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


PHP Summit::getSummitDateRange方法代碼示例

本文整理匯總了PHP中Summit::getSummitDateRange方法的典型用法代碼示例。如果您正苦於以下問題:PHP Summit::getSummitDateRange方法的具體用法?PHP Summit::getSummitDateRange怎麽用?PHP Summit::getSummitDateRange使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Summit的用法示例。


在下文中一共展示了Summit::getSummitDateRange方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createSummitJSON

 /**
  * @param Summit $s
  * @return array
  */
 protected function createSummitJSON(Summit $s)
 {
     $page = SummitPage::get()->filter('SummitID', $s->ID)->first();
     $image = null;
     if ($page) {
         $image = $page->SummitImage()->Image();
     }
     return ['id' => $s->ID, 'title' => $s->Title, 'dates' => $s->getSummitDateRange(), 'videoCount' => PresentationVideo::get()->filter(['DisplayOnSite' => true, 'Processed' => true, 'PresentationID' => $s->Presentations()->column('ID')])->count(), 'imageURL' => $image && $image->exists() && Director::fileExists($image->Filename) ? $image->CroppedImage(263, 148)->URL : 'summit-video-app/production/images/placeholder-image.jpg'];
 }
開發者ID:hogepodge,項目名稱:openstack-org,代碼行數:13,代碼來源:SummitVideoAppBackend.php

示例2: createSummitJSON

 /**
  * @param Summit $s
  * @return array
  */
 protected function createSummitJSON(Summit $s)
 {
     $page = SummitPage::get()->filter('SummitID', $s->ID)->first();
     $image = null;
     if ($page) {
         $image = $page->SummitImage()->Image();
     }
     $tracks = array_map(function ($t) {
         return ['id' => $t->ID, 'slug' => $t->Slug, 'title' => $t->Title, 'has_videos' => 0];
     }, $s->Categories()->toArray());
     $videos = PresentationVideo::get()->filter(['DisplayOnSite' => true, 'Processed' => true])->sort('DateUploaded', 'DESC')->innerJoin('Presentation', 'Presentation.ID = PresentationMaterial.PresentationID')->innerJoin('SummitEvent', 'SummitEvent.ID = PresentationMaterial.PresentationID')->filter('SummitEvent.SummitID', $s->ID);
     $videos_groupedby_track = GroupedList::create($videos)->groupBy('Track');
     foreach ($tracks as &$track) {
         if (array_key_exists($track['title'], $videos_groupedby_track)) {
             $track['has_videos'] = 1;
         }
     }
     return ['id' => $s->ID, 'title' => $s->Title, 'dates' => $s->getSummitDateRange(), 'videoCount' => PresentationVideo::get()->filter(['DisplayOnSite' => true, 'Processed' => true, 'PresentationID' => $s->Presentations()->column('ID')])->count(), 'imageURL' => $image && $image->exists() && Director::fileExists($image->Filename) ? $image->CroppedImage(263, 148)->URL : 'summit-video-app/production/images/placeholder-image.jpg', 'slug' => $s->Slug, 'tracks' => $tracks];
 }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:23,代碼來源:SummitVideoAppBackend.php


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