db = new DbDatabase(); if (is_object($row)) { $this->person = $row; $this->setId(); } else { $this->id = $row; $this->loadFromDatabase(); } } public function getHtmlPage() { $res = $this->db->editorToursRes($this->id); $this->tours = array(); while ( $tourRow = db_fetch_object($res) ) { $this->tours[] =DbPackage::newFromRow($tourRow); } $output = ''; $output .= ''; return $output; } private function setId() { $this->id = $this->person->CharId; } private function loadFromDatabase() { $this->person = $this->db->getPersonById($this->id); } public function newFromRow($row) { return new self($row); } public function getLink() { return l($this->getFullName(),'editors/'.$this->id); } public function getFullName() { return $this->person->Name. " ". $this->person->Surname; } public function getBreadcrumb() { $breadcrumb = array( l('Редакторы','editors') ); return $breadcrumb; } }