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


PHP DB::require_field方法代码示例

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


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

示例1: requireField

 /**
  * (non-PHPdoc)
  * @see DBField::requireField()
  */
 public function requireField()
 {
     $charset = Config::inst()->get('SilverStripe\\ORM\\Connect\\MySQLDatabase', 'charset');
     $collation = Config::inst()->get('SilverStripe\\ORM\\Connect\\MySQLDatabase', 'collation');
     $parts = ['datatype' => 'mediumtext', 'character set' => $charset, 'collate' => $collation, 'default' => $this->defaultVal, 'arrayValue' => $this->arrayValue];
     $values = ['type' => 'text', 'parts' => $parts];
     DB::require_field($this->tableName, $this->name, $values);
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:12,代码来源:DBText.php

示例2: requireField

 /**
  * (non-PHPdoc)
  * @see DBField::requireField()
  */
 public function requireField()
 {
     $charset = Config::inst()->get('SilverStripe\\ORM\\Connect\\MySQLDatabase', 'charset');
     $collation = Config::inst()->get('SilverStripe\\ORM\\Connect\\MySQLDatabase', 'collation');
     $parts = array('datatype' => 'varchar', 'precision' => $this->size, 'character set' => $charset, 'collate' => $collation, 'arrayValue' => $this->arrayValue);
     $values = array('type' => 'varchar', 'parts' => $parts);
     DB::require_field($this->tableName, $this->name, $values);
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:12,代码来源:DBVarchar.php

示例3: requireField

 public function requireField()
 {
     // @todo: Remove mysql-centric logic from this
     $charset = Config::inst()->get('SilverStripe\\ORM\\Connect\\MySQLDatabase', 'charset');
     $collation = Config::inst()->get('SilverStripe\\ORM\\Connect\\MySQLDatabase', 'collation');
     $values = array('type' => 'set', 'parts' => array('enums' => $this->enum, 'character set' => $charset, 'collate' => $collation, 'default' => $this->default, 'table' => $this->tableName, 'arrayValue' => $this->arrayValue));
     DB::require_field($this->tableName, $this->name, $values);
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:8,代码来源:DBMultiEnum.php

示例4: requireField

 public function requireField()
 {
     // HACK: MSSQL does not support double so we're using float instead
     // @todo This should go into MSSQLDatabase ideally somehow
     if (DB::get_conn() instanceof MySQLDatabase) {
         DB::require_field($this->tableName, $this->name, "double");
     } else {
         DB::require_field($this->tableName, $this->name, "float");
     }
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:10,代码来源:DBDouble.php

示例5: requireField

 public function requireField()
 {
     $parts = array('datatype' => 'float', 'null' => 'not null', 'default' => $this->defaultVal, 'arrayValue' => $this->arrayValue);
     $values = array('type' => 'float', 'parts' => $parts);
     DB::require_field($this->tableName, $this->name, $values);
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:6,代码来源:DBFloat.php

示例6: requireField

 /**
  * @return void
  */
 public function requireField()
 {
     $parts = array('datatype' => 'enum', 'enums' => $this->getEnumObsolete(), 'character set' => 'utf8', 'collate' => 'utf8_general_ci', 'default' => $this->getDefault(), 'table' => $this->getTable(), 'arrayValue' => $this->arrayValue);
     $values = array('type' => 'enum', 'parts' => $parts);
     DB::require_field($this->getTable(), $this->getName(), $values);
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:9,代码来源:DBClassName.php

示例7: requireField

 public function requireField()
 {
     $parts = array('datatype' => 'time', 'arrayValue' => $this->arrayValue);
     $values = array('type' => 'time', 'parts' => $parts);
     DB::require_field($this->tableName, $this->name, $values);
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:6,代码来源:DBTime.php

示例8: requireField

 public function requireField()
 {
     $parts = array('datatype' => 'tinyint', 'precision' => 1, 'sign' => 'unsigned', 'null' => 'not null', 'default' => $this->defaultVal, 'arrayValue' => $this->arrayValue);
     $values = array('type' => 'boolean', 'parts' => $parts);
     DB::require_field($this->tableName, $this->name, $values);
 }
开发者ID:jacobbuck,项目名称:silverstripe-framework,代码行数:6,代码来源:DBBoolean.php

示例9: requireField

 public function requireField()
 {
     $parts = ['datatype' => 'int', 'precision' => 11, 'null' => 'not null', 'default' => $this->defaultVal, 'arrayValue' => $this->arrayValue];
     $values = ['type' => 'int', 'parts' => $parts];
     DB::require_field($this->tableName, $this->name, $values);
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:6,代码来源:DBInt.php

示例10: requireField

 public function requireField()
 {
     $parts = array('datatype' => 'decimal', 'precision' => "{$this->wholeSize},{$this->decimalSize}", 'default' => $this->defaultValue, 'arrayValue' => $this->arrayValue);
     $values = array('type' => 'decimal', 'parts' => $parts);
     DB::require_field($this->tableName, $this->name, $values);
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:6,代码来源:DBDecimal.php

示例11: requireField

 public function requireField()
 {
     $spec = DB::get_schema()->IdColumn(false, $this->getAutoIncrement());
     DB::require_field($this->getTable(), $this->getName(), $spec);
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:5,代码来源:DBPrimaryKey.php

示例12: requireField

 public function requireField()
 {
     foreach ($this->compositeDatabaseFields() as $field => $spec) {
         $key = $this->getName() . $field;
         DB::require_field($this->tableName, $key, $spec);
     }
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:7,代码来源:DBComposite.php


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