本文整理汇总了PHP中Library\Utility\Helper::getUserAvatar方法的典型用法代码示例。如果您正苦于以下问题:PHP Helper::getUserAvatar方法的具体用法?PHP Helper::getUserAvatar怎么用?PHP Helper::getUserAvatar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Library\Utility\Helper
的用法示例。
在下文中一共展示了Helper::getUserAvatar方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAuthenticatedUserInfo
public function getAuthenticatedUserInfo()
{
$auth = $this->getServiceLocator()->get('library_backoffice_auth');
$userDomain = new \DDD\Domain\User\User();
if (!$auth->getIdentity()) {
return false;
}
$userInfo = $auth->getIdentity();
$userDomain->setId($userInfo->id);
$userDomain->setFirstname($userInfo->firstname);
$userDomain->setLastname($userInfo->lastname);
$userDomain->setEmail($userInfo->email);
$userDomain->setCity_id($userInfo->cityId);
$userDomain->setCountry_id($userInfo->countryId);
$userDomain->setAvatar($userInfo->avatar);
$userInfoArray = ['id' => $userDomain->getId(), 'firstname' => $userDomain->getFirstname(), 'lastname' => $userDomain->getLastname(), 'email' => $userDomain->getEmail(), 'cityId' => $userDomain->getCity_id(), 'countryId' => $userDomain->getCountry_id()];
$incidentPermission = $auth->hasRole(Roles::ROLE_MOBILE_INCIDENT_REPORT) ? true : false;
$warehousePermission = $auth->hasRole(Roles::ROLE_MOBILE_ASSET_MANAGER) ? true : false;
$userInfoArray['permissions']['warehouse'] = $warehousePermission;
$userInfoArray['permissions']['incident'] = $incidentPermission;
$userInfoArray['profileUrl'] = 'https:' . Helper::getUserAvatar($userDomain, 'big');
return $userInfoArray;
}
示例2: fetchAll
/**
* @api {get} API_DOMAIN/ginosi-link/users User List
* @apiVersion 1.0.0
* @apiName GetUser
* @apiGroup User
*
* @apiDescription This method returns the list of all users
*
* @apiHeader {String} Content-Type application/json
* @apiHeader {String} Authorization Bearer ACCESS_TOKEN
*
* @apiSuccess {Int} id The unique identification of the user
* @apiSuccess {String} firstname The first name of the user
* @apiSuccess {String} lastname The last name of the user
* @apiSuccess {String} avatar The profile picture of the user
*
* @apiSuccessExample {json} Sample Response:
* HTTP/1.1 200 OK
* [
* {
* "id": "12",
* "firstname": "App",
* "lastname": "User",
* "avatar": "https://images.ginosi.com/profile/12/1439802421_0_150.png"
* }
* ]
*
* @param array $params
* @return \Zend\Db\ResultSet\ResultSet
*/
public function fetchAll($params = array())
{
try {
$auth = $this->serviceLocator->get('library_backoffice_auth');
$requestHandler = $this->serviceLocator->get('Service\\RequestHandler');
$userManagerDao = new \DDD\Dao\User\UserManager($this->serviceLocator, 'ArrayObject');
$countryId = $auth->getIdentity()->countryId;
$usersInfo = $userManagerDao->getUserByCountry($countryId, ['id', 'firstname', 'lastname', 'avatar']);
$usersInfoArray = [];
foreach ($usersInfo as $userInfo) {
$userInfo['avatar'] = 'https:' . Helper::getUserAvatar($userInfo, 'big');
$usersInfoArray[] = $userInfo;
}
return $usersInfoArray;
} catch (\Exception $e) {
return $requestHandler->handleException($e);
}
}