Skip to content
Snippets Groups Projects
Commit 1b968d31 authored by Matthieu Guffroy's avatar Matthieu Guffroy
Browse files

Merge branch 'master' of gitlab.utc.fr:nf17-camp-p14/clivi

parents b54dc94a cee560bd
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,10 @@ class Animal extends Objet
protected $date_deces;
protected $taille;
protected $code;
public $_specialFields = array(
"sterile" => array(
"t" => "BoolField"
));
public function id()
{
......
......@@ -53,7 +53,7 @@ class Objet
$ret = array();
foreach(array_keys(get_object_vars($this)) as $keyName) {
if($keyName[0] == "_") { continue; }
if($keyName == $this->_primaryAttr && $this->_primaryAttr == "") { $ret[] = new Field($keyName, $this->$keyName, true); continue; }
if($keyName == $this->_primaryAttr && $this->_primaryAttr == "id") { $ret[] = new Field($keyName, $this->$keyName, true); continue; }
if(in_array($keyName, array_keys($this->_specialFields))) {
$ret[] = new $this->_specialFields[$keyName]["t"]($keyName, $this->$keyName);
} else {
......
......@@ -6,6 +6,10 @@ class Produit extends Objet
protected $nom;
protected $prix;
protected $is_medicament;
public $_specialFields = array(
"is_medicament" => array(
"t" => "BoolField"
));
public function id()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment