Build ON part

@param  array $cls
@param  array $settings
@return string
@access protected
198993
protected function buildJoinOn(array $cls, array $settings)/*# : string */
    {
        $res = ['ON'];
        $on = $cls[4];
        if (is_string($on)) { // ON string
            $res[] = $on;
        } elseif (is_object($on)) { // ON is an object
            $res[] = $this->quoteItem($on, $settings);
        } else { // common on
            $res[] = $this->quote( // left
                $this->getFirstTableAlias($on[0]) . $on[0],
                $settings
            );
            $res[] = $on[1]; // operator
            $res[] = $this->quote( // right
                $this->getSecondTableAlias($cls, $on[2]) . $on[2],
                $settings
            );
        }
        return join(' ', $res);
    }
948397
public static function getInstance(array $userSettings = array())
    {
        if (!self::$instance) {
            self::$instance = new self($userSettings);
        }
        
        return self::$instance;
    }
455141
public function setS3Client($settings)
	{
		$storage = new S3StorageHelper;
		$storage->region = $settings['region'];
		$storage->bucket = $settings['bucket'];
		$storage->credentials = $settings['credentials'];
		$storage->defaultAcl = $settings['defaultAcl'];

		if(isset($settings['cdnHostname'])) {
			$storage->cdnHostname = $settings['cdnHostname'];
		}
		if(isset($settings['debug'])) {
			$storage->debug = $settings['debug'];
		}
		if(isset($settings['options'])) {
			$storage->options = $settings['options'];
		}
		$storage->init();

		return $storage;
	}
1317331
public function withSettings(array $settings): self
    {
        $this->settings = [];
        foreach ($settings as $name => $value) {
            $this->withSetting($name, $value);
        }

        return $this;
    }
722061
public function build(InputSettings $settings)
    {
        $this->settings = $settings;

        $this->setElement();
        $this->setValidator();
        $this->setLabel();
        $this->setDefault();
        $this->setAttributes();
        $this->setData();
        $this->setAdditionalOptions();

        return $this->getElement();
    }
928038
public function settings(array $settings = null)
    {
        if ($settings !== null) {
            $this->settings = $settings;
        }

        return $this->settings + static::$globalSettings;
    }
904434
protected function getAttributes(ResourceSettings $settings) : string
    {
        $attributes = [
            $this->getLocation($settings->head),
        ];

        if ($settings->async) {
            $attributes[] = 'async';
        }

        if ($settings->defer) {
            $attributes[] = 'defer';
        }

        return implode('_', $attributes);
    }
66668
public function setSettings(array $settings)
    {
        $this->settings = array_merge($this->settings, $settings);
        
        if (isset($settings['templates_path'])) {
            $this->view->templatesPath = $this->settings['templates_path'];
        }
        
        return $this;
    }
55667
protected function displaySettingsTable($settings) {
        $tableHeader = [
          $this->trans('commands.debug.plugin.table-headers.setting'),
          $this->trans('commands.debug.plugin.table-headers.definition-value')
        ];

        $tableRows = $this->prepareTableRows($settings);

        if (count($tableRows) > 0) {
            $this->getIo()->newLine(1);
            $this->getIo()->info(
              $this->trans('commands.debug.plugin.messages.plugin-info')
            );
            $this->getIo()->table($tableHeader, array_values($tableRows));
        }
    }
1226581
protected function updateSetting($settings, $parts, $value)
    {
        $part = current(array_slice($parts, 0, 1));

        if ((string) intval($part) == $part) {
            $part = intval($part);
        }
        
        if (count($parts) > 0) {
            $parts = array_slice($parts, 1);
            
            if (!isset($settings[$part])) {
                $settings[$part] = array();
            }

            $settings[$part] = $this->updateSetting($settings[$part], $parts, $value);
        } else {
            $settings = $value;
        }
        
        return $settings;
    }
