src/Phiber/ORM/Persistence/TableMySql.php
static function drop($obj)
    {
        $tabela = strtolower(FuncoesReflections::pegaNomeClasseObjeto($obj));
        $atributosObjeto = FuncoesReflections::pegaAtributosDoObjeto($obj);
        $columnsTabela = self::columns($tabela);
        $arrayCamposTabela = [];
        for ($i = 0; $i < count($columnsTabela); $i++) {
            array_push($arrayCamposTabela, $columnsTabela[$i]['Field']);
        }
        
        $arrayDiff = array_diff($arrayCamposTabela, $atributosObjeto);
        $arrayDiff = array_values($arrayDiff);
        $sqlDrop = "ALTER TABLE $tabela \n";
        for ($j = 0; $j < count($arrayDiff); $j++) {
            if ($j != count($arrayDiff) - 1) {
                $sqlDrop .= "DROP " . $arrayDiff[$j] . ", ";
            } else {
                $sqlDrop .= "DROP " . $arrayDiff[$j] . ";";
            }
        }
        
        $contentFile = JsonReader::read(BASE_DIR."/phiber_config.json")->phiber->code_sync == 1 ? true : false;
        if ($contentFile) {
            $pdo = self::getConnection()->prepare($sqlDrop);
            if ($pdo->execute()) {
                return true;
            };

        } else {
            return $sqlDrop;
        }

        return false;
    }
static function drop($obj)
    {
        $tabela = strtolower(FuncoesReflections::pegaNomeClasseObjeto($obj));
        $atributosObjeto = FuncoesReflections::pegaAtributosDoObjeto($obj);
        $columnsTabela = self::columns($tabela);
        $arrayCamposTabela = [];
        for ($i = 0; $i < count($columnsTabela); $i++) {
            array_push($arrayCamposTabela, $columnsTabela[$i]['Field']);
        }
        
        $arrayDiff = array_diff($arrayCamposTabela, $atributosObjeto);
        $arrayDiff = array_values($arrayDiff);
        $sqlDrop = "ALTER TABLE $tabela \n";
        for ($j = 0; $j < count($arrayDiff); $j++) {
            if ($j != count($arrayDiff) - 1) {
                $sqlDrop .= "DROP " . $arrayDiff[$j] . ", ";
            } else {
                $sqlDrop .= "DROP " . $arrayDiff[$j] . ";";
            }
        }
        
        $contentFile = JsonReader::read(BASE_DIR."/phiber_config.json")->phiber->code_sync == 1 ? true : false;
        if ($contentFile) {
            $pdo = self::getConnection()->prepare($sqlDrop);
            if ($pdo->execute()) {
                return true;
            };

        } else {
            return $sqlDrop;
        }

        return false;
    }
static function drop ( $ obj ) { $ tabela = strtolower ( FuncoesReflections :: pegaNomeClasseObjeto ( $ obj ) ) ; $ atributosObjeto = FuncoesReflections :: pegaAtributosDoObjeto ( $ obj ) ; $ columnsTabela = self :: columns ( $ tabela ) ; $ arrayCamposTabela = [ ] ; for ( $ i = 0 ; $ i < count ( $ columnsTabela ) ; $ i ++ ) { array_push ( $ arrayCamposTabela , $ columnsTabela [ $ i ] [ 'Field' ] ) ; } $ arrayDiff = array_diff ( $ arrayCamposTabela , $ atributosObjeto ) ; $ arrayDiff = array_values ( $ arrayDiff ) ; $ sqlDrop = "ALTER TABLE $tabela \n" ; for ( $ j = 0 ; $ j < count ( $ arrayDiff ) ; $ j ++ ) { if ( $ j != count ( $ arrayDiff ) - 1 ) { $ sqlDrop .= "DROP " . $ arrayDiff [ $ j ] . ", " ; } else { $ sqlDrop .= "DROP " . $ arrayDiff [ $ j ] . ";" ; } } $ contentFile = JsonReader :: read ( BASE_DIR . "/phiber_config.json" ) -> phiber -> code_sync == 1 ? true : false ; if ( $ contentFile ) { $ pdo = self :: getConnection ( ) -> prepare ( $ sqlDrop ) ; if ( $ pdo -> execute ( ) ) { return true ; } ; } else { return $ sqlDrop ; } return false ; }
Deleta a tabela do banco de dados.

@param  Object $obj
@return bool|string
Deleta a tabela do banco de dados .