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


PHP Api::_方法代码示例

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


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

示例1: assert

 public function assert(Rbac $rbac)
 {
     $friendModel = Api::_()->getModel('User\\Model\\Friend');
     $friendDb = $friendModel->getItem()->getDataClass();
     $res = $friendDb->where(array('user_id' => $this->user['id'], 'friend_id' => $this->visitor['id'], 'relationshipStatus' => 'blocked'))->find('one');
     return true;
 }
开发者ID:ahyswang,项目名称:eva-engine,代码行数:7,代码来源:AssertMyBlockedUser.php

示例2: setParameters

 public function setParameters(Parameters $params)
 {
     if ($params->page) {
         $this->enableCount();
         $this->page($params->page);
     }
     if ($params->noLimit) {
         $this->disableLimit();
     }
     if ($params->order == 'eventcountdesc' || $params->order == 'eventcountasc') {
         $eventTagTable = Api::_()->getDbTable('Event\\DbTable\\TagsEvents');
         $eventTagTableName = $eventTagTable->initTableName()->getTable();
         $this->join($eventTagTableName, "id = {$eventTagTableName}.tag_id");
         $this->columns(array('*', 'EventCount' => new Expression("count(event_id)")));
         $this->group('tag_id');
     }
     $orders = array('idasc' => 'id ASC', 'iddesc' => 'id DESC', 'nameasc' => 'tagName ASC', 'namedesc' => 'tagName DESC');
     if ($params->order) {
         $order = $orders[$params->order];
         if ($order) {
             $this->order($order);
         }
     }
     return $this;
 }
开发者ID:ahyswang,项目名称:eva-engine,代码行数:25,代码来源:Tags.php

示例3: setParameters

 public function setParameters(Parameters $params)
 {
     if ($params->page) {
         $this->enableCount();
         $this->page($params->page);
     }
     if ($params->event_id) {
         $this->where(array('event_id' => $params->event_id));
     }
     if ($params->user_id) {
         $this->where(array('user_id' => $params->user_id));
     }
     if ($params->requestStatus) {
         $this->where(array('requestStatus' => $params->requestStatus));
     }
     if ($params->rows) {
         $this->limit((int) $params->rows);
     }
     if ($params->eventStatus) {
         $eventDb = Api::_()->getDbTable('Event\\DbTable\\Events');
         $eventTabName = $eventDb->initTableName()->table;
         $this->join($eventTabName, "{$this->table}.event_id = {$eventTabName}.id", array('*'), 'inner');
         $this->where(array("{$eventTabName}.eventStatus" => $params->eventStatus));
     }
     if ($params->order == 'eventcount') {
         /*
            $this->from(array('b' => $this->table));
            $distinct = new \Zend\Db\Sql\Expression("DISTINCT {$this->table}.user_id");
            $count = new \Zend\Db\Sql\Expression("(SELECT COUNT(*) AS {$this->table}.EventCount FROM b WHERE b.user_id = {$this->table}.user_id)"); 
            $this->columns(array($distinct, $count));
         */
     }
     if ($params->noLimit) {
         $this->disableLimit();
     }
     $orders = array('eventcount' => 'EventCount DESC', 'timeasc' => 'requestTime ASC', 'timedesc' => 'requestTime DESC');
     if ($params->order) {
         $order = $orders[$params->order];
         if ($order) {
             $this->order($order);
         }
     }
     return $this;
 }
开发者ID:ahyswang,项目名称:eva-engine,代码行数:44,代码来源:EventsUsers.php


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