Example #1
0
 /**
  * add
  *
  * @param Doctrine_Record $record       record to be added into registry
  * @return boolean
  */
 public function add(Doctrine_Record $record)
 {
     $oid = $record->getOID();
     if (isset($this->registry[$oid])) {
         return false;
     }
     $this->registry[$oid] = $record;
     return true;
 }
Example #2
0
 /**
  * Dumps a record.
  *
  * This method returns an html representation of a given
  * record, containing keys, state and data.
  *
  * @param Doctrine_Record $record
  * @return string
  */
 public static function getRecordAsString(Doctrine_Record $record)
 {
     $r[] = '<pre>';
     $r[] = 'Component  : ' . $record->getTable()->getComponentName();
     $r[] = 'ID         : ' . Doctrine::dump($record->identifier());
     $r[] = 'References : ' . count($record->getReferences());
     $r[] = 'State      : ' . Doctrine_Lib::getRecordStateAsString($record->state());
     $r[] = 'OID        : ' . $record->getOID();
     $r[] = 'data       : ' . Doctrine::dump($record->getData(), false);
     $r[] = '</pre>';
     return implode("\n", $r) . "<br />";
 }