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


PHP Criteria::setSort方法代码示例

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


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

示例1: getChangeLogs

 /**
  * get change logs
  *
  * @access public
  * @param int $item_id
  * @return array objects
  */
 function getChangeLogs($item_id)
 {
     $criteria = new Criteria('item_id', $item_id);
     $criteria->setSort('log_date');
     $criteria->setOrder('DESC');
     return $this->getObjects($criteria);
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:14,代码来源:changelog.class.php

示例2: execute

 function execute(&$controller, &$request, &$user)
 {
     exFrame::init(EXFRAME_PERM);
     // 閲覧権限のチェック
     exPerm::GuardRedirect('view_detail', 'index.php', _MD_PLZXOO_ERROR_PERMISSION);
     $id = isset($_REQUEST['qid']) ? intval($_REQUEST['qid']) : 0;
     $handler =& plzXoo::getHandler('question');
     $question =& $handler->get($id);
     if (!is_object($question)) {
         return VIEW_ERROR;
     }
     // ステータスが1,2と異なるものは管理者以外キック
     if (!in_array($question->getVar('status'), array(1, 2))) {
         if (!is_object($GLOBALS['xoopsUser']) || !$GLOBALS['xoopsUser']->isAdmin()) {
             return VIEW_ERROR;
         }
     }
     $handler =& plzXoo::getHandler('answer');
     $criteria = new Criteria('qid', $id);
     $criteria->setSort('input_date');
     $criteria->setOrder('DESC');
     $answers =& $handler->getObjects($criteria);
     $request->setAttribute('question', $question);
     $request->setAttribute('answers', $answers);
     return VIEW_SUCCESS;
 }
开发者ID:BackupTheBerlios,项目名称:peakxoops-svn,代码行数:26,代码来源:detail.class.php

示例3: item_get_userlist

function item_get_userlist($upage)
{
    global $xoopsDB;
    global $xoopsUser;
    // myuid
    $myuid = $xoopsUser->getVar('uid', 'n');
    $xusers_handler =& xoonips_getormhandler('xoonips', 'users');
    $tables['users'] = $xoopsDB->prefix('users');
    $tables['xusers'] = $xoopsDB->prefix('xoonips_users');
    $join_criteria = new XooNIpsJoinCriteria('users', 'uid', 'uid');
    $criteria = new Criteria($tables['users'] . '.level', 0, '>');
    $criteria->setSort($tables['users'] . '.uname');
    $fields = array();
    $fields[] = $tables['xusers'] . '.uid';
    $fields[] = $tables['users'] . '.uname';
    $xusers_objs =& $xusers_handler->getObjects($criteria, false, implode(',', $fields), false, $join_criteria);
    $textutil =& xoonips_getutility('text');
    $users = array();
    $users[] = array('uid' => 0, 'uname' => $textutil->html_special_chars(_AM_XOONIPS_MAINTENANCE_ITEM_LABEL_ALLUSERS), 'selected' => 'selected="selected"');
    foreach ($xusers_objs as $xusers_obj) {
        $uid = $xusers_obj->getVar('uid', 'e');
        $uname = $textutil->html_special_chars($xusers_obj->getExtraVar('uname'));
        $users[] = array('uid' => $uid, 'uname' => $uname, 'selected' => '');
    }
    return $users;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:26,代码来源:maintenance_item_uselect.php

示例4: Criteria

 /**
  * get titles
  *
  * @access public
  * @param int $item_id
  * @return array object array
  */
 function &getTitles($item_id)
 {
     $criteria = new Criteria('item_id', $item_id);
     $criteria->setSort('title_id');
     $criteria->setOrder('ASC');
     return $this->getObjects($criteria);
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:14,代码来源:title.class.php

示例5: b_mysearch_last_search_show

function b_mysearch_last_search_show()
{
    include_once XOOPS_ROOT_PATH . '/modules/mysearch/include/functions.php';
    $mysearch_handler =& xoops_getmodulehandler('searches', 'mysearch');
    $visiblekeywords = 0;
    $block = array();
    $visiblekeywords = mysearch_getmoduleoption('showindex');
    if ($visiblekeywords > 0) {
        $block['visiblekeywords'] = $visiblekeywords;
        $totalcount = $mysearch_handler->getCount();
        $start = 0;
        $critere = new Criteria('mysearchid', 0, '<>');
        $critere->setSort('datesearch');
        $critere->setLimit($visiblekeywords);
        $critere->setStart($start);
        $critere->setOrder('DESC');
        $tmpmysearch = new searches();
        $elements = $mysearch_handler->getObjects($critere);
        foreach ($elements as $oneelement) {
            $search = array();
            $search['keyword'] = $oneelement->getVar('keyword');
            $search['date'] = formatTimestamp(strtotime($oneelement->getVar('datesearch')));
            $search['uid'] = $oneelement->getVar('keyword');
            $search['uname'] = $tmpmysearch->uname($oneelement->getVar('uid'));
            $search['link'] = "<a href='" . XOOPS_URL . '/search.php?query=' . $oneelement->getVar('keyword') . "&action=results' target='_blank'>";
            $block['searches'][] = $search;
            unset($search);
        }
    }
    return $block;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:31,代码来源:mysearch_last_search.php

示例6: Criteria

 /**
  * get keywords
  *
  * @access public
  * @param int $item_id
  * @return array object array
  */
 function &getKeywords($item_id)
 {
     $criteria = new Criteria('item_id', $item_id);
     $criteria->setSort('keyword_id');
     $criteria->setOrder('ASC');
     return $this->getObjects($criteria);
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:14,代码来源:keyword.class.php

示例7: search

 /**
  * @brief search file
  *
  * @param query query
  * @param limit the maximum number of rows to return
  * @param offset the offset of the first row to return
  * @param uid user ID
  * @return array of item id
  */
 function search($query, $limit, $offset, $uid)
 {
     $msg = false;
     $iids = false;
     $dummy = false;
     $search_cache_id = false;
     $_SESSION['XNPSID'] = session_id();
     $member_handler =& xoops_gethandler('member');
     if (empty($GLOBALS['xoopsUser'])) {
         $GLOBALS['xoopsUser'] = $member_handler->getUser($uid);
     }
     if (xnpSearchExec('quicksearch', $query, 'all', false, $dummy, $dummy, $dummy, $search_cache_id, false, 'file')) {
         // search_cache_id -> file_ids
         $criteria = new Criteria('search_cache_id', $search_cache_id);
         $criteria->setSort('item_id');
         $criteria->setStart($offset);
         if ($limit) {
             $criteria->setLimit($limit);
         }
         $join = new XooNIpsJoinCriteria('xoonips_search_cache_file', 'file_id', 'file_id', 'LEFT');
         $file_handler =& xoonips_getormhandler('xoonips', 'file');
         $files =& $file_handler->getObjects($criteria, false, 'item_id', true, $join);
         if (false === $files) {
             return false;
         }
         $item_ids = array();
         foreach ($files as $file) {
             $item_ids[] = $file->get('item_id');
         }
         return $item_ids;
     } else {
         return false;
     }
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:43,代码来源:search_text.class.php

示例8: b_mypics_lastpictures_show

function b_mypics_lastpictures_show($options)
{
    $criteria = new Criteria('id', 0, '>');
    $criteria->setSort('id');
    $criteria->setOrder('DESC');
    $criteria->setLimit($options[0]);
    $handler = xoops_getModuleHandler('image', 'mypics');
    $block = $handler->getLastPicturesForBlock($options[0]);
    return $block;
}
开发者ID:trabisdementia,项目名称:xuups,代码行数:10,代码来源:blocks.php

示例9: getCreators

 /**
  * get creator objects of this item
  * @return XNPConferenceOrmCreator[] 
  */
 function getCreators()
 {
     $handler =& xoonips_getormhandler('xnpmodel', 'creator');
     $criteria = new Criteria('model_id', $this->get('model_id'));
     $criteria->setSort('creator_order');
     $result =& $handler->getObjects($criteria);
     if ($result) {
         return $result;
     }
     return array();
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:item_detail.class.php

示例10: getLastVotes

 /**
  * Returns the (x) last votes
  *
  * @param integer $start Starting position
  * @param integer $limit count of items to return
  * @return array Array of votedata objects
  */
 function getLastVotes($start = 0, $limit = 0)
 {
     $tbl_datas = array();
     $criteria = new Criteria('vote_ratingid', 0, '<>');
     $criteria->setLimit($limit);
     $criteria->setStart($start);
     $criteria->setSort('vote_ratingtimestamp');
     $criteria->setOrder('DESC');
     $tbl_datas = $this->getObjects($criteria, true);
     return $tbl_datas;
 }
开发者ID:naao,项目名称:myshop,代码行数:18,代码来源:myshop_votedata.php

示例11: getAuthors

 /**
  * get author objects of this item
  * @return XNPPaperOrmAuthor[] 
  */
 function getAuthors()
 {
     $handler =& xoonips_getormhandler('xnppaper', 'author');
     $criteria = new Criteria('paper_id', $this->get('paper_id'));
     $criteria->setSort('author_order');
     $result =& $handler->getObjects($criteria);
     if ($result) {
         return $result;
     }
     return array();
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:item_detail.class.php

示例12: getAllVats

 /**
  * Return All TAX
  *
  * @param integer $start Position de départ
  * @param integer $limit Nombre total d'enregistrements à renvoyer
  * @param string $order Champ sur lequel faire le tri
  * @param string $order Ordre du tri
  * @param boolean $idaskey Indique si le tableau renvoyé doit avoir pour clé l'identifiant unique de l'enregistrement
  * @return array tableau d'objets de type TVA
  */
 function getAllVats($start = 0, $limit = 0, $sort = 'vat_id', $order = 'ASC', $idaskey = true)
 {
     $critere = new Criteria('vat_id', 0, '<>');
     $critere->setLimit($limit);
     $critere->setStart($start);
     $critere->setSort($sort);
     $critere->setOrder($order);
     $tblVats = array();
     $tblVats = $this->getObjects($critere, $idaskey);
     return $tblVats;
 }
开发者ID:naao,项目名称:myshop,代码行数:21,代码来源:myshop_vat.php

示例13: getExperimenters

 /**
  * get experimenter objects of this item
  * @return XNPDataOrmExperimenter[] 
  */
 function getExperimenters()
 {
     $handler =& xoonips_getormhandler('xnpdata', 'experimenter');
     $criteria = new Criteria('data_id', $this->get('data_id'));
     $criteria->setSort('experimenter_order');
     $result =& $handler->getObjects($criteria);
     if ($result) {
         return $result;
     }
     return array();
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:item_detail.class.php

示例14: getAllStores

 /**
  * Renvoie la liste de tous les vendeurs du module
  *
  * @param integer $start Position de départ
  * @param integer $limit Nombre total d'enregistrements à renvoyer
  * @param string $order Champ sur lequel faire le tri
  * @param string $order Ordre du tri
  * @param boolean $idaskey Indique si le tableau renvoyé doit avoir pour clé l'identifiant unique de l'enregistrement
  * @return array tableau d'objets de type stores
  */
 function getAllStores($start = 0, $limit = 0, $sort = 'store_name', $order = 'ASC', $idaskey = true)
 {
     $critere = new Criteria('store_id', 0, '<>');
     $critere->setLimit($limit);
     $critere->setStart($start);
     $critere->setSort($sort);
     $critere->setOrder($order);
     $tbl_categs = array();
     $tbl_categs = $this->getObjects($critere, $idaskey);
     return $tbl_categs;
 }
开发者ID:naao,项目名称:myshop,代码行数:21,代码来源:myshop_stores.php

示例15: getDevelopers

 /**
  * get developer objects of this item
  * @return XnpstimulusOrmDeveloper[] 
  */
 function getDevelopers()
 {
     $handler =& xoonips_getormhandler('xnpstimulus', 'developer');
     $criteria = new Criteria('stimulus_id', $this->get('stimulus_id'));
     $criteria->setSort('developer_order');
     $result =& $handler->getObjects($criteria);
     if ($result) {
         return $result;
     }
     return array();
 }
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:15,代码来源:item_detail.class.php


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