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


PHP ParseQuery::notContainedIn方法代碼示例

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


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

示例1: testNotContainedInQueries

 public function testNotContainedInQueries()
 {
     Helper::clearClass("BoxedNumber");
     $this->saveObjects(10, function ($i) {
         $boxedNumber = ParseObject::create("BoxedNumber");
         $boxedNumber->set("number", $i);
         return $boxedNumber;
     });
     $query = new ParseQuery("BoxedNumber");
     $query->notContainedIn("number", [3, 5, 7, 9, 11]);
     $results = $query->find();
     $this->assertEquals(6, count($results), 'Did not return correct number of objects.');
 }
開發者ID:rvdavid,項目名稱:parse-php-sdk,代碼行數:13,代碼來源:ParseQueryTest.php

示例2: results

        private function results()
        {
            global $wp_query, $post, $wtd_plugin, $wtd_connector;
            $res_id = get_post_meta($post->ID, 'res_id', true);
            $parent_cat_id = get_query_var('wtdc');
            $cat_id = get_query_var('wtds');
            $excluded_cats = json_decode(get_option('wtd_excluded_cats'));
            if (empty($cat_id) & isset($_GET['wtds'])) {
                $cat_id = $_GET['wtds'];
            }
            // get parent category
            $query = new ParseQuery('resortParentCategories');
            $parent_cat = $query->get($parent_cat_id);
            // get category if its set
            if (!empty($cat_id)) {
                $query = new ParseQuery('resortCategory');
                $cat = $query->get($cat_id);
            }
            // parent restriction query
            $parent_cat_query = new ParseQuery('resortParentCategories');
            $parent_cat_query->equalTo('objectId', $parent_cat_id);
            // subcategory query
            $query = new ParseQuery('resortCategory');
            $query->matchesQuery('parentResCatObjectId', $parent_cat_query);
            $query->equalTo('deleted', false);
            $query->greaterThan('activityCnt', 0);
            if (!empty($excluded_cats)) {
                $query->notContainedIn('objectId', $excluded_cats);
            }
            $query->ascending('name');
            try {
                $categories = $query->find();
            } catch (\Parse\ParseException $ex) {
                var_dump($ex);
            }
            ?>
            <link rel="stylesheet" href="<?php 
            echo WTD_PLUGIN_URL . 'assets/css/wtd_activities_page.css?wtd_version=' . WTD_VERSION;
            ?>
" media="screen"/>
	        <div ng-app="activitiesApp" ng-controller="activitiesCtrl">
	            <div layout="row" layout-padding><?php 
            if ($wtd_plugin['act_page_type'] == 3) {
                ?>
	                    <ul layout="column"><?php 
                for ($i = 0; $i < count($categories); $i++) {
                    $category = $categories[$i];
                    $category_url_name = strtolower($parent_cat->get('name'));
                    $category_url_name = str_replace(' ', '-', $category_url_name);
                    $category_url_name = str_replace('/', '-', $category_url_name);
                    $subcategory_url_name = strtolower($category->get('name'));
                    $subcategory_url_name = str_replace(' ', '-', $subcategory_url_name);
                    $subcategory_url_name = str_replace(',', '', $subcategory_url_name);
                    $subcategory_url_name = str_replace('/', '-', $subcategory_url_name);
                    $url = site_url() . '/' . $post->post_name . '/whattodo/' . $category_url_name . '/' . $parent_cat->getObjectId() . '/' . $subcategory_url_name . '/' . $category->getObjectId() . '/';
                    ?>
		                        <li class="wtd_subcategory_menu_item <?php 
                    echo $category->getObjectId() == $wp_query->query['wtds'] ? 'active' : '';
                    ?>
">
		                            <a href="<?php 
                    echo $url;
                    ?>
"><?php 
                    echo $category->get('name');
                    ?>
</a>
		                        </li><?php 
                }
                ?>
	                    </ul><?php 
            }
            if ($wtd_plugin['act_page_type'] == 2) {
                $column_size = 100;
            } else {
                $column_size = 75;
            }
            ?>
	                <div layout="row" layout-align="center start" ng-hide="progress == false" layout-padding flex="100">
		                <md-progress-circular class="md-primary" md-mode="indeterminate"></md-progress-circular>
	                </div>
	                <div layout="column" flex="<?php 
            echo $column_size;
            ?>
" flex-sm="100" ng-hide="progress == true">
	                    <div layout="row" style="margin-bottom: 5px;">
		                    <a id="parent_<?php 
            echo $post->ID;
            ?>
_header" href="<?php 
            echo get_post_permalink($post->ID);
            ?>
" class="wtd_pull_left"><?php 
            echo $post->post_title;
            ?>
		                    </a><?php 
            if (!empty($parent_cat_id)) {
                $category_url_name = strtolower($parent_cat->get('name'));
                $category_url_name = str_replace(' ', '-', $category_url_name);
                //http://realty.home/vail-valley-activities/whattodo/spa-&-fitness/ZUNm0C89zy/fitness-centers/QoljJWroB8/
//.........這裏部分代碼省略.........
開發者ID:ActiveWebsite,項目名稱:BoojPressPlugins,代碼行數:101,代碼來源:wtd_parse_activities_page.class.php


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