当前位置: 首页>>代码示例>>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;未经允许,请勿转载。