app/Plugin/Recipe/Entity/Material.php line 15

Open in your IDE?
  1. <?php
  2. namespace Plugin\Recipe\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. if (!class_exists('\Plugin\Recipe\Entity\Material'false)) {
  5.     /**
  6.      * Material
  7.      *
  8.      * @ORM\Table(name="plg_recipe_material")
  9.      * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255)
  10.      * @ORM\Entity(repositoryClass="Plugin\Recipe\Repository\MaterialRepository")
  11.      */
  12.     class Material
  13.     {
  14.         /**
  15.          * @var int
  16.          *
  17.          * @ORM\Column(name="id", type="integer", options={"unsigned":true})
  18.          * @ORM\Id
  19.          * @ORM\GeneratedValue(strategy="IDENTITY")
  20.          */
  21.         private $id;
  22.         /**
  23.          * @var string
  24.          *
  25.          * @ORM\Column(name="name", type="string", length=255)
  26.          */
  27.         private $name;
  28.         /**
  29.          * @var int
  30.          *
  31.          * @ORM\Column(name="sort_no", type="integer", nullable=true)
  32.          */
  33.         private $sort_no;
  34.         /**
  35.          * @var \Doctrine\Common\Collections\Collection
  36.          *
  37.          * @ORM\OneToMany(targetEntity="Plugin\Recipe\Entity\RecipeMaterial", mappedBy="Material")
  38.          */
  39.         protected $RecipeMaterial;
  40.         /**
  41.          * Constructor
  42.          */
  43.         public function __construct()
  44.         {
  45.             $this->RecipeMaterial = new \Doctrine\Common\Collections\ArrayCollection();
  46.         }
  47.         /**
  48.          * @return int
  49.          */
  50.         public function getId()
  51.         {
  52.             return $this->id;
  53.         }
  54.         /**
  55.          * @return string
  56.          */
  57.         public function getName()
  58.         {
  59.             return $this->name;
  60.         }
  61.         /**
  62.          * @param string $name
  63.          *
  64.          * @return $this;
  65.          */
  66.         public function setName($name)
  67.         {
  68.             $this->name $name;
  69.             return $this;
  70.         }
  71.         /**
  72.          * Get rank.
  73.          *
  74.          * @return int
  75.          */
  76.         public function getSortno()
  77.         {
  78.           return $this->sort_no;
  79.         }
  80.         /**
  81.          * Set rank.
  82.          *
  83.          * @param int $sort_no
  84.          *
  85.          * @return $this
  86.          */
  87.         public function setSortno($sort_no)
  88.         {
  89.           $this->sort_no $sort_no;
  90.           return $this;
  91.         }
  92.         /**
  93.          * Add recipeMaterial.
  94.          *
  95.          * @param \Plugin\Recipe\Entity\RecipeMaterial $recipeMaterial
  96.          *
  97.          * @return Material
  98.          */
  99.         public function addRecipeMaterial(RecipeMaterial $recipeMaterial)
  100.         {
  101.             $this->RecipeMaterial[] = $recipeMaterial;
  102.             return $this;
  103.         }
  104.         /**
  105.          * Remove recipeMaterial.
  106.          *
  107.          * @param \Plugin\Recipe\Entity\RecipeMaterial $recipeMaterial
  108.          *
  109.          * @return boolean TRUE if this collection contained the specified element, FALSE otherwise.
  110.          */
  111.         public function removeRecipeMaterial(RecipeMaterial $recipeMaterial)
  112.         {
  113.             return $this->RecipeMaterial->removeElement($recipeMaterial);
  114.         }
  115.         /**
  116.          * Get recipeMaterial.
  117.          *
  118.          * @return \Doctrine\Common\Collections\Collection
  119.          */
  120.         public function getRecipeMaterial()
  121.         {
  122.             return $this->RecipeMaterial;
  123.         }
  124.     }
  125. }