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


PHP Summit::buildSummitListCriteria方法代碼示例

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


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

示例1: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'sites');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('tnam'), array('site_i18n', 'join_site'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 's');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // site criteria
     $has_name = Site::buildSiteListCriteria($criteria, $params_list, true);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // hut criteria
     $has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // parking criteria
     $has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // outing criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'linked_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // user criteria
     $has_name = User::buildUserListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
開發者ID:snouhaud,項目名稱:camptocamp.org,代碼行數:67,代碼來源:Site.class.php

示例2: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'images');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('inam'), array('image_i18n', 'join_image'));
     self::buildOrderCondition($joins_order, $orderby_list, array('odate'), array('outing', 'join_outing'));
     self::buildOrderCondition($joins_order, $orderby_list, array('oid'), array('post_outing', 'join_outing'));
     self::buildOrderCondition($joins, $orderby_list, array('oid', 'odate'), array('post_outing', 'join_outing'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'i');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, true);
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'Join', '', 'join', '');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // document criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lid.main_id', 'docs', 'doc');
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'ldc.linked_id', 'dtags', 'dtag');
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // hut criteria
     $has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // parking criteria
     $has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // route criteria
     $has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // site criteria
     $has_name = Site::buildSiteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // outing criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // user criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'hm.user_id', 'users', 'user_id');
     // TODO here we should restrict to initial uploader (ticket #333)
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lou.main_id', 'ousers', array('ouser_id', 'join_outing', 'post_outing'));
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
開發者ID:snouhaud,項目名稱:camptocamp.org,代碼行數:78,代碼來源:Image.class.php

示例3: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for enabling/disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'outings');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('onam'), array('outing_i18n', 'join_outing'));
     self::buildOrderCondition($joins_order, $orderby_list, array('lat', 'lon'), array('summit', 'join_summit'));
     //FIXME : Don't work : $outings_sort_route_criteria = sfConfig::get('app_outings_sort_route_criteria');
     $outings_sort_route_criteria = array('fac', 'time', 'ralt', 'dhei', 'grat', 'erat', 'prat', 'frat', 'arat', 'irat', 'mrat', 'trat', 'sexpo', 'lrat', 'srat', 'hrat', 'wrat');
     self::buildOrderCondition($joins_order, $orderby_list, $outings_sort_route_criteria, array('route', 'join_route'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'o');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // outing / article criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, true);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // hut criteria
     $has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // parking criteria
     $has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // route criteria
     $has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // site criteria
     $has_name = Site::buildSiteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // user criteria
     $has_name = User::buildUserListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
開發者ID:snouhaud,項目名稱:camptocamp.org,代碼行數:76,代碼來源:Outing.class.php

示例4: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'users');
     // criteria to hide users whithout public profile
     if (!sfContext::getInstance()->getUser()->isConnected()) {
         $conditions[] = 'upd.is_profile_public IS TRUE';
         $joins['user_pd'] = true;
         $joins['join_user'] = true;
         if (isset($joins['all'])) {
             unset($joins['all']);
         }
     }
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('unam'), array('user_i18n', 'join_user'));
     self::buildOrderCondition($joins_order, $orderby_list, array('ufnam'), array('user_pd', 'join_user'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'u');
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', array('go', 'linked_id'), 'oareas', 'oarea');
     if (isset($joins['oarea'])) {
         $joins['join_outing'] = true;
         $joins['post_outing'] = true;
     }
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // user criteria
     $has_name = User::buildUserListCriteria($criteria, $params_list, true);
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'Join', '', 'ijoin', '', 'image');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // outing criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'linked_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // route criteria
     $has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false, 'document_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
開發者ID:snouhaud,項目名稱:camptocamp.org,代碼行數:73,代碼來源:User.class.php

示例5: buildListCriteria

 public static function buildListCriteria($params_list)
 {
     $criteria = $conditions = $values = $joins = $joins_order = array();
     $criteria[0] = array();
     // conditions
     $criteria[1] = array();
     // values
     $criteria[2] = array();
     // joins
     $criteria[3] = array();
     // joins for order
     // criteria for disabling personal filter
     self::buildPersoCriteria($conditions, $values, $joins, $params_list, 'articles');
     // orderby criteria
     $orderby_list = c2cTools::getRequestParameterArray(array('orderby', 'orderby2', 'orderby3'));
     self::buildOrderCondition($joins_order, $orderby_list, array('cnam'), array('article_i18n', 'join_article'));
     // area criteria
     self::buildAreaCriteria($criteria, $params_list, 'a');
     // return if no criteria
     if (isset($joins['all']) || empty($params_list)) {
         $criteria[0] = array_merge($criteria[0], $conditions);
         $criteria[1] = array_merge($criteria[1], $values);
         $criteria[2] += $joins;
         $criteria[3] += $joins_order;
         return $criteria;
     }
     // article criteria
     $has_name = Article::buildArticleListCriteria($criteria, $params_list, true);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // linked document criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'List', 'lcd.main_id', 'cdocs', 'cdoc');
     // summit criteria
     $has_name = Summit::buildSummitListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // hut criteria
     $has_name = Hut::buildHutListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // parking criteria
     $has_name = Parking::buildParkingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // route criteria
     $has_name = Route::buildRouteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // site criteria
     $has_name = Site::buildSiteListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // outing criteria
     $has_name = Outing::buildOutingListCriteria($criteria, $params_list, false, 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // book criteria
     $has_name = Book::buildBookListCriteria($criteria, $params_list, false, 'c', 'main_id');
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // image criteria
     $has_name = Image::buildImageListCriteria($criteria, $params_list, false);
     if ($has_name === 'no_result') {
         return $has_name;
     }
     // user criteria
     self::buildConditionItem($conditions, $values, $joins, $params_list, 'MultiId', array('u', 'main_id'), 'users', 'user_id');
     $criteria[0] = array_merge($criteria[0], $conditions);
     $criteria[1] = array_merge($criteria[1], $values);
     $criteria[2] += $joins;
     $criteria[3] += $joins_order;
     return $criteria;
 }
開發者ID:snouhaud,項目名稱:camptocamp.org,代碼行數:81,代碼來源:Article.class.php


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