openclassify/addons/default/visiosoft/profile-module/src/Adress/Command/GetAddressByUser.php
2021-03-28 14:30:31 +03:00

23 lines
455 B
PHP

<?php namespace Visiosoft\ProfileModule\Adress\Command;
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
class GetAddressByUser
{
protected $id;
public function __construct($id)
{
$this->id = $id;
}
public function handle(AdressRepositoryInterface $addressRepository)
{
if ($this->id) {
return $addressRepository->findByUser($this->id);
}
return null;
}
}