private function processRelationQueue(Bag $relationQueue)
    {
        foreach ($relationQueue as $source => $links) {
            $entity = $this->query->getContent($source);
            $relations = [];
            foreach ($links as $linkKey) {
                $relation = $this->query->getContent($linkKey);
                $relatedKey = (string) $relation->getContentType();

                $relations[$relatedKey][] = $relation->getId();
            }
            /** @var Collection\Relations $related */
            $related = $this->em->createCollection(Entity\Relations::class);
            $related->setFromPost(['relation' => $relations], $entity);
            $entity->setRelation($related);
            $this->em->save($entity);
        }
    }