Classes/Domain/Repository/AddressRepository.php
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();
    }
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();
    }
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 ( ) ; }
Finds all addresses by the specified map or the storage pid

@param \Clickstorm\GoMapsExt\Domain\Model\Map $map The map
@param int $pid The Storage Pid
@return \TYPO3\CMS\Extbase\Persistence\QueryResultInterface The addresses
@throws \TYPO3\CMS\Extbase\Persistence\Exception\InvalidQueryException
Finds all addresses by the specified map or the storage pid