示例#1
0
 public function __construct()
 {
     $this->id = KeyGenerator::generate(8);
     $this->ownerId = $this->id . KeyGenerator::generate(4);
     $this->createdAt = new \DateTime();
 }
示例#2
0
 /**
  * Generate a new ID - don't use once the player is saved
  *
  * @return null
  **/
 protected function generateId()
 {
     if (null !== $this->id) {
         throw new \LogicException('Can not change the id of a saved player');
     }
     $this->id = KeyGenerator::generate(4);
 }