* @copyright 2014 Fabian Grutschus. All rights reserved. * @license BSD * @link http://github.com/fabiang/xmpp */ namespace Fabiang\Xmpp\Protocol\User; /** * User object. * * @package Xmpp\Protocol */ class User { /** * * @var string */ protected $name; /** * * @var string */ protected $jid; /** * * @var string */ protected $subscription; /** * * @var array */ protected $groups = array(); public function getName() { return $this->name; } public function setName($name = null) { if (null === $name || '' === $name) { $this->name = null; } else { $this->name = $name; } return $this; } public function getJid() { return $this->jid; } public function setJid($jid) { $this->jid = (string) $jid; return $this; } public function getSubscription() { return $this->subscription; } public function setSubscription($subscription) { $this->subscription = (string) $subscription; return $this; } public function getGroups() { return $this->groups; } public function setGroups(array $groups) { $this->groups = $groups; return $this; } public function addGroup($group) { $this->groups[] = (string) $group; return $this; } }