PHP Трейт App\Traits\SupportsDeleteWhereIDsNotIn

MySQL and PostgreSQL seem to have a limit of 2^16-1 (65535) elements in an IN statement. This trait provides a method as a workaround to this limitation.
Показать файл Открыть проект

Открытые методы

Метод Описание
deleteByChunk ( array $ids, string $key = 'id', integer $chunkSize = 65535 ) Delete records chunk by chunk.
deleteWhereIDsNotIn ( array $ids, string $key = 'id' ) : mixed Deletes all records whose IDs are not in an array.

Описание методов

deleteByChunk() публичный статический метод

Delete records chunk by chunk.
public static deleteByChunk ( array $ids, string $key = 'id', integer $chunkSize = 65535 )
$ids array The array of record IDs to delete
$key string Name of the primary key
$chunkSize integer Size of each chunk. Defaults to 2^16-1 (65535)

deleteWhereIDsNotIn() публичный статический метод

Deletes all records whose IDs are not in an array.
public static deleteWhereIDsNotIn ( array $ids, string $key = 'id' ) : mixed
$ids array The array of IDs.
$key string Name of the primary key.
Результат mixed