Exemple #1
0
 public function __construct($id = null)
 {
     $this->_client_id_unset_from_data = false;
     parent::__construct($id);
 }
Exemple #2
0
 /**
  *
  * @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}()));
 }
Exemple #3
0
 public static function registerBulkDelete(My_Model_Domain $obj)
 {
     $inst = self::instance();
     $inst->_bulkDelete[$obj->getId()] = $obj;
 }