public function getCollectonList() { $chttp = new Chttp(); $db = $chttp->getParam('db'); if (!empty($db)) { $model = new Model(); $collections = $model->listCollections($db, TRUE); $collectionList = array(); foreach ($collections as $collection) { $collectionList[] = array('name' => $collection->getName(), 'count' => $collection->count()); } return $collectionList; } else { return FALSE; } }
public static function getLoginDatabase() { $session = Application::getInstance('Session'); $model = new Model(); return array('databases' => array(array('name' => isset($session->options['db']) ? $session->options['db'] : '', 'noOfCollecton' => isset($session->options['db']) ? count($model->listCollections($session->options['db'], TRUE)) : NULL))); }