protected function _validateFormat(AnConfig $config)
    {
        $property = $config->property;
        $value = $config->value;
        $entity = $config->entity;
        $filter = $config->options;

        if (!empty($value) && $property->isAttribute() && $property->isScalar()) {
            if ($this->getFilter($filter)->validate($value) === false) {
                $entity->addError(array(
                    'message' => $property->getName().' must have the format of '.$filter,
                    'code' => AnError::INVALID_FORMAT,
                    'key' => $property->getName(),
                    'format' => $filter,
                ));

                return false;
            }
        }

        return true;
    }
protected function _validateFormat(AnConfig $config)
    {
        $property = $config->property;
        $value = $config->value;
        $entity = $config->entity;
        $filter = $config->options;

        if (!empty($value) && $property->isAttribute() && $property->isScalar()) {
            if ($this->getFilter($filter)->validate($value) === false) {
                $entity->addError(array(
                    'message' => $property->getName().' must have the format of '.$filter,
                    'code' => AnError::INVALID_FORMAT,
                    'key' => $property->getName(),
                    'format' => $filter,
                ));

                return false;
            }
        }

        return true;
    }
protected function _validateFormat ( AnConfig $ config ) { $ property = $ config -> property ; $ value = $ config -> value ; $ entity = $ config -> entity ; $ filter = $ config -> options ; if ( ! empty ( $ value ) && $ property -> isAttribute ( ) && $ property -> isScalar ( ) ) { if ( $ this -> getFilter ( $ filter ) -> validate ( $ value ) === false ) { $ entity -> addError ( array ( 'message' => $ property -> getName ( ) . ' must have the format of ' . $ filter , 'code' => AnError :: INVALID_FORMAT , 'key' => $ property -> getName ( ) , 'format' => $ filter , ) ) ; return false ; } } return true ; }
Validate format of a property using a KFilter.

@param AnConfig $config Configuration. Contains keys property,value,entity

@return bool Return true if it's valid or false if it's not
Validate format of a property using a KFilter .