Datastore/src/Transaction.php
public function insertBatch(array $entities)
    {
        $entities = $this->operation->allocateIdsToEntities($entities);
        foreach ($entities as $entity) {
            $this->mutations[] = $this->operation->mutation('insert', $entity, Entity::class);
        }

        return $this;
    }
public function insertBatch(array $entities)
    {
        $entities = $this->operation->allocateIdsToEntities($entities);
        foreach ($entities as $entity) {
            $this->mutations[] = $this->operation->mutation('insert', $entity, Entity::class);
        }

        return $this;
    }
public function insertBatch ( array $ entities ) { $ entities = $ this -> operation -> allocateIdsToEntities ( $ entities ) ; foreach ( $ entities as $ entity ) { $ this -> mutations [ ] = $ this -> operation -> mutation ( 'insert' , $ entity , Entity :: class ) ; } return $ this ; }
Insert multiple entities.

Changes are not immediately committed to Cloud Datastore when calling
this method. Use {@see Google\Cloud\Datastore\Transaction::commit()} to
commit changes and end the transaction.

If entities with incomplete keys are provided, this method will immediately
trigger a service call to allocate IDs to the entities.

Example:
```
$entities = [
$datastore->entity('Person', ['firstName' => 'Bob']),
$datastore->entity('Person', ['firstName' => 'John'])
];

$transaction->insertBatch($entities);
$transaction->commit();
```

@param EntityInterface[] $entities The entities to insert.
@return Transaction
Insert multiple entities .