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


PHP Column::getUnsigned方法代码示例

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


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

示例1: diffColumn

 /**
  * Returns the difference between the fields $field1 and $field2.
  *
  * If there are differences this method returns $field2, otherwise the
  * boolean false.
  *
  * @param Column $column1
  * @param Column $column2
  *
  * @return array
  */
 public function diffColumn(Column $column1, Column $column2)
 {
     $changedProperties = array();
     if ($column1->getType() != $column2->getType()) {
         $changedProperties[] = 'type';
     }
     if ($column1->getNotnull() != $column2->getNotnull()) {
         $changedProperties[] = 'notnull';
     }
     if ($column1->getDefault() != $column2->getDefault()) {
         $changedProperties[] = 'default';
     }
     if ($column1->getUnsigned() != $column2->getUnsigned()) {
         $changedProperties[] = 'unsigned';
     }
     if ($column1->getType() instanceof \Doctrine\DBAL\Types\StringType) {
         // check if value of length is set at all, default value assumed otherwise.
         $length1 = $column1->getLength() ?: 255;
         $length2 = $column2->getLength() ?: 255;
         if ($length1 != $length2) {
             $changedProperties[] = 'length';
         }
         if ($column1->getFixed() != $column2->getFixed()) {
             $changedProperties[] = 'fixed';
         }
     }
     if ($column1->getType() instanceof \Doctrine\DBAL\Types\DecimalType) {
         if (($column1->getPrecision() ?: 10) != ($column2->getPrecision() ?: 10)) {
             $changedProperties[] = 'precision';
         }
         if ($column1->getScale() != $column2->getScale()) {
             $changedProperties[] = 'scale';
         }
     }
     if ($column1->getAutoincrement() != $column2->getAutoincrement()) {
         $changedProperties[] = 'autoincrement';
     }
     // only allow to delete comment if its set to '' not to null.
     if ($column1->getComment() !== null && $column1->getComment() != $column2->getComment()) {
         $changedProperties[] = 'comment';
     }
     $options1 = $column1->getCustomSchemaOptions();
     $options2 = $column2->getCustomSchemaOptions();
     $commonKeys = array_keys(array_intersect_key($options1, $options2));
     foreach ($commonKeys as $key) {
         if ($options1[$key] !== $options2[$key]) {
             $changedProperties[] = $key;
         }
     }
     $diffKeys = array_keys(array_diff_key($options1, $options2) + array_diff_key($options2, $options1));
     $changedProperties = array_merge($changedProperties, $diffKeys);
     return $changedProperties;
 }
开发者ID:ashimidashajia,项目名称:zendstore,代码行数:64,代码来源:Comparator.php

示例2: diffColumn

 /**
  * Returns the difference between the fields $field1 and $field2.
  *
  * If there are differences this method returns $field2, otherwise the
  * boolean false.
  *
  * @param Column $column1
  * @param Column $column2
  *
  * @return array
  */
 public function diffColumn(Column $column1, Column $column2)
 {
     $changedProperties = array();
     if ($column1->getType() != $column2->getType()) {
         $changedProperties[] = 'type';
     }
     if ($column1->getNotnull() != $column2->getNotnull()) {
         $changedProperties[] = 'notnull';
     }
     if ($column1->getDefault() != $column2->getDefault()) {
         $changedProperties[] = 'default';
     }
     if ($column1->getUnsigned() != $column2->getUnsigned()) {
         $changedProperties[] = 'unsigned';
     }
     if ($column1->getType() instanceof \Doctrine\DBAL\Types\StringType) {
         if ($column1->getLength() != $column2->getLength()) {
             $changedProperties[] = 'length';
         }
         if ($column1->getFixed() != $column2->getFixed()) {
             $changedProperties[] = 'fixed';
         }
     }
     if ($column1->getType() instanceof \Doctrine\DBAL\Types\DecimalType) {
         if ($column1->getPrecision() != $column2->getPrecision()) {
             $changedProperties[] = 'precision';
         }
         if ($column1->getScale() != $column2->getScale()) {
             $changedProperties[] = 'scale';
         }
     }
     if ($column1->getAutoincrement() != $column2->getAutoincrement()) {
         $changedProperties[] = 'autoincrement';
     }
     return $changedProperties;
 }
开发者ID:skoop,项目名称:symfony-sandbox,代码行数:47,代码来源:Comparator.php

示例3: diffColumn

 /**
  * Returns the difference between the fields $field1 and $field2.
  *
  * If there are differences this method returns $field2, otherwise the
  * boolean false.
  *
  * @param Column $column1
  * @param Column $column2
  *
  * @return array
  */
 public function diffColumn(Column $column1, Column $column2)
 {
     $changedProperties = array();
     if ($column1->getType() != $column2->getType()) {
         $changedProperties[] = 'type';
     }
     if ($column1->getNotnull() != $column2->getNotnull()) {
         $changedProperties[] = 'notnull';
     }
     if ($column1->getDefault() != $column2->getDefault()) {
         $changedProperties[] = 'default';
     }
     if ($column1->getUnsigned() != $column2->getUnsigned()) {
         $changedProperties[] = 'unsigned';
     }
     if ($column1->getType() instanceof \Doctrine\DBAL\Types\StringType) {
         if ($column1->getLength() != $column2->getLength()) {
             $changedProperties[] = 'length';
         }
         if ($column1->getFixed() != $column2->getFixed()) {
             $changedProperties[] = 'fixed';
         }
     }
     if ($column1->getType() instanceof \Doctrine\DBAL\Types\DecimalType) {
         if ($column1->getPrecision() != $column2->getPrecision()) {
             $changedProperties[] = 'precision';
         }
         if ($column1->getScale() != $column2->getScale()) {
             $changedProperties[] = 'scale';
         }
     }
     foreach ($this->_checkColumnPlatformOptions as $optionName) {
         if ($column1->hasPlatformOption($optionName) && $column2->hasPlatformOption($optionName)) {
             if ($column1->getPlatformOption($optionName) != $column2->getPlatformOption($optionName)) {
                 $changedProperties[] = $optionName;
             }
         } else {
             if ($column1->hasPlatformOption($optionName) != $column2->hasPlatformOption($optionName)) {
                 $changedProperties[] = $optionName;
             }
         }
     }
     return $changedProperties;
 }
开发者ID:jacques-sounvi,项目名称:addressbook,代码行数:55,代码来源:Comparator.php


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