News.php 807 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * File description
  4. *
  5. * @author Anatoly Marinescu <tolean@zingan.com>
  6. */
  7. namespace Tree\Fixture\Closure;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. use Doctrine\ORM\Mapping as ORM;
  10. /**
  11. * @ORM\Entity
  12. */
  13. class News
  14. {
  15. /**
  16. * @ORM\Id
  17. * @ORM\Column(name="id", type="integer")
  18. * @ORM\GeneratedValue(strategy="IDENTITY")
  19. */
  20. private $id;
  21. /**
  22. * @ORM\Column(name="title", type="string", length=64)
  23. */
  24. private $title;
  25. /**
  26. * @ORM\OneToOne(targetEntity="Tree\Fixture\Closure\Category", cascade={"persist"})
  27. * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
  28. */
  29. private $category;
  30. public function __construct($title, Category $category)
  31. {
  32. $this->title = $title;
  33. $this->category = $category;
  34. }
  35. }