public function validate($entity)
    {
        //reset the error message
        $context = $this->getCommandContext();
        $context->entity = $entity;
        if ($entity->isValidatable()) {
            $entity->resetErrors();
        }
        $result = $this->getCommandChain()->run('on.validate', $context);

        return $result !== false;
    }
public function validate($entity)
    {
        //reset the error message
        $context = $this->getCommandContext();
        $context->entity = $entity;
        if ($entity->isValidatable()) {
            $entity->resetErrors();
        }
        $result = $this->getCommandChain()->run('on.validate', $context);

        return $result !== false;
    }
public function validate ( $ entity ) { //reset the error message $ context = $ this -> getCommandContext ( ) ; $ context -> entity = $ entity ; if ( $ entity -> isValidatable ( ) ) { $ entity -> resetErrors ( ) ; } $ result = $ this -> getCommandChain ( ) -> run ( 'on.validate' , $ context ) ; return $ result !== false ; }
Validates an entity.

@param AnDomainEntityAbstract $entity The entity to be validatd

@return bool
Validates an entity .