protected function generateColumnApplicationType(SystemTableMetaModelLoaderCallContext $callcontext, DataSourceMetaData $datasource, ColumnMetaData $column) { $classcontext = $callcontext->getClassContext($this); if (isset($classcontext->statementExecutionCallback[$datasource->type])) { $statementExecutionCallback = $classcontext->statementExecutionCallback[$datasource->type]; } else { $datasourceQueryHandler = DataSourceQueryFactory::getInstance()->getHandler($datasource->type); $statementExecutionCallback = $datasourceQueryHandler->prepareQueryStatementExecutionCallbackInstance(); $classcontext->statementExecutionCallback[$datasource->type] = $statementExecutionCallback; } $statementExecutionCallback->generateColumnType($column); }
protected function applyPattern(SystemTableMetaModelLoaderCallContext $callcontext, $patterns, $name, $default) { $classcontext = $callcontext->getClassContext($this); if (isset($patterns->exclude)) { if (isset($classcontext->namePatternCache[FALSE][$patterns->exclude][$name])) { $result = $classcontext->namePatternCache[FALSE][$patterns->exclude][$name]; } else { $result = preg_match($patterns->exclude, $name); $classcontext->namePatternCache[FALSE][$patterns->exclude][$name] = $result; } if ($result === FALSE) { // possible error in the expression LogHelper::log_error(t( "Regular expression matching error for '@name' value: @error", array('@name' => $name, '@error' => preg_last_error()))); return FALSE; } elseif ($result == 0) { // the column name does not match the pattern } else { return FALSE; } } if (isset($patterns->include)) { if (isset($classcontext->namePatternCache[TRUE][$patterns->include][$name])) { $result = $classcontext->namePatternCache[TRUE][$patterns->include][$name]; } else { $result = preg_match($patterns->include, $name); $classcontext->namePatternCache[TRUE][$patterns->include][$name] = $result; } if ($result === FALSE) { // possible error in the expression LogHelper::log_error(t( "Regular expression matching error for '@name' value: @error", array('@name' => $name, '@error' => preg_last_error()))); return FALSE; } elseif ($result == 0) { // the column name does not match the pattern return FALSE; } else { return TRUE; } } return $default; }