protected function _getSchemaForModel($modelName = null) {
		if (empty($modelName)) {
			return null;
		}

		$modelName = (string)$modelName;
		$cached = $this->_getSchemaCache($modelName);
		if ($cached !== null) {
			return $cached;
		}

		$modelObj = ClassRegistry::init($modelName, true);
		if ($modelObj === false) {
			return null;
		}

		$defaultSchema = [
			'type' => 'string',
			'null' => false,
			'default' => null,
			'length' => null,
		];
		$result = $modelObj->schema();
		$virtualFields = $modelObj->getVirtualField();
		if (!empty($result) && !empty($virtualFields)) {
			foreach ($virtualFields as $virtualFieldName => $virtualFieldValue) {
				$result[$virtualFieldName] = $defaultSchema;
			}
		}
		$this->_setSchemaCache($modelName, $result);

		return $result;
	}
protected function _getSchemaForModel($modelName = null) {
		if (empty($modelName)) {
			return null;
		}

		$modelName = (string)$modelName;
		$cached = $this->_getSchemaCache($modelName);
		if ($cached !== null) {
			return $cached;
		}

		$modelObj = ClassRegistry::init($modelName, true);
		if ($modelObj === false) {
			return null;
		}

		$defaultSchema = [
			'type' => 'string',
			'null' => false,
			'default' => null,
			'length' => null,
		];
		$result = $modelObj->schema();
		$virtualFields = $modelObj->getVirtualField();
		if (!empty($result) && !empty($virtualFields)) {
			foreach ($virtualFields as $virtualFieldName => $virtualFieldValue) {
				$result[$virtualFieldName] = $defaultSchema;
			}
		}
		$this->_setSchemaCache($modelName, $result);

		return $result;
	}
protected function _getSchemaForModel ( $ modelName = null ) { if ( empty ( $ modelName ) ) { return null ; } $ modelName = ( string ) $ modelName ; $ cached = $ this -> _getSchemaCache ( $ modelName ) ; if ( $ cached !== null ) { return $ cached ; } $ modelObj = ClassRegistry :: init ( $ modelName , true ) ; if ( $ modelObj === false ) { return null ; } $ defaultSchema = [ 'type' => 'string' , 'null' => false , 'default' => null , 'length' => null , ] ; $ result = $ modelObj -> schema ( ) ; $ virtualFields = $ modelObj -> getVirtualField ( ) ; if ( ! empty ( $ result ) && ! empty ( $ virtualFields ) ) { foreach ( $ virtualFields as $ virtualFieldName => $ virtualFieldValue ) { $ result [ $ virtualFieldName ] = $ defaultSchema ; } } $ this -> _setSchemaCache ( $ modelName , $ result ) ; return $ result ; }
Get schema information of model

@param string $modelName Model name
@return array|null Array of database table metadata.
Null on failure.
Get schema information of model