public function save() { parent::save(); $db = Database::getInstance(); $statement = $db->prepare("INSERT INTO owner VALUES (:id)"); $statement->execute([':id' => $this->id]); $db->commit(); }
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(); } }
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(); } }