OCA\Richdocuments\Db::deleteBy PHP Method

deleteBy() public method

Delete records matching the condition
public deleteBy ( string $field, mixed $value )
$field string for WHERE condition
$value mixed matching value(s)
    public function deleteBy($field, $value)
    {
        if (!is_array($value)) {
            $value = array($value);
        }
        $count = count($value);
        if ($count === 0) {
            return;
        } elseif ($count === 1) {
            $this->execute('DELETE FROM ' . $this->tableName . ' WHERE `' . $field . '` =?', $value);
        } else {
            $stmt = $this->buildInQuery($field, $value);
            $this->execute('DELETE FROM ' . $this->tableName . ' WHERE ' . $stmt, $value);
        }
    }