src/Validator.php
public function on($name, $child = null)
    {
        $reflection = $this->entity->getReflection();

        if (!$reflection->hasProperty($name)) {
            throw new Exception\InvalidArgumentException(
                "Unknown property '" . $name . "'!"
            );
        }
        $this->property = $reflection->getProperty($name);

        if ($this->property->hasOption(Computed::KEY)) {
            throw new Exception\InvalidArgumentException(
                "Validation can not be used on computed property!"
            );
        }
        if ($child
            && (!$this->property->getType() === Entity\Reflection\Property::TYPE_ENTITY
            && !$this->property->getType() === Entity\Reflection\Property::TYPE_COLLECTION)
        ) {
            throw new Exception\InvalidArgumentException(
                "Child validation can be used only on entities and collections!"
            );
        }
        $this->child = $child;

        return $this->endCondition();
    }
public function on($name, $child = null)
    {
        $reflection = $this->entity->getReflection();

        if (!$reflection->hasProperty($name)) {
            throw new Exception\InvalidArgumentException(
                "Unknown property '" . $name . "'!"
            );
        }
        $this->property = $reflection->getProperty($name);

        if ($this->property->hasOption(Computed::KEY)) {
            throw new Exception\InvalidArgumentException(
                "Validation can not be used on computed property!"
            );
        }
        if ($child
            && (!$this->property->getType() === Entity\Reflection\Property::TYPE_ENTITY
            && !$this->property->getType() === Entity\Reflection\Property::TYPE_COLLECTION)
        ) {
            throw new Exception\InvalidArgumentException(
                "Child validation can be used only on entities and collections!"
            );
        }
        $this->child = $child;

        return $this->endCondition();
    }
public function on ( $ name , $ child = null ) { $ reflection = $ this -> entity -> getReflection ( ) ; if ( ! $ reflection -> hasProperty ( $ name ) ) { throw new Exception \ InvalidArgumentException ( "Unknown property '" . $ name . "'!" ) ; } $ this -> property = $ reflection -> getProperty ( $ name ) ; if ( $ this -> property -> hasOption ( Computed :: KEY ) ) { throw new Exception \ InvalidArgumentException ( "Validation can not be used on computed property!" ) ; } if ( $ child && ( ! $ this -> property -> getType ( ) === Entity \ Reflection \ Property :: TYPE_ENTITY && ! $ this -> property -> getType ( ) === Entity \ Reflection \ Property :: TYPE_COLLECTION ) ) { throw new Exception \ InvalidArgumentException ( "Child validation can be used only on entities and collections!" ) ; } $ this -> child = $ child ; return $ this -> endCondition ( ) ; }
Set property which is validation configured on

@param string $name  Property name in entity
@param string $child Child property name

@return \UniMapper\Validator

@throws \Exception
Set property which is validation configured on