asGroup($group, $strict = false) { $groups = (array) $group; if($strict) { $result = !array_diff($groups, $this->getGroups()); } else { $result = (bool) array_intersect($this->getGroups(), $groups); } return $result; } /** * Returns the password used to authenticate the user. * * This should be the encoded password. On authentication, a plain-text password will be salted, encoded, and * then compared to this value. * * @return string The password */ public function getPassword() { return $this->getData()->password; } /** * Returns the salt that was originally used to encode the password. * * This can return null if the password was not encoded using a salt. * * @return string The salt */ public function getSalt() { return $this->getData()->salt; } /** * The user has been successfully authenticated * * @param boolean $strict If true, checks if the user has been authenticated for this request explicitly * @return Boolean */ public function isAuthentic($strict = false) { return $this->getData()->authentic; } /** * Checks whether the user account is enabled. * * @return Boolean */ public function isEnabled() { return $this->getData()->enabled; } /** * Checks whether the user account has expired. * * @return Boolean */ public function isExpired() { return $this->getData()->expired; } /** * Sets the user as authenticated for the request * * @return $this */ public function setAuthentic() { $this->getData()->authentic = true; return $this; } /** * Get an user attribute * * @param string $identifier Attribute identifier, eg .foo.bar * @param mixed $default Default value when the attribute doesn't exist * @return mixed The value */ public function get($identifier, $default = null) { $attributes = $this->getData()->attributes; $result = $default; if(isset($attributes[$identifier])) { $result = $attributes[$identifier]; } return $result; } /** * Set an user attribute * * @param mixed $identifier Attribute identifier, eg foo.bar * @param mixed $value Attribute value * @return KUserAbstract */ public function set($identifier, $value) { $attributes = $this->getData()->attributes; $attributes[$identifier] = $value; return $this; } /** * Check if a user attribute exists * * @param string $identifier Attribute identifier, eg foo.bar * @return boolean */ public function has($identifier) { $attributes = $this->getData()->attributes; if(isset($attributes[$identifier])) { return true; } return false; } /** * Removes an user attribute * * @param string $identifier Attribute identifier, eg foo.bar * @return KUserAbstract */ public function remove($identifier) { if(isset($attributes[$identifier])) { unset($attributes[$identifier]); } return $this; } /** * Check if the user is equal * * @param KObjectInterface|KUserInterface $user * @return Boolean */ public function equals(KObjectInterface $user) { if($user instanceof KUserInterface) { if($user->getEmail() == $this->getEmail()) { if($user->getPassword() == $this->getPassword()) { return true; } } } return false; } /** * Get the user data as an array * * @return array An associative array of data */ public function toArray() { return KObjectConfig::unbox($this->getData()); } /** * Dumping user object * * @return mixed */ public function __debugInfo() { return $this->toArray(); } }Error