private function getRecordListParams()
    {
        $metadataPrefix = null;
        $from = null;
        $until = null;
        $fromGranularity = null;
        $untilGranularity  = null;
        $set = isset($this->params['set']) ? $this->params['set'] : null;


        $checks = [
            function () use (&$from, &$fromGranularity) {
                if (isset($this->params['from'])) {
                    list($from, $fromGranularity)  = $this->parseRequestDate($this->params['from']);
                }
            },
            function () use (&$until, &$untilGranularity) {
                if (isset($this->params['until'])) {
                    list($until, $untilGranularity) = $this->parseRequestDate($this->params['until']);
                }
            },
            function () use (&$from, &$until) {
                if ($from !== null and $until !== null && $from > $until) {
                    throw new BadArgumentException(
                        'The `from` argument must be less than or equal to the `until` argument'
                    );
                }
            },
            function () use (&$from, &$until, &$fromGranularity, &$untilGranularity) {
                if ($from !== null and $until !== null && $fromGranularity !== $untilGranularity) {
                    throw new BadArgumentException('The `from` and `until` arguments have different granularity');
                }
            },
            function () use (&$fromGranularity) {
                if ($fromGranularity !== null &&
                    $fromGranularity === Identity::GRANULARITY_YYYY_MM_DDTHH_MM_SSZ &&
                    $this->repository->getGranularity() === Identity::GRANULARITY_YYYY_MM_DD) {
                    throw new BadArgumentException(
                        'The granularity of the `from` argument is not supported by this repository'
                    );
                }
            },
            function () use (&$untilGranularity) {
                if ($untilGranularity !== null &&
                    $untilGranularity === Identity::GRANULARITY_YYYY_MM_DDTHH_MM_SSZ &&
                    $this->repository->getGranularity() === Identity::GRANULARITY_YYYY_MM_DD) {
                    throw new BadArgumentException(
                        'The granularity of the `until` argument is not supported by this repository'
                    );
                }
            },
            function () use (&$metadataPrefix) {
                if (!isset($this->params['metadataPrefix'])) {
                    throw new BadArgumentException("Missing required argument metadataPrefix");
                }
                $metadataPrefix = $this->params['metadataPrefix'];
                if (is_array($metadataPrefix)) {
                    throw new BadArgumentException("Only one metadataPrefix allowed");
                }
                $this->checkMetadataPrefix($metadataPrefix);
            }
        ];

        $this->doChecks($checks);
        return [$metadataPrefix, $from, $until, $set];
    }
private function getRecordListParams()
    {
        $metadataPrefix = null;
        $from = null;
        $until = null;
        $fromGranularity = null;
        $untilGranularity  = null;
        $set = isset($this->params['set']) ? $this->params['set'] : null;


        $checks = [
            function () use (&$from, &$fromGranularity) {
                if (isset($this->params['from'])) {
                    list($from, $fromGranularity)  = $this->parseRequestDate($this->params['from']);
                }
            },
            function () use (&$until, &$untilGranularity) {
                if (isset($this->params['until'])) {
                    list($until, $untilGranularity) = $this->parseRequestDate($this->params['until']);
                }
            },
            function () use (&$from, &$until) {
                if ($from !== null and $until !== null && $from > $until) {
                    throw new BadArgumentException(
                        'The `from` argument must be less than or equal to the `until` argument'
                    );
                }
            },
            function () use (&$from, &$until, &$fromGranularity, &$untilGranularity) {
                if ($from !== null and $until !== null && $fromGranularity !== $untilGranularity) {
                    throw new BadArgumentException('The `from` and `until` arguments have different granularity');
                }
            },
            function () use (&$fromGranularity) {
                if ($fromGranularity !== null &&
                    $fromGranularity === Identity::GRANULARITY_YYYY_MM_DDTHH_MM_SSZ &&
                    $this->repository->getGranularity() === Identity::GRANULARITY_YYYY_MM_DD) {
                    throw new BadArgumentException(
                        'The granularity of the `from` argument is not supported by this repository'
                    );
                }
            },
            function () use (&$untilGranularity) {
                if ($untilGranularity !== null &&
                    $untilGranularity === Identity::GRANULARITY_YYYY_MM_DDTHH_MM_SSZ &&
                    $this->repository->getGranularity() === Identity::GRANULARITY_YYYY_MM_DD) {
                    throw new BadArgumentException(
                        'The granularity of the `until` argument is not supported by this repository'
                    );
                }
            },
            function () use (&$metadataPrefix) {
                if (!isset($this->params['metadataPrefix'])) {
                    throw new BadArgumentException("Missing required argument metadataPrefix");
                }
                $metadataPrefix = $this->params['metadataPrefix'];
                if (is_array($metadataPrefix)) {
                    throw new BadArgumentException("Only one metadataPrefix allowed");
                }
                $this->checkMetadataPrefix($metadataPrefix);
            }
        ];

        $this->doChecks($checks);
        return [$metadataPrefix, $from, $until, $set];
    }
