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


PHP Q::order方法代码示例

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


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

示例1: models_json

 public function models_json()
 {
     usleep(500000);
     $object_list = C(ChatMessage)->find_all(Q::gt('id', $this->inVars('since_id', 0)), Q::order('-id'));
     echo self::models_to_jsonp(array_reverse($object_list), $this->inVars('callback', 'callback'));
     exit;
 }
开发者ID:riaf,项目名称:ringl,代码行数:7,代码来源:ChatServer.php

示例2: edit

 /**
  * ページ編集
  */
 public function edit($name)
 {
     $this->vars('name', $name);
     try {
         $current = C(WikiPage)->find_get(Q::eq('name', $name), Q::order('-version'));
     } catch (Exception $e) {
     }
     if ($this->is_post()) {
         try {
             $page = new WikiPage();
             $page->cp($this->vars());
             if (isset($current)) {
                 $page->version($current->version() + 1);
             }
             $page->save();
             C($page)->commit();
             $this->redirect_method('model', $name);
         } catch (Exception $e) {
             $this->vars('page', $page);
             $this->vars('body', $page->body());
         }
     } else {
         if (isset($current)) {
             $this->vars('page', $current);
             $this->vars('body', $current->body());
         } else {
             $default = new WikiPage();
             $default->name($name);
             $this->vars('page', $default);
             $this->vars('body', '*' . $name);
         }
     }
 }
开发者ID:riaf,项目名称:rhaco2-repository,代码行数:36,代码来源:Wiki.php

示例3: last_activity

 public function last_activity()
 {
     try {
         return C(OpenpearTimeline)->find_get(Q::eq('maintainer_id', $this->id()), Q::order('-created'))->created();
     } catch (Exception $e) {
         return $this->created();
     }
 }
开发者ID:nequal,项目名称:Openpear,代码行数:8,代码来源:OpenpearMaintainer.php

示例4: models

 public function models()
 {
     $paginator = new Paginator(50, $this->inVars('page', 1));
     $object_list = C(ChatMessage)->find_all(Q::order('-id'), $paginator);
     $this->vars('object_list', array_reverse($object_list));
     $since_id = 0;
     foreach ($object_list as $object) {
         $since_id = $object->id() > $since_id ? $object->id() : $since_id;
     }
     $this->vars('since_id', $since_id);
     return $this;
 }
开发者ID:riaf,项目名称:ringl,代码行数:12,代码来源:Chat.php

示例5: get_by_maintainer

 public static function get_by_maintainer(OpenpearMaintainer $maintainer, $limit = 20)
 {
     try {
         $favorites = C(OpenpearFavorite)->find_all(Q::eq('maintainer_id', $maintainer->id()));
         $charges = C(OpenpearCharge)->find_all(Q::eq('maintainer_id', $maintainer->id()));
         $ids = array();
         foreach ($favorites as $f) {
             $ids[] = $f->package_id();
         }
         foreach ($charges as $c) {
             $ids[] = $c->package_id();
         }
         return C(OpenpearTimeline)->find_all(new Paginator($limit), Q::in('package_id', array_unique($ids)), Q::order('-id'));
     } catch (Exception $e) {
         return array();
     }
 }
开发者ID:nequal,项目名称:Openpear,代码行数:17,代码来源:OpenpearTimeline.php

示例6: find

 /**
  * 検索を実行する
  * @return self
  */
 public static function find()
 {
     $args = func_get_args();
     $dao = new static();
     $query = new \ebi\Q();
     $query->add($dao->__find_conds__());
     if (!empty($args)) {
         call_user_func_array([$query, 'add'], $args);
     }
     $paginator = $query->paginator();
     if ($paginator instanceof \ebi\Paginator) {
         if ($query->is_order_by()) {
             $paginator->order($query->in_order_by(0)->ar_arg1(), $query->in_order_by(0)->type() == Q::ORDER_ASC);
         } else {
             if ($paginator->has_order()) {
                 $query->add(Q::order($paginator->order()));
             }
         }
         $paginator->total(call_user_func_array([get_called_class(), 'find_count'], $args));
         if ($paginator->total() == 0) {
             return [];
         }
     }
     return static::get_statement_iterator($dao, $query);
 }
