當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kwc_Abstract::createChildModel方法代碼示例

本文整理匯總了PHP中Kwc_Abstract::createChildModel方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kwc_Abstract::createChildModel方法的具體用法?PHP Kwc_Abstract::createChildModel怎麽用?PHP Kwc_Abstract::createChildModel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Kwc_Abstract的用法示例。


在下文中一共展示了Kwc_Abstract::createChildModel方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: preDispatch

 public function preDispatch()
 {
     $this->setModel(new Kwc_Directories_Item_Directory_Trl_AdminModel(array('proxyModel' => Kwc_Abstract::createChildModel(Kwc_Abstract::getSetting($this->_getParam('class'), 'masterComponentClass')), 'trlModel' => Kwc_Abstract::createChildModel($this->_getParam('class')))));
     parent::preDispatch();
     $url = Kwc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('Form');
     $this->_editDialog['controllerUrl'] = $url;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:7,代碼來源:Controller.php

示例2: preDispatch

 public function preDispatch()
 {
     if (!isset($this->_model) && !isset($this->_tableName) && !isset($this->_modelName)) {
         $this->setModel(Kwc_Abstract::createChildModel($this->_getParam('class')));
     }
     parent::preDispatch();
 }
開發者ID:koala-framework,項目名稱:koala-framework,代碼行數:7,代碼來源:Grid.php

示例3: _getModel

 protected function _getModel()
 {
     if (!$this->_model) {
         if (isset($this->_settings['model'])) {
             if (is_string($this->_settings['model'])) {
                 $this->_model = Kwf_Model_Abstract::getInstance($this->_settings['model']);
             } else {
                 $this->_model = $this->_settings['model'];
             }
         } else {
             if (isset($this->_settings['table'])) {
                 if (is_string($this->_settings['table'])) {
                     $table = new $this->_settings['table']();
                 } else {
                     $table = $this->_settings['table'];
                 }
                 if (!$table instanceof Zend_Db_Table_Abstract) {
                     throw new Kwf_Exception("table setting for generator in {$this->_class} is not a Zend_Db_Table");
                 }
                 $this->_model = new Kwf_Model_Db(array('table' => $table));
             } else {
                 if ($this->_loadTableFromComponent) {
                     $this->_model = Kwc_Abstract::createChildModel($this->_class);
                 } else {
                     throw new Kwf_Exception("Can't create model for generator '{$this->getGeneratorKey()}' in '{$this->_class}'");
                 }
             }
         }
         if (!$this->_model) {
             throw new Kwf_Exception('model has to be set for table generator in ' . $this->_class);
         }
     }
     return $this->_model;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:34,代碼來源:Abstract.php

示例4: getListeners

 public function getListeners()
 {
     $ret = parent::getListeners();
     $model = Kwc_Abstract::createChildModel($this->_class);
     $siblingModels = $model->getSiblingModels();
     $ret[] = array('class' => get_class($siblingModels[0]), 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onLanguageUpdate');
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:8,代碼來源:Events.php

示例5: getListeners

 public function getListeners()
 {
     $ret = parent::getListeners();
     $m = Kwc_Abstract::createChildModel($this->_class);
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onOwnRowEvent');
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Deleted', 'callback' => 'onOwnRowEvent');
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onOwnRowEvent');
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:9,代碼來源:Events.php

示例6: preDispatch

 public function preDispatch()
 {
     if (!isset($this->_model) && !isset($this->_tableName)) {
         $this->setModel(Kwc_Abstract::createChildModel($this->_getParam('class')));
     }
     parent::preDispatch();
     $url = Kwc_Admin::getInstance($this->_getParam('class'))->getControllerUrl('Comment');
     $this->_editDialog['controllerUrl'] = $url;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:9,代碼來源:CommentsController.php

示例7: _initFields

 public function _initFields()
 {
     $this->_form->setModel(Kwc_Abstract::createChildModel($this->_getParam('class')));
     $this->_form->add(new Kwf_Form_Field_ShowField('create_time', trlKwf('Created')));
     $this->_form->add(new Kwf_Form_Field_Checkbox('visible', trlKwf('Visible')));
     $this->_form->add(new Kwf_Form_Field_TextField('name', trlKwf('Name')))->setWidth(300);
     $this->_form->add(new Kwf_Form_Field_TextField('email', trlKwf('E-Mail')))->setWidth(300);
     $this->_form->add(new Kwf_Form_Field_TextArea('content', trlKwf('Content')))->setWidth(300)->setHeight(160);
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:9,代碼來源:CommentController.php

示例8: getTrlRowByData

 public function getTrlRowByData(Kwf_Component_Data $data)
 {
     $ret = $this->_getRow($data->dbId);
     if (!$ret) {
         $m = Kwc_Abstract::createChildModel($this->_class);
         $ret = $m->createRow();
         $ret->component_id = $data->dbId;
     }
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:10,代碼來源:Generator.php

示例9: getListeners

 public function getListeners()
 {
     $ret = parent::getListeners();
     foreach (Kwc_Abstract::getComponentClasses() as $class) {
         if (in_array('Kwc_Advanced_SearchEngineReferer_Component', Kwc_Abstract::getParentClasses($class))) {
             $m = Kwc_Abstract::createChildModel($class);
             $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onRowInsert');
         }
     }
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:11,代碼來源:Events.php

示例10: getListeners

 public function getListeners()
 {
     $ret = parent::getListeners();
     $m = Kwc_Abstract::createChildModel($this->_class);
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onRowUpdate');
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onRowUpdate');
     $masterComponentClass = Kwc_Abstract::getSetting($this->_class, 'masterComponentClass');
     $m = Kwc_Abstract::createChildModel($masterComponentClass);
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onMasterRowUpdate');
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Deleted', 'callback' => 'onMasterRowDelete');
     return $ret;
 }
開發者ID:nsams,項目名稱:koala-framework,代碼行數:12,代碼來源:Events.php

示例11: getListeners

 public function getListeners()
 {
     $ret = parent::getListeners();
     $generators = Kwc_Abstract::getSetting($this->_class, 'generators');
     foreach ($generators['paragraphs']['component'] as $component) {
         $ret[] = array('class' => $component, 'event' => 'Kwf_Component_Event_Component_HasContentChanged', 'callback' => 'onChildHasContentChange');
     }
     $m = Kwc_Abstract::createChildModel($this->_class);
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onRowUpdate');
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onRowInsertOrDelete');
     $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Deleted', 'callback' => 'onRowInsertOrDelete');
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:13,代碼來源:Events.php

示例12: postUpdate

 public function postUpdate()
 {
     foreach (Kwc_Abstract::getComponentClasses() as $c) {
         if (is_instance_of($c, 'Kwc_Root_TrlRoot_Component')) {
             if ($m = Kwc_Abstract::createChildModel($c)) {
                 foreach ($m->getRows() as $r) {
                     $r->visible = true;
                     $r->save();
                 }
             }
         }
     }
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:13,代碼來源:20150309Legacy00003.php

示例13: setComponentId

 public function setComponentId($componentId)
 {
     $c = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($componentId, array('ignoreVisible' => true));
     $s = new Kwf_Component_Select();
     $s->ignoreVisible();
     $s->whereGenerator('paragraphs');
     $chainedModel = Kwc_Abstract::createChildModel($c->componentClass);
     foreach ($c->getChildComponents($s) as $c) {
         $chainedRow = $chainedModel->getRow($c->dbId);
         if (!$chainedRow) {
             $chainedRow = $chainedModel->createRow(array('component_id' => $c->dbId, 'visible' => false));
         }
         $this->_data[$c->componentId] = array('id' => $c->chained->row->id, 'component_id' => $componentId, 'component_class' => $c->componentClass, 'component_name' => Kwf_Trl::getInstance()->trlStaticExecute(Kwc_Abstract::getSetting($c->componentClass, 'componentName')), 'component_icon' => (string) new Kwf_Asset(Kwc_Abstract::getSetting($c->componentClass, 'componentIcon')), 'row' => $chainedRow, 'visible' => $chainedRow->visible, 'pos' => $c->chained->row->pos);
     }
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:15,代碼來源:AdminModel.php

示例14: getListeners

 public function getListeners()
 {
     $ret = parent::getListeners();
     $masterGeneratorModel = $this->_getChainedGenerator()->getModel();
     $ret[] = array('class' => get_class($masterGeneratorModel), 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onMasterRowUpdate');
     $ret[] = array('class' => get_class($masterGeneratorModel), 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onMasterRowAdd');
     $ret[] = array('class' => get_class($masterGeneratorModel), 'event' => 'Kwf_Events_Event_Row_Deleted', 'callback' => 'onMasterRowDelete');
     $ret[] = array('class' => get_class($masterGeneratorModel), 'event' => 'Kwf_Events_Event_Model_Updated', 'callback' => 'onMasterModelUpdate');
     $m = Kwc_Abstract::createChildModel($this->_class);
     if ($m) {
         $ret[] = array('class' => get_class($m), 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onRowUpdate');
         $ret[] = array('class' => get_class($m), 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onRowUpdate');
     }
     return $ret;
 }
開發者ID:xiaoguizhidao,項目名稱:koala-framework,代碼行數:15,代碼來源:Table.php

示例15: getListeners

 public function getListeners()
 {
     $ret = parent::getListeners();
     foreach (Kwc_Abstract::getComponentClasses() as $class) {
         if (is_instance_of($class, 'Kwc_Directories_Category_Directory_Component') && $this->_canCreateUsIndirectly($class)) {
             $childReference = Kwc_Abstract::hasSetting($class, 'childReferenceName') ? Kwc_Abstract::getSetting($class, 'childReferenceName') : 'Categories';
             foreach (call_user_func(array($this->_class, 'getItemDirectoryClasses'), $this->_class) as $dirCls) {
                 $dirModel = Kwc_Abstract::createChildModel($dirCls);
                 $relModel = $dirModel->getDependentModel($childReference);
                 $ret[] = array('class' => $relModel, 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onUpdateRow');
                 $ret[] = array('class' => $relModel, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onUpdateRow');
                 $ret[] = array('class' => $relModel, 'event' => 'Kwf_Events_Event_Row_Deleted', 'callback' => 'onUpdateRow');
             }
         }
     }
     return $ret;
 }
開發者ID:nsams,項目名稱:koala-framework,代碼行數:17,代碼來源:Events.php


注:本文中的Kwc_Abstract::createChildModel方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。