Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Preparing for Doctrine 3

Preparing for Doctrine 3

Doctrine ORM is probably the most used database abstraction in PHP. With Doctrine 3 on the horizon it's a perfect time to look at how Doctrine has changed and will change and what this means for you as users. This talk looks at some of the already merged features for Doctrine 3 that could have an impact on your code and why the might prevent you from upgrading. I will show approaches for tackling these changes and how your projects might benefit from introducing them already.

Denis Brumann

November 12, 2020
Tweet

More Decks by Denis Brumann

Other Decks in Programming

Transcript

  1. /** @ORM\Entity */ class Customer { /** * @ORM\Id *

    @ORM\Column(type="guid") * @ORM\GeneratedValue(strategy="UUID") */ private $id; … @dbrumann [email protected] 11
  2. /** @ORM\Entity */ class Customer { /** * @ORM\Id *

    @ORM\Column(type="guid") * @ORM\GeneratedValue(strategy="UUID") */ private $id; … @dbrumann [email protected] 12
  3. /** @ORM\Entity */ class Customer { /** * @ORM\Id *

    @ORM\Column(type="uuid") * @ORM\GeneratedValue(strategy="NONE") */ private $id; public function __construct() { $this->id = Uuid::uuid4(); } public function getId(): string { return (string) $this->id; } @dbrumann [email protected] 14
  4. 16

  5. /** @ORM\Entity */ class Customer { /** * @ORM\Id *

    @ORM\Column(name="number", type=“integer") */ private $number; … @dbrumann [email protected] 28
  6. /** @ORM\Entity */ class Customer { /** * @ORM\Id *

    @ORM\Column(name="number", type=“integer") */ private $number; … @dbrumann [email protected] 29
  7. @dbrumann [email protected] 52 RECAP MAPPING UUID GENERATOR NAMED QUERIES NAMESPACE

    ALIASES CLASS METADATA ENTITY MANAGER SECOND LEVEL CACHE