Cake\Database\Connection::delete PHP Method

delete() public method

Executes a DELETE statement on the specified table.
public delete ( string $table, array $conditions = [], array $types = [] ) : Cake\Database\StatementInterface
$table string the table to delete rows from
$conditions array conditions to be set for delete statement
$types array list of associative array containing the types to be used for casting
return Cake\Database\StatementInterface
    public function delete($table, $conditions = [], $types = [])
    {
        return $this->newQuery()->delete($table)->where($conditions, $types)->execute();
    }

Usage Example

 /**
  * {@inheritdoc}
  */
 public function deletePermission(PermissionInterface $permission)
 {
     $this->connection->delete($this->getAclSchema()->getPermissionsTableName(), ['requester' => $permission->getRequester()->getAclRequesterIdentifier(), 'resource' => $permission->getResource()->getAclResourceIdentifier()], ['requester' => 'string', 'resource' => 'string']);
 }