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


PHP Grid::isLoaded方法代码示例

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


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

示例1: writeGrid

 public function writeGrid(Grid $grid)
 {
     if (!$grid->isLoaded()) {
         $this->Torpor()->throwException($this->Torpor()->containerKeyName($grid) . ' grid not loaded (can only cache loaded grids)');
     }
     return $this->_memcache->set($this->makeGridKey($grid), $grid->dumpArray(true), $this->getCompression() ? MEMCACHE_COMPRESSED : null, $this->getTTL());
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:7,代码来源:TorporMemcache.php

示例2: scanForInsertId

 protected function scanForInsertId(Grid $grid)
 {
     if (!$grid->isLoaded()) {
         $primaryKey = $grid->primaryKey();
         $foundKeyColumn = false;
         if (is_array($primaryKey)) {
             foreach ($primaryKey as $keyColumn) {
                 if (!$keyColumn->isGeneratedOnPublish() || $keyColumn->hasData()) {
                     continue;
                 }
                 $foundKeyColumn = $keyColumn;
                 break;
             }
         } else {
             if ($primaryKey->isGeneratedOnPublish() && !$primaryKey->hasData()) {
                 $foundKeyColumn = $primaryKey;
             }
         }
         if ($foundKeyColumn) {
             $result = $this->query('SELECT SCOPE_IDENTITY() AS [LAST_INSERT_ID]');
             if (!$result || mssql_num_rows($result) != 1) {
                 $this->throwException('Attempt to fetch last insert id value failed: ' . $this->error());
             }
             $dataRow = $this->fetch_row($result);
             $foundKeyColumn->setData(array_shift($dataRow));
         }
     }
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:28,代码来源:MSSQLDataStore.php

示例3: writeGrid

 public function writeGrid(Grid $grid)
 {
     if (!$grid->isLoaded()) {
         $this->Torpor()->throwException($this->Torpor()->containerKeyName($grid) . ' grid not loaded (can only cache loaded grids)');
     }
     if (!isset($_SESSION[$this->Torpor()->containerKeyName($grid)])) {
         $_SESSION[$this->Torpor()->containerKeyName($grid)] = array();
     }
     $_SESSION[$this->Torpor()->containerKeyName($grid)][$this->makeGridKey($grid)] = $grid->dumpArray(true);
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:10,代码来源:TorporCache.php

示例4: scanForInsertId

 protected function scanForInsertId(Grid $grid, $sequence, $next = true)
 {
     if (!$grid->isLoaded()) {
         $primaryKey = $grid->primaryKey();
         $foundKeyColumn = false;
         if (is_array($primaryKey)) {
             foreach ($primaryKey as $keyColumn) {
                 if (!$keyColumn->isGeneratedOnPublish() || $keyColumn->hasData()) {
                     continue;
                 }
                 $foundKeyColumn = $keyColumn;
                 break;
             }
         } else {
             if ($primaryKey->isGeneratedOnPublish() && !$primaryKey->hasData()) {
                 $foundKeyColumn = $primaryKey;
             }
         }
         if ($foundKeyColumn) {
             $result = $this->query('SELECT ' . $this->escapeDataName($sequence) . '.' . $this->escapeDataName($next ? 'NEXTVAL' : 'CURRVAL') . ' ' . $this->asColumnOperator . ' ' . $this->escapeDataNameAlias('LAST_INSERT_ID') . ' FROM ' . $this->escapeDataName('DUAL'));
             if (!is_resource($result)) {
                 $this->throwException('Attempt to fetch last insert id value failed: ' . $this->error());
             }
             $dataRow = $this->fetch_row($result);
             $foundKeyColumn->setData(array_shift($dataRow));
         }
     }
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:28,代码来源:OracleDataStore.php

示例5: LoadFromCriteria

 public function LoadFromCriteria(Grid $grid, CriteriaBase $criteria, $refresh = false)
 {
     if (!$grid->isLoaded() || $refresh) {
         $sql = $this->CriteriaToSQL($grid, $criteria);
         $this->LoadGridFromQuery($grid, $sql, 1);
     }
     return $grid->isLoaded();
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:8,代码来源:ANSISQLDataStore.php

示例6: scanForInsertId

 protected function scanForInsertId(Grid $grid)
 {
     if (!$grid->isLoaded()) {
         $primaryKey = $grid->primaryKey();
         $foundKeyColumn = false;
         if (is_array($primaryKey)) {
             foreach ($primaryKey as $keyColumn) {
                 if (!$keyColumn->isGeneratedOnPublish() || $keyColumn->hasData()) {
                     continue;
                 }
                 $foundKeyColumn = $keyColumn;
                 break;
             }
         } else {
             if ($primaryKey->isGeneratedOnPublish() && !$primaryKey->hasData()) {
                 $foundKeyColumn = $primaryKey;
             }
         }
         if ($foundKeyColumn && ($lastInsertId = sqlite_last_insert_rowid($this->getConnection()))) {
             $foundKeyColumn->setData($lastInsertId);
         }
     }
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:23,代码来源:SQLiteDataStore.php

示例7: scanForInsertId

 protected function scanForInsertId(Grid $grid)
 {
     if (!$grid->isLoaded()) {
         $primaryKey = $grid->primaryKey();
         $foundKeyColumn = false;
         if (is_array($primaryKey)) {
             foreach ($primaryKey as $keyColumn) {
                 if (!$keyColumn->isGeneratedOnPublish() || $keyColumn->hasData()) {
                     continue;
                 }
                 $foundKeyColumn = $keyColumn;
                 break;
             }
         } else {
             if ($primaryKey instanceof Column && $primaryKey->isGeneratedOnPublish() && !$primaryKey->hasData()) {
                 $foundKeyColumn = $primaryKey;
             }
         }
         if ($foundKeyColumn && in_array($foundKeyColumn->getType(), array(Column::TYPE_FLOAT, Column::TYPE_INTEGER, Column::TYPE_UNSIGNED_INTEGER))) {
             // Executing the query directly, since the mysql_insert_id() command casts the return
             // value to c(long), and may truncate.
             $result = $this->query('SELECT LAST_INSERT_ID()');
             if (!$result || $this->num_rows($result) != 1) {
                 $this->throwException('Attempt to fetch last insert id value failed: ' . $this->error());
             }
             $dataRow = $this->fetch_row($result);
             $foundKeyColumn->setData(array_shift($dataRow));
         }
     }
 }
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:30,代码来源:MySQLDataStore.php


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