| Total Complexity | 43 |
| Total Lines | 419 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
Complex classes like DbSqlSessionFactory often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use DbSqlSessionFactory, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 15 | class DbSqlSessionFactory implements SessionFactoryInterface |
||
| 16 | { |
||
| 17 | public const POSTGRES = "postgres"; |
||
| 18 | |||
| 19 | public const SUPPORTED_DATABASES = [ self::POSTGRES ]; |
||
| 20 | |||
| 21 | protected static $databaseSpecificStatements = []; |
||
| 22 | |||
| 23 | public static $databaseSpecificLimitBeforeStatements = []; |
||
| 24 | public static $databaseSpecificLimitAfterStatements = []; |
||
| 25 | //limit statements that can be used to select first N rows without OFFSET |
||
| 26 | public static $databaseSpecificLimitBeforeWithoutOffsetStatements = []; |
||
| 27 | public static $databaseSpecificLimitAfterWithoutOffsetStatements = []; |
||
| 28 | // limitAfter statements that can be used with subqueries |
||
| 29 | public static $databaseSpecificInnerLimitAfterStatements = []; |
||
| 30 | public static $databaseSpecificLimitBetweenStatements = []; |
||
| 31 | public static $databaseSpecificLimitBetweenFilterStatements = []; |
||
| 32 | public static $databaseSpecificLimitBetweenAcquisitionStatements = []; |
||
| 33 | // count distinct statements |
||
| 34 | public static $databaseSpecificCountDistinctBeforeStart = []; |
||
| 35 | public static $databaseSpecificCountDistinctBeforeEnd = []; |
||
| 36 | public static $databaseSpecificCountDistinctAfterEnd = []; |
||
| 37 | |||
| 38 | public static $optimizeDatabaseSpecificLimitBeforeWithoutOffsetStatements = []; |
||
| 39 | public static $optimizeDatabaseSpecificLimitAfterWithoutOffsetStatements = []; |
||
| 40 | |||
| 41 | public static $databaseSpecificEscapeChar = []; |
||
| 42 | public static $databaseSpecificOrderByStatements = []; |
||
| 43 | public static $databaseSpecificLimitBeforeNativeQueryStatements = []; |
||
| 44 | public static $databaseSpecificBitAnd1 = []; |
||
| 45 | public static $databaseSpecificBitAnd2 = []; |
||
| 46 | public static $databaseSpecificBitAnd3 = []; |
||
| 47 | |||
| 48 | public static $databaseSpecificDatepart1 = []; |
||
| 49 | public static $databaseSpecificDatepart2 = []; |
||
| 50 | public static $databaseSpecificDatepart3 = []; |
||
| 51 | |||
| 52 | public static $databaseSpecificDummyTable = []; |
||
| 53 | |||
| 54 | public static $databaseSpecificIfNull = []; |
||
| 55 | |||
| 56 | public static $databaseSpecificTrueConstant = []; |
||
| 57 | public static $databaseSpecificFalseConstant = []; |
||
| 58 | |||
| 59 | public static $databaseSpecificDistinct = []; |
||
| 60 | |||
| 61 | public static $databaseSpecificNumericCast = []; |
||
| 62 | |||
| 63 | public static $dbSpecificConstants = []; |
||
| 64 | |||
| 65 | public static $databaseSpecificDaysComparator = []; |
||
| 66 | |||
| 67 | public static $databaseSpecificCollationForCaseSensitivity = []; |
||
| 68 | |||
| 69 | public static $databaseSpecificAuthJoinStart = []; |
||
| 70 | public static $databaseSpecificAuthJoinEnd = []; |
||
| 71 | public static $databaseSpecificAuthJoinSeparator = []; |
||
| 72 | |||
| 73 | public static $databaseSpecificAuth1JoinStart = []; |
||
| 74 | public static $databaseSpecificAuth1JoinEnd = []; |
||
| 75 | public static $databaseSpecificAuth1JoinSeparator = []; |
||
| 76 | |||
| 77 | private static $initialized = false; |
||
| 78 | |||
| 79 | /* |
||
| 80 | * On SQL server, the overall maximum number of parameters in a prepared statement |
||
| 81 | * is 2100. |
||
| 82 | */ |
||
| 83 | public const MAXIMUM_NUMBER_PARAMS = 2000; |
||
| 84 | |||
| 85 | public static $defaultOrderBy = 'order by ${internalOrderBy}'; |
||
| 86 | |||
| 87 | public static $defaultEscapeChar = "'\\'"; |
||
| 88 | |||
| 89 | public static $defaultDistinctCountBeforeStart = "select count(distinct"; |
||
| 90 | public static $defaultDistinctCountBeforeEnd = ")"; |
||
| 91 | public static $defaultDistinctCountAfterEnd = ""; |
||
| 92 | |||
| 93 | public static $defaultAuthOnStart = "IN ("; |
||
| 94 | public static $defaultAuthOnEnd = ")"; |
||
| 95 | public static $defaultAuthOnSeparator = ","; |
||
| 96 | |||
| 97 | protected $databaseType; |
||
| 98 | protected $databaseTablePrefix = ""; |
||
| 99 | protected $databaseSchema; |
||
| 100 | protected $sqlSessionFactory; |
||
| 101 | protected $idGenerator; |
||
| 102 | protected $statementMappings = []; |
||
| 103 | protected $insertStatements = []; |
||
| 104 | protected $updateStatements = []; |
||
| 105 | protected $deleteStatements = []; |
||
| 106 | protected $selectStatements = []; |
||
| 107 | protected $isDbIdentityUsed = true; |
||
| 108 | protected $isDbHistoryUsed = true; |
||
| 109 | protected $cmmnEnabled = false; |
||
| 110 | protected $dmnEnabled = false; |
||
| 111 | |||
| 112 | protected $batchProcessing; |
||
| 113 | |||
| 114 | public function __construct(bool $batchProcessing = false) |
||
| 115 | { |
||
| 116 | self::init(); |
||
| 117 | $this->batchProcessing = $batchProcessing; |
||
| 118 | } |
||
| 119 | |||
| 120 | private static function init(): void |
||
| 121 | { |
||
| 122 | if (self::$initialized == false) { |
||
|
|
|||
| 123 | self::$initialized = true; |
||
| 124 | self::$databaseSpecificLimitBeforeStatements[self::POSTGRES] = ""; |
||
| 125 | self::$optimizeDatabaseSpecificLimitBeforeWithoutOffsetStatements[self::POSTGRES] = ""; |
||
| 126 | self::$databaseSpecificLimitAfterStatements[self::POSTGRES] = "LIMIT #{maxResults} OFFSET #{firstResult}"; |
||
| 127 | self::$optimizeDatabaseSpecificLimitAfterWithoutOffsetStatements[self::POSTGRES] = "LIMIT #{maxResults}"; |
||
| 128 | self::$databaseSpecificLimitBeforeWithoutOffsetStatements[self::POSTGRES] = ""; |
||
| 129 | self::$databaseSpecificLimitAfterWithoutOffsetStatements[self::POSTGRES] = "LIMIT #{maxResults}"; |
||
| 130 | self::$databaseSpecificInnerLimitAfterStatements[self::POSTGRES] = self::$databaseSpecificLimitAfterStatements[self::POSTGRES]; |
||
| 131 | self::$databaseSpecificLimitBetweenStatements[self::POSTGRES] = ""; |
||
| 132 | self::$databaseSpecificLimitBetweenFilterStatements[self::POSTGRES] = ""; |
||
| 133 | self::$databaseSpecificLimitBetweenAcquisitionStatements[self::POSTGRES] = ""; |
||
| 134 | self::$databaseSpecificOrderByStatements[self::POSTGRES] = self::$defaultOrderBy; |
||
| 135 | self::$databaseSpecificLimitBeforeNativeQueryStatements[self::POSTGRES] = ""; |
||
| 136 | self::$databaseSpecificDistinct[self::POSTGRES] = "distinct"; |
||
| 137 | |||
| 138 | self::$databaseSpecificCountDistinctBeforeStart[self::POSTGRES] = 'SELECT COUNT(*) FROM (SELECT DISTINCT'; |
||
| 139 | self::$databaseSpecificCountDistinctBeforeEnd[self::POSTGRES] = ""; |
||
| 140 | self::$databaseSpecificCountDistinctAfterEnd[self::POSTGRES] = ") countDistinct"; |
||
| 141 | |||
| 142 | self::$databaseSpecificEscapeChar[self::POSTGRES] = self::$defaultEscapeChar; |
||
| 143 | |||
| 144 | self::$databaseSpecificBitAnd1[self::POSTGRES] = ""; |
||
| 145 | self::$databaseSpecificBitAnd2[self::POSTGRES] = " & "; |
||
| 146 | self::$databaseSpecificBitAnd3[self::POSTGRES] = ""; |
||
| 147 | self::$databaseSpecificDatepart1[self::POSTGRES] = "extract("; |
||
| 148 | self::$databaseSpecificDatepart2[self::POSTGRES] = " from "; |
||
| 149 | self::$databaseSpecificDatepart3[self::POSTGRES] = ")"; |
||
| 150 | |||
| 151 | self::$databaseSpecificDummyTable[self::POSTGRES] = ""; |
||
| 152 | self::$databaseSpecificTrueConstant[self::POSTGRES] = "true"; |
||
| 153 | self::$databaseSpecificFalseConstant[self::POSTGRES] = "false"; |
||
| 154 | self::$databaseSpecificIfNull[self::POSTGRES] = "COALESCE"; |
||
| 155 | |||
| 156 | self::$databaseSpecificCollationForCaseSensitivity[self::POSTGRES] = ""; |
||
| 157 | self::$databaseSpecificAuthJoinStart[self::POSTGRES] = self::$defaultAuthOnStart; |
||
| 158 | self::$databaseSpecificAuthJoinEnd[self::POSTGRES] = self::$defaultAuthOnEnd; |
||
| 159 | self::$databaseSpecificAuthJoinSeparator[self::POSTGRES] = self::$defaultAuthOnSeparator; |
||
| 160 | self::$databaseSpecificAuth1JoinStart[self::POSTGRES] = self::$defaultAuthOnStart; |
||
| 161 | self::$databaseSpecificAuth1JoinEnd[self::POSTGRES] = self::$defaultAuthOnEnd; |
||
| 162 | self::$databaseSpecificAuth1JoinSeparator[self::POSTGRES] = self::$defaultAuthOnSeparator; |
||
| 163 | |||
| 164 | self::addDatabaseSpecificStatement(self::POSTGRES, "insertByteArray", "insertByteArray_postgres"); |
||
| 165 | self::addDatabaseSpecificStatement(self::POSTGRES, "updateByteArray", "updateByteArray_postgres"); |
||
| 166 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectByteArray", "selectByteArray_postgres"); |
||
| 167 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectByteArrays", "selectByteArrays_postgres"); |
||
| 168 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectResourceByDeploymentIdAndResourceName", "selectResourceByDeploymentIdAndResourceName_postgres"); |
||
| 169 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectResourceByDeploymentIdAndResourceNames", "selectResourceByDeploymentIdAndResourceNames_postgres"); |
||
| 170 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectResourceByDeploymentIdAndResourceId", "selectResourceByDeploymentIdAndResourceId_postgres"); |
||
| 171 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectResourceByDeploymentIdAndResourceIds", "selectResourceByDeploymentIdAndResourceIds_postgres"); |
||
| 172 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectResourcesByDeploymentId", "selectResourcesByDeploymentId_postgres"); |
||
| 173 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectResourceById", "selectResourceById_postgres"); |
||
| 174 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectLatestResourcesByDeploymentName", "selectLatestResourcesByDeploymentName_postgres"); |
||
| 175 | self::addDatabaseSpecificStatement(self::POSTGRES, "insertIdentityInfo", "insertIdentityInfo_postgres"); |
||
| 176 | self::addDatabaseSpecificStatement(self::POSTGRES, "updateIdentityInfo", "updateIdentityInfo_postgres"); |
||
| 177 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectIdentityInfoById", "selectIdentityInfoById_postgres"); |
||
| 178 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectIdentityInfoByUserIdAndKey", "selectIdentityInfoByUserIdAndKey_postgres"); |
||
| 179 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectIdentityInfoByUserId", "selectIdentityInfoByUserId_postgres"); |
||
| 180 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectIdentityInfoDetails", "selectIdentityInfoDetails_postgres"); |
||
| 181 | self::addDatabaseSpecificStatement(self::POSTGRES, "insertComment", "insertComment_postgres"); |
||
| 182 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectCommentsByTaskId", "selectCommentsByTaskId_postgres"); |
||
| 183 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectCommentsByProcessInstanceId", "selectCommentsByProcessInstanceId_postgres"); |
||
| 184 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectCommentByTaskIdAndCommentId", "selectCommentByTaskIdAndCommentId_postgres"); |
||
| 185 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectEventsByTaskId", "selectEventsByTaskId_postgres"); |
||
| 186 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectFilterByQueryCriteria", "selectFilterByQueryCriteria_postgres"); |
||
| 187 | self::addDatabaseSpecificStatement(self::POSTGRES, "selectFilter", "selectFilter_postgres"); |
||
| 188 | |||
| 189 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteAttachmentsByRemovalTime", "deleteAttachmentsByRemovalTime_postgres_or_db2"); |
||
| 190 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteCommentsByRemovalTime", "deleteCommentsByRemovalTime_postgres_or_db2"); |
||
| 191 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricActivityInstancesByRemovalTime", "deleteHistoricActivityInstancesByRemovalTime_postgres_or_db2"); |
||
| 192 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricDecisionInputInstancesByRemovalTime", "deleteHistoricDecisionInputInstancesByRemovalTime_postgres_or_db2"); |
||
| 193 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricDecisionInstancesByRemovalTime", "deleteHistoricDecisionInstancesByRemovalTime_postgres_or_db2"); |
||
| 194 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricDecisionOutputInstancesByRemovalTime", "deleteHistoricDecisionOutputInstancesByRemovalTime_postgres_or_db2"); |
||
| 195 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricDetailsByRemovalTime", "deleteHistoricDetailsByRemovalTime_postgres_or_db2"); |
||
| 196 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteExternalTaskLogByRemovalTime", "deleteExternalTaskLogByRemovalTime_postgres_or_db2"); |
||
| 197 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricIdentityLinkLogByRemovalTime", "deleteHistoricIdentityLinkLogByRemovalTime_postgres_or_db2"); |
||
| 198 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricIncidentsByRemovalTime", "deleteHistoricIncidentsByRemovalTime_postgres_or_db2"); |
||
| 199 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteJobLogByRemovalTime", "deleteJobLogByRemovalTime_postgres_or_db2"); |
||
| 200 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricProcessInstancesByRemovalTime", "deleteHistoricProcessInstancesByRemovalTime_postgres_or_db2"); |
||
| 201 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricTaskInstancesByRemovalTime", "deleteHistoricTaskInstancesByRemovalTime_postgres_or_db2"); |
||
| 202 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricVariableInstancesByRemovalTime", "deleteHistoricVariableInstancesByRemovalTime_postgres_or_db2"); |
||
| 203 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteUserOperationLogByRemovalTime", "deleteUserOperationLogByRemovalTime_postgres_or_db2"); |
||
| 204 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteByteArraysByRemovalTime", "deleteByteArraysByRemovalTime_postgres_or_db2"); |
||
| 205 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteHistoricBatchesByRemovalTime", "deleteHistoricBatchesByRemovalTime_postgres_or_db2"); |
||
| 206 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteAuthorizationsByRemovalTime", "deleteAuthorizationsByRemovalTime_postgres_or_db2"); |
||
| 207 | self::addDatabaseSpecificStatement(self::POSTGRES, "deleteTaskMetricsByRemovalTime", "deleteTaskMetricsByRemovalTime_postgres_or_db2"); |
||
| 208 | |||
| 209 | $constants = []; |
||
| 210 | $constants["constant.event"] = "'event'"; |
||
| 211 | $constants["constant.op_message"] = "NEW_VALUE_ || '_|_' || PROPERTY_"; |
||
| 212 | $constants["constant_for_update"] = "for update"; |
||
| 213 | $constants["constant.datepart.quarter"] = "QUARTER"; |
||
| 214 | $constants["constant.datepart.month"] = "MONTH"; |
||
| 215 | $constants["constant.datepart.minute"] = "MINUTE"; |
||
| 216 | $constants["constant.null.startTime"] = "null START_TIME_"; |
||
| 217 | $constants["constant.varchar.cast"] = 'cast(\'${key}\' as varchar(64))'; |
||
| 218 | $constants["constant.integer.cast"] = "cast(NULL as integer)"; |
||
| 219 | $constants["constant.null.reporter"] = "CAST(NULL AS VARCHAR) AS REPORTER_"; |
||
| 220 | self::$dbSpecificConstants[self::POSTGRES] = $constants; |
||
| 221 | |||
| 222 | self::$databaseSpecificDaysComparator[self::POSTGRES] = 'EXTRACT (DAY FROM #{currentTimestamp} - ${date}) >= ${days}'; |
||
| 223 | self::$databaseSpecificNumericCast[self::POSTGRES] = ""; |
||
| 224 | } |
||
| 225 | } |
||
| 226 | |||
| 227 | public function getSessionType(): string |
||
| 228 | { |
||
| 229 | return DbSqlSession::class; |
||
| 230 | } |
||
| 231 | |||
| 232 | public function openSession(Connection $connection = null, string $catalog = null, string $schema = null): SessionInterface |
||
| 233 | { |
||
| 234 | return $this->batchProcessing ? |
||
| 235 | new BatchDbSqlSession($this, $connection, $catalog, $schema) : |
||
| 236 | new SimpleDbSqlSession($this, $connection, $catalog, $schema); |
||
| 237 | } |
||
| 238 | |||
| 239 | // insert, update and delete statements ///////////////////////////////////// |
||
| 240 | |||
| 241 | public function getInsertStatement(DbEntityInterface $object): string |
||
| 242 | { |
||
| 243 | return $this->getStatement(get_class($object), $this->insertStatements, "insert"); |
||
| 244 | } |
||
| 245 | |||
| 246 | public function getUpdateStatement(DbEntityInterface $object): string |
||
| 247 | { |
||
| 248 | return $this->getStatement(get_class($object), $this->updateStatements, "update"); |
||
| 249 | } |
||
| 250 | |||
| 251 | public function getDeleteStatement(string $persistentObjectClass): ?string |
||
| 252 | { |
||
| 253 | return $this->getStatement($persistentObjectClass, $this->deleteStatements, "delete"); |
||
| 254 | } |
||
| 255 | |||
| 256 | public function getSelectStatement(string $persistentObjectClass): ?string |
||
| 257 | { |
||
| 258 | return $this->getStatement($persistentObjectClass, $selectStatements, "select"); |
||
| 259 | } |
||
| 260 | |||
| 261 | private function getStatement(string $persistentObjectClass, array &$cachedStatements, string $prefix): ?string |
||
| 262 | { |
||
| 263 | if (array_key_exists($persistentObjectClass, $cachedStatements)) { |
||
| 264 | $statement = $cachedStatements[$persistentObjectClass]; |
||
| 265 | return $statement; |
||
| 266 | } |
||
| 267 | $statement = $prefix . ClassNameUtil::getClassNameWithoutPackage($persistentObjectClass); |
||
| 268 | $statement = substr($statement, 0, strlen($statement) - 6); // "Entity".length() = 6 |
||
| 269 | $cachedStatements[$persistentObjectClass] = $statement; |
||
| 270 | return $statement; |
||
| 271 | } |
||
| 272 | |||
| 273 | // db specific mappings ///////////////////////////////////////////////////// |
||
| 274 | |||
| 275 | protected static function addDatabaseSpecificStatement(string $databaseType, string $activitiStatement, string $doctrineStatement): void |
||
| 276 | { |
||
| 277 | $specificStatements = array_key_exists($databaseType, self::$databaseSpecificStatements) ? self::$databaseSpecificStatements[$databaseType] : null; |
||
| 278 | if ($specificStatements == null) { |
||
| 279 | $specificStatements = []; |
||
| 280 | self::$databaseSpecificStatements[$databaseType] = [ $doctrineStatement ]; |
||
| 281 | } else { |
||
| 282 | self::$databaseSpecificStatements[$activitiStatement][] = $doctrineStatement; |
||
| 283 | } |
||
| 284 | } |
||
| 285 | |||
| 286 | public function mapStatement(string $statement): ?string |
||
| 287 | { |
||
| 288 | if (empty($this->statementMappings)) { |
||
| 289 | return $statement; |
||
| 290 | } |
||
| 291 | $mappedStatement = array_key_exists($statement, $this->$statementMappings) ? $this->$statementMappings[$statement] : null; |
||
| 292 | return $mappedStatement ?? $statement; |
||
| 293 | } |
||
| 294 | |||
| 295 | // customized getters and setters /////////////////////////////////////////// |
||
| 296 | |||
| 297 | public function setDatabaseType(string $databaseType): void |
||
| 298 | { |
||
| 299 | $this->databaseType = $databaseType; |
||
| 300 | $this->statementMappings = array_key_exists($databaseType, self::$databaseSpecificStatements) ? self::$databaseSpecificStatements[$databaseType] : []; |
||
| 301 | } |
||
| 302 | |||
| 303 | // getters and setters ////////////////////////////////////////////////////// |
||
| 304 | |||
| 305 | public function getSqlSessionFactory(): SqlSessionFactoryInterface |
||
| 306 | { |
||
| 307 | return $this->sqlSessionFactory; |
||
| 308 | } |
||
| 309 | |||
| 310 | public function setSqlSessionFactory(SqlSessionFactoryInterface $sqlSessionFactory): void |
||
| 311 | { |
||
| 312 | $this->sqlSessionFactory = $sqlSessionFactory; |
||
| 313 | } |
||
| 314 | |||
| 315 | public function getIdGenerator(): IdGeneratorInterface |
||
| 316 | { |
||
| 317 | return $this->idGenerator; |
||
| 318 | } |
||
| 319 | |||
| 320 | public function setIdGenerator(IdGeneratorInterface $idGenerator): void |
||
| 321 | { |
||
| 322 | $this->idGenerator = $idGenerator; |
||
| 323 | } |
||
| 324 | |||
| 325 | public function getDatabaseType(): string |
||
| 326 | { |
||
| 327 | return $this->databaseType; |
||
| 328 | } |
||
| 329 | |||
| 330 | public function getStatementMappings(): array |
||
| 331 | { |
||
| 332 | return $this->statementMappings; |
||
| 333 | } |
||
| 334 | |||
| 335 | public function setStatementMappings(array $statementMappings): void |
||
| 336 | { |
||
| 337 | $this->statementMappings = $statementMappings; |
||
| 338 | } |
||
| 339 | |||
| 340 | public function getInsertStatements(): array |
||
| 341 | { |
||
| 342 | return $this->insertStatements; |
||
| 343 | } |
||
| 344 | |||
| 345 | public function setInsertStatements(array $insertStatements): void |
||
| 346 | { |
||
| 347 | $this->insertStatements = $insertStatements; |
||
| 348 | } |
||
| 349 | |||
| 350 | public function getUpdateStatements(): array |
||
| 351 | { |
||
| 352 | return $this->updateStatements; |
||
| 353 | } |
||
| 354 | |||
| 355 | public function setUpdateStatements(array $updateStatements): void |
||
| 356 | { |
||
| 357 | $this->updateStatements = $updateStatements; |
||
| 358 | } |
||
| 359 | |||
| 360 | public function getDeleteStatements(): array |
||
| 361 | { |
||
| 362 | return $this->deleteStatements; |
||
| 363 | } |
||
| 364 | |||
| 365 | public function setDeleteStatements(array $deleteStatements): void |
||
| 368 | } |
||
| 369 | |||
| 370 | public function getSelectStatements(): array |
||
| 371 | { |
||
| 372 | return $this->selectStatements; |
||
| 373 | } |
||
| 374 | |||
| 375 | public function setSelectStatements(array $selectStatements): void |
||
| 376 | { |
||
| 377 | $this->selectStatements = $selectStatements; |
||
| 378 | } |
||
| 379 | |||
| 380 | public function isDbIdentityUsed(): bool |
||
| 381 | { |
||
| 382 | return $this->isDbIdentityUsed; |
||
| 383 | } |
||
| 384 | |||
| 385 | public function setDbIdentityUsed(bool $isDbIdentityUsed): void |
||
| 386 | { |
||
| 387 | $this->isDbIdentityUsed = $isDbIdentityUsed; |
||
| 388 | } |
||
| 389 | |||
| 390 | public function isDbHistoryUsed(): bool |
||
| 391 | { |
||
| 392 | return $this->isDbHistoryUsed; |
||
| 393 | } |
||
| 394 | |||
| 395 | public function setDbHistoryUsed(bool $isDbHistoryUsed): void |
||
| 396 | { |
||
| 397 | $this->isDbHistoryUsed = $isDbHistoryUsed; |
||
| 398 | } |
||
| 399 | |||
| 400 | /*public boolean isCmmnEnabled() { |
||
| 401 | return cmmnEnabled; |
||
| 402 | } |
||
| 403 | |||
| 404 | public void setCmmnEnabled(boolean cmmnEnabled) { |
||
| 405 | $this->cmmnEnabled = cmmnEnabled; |
||
| 406 | } |
||
| 407 | |||
| 408 | public boolean isDmnEnabled() { |
||
| 409 | return dmnEnabled; |
||
| 410 | } |
||
| 411 | |||
| 412 | public void setDmnEnabled(boolean dmnEnabled) { |
||
| 413 | $this->dmnEnabled = dmnEnabled; |
||
| 414 | }*/ |
||
| 415 | |||
| 416 | public function setDatabaseTablePrefix(string $databaseTablePrefix): void |
||
| 417 | { |
||
| 418 | $this->databaseTablePrefix = $databaseTablePrefix; |
||
| 419 | } |
||
| 420 | |||
| 421 | public function getDatabaseTablePrefix(): string |
||
| 422 | { |
||
| 423 | return $this->databaseTablePrefix; |
||
| 424 | } |
||
| 425 | |||
| 426 | public function getDatabaseSchema(): string |
||
| 429 | } |
||
| 430 | |||
| 431 | public function setDatabaseSchema(string $databaseSchema): void |
||
| 432 | { |
||
| 433 | $this->databaseSchema = $databaseSchema; |
||
| 434 | } |
||
| 435 | } |
||
| 436 |
When comparing two booleans, it is generally considered safer to use the strict comparison operator.