class Doctrine_Validator_ErrorStack extends Doctrine_Access implements Countable, IteratorAggregate (View source)

Doctrine_Validator_ErrorStack

Properties

protected Doctrine_Locator $_locator from Doctrine_Locator_Injectable
protected array $_resources from Doctrine_Locator_Injectable
static protected Doctrine_Null $_null from Doctrine_Locator_Injectable
protected array $_errors The errors of the error stack.
protected array $_validators Array of validators that failed
protected string $_className Get model class name for the error stack

Methods

setLocator(Doctrine_Locator $locator)

setLocator this method can be used for setting the locator object locally

getLocator()

getLocator returns the locator associated with this object

mixed
locate(string $name)

locate locates a resource by given name and returns it

bind($name, $resource)

bind binds a resource to a name

static void
initNullObject(Doctrine_Null $null)

initNullObject initializes the null object

static Doctrine_Null
getNullObject()

getNullObject returns the null object associated with this object

setArray(array $array)

Set an entire aray to the data

void
__set($name, $value)

Set key and value to data

mixed
__get(mixed $name)

Get key from data

boolean
__isset(string $name)

Check if key exists in data

void
__unset(string $name)

Remove key from data

boolean
offsetExists(mixed $offset)

Check if an offset axists

mixed
offsetGet(mixed $offset)

An alias of get()

void
offsetSet(mixed $offset, mixed $value)

Sets $offset to $value

offsetUnset(mixed $offset)

Unset a given offset

boolean
remove(string $fieldName)

Removes all existing errors for the specified field from the stack.

mixed
get(string $fieldName)

Get errors for field

set(string $fieldName, string $errorCode)

Alias for add()

boolean
contains(string $fieldName)

Check if a field has an error

void
add($invalidFieldName, $errorCode = 'general')

Adds an error to the stack.

__construct($className)

Constructor

void
clear()

Removes all errors from the stack.

unknown
getIterator()

Enter description here.

toArray()

No description

integer
count()

Count the number of errors

string
getClassname()

Get the classname where the errors occured

array
getValidators()

Get array of failed validators

Details

Doctrine_Locator_Injectable setLocator(Doctrine_Locator $locator)

setLocator this method can be used for setting the locator object locally

Parameters

Doctrine_Locator $locator the locator object

Return Value

Doctrine_Locator_Injectable this instance

Doctrine_Locator getLocator()

getLocator returns the locator associated with this object

if there are no locator locally associated then this method tries to fetch the current global locator

Return Value

Doctrine_Locator

mixed locate(string $name)

locate locates a resource by given name and returns it

if the resource cannot be found locally this method tries to use the global locator for finding the resource

Parameters

string $name the name of the resource

Return Value

mixed the located resource

Exceptions

Doctrine_Locator_Exception if the resource could not be found

See also

Doctrine_Locator::locate

Doctrine_Locator bind($name, $resource)

bind binds a resource to a name

Parameters

$name
$resource

Return Value

Doctrine_Locator this object

static void initNullObject(Doctrine_Null $null)

initNullObject initializes the null object

Parameters

Doctrine_Null $null

Return Value

void

static Doctrine_Null getNullObject()

getNullObject returns the null object associated with this object

Return Value

Doctrine_Null

Doctrine_Access setArray(array $array)

Set an entire aray to the data

Parameters

array $array An array of key => value pairs

Return Value

Doctrine_Access

void __set($name, $value)

Set key and value to data

Parameters

$name
$value

Return Value

void

See also

set, offsetSet

mixed __get(mixed $name)

Get key from data

Parameters

mixed $name

Return Value

mixed

See also

get, offsetGet

boolean __isset(string $name)

Check if key exists in data

Parameters

string $name

Return Value

boolean whether or not this object contains $name

void __unset(string $name)

Remove key from data

Parameters

string $name

Return Value

void

boolean offsetExists(mixed $offset)

Check if an offset axists

Parameters

mixed $offset

Return Value

boolean Whether or not this object contains $offset

mixed offsetGet(mixed $offset)

An alias of get()

Parameters

mixed $offset

Return Value

mixed

See also

get, __get

void offsetSet(mixed $offset, mixed $value)

Sets $offset to $value

Parameters

mixed $offset
mixed $value

Return Value

void

See also

set, __set

offsetUnset(mixed $offset)

Unset a given offset

Parameters

mixed $offset

See also

set, offsetSet, __set

boolean remove(string $fieldName)

Removes all existing errors for the specified field from the stack.

Parameters

string $fieldName

Return Value

boolean True if removed otherwise false

mixed get(string $fieldName)

Get errors for field

Parameters

string $fieldName

Return Value

mixed

set(string $fieldName, string $errorCode)

Alias for add()

Parameters

string $fieldName
string $errorCode

boolean contains(string $fieldName)

Check if a field has an error

Parameters

string $fieldName

Return Value

boolean True if exists otherwise false

void add($invalidFieldName, $errorCode = 'general')

Adds an error to the stack.

Parameters

$invalidFieldName
$errorCode

Return Value

void

__construct($className)

Constructor

Parameters

$className

void clear()

Removes all errors from the stack.

Return Value

void

unknown getIterator()

Enter description here.

..

Return Value

unknown

toArray()

integer count()

Count the number of errors

Return Value

integer

string getClassname()

Get the classname where the errors occured

Return Value

string

array getValidators()

Get array of failed validators

Return Value

array