public function loadById($id) { global $DB; $stat = $DB->prepare("SELECT human_information.* FROM human_information WHERE id = :id"); $stat->execute(array('id' => $id)); if ($stat->rowCount() > 0) { $human = new HumanModel(); $human->setFromDataBaseRow($stat->fetch()); return $human; } }
public function fetchAll() { $this->buildStart(); $this->build(); $this->buildStat(); $results = array(); while ($data = $this->stat->fetch()) { $human = new HumanModel(); $human->setFromDataBaseRow($data); $results[] = $human; } return $results; }