コード例 #1
0
 /**
  * @see EntityStore::assignFreshId()
  *
  * @param EntityDocument $entity
  *
  * @throws StorageException
  */
 public function assignFreshId(EntityDocument $entity)
 {
     if ($entity->getId() !== null) {
         throw new StorageException('This entity already has an ID!');
     }
     $contentModelId = $this->contentFactory->getContentModelForType($entity->getType());
     $numericId = $this->idGenerator->getNewId($contentModelId);
     //FIXME: this relies on setId() accepting numeric IDs!
     $entity->setId($numericId);
 }