Server : Apache System : Linux indy02.toastserver.com 3.10.0-962.3.2.lve1.5.85.el7.x86_64 #1 SMP Thu Apr 18 15:18:36 UTC 2024 x86_64 User : palandch ( 1163) PHP Version : 7.1.33 Disable Function : NONE Directory : /home/palandch/www/core/model/modx/sqlsrv/ |
<?php /** * @package modx * @subpackage sqlsrv */ require_once (dirname(dirname(__FILE__)) . '/modcontextsetting.class.php'); /** * @package modx * @subpackage sqlsrv */ class modContextSetting_sqlsrv extends modContextSetting { public static function listSettings(xPDO &$xpdo, array $criteria = array(), array $sort = array('id' => 'ASC'), $limit = 0, $offset = 0) { /* build query */ $c = $xpdo->newQuery('modContextSetting'); $c->select(array( $xpdo->getSelectColumns('modContextSetting','modContextSetting'), )); $c->select(array( 'Entry.value AS name_trans', 'Description.value AS description_trans', )); $c->leftJoin('modLexiconEntry','Entry',"'setting_' + modContextSetting.{$xpdo->escape('key')} = Entry.name"); $c->leftJoin('modLexiconEntry','Description',"'setting_' + modContextSetting.{$xpdo->escape('key')} + '_desc' = Description.name"); $c->where($criteria); $count = $xpdo->getCount('modContextSetting',$c); $c->sortby($xpdo->getSelectColumns('modContextSetting','modContextSetting','',array('area')),'ASC'); foreach($sort as $field=> $dir) { $c->sortby($xpdo->getSelectColumns('modContextSetting','modContextSetting','',array($field)),$dir); } if ((int) $limit > 0) { $c->limit((int) $limit, (int) $offset); } return array( 'count'=> $count, 'collection'=> $xpdo->getCollection('modContextSetting',$c) ); } } ?>