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


PHP Cx::getDb方法代码示例

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


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

示例1: loadThumbnails

 public function loadThumbnails()
 {
     /**
      * @var $cx \Cx\Core\Core\Controller\Cx
      */
     $pdo = $this->cx->getDb()->getPdoConnection();
     $sth = $pdo->query('SELECT id,name, size,  100 as quality, CONCAT(".thumb_",name) as value FROM  `' . DBPREFIX . 'settings_thumbnail`');
     self::$thumbnails = $sth->fetchAll();
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:9,代码来源:UploaderConfiguration.class.php

示例2: getComponent

 /**
  * Get a component controller object
  * 
  * @param string $name  component name
  * @return \Cx\Core\Core\Model\Entity\SystemComponentController 
  * The requested component controller or null if no such component exists
  */
 public function getComponent($name)
 {
     if (empty($name)) {
         return null;
     }
     $componentRepo = $this->cx->getDb()->getEntityManager()->getRepository('Cx\\Core\\Core\\Model\\Entity\\SystemComponent');
     $component = $componentRepo->findOneBy(array('name' => $name));
     if (!$component) {
         return null;
     }
     return $component->getSystemComponentController();
 }
开发者ID:Niggu,项目名称:cloudrexx,代码行数:19,代码来源:DefaultEventListener.class.php

示例3: decorate

 /**
  * Decorates an entity or an array of entities
  * @param mixed $components SystemComponent or array of SystemComponents
  * @return mixed SystemComponentController or array of SystemComponentControllers
  */
 protected function decorate($components)
 {
     if (!$components) {
         return $components;
     }
     if (!is_array($components)) {
         $yamlDir = $this->cx->getClassLoader()->getFilePath($components->getDirectory(false) . '/Model/Yaml');
         if (file_exists($yamlDir)) {
             $this->cx->getDb()->addSchemaFileDirectories(array($yamlDir));
         }
         $entity = $this->decorateEntity($components);
         return $entity;
     }
     $yamlDirs = array();
     foreach ($components as $component) {
         if (isset($this->loadedComponents[$component->getId()])) {
             continue;
         }
         $yamlDir = $this->cx->getClassLoader()->getFilePath($component->getDirectory(false) . '/Model/Yaml');
         if ($yamlDir) {
             $yamlDirs[] = $yamlDir;
         }
     }
     $this->cx->getDb()->addSchemaFileDirectories($yamlDirs);
     foreach ($components as &$component) {
         if (isset($this->loadedComponents[$component->getId()])) {
             $component = $this->loadedComponents[$component->getId()];
             continue;
         }
         $component = $this->decorateEntity($component);
         \Cx\Core\Json\JsonData::addAdapter($component->getControllersAccessableByJson(), $component->getNamespace() . '\\Controller');
     }
     return $components;
 }
开发者ID:nahakiole,项目名称:cloudrexx,代码行数:39,代码来源:SystemComponentRepository.class.php

示例4: setPreLoadedComponents

 /**
  * Loads the systemComponent using the doctrine entity manager for the existing SystemComponentController and adds it to the repository
  * @param array $preLoadedComponents An array containing the preloaded components
  */
 public function setPreLoadedComponents($preLoadedComponents)
 {
     foreach ($preLoadedComponents as $componentName => $preLoadedComponent) {
         // get systemComponent by name
         $systemComponent = parent::findOneBy(array('name' => $componentName));
         // set systemComponent on existing systemComponentController
         $preLoadedComponent->setSystemComponent($systemComponent);
         // add yaml directory
         $yamlDir = $this->cx->getClassLoader()->getFilePath($preLoadedComponent->getDirectory(false) . '/Model/Yaml');
         if (file_exists($yamlDir)) {
             $this->cx->getDb()->addSchemaFileDirectories(array($yamlDir));
         }
         // store the systemComponent with its now loaded id as key to the array of loaded components
         $this->loadedComponents[$preLoadedComponent->getId()] = $preLoadedComponent;
         // Add JSON adapter
         \Cx\Core\Json\JsonData::addAdapter($preLoadedComponent->getControllersAccessableByJson(), $preLoadedComponent->getNamespace() . '\\Controller');
     }
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:22,代码来源:SystemComponentRepository.class.php

示例5: getSites

 /**
  * Get all content pages.
  *
  * @return array
  */
 public function getSites()
 {
     $pageTree = new MediaBrowserPageTree($this->cx->getDb()->getEntityManager(), $this->cx->getLicense(), 0, null, FRONTEND_LANG_ID, null, false, false, false);
     $pageTree->render();
     return $pageTree->getFlatTree();
 }
开发者ID:hbdsklf,项目名称:LimeCMS,代码行数:11,代码来源:JsonMediaBrowser.class.php


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