/** * Конструктор может быть вызван только из PsUser * * @param int $userId - код пользователя, обязательный параметр * @param array $data - параметры пользователя Могут и не быть */ protected function __construct($userId) { $this->userId = UserBean::inst()->register($userId); $this->canEdit = AuthManager::isIt($userId) || AuthManager::isAuthorizedAsAdmin(); $this->LOGGER = PsLogger::inst(get_called_class()); $this->LOGGER->info('[{}] Instance created, can edit ? {}', $this->userId, var_export($this->canEdit, true)); }