當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。