samizdam/PhamilyFramework

View on GitHub
src/Model/Anthroponym.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace Phamily\Framework\Model;

class Anthroponym implements AnthroponymInterface
{
    protected $id;

    protected $type;

    protected $value;

    public function __construct($type, $value)
    {
        $this->type = $type;
        $this->value = $value;
    }

    public function populate($data)
    {
        $data = (object) $data;
        $this->id = $data->id;
        $this->type = $data->type;
        $this->value = $data->value;

        return $this;
    }

    public function getId()
    {
        return $this->id;
    }

    public function getType()
    {
        return $this->type;
    }

    public function getValue()
    {
        return $this->value;
    }

    public function __toString()
    {
        return (string) $this->getValue();
    }
}