Example #1
0
 public function create($email, $password = null, $leveradres = null)
 {
     $retobj = null;
     if ($this->IsEmailUnique($email) == true) {
         $passwok = $this->IspasswordOk($password);
         if ($passwok == false) {
             $ret = OpslagMedium::callsp('select getRandomPassw() as passw');
             $password = $ret->passw;
             $retobj = $this->getRetObj(false, 2, 'account added with generated passw');
         } else {
             $retobj = $this->getRetObj(false, 3, 'account added with own password');
         }
         $this->id = 0;
         $this->emailadres = $email;
         $this->passwoord = $password;
         $this->leveradres = $leveradres;
         $retid = OpslagMedium::storeObject(DEFTABLE, $this->changedProperties);
         if ($retid != 0) {
             $this->id = $retid;
             $query = $this->getDatafieldname('id') . '=' . $this->id . ' ';
             $this->convertdata(OpslagMedium::getObjectdataOnQuery(DEFTABLE, $query));
             $retobj->result = true;
         }
     } else {
         $retobj = $this->getRetObj(false, 1, 'email not unique');
     }
     return $retobj;
 }
Example #2
0
 public function create($klantid)
 {
     $retobj = null;
     $this->klantid = $klantid;
     $this->id = 0;
     $this->ordernr = uniqid();
     $this->totaalaankoop = 0;
     $this->betaald = false;
     $this->geleverd = false;
     $retid = OpslagMedium::storeObject(TABLE_BEST, $this->changedProperties);
     if ($retid != 0) {
         $this->id = $retid;
         $query = $this->getDatafieldname('id') . '=' . $this->id . ' ';
         $this->convertdata(OpslagMedium::getObjectdataOnQuery(TABLE_BEST, $query));
         $retobj->result = true;
     }
     return $retobj;
 }
Example #3
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();
     }
 }