Ejemplo n.º 1
0
 public function testRemove()
 {
     $table = 'table';
     $parentId = 'parent';
     $rowId = 'row';
     $data = new \stdClass();
     $this->object->setRow($table, $parentId, $rowId, $data);
     $this->object->remove($table, $parentId, $rowId, $data);
     $this->assertFalse($this->object->get($table, $parentId, $rowId));
 }
Ejemplo n.º 2
0
 /**
  * Delete table row
  *
  * @param string $table
  * @param string $idField
  * @param string|int $rowId
  * @param null|string $parentField
  * @param int|string $parentId
  * @return $this
  */
 public function deleteTableRow($table, $idField, $rowId, $parentField = null, $parentId = 0)
 {
     $table = $this->getTable($table);
     $adapter = $this->getConnection();
     $where = [$adapter->quoteIdentifier($idField) . '=?' => $rowId];
     if (!is_null($parentField)) {
         $where[$adapter->quoteIdentifier($parentField) . '=?'] = $parentId;
     }
     $adapter->delete($table, $where);
     $this->setupCache->remove($table, $parentId, $rowId);
     return $this;
 }