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/mysql/ |
<?php /** * @package modx * @subpackage mysql */ include_once (strtr(realpath(dirname(__FILE__)), '\\', '/') . '/../modevent.class.php'); /** * @package modx * @subpackage mysql */ class modEvent_mysql extends modEvent { public static function listEvents(xPDO &$xpdo, $plugin, array $criteria = array(), array $sort = array('id' => 'ASC'), $limit = 0, $offset = 0) { $c = $xpdo->newQuery('modEvent'); $count = $xpdo->getCount('modEvent',$c); $c->select($xpdo->getSelectColumns('modEvent','modEvent')); $c->select(array( 'IF(ISNULL(modPluginEvent.pluginid),0,1) AS enabled', 'modPluginEvent.priority AS priority', 'modPluginEvent.propertyset AS propertyset', )); $c->leftJoin('modPluginEvent','modPluginEvent',' modPluginEvent.event = modEvent.name AND modPluginEvent.pluginid = '.$plugin.' '); $c->where($criteria); foreach($sort as $field=> $dir) { $c->sortby($xpdo->getSelectColumns('modEvent','modEvent','',array($field)),$dir); } if ((int) $limit > 0) { $c->limit((int) $limit, (int) $offset); } return array( 'count'=> $count, 'collection'=> $xpdo->getCollection('modEvent',$c) ); } }