SingleAssociationToIntIdEntity.php 887 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bridge\Doctrine\Tests\Fixtures;
  11. use Doctrine\ORM\Mapping\Column;
  12. use Doctrine\ORM\Mapping\Entity;
  13. use Doctrine\ORM\Mapping\Id;
  14. use Doctrine\ORM\Mapping\OneToOne;
  15. /** @Entity */
  16. class SingleAssociationToIntIdEntity
  17. {
  18. /** @Id @OneToOne(targetEntity="SingleIntIdNoToStringEntity", cascade={"ALL"}) */
  19. protected $entity;
  20. /** @Column(type="string", nullable=true) */
  21. public $name;
  22. public function __construct(SingleIntIdNoToStringEntity $entity, $name)
  23. {
  24. $this->entity = $entity;
  25. $this->name = $name;
  26. }
  27. public function __toString()
  28. {
  29. return (string) $this->name;
  30. }
  31. }