当前位置: 首页>>代码示例>>PHP>>正文


PHP Table::columnType方法代码示例

本文整理汇总了PHP中Cake\Database\Schema\Table::columnType方法的典型用法代码示例。如果您正苦于以下问题:PHP Table::columnType方法的具体用法?PHP Table::columnType怎么用?PHP Table::columnType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cake\Database\Schema\Table的用法示例。


在下文中一共展示了Table::columnType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _initializeSchema

 /**
  * 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;
 }
开发者ID:cwbit,项目名称:cakephp-emailqueue,代码行数:12,代码来源:EmailLogsTable.php

示例2: _initializeSchema

 /**
  * @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);
 }
开发者ID:uafrica,项目名称:delayed-jobs,代码行数:11,代码来源:DelayedJobsTable.php

示例3: testColumnType

 /**
  * 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'));
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:12,代码来源:TableTest.php

示例4: _initializeSchema

 protected function _initializeSchema(Schema $table)
 {
     $table->columnType('email', 'crypted');
     $table->columnType('username', 'crypted');
     $table->columnType('last_ip', 'crypted');
     $table->columnType('token', 'crypted');
     return $table;
 }
开发者ID:ThreeCMS,项目名称:ThreeCMS,代码行数:8,代码来源:UsersTable.php

示例5: _initializeSchema

 /**
  * 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;
 }
开发者ID:Xety,项目名称:Xeta,代码行数:15,代码来源:UsersTwoFactorAuthTable.php

示例6: _initializeSchema

 /**
  * @param \Cake\Database\Schema\Table $table
  *
  * @return \Cake\Database\Schema\Table
  */
 protected function _initializeSchema(Schema $table)
 {
     $table->columnType('image', 'image');
     return $table;
 }
开发者ID:dereuromark,项目名称:cakephp-captcha,代码行数:10,代码来源:CaptchasTable.php

示例7: _getRecords

 /**
  * 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];
 }
开发者ID:scherersoftware,项目名称:cakephp-schema,代码行数:25,代码来源:SeedImportTask.php

示例8: _initializeSchema

 /**
  * Initialize Schema
  *
  * @param Schema $schema
  * @return Schema
  */
 protected function _initializeSchema(Schema $schema)
 {
     $schema->columnType('data', 'json');
     $schema->columnType('stats', 'json');
     return $schema;
 }
开发者ID:codeblastr,项目名称:queue,代码行数:12,代码来源:QueuesTable.php

示例9: _initializeSchema

 /**
  * _initializeSchema
  */
 protected function _initializeSchema(\Cake\Database\Schema\Table $table)
 {
     $table->columnType('image', 'proffer.file');
     return $table;
 }
开发者ID:nadymain,项目名称:quebolu,代码行数:8,代码来源:UploadsTable.php

示例10: _initializeSchema

 protected function _initializeSchema(Schema $table)
 {
     $table->columnType('ip', 'ip');
     return parent::_initializeSchema($table);
 }
开发者ID:TheFRedFox,项目名称:cakephp-ip-type,代码行数:5,代码来源:IpsTable.php

示例11: _initializeSchema

 protected function _initializeSchema(Schema $schema)
 {
     $schema->columnType('context', 'loggingJson');
     return $schema;
 }
开发者ID:daoandco,项目名称:cakephp-logging,代码行数:5,代码来源:LogsTable.php

示例12: column

 /**
  * 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)];
 }
开发者ID:josegonzalez,项目名称:migrations,代码行数:11,代码来源:MigrationHelper.php

示例13: _initializeSchema

 /**
  * 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;
 }
开发者ID:cwbit,项目名称:cakephp-emailqueue,代码行数:22,代码来源:EmailTemplatesTable.php

示例14: testBaseColumnTypeInherited

 /**
  * 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'));
 }
开发者ID:Slayug,项目名称:castor,代码行数:13,代码来源:TableTest.php

示例15: _initializeSchema

 /**
  * @param \Cake\Database\Schema\Table $schema
  * @return \Cake\Database\Schema\Table
  */
 protected function _initializeSchema(Schema $schema)
 {
     $schema->columnType('foreign_data', 'json');
     return $schema;
 }
开发者ID:UseMuffin,项目名称:Tokenize,代码行数:9,代码来源:TokensTable.php


注:本文中的Cake\Database\Schema\Table::columnType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。