/** * Function for adding a new party to the database. Updates the party object. * * @param rental_party $party the party to be added * @return bool true if successful, false otherwise */ function add(&$party) { // Insert a new party $q = "INSERT INTO rental_party (is_inactive) VALUES (false)"; $result = $this->db->query($q); if (isset($result)) { // Set the new party ID $party->set_id($this->db->get_last_insert_id('rental_party', 'id')); // Forward this request to the update method return $this->update($party); } else { return false; } }