public function load(Connection $connection) { if (!$connection->isConnected) { $connection->Connect(); } if (!$connection->query($this->medicationQuery)) { return false; } else { $result = null; $medication = null; while ($result = $connection->getObject()) { $medication = new Medication(); $medication->setCommonDose($result->commonDose); $medication->setGenericName($result->genericName); $medication->setRoute($result->route); $medication->setUnit($result->unit); $medication->setMedicationID($result->medicationId); $medication->setActive($result->active); $medication->setConfirmed($result->confirmed); $medication->setConfirmedBy($result->confirmedBy); array_push($this->medicationList, $medication); } } return true; }