本文整理汇总了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;
}
示例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;
}