@param PartitionDefinition|PartitionDefinition[] $component the component to be built
@param array                                     $options   parameters for building

@return string
16741
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return "(\n" . implode(",\n", $component) . "\n)";
        }

        if ($component->isSubpartition) {
            return trim('SUBPARTITION ' . $component->name . ' ' . $component->options);
        }

        $subpartitions = empty($component->subpartitions) ? '' : ' ' . self::build($component->subpartitions);

        return trim(
            'PARTITION ' . $component->name
            . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr . ' ')
            . ((! empty($component->options) && ! empty($component->type)) ? '' : ' ') . $component->options . $subpartitions
        );
    }
384561
public function init($component, $options = array()) {
		if (isset($component)) {
			$this->setComponent($component);
		}

		$this->setRedirectUrl(Yii::app()->user->returnUrl);
		$server = Yii::app()->request->getHostInfo();
		$path = Yii::app()->request->getPathInfo();
		$this->setCancelUrl($server . '/' . $path);

		foreach ($options as $key => $val) {
			$this->$key = $val;
		}
	}
1060685
public static function build($component, array $options = [])
    {
        return trim(
            $component->table
            . ' (' . implode(', ', Context::escape($component->columns)) . ') '
            . $component->options
        );
    }
1042570
protected static function formatAuthComponent(array $components)
    {
        if (!is_null($components['scheme'])
            && is_null($components['host'])
            && !empty($components['path'])
            && strpos($components['path'], '@') !== false
        ) {
            $tmp = explode('@', $components['path'], 2);
            $components['user'] = $components['scheme'];
            $components['pass'] = $tmp[0];
            $components['path'] = $tmp[1];
            $components['scheme'] = null;
        }

        return $components;
    }
357915
public function showEditComponent(Component $component)
    {
        $groups = ComponentGroup::all();

        $pageTitle = sprintf('"%s" - %s - %s', $component->name, trans('dashboard.components.edit.title'), trans('dashboard.dashboard'));

        return View::make('dashboard.components.edit')
            ->withPageTitle($pageTitle)
            ->withComponent($component)
            ->withGroups($groups);
    }
495223
public function generate(array $components)
    {
        $uri = $components['scheme'] . '://'
             . $components['authority']
             . $components['path'];

        if (array_key_exists('query', $components) && strlen($components['query'])) {
            $uri .= '?' . $components['query'];
        }
        if (array_key_exists('fragment', $components)) {
            $uri .= '#' . $components['fragment'];
        }

        return $uri;
    }
706071
public function reactRenderComponentStatic($componentName, array $options = array())
    {
        $renderer = $this->renderer;
        $this->renderer = $this->staticRenderer;

        $rendered = $this->reactRenderComponent($componentName, $options);
        $this->renderer = $renderer;

        return $rendered;
    }
795402
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return '(' . implode(', ', $component) . ')';
        }

        $tmp = '';
        if (! empty($component->inOut)) {
            $tmp .= $component->inOut . ' ';
        }

        return trim(
            $tmp . Context::escape($component->name) . ' ' . $component->type
        );
    }
727335
protected static function addLocalConfiguration($componentDirectory, array $component)
    {
        $component['local']   = [];
        $componentDirectories = [];
        for ($dir = 0; $dir < count($component['path']); ++$dir) {
            $componentDirectory = $componentDirectories[] = dirname($componentDirectory);
        }

        foreach (array_reverse($componentDirectories) as $componentDirectory) {
            $component['local'][] = self::getLocalConfiguration($componentDirectory);
        }

        return $component;
    }
1248041
public static function build($component, array $options = [])
    {
        if ($component->dest instanceof Expression) {
            $columns = ! empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : '';

            return $component->dest . $columns;
        } elseif (isset($component->values)) {
            return ExpressionArray::build($component->values);
        }

        $ret = 'OUTFILE "' . $component->dest . '"';

        $fields_options_str = OptionsArray::build($component->fields_options);
        if (trim($fields_options_str) !== '') {
            $ret .= $component->fields_keyword ? ' FIELDS' : ' COLUMNS';
            $ret .= ' ' . $fields_options_str;
        }

        $lines_options_str = OptionsArray::build($component->lines_options, ['expr' => true]);
        if (trim($lines_options_str) !== '') {
            $ret .= ' LINES ' . $lines_options_str;
        }

        return $ret;
    }
479330
public static function getComponentName($component)
    {
        $details = $component->componentDetails();
        $name = $details['name'] ?? 'cms::lang.component.unnamed';

        return Lang::get($name);
    }
618349
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode(', ', $component);
        }

        return $component->column . ' = ' . $component->value;
    }
243389
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode(', ', $component);
        } elseif (! empty($component->raw)) {
            return '(' . implode(', ', $component->raw) . ')';
        }

        return '(' . implode(', ', $component->values) . ')';
    }
173971
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode(', ', $component);
        }

        return trim((string) $component->expr);
    }
932762
function getParts (component, options) {
  let {
    modules = [],
    package: pack,
    path: packPath = COMPONENTS_DIRNAME,
    transform,
    fileName,
    locale,
    global = []
  } = options

  if (pack && fileName) {
    modules.push({ package: pack, path: packPath, transform, fileName })
  }

  if (locale !== false) {
    if (!locale) {
      locale = 'zh-Hans'
    }

    if (!Array.isArray(locale)) {
      locale = [locale]
    }
    locale = locale.filter(l => typeof l === 'string')
    modules = locale
      .map(l => {
        return {
          package: 'veui',
          path: `locale/${l}`,
          transform: false,
          fileName: '{module}.js'
        }
      })
      .concat(modules)

    global = locale
      .map(l => {
        return { path: `veui/locale/${l}/common.js` }
      })
      .concat(global)
  }

  return modules.reduce(
    (
      acc,
      {
        package: pack,
        path: packPath = COMPONENTS_DIRNAME,
        transform,
        fileName
      }
    ) => {
      let peerComponent = getPeerFilename(component, {
        transform,
        template: fileName
      })
      let peerPath = slash(path.join(pack, packPath, peerComponent))
      pushPart(acc, { path: peerPath })
      return acc
    },
    {
      script: [...global],
      style: []
    }
  )
}
933423
public function getComponentPath($component)
    {
        try {
            return $this->findOrFail($component)->getPath() . '/';
        } catch (ComponentNotFoundException $e) {
            return $this->getPath() . '/' . Str::studly($component) . '/';
        }
    }
834006
public function init($component, $options = array()) {
		parent::init($component, $options);

		$this->auth = new EOAuthUserIdentity(array(
			'scope' => $this->scope,
			'key' => $this->key,
			'secret' => $this->secret,
			'provider' => $this->providerOptions,
		));

		// Try to restore access token and customer from session.
		$this->restoreCredentials();
	}