public function addAnswer(\Lampcms\Answer $A) { d('cp'); $id = $A->getCategoryId(); if ($id > 0) { $update = array('$inc' => array('i_acount' => 1), '$set' => array('i_ts' => time(), 'hts' => date('F j, Y, g:i a T'))); $this->Mongo->CATEGORY->update(array('id' => $id), $update, array("upsert" => true)); } return $this; }