本文整理汇总了PHP中Partner::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Partner::getName方法的具体用法?PHP Partner::getName怎么用?PHP Partner::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Partner
的用法示例。
在下文中一共展示了Partner::getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(Partner $partner, $content = null)
{
parent::__construct($partner->getWebsiteUrl(), $content);
$this->partner = $partner;
if ($content == null) {
$this->setContent($partner->getName());
}
$this->openNewWindow(true);
}
示例2: getList
/**
* Method used to get the list of users available in the system.
*
* @param boolean $show_customers Whether to return customers or not
* @return array The list of users
*/
public static function getList($show_customers, $show_inactive)
{
// FIXME: what about other statuses like "pending"?
$stmt = 'SELECT
*
FROM
{{%user}}
WHERE
usr_id != ?';
$params = array(APP_SYSTEM_USER_ID);
if (!$show_inactive) {
$stmt .= ' AND usr_status != ?';
$params[] = 'inactive';
}
$stmt .= '
ORDER BY
usr_status ASC,
usr_full_name ASC';
try {
$res = DB_Helper::getInstance()->getAll($stmt, $params);
} catch (DbException $e) {
return '';
}
$data = array();
foreach ($res as &$row) {
$roles = Project::getAssocList($row['usr_id'], false, true);
$role = current($roles);
$role = $role['pru_role'];
if ($show_customers == false && (@$roles[Auth::getCurrentProject()]['pru_role'] == self::getRoleID('Customer') || count($roles) == 1 && $role == self::getRoleID('Customer'))) {
continue;
}
$row['roles'] = $roles;
if (!empty($row['usr_grp_id'])) {
$row['group_name'] = Group::getName($row['usr_grp_id']);
}
if (!empty($row['usr_par_code'])) {
$row['partner_name'] = Partner::getName($row['usr_par_code']);
}
// add email aliases
$row['aliases'] = User::getAliases($row['usr_id']);
$data[] = $row;
}
return $data;
}
示例3: testGetName
public function testGetName()
{
$this->assertEquals(self::STATUS_EXPECTED, $this->partnerStatus->getName());
}
示例4: actionSavePartner
function actionSavePartner($currentUser)
{
$backUrl = $this->context->getFlowScopeAttr("backUrl");
$partnerID = $this->context->getRequestAttr("id");
$partner = new Partner();
$partnerErrs = array();
$partner->setId($this->context->getRequestAttr("id"));
$partner->setPid($this->context->getRequestAttr("projectID"));
$partner->setName($this->context->getRequestAttr("name"));
if (!is_null($partner->getName())) {
$partner->setName(trim($partner->getName()));
if (strlen($partner->getName()) < 1) {
$partner->setName(null);
}
}
if (is_null($partner->getName())) {
$partnerErrs["name"] = "field.error.empty";
}
$partner->setEmail($this->context->getRequestAttr("email"));
if (!is_null($partner->getEmail())) {
$partner->setEmail(trim($partner->getEmail()));
if (strlen($partner->getEmail()) < 1) {
$partner->setEmail(null);
}
}
if (is_null($partner->getEmail())) {
$partnerErrs["email"] = "field.error.empty";
}
$partner->setTelephone($this->context->getRequestAttr("telephone"));
if (!is_null($partner->getTelephone())) {
$partner->setTelephone(trim($partner->getTelephone()));
if (strlen($partner->getTelephone()) < 1) {
$partner->setTelephone(null);
}
}
if (is_null($partner->getTelephone())) {
$partnerErrs["telephone"] = "field.error.empty";
}
$create = $this->context->getRequestAttr("create");
$partner->setCan_create($create == "1" ? true : false);
$timeZone = new DateTimeZone("Europe/Vilnius");
$time = new DateTime("now", $timeZone);
$partner->setR_date($time->format("Y-m-d H:i:s"));
$partner->setR_user($currentUser->getId());
$this->context->setFlashScopeAttr("partner", $partner);
$this->context->setFlashScopeAttr("partnerErrs", $partnerErrs);
if (!is_null($partner->getId())) {
$oldPartner = $this->partnerDao->get($partner->getId());
if (is_null($oldPartner) || is_string($oldPartner)) {
$this->context->setRequestScopeAttr("error", "partner.error.notfound");
$this->cancelPartnerEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
}
$projectID = $partner->getPid();
if (is_null($projectID)) {
$this->context->setRequestScopeAttr("error", "project.error.notfound");
$this->cancelPartnerEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
$project = $this->projectDao->get($projectID);
if (is_null($project)) {
$this->context->setRequestScopeAttr("error", "project.error.notfound");
$this->cancelPartnerEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
} else {
if (is_string($project)) {
$this->context->setRequestScopeAttr("error", "error.dberror");
$this->context->setRequestScopeAttr("errortxt", $project);
$project = null;
$this->cancelPartnerEdit();
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
}
$this->context->setFlashScopeAttr("partnerProject", $project);
if (count($partnerErrs) >= 1) {
if (!is_null($backUrl)) {
header("Location: " . $backUrl);
return true;
}
return false;
}
if (!is_null($partner->getId())) {
if ($oldPartner->getEmail() != $partner->getEmail()) {
//.........这里部分代码省略.........