Guest User

ArticleModel

a guest
Aug 10th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 6.29 KB | None | 0 0
  1. <?php
  2. namespace VKF\Info\Domain\Model;
  3.  
  4. use TYPO3\FLOW3\Annotations as FLOW3;
  5. use Doctrine\ORM\Mapping as ORM;
  6.  
  7. /**
  8.  * @FLOW3\Entity
  9.  */
  10. class Article {
  11.  
  12.     /**
  13.      * @FLOW3\Identity
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @var integer
  17.      */
  18.     protected $id;
  19.  
  20.     /**
  21.      * @var string
  22.      * @FLOW3\Validate(type="StringLength", options={"minimum"=3, "maximum"=50})
  23.      */
  24.     protected $name;
  25.  
  26.     /**
  27.      * @var string
  28.      */
  29.     protected $description;
  30.  
  31.     /**
  32.      * @var \VKF\Info\Domain\Model\ArticleGroup
  33.      * @ORM\ManyToOne(inversedBy="articles")
  34.      */
  35.     protected $articleGroup;
  36.  
  37.     /**
  38.      * @var \VKF\Info\Domain\Model\Branch
  39.      * @ORM\ManyToOne(inversedBy="articles")
  40.      */
  41.     protected $branch;
  42.  
  43.     /**
  44.      * @var \VKF\Info\Domain\Model\Contact
  45.      * @ORM\ManyToOne(inversedBy="articles")
  46.      */
  47.     protected $contact;
  48.  
  49.     /**
  50.      * @var \VKF\Info\Domain\Model\Customer
  51.      * @ORM\ManyToOne(inversedBy="articles")
  52.      */
  53.     protected $customer;
  54.  
  55.     /**
  56.      * @var \VKF\Info\Domain\Model\Department
  57.      * @ORM\ManyToOne(inversedBy="articles")
  58.      */
  59.     protected $department;
  60.  
  61.     /**
  62.      * @var \Doctrine\Common\Collections\Collection<\VKF\Info\Domain\Model\Material>
  63.      * @ORM\ManyToMany(inversedBy="articles")
  64.      */
  65.     protected $materials;
  66.  
  67.     /**
  68.      * @var \DateTime
  69.      */
  70.     protected $created;
  71.  
  72.     /**
  73.      * @var \DateTime
  74.      */
  75.     protected $lastchange;
  76.  
  77.     /**
  78.      * @var \Doctrine\Common\Collections\Collection<\VKF\Info\Domain\Model\ArticleImage>
  79.      * @ORM\OneToMany(mappedBy="article")
  80.      */
  81.     protected $images;
  82.  
  83.     public function __construct() {
  84.         $this->materials = new \Doctrine\Common\Collections\ArrayCollection();
  85.         $this->created = new \DateTime();
  86.         $this->lastchange = new \DateTime();
  87.         $this->images = new \Doctrine\Common\Collections\ArrayCollection();
  88.     }
  89.  
  90.     /**
  91.      * @param integer $id
  92.      * @return Article
  93.      */
  94.     public function setId($id) {
  95.         $this->id = $id;
  96.         return $this;
  97.     }
  98.  
  99.     /**
  100.      * @return integer
  101.      */
  102.     public function getId() {
  103.         return $this->id;
  104.     }
  105.  
  106.     /**
  107.      * @param string $name
  108.      * @return Article
  109.      */
  110.     public function setName($name) {
  111.         $this->name = $name;
  112.         return $this;
  113.     }
  114.  
  115.     /**
  116.      * @return string
  117.      */
  118.     public function getName() {
  119.         return $this->name;
  120.     }
  121.  
  122.     /**
  123.      * @param type $description
  124.      * @return \VKF\Info\Domain\Model\Article
  125.      */
  126.     public function setDescription($description) {
  127.         $this->description = $description;
  128.         return $this;
  129.     }
  130.  
  131.     /**
  132.      * @return string
  133.      */
  134.     public function getDescription() {
  135.         return $this->description;
  136.     }
  137.  
  138.     /**
  139.      * @param \VKF\Info\Domain\Model\ArticleGroup $articleGroup
  140.      * @return Article
  141.      */
  142.     public function setArticleGroup(\VKF\Info\Domain\Model\ArticleGroup $articleGroup) {
  143.         $this->articleGroup = $articleGroup;
  144.         return $this;
  145.     }
  146.  
  147.     /**
  148.      * @return \VKF\Info\Domain\Model\ArticleGroup
  149.      */
  150.     public function getArticleGroup() {
  151.         return $this->articleGroup;
  152.     }
  153.  
  154.     /**
  155.      * @param \VKF\Info\Domain\Model\Branch $branches
  156.      * @return Article
  157.      */
  158.     public function setBranch(\VKF\Info\Domain\Model\Branch $branch) {
  159.         $this->branch = $branch;
  160.         return $this;
  161.     }
  162.  
  163.     /**
  164.      * @return \VKF\Info\Domain\Model\Branch
  165.      */
  166.     public function getBranch() {
  167.         return $this->branch;
  168.     }
  169.  
  170.     /**
  171.      * @param \VKF\Info\Domain\Model\Contact $contact
  172.      * @return Article
  173.      */
  174.     public function setContact(\VKF\Info\Domain\Model\Contact $contact) {
  175.         $this->contact = $contact;
  176.         return $this;
  177.     }
  178.  
  179.     /**
  180.      * @return \VKF\Info\Domain\Model\Contact
  181.      */
  182.     public function getContact() {
  183.         return $this->contact;
  184.     }
  185.  
  186.     /**
  187.      * @param \VKF\Info\Domain\Model\Customer $customer
  188.      * @return Article
  189.      */
  190.     public function setCustomer(\VKF\Info\Domain\Model\Customer $customer) {
  191.         $this->customer = $customer;
  192.         return $this;
  193.     }
  194.  
  195.     /**
  196.      * @return \VKF\Info\Domain\Model\Customer
  197.      */
  198.     public function getCustomer() {
  199.         return $this->customer;
  200.     }
  201.  
  202.     /**
  203.      * @param \VKF\Info\Domain\Model\Department $department
  204.      * @return Article
  205.      */
  206.     public function setDepartment(\VKF\Info\Domain\Model\Department $department) {
  207.         $this->department = $department;
  208.         return $this;
  209.     }
  210.  
  211.     /**
  212.      * @return \VKF\Info\Domain\Model\Department
  213.      */
  214.     public function getDepartment() {
  215.         return $this->department;
  216.     }
  217.  
  218.     /**
  219.      * @param \VKF\Info\Domain\Model\Material $materials
  220.      * @return Article
  221.      */
  222.     public function addMaterial(\VKF\Info\Domain\Model\Material $material) {
  223.         $material->addArticle($this);
  224.         $this->materials->add($material);
  225.         return $this;
  226.     }
  227.  
  228.     public function setMaterials(\Doctrine\Common\Collections\ArrayCollection $materials) {
  229.         $this->materials = $materials;
  230.         return $this;
  231.     }
  232.  
  233.     /**
  234.      * @param \VKF\Info\Domain\Model\Material $material
  235.      * @return \VKF\Info\Domain\Model\Article
  236.      */
  237.     public function removeMaterial(\VKF\Info\Domain\Model\Material $material) {
  238.         $this->materials->removeElement($material);
  239.         return $this;
  240.     }
  241.  
  242.     /**
  243.      * @return \Doctrine\Common\Collections\Collection<\VKF\Info\Domain\Model\Material>
  244.      */
  245.     public function getMaterials() {
  246.         return $this->materials;
  247.     }
  248.  
  249.     /**
  250.      * @param \DateTime $created
  251.      * @return \VKF\Info\Domain\Model\Article
  252.      */
  253.     public function setCreated(\DateTime $created) {
  254.         $this->created = $created;
  255.         return $this;
  256.     }
  257.  
  258.     /**
  259.      * @return \DateTime
  260.      */
  261.     public function getCreated() {
  262.         return $this->created;
  263.     }
  264.  
  265.     /**
  266.      * @param \DateTime $lastchange
  267.      * @return \VKF\Info\Domain\Model\Article
  268.      */
  269.     public function setLastChange(\DateTime $lastchange) {
  270.         $this->lastchange = $lastchange;
  271.         return $this;
  272.     }
  273.  
  274.     /**
  275.      * @return \DateTime
  276.      */
  277.     public function getLastChange() {
  278.         return $this->lastchange;
  279.     }
  280.  
  281.     /**
  282.      * @param \VKF\Info\Domain\Model\ArticleImage $articleImage
  283.      * @return \VKF\Info\Domain\Model\Article
  284.      */
  285.     public function addImage(\VKF\Info\Domain\Model\ArticleImage $articleImage) {
  286.         $articleImage->setArticle($this);
  287.         $this->images->add($articleImage);
  288.         return $this;
  289.     }
  290.  
  291.     /**
  292.      * @param \VKF\Info\Domain\Model\ArticleImage $articleImage
  293.      * @return \VKF\Info\Domain\Model\Article
  294.      */
  295.     public function removeImage(\VKF\Info\Domain\Model\ArticleImage $articleImage) {
  296.         $this->images->removeElement($articleImage);
  297.         return $this;
  298.     }
  299.  
  300.     /**
  301.      * @return \Doctrine\Common\Collections\Collection<\VKF\Info\Domain\Model\ArticleImage>
  302.      */
  303.     public function getImages() {
  304.         return $this->images;
  305.     }
  306.  
  307. }
  308.  
  309. ?>
Advertisement
Add Comment
Please, Sign In to add comment