Doctrine 1.2.4
Doctrine_Table_Repository Class Reference

Inherits Countable, and IteratorAggregate.

Public Member Functions

 __construct (Doctrine_Table $table)
 
 add (Doctrine_Record $record)
 
 contains ($oid)
 
 count ()
 
 evict ($oid)
 
 evictAll ()
 
 get ($oid)
 
 getIterator ()
 
 getTable ()
 
 loadAll ()
 

Detailed Description

Definition at line 35 of file Repository.php.

Constructor & Destructor Documentation

Doctrine_Table_Repository::__construct ( Doctrine_Table  $table)

constructor

Parameters
Doctrine_Table$table

Definition at line 54 of file Repository.php.

{
$this->table = $table;
}

Member Function Documentation

Doctrine_Table_Repository::add ( Doctrine_Record  $record)

add

Parameters
Doctrine_Record$recordrecord to be added into registry
Returns
boolean

Definition at line 75 of file Repository.php.

{
$oid = $record->getOID();
if (isset($this->registry[$oid])) {
return false;
}
$this->registry[$oid] = $record;
return true;
}
Doctrine_Table_Repository::contains (   $oid)

contains

Parameters
integer$oidobject identifier

Definition at line 150 of file Repository.php.

{
return isset($this->registry[$oid]);
}
Doctrine_Table_Repository::count ( )

count Doctrine_Registry implements interface Countable

Returns
integer the number of records this registry has

Definition at line 105 of file Repository.php.

{
return count($this->registry);
}
Doctrine_Table_Repository::evict (   $oid)
Parameters
integer$oidobject identifier
Returns
boolean whether ot not the operation was successful

Definition at line 114 of file Repository.php.

{
if ( ! isset($this->registry[$oid])) {
return false;
}
unset($this->registry[$oid]);
return true;
}
Doctrine_Table_Repository::evictAll ( )
Returns
integer number of records evicted

Definition at line 126 of file Repository.php.

{
$evicted = 0;
foreach ($this->registry as $oid=>$record) {
if ($this->evict($oid)) {
$evicted++;
}
}
return $evicted;
}
Doctrine_Table_Repository::get (   $oid)

get

Parameters
integer$oid
Exceptions
Doctrine_Table_Repository_Exception

Definition at line 92 of file Repository.php.

{
if ( ! isset($this->registry[$oid])) {
throw new Doctrine_Table_Repository_Exception("Unknown object identifier");
}
return $this->registry[$oid];
}
Doctrine_Table_Repository::getIterator ( )

getIterator

Returns
ArrayIterator

Definition at line 141 of file Repository.php.

{
return new ArrayIterator($this->registry);
}
Doctrine_Table_Repository::getTable ( )

getTable

Returns
Doctrine_Table

Definition at line 64 of file Repository.php.

{
return $this->table;
}
Doctrine_Table_Repository::loadAll ( )

loadAll

Returns
void

Definition at line 159 of file Repository.php.

{
$this->table->findAll();
}

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