OODB manages two repositories, a fluid one that
adjust the database schema on-the-fly to accomodate for
new bean types (tables) and new properties (columns) and
a frozen one for use in a production environment. OODB
allows you to swap the repository instances using the freeze()
method.
/** * Returns the next bean in the collection. * If called the first time, this will return the first bean in the collection. * If there are no more beans left in the collection, this method * will return NULL. * * @return OODBBean|NULL */ public function next() { $row = $this->cursor->getNextItem(); if ($row) { $beans = $this->repository->convertToBeans($this->type, array($row)); $bean = array_shift($beans); return $bean; } return NULL; }
/** * Trash all beans of a given type. Wipes an entire type of bean. * * @param string $type type of bean you wish to delete all instances of * * @return boolean */ public function wipe($type) { return $this->repository->wipe($type); }