<?php 

namespace NPS\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Adds name property to any entity
 * @author Lukas Korinek
 */
trait TNameProperty
{
    /**
     * @ORM\Column(type="string", name="name", length=250, nullable=true)
     * @var string
     */
    public $name;

    public function __set($name , $value)
    {
        if($name == 'name')
        {
            $this->name = ucfirst(trim($value));
        }
    }
}

