daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Jun 24th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** @ODMDocument */
  2. class Stat
  3. {
  4.     /** @ODMId(strategy="NONE", type="int") */
  5.     private $id;
  6.  
  7.     /** @ODMField(type="string") */
  8.     private $period;
  9.  
  10.     /** @ODMReferenceOne(targetDocument="Player") */
  11.     private $player;
  12.  
  13.     /** @ODMField(type="string") @ODMIndex */
  14.     private $statType;
  15.    
  16. $stat = new DocumentsStat();
  17.  
  18. $stat->setId(1);
  19. $stat->setPlayer($player);
  20. $stat->setPeriod(1);
  21. $stat->setStatType('goal');
  22.  
  23. $dm->persist($stat);
  24. $dm->flush();
  25.    
  26. /**
  27.  * @ODMDocument
  28.  * @ODMIndexes({
  29.  *   @ODMIndex(keys={"statType"="asc"}),
  30.  *   @ODMUniqueIndex(keys={"period"="asc"})//For example unique index
  31.  * })
  32.  */
  33. class Stat
  34. {
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top