Exemplo n.º 1
0
 /**
  * Removes the row from the database
  */
 public function deleteRow()
 {
     if (!$this->isNew() and !$this->isReadOnly()) {
         $db = P4A_DB::singleton($this->getDSN());
         $table = $this->getTable();
         $schema = $this->getSchema();
         $pks = $this->getPK();
         foreach ($this->_multivalue_fields as $fieldname => $aField) {
             $pk_value = $this->fields->{$pks}->getNewValue();
             $fk_table = ($schema ? "{$schema}." : "") . $aField["table"];
             $fk = $aField["fk"];
             $db->adapter->query("DELETE FROM {$fk_table} WHERE {$fk}=?", array($pk_value));
         }
         $table = new P4A_Db_Table(array('name' => $this->getTable(), 'schema' => $this->getSchema(), 'db' => $db->adapter));
         $table->delete($this->_composePkString());
         $this->resetNumRows();
     }
     parent::deleteRow();
 }
Exemplo n.º 2
0
 public function deleteRow()
 {
     $pointer = $this->getRowNumber();
     unset($this->_array[$pointer - 1]);
     parent::deleteRow();
 }
Exemplo n.º 3
0
 /**
  * Deletes the currently pointed record
  * @return P4A_Mask
  */
 public function deleteRow()
 {
     $this->data->deleteRow();
     return $this;
 }