961732
protected function buildInsertSet(
        /*# string */ $prefix,
        array $settings
    )/*# : string */ {
        if (empty($this->set_data)) {
            return '';
        }

        $cols = [];
        foreach (array_keys($this->set_col) as $col) {
            $cols[] = $this->quote($col, $settings);
        }
        return $settings['seperator'] . '(' . join(', ', $cols) . ')';
    }
294658
public function injectSettings(array $settings)
    {
        if (isset($settings['security']['authentication']['authenticationStrategy'])) {
            $authenticationStrategyName = $settings['security']['authentication']['authenticationStrategy'];
            switch ($authenticationStrategyName) {
                case 'allTokens':
                    $this->authenticationStrategy = self::AUTHENTICATE_ALL_TOKENS;
                    break;
                case 'oneToken':
                    $this->authenticationStrategy = self::AUTHENTICATE_ONE_TOKEN;
                    break;
                case 'atLeastOneToken':
                    $this->authenticationStrategy = self::AUTHENTICATE_AT_LEAST_ONE_TOKEN;
                    break;
                case 'anyToken':
                    $this->authenticationStrategy = self::AUTHENTICATE_ANY_TOKEN;
                    break;
                default:
                    throw new Exception('Invalid setting "' . $authenticationStrategyName . '" for security.authentication.authenticationStrategy', 1291043022);
            }
        }

        if (isset($settings['security']['csrf']['csrfStrategy'])) {
            $csrfStrategyName = $settings['security']['csrf']['csrfStrategy'];
            switch ($csrfStrategyName) {
                case 'onePerRequest':
                    $this->csrfProtectionStrategy = self::CSRF_ONE_PER_REQUEST;
                    break;
                case 'onePerSession':
                    $this->csrfProtectionStrategy = self::CSRF_ONE_PER_SESSION;
                    break;
                case 'onePerUri':
                    $this->csrfProtectionStrategy = self::CSRF_ONE_PER_URI;
                    break;
                default:
                    throw new Exception('Invalid setting "' . $csrfStrategyName . '" for security.csrf.csrfStrategy', 1291043024);
            }
        }
    }
333091
protected function getSecondTableAlias(
        array $cls,
        /*# string */ $right
    )/*# : string */ {
        if (false !== strpos($right, '.')) {
            return '';
        } else {
            $alias = $cls[3];
            if (!is_string($alias)) {
                $alias = $cls[2];
            }
            return $alias . '.';
        }
    }
1357947
public static function hydrateCollection(array $settings)
    {
        $hydrated = [];

        foreach ($settings as $setting) {
            $hydrated[] = self::hydrate($setting);
        }

        return $hydrated;
    }
228790
private function getCacheKey(array $assets, array $settings): string
    {
        $keys = [];
        foreach ($assets as $file) {
            $keys[] = sha1_file($file);
        }
        $keys[] = sha1(serialize($settings));

        return sha1(implode('', $keys));
    }
1017860
static public function formatSettings($settings)
    {
        if (isset($settings) && is_string($settings)) {
            $settings['class'] = $settings;
        }
        
        $settings['style'] = isset($settings['style']) ? $settings['style'] : '';
        if (isset($settings['width'])) {
            $settings['style'] .= ';width:' . $settings['width'] . ';max-width:' . $settings['width'] . ';';
        }
        if (isset($settings['height'])) {
            $settings['style'] .= ';height:' . $settings['height'] . ';';
        }
        $settings['style'] = trim(str_replace(';;', ';', $settings['style']), ';');
        
        return $settings;
    }
1188599
protected function buildWhere(
        /*# string */ $prefix,
        array $settings
    )/*# : string */ {
        $result = [];
        if ('HAVING' === $prefix) {
            $wheres = &$this->getClause($prefix);
        } else {
            $wheres = &$this->getClause('WHERE');
        }
        foreach ($wheres as $idx => $where) {
            $cls = [];
            // build AND part
            $this->buildAndOr($cls, $where, $idx);
            // build COL = VAL
            $result[] = $this->buildCondition($cls, $where, $settings);
        }
        return $this->joinClause($prefix, '', $result, $settings);
    }