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
|
<?php
class Billet{
//variables de classe
protected static $id_b=0;
protected $id,$titre,$contenu,$date,$categorie,$auteur;
//constructeur
public function __contruct($p_titre ,$p_contenu,$p_categorie,$p_auteur) {
$this->titre = $p_titre;
$this->contenu = $p_contenu;
$this->categorie = $p_categorie;
$this->auteur = $p_auteur;
$this->date = date("d-m-Y");
$this->id = self::$id_b;
self::$id_b++;
}
//destructeur
public function __desctruct() {
$this->id = null;
$this->contenu = null;
$this->titre = null;
$this->categorie = null;
$this->date = null;
}
//Getteurs
public function getTitre(){
return $this->titre;
} |