public function findAllAddresses(Map $map, $pid)
    {
        $query = $this->createQuery();
        $query->getQuerySettings()->setRespectStoragePage(false);
        $query->getQuerySettings()->setRespectSysLanguage(false);

        $or = [];
        $and = [];

        foreach (explode(',', $pid) as $p) {
            $or[] = $query->equals('pid', $p);
        }
        if ($map) {
            $or[] = $query->contains('map', $map);
        }
        $and[] = $query->logicalOr($or);

        return $query->matching(
            $query->logicalAnd(
                $and
            )
        )
            ->execute();
    }