Skip to content

Commit

Permalink
Merge pull request #802 from develth/master
Browse files Browse the repository at this point in the history
Added mapping for guid type
  • Loading branch information
goetas authored Aug 25, 2017
2 parents fe455ee + 633803a commit ef6000e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ abstract class AbstractDoctrineTypeDriver implements DriverInterface
'string' => 'string',
'text' => 'string',
'blob' => 'string',
'guid' => 'string',

'integer' => 'integer',
'smallint' => 'integer',
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Doctrine/BlogPost.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class BlogPost
{
/**
* @ORM\Id @ORM\Column(type="integer")
* @ORM\Id @ORM\Column(type="guid") @ORM\GeneratedValue(strategy="UUID")
*/
protected $id;

Expand Down
10 changes: 10 additions & 0 deletions tests/Metadata/Driver/DoctrineDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ public function testVirtualPropertiesAreNotModified()
$this->assertNull($doctrineMetadata->propertyMetadata['ref']->type);
}

public function testGuidPropertyIsGivenStringType()
{
$metadata = $this->getMetadata();

$this->assertEquals(
array('name' => 'string', 'params' => array()),
$metadata->propertyMetadata['id']->type
);
}

protected function getEntityManager()
{
$config = new Configuration();
Expand Down

0 comments on commit ef6000e

Please sign in to comment.