@param Configuration $configuration
@param array         $params

@return bool
965848
public function requireIfNotAvailableOr(Configuration $configuration, array $params)
  {
    $requiredIfNotAvailable = $configuration->getOptions()->getRequiredIfNotAvailable();
    foreach ($requiredIfNotAvailable->getOr() as $key)
    {
      if (!array_key_exists(strtolower($key), $params))
      {
        return true;
        break;
      }
    }

    return false;
  }
998686
protected function prepareArray(Configuration $configuration, Parameter $parameter)
  {
    $this->dispatcher->dispatch(
      TransformerEvents::PREPARE_ARRAY,
      new TransformerEvent($configuration, $parameter)
    );

    $return = self::BUILD_ARRAY;

    if (count($configuration->getChildren()) > 0
        && $configuration->getOptions()->isAssociative() === true
    )
    {
      $value = $this->build(
        $return,
        $configuration->getChildren(),
        $this->converter->convertTo($parameter->getValue(), 'array')
      );
      $parameter->setValue($value);
    }

    return $this;
  }
465111
protected function setValue(array $return, Configuration $configuration, Parameter $parameter)
  {
    $key   = $configuration->getRenameTo() !== null ? $configuration->getRenameTo() : $configuration->getKey();
    $array = array($key => $parameter->getValue());

    return array_merge($return, $array);
  }
374454
protected function performQuery(array $configuration, &$context, array $parameters, $sql)
    {
        /** @var PDOStatement $stmt */
        $stmt = $this->getConnection($context)->executeQuery($sql, $parameters['values'], $parameters['types']);

        if ($stmt->columnCount() > 0) { // SQL query is for example a SELECT
            $result = $stmt->fetchAll();
        } else { // SQL query is for example an UPDATE
            $result = ['count' => $stmt->rowCount()];
        }

        if (array_key_exists(self::CONF_QUERY_NAME, $configuration)) {
            $name = $configuration[self::CONF_QUERY_NAME];
            $context[self::CONTEXT_RESULTS][$name] = $result;
            if (0 == count($result)) {
                throw new NoResultsException('No results found for query named: '.$name);
            }
        }

        return $result;
    }
1329274
public function init($configuration)
    {
        $returnValue = (bool) false;

    	$this->appenders = array();
    	$this->minLevel = null;
    	foreach ($configuration as $appenderConfig) {
    		if (isset($appenderConfig['class'])) {
    			
    			$classname = $appenderConfig['class'];
    			if (!class_exists($classname)){
    				$classname = 'common_log_'.$classname;
                }
    			if (class_exists($classname) && is_subclass_of($classname, 'common_log_Appender')) {
    				$appender = new $classname();
    				if (!is_null($appender) && $appender->init($appenderConfig)) {
    					$this->addAppender($appender);
    				}
    			}
    		}
    	}
    	$returnValue = (count($this->appenders) > 0);
        

        return (bool) $returnValue;
    }
689995
public function apply(Request $request, ParamConverter $configuration)
    {
        if (null === $parameter = $configuration->getName()) {
            throw new InvalidConfigurationException(InvalidConfigurationException::MISSING_NAME);
        }

        if (null === $entityClass = $configuration->getClass()) {
            throw new InvalidConfigurationException(InvalidConfigurationException::MISSING_CLASS);
        }

        $options = $configuration->getOptions();

        if (!isset($options['id'])) {
            throw new InvalidConfigurationException(InvalidConfigurationException::MISSING_ID);
        }

        if ($request->attributes->has($options['id'])) {
            if (null !== $id = $request->attributes->get($options['id'])) {
                if (null !== $entity = $this->em->getRepository($entityClass)->find($id)) {
                    $request->attributes->set($parameter, $entity);

                    return true;
                }
            }

            if (!$configuration->isOptional()) {
                throw new NotFoundHttpException();
            }
        }

        return false;
    }
1172026
public function build(Configuration $configuration, array $queries = [])
    {
        $platform = $configuration->getConnection()->getDatabasePlatform()->getName();

        $code = [];
        foreach ($queries as $query) {
            if (stripos($query, $configuration->getMigrationsTableName()) !== false) {
                continue;
            }
            $code[] = sprintf("\$this->addSql(%s);", var_export($query, true));
        }

        if (!empty($code)) {
            array_unshift(
                $code,
                sprintf(
                    "\$this->abortIf(\$this->connection->getDatabasePlatform()->getName() != %s, %s);",
                    var_export($platform, true),
                    var_export(sprintf("Migration can only be executed safely on '%s'.", $platform), true)
                ),
                ""
            );
        }

        return implode("\n", $code);
    }
