Exemplo n.º 1
0
 public static function FromDatabase(array $row, User $user)
 {
     $members = array();
     $changes = array();
     $row = array_slice($row, 1);
     // Slice off userID column
     foreach ($row as $rowName => $rowValue) {
         $techObject = clone ResourceParser::Instance()->GetTechnologyByName($rowName);
         $techObject->Amount($rowValue);
         $members[$rowName] = $techObject;
         $changes[$rowName] = false;
     }
     $technologyGroup = new TechnologyGroup();
     $technologyGroup->Members($members);
     $technologyGroup->Owner($user);
     $technologyGroup->Changes($changes);
     return $technologyGroup;
 }