Skip to content

Instantly share code, notes, and snippets.

@tyx
Last active December 30, 2015 18:48
Show Gist options
  • Save tyx/1f817bbf99163c5920ce to your computer and use it in GitHub Desktop.
Save tyx/1f817bbf99163c5920ce to your computer and use it in GitHub Desktop.
<?php
class GameController extends Controller
{
public function showAction($id)
{
$game = $this
->get('doctrine')
->getRepository('Afsy\Bundle\BlackjackBundle\Entity\Game')
->find(Uuid::fromString($id))
;
// I got : Warning: Illegal offset type in /Users/Tim/www/cqrs-afsy/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 2480
$game = $this
->get('doctrine')
->getRepository('Afsy\Bundle\BlackjackBundle\Entity\Game')
->find((string) $id))
;
// I got : ConversionException: Could not convert database value "6742563c-601f-11e3-a..." to Doctrine Type uuid
}
}
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity repository-class="Afsy\Bundle\BlackjackBundle\Entity\GameRepository" name="Afsy\Bundle\BlackjackBundle\Entity\Game" table="game">
<id name="id" type="uuid" length="36" column="uuid" />
<field name="playerCards" type="array" column="player_cards" />
<field name="bankCards" type="array" column="bank_cards" />
</entity>
</doctrine-mapping>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment