mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-20 04:20:55 +01:00
06aa207960
Summary: Ref T10054. This primarily improves aesthetics and consistency for member/wathcher lists in projects. Test Plan: {F1068873} {F1068874} Reviewers: chad Reviewed By: chad Maniphest Tasks: T10054 Differential Revision: https://secure.phabricator.com/D15103
46 lines
1.1 KiB
PHP
46 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class PhabricatorUserProfile extends PhabricatorUserDAO {
|
|
|
|
protected $userPHID;
|
|
protected $title;
|
|
protected $blurb;
|
|
protected $profileImagePHID;
|
|
protected $icon;
|
|
|
|
public static function initializeNewProfile(PhabricatorUser $user) {
|
|
$default_icon = PhabricatorPeopleIconSet::getDefaultIconKey();
|
|
|
|
return id(new self())
|
|
->setUserPHID($user->getPHID())
|
|
->setIcon($default_icon);
|
|
}
|
|
|
|
protected function getConfiguration() {
|
|
return array(
|
|
self::CONFIG_COLUMN_SCHEMA => array(
|
|
'title' => 'text255',
|
|
'blurb' => 'text',
|
|
'profileImagePHID' => 'phid?',
|
|
'icon' => 'text32',
|
|
),
|
|
self::CONFIG_KEY_SCHEMA => array(
|
|
'userPHID' => array(
|
|
'columns' => array('userPHID'),
|
|
'unique' => true,
|
|
),
|
|
),
|
|
) + parent::getConfiguration();
|
|
}
|
|
|
|
public function getDisplayTitle() {
|
|
$title = $this->getTitle();
|
|
if (strlen($title)) {
|
|
return $title;
|
|
}
|
|
|
|
$icon_key = $this->getIcon();
|
|
return PhabricatorPeopleIconSet::getIconName($icon_key);
|
|
}
|
|
|
|
}
|