public static function save(Application_Model_O_ConsultDialog $obj, $extra = '') { if (!$obj->getModifiedFields()) { return $obj; } foreach ($obj->getModifiedFields() as $key => $value) { $field = self::$fields[strtolower($key)]; if ($field) { $data[$field] = $value; } } if (!$obj->getId()) { $obj->setId(self::getDbTable()->insert($data, $extra)); $obj->setNew(false); } else { self::getDbTable()->update($data, array('id = ?' => $obj->getId())); } return $obj; }