File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,18 @@ public function delete($object) {
192192 return FALSE ;
193193 }
194194
195+
196+ /**
197+ * Delete the objects using the given criteria.
198+ * @param array $criteria - the criterions to match for delete for (AND) - see README.md (optional, default will clear table)
199+ * @return mixed - FALSE when delete failed, TRUE when successful
200+ */
201+ public function deleteBy ($ criteria = array ()) {
202+ $ whereClause = $ this ->createWhereClause ($ criteria );
203+ $ query = 'DELETE FROM ' .$ this ->database ->quoteName ($ this ->tableName ).' ' .$ whereClause ;
204+ return $ this ->database ->query ($ query );
205+ }
206+
195207 /**
196208 * Get the full SQL query to delete the given uid.
197209 * <p>Override this to implement soft delete functionality.</p>
You can’t perform that action at this time.
0 commit comments