2019-12-17 11:58:23 +01:00
|
|
|
<?php
|
2020-03-18 10:40:15 +01:00
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-03-18 10:40:15 +01:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2021-01-03 22:54:54 +01:00
|
|
|
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-03-18 10:40:15 +01:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
2019-12-17 11:58:23 +01:00
|
|
|
|
|
|
|
namespace App\Utils\Traits;
|
|
|
|
|
|
|
|
trait BulkOptions
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Store method in requests.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public static $STORE_METHOD = 'create';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Default chunk size.
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
public static $CHUNK_SIZE = 100;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Default queue for bulk processing.
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public static $DEFAULT_QUEUE = 'bulk_processing';
|
|
|
|
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Available bulk options - used in requests (eg. BulkClientRequests).
|
2019-12-17 11:58:23 +01:00
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
public function getBulkOptions()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'create', 'edit', 'view',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Shared rules for bulk requests.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
public function getGlobalRules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'action' => ['required'],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|