mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 04:24:00 +00:00
38 lines
927 B
PHP
38 lines
927 B
PHP
<?php
|
|
|
|
namespace App\Modules\ControllerLogic\Contacts;
|
|
|
|
use App\Classes\Constants;
|
|
use App\Classes\Modules\Contacts\DataTransferObjects\ContactObject;
|
|
use App\Classes\Modules\Contacts\Services\CreatesContact;
|
|
use Illuminate\Http\Request;
|
|
|
|
class CreateContactLogic
|
|
{
|
|
/** @var CreatesContact */
|
|
private $createContact;
|
|
|
|
/**
|
|
* CreateContactLogic constructor.
|
|
* @param CreatesContact $createContact
|
|
*/
|
|
public function __construct(CreatesContact $createContact)
|
|
{
|
|
$this->createContact = $createContact;
|
|
}
|
|
|
|
|
|
public function execute(string $type, int $referenceId, Request $request)
|
|
{
|
|
try{
|
|
|
|
$object = new ContactObject($request->input('name'), $request->input('designation'), $request->input('contact'), $request->input('email'));
|
|
return $this->createContact->execute($object, $type, $referenceId);
|
|
|
|
}
|
|
catch (){
|
|
|
|
}
|
|
}
|
|
|
|
} |