275669
private function checkTransitionsConfiguration(array $configuration)
    {
        foreach ($configuration as $transitionConfiguration) {
            if (
                is_array($transitionConfiguration) &&
                (count($transitionConfiguration) === 3) &&
                isset($transitionConfiguration[0]) &&
                is_string($transitionConfiguration[0]) &&
                $transitionConfiguration[0] &&
                isset($transitionConfiguration[1]) &&
                is_string($transitionConfiguration[1]) &&
                $transitionConfiguration[1] &&
                isset($transitionConfiguration[2]) &&
                is_string($transitionConfiguration[2]) &&
                $transitionConfiguration[2]
            ) {
                return $this;
            }
        }

        throw new TransitionNotValidException();
    }
827150
public function updateByParams( $params = [], $config = [] ) {

		$modelId	= $params[ 'modelId' ];
		$name		= $params[ 'name' ];
		$type		= $params[ 'type' ];

		$model = $this->getByNameType( $modelId, $name, $type );

		if( isset( $model ) ) {

			$model->value = $params[ 'value' ];

			return parent::update( $model, [
				'selective' => false,
				'attributes' => [ 'value' ]
			]);
		}
	}
380160
protected function getValue(Configuration $configuration, array $params)
  {
    if (array_key_exists(strtolower($configuration->getKey()), $params))
    {
      return $params[strtolower($configuration->getKey())];
    }
    if (array_key_exists(strtolower($configuration->getRenameTo()), $params))
    {
      return $params[strtolower($configuration->getRenameTo())];
    }

    return null;
  }
175378
private function parseAndFillConfiguration($configurations)
    {
        $this->default_include = isset($configurations['include']) ?
            array_merge($this->default_include, $configurations['include']) : $this->default_include;

        $this->default_exclude = isset($configurations['exclude']) ?
            array_merge($this->default_exclude, $configurations['exclude']) : $this->default_exclude;
    }
743624
public function apply(Request $request, ParamConverter $configuration): bool
    {
        if (!$request->get(self::PARAMETER_VERSION_NO) || !$request->get(self::PARAMETER_CONTENT_ID)) {
            return false;
        }

        $versionNo = (int)$request->get(self::PARAMETER_VERSION_NO);
        $contentId = (int)$request->get(self::PARAMETER_CONTENT_ID);

        $contentInfo = $this->contentService->loadContentInfo($contentId);
        $versionInfo = $this->contentService->loadVersionInfo($contentInfo, $versionNo);

        $request->attributes->set($configuration->getName(), $versionInfo);

        return true;
    }
8940
protected function includeConfiguration($configuration)
    {
        if (file_exists($configuration)) {
            $callable = include $configuration;
            if (is_callable($callable)) {
                call_user_func($callable, $this->eventEmitter);
            }
        }

        return true;
    }
890739
public function apply(Request $request, ParamConverterConfiguration $configuration)
    {
        $name = $configuration->getName();

        $object = $this->manager->getCurrentModule();
        $request->attributes->set($name, $object);

        return true;
    }
248948
private function loadConfiguration($params)
	{
		if (!is_null(self::$jConfig))
		{
			return true;
		}

		// Load config as object
		$jConfig = json_decode(json_encode(parse_ini_file(JPATH_BASE . '/jorobo.ini', true)), false);

		if (!$jConfig)
		{
			$this->say('Error: Config file jorobo.ini not available');

			throw new FileNotFoundException('Config file jorobo.ini not available');
		}

		// Are we building a git / dev release?
		if ($this->isDevelopmentVersion($params))
		{
			$res = $this->_exec('git rev-parse --short HEAD');

			$version = "git" . trim($res->getMessage());

			if ($version)
			{
				$this->say("Changing version to development version " . $version);
				$jConfig->version = $version;
			}
		}

		$jConfig->buildFolder = JPATH_BASE . $this->determineTarget($jConfig);
		$jConfig->params      = $params;

		self::$jConfig = $jConfig;

		// Date set
		date_default_timezone_set('UTC');
	}
736456
protected function prepareValue(Configuration $configuration, Parameter $parameter)
  {
    $this->dispatcher->dispatch(
      TransformerEvents::PREPARE_VALUE,
      new TransformerEvent($configuration, $parameter)
    );

    switch ($configuration->getType())
    {
      case TypeEnum::COLLECTION_TYPE:
        $this->prepareCollection($configuration, $parameter);
        break;
      case TypeEnum::OBJECT_TYPE:
        $this->prepareObject($configuration, $parameter);
        break;
      case TypeEnum::DATE_TYPE:
        $this->prepareDate($configuration, $parameter);
        break;
      case TypeEnum::INDIVIDUAL_TYPE:
        $this->prepareIndividual($configuration, $parameter);
        break;
      case TypeEnum::ARRAY_TYPE:
        $this->prepareArray($configuration, $parameter);
        break;
    }

    return $this;
  }
825847
public function createByParams( $params = [], $config = [] ) {

		$params[ 'active' ]	= CoreGlobal::STATUS_ACTIVE;

		return parent::createByParams( $params, $config );
	}