Skip to content

Instantly share code, notes, and snippets.

@mikemix
Created November 11, 2022 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikemix/4ce0dd29a7d66dc0b04df2db84b7cdf5 to your computer and use it in GitHub Desktop.
Save mikemix/4ce0dd29a7d66dc0b04df2db84b7cdf5 to your computer and use it in GitHub Desktop.
<?php
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Cache(usage="READ_ONLY", region="append_only")
*/
class User
{
// …
/**
* @ORM\OneToMany(targetEntity=Post::class, mappedBy="author")
* @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="write_rare")
*/
private Collection $posts;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment