public $__table = 'user_group'; // table name
public $id; // int(4) primary_key not_null
+ public $profile_id; // int(4) primary_key not_null
public $nickname; // varchar(64)
public $fullname; // varchar(191) not 255 because utf8mb4 takes more space
public $homepage; // varchar(191) not 255 because utf8mb4 takes more space
return $this->getProfile()->getNickname();
}
+ public function getFullname()
+ {
+ return $this->getProfile()->getFullname();
+ }
+
public static function defaultLogo($size)
{
static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile',
function homeUrl()
{
- $url = null;
- if (Event::handle('StartUserGroupHomeUrl', array($this, &$url))) {
- // normally stored in mainpage, but older ones may be null
- if (!empty($this->mainpage)) {
- $url = $this->mainpage;
- } elseif ($this->isLocal()) {
- $url = common_local_url('showgroup',
- array('nickname' => $this->nickname));
- }
- }
- Event::handle('EndUserGroupHomeUrl', array($this, &$url));
- return $url;
+ return $this->getProfile()->getUrl();
}
function getUri()
function getNotices($offset, $limit, $since_id=null, $max_id=null)
{
- $stream = new GroupNoticeStream($this);
+ // FIXME: Get the Profile::current() some other way, to avoid
+ // possible confusion between current session and queue process.
+ $stream = new GroupNoticeStream($this, Profile::current());
return $stream->getNotices($offset, $limit, $since_id, $max_id);
}