Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
CargoTablesAPI | |
0.00% |
0 / 8 |
|
0.00% |
0 / 3 |
20 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
execute | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
6 | |||
getDescription | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | /** |
3 | * Adds the 'cargotable' action to the MediaWiki API |
4 | * |
5 | * @ingroup Cargo |
6 | * @author Sanjay Thiyagarajan |
7 | * |
8 | */ |
9 | class CargoTablesAPI extends ApiBase { |
10 | |
11 | public function __construct( $query, $moduleName ) { |
12 | parent::__construct( $query, $moduleName ); |
13 | } |
14 | |
15 | public function execute() { |
16 | try { |
17 | $queryResults = CargoUtils::getTables(); |
18 | } catch ( Exception $e ) { |
19 | $this->dieWithError( $e, 'db_error' ); |
20 | } |
21 | |
22 | // Set top-level elements. |
23 | $result = $this->getResult(); |
24 | $result->setIndexedTagName( $queryResults, 'p' ); |
25 | $result->addValue( null, $this->getModuleName(), $queryResults ); |
26 | } |
27 | |
28 | protected function getDescription() { |
29 | return 'Fetches all the tables in the system'; |
30 | } |
31 | |
32 | } |