15trait DeleteByFilterTrait
22 public static function deleteByFilter(array $filter)
24 $entity = static::getEntity();
25 $table = static::getTableName();
27 $where = Query\Query::buildFilterSql($entity, $filter);
31 $where =
' where ' . $where;
35 throw new Main\ArgumentException(
"Deleting by empty filter is not allowed, use truncate ({$table}).",
'filter');
38 static::onBeforeDeleteByFilter($where);
40 $entity->getConnection()->queryExecute(
"delete from {$table} {$where}");
45 protected static function onBeforeDeleteByFilter(
string $where)