Cake\ORM\Table::_initializeSchema PHP 메소드

_initializeSchema() 보호된 메소드

This function is only called after fetching the schema out of the database. If you wish to provide your own schema to this table without touching the database, you can override schema() or inject the definitions though that method. ### Example: protected function _initializeSchema(\Cake\Database\Schema\Table $table) { $table->columnType('preferences', 'json'); return $table; }
protected _initializeSchema ( Cake\Database\Schema\Table $table ) : Cake\Database\Schema\Table
$table Cake\Database\Schema\Table The table definition fetched from database.
리턴 Cake\Database\Schema\Table the altered schema
    protected function _initializeSchema(Schema $table)
    {
        return $table;
    }

Usage Example

예제 #1
0
 /**
  * @param \Cake\Database\Schema\Table $table Table schema
  * @return \Cake\Database\Schema\Table
  */
 protected function _initializeSchema(Schema $table)
 {
     $table->columnType('payload', 'serialize');
     $table->columnType('options', 'serialize');
     $table->columnType('history', 'json');
     return parent::_initializeSchema($table);
 }
All Usage Examples Of Cake\ORM\Table::_initializeSchema