@param $toolKey
@param $parentKey

@return null|string
437396
public function isParentOf($toolKey, $parentKey, $data = null)
    {
        $data = is_null($data) ? $this->getToolSectionMap() : $data;

        foreach ($data as $idx => $tool) {
            if ($tool['key'] === $toolKey) {
                $this->sectionParent = $tool['parent'];
            }

            if (!empty($tool['children']) && $tool['key'] !== $toolKey) {
                $this->isParentOf($toolKey, $parentKey, $tool['children']);
            }
        }

        return $this->sectionParent == $parentKey;
    }
648136
public function getImageListAjaxAction($parentId, $parentType)
    {
        $this->checkAuth(AdminResources::MODULE,Team::getModuleCode(), AccessManager::UPDATE);
        $this->checkXmlHttpRequest();
        $args = array('imageType' => $parentType, 'parentId' => $parentId);

        return $this->render('custom/image-upload-list-ajax', $args);
    }
50423
protected function parseConstKey($key, $curBlock)
    {
        $key = str_replace('\\\\', '\\', $key);

        if ($this->securityPolicy !== null && $this->securityPolicy->getConstantHandling() === SecurityPolicy::CONST_DISALLOW) {
            return 'null';
        }

        if ($curBlock !== 'root') {
            return '(defined("' . $key . '") ? ' . $key . ' : null)';
        }

        return $key;
    }
285888
public static ToolbarBaseAction getToolbarAction(String key, MapWidget mapWidget) {
		ToolCreator toolCreator = REGISTRY.get(key);
		if (null == toolCreator) {
			return null;
		}
		return toolCreator.createTool(mapWidget);
	}
13909
protected static function check_plugin($key=null) {
		if (\is_null(static::$_plugin)) {
			// Pull the remote info and store it for later.
			if (false === ($remote = static::get_release_info('Info URI', static::PLUGIN_TEMPLATE))) {
				static::$_plugin = false;
				return static::$_plugin;
			}

			// Use the main plugin headers as the basis.
			static::$_plugin = \get_plugin_data(\BLOBCOMMON_INDEX, false, false);

			// And add in what we pulled remotely.
			static::$_plugin['InfoURI'] = $remote['json_uri'];
			static::$_plugin['DownloadVersion'] = $remote['Version'];
			static::$_plugin['DownloadURI'] = $remote['DownloadURI'];
		}

		// Requesting just one key?
		if (! \is_null($key)) {
			return \array_key_exists($key, static::$_plugin) ? static::$_plugin[$key] : false;
		}

		// Send everything!
		return static::$_plugin;
	}
879831
public function getChildBookmark($parentIndex, $childIndex)
    {

        $strURI = Product::$baseProductUri . '/pdf/' . $this->getFileName() . '/bookmarks/' . $parentIndex . '/bookmarks/' . $childIndex;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        return $json->Bookmark;
    }
1024871
private function normalizeParameters($parameters, $parentKey = '')
    {
        if (empty($parameters)) {
            return '';
        }

        $normalized = array();
        foreach ($parameters as $key => $value) {
            if (empty($value)) {
                continue;
            }

            if ($parentKey !== '') {
                // Multidimensional array; using foo=bar&foo=baz rather than foo[bar]=baz&foo[baz]=bar
                $key = $parentKey;
            }

            if (is_array($value)) {
                $normalized[] = $this->normalizeParameters($value, $key);
            } else {
                $normalized[] = $this->encode($key) . '=' . $this->encode($value);
            }
        }

        $normalized = array_filter($normalized);
        sort($normalized, SORT_STRING);

        return implode('&', $normalized);
    }
1009014
protected function transformKey($key)
    {
        $key = sprintf('site.sites.%s.%s', $this->site->getSiteHandle(), $key);
        return parent::transformKey($key);
    }
297320
private void createIncompleteKey(Key parent) {
    String kind = entityMetadata.getKind();
    if (parent == null) {
      key = entityManager.newNativeKeyFactory().setKind(kind).newKey();
    } else {
      key = IncompleteKey.newBuilder(parent, kind).build();
    }
  }
412967
public function findRoleByKey($roleKey)
    {
        if ($roleKey instanceof RoleInterface) {
            return $roleKey;
        }

        $result         =   $this->roleProvider->findByKey($roleKey);
        if ($result) {
            return $result;
        }

        $exceptionMessage   =   "The role '%(rolekey)s' cannot be found.";

        throw new RoleNotFound(isprintf($exceptionMessage, compact('roleKey')));
    }
863251
function via( $key ) {

        if ( !$this->parent_ ) throw new \LogicException( 'Cannot set reference key on basic Result' );

        $clone = clone $this;

        if ( $clone->single ) {

            $clone->parentKey = $key;

        } else {

            $clone->key = $key;

        }

        return $clone;

    }
211067
public function getParentKey()
    {
        if ($this->owner->isRoot()) {
            return null;
        }
        $path = $this->getPath();
        return array_pop($path);
    }
39862
public function parent($key):self
    {
        $breadcrumb = BreadcrumbFacade::get($key);
        $this->parents->put($key, $breadcrumb);

        return $this;
    }
680360
public static function get($pKey)
    {
        if (array_key_exists($pKey, self::$_registry)) {
            return self::$_registry[$pKey];
        }

        return NULL;
    }
180832
private function getRecursive(string $key, array $parent = null)
    {
        if ($parent !== null ? \array_key_exists($key, $parent) : parent::has($key)) {
            return $parent !== null ? $parent[$key] : parent::get($key);
        }

        $keySegments = \explode('.', $key);
        $keyParts = [];

        while (\count($keySegments) > 1) {
            \array_unshift($keyParts, \array_pop($keySegments));
            $subKey = \implode('.', $keySegments);

            if ($parent !== null ? \array_key_exists($subKey, $parent) : parent::has($subKey)) {
                $parent = $parent !== null ? $parent[$subKey] : parent::get($subKey);

                if (!\is_array($parent)) {
                    break;
                }

                return $this->getRecursive(\implode('.', $keyParts), $parent);
            }
        }

        throw new NotFoundException(\sprintf('Entry "%s" not found', $key));
    }
1168081
private function queueRelated(
        ContextualCommandInterface $parentCommand
    ): ContextualCommandInterface {
        /*
         * Only queue parent relations when parent wasn't saved already, attention, this might
         * cause an issues with very deep recursive structures (and it's expected).
         */
        $innerCommand = $this->instance->queueStore(
            !$this->instance->isLoaded()
        );

        if (!$this->isSynced($this->parent, $this->instance)) {
            //Syncing FKs before primary command been executed
            $innerCommand->onExecute(function ($innerCommand) use ($parentCommand) {
                $parentCommand->addContext(
                    $this->key(Record::INNER_KEY),
                    $this->lookupKey(Record::OUTER_KEY, $this->parent, $innerCommand)
                );
            });
        }

        return $innerCommand;
    }
348646
public function __isset($key)
    {
        return parent::__isset($key) || parent::__isset($this->getSnakeKey($key));
    }