public function isField($value, $depth = 1) { if ($value == 'usercompanyid') { return true; } else { return parent::isField($value, $depth); } }
function handle(DataObject $model) { $db =& DB::Instance(); $query = 'SELECT max(' . $this->position_field . ') FROM ' . $model->getTableName(); if ($model->isField('usercompanyid')) { $query .= ' WHERE usercompanyid=' . $db->qstr(EGS_COMPANY_ID); } $position = $db->GetOne($query); $position++; return $position; }
protected function addAuditFields(&$fields) { // get the fields for the base table/view for the collection // and add the audit fields if they exist in the table/view $do = new DataObject($this->_tablename); foreach ($do->audit_fields as $audit_field) { if ($do->isField($audit_field)) { $fields[$audit_field] = $do->getField($audit_field); } } }