/** * Deletes the record from the database. */ function delete($secure = false) { import('Dataface/IO.php'); $io = new Dataface_IO($this->_table->tablename); return $io->delete($this, $secure); //trigger_error('Not implemented yet: '.Dataface_Error::printStackTrace(), E_USER_ERROR); }
function test_delete() { $record = new Dataface_Record('Profiles', array()); $io = new Dataface_IO('Profiles'); $io->read(array('id' => 10), $record); $res = $io->delete($record); $this->assertTrue($res); $this->assertTrue(!PEAR::isError($res)); $this->assertTrue(PEAR::isError($io->read(array('id' => 10), $record))); }
/** * @brief Deletes the record from the database. * * @param boolean $secure Whether to check permissions before saving. * * @return mixed True on success. PEAR_Error object on fail. */ function delete($secure = false) { import('Dataface/IO.php'); $io = new Dataface_IO($this->_table->tablename); return $io->delete($this, $secure); }
function delete($values) { require_once 'Dataface/IO.php'; $query = $this->_buildDeleteQuery($values); if (PEAR::isError($query)) { return $query; } $io = new Dataface_IO($this->_tablename); $it =& df_get_records($this->_tablename, $query); $warnings = array(); while ($it->hasNext()) { $record =& $it->next(); $res = $io->delete($record); if (PEAR::isError($res) && Dataface_Error::isError($res)) { // this is a serious error... kill it return $res; } else { if (PEAR::isError($res)) { // this is a warning or a notice $warnings[] = $res; } } unset($record); } if (count($warnings) > 0) { return $warnings; } return true; }