Exemplo n.º 1
0
 protected static function init()
 {
     $counties = array();
     array_push($counties, new Country('Austria', 'au', array(new State("Vienne"), new State("Stryle"))));
     array_push($counties, new Country('Canada', 'ca', array(new State("Quecec"), new State("Ontario"), new State("Albert"))));
     array_push($counties, new Country('Usa', 'us', array()));
     self::$counties = $counties;
 }
Exemplo n.º 2
0
<?php

require 'CountriesRepository.php';
$c = CountriesRepository::getCountries();
echo json_encode($c);