protected function getItem(array $aData = [], int $iSegment = null, bool $bIncludeDeleted = false, bool $b404 = true)
    {
        $iSegment = $iSegment ?? 5;
        $oUri     = Factory::service('Uri');
        $oModel   = $this->getModel();
        $iItemId  = (int) $oUri->segment($iSegment);

        if (classUses($oModel, Localised::class) && $oUri->segment($iSegment + 1)) {
            $aData['USE_LOCALE'] = $oUri->segment($iSegment + 1);
        }

        if (!array_key_exists('where', $aData)) {
            $aData['where'] = [];
        }

        $aData['where'][] = ['id', $iItemId];

        $aItems = $oModel->getAll(
            null,
            null,
            $aData,
            $bIncludeDeleted
        );

        $oItem = reset($aItems);

        if ($b404 && empty($oItem)) {
            show404();
        }

        return $oItem;
    }