| @@ 30-40 (lines=11) @@ | ||
| 27 | * |
|
| 28 | * @return Page |
|
| 29 | */ |
|
| 30 | public function getFromRevisionId( $id, array $extraParams = [] ) { |
|
| 31 | $result = |
|
| 32 | $this->api->getRequest( |
|
| 33 | new SimpleRequest( |
|
| 34 | 'query', |
|
| 35 | $this->getQuery( [ 'revids' => $id ], $extraParams ) |
|
| 36 | ) |
|
| 37 | ); |
|
| 38 | ||
| 39 | return $this->newPageFromResult( array_shift( $result['query']['pages'] ) ); |
|
| 40 | } |
|
| 41 | ||
| 42 | /** |
|
| 43 | * @since 0.2 |
|
| @@ 73-83 (lines=11) @@ | ||
| 70 | * |
|
| 71 | * @return Page |
|
| 72 | */ |
|
| 73 | public function getFromPageId( $id, array $extraParams = [] ) { |
|
| 74 | $result = |
|
| 75 | $this->api->getRequest( |
|
| 76 | new SimpleRequest( |
|
| 77 | 'query', |
|
| 78 | $this->getQuery( [ 'pageids' => $id ], $extraParams ) |
|
| 79 | ) |
|
| 80 | ); |
|
| 81 | ||
| 82 | return $this->newPageFromResult( array_shift( $result['query']['pages'] ) ); |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * @since 0.4 |
|