Example #1
0
 public function save()
 {
     parent::save();
     $db = Database::getInstance();
     $statement = $db->prepare("INSERT INTO owner VALUES (:id)");
     $statement->execute([':id' => $this->id]);
     $db->commit();
 }
Example #2
0
 public function save()
 {
     parent::save();
     try {
         $db = Database::getInstance();
         $statement = $db->prepare("INSERT INTO tenant VALUES (:super_user_id, :property_id)");
         $statement->execute([":super_user_id" => $this->id, ":property_id" => $this->property_id]);
         $db->commit();
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }
Example #3
0
 public function save()
 {
     parent::save();
     try {
         $db = Database::getInstance();
         $statement = $db->prepare("INSERT INTO agent VALUES (:super_user_id, :real_estate_id)");
         $statement->execute([':super_user_id' => $this->id, ':real_estate_id' => $this->real_estate_id]);
         $db->commit();
     } catch (Exception $e) {
         echo $e->getMessage();
     }
 }