public function __construct($id = null) { $this->_client_id_unset_from_data = false; parent::__construct($id); }
/** * * @param My_Model_Domain|array $obj * @throws Exception * @return number */ public function update($obj) { if ($obj instanceof My_Model_Domain) { if ($obj->getClientIdUnsetFromData()) { $obj->unsetField($obj->getClientIdKey()); } $bind = $obj->getData(); } elseif (is_array($obj)) { $bind = $obj; } else { throw new Exception("Unsupported datatype used in insert/update", -1001); } $db = $this->_connection; return $this->_connection->update($this->_tablename, $bind, $db->quoteInto("{$this->_primary_key_field} = (?)", $obj->{"get" . $this->_primary_key_field}())); }
public static function registerBulkDelete(My_Model_Domain $obj) { $inst = self::instance(); $inst->_bulkDelete[$obj->getId()] = $obj; }