Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace FermierMalin\Bundle\GrowerBundle\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Entity (repositoryClass="FermierMalin\Bundle\GrowerBundle\Entity\CategoryGrowerRepository")
- * @ORM\Table (name="category_grower")
- */
- class CategoryGrower
- {
- public function __construct() {
- $this->growers = new ArrayCollection();
- }
- public function __toString()
- {
- return $this->getLabel();
- }
- /**
- * @ORM\Id
- * @ORM\Column(type="integer")
- * @ORM\GeneratedValue(strategy="AUTO")
- */
- private $id;
- /**
- * @ORM\Column(name="label", type="string")
- */
- private $label;
- /**
- * @ORM\Column(name="parent", type="string")
- */
- private $parent;
- /**
- * @ORM\OneToMany(targetEntity="Grower", mappedBy="category")
- **/
- private $growers;
- /**
- * Get id
- *
- * @return integer
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set label
- *
- * @param string $label
- * @return CategoryGrower
- */
- public function setLabel($label)
- {
- $this->label = $label;
- return $this;
- }
- /**
- * Get label
- *
- * @return string
- */
- public function getLabel()
- {
- return $this->label;
- }
- /**
- * Set parent
- *
- * @param string $parent
- * @return CategoryGrower
- */
- public function setParent($parent)
- {
- $this->parent = $parent;
- return $this;
- }
- /**
- * Get parent
- *
- * @return string
- */
- public function getParent()
- {
- return $this->parent;
- }
- /**
- * Add growers
- *
- * @param Grower $growers
- * @return CategoryGrower
- */
- public function addGrower(Grower $growers)
- {
- $this->growers[] = $growers;
- return $this;
- }
- /**
- * Remove growers
- *
- * @param Grower $growers
- */
- public function removeGrower(Grower $growers)
- {
- $this->growers->removeElement($growers);
- }
- /**
- * Get growers
- *
- * @return Collection
- */
- public function getGrowers()
- {
- return $this->growers;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement