mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Rename listeners
This commit is contained in:
parent
cd8d479209
commit
f3994f4a07
41
app/Listeners/Client/CreatedClientActivity.php
Normal file
41
app/Listeners/Client/CreatedClientActivity.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Client;
|
||||
|
||||
use App\Models\Activity;
|
||||
use App\Repositories\ActivityRepository;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
|
||||
class CreatedClientActivity
|
||||
{
|
||||
protected $activityRepo;
|
||||
/**
|
||||
* Create the event listener.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(ActivityRepository $activityRepo)
|
||||
{
|
||||
$this->activityRepo = $activityRepo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param object $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle($event)
|
||||
{
|
||||
|
||||
$fields = new \stdClass;
|
||||
|
||||
$fields->client_id = $event->client->id;
|
||||
$fields->user_id = $event->client->user_id;
|
||||
$fields->company_id = $event->client->company_id;
|
||||
$fields->activity_type_id = Activity::CREATE_CLIENT;
|
||||
|
||||
$this->activityRepo->save($fields, $event->client);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user