当前位置: 首页>>代码示例>>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;未经允许,请勿转载。