注册一个命令

@param string $class 类名
@param null $alias 命令别名

@return $this
518660
public function addCommand($class, $alias = null)
    {
        $name = $class;
        $name = substr($name, 0, -7);
        $name = self::dashToCamelCase(basename(str_replace('\\', '/', $name)));

        $name = $alias ?: $name;
        $this->commands[$name] = $class;

        return $this;
    }
585831
public function ucase($column, string $alias = null): self
    {
        return $this->column((new Expression())->ucase($column), $alias);
    }
372041
public function addClassAlias($alias, $class)
    {
        $alias = static::normalise($alias);
        $class = static::normalise($class);

        $this->classAliases[$alias] = $class;

        return $this;
    }
195822
public function bind($class, $transformer = null)
	{
		if(!$transformer) {
			return $this->autoBind($class);
		}

		$this->binds[$class] = $transformer;

		return $this;
	}
1299821
public function column($name, string $alias = null): self
    {
        $this->sql->addColumn($name, $alias);
        return $this;
    }
817850
public function load($alias)
    {
        if (array_key_exists($alias, $this->aliases)) {
            return class_alias($this->aliases[$alias], $alias);
        }

        return false;
    }
1194072
public function remove($aliasOrGClass) {
    if ($aliasOrGClass instanceof ClassInterface) {
      $gClass = $aliasOrGClass;
      $alias = $aliasOrGClass->getName();
    } else {
      $gClass = NULL;
      $alias = $aliasOrGClass;
    }
    
    if (array_key_exists($loweralias = mb_strtolower($alias), $this->aliases)) {
      unset($this->classes[ $this->aliases[$loweralias] ]);
      unset($this->aliases[$loweralias]);
    } elseif (isset($gClass)) {
      foreach ($this->classes as $alias => $otherGClass) {
        if ($otherGClass->equals($gClass)) {
          unset($this->aliases[mb_strtolower($alias)]);
          unset($this->classes[$alias]);
          break;
        }
      }
    }
    
    return $this;
  }
155048
public function alias($alias = null)
    {
        if (null === $alias) {
            $alias = $this->getTableAlias();
        }
        $this->oosql_table_alias = $alias;
        return $this;
    }
845907
public function setAuthenticatorClass($class)
    {
        $this->authenticatorClass = $class;

        /** @var FieldList|null $fields */
        $fields = $this->Fields();
        if (!$fields) {
            return $this;
        }

        $authenticatorField = $fields->dataFieldByName('AuthenticationMethod');
        if ($authenticatorField) {
            $authenticatorField->setValue($class);
        }

        return $this;
    }
998977
public function alias($alias = null)
    {
        if ($alias !== null) {
            $this->alias = $alias;
        }

        return $this->alias;
    }
39542
public function alias($alias)
    {
        $this->alias = $alias;

        if (!in_array('`' . $alias . '`.*', $this->select)) {
            $this->select[] = '`' . $alias . '`.*';
        }

        if (in_array('`' . $this->table . '`.*', $this->select)) {
            unset($this->select[array_search('`' . $this->table . '`.*', $this->select)]);
        }

        return $this;
    }
8085
public function registerAlias($class, $alias)
    {
        $alias = trim($alias);
        $class = trim($class);

        $this->__registry->alias($class, $alias);
    }
1132640
public function dsql($class = null)
    {
        $obj = parent::dsql($class);
        if (!$obj instanceof DB_dsql_prefixed) {
            throw $this->exception('Specified class must be descendant of DB_dsql_prefixed')
            ->addMoreInfo('class', $class);
        }
        if ($this->table_prefix) {
            $obj->prefix($this->table_prefix);
        }

        return $obj;
    }
911555
public function load(string $class)
    {
        $alias = $this->loader;
        if (isset($alias[$class])) {
            class_alias($alias[$class], $class);
        }

        $class = $this->alias($class);
        if (!$this->container->has($class)) {
            return null;
        }

        $instance = $this->container[$class];
        if (is_object($instance)) {
            return $instance;
        }

        return null;
    }
994147
public function setAliasOf($alias) {
        $alias = $this->normalizeID($alias);

        if ($alias === $this->currentRuleName) {
            trigger_error("You cannot set alias '$alias' to itself.", E_USER_NOTICE);
        } else {
            $this->currentRule['aliasOf'] = $alias;
        }
        return $this;
    }
725168
public function alias($alias, $path = null)
	{
		if (is_null($path))
		{
			return $this->aliases[$alias] ?: null;
		}
		else
		{
			$this->aliases[$alias] = $path;
		}
	}
40052
public function withAlias($aliasAction, $alias)
    {
        $this->aliasAction = $aliasAction;
        $this->alias = $alias;
        return $this;
    }