本文整理汇总了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]);
}
示例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;
}
示例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);
}