当前位置: 首页>>代码示例>>PHP>>正文


PHP pdo::getCourses方法代码示例

本文整理汇总了PHP中pdo::getCourses方法的典型用法代码示例。如果您正苦于以下问题:PHP pdo::getCourses方法的具体用法?PHP pdo::getCourses怎么用?PHP pdo::getCourses使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pdo的用法示例。


在下文中一共展示了pdo::getCourses方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: exhibitionPdoToBean

 /**
  * Converts the given exhibition PDO to a bean object.
  * This includes the conversion from nested lists
  * of PDO objects to usable lists of oids/names to be used
  * by the page renderer.
  *
  * @access private
  * @param pdo $pdo Program
  * @return bean Program
  */
 private function exhibitionPdoToBean($pdo)
 {
     global $logger;
     $logger->debug(get_class($this) . "::exhibitionPdoToBean({$pdo})");
     $bean = new Exhibition($pdo->epGetVars());
     // pubState to a string
     $ps = '';
     if ($pdo->getPubState() != null) {
         $ps = $pdo->getPubState()->getValue();
     }
     $bean->setPubState($ps);
     // eventStatus to a string
     $es = '';
     if ($pdo->getEventStatus() != null) {
         $es = $pdo->getEventStatus()->getValue();
     }
     $bean->setEventStatus($es);
     // schedule
     $schedule = $pdo->getSchedule();
     if ($schedule) {
         $bean->setSchedule(new Schedule($schedule->epGetVars()));
     } else {
         $bean->setSchedule(new Schedule());
     }
     // venues from array of pdos to array of venue bean
     $vens = array();
     if ($pdo->getVenues() != null) {
         foreach ($pdo->getVenues() as $ven) {
             $vens[] = new Venue($ven->epGetVars());
         }
     }
     $bean->setVenues($vens);
     // categories from array of pdos to keyed array of oids
     $cats = array();
     if ($pdo->getCategories() != null) {
         foreach ($pdo->getCategories() as $cat) {
             $scope = $cat->getScope();
             $cats[$scope][] = new $scope($cat->epGetVars());
         }
     }
     $bean->setCategories($cats);
     // related programs from array of pdos to keyed array of oids
     $programs = $pdo->getPrograms();
     if ($programs != null) {
         $related = array();
         foreach ($programs as $event) {
             $rp = new Program($event->epGetVars());
             $ps = $event->getPubState()->getValue();
             $rp->setPubState($ps);
             // primary genre
             if ($event->getPrimaryGenre()) {
                 $pg = $event->getPrimaryGenre();
                 $prpg = new Category(array("oid" => $pg->getOid(), "name" => $pg->getName()));
                 $rp->setPrimaryGenre($prpg);
             }
             $acts = array();
             foreach ($event->getChildren() as $perf) {
                 $sch = new Performance($perf->epGetVars());
                 $sch->setSchedule(new Schedule($perf->schedule->epGetVars()));
                 $acts[] = $sch;
             }
             usort($acts, array(&$this, "orderPerformances"));
             $rp->setChildren($acts);
             // Using "Nextevent" so we can use orderProgramsByNextevent; really is firstEvent
             $rp->setNextevent($acts[0]->schedule->getStartTime());
             $related[] = $rp;
         }
         usort($related, array(&$this, "orderProgramsByNextevent"));
         $bean->setPrograms($related);
     }
     // related courses from array of pdos to keyed array of oids
     $courses = $pdo->getCourses();
     if ($courses != null) {
         $related = array();
         foreach ($courses as $event) {
             $related[] = new Course($event->epGetVars());
         }
         $bean->setCourses($related);
     }
     // related artists
     $artists = $pdo->getArtists();
     if ($artists != null) {
         $related = array();
         foreach ($artists as $person) {
             $related[] = new Artist($person->epGetVars());
         }
         $bean->setArtists($related);
     }
     return $bean;
 }
开发者ID:justinlyon,项目名称:scc,代码行数:100,代码来源:EventService.php


注:本文中的pdo::getCourses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。