1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Rename listeners

This commit is contained in:
David Bomba 2019-04-21 22:28:45 +10:00
parent cd8d479209
commit f3994f4a07

View 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);
}
}