/** * Tell CakePHP to modify the data structure of the entity data types * @param Schema $schema this table's schema * @return Schema the adjusted schema definition */ protected function _initializeSchema(Schema $schema) { $schema->columnType('sent_to', 'json'); $schema->columnType('sent_from', 'json'); $schema->columnType('email_data', 'json'); return $schema; }
/** * @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); }
/** * Test columnType method * * @return void */ public function testColumnType() { $table = new Table('articles'); $table->addColumn('title', ['type' => 'string', 'length' => 25, 'null' => false]); $this->assertEquals('string', $table->columnType('title')); $this->assertNull($table->columnType('not there')); }
protected function _initializeSchema(Schema $table) { $table->columnType('email', 'crypted'); $table->columnType('username', 'crypted'); $table->columnType('last_ip', 'crypted'); $table->columnType('token', 'crypted'); return $table; }
/** * Initialize schema method * * @param \Cake\Database\Schema\Table $schema The schema of the Table. * * @return \Cake\Database\Schema\Table */ protected function _initializeSchema(Schema $schema) { $schema->columnType('secret', 'encryptedsecurity'); $schema->columnType('username', 'encryptedsecurity'); $schema->columnType('session', 'encryptedsecurity'); $schema->columnType('recovery_code', 'encryptedsecurity'); return $schema; }
/** * @param \Cake\Database\Schema\Table $table * * @return \Cake\Database\Schema\Table */ protected function _initializeSchema(Schema $table) { $table->columnType('image', 'image'); return $table; }
/** * Converts the internal records into data used to generate a query * for given table schema. * * @param \Schema\Table $schema Table schema. * @param array $records Internal records. * @return array Fields, values and types. */ protected function _getRecords(Table $schema, $records) { $fields = $values = $types = []; $columns = $schema->columns(); foreach ($records as $record) { $fields = array_merge($fields, array_intersect(array_keys($record), $columns)); } $fields = array_values(array_unique($fields)); foreach ($fields as $field) { $types[$field] = $schema->columnType($field); } $default = array_fill_keys($fields, null); foreach ($records as $record) { $values[] = array_merge($default, $record); } return [$fields, $values, $types]; }
/** * Initialize Schema * * @param Schema $schema * @return Schema */ protected function _initializeSchema(Schema $schema) { $schema->columnType('data', 'json'); $schema->columnType('stats', 'json'); return $schema; }
/** * _initializeSchema */ protected function _initializeSchema(\Cake\Database\Schema\Table $table) { $table->columnType('image', 'proffer.file'); return $table; }
protected function _initializeSchema(Schema $table) { $table->columnType('ip', 'ip'); return parent::_initializeSchema($table); }
protected function _initializeSchema(Schema $schema) { $schema->columnType('context', 'loggingJson'); return $schema; }
/** * Returns an array of column data for a single column * * @param \Cake\Database\Schema\Table $tableSchema Name of the table to retrieve columns for * @param string $column A column to retrieve data for * @return array */ public function column($tableSchema, $column) { return ['columnType' => $tableSchema->columnType($column), 'options' => $this->attributes($tableSchema->name(), $column)]; }
/** * Tell CakePHP to modify the data structure of the entity data types * @param Schema $schema this table's schema * @return Schema the adjusted schema definition */ protected function _initializeSchema(Schema $schema) { $schema->columnType('from_addr', 'json'); $schema->columnType('sender_addr', 'json'); $schema->columnType('to_addr', 'json'); $schema->columnType('cc_addr', 'json'); $schema->columnType('bcc_addr', 'json'); $schema->columnType('replyTo', 'json'); $schema->columnType('readReceipt', 'json'); $schema->columnType('returnPath', 'json'); $schema->columnType('headers', 'json'); $schema->columnType('viewVars', 'json'); $schema->columnType('processor', 'json'); $schema->columnType('attachments', 'json'); $schema->columnType('helpers', 'json'); return $schema; }
/** * Tests getting the base type as it is retuned by the Type class * * @return void */ public function testBaseColumnTypeInherited() { Type::map('foo', __NAMESPACE__ . '\\FooType'); $table = new Table('articles'); $table->addColumn('thing', ['type' => 'foo', 'null' => false]); $this->assertEquals('foo', $table->columnType('thing')); $this->assertEquals('integer', $table->baseColumnType('thing')); }
/** * @param \Cake\Database\Schema\Table $schema * @return \Cake\Database\Schema\Table */ protected function _initializeSchema(Schema $schema) { $schema->columnType('foreign_data', 'json'); return $schema; }
/** * Tell CakePHP to modify the data structure of the entity data types * @param Schema $schema this table's schema * @return Schema the adjusted schema definition */ protected function _initializeSchema(Schema $schema) { $schema->columnType('before_edit', 'json'); $schema->columnType('after_edit', 'json'); return $schema; }
/** * Sets the column type for template_vars and headers to json. * * @param Schema $schema The table description * * @return Schema */ protected function _initializeSchema(Schema $schema) { $schema->columnType('template_vars', 'serialize'); $schema->columnType('headers', 'serialize'); return $schema; }
/** * Alter the schema used by this table. * * @param \Cake\Database\Schema\Table $table The table definition fetched from database * @return \Cake\Database\Schema\Table the altered schema */ protected function _initializeSchema(Schema $table) { $table->columnType('data', 'serialized'); return $table; }
/** * Sets the column type for template_vars and headers to json. * * @param Schema $schema The table description * * @return Schema */ protected function _initializeSchema(Schema $schema) { $type = Configure::read('EmailQueue.serialization_type') ?: 'email_queue.serialize'; $schema->columnType('template_vars', $type); $schema->columnType('headers', $type); $schema->columnType('attachments', $type); return $schema; }
protected function _initializeSchema(Schema $schema) { $schema->columnType('gender', 'gender'); return $schema; }
protected function _initializeSchema(Schema $table) { //return parent::_initializeSchema($table); $table->columnType('photo', 'proffer.file'); return $table; }
/** * @param \Cake\Database\Schema\Table $schema * * @return \Cake\Database\Schema\Table */ protected function _initializeSchema(Schema $schema) { $schema->columnType('data', 'object'); return $schema; }
/** * Tell CakePHP to modify the data structure of the entity data types * @param Schema $schema this table's schema * @return Schema the adjusted schema definition */ protected function _initializeSchema(Schema $schema) { $schema->columnType('viewVars', 'json'); return $schema; }
/** * @param \Cake\Database\Schema\Table $schema * * @return \Cake\Database\Schema\Table */ protected function _initializeSchema(Schema $schema) { $schema->columnType('year_of_birth', 'year'); return $schema; }
/** * {@inheritdoc} */ protected function _initializeSchema(Schema $schema) { Type::map('gourmet_dashboard', 'Gourmet\\Dashboard\\Database\\Type\\JsonType'); $schema->columnType('data', 'gourmet_dashboard'); return $schema; }