This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Components/Validator/Fixtures/Entity.php

53 lines
950 B
PHP
Raw Normal View History

<?php
namespace Symfony\Tests\Components\Validator\Fixtures;
require_once __DIR__.'/EntityParent.php';
require_once __DIR__.'/EntityInterface.php';
/**
* @Validation({
* @NotNull,
* @Min(3),
* @Choice({"A", "B"}),
* @All({@NotNull, @Min(3)}),
* @All(constraints={@NotNull, @Min(3)}),
* @Collection(fields={
* "foo" = {@NotNull, @Min(3)},
* "bar" = @Min(5)
* })
* })
*/
class Entity extends EntityParent implements EntityInterface
{
/**
* @Validation({
* @Choice(choices={"A", "B"}, message="Must be one of %choices%")
* })
*/
protected $firstName;
protected $lastName;
private $internal;
public function __construct($internal = null)
{
$this->internal = $internal;
}
public function getInternal()
{
return $this->internal . ' from getter';
}
/**
* @Validation({
* @NotNull
* })
*/
public function getLastName()
{
return $this->lastName;
}
}