Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace VKF\Info\Domain\Model;
- use TYPO3\FLOW3\Annotations as FLOW3;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @FLOW3\Entity
- */
- class Article {
- /**
- * @FLOW3\Identity
- * @ORM\Id
- * @ORM\GeneratedValue
- * @var integer
- */
- protected $id;
- /**
- * @var string
- * @FLOW3\Validate(type="StringLength", options={"minimum"=3, "maximum"=50})
- */
- protected $name;
- /**
- * @var string
- */
- protected $description;
- /**
- * @var \VKF\Info\Domain\Model\ArticleGroup
- * @ORM\ManyToOne(inversedBy="articles")
- */
- protected $articleGroup;
- /**
- * @var \VKF\Info\Domain\Model\Branch
- * @ORM\ManyToOne(inversedBy="articles")
- */
- protected $branch;
- /**
- * @var \VKF\Info\Domain\Model\Contact
- * @ORM\ManyToOne(inversedBy="articles")
- */
- protected $contact;
- /**
- * @var \VKF\Info\Domain\Model\Customer
- * @ORM\ManyToOne(inversedBy="articles")
- */
- protected $customer;
- /**
- * @var \VKF\Info\Domain\Model\Department
- * @ORM\ManyToOne(inversedBy="articles")
- */
- protected $department;
- /**
- * @var \Doctrine\Common\Collections\Collection<\VKF\Info\Domain\Model\Material>
- * @ORM\ManyToMany(inversedBy="articles")
- */
- protected $materials;
- /**
- * @var \DateTime
- */
- protected $created;
- /**
- * @var \DateTime
- */
- protected $lastchange;
- /**
- * @var \Doctrine\Common\Collections\Collection<\VKF\Info\Domain\Model\ArticleImage>
- * @ORM\OneToMany(mappedBy="article")
- */
- protected $images;
- public function __construct() {
- $this->materials = new \Doctrine\Common\Collections\ArrayCollection();
- $this->created = new \DateTime();
- $this->lastchange = new \DateTime();
- $this->images = new \Doctrine\Common\Collections\ArrayCollection();
- }
- /**
- * @param integer $id
- * @return Article
- */
- public function setId($id) {
- $this->id = $id;
- return $this;
- }
- /**
- * @return integer
- */
- public function getId() {
- return $this->id;
- }
- /**
- * @param string $name
- * @return Article
- */
- public function setName($name) {
- $this->name = $name;
- return $this;
- }
- /**
- * @return string
- */
- public function getName() {
- return $this->name;
- }
- /**
- * @param type $description
- * @return \VKF\Info\Domain\Model\Article
- */
- public function setDescription($description) {
- $this->description = $description;
- return $this;
- }
- /**
- * @return string
- */
- public function getDescription() {
- return $this->description;
- }
- /**
- * @param \VKF\Info\Domain\Model\ArticleGroup $articleGroup
- * @return Article
- */
- public function setArticleGroup(\VKF\Info\Domain\Model\ArticleGroup $articleGroup) {
- $this->articleGroup = $articleGroup;
- return $this;
- }
- /**
- * @return \VKF\Info\Domain\Model\ArticleGroup
- */
- public function getArticleGroup() {
- return $this->articleGroup;
- }
- /**
- * @param \VKF\Info\Domain\Model\Branch $branches
- * @return Article
- */
- public function setBranch(\VKF\Info\Domain\Model\Branch $branch) {
- $this->branch = $branch;
- return $this;
- }
- /**
- * @return \VKF\Info\Domain\Model\Branch
- */
- public function getBranch() {
- return $this->branch;
- }
- /**
- * @param \VKF\Info\Domain\Model\Contact $contact
- * @return Article
- */
- public function setContact(\VKF\Info\Domain\Model\Contact $contact) {
- $this->contact = $contact;
- return $this;
- }
- /**
- * @return \VKF\Info\Domain\Model\Contact
- */
- public function getContact() {
- return $this->contact;
- }
- /**
- * @param \VKF\Info\Domain\Model\Customer $customer
- * @return Article
- */
- public function setCustomer(\VKF\Info\Domain\Model\Customer $customer) {
- $this->customer = $customer;
- return $this;
- }
- /**
- * @return \VKF\Info\Domain\Model\Customer
- */
- public function getCustomer() {
- return $this->customer;
- }
- /**
- * @param \VKF\Info\Domain\Model\Department $department
- * @return Article
- */
- public function setDepartment(\VKF\Info\Domain\Model\Department $department) {
- $this->department = $department;
- return $this;
- }
- /**
- * @return \VKF\Info\Domain\Model\Department
- */
- public function getDepartment() {
- return $this->department;
- }
- /**
- * @param \VKF\Info\Domain\Model\Material $materials
- * @return Article
- */
- public function addMaterial(\VKF\Info\Domain\Model\Material $material) {
- $material->addArticle($this);
- $this->materials->add($material);
- return $this;
- }
- public function setMaterials(\Doctrine\Common\Collections\ArrayCollection $materials) {
- $this->materials = $materials;
- return $this;
- }
- /**
- * @param \VKF\Info\Domain\Model\Material $material
- * @return \VKF\Info\Domain\Model\Article
- */
- public function removeMaterial(\VKF\Info\Domain\Model\Material $material) {
- $this->materials->removeElement($material);
- return $this;
- }
- /**
- * @return \Doctrine\Common\Collections\Collection<\VKF\Info\Domain\Model\Material>
- */
- public function getMaterials() {
- return $this->materials;
- }
- /**
- * @param \DateTime $created
- * @return \VKF\Info\Domain\Model\Article
- */
- public function setCreated(\DateTime $created) {
- $this->created = $created;
- return $this;
- }
- /**
- * @return \DateTime
- */
- public function getCreated() {
- return $this->created;
- }
- /**
- * @param \DateTime $lastchange
- * @return \VKF\Info\Domain\Model\Article
- */
- public function setLastChange(\DateTime $lastchange) {
- $this->lastchange = $lastchange;
- return $this;
- }
- /**
- * @return \DateTime
- */
- public function getLastChange() {
- return $this->lastchange;
- }
- /**
- * @param \VKF\Info\Domain\Model\ArticleImage $articleImage
- * @return \VKF\Info\Domain\Model\Article
- */
- public function addImage(\VKF\Info\Domain\Model\ArticleImage $articleImage) {
- $articleImage->setArticle($this);
- $this->images->add($articleImage);
- return $this;
- }
- /**
- * @param \VKF\Info\Domain\Model\ArticleImage $articleImage
- * @return \VKF\Info\Domain\Model\Article
- */
- public function removeImage(\VKF\Info\Domain\Model\ArticleImage $articleImage) {
- $this->images->removeElement($articleImage);
- return $this;
- }
- /**
- * @return \Doctrine\Common\Collections\Collection<\VKF\Info\Domain\Model\ArticleImage>
- */
- public function getImages() {
- return $this->images;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment