当前位置: 首页>>代码示例>>PHP>>正文


PHP Kwc_Abstract::createOwnModel方法代码示例

本文整理汇总了PHP中Kwc_Abstract::createOwnModel方法的典型用法代码示例。如果您正苦于以下问题:PHP Kwc_Abstract::createOwnModel方法的具体用法?PHP Kwc_Abstract::createOwnModel怎么用?PHP Kwc_Abstract::createOwnModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kwc_Abstract的用法示例。


在下文中一共展示了Kwc_Abstract::createOwnModel方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getComponentsForTarget

 public static function getComponentsForTarget($componentClass, $targetId, $includeSubpages)
 {
     if (!isset(self::$_pageIds[$componentClass])) {
         $ids = array();
         $model = Kwc_Abstract::createOwnModel($componentClass);
         foreach ($model->export(Kwf_Model_Abstract::FORMAT_ARRAY) as $row) {
             $target = $row['target'];
             if (!isset($ids[$target])) {
                 $ids[$target] = array();
             }
             $ids[$target][] = $row['component_id'];
         }
         self::$_pageIds[$componentClass] = $ids;
     }
     $ret = array();
     foreach (self::$_pageIds[$componentClass] as $targetPageId => $dbIds) {
         $ids = array();
         if ($includeSubpages) {
             if ((string) $targetPageId == (string) $targetId || substr($targetPageId, 0, strlen($targetId) + 1) == $targetId . '-' || substr($targetPageId, 0, strlen($targetId) + 1) == $targetId . '_') {
                 $ids = $dbIds;
             }
         } else {
             if ((string) $targetPageId === (string) $targetId) {
                 $ids = $dbIds;
             }
         }
         foreach ($ids as $dbId) {
             $ret = array_merge($ret, Kwf_Component_Data_Root::getInstance()->getComponentsByDbId($dbId));
         }
     }
     return $ret;
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:32,代码来源:Events.php

示例2: _getModel

 protected function _getModel()
 {
     if (!$this->_model) {
         $this->_model = Kwc_Abstract::createOwnModel($this->_class);
     }
     return $this->_model;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:7,代码来源:Generator.php

示例3: _getLinkRow

 private function _getLinkRow()
 {
     if (!isset($this->_linkRow)) {
         $m = Kwc_Abstract::createOwnModel($this->componentClass);
         $this->_linkRow = $m->getRow($this->dbId);
     }
     return $this->_linkRow;
 }
开发者ID:nsams,项目名称:koala-framework,代码行数:8,代码来源:Data.php

示例4: _getData

 protected function _getData($select = array())
 {
     $m = Kwc_Abstract::createOwnModel($this->componentClass);
     if ($column = $m->fetchColumnByPrimaryId('target_component_id', $this->dbId)) {
         return Kwf_Component_Data_Root::getInstance()->getComponentByDbId($column, array('subroot' => $this));
     }
     return false;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:8,代码来源:Data.php

示例5: _onCategoryChanged

 private function _onCategoryChanged($categoryIds)
 {
     $model = Kwc_Abstract::createOwnModel($this->_class);
     $select = $model->select()->whereEquals('category_id', $categoryIds);
     foreach ($model->getRows($select) as $row) {
         $this->_deleteCache($row->component_id);
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:8,代码来源:Events.php

示例6: _getLinkRow

 private function _getLinkRow()
 {
     if (!isset($this->_linkRow)) {
         $m = Kwc_Abstract::createOwnModel($this->componentClass);
         $cols = array('target', 'open_type', 'width', 'height', 'menubar', 'toolbar', 'locationbar', 'statusbar', 'scrollbars', 'resizable');
         $this->_linkRow = (object) $m->fetchColumnsByPrimaryId($cols, $this->dbId);
     }
     return $this->_linkRow;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:9,代码来源:Data.php

示例7: getListeners

 public function getListeners()
 {
     $ret = array();
     $ownModel = Kwc_Abstract::createOwnModel($this->_class);
     $models = Kwf_Model_Abstract::getInstance($ownModel)->getDependentModels();
     $model = $models['Networks'];
     $ret[] = array('class' => $model, 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onNetworksRowUpdate');
     $ret[] = array('class' => $model, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onNetworksRowUpdate');
     $ret[] = array('class' => $model, 'event' => 'Kwf_Events_Event_Row_Deleted', 'callback' => 'onNetworksRowUpdate');
     return $ret;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:11,代码来源:Events.php

示例8: __construct

 public function __construct($name, $class)
 {
     $this->setClass($class);
     if ($class) {
         if (!$this->getModel()) {
             $model = Kwc_Abstract::createOwnModel($class);
             if ($model) {
                 $this->setModel($model);
             }
         }
         $this->setCreateMissingRow(true);
     }
     parent::__construct($name);
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:14,代码来源:Form.php

示例9: getListeners

 public function getListeners()
 {
     $ret = parent::getListeners();
     if (Kwc_Abstract::hasSetting($this->_class, 'throwContentChangedOnOwnMasterModelUpdate') || Kwc_Abstract::hasSetting($this->_class, 'throwHasContentChangedOnMasterRowColumnsUpdate')) {
         $masterComponentClass = Kwc_Abstract::getSetting($this->_class, 'masterComponentClass');
         $m = Kwc_Abstract::createOwnModel($masterComponentClass);
         if (!$m) {
             throw new Kwf_Exception("Master component '{$masterComponentClass}' doesn't have ownModel");
         }
         $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Updated', 'callback' => 'onMasterOwnRowUpdate');
         $ret[] = array('class' => $m, 'event' => 'Kwf_Events_Event_Row_Inserted', 'callback' => 'onMasterOwnRowUpdate');
     }
     return $ret;
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:14,代码来源:Events.php

示例10: load

 public function load($row)
 {
     $model = Kwc_Abstract::createOwnModel($this->_class);
     $componentId = $row->component_id . '-' . $row->id;
     if ($this->_subComponent) {
         $componentId .= $this->_subComponent;
     }
     $row = $model->getRow($componentId);
     if ($row && $row->kwf_upload_id) {
         $hashKey = Kwf_Util_Hash::hash($row->kwf_upload_id);
         return Kwf_Setup::getBaseUrl() . '/kwf/media/upload/preview?uploadId=' . $row->kwf_upload_id . '&hashKey=' . $hashKey . '&size=' . $this->_size;
     } else {
         return '';
     }
 }
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:15,代码来源:Image.php

示例11: _getComponentDbIdsForTarget

 private static function _getComponentDbIdsForTarget($componentClass, $targetIds, $includeSubpages)
 {
     if (!isset(self::$_pageIds[$componentClass])) {
         $ids = array();
         $model = Kwc_Abstract::createOwnModel($componentClass);
         foreach ($model->export(Kwf_Model_Abstract::FORMAT_ARRAY) as $row) {
             $target = $row['target'];
             if (!isset($ids[$target])) {
                 $ids[$target] = array();
             }
             $ids[$target][] = $row['component_id'];
         }
         self::$_pageIds[$componentClass] = $ids;
     }
     $ret = array();
     foreach (self::$_pageIds[$componentClass] as $targetPageId => $dbIds) {
         $ids = array();
         if ($includeSubpages) {
             foreach ($targetIds as $targetId) {
                 if ((string) $targetPageId == $targetId || substr($targetPageId, 0, strlen($targetId) + 1) == $targetId . '-' || substr($targetPageId, 0, strlen($targetId) + 1) == $targetId . '_') {
                     $ret = array_merge($ret, $dbIds);
                     break;
                 }
             }
         } else {
             if (in_array((string) $targetPageId, $targetIds, true)) {
                 $ret = array_merge($ret, $dbIds);
             }
         }
     }
     return $ret;
 }
开发者ID:koala-framework,项目名称:koala-framework,代码行数:32,代码来源:Events.php


注:本文中的Kwc_Abstract::createOwnModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。