public function validate($data)
    {
        try {
            /** @var \tao_helpers_form_Validator[] $validators */
            $validators = ValidationRuleRegistry::getRegistry()->getValidators($this->getPropertyToWrite());
        } catch (\common_exception_NotFound $e) {
            throw new MetadataWriterException($e->getMessage());
        }

        $validated = true;
        foreach ($validators as $validator) {
            if (! $validator->evaluate($data)) {
                $validated = false;
                \common_Logger::d('Unable to validate value for property "' . $this->getPropertyToWrite()->getUri() . '"' .
                    ' against validator "' . $validator->getName(). '" : "' . $validator->getMessage() . '".');
            }
        }
        return $validated;
    }
public function validate($data)
    {
        try {
            /** @var \tao_helpers_form_Validator[] $validators */
            $validators = ValidationRuleRegistry::getRegistry()->getValidators($this->getPropertyToWrite());
        } catch (\common_exception_NotFound $e) {
            throw new MetadataWriterException($e->getMessage());
        }

        $validated = true;
        foreach ($validators as $validator) {
            if (! $validator->evaluate($data)) {
                $validated = false;
                \common_Logger::d('Unable to validate value for property "' . $this->getPropertyToWrite()->getUri() . '"' .
                    ' against validator "' . $validator->getName(). '" : "' . $validator->getMessage() . '".');
            }
        }
        return $validated;
    }
public function validate ( $ data ) { try { /** @var \tao_helpers_form_Validator[] $validators */ $ validators = ValidationRuleRegistry :: getRegistry ( ) -> getValidators ( $ this -> getPropertyToWrite ( ) ) ; } catch ( \ common_exception_NotFound $ e ) { throw new MetadataWriterException ( $ e -> getMessage ( ) ) ; } $ validated = true ; foreach ( $ validators as $ validator ) { if ( ! $ validator -> evaluate ( $ data ) ) { $ validated = false ; \ common_Logger :: d ( 'Unable to validate value for property "' . $ this -> getPropertyToWrite ( ) -> getUri ( ) . '"' . ' against validator "' . $ validator -> getName ( ) . '" : "' . $ validator -> getMessage ( ) . '".' ) ; } } return $ validated ; }
Validate if value is writable by current writer
Validation is handle by property validators

@param $data
@return bool
@throws MetadataWriterException
Validate if value is writable by current writer Validation is handle by property validators