Takes a table name and creates the class name.

@param   string  the table name
@param   bool    whether to singularize the table name or not
@return  string  the class name
329776
public function classify($name, $force_singular = true)
	{
		$class = ($force_singular) ? $this->singularize($name) : $name;
		return $this->wordsToUpper($class);
	}
884009
function get_name($class, $function, $name = null)
    {
        $result = false;
        if (isset(Eresus_CMS::getLegacyKernel()->conf['extensions']))
        {
            if (isset(Eresus_CMS::getLegacyKernel()->conf['extensions'][$class]))
            {
                if (isset(Eresus_CMS::getLegacyKernel()->conf['extensions'][$class][$function]))
                {
                    $items = Eresus_CMS::getLegacyKernel()->conf['extensions'][$class][$function];
                    reset($items);
                    $result = isset($items[$name]) ? $name : key($items);
                }
            }
        }

        return $result;
    }
883664
protected function getTable()
	{
		$table = parent::getTable();

		if ($table instanceof SelectQuery) return "(" . $table->get(false) . ")";

		return $table;
	}
698213
private function getClassName($table, $prefix)
    {
        $prefixLen = strlen($prefix);
        if(substr($table, 0, $prefixLen) === $prefix)
        {
            $table = substr($table, $prefixLen);
        }
        return Text::toPascalName($table);
    }
339439
public function getTableName($addTablePrefix = false, $addDbName = false)
    {
        if (is_null($this->table)) {
            $tmp = get_class($this);
            $this->table = strtolower(substr($tmp, strrpos($tmp, '\\') + 1, -5));
        }

        $dbName = $addDbName ? Config::get($this->getDbConf() . '.master.dbname') . '.' : '';

        if ($addTablePrefix) {
            $tablePrefix = $this->tablePrefix;
            $tablePrefix || $tablePrefix = Config::get($this->getDbConf() . '.master.tableprefix');
            return $dbName . $tablePrefix . $this->table;
        }
        return $dbName . $this->table;
    }
179976
private static <T> String getTableName(Class<T> clazz) {
		
		Table tableAnno = clazz.getAnnotation(Table.class);
		if(tableAnno != null){
			if(tableAnno.catalog() != null){
				return tableAnno.catalog() + "." + tableAnno.name();
			}
			return tableAnno.name();
		}
		//if Table annotation is null
		String className = clazz.getName();
		return IdUtils.toUnderscore(className.substring(className.lastIndexOf(".")+1));
	}
1137453
public function getTableName() {
        if(empty($this->trueTableName)) {
            $tableName  = !empty($this->tablePrefix) ? $this->tablePrefix : '';
            if(!empty($this->tableName)) {
                $tableName .= $this->tableName;
            }else{
                $tableName .= parse_name($this->name);
            }
            $this->trueTableName    =   strtolower($tableName);
        }
        return (!empty($this->dbName)?$this->dbName.'.':'').$this->trueTableName;
    }
1260139
private function determineTableName()
    {
        $annotations = $this->inspector->getClassAnnotations();
        $name = self::parseTableName($this->entity);
        if ($annotations->hasAnnotation('@table')) {
            $name = $annotations->getAnnotation('@table')->getValue();
        }
        return $name;
    }
416218
public String classToTableName(String className) {
    String tableName = null;
    try {
      tableName = tableNamingStrategy.classToTableName(Class.forName(className));
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }
    if (tableName.length() > MaxLength) logger.warn("{}'s length greate than 30!", tableName);
    logger.debug("Mapping entity[{}] to {}", className, tableName);
    return tableName;
  }
778416
protected static function buildTableName($suffix = '')
    {
        if (true === empty(static::$tablePrefix)) {
            if (strpos(static::tableName(), '}}') !== false) {
                $name = str_replace('}}', $suffix . '}}', static::tableName());
            } else {
                $name = static::tableName() . $suffix;
            }
        } else {
            $name = static::$tablePrefix . $suffix;
        }
        return $name;
    }
177083
private TableAlias createTableAlias(ClassDescriptor aCld, String aPath, String aUserAlias, List hints)
    {
		if (aUserAlias == null)
		{
			return createTableAlias(aCld, hints, aPath);
		}
		else
		{
			return createTableAlias(aCld, hints, aUserAlias + ALIAS_SEPARATOR + aPath);
		}
    }
