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


PHP Status::genSubgridVariables方法代码示例

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


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

示例1: getBreadcrumb

 protected function getBreadcrumb()
 {
     $depth = Status::depth($this->statusVariables);
     if ($depth <= 1) {
         return array();
     }
     $breadcrumb = array();
     $gridConfig = $this->config;
     $breadcrumb[] = array('title' => $gridConfig->getTitle(), 'url' => '#');
     $lastStatusVariables = array();
     $db = new Db($this->config, $this->statusVariables);
     for ($i = 1; $i <= $depth - 1; $i++) {
         if (isset($this->statusVariables['gridParentId' . $i])) {
             $parentId = $this->statusVariables['gridParentId' . $i];
         } else {
             $parentId = null;
         }
         if (isset($this->statusVariables['gridId' . $i])) {
             $gridId = $this->statusVariables['gridId' . $i];
         } else {
             $gridId = null;
         }
         $lastStatusVariables = Status::genSubgridVariables($lastStatusVariables, $gridId, $parentId);
         $tmpGridConfig = $gridConfig->subgridConfig($lastStatusVariables);
         $hash = Status::build($lastStatusVariables);
         $breadcrumbGridconfig = $gridConfig->subgridConfig($lastStatusVariables, $i);
         if ($breadcrumbGridconfig->getBreadcrumbField()) {
             $title = $db->breadcrumbTitle($i);
         } else {
             $title = $tmpGridConfig->getTitle();
         }
         $breadcrumb[] = array('title' => $title, 'url' => '#' . $hash);
     }
     return $breadcrumb;
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:35,代码来源:Display.php

示例2: delete

 public function delete($id)
 {
     $db = new Db($this->subgridConfig, $this->statusVariables);
     $fields = $this->subgridConfig->fields();
     $curData = $db->fetchRow($id);
     foreach ($fields as $field) {
         $fieldObject = $this->subgridConfig->fieldObject($field);
         $fieldObject->beforeDelete($id, $curData);
     }
     $sql = "\n        DELETE\n            " . $this->subgridConfig->tableName() . "\n        FROM\n            " . $this->subgridConfig->tableName() . "\n            " . $db->joinQuery() . "\n        WHERE\n            " . $this->subgridConfig->tableName() . ".`" . $this->subgridConfig->idField() . "` = :id\n        ";
     $params = array('id' => $id);
     $callables = $this->subgridConfig->beforeDelete();
     if ($callables) {
         if (is_array($callables) && !is_callable($callables)) {
             foreach ($callables as $callable) {
                 call_user_func($callable, $params['id']);
             }
         } else {
             call_user_func($callables, $params['id']);
         }
     }
     ipDb()->execute($sql, $params);
     if ($this->subgridConfig->isMultilingual()) {
         $sql = "\n            DELETE\n\n            FROM\n                " . $this->subgridConfig->languageTableName() . "\n            WHERE\n                " . $this->subgridConfig->languageTableName() . ".`" . $this->subgridConfig->languageForeignKeyField() . "` = :id\n            ";
         ipDb()->execute($sql, $params);
     }
     $callables = $this->subgridConfig->afterDelete();
     if ($callables) {
         if (is_array($callables) && !is_callable($callables)) {
             foreach ($callables as $callable) {
                 call_user_func($callable, $params['id']);
             }
         } else {
             call_user_func($callables, $params['id']);
         }
     }
     //remove records in child grids
     foreach ($fields as $field) {
         $fieldObject = $this->subgridConfig->fieldObject($field);
         $fieldObject->afterDelete($id, $curData);
         if ($field['type'] == 'Grid') {
             $childStatusVariables = Status::genSubgridVariables($this->statusVariables, $field['gridId'], $id);
             $subActions = new Actions(new Config($field['config']), $childStatusVariables);
             $childConfig = new Config($field['config']);
             $db = new Db($childConfig, $childStatusVariables);
             $where = $db->buildSqlWhere();
             $sql = "\n                    SELECT\n                        `" . $childConfig->idField() . "`\n                    FROM\n                        " . $childConfig->tableName() . "\n                    WHERE\n                        {$where}\n                ";
             $idsToDelete = ipDb()->fetchColumn($sql);
             foreach ($idsToDelete as $idToDelete) {
                 $subActions->delete($idToDelete);
             }
         }
     }
 }
开发者ID:Umz,项目名称:ImpressPages,代码行数:54,代码来源:Actions.php

示例3: subgrid

 protected function subgrid($params)
 {
     if (empty($params['gridId'])) {
         throw new \Ip\Exception('girdId GET variable missing');
     }
     if (empty($params['gridParentId'])) {
         throw new \Ip\Exception('girdParentId GET variable missing');
     }
     $newStatusVariables = Status::genSubgridVariables($this->statusVariables, $params['gridId'], $params['gridParentId']);
     $commands[] = Commands::setHash(Status::build($newStatusVariables));
     return $commands;
 }
开发者ID:impresspages,项目名称:impresspages,代码行数:12,代码来源:Table.php


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