Exemplo n.º 1
0
 private function convertdata($data)
 {
     $this->data = null;
     if (is_null($data)) {
         return;
     } else {
         $this->copyValueToKey($data);
         // first copys in all the data that has one to one relation
         foreach ($this->propertyTable as $key => &$obj) {
             //then copy the logical properties over
             $value = null;
             $datafieldname = $this->getDatafieldname($key);
             if (is_null($datafieldname) == false) {
                 $value = $data->{$datafieldname};
             }
             if ($obj->logicdefined == true) {
                 if ($key == 'boek') {
                     $book = new boek(null);
                     $booktoget = intval($data->boekid);
                     $book->retrieveByID($booktoget);
                     $this->data->{$key} = $book;
                     //   $this->valtodata($key,false);
                 } else {
                     $msg = 'objectfield \'' . $key . '\' should be logicdefined while no definition in objectDef ' . '<br/>';
                     Logger::log($msg);
                     die;
                 }
             }
         }
         unset($obj);
     }
 }