本文整理汇总了PHP中Contest::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Contest::getInstance方法的具体用法?PHP Contest::getInstance怎么用?PHP Contest::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Contest
的用法示例。
在下文中一共展示了Contest::getInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getRecipients
/**
* @see ContestNotificationInterface::getRecipients()
*/
public function getRecipients()
{
$ids = array();
switch ($this->state) {
// tell contest owner that s.o. did apply
case 'applied':
require_once WCF_DIR . 'lib/data/contest/Contest.class.php';
$contest = Contest::getInstance($this->contestID);
$ids = array_merge($ids, $contest->getOwner()->getUserIDs());
break;
case 'invited':
$ids = array_merge($ids, $this->getInstance()->getOwner()->getUserIDs());
break;
// tell recipient that s.o. did moderator interaction
// tell recipient that s.o. did moderator interaction
case 'accepted':
$ids = array_merge($ids, $this->getInstance()->getOwner()->getUserIDs());
// maybe the user applied himself, then tell the owners
require_once WCF_DIR . 'lib/data/contest/Contest.class.php';
$contest = Contest::getInstance($this->contestID);
if ($contest->enableSponsorCheck == false) {
$ids = array_merge($ids, $contest->getOwner()->getUserIDs());
}
break;
}
return array_unique($ids);
}
示例2: isDeletable
/**
* Returns true, if the active user can delete this entry.
*
* @return boolean
*/
public function isDeletable()
{
$contest = Contest::getInstance($this->contestID);
if ($contest->isOwner()) {
return true;
}
return false;
}
示例3: getRecipients
/**
* @see ContestNotificationInterface::getRecipients()
*/
public function getRecipients()
{
$ids = array();
// tell all jury members, that a new entry exists
require_once WCF_DIR . 'lib/data/contest/Contest.class.php';
$contest = Contest::getInstance($this->contestID);
foreach ($contest->getJurys() as $jury) {
$ids = array_merge($ids, $jury->getOwner()->getUserIDs());
}
return array_unique($ids);
}
示例4: getRecipients
/**
* @see ContestNotificationInterface::getRecipients()
*/
public function getRecipients()
{
$ids = array();
switch ($this->state) {
// tell contest jury that a solution was commited
case 'applied':
require_once WCF_DIR . 'lib/data/contest/Contest.class.php';
$contest = Contest::getInstance($this->contestID);
foreach ($contest->getJurys() as $jury) {
$ids = array_merge($ids, $jury->getOwner()->getUserIDs());
}
break;
// tell solution member, that moderator did interaction
// tell solution member, that moderator did interaction
case 'accepted':
case 'declined':
$ids = array_merge($ids, $this->getInstance()->getOwner()->getUserIDs());
break;
}
return array_unique($ids);
}
示例5: isEditable
/**
* Returns true, if the active user can edit this entry.
* the owner of the entry can only change the contest, if it has not been published yet.
* the jury can change the entry if the contest has not finished yet.
*
* @return boolean
*/
public function isEditable()
{
return $this->isOwner() && (in_array($this->state, array('private', 'applied')) || Contest::getInstance($this->contestID)->isJuryable() && Contest::getInstance($this->contestID)->isJury());
}
示例6: isEditable
/**
* Returns true, if the active user can edit this entry.
*
* @return boolean
*/
public function isEditable()
{
return $this->isOwner() || $this->isSponsor() || Contest::getInstance($this->contestID)->isOwner();
}