Doctrine 1.2.4
Doctrine_Access Class Reference

Inherits Doctrine_Locator_Injectable, and ArrayAccess.

Inherited by Doctrine_Collection, Doctrine_Column, Doctrine_EventListener_Chain, Doctrine_Record_Abstract, and Doctrine_Record_Listener_Chain.

Public Member Functions

 __get ($name)
 
 __isset ($name)
 
 __set ($name, $value)
 
 __unset ($name)
 
 add ($value)
 
 bind ($name, $resource)
 
 contains ($offset)
 
 get ($offset)
 
 getLocator ()
 
 locate ($name)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 remove ($offset)
 
 set ($offset, $value)
 
 setArray (array $array)
 
 setLocator (Doctrine_Locator $locator)
 

Static Public Member Functions

static getNullObject ()
 
static initNullObject (Doctrine_Null $null)
 

Detailed Description

Definition at line 33 of file Access.php.

Member Function Documentation

Doctrine_Access::__get (   $name)

Get key from data

See Also
get, offsetGet
Parameters
mixed$name
Returns
mixed

Definition at line 70 of file Access.php.

{
return $this->get($name);
}
Doctrine_Access::__isset (   $name)

Check if key exists in data

Parameters
string$name
Returns
boolean whether or not this object contains $name

Definition at line 81 of file Access.php.

{
return $this->contains($name);
}
Doctrine_Access::__set (   $name,
  $value 
)

Set key and value to data

See Also
set, offsetSet
Parameters
$name
$value
Returns
void

Definition at line 58 of file Access.php.

{
$this->set($name, $value);
}
Doctrine_Access::__unset (   $name)

Remove key from data

Parameters
string$name
Returns
void

Definition at line 92 of file Access.php.

{
return $this->remove($name);
}
Doctrine_Access::add (   $value)

Add the value

Parameters
mixed$valueThe value to add
Returns
void

Definition at line 199 of file Access.php.

{
throw new Doctrine_Exception('Add is not supported for ' . get_class($this));
}
Doctrine_Locator_Injectable::bind (   $name,
  $resource 
)
inherited

bind binds a resource to a name

Parameters
string$namethe name of the resource to bind
mixed$valuethe value of the resource
Returns
Doctrine_Locator this object

Definition at line 120 of file Injectable.php.

{
$this->_resources[$name] = $resource;
return $this;
}
Doctrine_Access::contains (   $offset)

Check if the specified offset exists

Parameters
mixed$offsetThe offset to check
Returns
boolean True if exists otherwise false

Definition at line 188 of file Access.php.

{
throw new Doctrine_Exception('Contains is not supported for ' . get_class($this));
}
Doctrine_Access::get (   $offset)

Return the element with the specified offset

Parameters
mixed$offsetThe offset to return
Returns
mixed

Definition at line 165 of file Access.php.

{
throw new Doctrine_Exception('Get is not supported for ' . get_class($this));
}
Doctrine_Locator_Injectable::getLocator ( )
inherited

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

Returns
Doctrine_Locator

Definition at line 75 of file Injectable.php.

{
if ( ! isset($this->_locator)) {
$this->_locator = Doctrine_Locator::instance();
}
return $this->_locator;
}
static Doctrine_Locator_Injectable::getNullObject ( )
staticinherited

getNullObject returns the null object associated with this object

Returns
Doctrine_Null

Definition at line 145 of file Injectable.php.

{
return self::$_null;
}
static Doctrine_Locator_Injectable::initNullObject ( Doctrine_Null  $null)
staticinherited

initNullObject initializes the null object

Parameters
Doctrine_Null$null
Returns
void

Definition at line 134 of file Injectable.php.

{
self::$_null = $null;
}
Doctrine_Locator_Injectable::locate (   $name)
inherited

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

See Also
Doctrine_Locator::locate()
Exceptions
Doctrine_Locator_Exceptionif the resource could not be found
Parameters
string$namethe name of the resource
Returns
mixed the located resource

Definition at line 96 of file Injectable.php.

{
if (isset($this->_resources[$name])) {
if (is_object($this->_resources[$name])) {
return $this->_resources[$name];
} else {
// get the name of the concrete implementation
$concreteImpl = $this->_resources[$name];
return $this->getLocator()->locate($concreteImpl);
}
} else {
return $this->getLocator()->locate($name);
}
}
Doctrine_Access::offsetExists (   $offset)

Check if an offset axists

Parameters
mixed$offset
Returns
boolean Whether or not this object contains $offset

Definition at line 103 of file Access.php.

{
return $this->contains($offset);
}
Doctrine_Access::offsetGet (   $offset)

An alias of get()

See Also
get, __get
Parameters
mixed$offset
Returns
mixed

Definition at line 115 of file Access.php.

{
return $this->get($offset);
}
Doctrine_Access::offsetSet (   $offset,
  $value 
)

Sets $offset to $value

See Also
set, __set
Parameters
mixed$offset
mixed$value
Returns
void

Definition at line 128 of file Access.php.

{
if ( ! isset($offset)) {
$this->add($value);
} else {
$this->set($offset, $value);
}
}
Doctrine_Access::offsetUnset (   $offset)

Unset a given offset

See Also
set, offsetSet, __set
Parameters
mixed$offset

Definition at line 143 of file Access.php.

{
return $this->remove($offset);
}
Doctrine_Access::remove (   $offset)

Remove the element with the specified offset

Parameters
mixed$offsetThe offset to remove
Returns
boolean True if removed otherwise false

Definition at line 154 of file Access.php.

{
throw new Doctrine_Exception('Remove is not supported for ' . get_class($this));
}
Doctrine_Access::set (   $offset,
  $value 
)

Set the offset to the value

Parameters
mixed$offsetThe offset to set
mixed$valueThe value to set the offset to

Definition at line 177 of file Access.php.

{
throw new Doctrine_Exception('Set is not supported for ' . get_class($this));
}
Doctrine_Access::setArray ( array  $array)

Set an entire aray to the data

Parameters
array$arrayAn array of key => value pairs
Returns
Doctrine_Access

Definition at line 41 of file Access.php.

{
foreach ($array as $k => $v) {
$this->set($k, $v);
}
return $this;
}
Doctrine_Locator_Injectable::setLocator ( Doctrine_Locator  $locator)
inherited

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

Parameters
Doctrine_Locatorthe locator object
Returns
Doctrine_Locator_Injectable this instance

Definition at line 60 of file Injectable.php.

{
$this->_locator = $locator;
return $this;
}

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