tour = $row; $this->db = new DbDatabase(); $this->setId(); } protected function setId() { $this->id = $this->tour->FileName; } public static function newFromRow() { $tour = new self; $tour->tour = $row; } public static function newFromDb($id) { $db = new DbDatabase; $row = $db->getTournament($id); if (!$row) { return FALSE; } elseif ($row->Type == 'Г' ) { return new DbPackageGroup($row); } elseif ($row->Type == 'Ч' ) { return new DbPackageChamp($row); } elseif ($row->Type == 'Т' ) { return new DbPackageTour($row); } } public function getAll() { return false; } protected function getDbId() { return $this->tour->Id; } public function getTitle() { return $this->tour->Title; } }