<?php


namespace App\Model\Entities;

use App\Model\Entities\Interfaces\IBaseNamedRecord;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\MappedSuperclass
 */
abstract class BaseNamedRecord extends BaseRecord implements IBaseNamedRecord
{
    /**
     * @ORM\Column(type="string")
     */
    protected $name;

    /**
     * @return string
     */
    public function getName() : string
    {
        return $this->name;
    }

    /**
     * @param string $name
     */
    public function setName(string $name)
    {
        $this->validateNotNullValue($name);

        $this->name = $name;
    }
}