src/Titon/Db/Repository.php
public function deleteMany(Closure $conditions, array $options = []) {
        $query = $this->query(Query::DELETE)->bindCallback($conditions);

        // Validate that this won't delete all records
        $where = $query->getWhere()->getParams();

        if (empty($where)) {
            throw new InvalidQueryException('No where clause detected, will not delete all records');
        }

        return $query->save([], $options);
    }
public function deleteMany(Closure $conditions, array $options = []) {
        $query = $this->query(Query::DELETE)->bindCallback($conditions);

        // Validate that this won't delete all records
        $where = $query->getWhere()->getParams();

        if (empty($where)) {
            throw new InvalidQueryException('No where clause detected, will not delete all records');
        }

        return $query->save([], $options);
    }
public function deleteMany ( Closure $ conditions , array $ options = [ ] ) { $ query = $ this -> query ( Query :: DELETE ) -> bindCallback ( $ conditions ) ; // Validate that this won't delete all records $ where = $ query -> getWhere ( ) -> getParams ( ) ; if ( empty ( $ where ) ) { throw new InvalidQueryException ( 'No where clause detected, will not delete all records' ) ; } return $ query -> save ( [ ] , $ options ) ; }
Delete multiple records with conditions.

@param \Closure $conditions
@param array $options
@return int The count of records deleted
@throws \Titon\Db\Exception\InvalidQueryException
Delete multiple records with conditions .