开发者ID:tokushima,项目名称:ebi,代码行数:29,代码来源:Dao.php

示例7: find_page

 public function find_page($query, Paginator $paginator, $order, $porder = null)
 {
     return C($this)->find_all($paginator, Q::match($query), Q::select_order($order, $porder), Q::order($this->__page_order__()));
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:4,代码来源:Dao.php

示例8: message_sent

 /**
  * 送信したメッセージ
  */
 public function message_sent()
 {
     $user = $this->user();
     $paginator = new Paginator(20, $this->in_vars('page', 1));
     $this->vars('object_list', C(OpenpearMessage)->find_all($paginator, Q::eq('maintainer_from_id', $user->id()), Q::order('-id')));
     $this->vars('paginator', $paginator);
 }
开发者ID:nequal,项目名称:Openpear,代码行数:10,代码来源:OpenpearLogin.php

示例9: atom

 public function atom()
 {
     Atom::convert(module_const('sitename', 'Planet'), url(), C(PlanetEntry)->find_all(new Paginator(20), Q::order('-updated')))->output();
 }
开发者ID:riaf,项目名称:Planet,代码行数:4,代码来源:Planet.php

示例10: package_tags

 public function package_tags()
 {
     // setting package tags
     if (empty($this->package_tags)) {
         try {
             $this->package_tags = C(OpenpearPackageTag)->find_all(Q::eq('package_id', $this->id()), Q::order('-prime'));
         } catch (Exception $e) {
         }
     }
     return $this->package_tags;
 }
开发者ID:nequal,项目名称:Openpear,代码行数:11,代码来源:OpenpearPackage.php

示例11: declare

<?php

declare (ticks=1);
require dirname(__FILE__) . '/__settings__.php';
import('core.Log');
import('core.Request');
Log::disable_display();
import('Chat.ChatServer');
header('application/x-javascript');
$req = new Request();
$object_list = C(ChatMessage)->find_all(Q::gt('id', $req->inVars('since_id', 0)), Q::order('-id'));
if (count($object_list) > 0) {
    echo ChatServer::models_to_jsonp(array_reverse($object_list), $req->inVars('callback', 'callback'));
    exit;
}
$server = new ChatServer();
pcntl_signal(SIGTERM, array(&$server, 'models_json'));
pcntl_signal(SIGHUP, array(&$server, 'models_json'));
pcntl_signal(SIGUSR1, array(&$server, 'models_json'));
sleep(def('chat@timeout'));
开发者ID:riaf,项目名称:ringl,代码行数:20,代码来源:server.php

示例12: fetch_queues

 public static function fetch_queues($type, $limit = 5)
 {
     return C(OpenpearQueue)->find_all(new Paginator($limit), Q::lt('locked', time()), Q::eq('type', $type), Q::order('updated'));
 }
开发者ID:nequal,项目名称:Openpear,代码行数:4,代码来源:OpenpearQueue.php

示例13: timeline_atom_maintainer

 /**
  * メンテナのタイムラインをAtomフィードで出力
  * @param string $maintainer_name メンテナのアカウント名
  */
 public function timeline_atom_maintainer($maintainer_name)
 {
     // TODO 仕様の確認
     $maintainer = C(OpenpearMaintainer)->find_get(Q::eq('name', $maintainer_name));
     Atom::convert('Openpear Maintainer Timelines: ' . $maintainer->name(), url('timelines.atom'), C(OpenpearTimeline)->find_all(new Paginator(20), Q::eq('maintainer_id', $maintainer->id()), Q::order('-created')))->output();
 }
开发者ID:nequal,项目名称:Openpear,代码行数:10,代码来源:OpenpearNoLogin.php

示例14: dirname

<?php

require_once dirname(__DIR__) . '/__settings__.php';
try {
    $queue = C(OpenpearNewprojectQueue)->find_get(Q::lt('trial_count', 5), Q::order('id'));
    $queue->create();
} catch (Exception $e) {
    # pass
}
开发者ID:nequal,项目名称:Openpear,代码行数:9,代码来源:create_repos.php


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