Source for file Repository.php
Documentation is available at Repository.php
* $Id: Repository.php 1080 2007-02-10 18:17:08Z romanb $
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
* each record is added into Doctrine_Repository at the same time they are created,
* loaded from the database or retrieved from the cache
* @author Konsta Vesterinen <kvesteri@cc.hut.fi>
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @category Object Relational Mapping
* @link www.phpdoctrine.com
* @version $Revision: 1080 $
* @var object Doctrine_Table $table
* an array of all records
* keys representing record object identifiers
* @param Doctrine_Table $table
* @return object Doctrine_Table
* @param Doctrine_Record $record record to be added into registry
public function add(Doctrine_Record $record)
$oid =
$record->getOID();
* @throws Doctrine_Table_Repository_Exception
public function get($oid)
* Doctrine_Registry implements interface Countable
* @return integer the number of records this registry has
* @param integer $oid object identifier
* @return boolean whether ot not the operation was successful
public function evict($oid)
* @return integer number of records evicted
foreach ($this->registry as $oid=>
$record) {
if ($this->evict($oid)) {
return new ArrayIterator($this->registry);
* @param integer $oid object identifier