diff --git a/src/AppBundle/Entity/LDraw/Category.php b/src/AppBundle/Entity/LDraw/Category.php index 549c804..10dda36 100644 --- a/src/AppBundle/Entity/LDraw/Category.php +++ b/src/AppBundle/Entity/LDraw/Category.php @@ -3,7 +3,7 @@ namespace AppBundle\Entity\LDraw; use AppBundle\Entity\Traits\IdentityTrait; -use AppBundle\Entity\Traits\NameTrait; +use AppBundle\Entity\Traits\UniqueNameTrait; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; @@ -17,7 +17,7 @@ use Doctrine\ORM\Mapping as ORM; class Category { use IdentityTrait; - use NameTrait; + use UniqueNameTrait; /** * @var Collection diff --git a/src/AppBundle/Entity/LDraw/Keyword.php b/src/AppBundle/Entity/LDraw/Keyword.php index 1a57071..85aeea3 100644 --- a/src/AppBundle/Entity/LDraw/Keyword.php +++ b/src/AppBundle/Entity/LDraw/Keyword.php @@ -3,7 +3,7 @@ namespace AppBundle\Entity\LDraw; use AppBundle\Entity\Traits\IdentityTrait; -use AppBundle\Entity\Traits\NameTrait; +use AppBundle\Entity\Traits\UniqueNameTrait; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\ORM\Mapping as ORM; @@ -16,7 +16,7 @@ use Doctrine\ORM\Mapping as ORM; class Keyword { use IdentityTrait; - use NameTrait; + use UniqueNameTrait; /** * @var ArrayCollection diff --git a/src/AppBundle/Entity/Traits/UniqueNameTrait.php b/src/AppBundle/Entity/Traits/UniqueNameTrait.php new file mode 100644 index 0000000..63c742d --- /dev/null +++ b/src/AppBundle/Entity/Traits/UniqueNameTrait.php @@ -0,0 +1,33 @@ +name; + } + + /** + * @param string $name + * + * @return mixed + */ + public function setName($name) + { + $this->name = $name; + + return $this; + } +}