diff --git a/traits/BlameableTrait.php b/traits/BlameableTrait.php index ee95348..ffe8c9f 100644 --- a/traits/BlameableTrait.php +++ b/traits/BlameableTrait.php @@ -553,7 +553,7 @@ public function getHost() /** * Set host of this model. * @param string $host - * @return type + * @return string|boolean */ public function setHost($host) { diff --git a/traits/SubsidiaryTrait.php b/traits/SubsidiaryTrait.php index e936d65..675ab73 100644 --- a/traits/SubsidiaryTrait.php +++ b/traits/SubsidiaryTrait.php @@ -116,13 +116,13 @@ public function getSubsidiaries($name, $limit = 'all', $page = 0) if (!method_exists($query, 'createdBy')) { return null; } - return $class::find()->createdBy($this)->page($limit, $page)->all(); + return $query->createdBy($this)->page($limit, $page)->all(); } /** * @param $name * @param $arguments - * @return type + * @return mixed */ public function __call($name, $arguments) { @@ -202,7 +202,7 @@ public function create($className, $config = [], $loadDefault = true, $skipIfSet * * @param string $name * @param array $config - * @return type + * @return mixed */ public function createSubsidiary($name, $config) { diff --git a/web/User.php b/web/User.php index 07acf0f..f09fd33 100644 --- a/web/User.php +++ b/web/User.php @@ -21,14 +21,25 @@ class User extends \yii\web\User { private $_access = []; - + + /** + * Get the GUID of identity. + * If no user logged-in, null will be given. + * @return null|string + */ public function getGuid() { $identity = $this->getIdentity(); /* @var $identity BaseUserModel */ return $identity !== null ? $identity->getGUID() : null; } - + + /** + * @param string $permissionName + * @param array $params + * @param bool $allowCaching + * @return bool|mixed + */ public function can($permissionName, $params = [], $allowCaching = true) { if ($allowCaching && empty($params) && isset($this->_access[$permissionName])) { @@ -44,4 +55,4 @@ public function can($permissionName, $params = [], $allowCaching = true) return $access; } -} \ No newline at end of file +}