invoiceninja/app/Jobs/Entity/ActionEntity.php
David Bomba b635f3b32e
Implement Bulk Actions (#2605)
* Wired up Bulk Archive / Delete / Restore button with reactivity on checkbox actions

* Working on POSTing bulk actions

* Working on Filtering by status

* Add Action Entity

* Implement Vuex for state management

* Implement Vuex storage & list view bulk actions

* Clean up console logs
2019-01-19 17:21:34 +11:00

41 lines
726 B
PHP

<?php
namespace App\Jobs\Entity;
use App\Repositories\BaseRepository;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
class ActionEntity
{
use Dispatchable;
protected $action;
protected $entity;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct(Model $entity, string $action)
{
$this->action = $action;
$this->entity = $entity;
}
/**
* Execute the job.
*
* @return void
*/
public function handle(BaseRepository $baseRepo)
{
return $baseRepo->{$this->action}($this->entity);
}
}