當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Contest::getInstance方法代碼示例

本文整理匯總了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);
 }
開發者ID:CaribeSoy,項目名稱:contest-wcf,代碼行數:30,代碼來源:ContestSponsorNotificationObject.class.php

示例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;
 }
開發者ID:CaribeSoy,項目名稱:contest-wcf,代碼行數:13,代碼來源:ContestEvent.class.php

示例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);
 }
開發者ID:CaribeSoy,項目名稱:contest-wcf,代碼行數:14,代碼來源:ContestJurytalkNotificationObject.class.php

示例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);
 }
開發者ID:CaribeSoy,項目名稱:contest-wcf,代碼行數:24,代碼來源:ContestSolutionNotificationObject.class.php

示例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());
 }
開發者ID:CaribeSoy,項目名稱:contest-wcf,代碼行數:11,代碼來源:ContestSolution.class.php

示例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();
 }
開發者ID:CaribeSoy,項目名稱:contest-wcf,代碼行數:9,代碼來源:ContestPrice.class.php


注:本文中的Contest::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。