89592
public static function table($table, $isQuery = false) {
        $new_self = new self();
        
        if ($isQuery) {
            $new_self->_table = '(' . $table . ')';
        } else {
            $new_self->_table = $table;
        }

        return $new_self;
    }
1354806
public static String mangleClass(Class cl, boolean isFull)
    {
        String name = cl.getName();

        if (name.equals("boolean") || name.equals("java.lang.Boolean"))
            return "boolean";
        else if (name.equals("int") || name.equals("java.lang.Integer")
            || name.equals("short") || name.equals("java.lang.Short")
            || name.equals("byte") || name.equals("java.lang.Byte"))
            return "int";
        else if (name.equals("long") || name.equals("java.lang.Long"))
            return "long";
        else if (name.equals("float") || name.equals("java.lang.Float")
            || name.equals("double") || name.equals("java.lang.Double"))
            return "double";
        else if (name.equals("java.lang.String")
            || name.equals("com.caucho.util.CharBuffer")
            || name.equals("char") || name.equals("java.lang.Character")
            || name.equals("java.io.Reader"))
            return "string";
        else if (name.equals("java.util.Date")
            || name.equals("com.caucho.util.QDate"))
            return "date";
        else if (InputStream.class.isAssignableFrom(cl)
            || name.equals("[B"))
            return "binary";
        else if (cl.isArray()) {
            return "[" + mangleClass(cl.getComponentType(), isFull);
        }
        else if (name.equals("org.w3c.dom.Node")
            || name.equals("org.w3c.dom.Element")
            || name.equals("org.w3c.dom.Document"))
            return "xml";
        else if (isFull)
            return name;
        else {
            int p = name.lastIndexOf('.');
            if (p > 0)
                return name.substring(p + 1);
            else
                return name;
        }
    }
211991
protected function generateClassName($tableName)
    {
        if (isset($this->_classNames[$tableName])) {
            return $this->_classNames[$tableName];
        }

        if (($pos = strrpos($tableName, '.')) !== false) {
            $tableName = substr($tableName, $pos + 1);
        }

        $db = $this->getDbConnection();
        $patterns = [];
        $patterns[] = "/^{$db->tablePrefix}(.*?)$/";
        $patterns[] = "/^(.*?){$db->tablePrefix}$/";
        if (strpos($this->tableName, '*') !== false) {
            $pattern = $this->tableName;
            if (($pos = strrpos($pattern, '.')) !== false) {
                $pattern = substr($pattern, $pos + 1);
            }
            $patterns[] = '/^' . str_replace('*', '(\w+)', $pattern) . '$/';
        }
        $className = $tableName;
        foreach ($patterns as $pattern) {
            if (preg_match($pattern, $tableName, $matches)) {
                $className = $matches[1];
                break;
            }
        }

        return $this->_classNames[$tableName] = Inflector::id2camel($className, '_');
    }
1344707
function name( $lang = false )
    {
        if ( $this->VersionName !== null )
            return $this->VersionName;
        $this->VersionName = $this->attribute( 'contentobject' )->versionLanguageName( $this->attribute( 'version' ),
                                                                                       $lang );
        if ( $lang !== false )
        {
            $contentObject = $this->contentObject();
            if ( $contentObject )
            {
                return $contentObject->name( false, $lang );
            }
        }
        if ( $this->VersionName === false )
        {
            $contentObject = $this->contentObject();
            if ( $contentObject )
            {
                $this->VersionName = $contentObject->name( false, $lang );
            }
        }
        return $this->VersionName;
    }
697163
public function get_table_definition( $table_name ){
		$tabel_definition = @$this->table_definition->tables->{$table_name};
		return ($tabel_definition ? $tabel_definition : false);
	}
1096588
public function table_simple_name($table, $escaped=false)
  {
    if ( \is_string($table) && ($table = trim($table)) ){
      $mtable = explode(".", str_replace("`", "", $table));
      switch ( \count($mtable) ){
        case 1:
          $table = $mtable[0];
          break;
        case 2:
          $table = $mtable[1];
          break;
        case 3:
          $table = $mtable[1];
          break;
      }
      if ( bbn\str::check_name($table) ){
        return $escaped ? "`".$table."`" : $table;
      }
    }
		return false;
  }