private function getRecordListParams ( ) { $ metadataPrefix = null ; $ from = null ; $ until = null ; $ fromGranularity = null ; $ untilGranularity = null ; $ set = isset ( $ this -> params [ 'set' ] ) ? $ this -> params [ 'set' ] : null ; $ checks = [ function ( ) use ( & $ from , & $ fromGranularity ) { if ( isset ( $ this -> params [ 'from' ] ) ) { list ( $ from , $ fromGranularity ) = $ this -> parseRequestDate ( $ this -> params [ 'from' ] ) ; } } , function ( ) use ( & $ until , & $ untilGranularity ) { if ( isset ( $ this -> params [ 'until' ] ) ) { list ( $ until , $ untilGranularity ) = $ this -> parseRequestDate ( $ this -> params [ 'until' ] ) ; } } , function ( ) use ( & $ from , & $ until ) { if ( $ from !== null and $ until !== null && $ from > $ until ) { throw new BadArgumentException ( 'The `from` argument must be less than or equal to the `until` argument' ) ; } } , function ( ) use ( & $ from , & $ until , & $ fromGranularity , & $ untilGranularity ) { if ( $ from !== null and $ until !== null && $ fromGranularity !== $ untilGranularity ) { throw new BadArgumentException ( 'The `from` and `until` arguments have different granularity' ) ; } } , function ( ) use ( & $ fromGranularity ) { if ( $ fromGranularity !== null && $ fromGranularity === Identity :: GRANULARITY_YYYY_MM_DDTHH_MM_SSZ && $ this -> repository -> getGranularity ( ) === Identity :: GRANULARITY_YYYY_MM_DD ) { throw new BadArgumentException ( 'The granularity of the `from` argument is not supported by this repository' ) ; } } , function ( ) use ( & $ untilGranularity ) { if ( $ untilGranularity !== null && $ untilGranularity === Identity :: GRANULARITY_YYYY_MM_DDTHH_MM_SSZ && $ this -> repository -> getGranularity ( ) === Identity :: GRANULARITY_YYYY_MM_DD ) { throw new BadArgumentException ( 'The granularity of the `until` argument is not supported by this repository' ) ; } } , function ( ) use ( & $ metadataPrefix ) { if ( ! isset ( $ this -> params [ 'metadataPrefix' ] ) ) { throw new BadArgumentException ( "Missing required argument metadataPrefix" ) ; } $ metadataPrefix = $ this -> params [ 'metadataPrefix' ] ; if ( is_array ( $ metadataPrefix ) ) { throw new BadArgumentException ( "Only one metadataPrefix allowed" ) ; } $ this -> checkMetadataPrefix ( $ metadataPrefix ) ; } ] ; $ this -> doChecks ( $ checks ) ; return [ $ metadataPrefix , $ from , $ until , $ set ] ; }
Parses request arguments used by both ListIdentifiers and ListRecords
@return array
@throws BadArgumentException
Parses request arguments used by both ListIdentifiers and ListRecords