public function delete($table, $conditions, $bind = [])
    {
        if (is_string($conditions)) {
            $conditions = [$conditions];
        }

        $wheres = [];
        /** @noinspection ForeachSourceInspection */
        foreach ($conditions as $k => $v) {
            if (is_int($k)) {
                $wheres[] = stripos($v, ' or ') ? "($v)" : $v;
            } else {
                $wheres[] = "[$k]=:$k";
                $bind[$k] = $v;
            }
        }

        $sql = 'DELETE' . ' FROM ' . $this->_escapeIdentifier($table) . ' WHERE ' . implode(' AND ', $wheres);
        return $this->_execute('delete', $sql, $bind);
    }
public function delete($table, $conditions, $bind = [])
    {
        if (is_string($conditions)) {
            $conditions = [$conditions];
        }

        $wheres = [];
        /** @noinspection ForeachSourceInspection */
        foreach ($conditions as $k => $v) {
            if (is_int($k)) {
                $wheres[] = stripos($v, ' or ') ? "($v)" : $v;
            } else {
                $wheres[] = "[$k]=:$k";
                $bind[$k] = $v;
            }
        }

        $sql = 'DELETE' . ' FROM ' . $this->_escapeIdentifier($table) . ' WHERE ' . implode(' AND ', $wheres);
        return $this->_execute('delete', $sql, $bind);
    }
public function delete ( $ table , $ conditions , $ bind = [ ] ) { if ( is_string ( $ conditions ) ) { $ conditions = [ $ conditions ] ; } $ wheres = [ ] ; /** @noinspection ForeachSourceInspection */ foreach ( $ conditions as $ k => $ v ) { if ( is_int ( $ k ) ) { $ wheres [ ] = stripos ( $ v , ' or ' ) ? "($v)" : $ v ; } else { $ wheres [ ] = "[$k]=:$k" ; $ bind [ $ k ] = $ v ; } } $ sql = 'DELETE' . ' FROM ' . $ this -> _escapeIdentifier ( $ table ) . ' WHERE ' . implode ( ' AND ' , $ wheres ) ; return $ this -> _execute ( 'delete' , $ sql , $ bind ) ; }
Deletes data from a table using custom SQL syntax

@param string       $table
@param string|array $conditions
@param array        $bind

@return int
@throws \ManaPHP\Db\Exception
Deletes data from a table using custom SQL syntax