openclassify/addons/default/visiosoft/profile-module/src/Profile/Command/FindUserProfile.php
2019-10-30 13:33:42 +03:00

34 lines
654 B
PHP

<?php namespace Visiosoft\ProfileModule\Profile\Command;
use Visiosoft\ProfileModule\Profile\Contract\ProfileRepositoryInterface;
class FindUserProfile
{
/**
* @var $id
*/
protected $id;
/**
* GetProduct constructor.
* @param $id
*/
public function __construct($id)
{
$this->id = $id;
}
/**
* @param ProfileRepositoryInterface $profileRepository
* @return |null
*/
public function handle(ProfileRepositoryInterface $profileRepository)
{
if ($this->id) {
return $profileRepository->findByUserID($this->id);
}
return null;
}
}