framework/cli/commands/shell/ModelCommand.php
protected function generateClassNames($schema,$pattern=null)
	{
		$this->_tables=array();
		foreach($schema->getTableNames() as $name)
		{
			if($pattern===null)
				$this->_tables[$name]=$this->generateClassName($this->removePrefix($name));
			elseif(preg_match($pattern,$name,$matches))
			{
				if(count($matches)>1 && !empty($matches[1]))
					$className=$this->generateClassName($matches[1]);
				else
					$className=$this->generateClassName($matches[0]);
				$this->_tables[$name]=empty($className) ? $name : $className;
			}
		}
	}
protected function generateClassNames($schema,$pattern=null)
	{
		$this->_tables=array();
		foreach($schema->getTableNames() as $name)
		{
			if($pattern===null)
				$this->_tables[$name]=$this->generateClassName($this->removePrefix($name));
			elseif(preg_match($pattern,$name,$matches))
			{
				if(count($matches)>1 && !empty($matches[1]))
					$className=$this->generateClassName($matches[1]);
				else
					$className=$this->generateClassName($matches[0]);
				$this->_tables[$name]=empty($className) ? $name : $className;
			}
		}
	}
protected function generateClassNames ( $ schema , $ pattern = null ) { $ this -> _tables = array ( ) ; foreach ( $ schema -> getTableNames ( ) as $ name ) { if ( $ pattern === null ) $ this -> _tables [ $ name ] = $ this -> generateClassName ( $ this -> removePrefix ( $ name ) ) ; elseif ( preg_match ( $ pattern , $ name , $ matches ) ) { if ( count ( $ matches ) > 1 && ! empty ( $ matches [ 1 ] ) ) $ className = $ this -> generateClassName ( $ matches [ 1 ] ) ; else $ className = $ this -> generateClassName ( $ matches [ 0 ] ) ; $ this -> _tables [ $ name ] = empty ( $ className ) ? $ name : $ className ; } } }
Generates the mapping table between table names and class names.
@param CDbSchema $schema the database schema
@param string $pattern a regular expression that may be used to filter table names
Generates the mapping table between table names and class names .