public function getById($id) { $result = parent::getById($id, "\n \t\t\t\t*,\n unix_timestamp(created) as tscreated,\n unix_timestamp(lastpingvisitor) as lpvisitor,\n unix_timestamp(lastpingagent) as lpoperator,\n unix_timestamp(CURRENT_TIMESTAMP) as current"); if ($result) { //Inject rate if needed $crm = MapperFactory::getMapper("Rate"); $rate = $crm->getByThreadidAndOperatorid($result['threadid'], $result['operatorid']); if ($rate) { $result['ratedoperatorid'] = $rate['operatorid']; $result['rate'] = $rate['rate']; } else { $result['ratedoperatorid'] = null; $result['rate'] = null; } } return $result; }
public function getById($id) { $result = parent::getById($id, ' t.*, WM_UNIX_TIMESTAMP("created") as "tscreated", WM_UNIX_TIMESTAMP("lastpingvisitor") as "lpvisitor", WM_UNIX_TIMESTAMP("lastpingagent") as "lpoperator", WM_UNIX_TIMESTAMP(SYSDATE) as "current" '); if ($result) { //Inject rate if needed $crm = MapperFactory::getMapper("Rate"); $rate = $crm->getByThreadidAndOperatorid($result['threadid'], $result['operatorid']); if ($rate) { $result['ratedoperatorid'] = $rate['operatorid']; $result['rate'] = $rate['rate']; } else { $result['ratedoperatorid'] = null; $result['rate'] = null; } } return $result; }