Created
June 6, 2012 14:55
-
-
Save enricostano/2882371 to your computer and use it in GitHub Desktop.
Vocabulary entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace StanoSas\Bundle\TaxonomyBundle\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* StanoSas\Bundle\TaxonomyBundle\Entity\Vocabulary | |
* | |
* @ORM\Table() | |
* @ORM\Entity | |
*/ | |
class Vocabulary | |
{ | |
/** | |
* @var integer $id | |
* | |
* @ORM\Column(name="id", type="integer") | |
* @ORM\Id | |
* @ORM\GeneratedValue(strategy="AUTO") | |
*/ | |
private $id; | |
/** | |
* @var string $name | |
* | |
* @ORM\Column(name="name", type="string", length=255) | |
*/ | |
private $name; | |
/** | |
* @var string $slug | |
* | |
* @ORM\Column(name="slug", type="string", length=255) | |
*/ | |
private $slug; | |
/** | |
* @ORM\OneToMany(targetEntity="Term", mappedBy="vocabulary") | |
*/ | |
private $terms; | |
public function __construct() | |
{ | |
$this->terms = new ArrayCollection(); | |
} | |
/** | |
* Get id | |
* | |
* @return integer | |
*/ | |
public function getId() | |
{ | |
return $this->id; | |
} | |
/** | |
* Set name | |
* | |
* @param string $name | |
*/ | |
public function setName($name) | |
{ | |
$this->name = $name; | |
} | |
/** | |
* Get name | |
* | |
* @return string | |
*/ | |
public function getName() | |
{ | |
return $this->name; | |
} | |
/** | |
* Set slug | |
* | |
* @param string $slug | |
*/ | |
public function setSlug($slug) | |
{ | |
$this->slug = $slug; | |
} | |
/** | |
* Get slug | |
* | |
* @return string | |
*/ | |
public function getSlug() | |
{ | |
return $this->slug; | |
} | |
/** | |
* Add terms | |
* | |
* @param StanoSas\Bundle\TaxonomyBundle\Entity\Term $terms | |
*/ | |
public function addTerm(\StanoSas\Bundle\TaxonomyBundle\Entity\Term $terms) | |
{ | |
$this->terms[] = $terms; | |
} | |
/** | |
* Get terms | |
* | |
* @return Doctrine\Common\Collections\Collection | |
*/ | |
public function getTerms() | |
{ | |
return $this->terms; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment