public function applyFilters($value, $rules = array())
    {
        $valueTO = $this->valueTO->forge($value);
        // loop through all the rules to validate $value.
        foreach ($rules as $rule => $parameter) {
            // skip rules with option as FALSE.
            if ($parameter === false) {
                continue;
            }
            $this->filter->apply($rule, $valueTO, $parameter);

            // loop break.
            if ($valueTO->getBreak()) {
                break;
            }
        }

        return $valueTO;
    }
public function applyFilters($value, $rules = array())
    {
        $valueTO = $this->valueTO->forge($value);
        // loop through all the rules to validate $value.
        foreach ($rules as $rule => $parameter) {
            // skip rules with option as FALSE.
            if ($parameter === false) {
                continue;
            }
            $this->filter->apply($rule, $valueTO, $parameter);

            // loop break.
            if ($valueTO->getBreak()) {
                break;
            }
        }

        return $valueTO;
    }
public function applyFilters ( $ value , $ rules = array ( ) ) { $ valueTO = $ this -> valueTO -> forge ( $ value ) ; // loop through all the rules to validate $value. foreach ( $ rules as $ rule => $ parameter ) { // skip rules with option as FALSE. if ( $ parameter === false ) { continue ; } $ this -> filter -> apply ( $ rule , $ valueTO , $ parameter ) ; // loop break. if ( $ valueTO -> getBreak ( ) ) { break ; } } return $ valueTO ; }
apply filters on a single value.

@param string      $value
@param array|Rules $rules
@return ValueTO
apply filters on a single value .