vendor/perfectneeds/content-multi-lang-bundle/Entity/DynamicContent.php line 12

Open in your IDE?
  1. <?php
  2. namespace PN\ContentBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\Validator\Constraints as Assert;
  5. /**
  6. * @ORM\Table(name="dynamic_content")
  7. * @ORM\Entity(repositoryClass="PN\ContentBundle\Repository\DynamicContentRepository")
  8. */
  9. class DynamicContent {
  10. /**
  11. * @var int
  12. *
  13. * @ORM\Column(name="id", type="integer")
  14. * @ORM\Id
  15. * @ORM\GeneratedValue(strategy="AUTO")
  16. */
  17. private $id;
  18. /**
  19. * @var string
  20. * @Assert\NotNull()
  21. * @ORM\Column(name="title", type="string", length=50)
  22. */
  23. protected $title;
  24. /**
  25. * @ORM\OneToMany(targetEntity="DynamicContentAttribute", mappedBy="dynamicContent", cascade={"all"})
  26. */
  27. protected $dynamicContentAttributes;
  28. /**
  29. * Constructor
  30. */
  31. public function __construct() {
  32. $this->dynamicContentAttributes = new \Doctrine\Common\Collections\ArrayCollection();
  33. }
  34. /**
  35. * Get id
  36. *
  37. * @return integer
  38. */
  39. public function getId() {
  40. return $this->id;
  41. }
  42. /**
  43. * Set title
  44. *
  45. * @param string $title
  46. *
  47. * @return DynamicContent
  48. */
  49. public function setTitle($title) {
  50. $this->title = $title;
  51. return $this;
  52. }
  53. /**
  54. * Get title
  55. *
  56. * @return string
  57. */
  58. public function getTitle() {
  59. return $this->title;
  60. }
  61. /**
  62. * Add dynamicContentAttribute
  63. *
  64. * @param \PN\ContentBundle\Entity\DynamicContentAttribute $dynamicContentAttribute
  65. *
  66. * @return DynamicContent
  67. */
  68. public function addDynamicContentAttribute(\PN\ContentBundle\Entity\DynamicContentAttribute $dynamicContentAttribute) {
  69. $this->dynamicContentAttributes[] = $dynamicContentAttribute;
  70. return $this;
  71. }
  72. /**
  73. * Remove dynamicContentAttribute
  74. *
  75. * @param \PN\ContentBundle\Entity\DynamicContentAttribute $dynamicContentAttribute
  76. */
  77. public function removeDynamicContentAttribute(\PN\ContentBundle\Entity\DynamicContentAttribute $dynamicContentAttribute) {
  78. $this->dynamicContentAttributes->removeElement($dynamicContentAttribute);
  79. }
  80. /**
  81. * Get dynamicContentAttributes
  82. *
  83. * @return \Doctrine\Common\Collections\Collection
  84. */
  85. public function getDynamicContentAttributes() {
  86. return $this->dynamicContentAttributes;
  87. }
  88. }