Cake\ORM\Table::_initializeSchema PHP Method

_initializeSchema() protected method

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.
return Cake\Database\Schema\Table the altered schema
    protected function _initializeSchema(Schema $table)
    {
        return $table;
    }

Usage Example

 /**
  * @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