Вход Регистрация
Файл: symfony-2.7/src/Symfony/Component/Validator/Tests/Fixtures/Entity.php
Строк: 108
<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace SymfonyComponentValidatorTestsFixtures;

use 
SymfonyComponentValidatorConstraints as Assert;
use 
SymfonyComponentValidatorExecutionContextInterface;

/**
 * @SymfonyComponentValidatorTestsFixturesConstraintA
 * @AssertGroupSequence({"Foo", "Entity"})
 * @AssertCallback({"SymfonyComponentValidatorTestsFixturesCallbackClass", "callback"})
 */
class Entity extends EntityParent implements EntityInterface
{
    
/**
     * @AssertNotNull
     * @AssertRange(min=3)
     * @AssertAll({@AssertNotNull, @AssertRange(min=3)}),
     * @AssertAll(constraints={@AssertNotNull, @AssertRange(min=3)})
     * @AssertCollection(fields={
     *   "foo" = {@AssertNotNull, @AssertRange(min=3)},
     *   "bar" = @AssertRange(min=5)
     * })
     * @AssertChoice(choices={"A", "B"}, message="Must be one of %choices%")
     */
    
public $firstName;
    protected 
$lastName;
    public 
$reference;
    public 
$reference2;
    private 
$internal;
    public 
$data 'Overridden data';
    public 
$initialized false;

    public function 
__construct($internal null)
    {
        
$this->internal $internal;
    }

    public function 
getInternal()
    {
        return 
$this->internal.' from getter';
    }

    public function 
setLastName($lastName)
    {
        
$this->lastName $lastName;
    }

    
/**
     * @AssertNotNull
     */
    
public function getLastName()
    {
        return 
$this->lastName;
    }

    
/**
     * @AssertTrue
     */
    
public function isValid()
    {
        return 
'valid';
    }

    
/**
     * @AssertTrue
     */
    
public function hasPermissions()
    {
        return 
'permissions';
    }

    public function 
getData()
    {
        return 
'Overridden data';
    }

    
/**
     * @AssertCallback
     */
    
public function validateMe(ExecutionContextInterface $context)
    {
    }

    
/**
     * @AssertCallback
     */
    
public static function validateMeStatic($objectExecutionContextInterface $context)
    {
    }
}
Онлайн: 1
Реклама