on_table); $ar = $x->links(); // is the name a link.. if (!isset($ar[$this->name])) { return $this->value; } if (empty($this->value) ) { return ''; } // lr = ProjecT:id // get the current value of that... $lr = explode(':', $ar[$this->name]); $x = DB_DataObject::factory($lr[0]); if (!method_exists($x, 'toEventString')) { return $lr[0] .':'. $this->value; } $x->get($this->value); return $x->toEventString(); // big assumption.. } function oldvalue($event) { if (!$this->old_audit_id) { return 'Unknown'; } //var_dump($cg->ontable); $x = DB_DataObject::factory('core_event_audit'); $x->get($this->old_audit_id); return $x->newvalue($event); } function findLast($event, $name) { //DB_DataObject::debugLevel(1); $x = DB_DataObject::factory('core_event_audit'); $x->autoJoin(); $x->selectAdd(); $x->selectAdd('core_event_audit.id as id'); $x->name = $name; $x->whereAdd(" join_event_id_id.on_table = '{$event->on_table}' AND join_event_id_id.on_id = {$event->on_id} "); $x->orderBy('join_event_id_id.event_when DESC'); $x->limit(1); if (!$x->find(true)) { return 0; } return $x->id; } }