DDC117ArticleDetails.php 664B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. namespace Doctrine\Tests\Models\DDC117;
  3. /**
  4. * @Entity
  5. */
  6. class DDC117ArticleDetails
  7. {
  8. /**
  9. * @Id
  10. * @OneToOne(targetEntity="DDC117Article", inversedBy="details")
  11. * @JoinColumn(name="article_id", referencedColumnName="article_id")
  12. */
  13. private $article;
  14. /**
  15. * @Column(type="text")
  16. */
  17. private $text;
  18. public function __construct($article, $text)
  19. {
  20. $this->article = $article;
  21. $article->setDetails($this);
  22. $this->update($text);
  23. }
  24. public function update($text)
  25. {
  26. $this->text = $text;
  27. }
  28. public function getText()
  29. {
  30. return $this->text;
  31. }
  32. }