private function getMapSecurityIdentities(array $sids)
    {
        $connection = $this->entityManager->getConnection();
        $mapSids = [];

        foreach ($sids as $sid) {
            $type = $this->sharingManager->getIdentityConfig($sid->getType())->getType();
            $mapSids[$type][] = $connection->quote($sid->getIdentifier());
        }

        foreach ($mapSids as $type => $ids) {
            $mapSids[$type] = implode(', ', $ids);
        }

        return $mapSids;
    }