private function determineMapFor(int $index, int $parentId, array $inverseList): ?int
    {
        if (!isset($inverseList[$parentId])) {
            throw new \InvalidArgumentException(
                'Page id ' . $parentId . ' has not been mapped'
            );
        }

        // Lookup all children of parent page in main language.
        $mainSiblings = $this->database->getPagesByPidList([$inverseList[$parentId]]);

        return isset($mainSiblings[$index]) ? (int) $mainSiblings[$index]['id'] : null;
    }
private function determineMapFor(int $index, int $parentId, array $inverseList): ?int
    {
        if (!isset($inverseList[$parentId])) {
            throw new \InvalidArgumentException(
                'Page id ' . $parentId . ' has not been mapped'
            );
        }

        // Lookup all children of parent page in main language.
        $mainSiblings = $this->database->getPagesByPidList([$inverseList[$parentId]]);

        return isset($mainSiblings[$index]) ? (int) $mainSiblings[$index]['id'] : null;
    }
private function determineMapFor ( int $ index , int $ parentId , array $ inverseList ) : ? int { if ( ! isset ( $ inverseList [ $ parentId ] ) ) { throw new \ InvalidArgumentException ( 'Page id ' . $ parentId . ' has not been mapped' ) ; } // Lookup all children of parent page in main language. $ mainSiblings = $ this -> database -> getPagesByPidList ( [ $ inverseList [ $ parentId ] ] ) ; return isset ( $ mainSiblings [ $ index ] ) ? ( int ) $ mainSiblings [ $ index ] [ 'id' ] : null ; }
Determine the mapping for the passed index.

@param int   $index       The index to look up.
@param int   $parentId    The parent id.
@param array $inverseList The reverse lookup list.

@return int|null

@throws \InvalidArgumentException When the parent page has not been mapped.
Determine the mapping for the passed index .