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


PHP Area::sortAssociatedAreas方法代码示例

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


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

示例1: executeList

 /**
  * Executes list action, adding parkings linked to routes
  */
 public function executeList()
 {
     parent::executeList();
     $nb_results = $this->nb_results;
     if ($nb_results == 0) {
         return;
     }
     $timer = new sfTimer();
     $routes = $this->query->execute(array(), Doctrine::FETCH_ARRAY);
     c2cActions::statsdTiming('pager.getResults', $timer->getElapsedTime());
     // if they are criterias on the summit (snam, srnam, salt, styp)
     // we might have only some of the associated summits and not the 'best one' (ticket #337)
     // so we must add a new request to get the summits, display the best one and add a note to explain that the
     // other summit is associated
     // FIXME would be nice to put all in a single request (before), but I didn't manage to do it
     // TODO not working right now
     //if ($this->hasRequestParameter('snam') || $this->hasRequestParameter('srnam') ||
     //    $this->hasRequestParameter('salt') || $this->hasRequestParameter('styp'))
     //{
     // $routes = Route::addBestSummitName($routes, '');
     //}
     $timer = new sfTimer();
     Parking::addAssociatedParkings($routes, 'pr');
     // add associated parkings infos to $routes
     c2cActions::statsdTiming('parking.addAssociatedParkings', $timer->getElapsedTime());
     $timer = new sfTimer();
     Document::countAssociatedDocuments($routes, 'ro', true);
     // number of associated outings
     c2cActions::statsdTiming('document.countAssociatedDocuments', $timer->getElapsedTime());
     Area::sortAssociatedAreas($routes);
     $this->items = Language::parseListItems($routes, 'Route');
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:35,代码来源:actions.class.php

示例2: executeList

 /**
  * Executes list action
  */
 public function executeList()
 {
     parent::executeList();
     $nb_results = $this->nb_results;
     if ($nb_results == 0) {
         return;
     }
     $timer = new sfTimer();
     $summits = $this->query->execute(array(), Doctrine::FETCH_ARRAY);
     c2cActions::statsdTiming('pager.getResults', $timer->getElapsedTime());
     $timer = new sfTimer();
     Document::countAssociatedDocuments($summits, 'sr', true);
     c2cActions::statsdTiming('document.countAssociatedDocuments', $timer->getElapsedTime());
     Area::sortAssociatedAreas($summits);
     $this->items = Language::parseListItems($summits, 'Summit');
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:19,代码来源:actions.class.php

示例3: executeList

 /**
  * Executes list action, adding ratings from routes linked to outings
  */
 public function executeList()
 {
     // redirect to user outings list if connected and if myoutings criteria is set
     if ($this->getUser()->isConnected() && $this->getRequestParameter('myoutings')) {
         sfLoader::loadHelpers(array('Pagination'));
         $user_id = $this->getUser()->getId();
         $this->redirect(_addUrlParameters(_getBaseUri(), array('myoutings'), array('users' => $user_id)));
     }
     // TODO something to do if outings where filtered on route ratings?
     parent::executeList();
     $format = $this->format;
     if (in_array('cond', $format) && !in_array('json', $format)) {
         $this->setTemplate('conditions');
         if (in_array('full', $format)) {
             $this->setPageTitle($this->__('conditions and comments'));
         } else {
             $this->setPageTitle($this->__('recent conditions'));
         }
     }
     $nb_results = $this->nb_results;
     if ($nb_results == 0) {
         return;
     }
     $show_images = $this->show_images;
     $timer = new sfTimer();
     $outings = $this->query->execute(array(), Doctrine::FETCH_ARRAY);
     c2cActions::statsdTiming('pager.getResults', $timer->getElapsedTime());
     $timer = new sfTimer();
     $outings = Outing::getAssociatedCreatorData($outings);
     // retrieve outing creator names
     c2cActions::statsdTiming('outing.getAssociatedCreatorData', $timer->getElapsedTime());
     $timer = new sfTimer();
     $outings = Outing::getAssociatedRoutesData($outings);
     // retrieve associated route ratings
     c2cActions::statsdTiming('outing.getAssociatedRoutesData', $timer->getElapsedTime());
     if (!in_array('list', $format)) {
         $timer = new sfTimer();
         $outings = Language::getTheBestForAssociatedAreas($outings);
         c2cActions::statsdTiming('language.getTheBestForAssociatedAreas', $timer->getElapsedTime());
     }
     // add images infos
     if ($show_images) {
         $timer = new sfTimer();
         Image::addAssociatedImages($outings, 'oi');
         c2cActions::statsdTiming('image.addAssociatedImages', $timer->getElapsedTime());
     }
     Area::sortAssociatedAreas($outings);
     $this->items = Language::parseListItems($outings, 'Outing', !$show_images);
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:52,代码来源:actions.class.php

示例4: executeList

 /**
  * Executes list action
  */
 public function executeList()
 {
     parent::executeList();
     $nb_results = $this->nb_results;
     if ($nb_results == 0) {
         return;
     }
     $timer = new sfTimer();
     $sites = $this->query->execute(array(), Doctrine::FETCH_ARRAY);
     c2cActions::statsdTiming('pager.getResults', $timer->getElapsedTime());
     $timer = new sfTimer();
     Parking::addAssociatedParkings($sites, 'pt');
     // add associated parkings infos to $sites
     c2cActions::statsdTiming('parking.addAssociatedParkings', $timer->getElapsedTime());
     $timer = new sfTimer();
     Document::countAssociatedDocuments($sites, 'to', true);
     c2cActions::statsdTiming('document.countAssociatedDocuments', $timer->getElapsedTime());
     Area::sortAssociatedAreas($sites);
     $this->items = Language::parseListItems($sites, 'Site');
 }
开发者ID:snouhaud,项目名称:camptocamp.org,代码行数:23,代码来源:actions.class.php


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