unsigned is in fieldMapping['options']
This commit is contained in:
parent
9715f3dfcc
commit
4a39754e76
@ -1652,7 +1652,7 @@ public function __construct(<params>)
|
||||
|
||||
$options = [];
|
||||
|
||||
if (isset($fieldMapping['unsigned']) && $fieldMapping['unsigned']) {
|
||||
if (isset($fieldMapping['options']['unsigned']) && $fieldMapping['options']['unsigned']) {
|
||||
$options[] = '"unsigned"=true';
|
||||
}
|
||||
|
||||
|
@ -206,6 +206,8 @@ abstract class AbstractClassMetadataExporterTest extends \Doctrine\Tests\OrmTest
|
||||
$this->assertEquals('user_email', $class->fieldMappings['email']['columnName']);
|
||||
$this->assertEquals('CHAR(32) NOT NULL', $class->fieldMappings['email']['columnDefinition']);
|
||||
|
||||
$this->assertEquals(true, $class->fieldMappings['age']['options']['unsigned']);
|
||||
|
||||
return $class;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,11 @@ class User
|
||||
*/
|
||||
public $email;
|
||||
|
||||
/**
|
||||
* @Column(type="integer", options={"unsigned"=true})
|
||||
*/
|
||||
public $age;
|
||||
|
||||
/**
|
||||
* @OneToOne(targetEntity="Doctrine\Tests\ORM\Tools\Export\Address", inversedBy="user", cascade={"persist"}, orphanRemoval=true, fetch="EAGER")
|
||||
* @JoinColumn(name="address_id", onDelete="CASCADE")
|
||||
@ -49,7 +54,6 @@ class User
|
||||
*/
|
||||
public $groups;
|
||||
|
||||
|
||||
/**
|
||||
* @PrePersist
|
||||
*/
|
||||
|
@ -31,6 +31,11 @@ $metadata->mapField(array(
|
||||
'columnName' => 'user_email',
|
||||
'columnDefinition' => 'CHAR(32) NOT NULL',
|
||||
));
|
||||
$metadata->mapField(array(
|
||||
'fieldName' => 'age',
|
||||
'type' => 'integer',
|
||||
'options' => array("unsigned"=>true),
|
||||
));
|
||||
$metadata->setIdGeneratorType(ClassMetadataInfo::GENERATOR_TYPE_AUTO);
|
||||
$metadata->mapManyToOne(array(
|
||||
'fieldName' => 'mainGroup',
|
||||
|
@ -24,6 +24,11 @@
|
||||
|
||||
<field name="name" column="name" type="string" length="50" nullable="true" unique="true" />
|
||||
<field name="email" column="user_email" type="string" column-definition="CHAR(32) NOT NULL" />
|
||||
<field name="age" type="integer">
|
||||
<options>
|
||||
<option name="unsigned">1</option>
|
||||
</options>
|
||||
</field>
|
||||
|
||||
<one-to-one field="address" target-entity="Doctrine\Tests\ORM\Tools\Export\Address" inversed-by="user" orphan-removal="true" fetch="EAGER">
|
||||
<cascade><cascade-persist /></cascade>
|
||||
|
@ -19,6 +19,10 @@ Doctrine\Tests\ORM\Tools\Export\User:
|
||||
type: string
|
||||
column: user_email
|
||||
columnDefinition: CHAR(32) NOT NULL
|
||||
age:
|
||||
type: integer
|
||||
options:
|
||||
unsigned: true
|
||||
oneToOne:
|
||||
address:
|
||||
targetEntity: Doctrine\Tests\ORM\Tools\Export\Address
|
||||
|
Loading…
x
Reference in New Issue
Block a user