/** * constructor * * @param User $user User that's missing a profile */ public function __construct(User $user) { $this->user = $user; // TRANS: Exception text shown when no profile can be found for a user. // TRANS: %1$s is a user nickname, $2$d is a user ID (number). $message = sprintf(_('User %1$s (%2$d) has no profile record.'), $user->nickname, $user->id); parent::__construct($user->id, $message); }
/** * constructor * * @param User_group $user User_group that's missing a profile */ public function __construct(User_group $group) { $this->group = $group; // TRANS: Exception text shown when no profile can be found for a group. // TRANS: %1$s is a group nickname, $2$d is a group profile_id (number). $message = sprintf(_('User %1$s (%2$d) has no profile record.'), $group->nickname, $group->id); parent::__construct($group->profile_id, $message); }