public function validate(Validator $validator)
    {
        $handler = $this->get('metadata')->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->validate($this, $validator);
        }
    }
public function validate(Validator $validator)
    {
        $handler = $this->get('metadata')->get('handler');
        if (class_exists($handler)) {
            $handler = new $handler();

            return $handler->validate($this, $validator);
        }
    }
public function validate ( Validator $ validator ) { $ handler = $ this -> get ( 'metadata' ) -> get ( 'handler' ) ; if ( class_exists ( $ handler ) ) { $ handler = new $ handler ( ) ; return $ handler -> validate ( $ this , $ validator ) ; } }
Triggers entity's validate callback.

@param \Cake\Validation\Validator $validator The validator object to be
altered.
@return bool|null
Triggers entity s validate callback .