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


PHP Summit::Presentations方法代码示例

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


在下文中一共展示了Summit::Presentations方法的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::Presentations方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。