public function getScopeKey()
    {
        $parent_attribute = $this->getType()->getParentAttribute();
        $scope_key_pieces = [];

        if ($parent_attribute) {
            $scope_key_pieces[] = $this->getRoot()->getType()->getScopeKey();
            if ($workflow_state = $this->getRoot()->getWorkflowState()) {
                $scope_key_pieces[] = $workflow_state;
            }
            $scope_key_pieces[] = $parent_attribute->getPath();
            $scope_key_pieces[] = $this->getType()->getPrefix();
        } else {
            $scope_key_pieces[] = $this->getType()->getScopeKey();
            if ($workflow_state = $this->getWorkflowState()) {
                $scope_key_pieces[] = $workflow_state;
            }
        }

        return implode(self::SCOPE_KEY_SEPARATOR, $scope_key_pieces);
    }