public static function validates($attr, $validation) 
    {
        $cls = get_called_class();

        if (!array_key_exists($cls, self::$_validations)) {
            self::$_validations[$cls] = array();
        }

        if (!array_key_exists($attr, self::$_validations[$cls])) {
            self::$_validations[$cls][$attr] = array();
        }

        array_push(self::$_validations[$cls][$attr], $validation);
    }
public static function validates($attr, $validation) 
    {
        $cls = get_called_class();

        if (!array_key_exists($cls, self::$_validations)) {
            self::$_validations[$cls] = array();
        }

        if (!array_key_exists($attr, self::$_validations[$cls])) {
            self::$_validations[$cls][$attr] = array();
        }

        array_push(self::$_validations[$cls][$attr], $validation);
    }
public static function validates ( $ attr , $ validation ) { $ cls = get_called_class ( ) ; if ( ! array_key_exists ( $ cls , self :: $ _validations ) ) { self :: $ _validations [ $ cls ] = array ( ) ; } if ( ! array_key_exists ( $ attr , self :: $ _validations [ $ cls ] ) ) { self :: $ _validations [ $ cls ] [ $ attr ] = array ( ) ; } array_push ( self :: $ _validations [ $ cls ] [ $ attr ] , $ validation ) ; }
Validates an attribute with a validation rule

@param string $attr       attribute
@param mixed  $validation validation rule

@return valid or not
Validates an attribute with a validation rule