src/Callbacks/BooleanValidatorCallback.php
/**
     * Will be invoked by the observer it has been registered for.
     *
     * @param string|null $attributeCode  The code of the attribute that has to be validated
     * @param string|null $attributeValue The attribute value to be validated
     *
     * @return mixed The modified value
     */
Will be invoked by the observer it has been registered for.
@param string|null $attributeCode  The code of the attribute that has to be validated
@param string|null $attributeValue The attribute value to be validated

@return mixed The modified value
Will be invoked by the observer it has been registered for . @param string|null $attributeCode The code of the attribute that has to be validated @param string|null $attributeValue The attribute value to be validated @return mixed The modified value
public function handle($attributeCode = null, $attributeValue = null)
    {
        $subject = $this->getSubject();
        if ($this->isNullable($optionValues = $subject->explode($attributeValue, '='))) {
            return;
        }
        $validations = $this->getValidations($attributeCode);
        foreach ($optionValues as $optionValue) {
            if (in_array(strtolower($optionValue), $validations)) {
                continue;
            }
            throw new \InvalidArgumentException(
                sprintf('Found invalid boolean value "%s" for attribute with code "%s"', $optionValue, $attributeCode)
            );
        }
    }
public function handle ( $ attributeCode = null , $ attributeValue = null ) { $ subject = $ this -> getSubject ( ) ; if ( $ this -> isNullable ( $ optionValues = $ subject -> explode ( $ attributeValue , '=' ) ) ) { return ; } $ validations = $ this -> getValidations ( $ attributeCode ) ; foreach ( $ optionValues as $ optionValue ) { if ( in_array ( strtolower ( $ optionValue ) , $ validations ) ) { continue ; } throw new \ InvalidArgumentException ( sprintf ( 'Found invalid boolean value "%s" for attribute with code "%s"' , $ optionValue , $ attributeCode ) ) ; } }
Will be invoked by the observer it has been registered for.
Will be invoked by the observer it has been registered for .
// load the subject instance // explode the additional attributes // load the validations // iterate over the attributes and append them to the row // query whether or not a boolean value has been specified // throw an exception if the value is NOT in the array