public static function add() { $db = Loader::db(); $date = Loader::helper('date')->getOverridableNow(); $r = $db->Execute('insert into Gatherings (gaDateCreated) values (?)', array($date)); return Gathering::getByID($db->Insert_ID()); }
public function view() { if ($this->gaID) { $gathering = Gathering::getByID($this->gaID); if (is_object($gathering)) { Core::make('helper/overlay')->init(false); if ($this->enablePostingFromGathering && $this->ptID) { $pt = PageType::getByID($this->ptID); Core::make('helper/concrete/composer')->addAssetsToRequest($pt, $this); $p = new Permissions($pt); if ($p->canEditPageTypeInComposer()) { $this->set('pagetype', $pt); } } $list = new GatheringItemList($gathering); $list->sortByDateDescending(); $list->setItemsPerPage($this->itemsPerPage); $this->set('gathering', $gathering); $this->set('itemList', $list); } } }