protected function _newImage(DB_DataObject $obj) { $defs = $obj->_getPluginsDef(); $tbl = DB_DataObject::factory($defs['otfimagereceiver']['table']); $tbl->record_table = $obj->tableName(); $tbl->record_id = $obj->pk(); return $tbl; }
public function log($message, $messagecode, DB_DataObject $obj) { self::getLogger()->info(vsprintf('[%1$s %2$s %5$s %3$s] %3$s %4$s %1$s ID %2$s', array($obj->tableName(), $obj->pk(), self::getUsername(), $message, $messagecode))); }
public function attachTo(DB_DataObject $owner, $obj) { $obj->record_table = $owner->tableName(); $obj->record_id = $owner->pk(); $obj->save(); }
public static function create(DB_DataObject $do) { $class = 'Presenter_' . $do->tableName(); return new $class($do); }
public function setRecord(DB_DataObject $record) { $this->record_id = $record->pk(); $this->tagged_table = $record->tableName(); }
/** * set or get the dataobject this image is associated with * @param DB_DataObject $obj An object to associate this image with * (does not store it - you need to call update() to do that) * @return DB_DataObject the dataobject this image is attached to. */ function object($obj = false) { if ($obj === false) { if (empty($this->ontable) || empty($this->onid)) { return false; } $ret = DB_DataObject::factory($this->ontable); $ret->get($this->onid); return $ret; } $this->ontable = $obj->tableName(); $this->onid = $obj->id; /// assumes our nice standard of using ids.. return $obj; }
public function getTagLastHistory($tag, $direction, DB_DataObject $obj) { if (!($tag = $this->_getTagFromTag($tag))) { return self::returnStatus(false); } $h = DB_DataObject::factory('tag_history'); $h->tag_id = $tag->id; $h->record_id = $obj->pk(); $h->tagged_table = $obj->tableName(); $h->direction = $direction; $h->orderBy('date DESC'); $h->find(true); return self::returnStatus($h); }