protected function _validateScope(AnConfig $config)
    {
        $property = $config->property;
        $value = $config->value;
        $entity = $config->entity;
        $options = AnConfig::unbox($config->options);

        if (!in_array($value, $options)) {
            $entity->addError(array(
                'message' => $property->getName().' must be one of the value of '.implode($options, ','),
                'code' => AnError::OUT_OF_SCOPE,
                'key' => $property->getName(),
                'scope' => $options,
            ));

            return false;
        }

        return true;
    }
protected function _validateScope(AnConfig $config)
    {
        $property = $config->property;
        $value = $config->value;
        $entity = $config->entity;
        $options = AnConfig::unbox($config->options);

        if (!in_array($value, $options)) {
            $entity->addError(array(
                'message' => $property->getName().' must be one of the value of '.implode($options, ','),
                'code' => AnError::OUT_OF_SCOPE,
                'key' => $property->getName(),
                'scope' => $options,
            ));

            return false;
        }

        return true;
    }
protected function _validateScope ( AnConfig $ config ) { $ property = $ config -> property ; $ value = $ config -> value ; $ entity = $ config -> entity ; $ options = AnConfig :: unbox ( $ config -> options ) ; if ( ! in_array ( $ value , $ options ) ) { $ entity -> addError ( array ( 'message' => $ property -> getName ( ) . ' must be one of the value of ' . implode ( $ options , ',' ) , 'code' => AnError :: OUT_OF_SCOPE , 'key' => $ property -> getName ( ) , 'scope' => $ options , ) ) ; return false ; } return true ; }
Validate scope of a property.

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

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