1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| <?php
/**
*
*/
class ArticleData
{
private $type;
private $titre;
private $description;
private $postal;
private $ville;
private $region;
private $prixJour;
private $prixWeek;
private $prixSemaine;
function initData($jsonToDecode)
{
$type = $jsonToDecode[0][0];
$titre = $jsonToDecode[0][3];
$description = $jsonToDecode[0][2];
$postal = $jsonToDecode[0][1];
$ville = $jsonToDecode[0][4];
$region = $jsonToDecode[0][5];
$prixJour = $jsonToDecode[0][10];
$prixWeek = $jsonToDecode[0][11];
$prixSemaine = $jsonToDecode[0][12];
var_dump($type);
}
function showType() {
return $this->$type;
}
function showTitle() {
return $this->titre;
}
function showDescription() {
return $this->description;
}
function showPostalAndVille() {
return 'Ville : '.$this->ville . '. Code Postal : '.$this->postal;
}
function showPriceDay() {
return 'Prix pour la journée : '.$this->prixJour;
}
function showPriceWeekEnd() {
return 'Prix pour le week end : '.$this->prixWeek;
}
function showPriceWeek() {
return 'Prix pour la semaine : '.$this->prixSemaine;
}
}
?> |
Partager