src/Document.php
public function setEntities(array $entities)
    {
        foreach ($entities as $key => $entity) {
            if (!($entity instanceof Entity)) {
                $exMsg = sprintf(
                    'Array key `%s` is not an instance of Entity',
                    $key
                );
                throw new LogicException($exMsg);
            }
        }

        $this->entities = $entities;

        return $this;
    }
public function setEntities(array $entities)
    {
        foreach ($entities as $key => $entity) {
            if (!($entity instanceof Entity)) {
                $exMsg = sprintf(
                    'Array key `%s` is not an instance of Entity',
                    $key
                );
                throw new LogicException($exMsg);
            }
        }

        $this->entities = $entities;

        return $this;
    }
Set entities

@param Entity[] $entities
@return $this