Overview

Namespaces

  • None
  • Yajra
    • Oci8
      • Connectors
      • Eloquent
      • Query
        • Grammars
        • Processors
      • Schema
        • Grammars

Classes

  • Yajra\Oci8\Connectors\OracleConnector
  • Yajra\Oci8\Eloquent\OracleEloquent
  • Yajra\Oci8\Oci8Connection
  • Yajra\Oci8\Oci8ServiceProvider
  • Yajra\Oci8\Query\Grammars\OracleGrammar
  • Yajra\Oci8\Query\OracleBuilder
  • Yajra\Oci8\Query\Processors\OracleProcessor
  • Yajra\Oci8\Schema\Comment
  • Yajra\Oci8\Schema\Grammars\OracleGrammar
  • Yajra\Oci8\Schema\OracleAutoIncrementHelper
  • Yajra\Oci8\Schema\OracleBlueprint
  • Yajra\Oci8\Schema\OracleBuilder
  • Yajra\Oci8\Schema\Sequence
  • Yajra\Oci8\Schema\Trigger

Traits

  • Yajra\Oci8\OracleReservedWords

Functions

  • config_path
  • Overview
  • Namespace
  • Class
  1: <?php
  2: 
  3: namespace Yajra\Oci8\Schema;
  4: 
  5: use Closure;
  6: use Illuminate\Database\Connection;
  7: use Illuminate\Database\Schema\Builder;
  8: 
  9: class OracleBuilder extends Builder
 10: {
 11:     /**
 12:      * @var \Yajra\Oci8\Schema\OracleAutoIncrementHelper
 13:      */
 14:     public $helper;
 15: 
 16:     /**
 17:      * @var \Yajra\Oci8\Schema\Comment
 18:      */
 19:     public $comment;
 20: 
 21:     /**
 22:      * @param Connection $connection
 23:      */
 24:     public function __construct(Connection $connection)
 25:     {
 26:         $this->connection = $connection;
 27:         $this->grammar    = $connection->getSchemaGrammar();
 28:         $this->helper     = new OracleAutoIncrementHelper($connection);
 29:         $this->comment    = new Comment($connection);
 30:     }
 31: 
 32:     /**
 33:      * Create a new table on the schema.
 34:      *
 35:      * @param  string $table
 36:      * @param  Closure $callback
 37:      * @return \Illuminate\Database\Schema\Blueprint
 38:      */
 39:     public function create($table, Closure $callback)
 40:     {
 41:         $blueprint = $this->createBlueprint($table);
 42: 
 43:         $blueprint->create();
 44: 
 45:         $callback($blueprint);
 46: 
 47:         $this->build($blueprint);
 48: 
 49:         $this->comment->setComments($blueprint);
 50: 
 51:         $this->helper->createAutoIncrementObjects($blueprint, $table);
 52:     }
 53: 
 54:     /**
 55:      * Changes an existing table on the schema.
 56:      *
 57:      * @param  string $table
 58:      * @param  Closure $callback
 59:      * @return \Illuminate\Database\Schema\Blueprint
 60:      */
 61:     public function table($table, Closure $callback)
 62:     {
 63:         $blueprint = $this->createBlueprint($table);
 64: 
 65:         $callback($blueprint);
 66: 
 67:         foreach($blueprint->getCommands() as $command)
 68:         {
 69:             if ($command->get('name') == 'drop')
 70:             {
 71:                 $this->helper->dropAutoIncrementObjects($table);
 72:             }
 73:         }
 74: 
 75:         $this->build($blueprint);
 76: 
 77:         $this->comment->setComments($blueprint);
 78:     }
 79: 
 80:     /**
 81:      * Create a new command set with a Closure.
 82:      *
 83:      * @param  string $table
 84:      * @param  Closure $callback
 85:      * @return \Illuminate\Database\Schema\Blueprint
 86:      */
 87:     protected function createBlueprint($table, Closure $callback = null)
 88:     {
 89:         $blueprint = new OracleBlueprint($table, $callback);
 90:         $blueprint->setTablePrefix($this->connection->getTablePrefix());
 91: 
 92:         return $blueprint;
 93:     }
 94: 
 95:     /**
 96:      * Drop a table from the schema.
 97:      *
 98:      * @param  string $table
 99:      * @return \Illuminate\Database\Schema\Blueprint
100:      */
101:     public function drop($table)
102:     {
103:         $this->helper->dropAutoIncrementObjects($table);
104:         parent::drop($table);
105:     }
106: 
107:     /**
108:      * Indicate that the table should be dropped if it exists.
109:      *
110:      * @return \Illuminate\Support\Fluent
111:      */
112:     public function dropIfExists($table)
113:     {
114:         $this->helper->dropAutoIncrementObjects($table);
115:         parent::dropIfExists($table);
116:     }
117: }
118: 
API documentation generated by ApiGen