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


PHP Artist::setOid方法代码示例

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


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

示例1: getBeanFromRequest

 /**
  * Instantiates an Exhibition bean object and copies all
  * valid incoming form elements to the bean object
  * @return The valid Exhibition bean
  */
 protected function getBeanFromRequest()
 {
     global $logger;
     $logger->debug(get_class($this) . "::getBeanFromRequest()");
     $service = $this->getEventService();
     // TODO: Add validator here
     $exhibit = new Exhibition($_REQUEST);
     $logger->debug("exhibition object: {$exhibit}");
     if (isset($_REQUEST['displayOrder']) && intval($_REQUEST['displayOrder']) > 0) {
         $exhibit->setDisplayOrder($_REQUEST['displayOrder']);
     }
     // Format the times
     $logger->debug("Start Time: " . $_REQUEST['startMonth'] . "," . $_REQUEST['startDay'] . "," . $_REQUEST['startYear']);
     $startTime = mktime(0, 0, 0, $_REQUEST['startMonth'], $_REQUEST['startDay'], $_REQUEST['startYear']);
     $logger->debug("Start Time (mktime)" . $startTime);
     // find out if this is a recurring event
     $endTime = mktime(0, 0, 0, $_REQUEST['endMonth'], $_REQUEST['endDay'], $_REQUEST['endYear']);
     if ($_REQUEST['close_type'] == 'ongoing') {
         $endTime = 0;
     }
     // load the schedule
     $schedule = new Schedule();
     if (isset($_REQUEST['scheduleOid'])) {
         $schedule->setOid(intval($_REQUEST['scheduleOid']));
     }
     $schedule->setStartTime($startTime);
     $schedule->setEndTime($endTime);
     $exhibit->setSchedule($schedule);
     // venues
     if (isset($_REQUEST['venue'])) {
         $venues = array();
         foreach ($_REQUEST['venue'] as $oid) {
             $venue = new Venue();
             $venue->setOid($oid);
             $venues[] = $venue;
         }
         $logger->debug("Number of venues in the form: " . count($venues));
         $exhibit->setVenues($venues);
     }
     // categories
     $cats = array();
     if (isset($_REQUEST['audience'])) {
         foreach ($_REQUEST['audience'] as $oid) {
             $category = new Audience();
             $category->setOid($oid);
             $cats['audience'][] = $category;
         }
     }
     if (isset($_REQUEST['genre'])) {
         foreach ($_REQUEST['genre'] as $oid) {
             $category = new Genre();
             $category->setOid($oid);
             $cats['genre'][] = $category;
         }
     }
     if (isset($cats['audience'])) {
         $logger->debug("Number of audience categories in the form: " . count($cats['audience']));
     }
     if (isset($cats['genre'])) {
         $logger->debug("Number of genre categories in the form: " . count($cats['genre']));
     }
     if (isset($cats['audience']) || isset($cats['genre'])) {
         $exhibit->setCategories($cats);
     }
     // related events
     $events = array();
     if (isset($_REQUEST['program'])) {
         foreach ($_REQUEST['program'] as $oid) {
             $program = new Program();
             $program->setOid($oid);
             $events[] = $program;
         }
     }
     if (isset($events)) {
         $logger->debug("Number of related programs in the form: " . count($events));
         $exhibit->setPrograms($events);
     }
     $events = array();
     if (isset($_REQUEST['course'])) {
         foreach ($_REQUEST['course'] as $oid) {
             $course = new Course();
             $course->setOid($oid);
             $events[] = $course;
         }
     }
     if (isset($events)) {
         $logger->debug("Number of related courses in the form: " . count($events));
         $exhibit->setCourses($events);
     }
     // gallery
     if (isset($_REQUEST['gallery'])) {
         $exhibit->setGallery($_REQUEST['gallery']);
     }
     // artists
     if (isset($_REQUEST['person'])) {
//.........这里部分代码省略.........
开发者ID:justinlyon,项目名称:scc,代码行数:101,代码来源:ExhibitionAction.php


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