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


PHP Schema::get方法代码示例

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


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

示例1: __construct

 public function __construct(array $fields, $subs = null, $callback = null)
 {
     $this->fields = $fields;
     $this->subs = $subs;
     $this->callback = $callback;
     $this->schema = Schema::get($this->className());
 }
开发者ID:netixx,项目名称:frankiz,代码行数:7,代码来源:select.php

示例2: onCheckSchema

 function onCheckSchema()
 {
     $schema = Schema::get();
     $schema->ensureTable('grades', Grades::schemaDef());
     $schema->ensureTable('grades_group', Gradesgroup::schemaDef());
     return true;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:7,代码来源:GradesPlugin.php

示例3: onCheckSchema

 /**
  * Database schema setup
  *
  * @see Schema
  * @see ColumnDef
  *
  * @return boolean hook value; true means continue processing, false means stop.
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     // For storing user-submitted flags on profiles
     $schema->ensureTable('bookmark', array(new ColumnDef('id', 'char', 36, false, 'PRI'), new ColumnDef('profile_id', 'integer', null, false, 'MUL'), new ColumnDef('url', 'varchar', 255, false, 'MUL'), new ColumnDef('title', 'varchar', 255), new ColumnDef('description', 'text'), new ColumnDef('uri', 'varchar', 255, false, 'UNI'), new ColumnDef('created', 'datetime', null, false, 'MUL')));
     return true;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:15,代码来源:BookmarkPlugin.php

示例4: onCheckSchema

 /**
  * Hook for ensuring our tables are created
  *
  * Ensures the fave_tally table is there and has the right columns
  *
  * @return boolean hook return
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     // For storing total number of times a notice has been faved
     $schema->ensureTable('fave_tally', Fave_tally::schemaDef());
     return true;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:14,代码来源:AnonymousFavePlugin.php

示例5: onCheckSchema

 /**
  * Database schema setup
  *
  * @see Schema
  * @see ColumnDef
  *
  * @return boolean hook value; true means continue processing, false means stop.
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     $schema->ensureTable('spam_score', Spam_score::schemaDef());
     Spam_score::upgrade();
     return true;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:15,代码来源:ActivitySpamPlugin.php

示例6: onCheckSchema

 function onCheckSchema()
 {
     $schema = Schema::get();
     $schema->ensureTable('task', Task::schemaDef());
     $schema->ensureTable('task_grader', Task_Grader::schemaDef());
     return true;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:7,代码来源:TaskPlugin.php

示例7: beforeSchemaUpdate

 public static function beforeSchemaUpdate()
 {
     $table = strtolower(get_called_class());
     $schema = Schema::get();
     $schemadef = $schema->getTableDef($table);
     // 2015-12-31 RSVPs refer to Happening by event_uri now, not event_id. Let's migrate!
     if (isset($schemadef['fields']['event_uri'])) {
         // We seem to have already migrated, good!
         return;
     }
     // this is a "normal" upgrade from StatusNet for example
     echo "\nFound old {$table} table, upgrading it to add 'event_uri' field...";
     $schemadef['fields']['event_uri'] = array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'Event URI');
     $schema->ensureTable($table, $schemadef);
     $rsvp = new RSVP();
     $rsvp->find();
     while ($rsvp->fetch()) {
         $event = Happening::getKV('id', $rsvp->event_id);
         if (!$event instanceof Happening) {
             $rsvp->delete();
             continue;
         }
         $orig = clone $rsvp;
         $rsvp->event_uri = $event->uri;
         $rsvp->updateWithKeys($orig);
     }
     print "DONE.\n";
     print "Resuming core schema upgrade...";
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:29,代码来源:RSVP.php

示例8: onCheckSchema

 /**
  * Database schema setup
  *
  * We store user registrations in a table registration_ip.
  *
  * @return boolean hook value; true means continue processing, false means stop.
  */
 public function onCheckSchema()
 {
     $schema = Schema::get();
     // For storing user-submitted flags on profiles
     $schema->ensureTable('registration_ip', Registration_ip::schemaDef());
     return true;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:14,代码来源:RegisterThrottlePlugin.php

示例9: onCheckSchema

 /**
  * Set up our tables (event and rsvp)
  *
  * @see Schema
  * @see ColumnDef
  *
  * @return boolean hook value; true means continue processing, false means stop.
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     $schema->ensureTable('happening', Happening::schemaDef());
     $schema->ensureTable('rsvp', RSVP::schemaDef());
     return true;
 }
开发者ID:phpsource,项目名称:gnu-social,代码行数:15,代码来源:EventPlugin.php

示例10: onCheckSchema

 /**
  * Hook for ensuring our tables are created
  *
  * Ensures that the user_flag_profile table exists
  * and has the right columns.
  *
  * @return boolean hook return
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     // For storing user-submitted flags on profiles
     $schema->ensureTable('user_flag_profile', array(new ColumnDef('profile_id', 'integer', null, false, 'PRI'), new ColumnDef('user_id', 'integer', null, false, 'PRI'), new ColumnDef('created', 'datetime', null, false, 'MUL'), new ColumnDef('cleared', 'datetime', null, true, 'MUL')));
     return true;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:15,代码来源:UserFlagPlugin.php

示例11: onCheckSchema

 /**
  * Database schema setup
  *
  * @return boolean hook value
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     // For storing user-submitted flags on profiles
     $schema->ensureTable('email_summary_status', Email_summary_status::schemaDef());
     return true;
 }
开发者ID:bashrc,项目名称:gnusocial-debian,代码行数:12,代码来源:EmailSummaryPlugin.php

示例12: onCheckSchema

 /**
  * Hook for ensuring our tables are created
  *
  * Ensures the fave_tally table is there and has the right columns
  *
  * @return boolean hook return
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     // For storing total number of times a notice has been faved
     $schema->ensureTable('fave_tally', array(new ColumnDef('notice_id', 'integer', null, false, 'PRI'), new ColumnDef('count', 'integer', null, false), new ColumnDef('modified', 'timestamp', null, false, null, 'CURRENT_TIMESTAMP', 'on update CURRENT_TIMESTAMP')));
     return true;
 }
开发者ID:Grasia,项目名称:bolotweet,代码行数:14,代码来源:AnonymousFavePlugin.php

示例13: onCheckSchema

 /**
  * Database schema setup
  *
  * @return boolean hook value
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     // For storing user-submitted flags on profiles
     $schema->ensureTable('email_summary_status', array(new ColumnDef('user_id', 'integer', null, false, 'PRI'), new ColumnDef('send_summary', 'tinyint', null, false, null, 1), new ColumnDef('last_summary_id', 'integer', null, true), new ColumnDef('created', 'datetime', null, false), new ColumnDef('modified', 'datetime', null, false)));
     return true;
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:12,代码来源:EmailSummaryPlugin.php

示例14: onCheckSchema

 /**
  * Database schema setup
  *
  * @see Schema
  * @see ColumnDef
  *
  * @return boolean hook value; true means continue processing, false means stop.
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     $schema->ensureTable('poll', Poll::schemaDef());
     $schema->ensureTable('poll_response', Poll_response::schemaDef());
     return true;
 }
开发者ID:jianoll,项目名称:SpeakEnglish_Server,代码行数:15,代码来源:PollPlugin.php

示例15: onCheckSchema

 /**
  * Database schema setup
  *
  * We store user registrations in a table registration_ip.
  *
  * @return boolean hook value; true means continue processing, false means stop.
  */
 function onCheckSchema()
 {
     $schema = Schema::get();
     // For storing user-submitted flags on profiles
     $schema->ensureTable('registration_ip', array(new ColumnDef('user_id', 'integer', null, false, 'PRI'), new ColumnDef('ipaddress', 'varchar', 15, false, 'MUL'), new ColumnDef('created', 'timestamp', null, false, 'MUL')));
     return true;
 }
开发者ID:microcosmx,项目名称:experiments,代码行数:14,代码来源:RegisterThrottlePlugin.php


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