public function execute()
    {
        $result = $this->resultJson->create();

        try {
            $dictionaryId = $this->getRequest()->getParam('dictionary_id');
            $dictionaryItems = $this->api->dictionaryItemsList($dictionaryId);

            if (is_array($dictionaryItems) && empty($dictionaryItems)) {
                return $result->setData([
                    'status'            => 'empty',
                    'dictionaryItems'   => []
                ]);
            }

            if (!$dictionaryItems) {
                return $result->setData([
                    'status'    => false,
                    'msg'       => 'Failed to fetch dictionary items.'
                ]);
            }

            return $result->setData([
                'status'            => true,
                'dictionaryItems'   => $dictionaryItems
            ]);
        } catch (\Exception $e) {
            return $result->setData([
                'status'    => false,
                'msg'       => $e->getMessage()
            ]);
        }
    }
public function execute()
    {
        $result = $this->resultJson->create();

        try {
            $dictionaryId = $this->getRequest()->getParam('dictionary_id');
            $dictionaryItems = $this->api->dictionaryItemsList($dictionaryId);

            if (is_array($dictionaryItems) && empty($dictionaryItems)) {
                return $result->setData([
                    'status'            => 'empty',
                    'dictionaryItems'   => []
                ]);
            }

            if (!$dictionaryItems) {
                return $result->setData([
                    'status'    => false,
                    'msg'       => 'Failed to fetch dictionary items.'
                ]);
            }

            return $result->setData([
                'status'            => true,
                'dictionaryItems'   => $dictionaryItems
            ]);
        } catch (\Exception $e) {
            return $result->setData([
                'status'    => false,
                'msg'       => $e->getMessage()
            ]);
        }
    }
public function execute ( ) { $ result = $ this -> resultJson -> create ( ) ; try { $ dictionaryId = $ this -> getRequest ( ) -> getParam ( 'dictionary_id' ) ; $ dictionaryItems = $ this -> api -> dictionaryItemsList ( $ dictionaryId ) ; if ( is_array ( $ dictionaryItems ) && empty ( $ dictionaryItems ) ) { return $ result -> setData ( [ 'status' => 'empty' , 'dictionaryItems' => [ ] ] ) ; } if ( ! $ dictionaryItems ) { return $ result -> setData ( [ 'status' => false , 'msg' => 'Failed to fetch dictionary items.' ] ) ; } return $ result -> setData ( [ 'status' => true , 'dictionaryItems' => $ dictionaryItems ] ) ; } catch ( \ Exception $ e ) { return $ result -> setData ( [ 'status' => false , 'msg' => $ e -> getMessage ( ) ] ) ; } }
Get all dictionaries for active version

@return $this|\Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface
Get all dictionaries for active version