library/Garp/Model/Validator/MinLength.php
public function validate(array $data, Garp_Model_Db $model, $onlyIfAvailable = true) {
        $theFields = $this->_fields;
        $applicableFields = array_keys(array_get_subset($data, array_keys($theFields)));

        $tooShortFields = array_filter(
            $applicableFields,
            function ($field) use ($theFields, $data) {
                return !is_null($data[$field]) && strlen($data[$field]) < $theFields[$field];
            }
        );

        if (count($tooShortFields)) {
            $first = current($tooShortFields);
            throw new Garp_Model_Validator_Exception(
                Garp_Util_String::interpolate(
                    __(self::ERROR_MESSAGE),
                    array(
                        'value' => $first,
                        'min' => $theFields[$first]
                    )
                )
            );
        }
    }
public function validate(array $data, Garp_Model_Db $model, $onlyIfAvailable = true) {
        $theFields = $this->_fields;
        $applicableFields = array_keys(array_get_subset($data, array_keys($theFields)));

        $tooShortFields = array_filter(
            $applicableFields,
            function ($field) use ($theFields, $data) {
                return !is_null($data[$field]) && strlen($data[$field]) < $theFields[$field];
            }
        );

        if (count($tooShortFields)) {
            $first = current($tooShortFields);
            throw new Garp_Model_Validator_Exception(
                Garp_Util_String::interpolate(
                    __(self::ERROR_MESSAGE),
                    array(
                        'value' => $first,
                        'min' => $theFields[$first]
                    )
                )
            );
        }
    }
public function validate ( array $ data , Garp_Model_Db $ model , $ onlyIfAvailable = true ) { $ theFields = $ this -> _fields ; $ applicableFields = array_keys ( array_get_subset ( $ data , array_keys ( $ theFields ) ) ) ; $ tooShortFields = array_filter ( $ applicableFields , function ( $ field ) use ( $ theFields , $ data ) { return ! is_null ( $ data [ $ field ] ) && strlen ( $ data [ $ field ] ) < $ theFields [ $ field ] ; } ) ; if ( count ( $ tooShortFields ) ) { $ first = current ( $ tooShortFields ) ; throw new Garp_Model_Validator_Exception ( Garp_Util_String :: interpolate ( __ ( self :: ERROR_MESSAGE ) , array ( 'value' => $ first , 'min' => $ theFields [ $ first ] ) ) ) ; } }
Validate wether the given columns are long enough

@param array $data The data to validate
@param Garp_Model_Db $model
@param bool $onlyIfAvailable Wether to skip validation on fields that are not in the array
@return void
@throws Garp_Model_Validator_Exception
Validate wether the given columns are long enough