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


PHP parent::fase方法代码示例

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


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

示例1: add

 public function add()
 {
     $tabelas = array_intersect(parent::$dev['tabelas'], parent::$homolog['tabelas']);
     $string = $stringResult = "";
     if (!empty($tabelas)) {
         $propriedade = new PropriedadeBO();
         parent::$fase = FaseQuery::ADD;
         foreach ($tabelas as $tabelaInput) {
             list(parent::$schema, parent::$tabela) = explode(".", $tabelaInput);
             $schema = parent::$schema;
             $tabela = parent::$tabela;
             if (isset(parent::$dev['schema'][$schema]['tabela'][$tabela]['coluna'])) {
                 $dev = array_keys(parent::$dev['schema'][$schema]['tabela'][$tabela]['coluna']);
             }
             if (isset(parent::$homolog['schema'][$schema]['tabela'][$tabela]['coluna'])) {
                 $homolog = array_keys(parent::$homolog['schema'][$schema]['tabela'][$tabela]['coluna']);
             }
             $colunas = array_diff($dev, $homolog);
             if (!empty($colunas)) {
                 $stringResult = "\n\n\n" . str_pad(" ADD COLUMN ", 100, "-", STR_PAD_BOTH);
                 foreach ($colunas as $coluna) {
                     parent::$coluna = $coluna;
                     $string .= "\n\nALTER TABLE {$schema}.{$tabela} ADD COLUMN {$coluna} ";
                     $string .= $propriedade->construct() . ";";
                 }
             }
         }
     }
     return $stringResult . $string;
 }
开发者ID:rtakauti,项目名称:Galileu,代码行数:30,代码来源:ColunaBO.php

示例2: alter

 public function alter()
 {
     $schema = parent::$schema;
     $tabela = parent::$tabela;
     $coluna = parent::$coluna;
     parent::$fase = FaseQuery::ALTER;
     $propriedadesBO = $this->properties;
     $dev = parent::$dev['schema'][$schema]['tabela'][$tabela]['coluna'][$coluna];
     $homolog = parent::$homolog['schema'][$schema]['tabela'][$tabela]['coluna'][$coluna];
     parent::$propriedades = array_diff_assoc($dev, $homolog);
     $string = $anteriorColuna = $anterior = "";
     foreach (parent::$propriedades as $propriedade => $valor) {
         $anteriorColuna = "\n\n-- ESTADO ANTERIOR: {$coluna} -- ";
         $homologValor = parent::$homolog['schema'][$schema]['tabela'][$tabela]['coluna'][$coluna][$propriedade];
         if (!isset($homologValor)) {
             $homologValor = "NULO";
         }
         $anterior .= " {$propriedade} => {$homologValor}, ";
         $string .= GeradorPropriedades::gerarPropriedade($propriedadesBO[$propriedade], $valor);
     }
     $anterior = substr($anterior, 0, -2);
     return $anteriorColuna . $anterior . $string;
 }
开发者ID:rtakauti,项目名称:Galileu,代码行数:23,代码来源:PropriedadeBO.php


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