hasSharedInstanceWithParameters()

@param  string      $classOrAlias
@param  array       $params
@param  bool        $returnFastHashLookupKey
@return bool|string
487240
public function hasSharedInstanceWithParameters($classOrAlias, array $params, $returnFastHashLookupKey = false)
        {
            ksort($params);
            $hashKey = $this->createHashForKeys($classOrAlias, array_keys($params));
            if (isset($this->sharedInstancesWithParams['hashShort'][$hashKey])) {
                $hashValue = $this->createHashForValues($classOrAlias, $params);
                if (isset($this->sharedInstancesWithParams['hashLong'][$hashKey . '/' . $hashValue])) {
                    return ($returnFastHashLookupKey) ? $hashKey . '/' . $hashValue : true;
                }
            }

            return false;
        }
324184
public function make($key, $params = [])
    {
        if($this->aliasExist($key)) {
            return $this->make($this->aliases[$key], $params);
        }

        if(is_callable($key)) {
            return call_user_func_array($key, $this->resolveCallback($key, $params));
        }

        return $this->resolveClass($key, $params);
    }
925555
protected function hasOneOrManyDeepLocalKeys(Model $related, array $throughParents, array $localKeys)
    {
        foreach (array_merge([$this], $throughParents) as $i => $instance) {
            /** @var \Illuminate\Database\Eloquent\Model $instance */
            if (! isset($localKeys[$i])) {
                if ($instance instanceof Pivot) {
                    $localKeys[$i] = ($throughParents[$i] ?? $related)->getForeignKey();
                } else {
                    $localKeys[$i] = $instance->getKeyName();
                }
            }
        }

        return $localKeys;
    }
513729
public function discovery($params)
    {
        if (is_string($params)) {
            $params = array('email' => $params);
        } else {
            $params = $this->checkFilterParams($params, array('email'), array('email'));
            if ($params === false) {
                throw new \InvalidArgumentException("params array contains invalid parameters or misses required parameters");
            }
        }

        return $this->lastRequest->get(null, 'discovery?email=' . rawurlencode($params[ 'email' ]));
    }
712708
protected function foreignKeyCondition(string $parentAlias, string $classTableAlias)
    {
        return Expr::equal(
                Expr::column($parentAlias, $this->parentTable->getPrimaryKeyColumn()),
                Expr::column($classTableAlias, $this->classTable->getPrimaryKeyColumn())
        );
    }
1057070
private function reindexClassParams(array $classParams)
    {
        $reindexed = [];

        foreach ($classParams as $param) {
            if (!is_object($param)) {
                throw new \InvalidArgumentException("\$classParams entries must be objects.");
            }

            // Iterate for param class and all parent classes. This way you can
            // inject subclasses as well as the specified class
            for ($class = get_class($param); $class !== false; $class = get_parent_class($class)) {
                if (isset($reindexed[$class])) {
                    throw new \InvalidArgumentException("\$classParams contains multiple objects of the same class [$class].");
                }

                $reindexed[$class] = $param;
            }
        }

        return $reindexed;
    }
140102
public function hasScalarKeys() {
    if ($this->key instanceof ScalarNode) {
      return $this->array instanceof ArrayLookupNode ? $this->array->hasScalarKeys() : TRUE;
    }
    else {
      return FALSE;
    }
  }
187750
public function setClassParameters($classParams)
    {
        $object = $this->getObject();
        $tableName = $object->getCoreTableName();
        $values = array();
        foreach ($classParams as $sParamKey => $paramValue) {
            if (is_int($sParamKey)) {
                $fieldName = $this->_getFieldName($tableName, $paramValue);
                $values[$paramValue] = $object->$fieldName->value;
            } else {
                $fieldName = $this->_getFieldName($tableName, $sParamKey);
                if (is_string($paramValue)) {
                    $paramValue = html_entity_decode($paramValue);
                }
                $object->$fieldName = new \OxidEsales\Eshop\Core\Field($paramValue);
            }
        }

        return $values;
    }
673259
public static function isInstanceOf($class_name) {
    $classes = func_get_args();

    return function ($node) use ($classes) {
      foreach ($classes as $class) {
        if ($node instanceof $class) {
          return TRUE;
        }
      }
      return FALSE;
    };
  }
440091
protected function callBeforeHooks($classInstance, $method, array $args = [])
    {
        $return = $this->callBeforeAllHooks($classInstance, $method);

        if ($return !== null) {
            return $return;
        }

        $return = $this->callBeforeMethodHooks($classInstance, $method, $args);

        if ($return !== null) {
            return $return;
        }

        $return = $this->callOnceBeforeHooks($classInstance, $method, $args);

        if ($return !== null) {
            return $return;
        }
    }
852082
public function getInstances($recursive = false, $params = array())
    {
        return (array) $this->getImplementation()->getInstances($this, $recursive, $params);
    }
147484
public function exists($params, $optParams = [])
    {
        if (is_string($params)) {
            $params = ['publicId' => $params];
        }

        return $this->sendRequest(['cloudId', 'publicId'], [
            'restAction' => 'exists',
            'uri' => '/c/<cloudId>/o/<publicId>',
            'params' => $params,
            'getParams' => $optParams,
        ], function ($response) {
            return $response->success;
        });
    }
939667
public function get(string $class_name, array $args = [])
    {
        $class_name = ltrim($class_name, '\\');
        $class_key  = strtolower($class_name);

        if (isset($this->instances[$class_key])) {
            return $this->instances[$class_key];
        }
        if (!isset($this->closures[$class_key])) {
            $this->closures[$class_key] = $this->getClosure($class_name, $class_key);
        }
        return $this->closures[$class_key]($args);
    }
726764
private static function &getMockHierarchyResponse(
        $chainedMethodsBefore,
        $mockClassType,
        $mockClassInstanceId
    ) {
        $rReturnValues = &self::$returnValues[$mockClassType][$mockClassInstanceId];
        // Check return values chain
        foreach ($chainedMethodsBefore as $chainedMethod) {
            $chainedMethodName = key($chainedMethod);
            $chainedMethodArgs = $chainedMethod[$chainedMethodName];

            $serializedChainMethodArgs = serialize($chainedMethodArgs);

            $rReturnValues = & $rReturnValues[$chainedMethodName][$serializedChainMethodArgs];
        }
        return $rReturnValues;
    }
541071
public <E> CacheQuery<E> getQuery(HSQuery hSearchQuery, IndexedQueryMode queryMode) {
      if (timeoutExceptionFactory != null) {
         hSearchQuery.timeoutExceptionFactory(timeoutExceptionFactory);
      }
      Class<?>[] classes = hSearchQuery.getTargetedEntities().toPojosSet().toArray(new Class[hSearchQuery.getTargetedEntities().size()]);
      queryInterceptor.enableClasses(classes);

      if (queryMode == IndexedQueryMode.BROADCAST) {
         ExecutorService asyncExecutor = queryInterceptor.getAsyncExecutor();
         return new ClusteredCacheQueryImpl<>(new QueryDefinition(hSearchQuery), asyncExecutor, cache, keyTransformationHandler, null);
      } else {
         return new CacheQueryImpl<>(hSearchQuery, cache, keyTransformationHandler);
      }
   }
871188
protected function createFormInstance(string $className, array $params)
    {
        $result = new $className ($this->getTranslator(), $this->getValidator(), $this->getOptions(), $params);

        return $result;
    }
399302
function instance(defaults, options) {
  if (!singletonQS) {
    singletonQS = queryState(defaults, options);
  } else if (defaults) {
    singletonQS.setIfEmpty(defaults);
  }

  return singletonQS;
}