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


PHP Entry::Find方法代码示例

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


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

示例1: sdkLoader

 public function sdkLoader()
 {
     // Variables
     $category = [];
     $cart = [];
     unset($_SESSION);
     // Load the SDK
     $moltin = new \Moltin\SDK\SDK(new \Moltin\SDK\Storage\Session(), new \Moltin\SDK\Request\CURL(), ['url' => isset($this->config['moltin_api_url']) ? $this->config['moltin_api_url'] : null, 'auth_url' => isset($this->config['moltin_api_auth_url']) ? $this->config['moltin_api_auth_url'] : null, 'version' => isset($this->config['moltin_api_version']) ? $this->config['moltin_api_version'] : null]);
     \Moltin::Authenticate('ClientCredentials', ['client_id' => $this->config['api_client_id'], 'client_secret' => $this->config['api_client_secret']]);
     try {
         // Get categories
         $categories = \Category::Tree(['status' => 1]);
     } catch (\Exception $e) {
         exit($e->getMessage());
     }
     try {
         // Get cart contents
         $cart = \Cart::Contents()['result'];
     } catch (\Exception $e) {
         exit($e->getMessage());
     }
     try {
         // Get pages
         $pages = \Entry::Find('page', ['status' => 1])['result'];
     } catch (\Exception $e) {
         exit($e->getMessage());
     }
     // add cart to app - so it can be accessed in controllers
     $this->app->cart = $cart;
     // Assign to view
     $this->app->view()->appendData(['categories' => $categories['result'], 'cart' => $cart]);
 }
开发者ID:beyondusability,项目名称:moltin-framework,代码行数:32,代码来源:Moltin.php

示例2: cache_ping_counts

 public function cache_ping_counts($entry_list)
 {
     $ids = array();
     foreach ($entry_list as $entry_id) {
         if (!isset($this->_ping_count_cache[$entry_id])) {
             $ids[] = $entry_id;
             $this->_ping_count_cache[$entry_id] = 0;
         }
     }
     if (empty($ids)) {
         return;
     }
     $id_list = implode(",", $ids);
     if (empty($id_list)) {
         return;
     }
     $where = "entry_id in ({$id_list})";
     require_once 'class.mt_entry.php';
     $entry = new Entry();
     $entries = $entry->Find($where);
     if (!empty($results)) {
         foreach ($entries as $e) {
             $this->_ping_count_cache[$e->id] = $e->ping_count;
         }
     }
     return true;
 }
开发者ID:OCMO,项目名称:movabletype,代码行数:27,代码来源:mtdb.base.php

示例3: get_archive_list_data

 protected function get_archive_list_data($args)
 {
     $mt = MT::get_instance();
     $blog_id = $args['blog_id'];
     $order = $args['sort_order'] == 'ascend' ? 'asc' : 'desc';
     $sql = "\n                entry_blog_id = {$blog_id}\n                and entry_status = 2\n                and entry_class = 'entry'\n                order by entry_authored_on {$order}";
     $extras = array();
     $extras['limit'] = isset($args['lastn']) ? $args['lastn'] : -1;
     $extras['offset'] = isset($args['offset']) ? $args['offset'] : -1;
     require_once 'class.mt_entry.php';
     $entry = new Entry();
     $results = $entry->Find($sql, false, false, $extras);
     return empty($results) ? null : array($results, null, null);
 }
开发者ID:keita-pg,项目名称:takahashi.site,代码行数:14,代码来源:archive_lib.php


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