protected function _getRelatedParentProperties(array $relatedProperties) : array
    {
        if (empty($relatedProperties['entity']) ||
            empty($relatedProperties['controller']) ||
            empty($relatedProperties['config']['parent']['module'])
        ) {
            return [];
        }

        $foreignKey = $this->_getForeignKey(
            TableRegistry::get($relatedProperties['config']['parent']['module']),
            empty($relatedProperties['plugin']) ?
                $relatedProperties['controller'] :
                sprintf('%s.%s', $relatedProperties['plugin'], $relatedProperties['controller'])
        );

        if ('' === $foreignKey) {
            return [];
        }

        if (empty($relatedProperties['entity']->get($foreignKey))) {
            return [];
        }

        $result = $this->_getRelatedProperties(
            $relatedProperties['config']['parent']['module'],
            $relatedProperties['entity']->get($foreignKey)
        );

        if (null === $result['entity']) {
            return [];
        }

        return $result;
    }