Exemple #1
0
 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;
 }
Exemple #2
0
 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)));
 }
Exemple #3
0
 public function attachTo(DB_DataObject $owner, $obj)
 {
     $obj->record_table = $owner->tableName();
     $obj->record_id = $owner->pk();
     $obj->save();
 }
Exemple #4
0
 public static function create(DB_DataObject $do)
 {
     $class = 'Presenter_' . $do->tableName();
     return new $class($do);
 }
Exemple #5
0
 public function setRecord(DB_DataObject $record)
 {
     $this->record_id = $record->pk();
     $this->tagged_table = $record->tableName();
 }
Exemple #6
0
 /**
  * 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;
 }
Exemple #7
0
 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);
 }