Fix, session list order and limit conditions - refs BT#9092

1.10.x
Daniel Barreto 11 years ago
parent 8b776c45c6
commit eee5eee90f
  1. 15
      plugin/advancedsubscription/src/AdvancedSubscriptionPlugin.php

@ -852,22 +852,19 @@ class AdvancedSubscriptionPlugin extends Plugin implements HookPluginInterface
/** /**
* List all session (id, name) for select input * List all session (id, name) for select input
* @param int $length * @param int $limit
* @return array * @return array
*/ */
public function listAllSessions($length = 100) public function listAllSessions($limit = 100)
{ {
$length = intval($length); $limit = intval($limit);
$sessionTable = Database::get_main_table(TABLE_MAIN_SESSION); $sessionTable = Database::get_main_table(TABLE_MAIN_SESSION);
$columns = 'id, name'; $columns = 'id, name';
$conditions = array(); $conditions = array();
if ($length > 0) { if ($limit > 0) {
$conditions = array( $conditions = array(
'order' => array( 'order' => 'name',
'BY name LIMIT ?' => array( 'limit' => $limit,
$length
)
)
); );
} }

Loading…
Cancel
Save