public function gridAction() { $block = new manage_block_city_grid(); $collection = app::getModel('manage_model_city')->getCollection(); $block->setVar('collection', $collection); $block->renderHtml(); }
public function gridAction() { $block = new manage_block_user_grid(); /** @var manage_model_user_collection $collection */ $collection = app::getModel('manage_model_user')->getCollection(); $block->setVar('collection', $collection); $block->renderHtml(); }
public function getAllTradePointsJsonAction() { try { $filter = $this->getRequest()->getParam('filter'); /** @var manage_model_event_collection $events */ $tradepoints = app::getModel('manage_model_tradepoint')->getCollection(); $tradepoints->load(); $tradepoints_array = $tradepoints->toArray(); $json = self::okJson($tradepoints_array); } catch (Exception $e) { $json = self::errJson($e->getMessage()); } echo $json; }
public function some_actionAction() { $testModel = app::getModel('manage_model_test'); $col = $testModel->getCollection(); foreach ($col as $m) { var_dump($m); } //var_dump($col); //$testModel->load(1); //$testModel->setData('field1',777); //$testModel->setData('field2',555); // $testModel->save(); //var_dump($testModel); die('bla'); $this->initLayout(); $page = $this->getLayout()->getPageBlock(); $page->addChild('content', new manage_block_test()); $this->renderLayout(); }
public function load() { $this->_beforeLoad(); /** @var PDOStatement $stmt */ $this->setStatement($this->getConnection()->prepare($this->getSql())); $this->getStatement()->execute($this->getSqlValues()); while ($row = $this->getStatement()->fetch(PDO::FETCH_ASSOC)) { $model = app::getModel($this->getModelClass()); $row = $this->_beforeLoadItemData($row, $model); $model->_beforeLoad(); $model->setData($row)->setOrigData($row); $model->_afterLoad(); $this->_afterLoadItemData($model); $this->_items[] = $model; } $this->isLoaded(true); $this->_afterLoad(); return $this; }