Public Member Functions | Public Attributes | Protected Attributes

Robo47_Validate_StringNotContains Class Reference

Inheritance diagram for Robo47_Validate_StringNotContains:
Inheritance graph
[legend]
Collaboration diagram for Robo47_Validate_StringNotContains:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 getContains ()
 Get Contains.
 isValid ($value)
 setContains ($contains)
 Set Contains.

Public Attributes

const CONTAINS = 'contains'

Protected Attributes

 $_contains = ''
 $_messageTemplates
 $_messageVariables

Detailed Description

Definition at line 31 of file StringNotContains.php.


Member Function Documentation

Robo47_Validate_StringContains::getContains (  )  [inherited]

Get Contains.

Returns:
array

Definition at line 79 of file StringContains.php.

    {
        return $this->_contains;
    }

Robo47_Validate_StringNotContains::isValid ( value  ) 
Returns:
boolean

Reimplemented from Robo47_Validate_StringContains.

Definition at line 41 of file StringNotContains.php.

    {
        $this->_setValue($value);
        $isValid = true;
        foreach ($this->_contains as $contains) {
            if (false !== strpos($value, $contains)) {
                $isValid = false;
                $this->_createMessage(self::CONTAINS, $contains);
                break;
            }
        }
        return $isValid;
    }

Robo47_Validate_StringContains::setContains ( contains  )  [inherited]

Set Contains.

Parameters:
string|array $contains
Returns:
Robo47_Validate_StringContains *Provides Fluent Interface*

Definition at line 61 of file StringContains.php.

Referenced by Robo47_Validate_StringContains::__construct().

    {
        if (is_string($contains)) {
            $contains = array($contains);
        }
        if (empty($contains)) {
            $message = '$contains is empty';
            throw new Robo47_Validate_Exception($message);
        }
        $this->_contains = $contains;
        return $this;
    }

Here is the caller graph for this function:


Member Data Documentation

Robo47_Validate_StringContains::$_contains = '' [protected, inherited]

Definition at line 38 of file StringContains.php.

Robo47_Validate_StringNotContains::$_messageTemplates [protected]
Initial value:
 array(
        self::CONTAINS => "'%value%' does contain '%contains%'"
    )

Reimplemented from Robo47_Validate_StringContains.

Definition at line 34 of file StringNotContains.php.

Robo47_Validate_StringContains::$_messageVariables [protected, inherited]
Initial value:
 array(
        'value' => '_value',
    )

Definition at line 43 of file StringContains.php.

const Robo47_Validate_StringContains::CONTAINS = 'contains' [inherited]

Definition at line 33 of file StringContains.php.


The documentation for this class was generated from the following file: