예제 #1
0
 /**
  * Constructor of the class Category
  * If you give an in_id and no in_name, you get info concerning the category of id=in_id
  * otherwise, you've got an category objet avec your in_id, in_name, in_descr
  *
  * @param int    $id
  * @param string $name
  * @param string $description
  *
  * @author - Hubert Borderiou
  */
 public function __construct($id = 0, $name = '', $description = "")
 {
     if ($id != 0 && $name == "") {
         $obj = new TestCategory();
         $obj->getCategory($id);
         $this->id = $obj->id;
         $this->name = $obj->name;
         $this->description = $obj->description;
     } else {
         $this->id = $id;
         $this->name = $name;
         $this->description = $description;
     }
 }