|
@@ 79-85 (lines=7) @@
|
| 76 |
|
* @param mixed $city City. |
| 77 |
|
* @return void |
| 78 |
|
*/ |
| 79 |
|
public function get_schools( $state, $city ) { |
| 80 |
|
$request = $this->base_uri . $state . '/' . $city . '?key=' . static::$api_key; |
| 81 |
|
$xml = simplexml_load_file( $request ); |
| 82 |
|
$json = wp_json_encode( $xml ); |
| 83 |
|
$results = json_decode( $json, true ); |
| 84 |
|
return $results; |
| 85 |
|
} |
| 86 |
|
/** |
| 87 |
|
* get_nearby_schools function. |
| 88 |
|
* |
|
@@ 112-118 (lines=7) @@
|
| 109 |
|
* @param mixed $school_id School ID. |
| 110 |
|
* @return void |
| 111 |
|
*/ |
| 112 |
|
public function get_school( $state, $school_id ) { |
| 113 |
|
$request = $this->base_uri . $state . '/'. $school_id .'?key=' . static::$api_key; |
| 114 |
|
$xml = simplexml_load_file( $request ); |
| 115 |
|
$json = wp_json_encode( $xml ); |
| 116 |
|
$results = json_decode( $json, true ); |
| 117 |
|
return $results; |
| 118 |
|
} |
| 119 |
|
/** |
| 120 |
|
* Returns a list of schools based on a search string. |
| 121 |
|
* |
|
@@ 174-180 (lines=7) @@
|
| 171 |
|
* @param mixed $school_id School ID. |
| 172 |
|
* @return void |
| 173 |
|
*/ |
| 174 |
|
public function get_school_test_scores( $state, $school_id ) { |
| 175 |
|
$request = $this->base_uri . '/school/tests/' . $state . '/'. $school_id .'?key=' . static::$api_key; |
| 176 |
|
$xml = simplexml_load_file( $request ); |
| 177 |
|
$json = wp_json_encode( $xml ); |
| 178 |
|
$results = json_decode( $json, true ); |
| 179 |
|
return $results; |
| 180 |
|
} |
| 181 |
|
/** |
| 182 |
|
* Returns census and profile data for a school. |
| 183 |
|
* |
|
@@ 189-195 (lines=7) @@
|
| 186 |
|
* @param mixed $school_id School ID. |
| 187 |
|
* @return void |
| 188 |
|
*/ |
| 189 |
|
public function get_school_census_data( $state, $school_id ) { |
| 190 |
|
$request = $this->base_uri . '/school/census/' . $state . '/'. $school_id .'?key=' . static::$api_key; |
| 191 |
|
$xml = simplexml_load_file( $request ); |
| 192 |
|
$json = wp_json_encode( $xml ); |
| 193 |
|
$results = json_decode( $json, true ); |
| 194 |
|
return $results; |
| 195 |
|
} |
| 196 |
|
/** |
| 197 |
|
* Returns information about a city. |
| 198 |
|
* |
|
@@ 204-210 (lines=7) @@
|
| 201 |
|
* @param mixed $city City. |
| 202 |
|
* @return void |
| 203 |
|
*/ |
| 204 |
|
public function get_city_schools( $state, $city ) { |
| 205 |
|
$request = $this->base_uri . '/cities/' . $state . '/'. $city .'?key=' . static::$api_key; |
| 206 |
|
$xml = simplexml_load_file( $request ); |
| 207 |
|
$json = wp_json_encode( $xml ); |
| 208 |
|
$results = json_decode( $json, true ); |
| 209 |
|
return $results; |
| 210 |
|
} |
| 211 |
|
/** |
| 212 |
|
* Returns a list of cities near another city. |
| 213 |
|
* |
|
@@ 236-242 (lines=7) @@
|
| 233 |
|
* @param mixed $city City. |
| 234 |
|
* @return void |
| 235 |
|
*/ |
| 236 |
|
public function get_districts( $state, $city ) { |
| 237 |
|
$request = $this->base_uri . '/districts/' . $state . '/'. $city .'?key=' . static::$api_key; |
| 238 |
|
$xml = simplexml_load_file( $request ); |
| 239 |
|
$json = wp_json_encode( $xml ); |
| 240 |
|
$results = json_decode( $json, true ); |
| 241 |
|
return $results; |
| 242 |
|
} |
| 243 |
|
} |
| 244 |
|
} |
| 245 |
|
|