public static function factory(Storage $storage, $row) { $state = new State($storage); $state->setStateID($row["stateid"]); $state->setLabel($row["label"]); $state->setPopulation($row["population"]); $state->setCountryID($row["countryid"]); return $state; }