本文整理汇总了PHP中app::getModel方法的典型用法代码示例。如果您正苦于以下问题:PHP app::getModel方法的具体用法?PHP app::getModel怎么用?PHP app::getModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app
的用法示例。
在下文中一共展示了app::getModel方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gridAction
public function gridAction()
{
$block = new manage_block_city_grid();
$collection = app::getModel('manage_model_city')->getCollection();
$block->setVar('collection', $collection);
$block->renderHtml();
}
示例2: gridAction
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();
}
示例3: getAllTradePointsJsonAction
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;
}
示例4: some_actionAction
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();
}
示例5: load
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;
}