1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02:00
invoiceninja/app/Utils/Traits/BulkOptions.php
Benjamin Beganović da49880733 Massively creating resources (#3152)
* Bulk storing request & accesing policy service

* Transform hardcoded action to self-property

* Testing, support for multiple resources

* Uncomment, response(200)

* Change authorize to isAdmin() property
2019-12-17 21:58:23 +11:00

56 lines
891 B
PHP

<?php
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';
/**
* Available bulk options - used in requests (eg. BulkClientRequests)
*
* @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'],
];
}
}