lib/controllers/ObjectController.php
public function _parseParams()
    {
        $paramSource = $_GET;
        $p = [];

        // primary object
        $p['objectId'] = ArrayHelper::getValue($paramSource, 'id', false);
        if ($p['objectId']) {
            $p['object'] = Registry::getObject($p['objectId'], false);
            if (empty($p['object'])) {
                throw new HttpException(404, "Unknown object '{$p['objectId']}.");
            }
        }

        // object type
        $p['typeName'] = ArrayHelper::getValue($paramSource, 'type', false);
        if ($p['typeName']) {
            $p['typeItem'] = Yii::$app->collectors['types']->getOne($p['typeName']);
            if (isset($p['typeItem']->object)) {
                $p['type'] = $p['typeItem']->object;
            }
        } elseif (isset($p['object'])) {
            $p['typeItem'] = $p['object']->objectTypeItem;
            $p['type'] = $p['object']->objectType;
        }

        if (empty($p['type'])) {
            throw new HttpException(404, "Unknown object type.");
        }

        // related object
        $p['relatedObjectId'] = ArrayHelper::getValue($paramSource, 'related_object_id', false);
        if ($p['relatedObjectId']) {
            $p['relatedObject'] = Registry::getObject($p['relatedObjectId'], false);
            if (empty($p['relatedObject'])) {
                throw new HttpException(404, "Unknown related object.");
            }
            $p['relatedType'] = $p['relatedObject']->objectType;
        }

        // relation
        $p['objectRelationName'] = ArrayHelper::getValue($paramSource, 'object_relation', false);
        if ($p['objectRelationName'] && isset($p['relatedType'])) {
            list($p['relationship'], $p['relationshipRole']) = $p['relatedType']->getRelationship($p['objectRelationName']);
            if (!empty($p['relationship']) && !empty($p['relatedObject']) && !empty($p['object'])) {
                if ($p['relationshipRole'] === 'child') {
                    $p['parentObject'] = $p['relatedObject'];
                    $p['childObject'] = $p['object'];
                } else {
                    $p['parentObject'] = $p['object'];
                    $p['childObject'] = $p['relatedObject'];
                }
                $p['relation'] = $p['relationship']->getModel($p['parentObject'], $p['childObject']);
            }
            if (empty($p['relationship'])) {
                throw new HttpException(404, "Unknown type relationship {$p['objectRelationName']}");
            }
        }

        return $p;
    }
public function _parseParams()
    {
        $paramSource = $_GET;
        $p = [];

        // primary object
        $p['objectId'] = ArrayHelper::getValue($paramSource, 'id', false);
        if ($p['objectId']) {
            $p['object'] = Registry::getObject($p['objectId'], false);
            if (empty($p['object'])) {
                throw new HttpException(404, "Unknown object '{$p['objectId']}.");
            }
        }

        // object type
        $p['typeName'] = ArrayHelper::getValue($paramSource, 'type', false);
        if ($p['typeName']) {
            $p['typeItem'] = Yii::$app->collectors['types']->getOne($p['typeName']);
            if (isset($p['typeItem']->object)) {
                $p['type'] = $p['typeItem']->object;
            }
        } elseif (isset($p['object'])) {
            $p['typeItem'] = $p['object']->objectTypeItem;
            $p['type'] = $p['object']->objectType;
        }

        if (empty($p['type'])) {
            throw new HttpException(404, "Unknown object type.");
        }

        // related object
        $p['relatedObjectId'] = ArrayHelper::getValue($paramSource, 'related_object_id', false);
        if ($p['relatedObjectId']) {
            $p['relatedObject'] = Registry::getObject($p['relatedObjectId'], false);
            if (empty($p['relatedObject'])) {
                throw new HttpException(404, "Unknown related object.");
            }
            $p['relatedType'] = $p['relatedObject']->objectType;
        }

        // relation
        $p['objectRelationName'] = ArrayHelper::getValue($paramSource, 'object_relation', false);
        if ($p['objectRelationName'] && isset($p['relatedType'])) {
            list($p['relationship'], $p['relationshipRole']) = $p['relatedType']->getRelationship($p['objectRelationName']);
            if (!empty($p['relationship']) && !empty($p['relatedObject']) && !empty($p['object'])) {
                if ($p['relationshipRole'] === 'child') {
                    $p['parentObject'] = $p['relatedObject'];
                    $p['childObject'] = $p['object'];
                } else {
                    $p['parentObject'] = $p['object'];
                    $p['childObject'] = $p['relatedObject'];
                }
                $p['relation'] = $p['relationship']->getModel($p['parentObject'], $p['childObject']);
            }
            if (empty($p['relationship'])) {
                throw new HttpException(404, "Unknown type relationship {$p['objectRelationName']}");
            }
        }

        return $p;
    }
[[@doctodo method_description:_parseParams]].

@throws HttpException [[@doctodo exception_description:HttpException]]
@return [[@doctodo return_type:_parseParams]] [[@doctodo return_description:_parseParams]]