实现连贯操作
@param type $name
@param type $arguments
@return Model
355744
public function __callBefore($name, $arguments)
	{
		if(isset($arguments[0]))
		{
			// getBy字段支持：
			$arr = explode('getBy',$name);
			if(''===$arr[0] && isset($arr[1]))
			{
				return $this->getBy($arr[1], $arguments[0]);
			}
			// selectBy字段支持：
			$arr = explode('selectBy',$name);
			if(''===$arr[0] && isset($arr[1]))
			{
				return $this->selectBy($arr[1], $arguments[0]);
			}
			unset($arr);
			// 全部转为小写，照顾所有大小写习惯的用户
			$name = strtolower($name);
		}
	}
1121404
public static function instance($config = [], $name = false)
    {
        if (false === $name) {
            $name = md5(serialize($config));
        }

        if (true === $name || !isset(self::$instance[$name])) {
            // 解析连接参数 支持数组和字符串
            $options = self::parseConfig($config);

            if (empty($options['type'])) {
                throw new InvalidArgumentException('Undefined db type');
            }

            $class = false !== strpos($options['type'], '\\') ? $options['type'] : '\\think\\db\\connector\\' . ucwords($options['type']);
            // 记录初始化信息
            self::$log[] = '[ DB ] INIT ' . $options['type'];

            if (true === $name) {
                $name = md5(serialize($config));
            }

            self::$instance[$name] = new $class($options);
        }

        return self::$instance[$name];
    }
505160
protected function setKey(string $name, array $arguments): string
    {
        $prefix = $this->cachePrefix($name);
        $cacheKey = sha1($prefix.serialize($arguments));
        $this->cacheKeys[$prefix] = $cacheKey;

        return $cacheKey;
    }
821786
protected function key(string $name, array $arguments = null): string
    {
        if ($this->name !== '') {
            return $this->name;
        }

        if ($arguments === null) {
            return $this->name = $name;
        }

        return $this->name = \sha1(Serialize::encode([$name, $arguments]));
    }
1153058
public function factory($name, array $args = array())
    {
        foreach ($this->factories as $factory) {
            $command = $factory->factory($name, $args);
            if ($command) {
                return $command;
            }
        }
    }
109782
private function makeService($name, array $args = [])
    {
        if (!isset($this->services[$name]) || $args) {
            $apiClient = $this->sdk->createClient($name, $args);
            $model = $this->loadModel($name, $apiClient->getApi()->getApiVersion());
            $resourceClient = new ResourceClient($apiClient, $model);
            $this->services[$name] = new Resource($resourceClient, 'service', [], []);
        }

        return $this->services[$name];
    }
570182
public function getArgument($name)
    {
        if (!$this->hasArgument($name)) {
            throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name));
        }

        $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments;

        return $arguments[$name];
    }
1077227
private function call($name, array $arguments = array())
    {
        $startTime = microtime(true);
        $result = call_user_func_array("parent::$name", $arguments);
        $duration = (microtime(true) - $startTime) * 1000;

        if (null !== $this->logger) {
            $this->logger->logCommand($this->getCommandString($name, $arguments), $duration, $this->alias, false);
        }

        return $result;
    }
228415
public function createObject(string $name, array $args): JavaProxy
    {
        $this->protocol->createObjectBegin($name);
        $this->writeArgs($args);
        $this->protocol->createObjectEnd();

        return $this->getInternalResult();
    }
499827
public function call($name, array $arguments = [])
    {
        $this->initSteps($name, $row, $last);
        $isCallable = is_callable($row);

        if (!$isCallable && !$last)
        {
            return $row;
        }

        return call_user_func_array(
            $isCallable ? $row : [$row, $last],
            (new Argument($this, $arguments))->get()
        );
    }
398392
public function update(
            Expression $value,
            Expression $name,
            array $arguments
    ) {
        if ($this->value === $value
                && $this->name === $name
                && $this->arguments === $arguments
        ) {
            return $this;
        }

        return new self(
                $value,
                $name,
                $arguments);
    }
677014
public static function create($name, callable $callback, ...$arguments) {

        try {

            return  new RpcMethod($name, $callback, ...$arguments);

        } catch (Exception $e) {

            throw $e;

        }

    }
1364687
public function callTransformer($name, $arguments = [])
	{
		return call_user_func_array(array($this, 'transform' . ucfirst($this->snakeToCamel($name))), $arguments);
	}
705391
protected function addMethod($name, array $arguments = array())
    {
        $this->methods[] = new MethodCall($this, $name, $arguments);

        return $this;
    }
961477
private static function buildTag(string $name, $arguments): string
    {
        $tagConf = static::$tagsData[$name];
        $hasValue = (boolean)$tagConf['hasValue'];
        $clear = \iterator_to_array($tagConf['clearAttributes'], true);
        $default = \iterator_to_array($tagConf['defaultAttributes'], true);

        $tagName = $name == 'vartag' ? 'var' : $name;
        $tagValue = static::getTagContent($arguments, $hasValue);
        $attributes = static::getTagAttributes($arguments, $hasValue);
        $attributes = static::clearAttributes($attributes, $clear);
        $attributes = static::setDefaultAttributes($attributes, $default);
        $newLine = '';

        if (\is_array($tagValue)) {
            $tagValue = \implode(static::CRLF, $tagValue);
            $newLine = static::CRLF;
        } elseif (\in_array($tagName, ['body', 'head', 'html'])) {
            $newLine = static::CRLF;
        }

        if ($hasValue === true) {
            return \sprintf(
                '<%s%s>%s%s%s</%s>%s',
                $tagName,
                static::extractAttributes($attributes),
                $newLine,
                \rtrim(\str_replace(static::CRLF.static::CRLF, static::CRLF, $tagValue), static::CRLF),
                $newLine,
                $tagName,
                $newLine
            );
        }

        if (\in_array($tagName, ['iframe'])) {
            return \sprintf('<%s%s></%s>', $tagName, static::extractAttributes($attributes), $tagName);
        }

        return \sprintf('<%s%s/>', $tagName, static::extractAttributes($attributes));
    }
116743
public function call($name, $arguments = [])
    {
        return $this->runViaLaravelCollection(function ($collection) use (
            $name,
            $arguments
        ) {
            return call_user_func_array(
                [$collection, $name],
                $this->coollectizeCallbacks($this->__toArray($arguments), $name)
            );
        },
        $name);
    }
1144644
public static function oneByName($name)
	{
		$model = self::all()
			->whereEquals('name', $name)
			->row();

		if (!$model)
		{
			$model = self::blank();
		}

		return $model;
	}