Entity.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace Symfony\Tests\Component\Validator\Fixtures;
  3. require_once __DIR__.'/EntityParent.php';
  4. require_once __DIR__.'/EntityInterface.php';
  5. /**
  6. * @Symfony\Tests\Component\Validator\Fixtures\ConstraintA
  7. * @assert:GroupSequence({"Foo", "Entity"})
  8. */
  9. class Entity extends EntityParent implements EntityInterface
  10. {
  11. /**
  12. * @assert:NotNull
  13. * @assert:Min(3)
  14. * @assert:Set({
  15. * @assert:All({@assert:NotNull, @assert:Min(3)}),
  16. * @assert:All(constraints={@assert:NotNull, @assert:Min(3)})
  17. * })
  18. * @assert:Collection(fields={
  19. * "foo" = {@assert:NotNull, @assert:Min(3)},
  20. * "bar" = @assert:Min(5)
  21. * })
  22. * @assert:Choice(choices={"A", "B"}, message="Must be one of %choices%")
  23. */
  24. protected $firstName;
  25. protected $lastName;
  26. public $reference;
  27. private $internal;
  28. public function __construct($internal = null)
  29. {
  30. $this->internal = $internal;
  31. }
  32. public function getInternal()
  33. {
  34. return $this->internal . ' from getter';
  35. }
  36. /**
  37. * @assert:NotNull
  38. */
  39. public function getLastName()
  40. {
  41. return $this->lastName;
  42. }
  43. }