public function restore()
 {
     parent::restore();
     if ($this['topic_id'] === $this['root_id']) {
         $db = DBManager::get();
         $this->content['discussion_time'] = $db->query("SELECT mkdate " . "FROM px_topics " . "WHERE root_id = " . $db->quote($this->getId()) . " " . "ORDER BY mkdate DESC " . "LIMIT 1 " . "")->fetch(PDO::FETCH_COLUMN, 0);
     } else {
         $this->content['discussion_time'] = $this['mkdate'];
     }
 }
Пример #2
0
 public function restore()
 {
     $found = parent::restore();
     if ($found) {
         $db = DBManager::get();
         $st = $db->prepare("SELECT a.property_id, state, mkdate, chdate, type, name, options, system\n                                FROM resources_requests_properties a\n                                LEFT JOIN resources_properties b USING (property_id)\n                                WHERE a.request_id=? ");
         if ($st->execute(array($this->getId()))) {
             $this->properties = array_map('array_shift', $st->fetchAll(PDO::FETCH_ASSOC | PDO::FETCH_GROUP));
             $this->properties_changed = false;
         }
     } else {
         $this->inititalizeProperties();
     }
     return $found;
 }
 public function restore()
 {
     parent::restore();
     $this->cbUnserializeData();
 }