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

@return string
173971
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode(', ', $component);
        }

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

        return Lang::get($name);
    }
471658
public function updateComponentGroupAction(ComponentGroup $group)
    {
        try {
            $group = execute(new UpdateComponentGroupCommand(
                $group,
                Binput::get('name'),
                $group->order,
                Binput::get('collapsed'),
                Binput::get('visible')
            ));
        } catch (ValidationException $e) {
            return cachet_redirect('dashboard.components.groups.edit', [$group->id])
                ->withInput(Binput::all())
                ->withTitle(sprintf('%s %s', trans('dashboard.notifications.whoops'), trans('dashboard.components.groups.edit.failure')))
                ->withErrors($e->getMessageBag());
        }

        return cachet_redirect('dashboard.components.groups.edit', [$group->id])
            ->withSuccess(sprintf('%s %s', trans('dashboard.notifications.awesome'), trans('dashboard.components.groups.edit.success')));
    }
289690
protected function newGroupModel($token, array $options = [])
    {
        $group        = new Group();
        $group->token = $token;

        foreach ($options as $key => $value) {
            $group->{$key} = $value;
        }

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

        return $component->column . ' = ' . $component->value;
    }
586166
protected function validateComponent($component): ?string
    {
        $component = $this->filterComponent($component);
        if (null === $component) {
            return $component;
        }

        return $this->decodeComponent($component);
    }
1283953
protected String buildTitle(final Component component) {
		Component current = component;
		final StringBuilder title = new StringBuilder();
		while (current != null) {
			final String currentTitle = getTitleIfKnownComponent(current);
			if (currentTitle != null && currentTitle.length() != 0) {
				if (title.length() != 0) {
					title.insert(0, " - ");
				}
				title.insert(0, currentTitle);
			}
			current = current.getParent();
		}

		return title.length() != 0 ? title.toString() : null;
	}
1050186
public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $tags = $this->filterQueryHandler->handle($options['widget'], Tag::class);

        foreach ($tags as $tag) {
            $tagsChoices[$tag->getTitle()] = $tag->getId();
        }

        $data = null;
        if ($this->getRequest()->query->has('filter') && array_key_exists('tag_filter', $this->getRequest()->query->get('filter'))) {
            if ($options['multiple']) {
                $data = [];
                foreach ($this->getRequest()->query->get('filter')['tag_filter']['tags'] as $id => $selectedTag) {
                    $data[$id] = $selectedTag;
                }
            } else {
                $data = $this->getRequest()->query->get('filter')['tag_filter']['tags'];
            }
        }

        $builder
            ->add('tags', ChoiceType::class, [
                'label'             => false,
                'choices'           => $tagsChoices,
                'choices_as_values' => true,
                'placeholder'       => 'blog.tag_filter.empty_value',
                'required'          => false,
                'expanded'          => true,
                'multiple'          => $options['multiple'],
                'data'              => $data,
            ]);
    }
289900
public static function getComponentPropertyValues($component)
    {
        $result = [];

        $result['oc.alias'] = $component->alias;

        $properties = $component->defineProperties();
        foreach ($properties as $name => $params) {
            $result[$name] = $component->property($name);
        }

        return json_encode($result);
    }
1265957
public static function build($component, array $options = [])
    {
        if (is_array($component)) {
            return implode($component, ', ');
        }

        if ($component->expr !== '' && ! is_null($component->expr)) {
            $ret = $component->expr;
        } else {
            $fields = [];
            if (isset($component->database) && ($component->database !== '')) {
                $fields[] = $component->database;
            }
            if (isset($component->table) && ($component->table !== '')) {
                $fields[] = $component->table;
            }
            if (isset($component->column) && ($component->column !== '')) {
                $fields[] = $component->column;
            }
            $ret = implode('.', Context::escape($fields));
        }

        if (! empty($component->alias)) {
            $ret .= ' AS ' . Context::escape($component->alias);
        }

        return $ret;
    }
856526
public function admin( $options, $settings, $component ) {

		if ( ! isset( $this->components[ $component ] ) ) {
			wp_die( 'Invalid Component', '', array( 'back_link' => true ) );
		}

		$component_label = $this->components[ $component ]['Name'];

		include PODS_DIR . 'ui/admin/components-admin.php';
	}
566126
public function getComponent($component)
    {
        if (isset($this->_components[$component])) {
            return self::createComponents($this->_components[$component]);
        } else {
            throw new \Exception($component . '组件不存在');
        }
    }
1308649
public static function build($component, array $options = [])
    {
        $ret = $component->type . ' ';
        if (! empty($component->name)) {
            $ret .= Context::escape($component->name) . ' ';
        }

        $columns = [];
        foreach ($component->columns as $column) {
            $tmp = Context::escape($column['name']);
            if (isset($column['length'])) {
                $tmp .= '(' . $column['length'] . ')';
            }
            $columns[] = $tmp;
        }

        $ret .= '(' . implode(',', $columns) . ') ' . $component->options;

        return trim($ret);
    }
485332
public function serialize(Keyword $keyword, array $options = [])
    {
        $serialized = [
            'text' => $keyword->getText(),
            'caseSensitive' => $keyword->isCaseSensitive(),
            'score' => $keyword->getScore(),
        ];

        if ($keyword->getFeedback()) {
            $serialized['feedback'] = $keyword->getFeedback();
        }

        return $serialized;
    }
43498
public static function Options( $options, $selected = NULL )
	{
		$list		= array();
		foreach( $options as $key => $value)
		{
			if( (string) $key != "_selected" && is_array( $value ) )
			{
				foreach( $options as $groupLabel => $groupOptions )
				{
					if( !is_array( $groupOptions ) )
						continue;
					if( (string) $groupLabel == "_selected" )
						continue;
					$groupName	= isset( $groupOptions['_groupname'] ) ? $groupOptions['_groupname'] : $groupLabel;
					$select		= isset( $options['_selected'] ) ? $options['_selected'] : $selected;
					$list[]		= self::OptionGroup( $groupName, $groupOptions, $select );
				}
				return implode( "", $list );
			}
		}
		foreach( $options as $value => $label )
		{
			$value		= (string) $value;
			$isSelected	= is_array( $selected ) ? in_array( $value, $selected ) : (string) $selected == (string) $value;
			$list[]		= self::Option( $value, $label, $isSelected );
		}
		return implode( "", $list );
	}
1300309
public function findComponentPlugin($component)
    {
        $className = Str::normalizeClassName(get_class($component));
        if (isset($this->pluginMap[$className])) {
            return $this->pluginMap[$className];
        }

        return null;
    }
1066871
public function init($component, $options = array()) {
		parent::init($component, $options);
		$this->auth = Yii::app()->loid->load();
	}