public function addRecord($domain, $name, $type, $content, $ttl = 86400, $prio = 0) { $domainId = $domain; if (!is_numeric($domain)) { $domainId = $this->getDomainId($domain); } $this->_db->insert('records', array('domain_id' => $domainId, 'name' => $name, 'type' => strtoupper($type), 'content' => trim($content), 'ttl' => intval($ttl), 'prio' => intval($prio))); }
/** * Saves the current attributes to the DB. */ public function save() { $this->beforeSave(); // Trims out non-fields and serializes data for DB entry. $info = $this->info(true, true); if (!$this->exists) { $this->beforeCreate(); $this->_zendDb->insert($this->tableName(), $info); if (!$this->id) { $this->id = $this->_zendDb->lastInsertId(); } $this->_afterCommand('insert'); $this->exists = true; $this->afterCreate(); } else { $this->_zendDb->update($this->tableName(), $info, 'id = ' . $this->_zendDb->quote($this->id)); $this->_afterCommand('update'); } $this->afterSave(); $this->_lastSaveRow = $this->info(); }
/** * Enter description here ... * @param array $arr * @param string $id */ public function insertIntro($data) { $result = $this->db->insert('intro', $data); return $result; }