Example #1
0
 /**
  * @param1 is the book I want to save
  * @return the saved object
  **/
 public function save(Boek $book)
 {
     $properties = $book->giveAllPropertiesArray();
     // gets all the properties in the form of a array
     foreach ($properties as $key => $value) {
         $this->valtodata($key, $value);
     }
     $id = $book->id;
     if ($book->id == 0) {
         $retid = OpslagMedium::storeObject($this::tablename, $properties);
     } else {
         $retid = OpslagMedium::updateObject($this::tablename, $book->id, $book->changedProperties);
     }
     if ($retid != 0) {
         $query = $this->getDatafieldname('id') . '=' . $retid . ' ';
         $this->convertdata(OpslagMedium::getObjectdataOnQuery($this::tablename, $query));
         $retobj->result = true;
         return $this->GetBookObject();
     }
 }