libretime/legacy/application/services/UserService.php

27 lines
542 B
PHP
Raw Permalink Normal View History

<?php
class Application_Service_UserService
{
private $currentUser;
public function __construct()
{
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
if (!is_null($userInfo->id)) {
$this->currentUser = CcSubjsQuery::create()->findPK($userInfo->id);
}
}
/**
2021-10-11 16:10:47 +02:00
* Returns a CcSubjs object.
*/
public function getCurrentUser()
{
if (is_null($this->currentUser)) {
throw new Exception();
}
return $this->currentUser;
}
2021-10-11 16:10:47 +02:00
}