1010use DreamFactory \Core \Database \Schema \TableSchema ;
1111use DreamFactory \Core \Enums \DbSimpleTypes ;
1212use DreamFactory \Core \SqlDb \Database \Schema \SqlSchema ;
13+ use Arr ;
1314
1415/**
1516 * Schema is the class for retrieving metadata information from an Oracle database.
@@ -306,7 +307,7 @@ protected function loadTableColumns(TableSchema $table)
306307 $ c ->quotedName = $ this ->quoteColumnName ($ c ->name );
307308 $ c ->autoIncrement = array_get_bool ($ column , 'identity_column ' );
308309 $ c ->allowNull = $ column ['nullable ' ] === 'Y ' ;
309- $ c ->isPrimaryKey = strpos (strval (array_get ($ column , 'key ' )), 'P ' ) !== false ;
310+ $ c ->isPrimaryKey = strpos (strval (Arr:: get ($ column , 'key ' )), 'P ' ) !== false ;
310311 $ c ->dbType = $ column ['data_type ' ];
311312 $ c ->precision = intval ($ column ['data_precision ' ]);
312313 $ c ->scale = intval ($ column ['data_scale ' ]);
@@ -327,12 +328,12 @@ protected function loadTableColumns(TableSchema $table)
327328 $ this ->extractLimit ($ c , $ c ->dbType );
328329 $ c ->fixedLength = $ this ->extractFixedLength ($ c ->dbType );
329330 $ c ->supportsMultibyte = $ this ->extractMultiByteSupport ($ c ->dbType );
330- $ collectionType = array_get ($ column , 'collection_type ' );
331+ $ collectionType = Arr:: get ($ column , 'collection_type ' );
331332 switch (strtolower ($ collectionType )) {
332333 case 'table ' :
333334 $ this ->extractType ($ c , 'table ' );
334- $ nestedTable = array_get ($ column , 'nested_table_name ' );
335- $ nestedTableOwner = array_get ($ column , 'nested_table_owner ' );
335+ $ nestedTable = Arr:: get ($ column , 'nested_table_name ' );
336+ $ nestedTableOwner = Arr:: get ($ column , 'nested_table_owner ' );
336337 $ sql = <<<EOD
337338SELECT column_name, data_type, data_precision, data_scale, data_length, nullable, data_default
338339FROM ALL_NESTED_TABLE_COLS
@@ -357,7 +358,7 @@ protected function loadTableColumns(TableSchema $table)
357358 break ;
358359 }
359360 $ this ->extractDefault ($ c , $ column ['data_default ' ]);
360- $ c ->comment = array_get ($ column , 'column_comment ' , '' );
361+ $ c ->comment = Arr:: get ($ column , 'column_comment ' , '' );
361362
362363 if ($ c ->isPrimaryKey ) {
363364 foreach ($ triggers as $ trigger ) {
@@ -389,10 +390,10 @@ protected function loadTableColumns(TableSchema $table)
389390 protected function createColumn ($ column )
390391 {
391392 $ c = new ColumnSchema (['name ' => $ column ['column_name ' ]]);
392- $ c ->autoIncrement = array_get ($ column , 'auto_increment ' , false );
393+ $ c ->autoIncrement = Arr:: get ($ column , 'auto_increment ' , false );
393394 $ c ->quotedName = $ this ->quoteColumnName ($ c ->name );
394395 $ c ->allowNull = $ column ['nullable ' ] === 'Y ' ;
395- $ c ->isPrimaryKey = strpos (strval (array_get ($ column , 'key ' )), 'P ' ) !== false ;
396+ $ c ->isPrimaryKey = strpos (strval (Arr:: get ($ column , 'key ' )), 'P ' ) !== false ;
396397 $ c ->dbType = $ column ['data_type ' ];
397398 $ c ->precision = intval ($ column ['data_precision ' ]);
398399 $ c ->scale = intval ($ column ['data_scale ' ]);
@@ -413,12 +414,12 @@ protected function createColumn($column)
413414 $ this ->extractLimit ($ c , $ c ->dbType );
414415 $ c ->fixedLength = $ this ->extractFixedLength ($ c ->dbType );
415416 $ c ->supportsMultibyte = $ this ->extractMultiByteSupport ($ c ->dbType );
416- $ collectionType = array_get ($ column , 'collection_type ' );
417+ $ collectionType = Arr:: get ($ column , 'collection_type ' );
417418 switch (strtolower ($ collectionType )) {
418419 case 'table ' :
419420 $ this ->extractType ($ c , 'table ' );
420- $ nestedTable = array_get ($ column , 'nested_table_name ' );
421- $ nestedTableOwner = array_get ($ column , 'nested_table_owner ' );
421+ $ nestedTable = Arr:: get ($ column , 'nested_table_name ' );
422+ $ nestedTableOwner = Arr:: get ($ column , 'nested_table_owner ' );
422423 $ sql = <<<EOD
423424SELECT column_name, data_type, data_precision, data_scale, data_length, nullable, data_default
424425FROM ALL_NESTED_TABLE_COLS
@@ -443,7 +444,7 @@ protected function createColumn($column)
443444 break ;
444445 }
445446 $ this ->extractDefault ($ c , $ column ['data_default ' ]);
446- $ c ->comment = array_get ($ column , 'column_comment ' , '' );
447+ $ c ->comment = Arr:: get ($ column , 'column_comment ' , '' );
447448
448449 return $ c ;
449450 }
@@ -477,8 +478,8 @@ protected function getTableConstraints($schema = '')
477478 if ('R ' === $ row ['constraint_type ' ]) {
478479 $ row ['constraint_type ' ] = 'foreign key ' ;
479480 }
480- $ colName = array_get ($ row , 'column_name ' );
481- $ refColName = array_get ($ row , 'referenced_column_name ' );
481+ $ colName = Arr:: get ($ row , 'column_name ' );
482+ $ refColName = Arr:: get ($ row , 'referenced_column_name ' );
482483 if (isset ($ constraints [$ ts ][$ tn ][$ cn ])) {
483484 $ constraints [$ ts ][$ tn ][$ cn ]['column_name ' ] =
484485 array_merge ((array )$ constraints [$ ts ][$ tn ][$ cn ]['column_name ' ], (array )$ colName );
@@ -522,8 +523,8 @@ protected function getTableNames($schema = '')
522523 $ names = [];
523524 foreach ($ rows as $ row ) {
524525 $ row = array_change_key_case ((array )$ row , CASE_UPPER );
525- $ schemaName = array_get ($ row , 'TABLE_SCHEMA ' , '' );
526- $ resourceName = array_get ($ row , 'TABLE_NAME ' , '' );
526+ $ schemaName = Arr:: get ($ row , 'TABLE_SCHEMA ' , '' );
527+ $ resourceName = Arr:: get ($ row , 'TABLE_NAME ' , '' );
527528 $ internalName = $ schemaName . '. ' . $ resourceName ;
528529 $ name = $ resourceName ;
529530 $ quotedName = $ this ->quoteTableName ($ schemaName ) . '. ' . $ this ->quoteTableName ($ resourceName );;
@@ -552,8 +553,8 @@ protected function getViewNames($schema = '')
552553 $ names = [];
553554 foreach ($ rows as $ row ) {
554555 $ row = array_change_key_case ((array )$ row , CASE_UPPER );
555- $ schemaName = array_get ($ row , 'TABLE_SCHEMA ' , '' );
556- $ resourceName = array_get ($ row , 'TABLE_NAME ' , '' );
556+ $ schemaName = Arr:: get ($ row , 'TABLE_SCHEMA ' , '' );
557+ $ resourceName = Arr:: get ($ row , 'TABLE_NAME ' , '' );
557558 $ internalName = $ schemaName . '. ' . $ resourceName ;
558559 $ name = $ resourceName ;
559560 $ quotedName = $ this ->quoteTableName ($ schemaName ) . '. ' . $ this ->quoteTableName ($ resourceName );;
@@ -604,12 +605,12 @@ protected function getRoutineNames($type, $schema = '')
604605 $ names = [];
605606 foreach ($ rows as $ row ) {
606607 $ row = array_change_key_case ((array )$ row , CASE_UPPER );
607- $ resourceName = array_get ($ row , 'OBJECT_NAME ' );
608+ $ resourceName = Arr:: get ($ row , 'OBJECT_NAME ' );
608609 $ schemaName = $ schema ;
609610 $ internalName = $ schemaName . '. ' . $ resourceName ;
610611 $ name = $ resourceName ;
611612 $ quotedName = $ this ->quoteTableName ($ schemaName ) . '. ' . $ this ->quoteTableName ($ resourceName );
612- if (!empty ($ addPackage = array_get ($ row , 'PROCEDURE_NAME ' ))) {
613+ if (!empty ($ addPackage = Arr:: get ($ row , 'PROCEDURE_NAME ' ))) {
613614 $ resourceName .= '. ' . $ addPackage ;
614615 $ name .= '. ' . $ addPackage ;
615616 $ internalName .= '. ' . $ addPackage ;
@@ -645,23 +646,23 @@ protected function loadParameters(RoutineSchema $holder)
645646 $ rows = $ this ->connection ->select ($ sql , $ bindings );
646647 foreach ($ rows as $ row ) {
647648 $ row = array_change_key_case ((array )$ row , CASE_UPPER );
648- $ name = array_get ($ row , 'ARGUMENT_NAME ' );
649- $ pos = intval (array_get ($ row , 'POSITION ' ));
650- $ simpleType = static ::extractSimpleType (array_get ($ row , 'DATA_TYPE ' ));
649+ $ name = Arr:: get ($ row , 'ARGUMENT_NAME ' );
650+ $ pos = intval (Arr:: get ($ row , 'POSITION ' ));
651+ $ simpleType = static ::extractSimpleType (Arr:: get ($ row , 'DATA_TYPE ' ));
651652 if ((0 === $ pos ) || is_null ($ name )) {
652653 $ holder ->returnType = $ simpleType ;
653654 } else {
654655 $ holder ->addParameter (new ParameterSchema ([
655656 'name ' => $ name ,
656657 'position ' => $ pos ,
657- 'param_type ' => str_replace ('/ ' , '' , array_get ($ row , 'IN_OUT ' )),
658+ 'param_type ' => str_replace ('/ ' , '' , Arr:: get ($ row , 'IN_OUT ' )),
658659 'type ' => $ simpleType ,
659- 'db_type ' => array_get ($ row , 'DATA_TYPE ' ),
660- 'length ' => (isset ($ row ['DATA_LENGTH ' ]) ? intval (array_get ($ row , 'DATA_LENGTH ' )) : null ),
661- 'precision ' => (isset ($ row ['DATA_PRECISION ' ]) ? intval (array_get ($ row , 'DATA_PRECISION ' ))
660+ 'db_type ' => Arr:: get ($ row , 'DATA_TYPE ' ),
661+ 'length ' => (isset ($ row ['DATA_LENGTH ' ]) ? intval (Arr:: get ($ row , 'DATA_LENGTH ' )) : null ),
662+ 'precision ' => (isset ($ row ['DATA_PRECISION ' ]) ? intval (Arr:: get ($ row , 'DATA_PRECISION ' ))
662663 : null ),
663- 'scale ' => (isset ($ row ['DATA_SCALE ' ]) ? intval (array_get ($ row , 'DATA_SCALE ' )) : null ),
664- 'default_value ' => array_get ($ row , 'DEFAULT_VALUE ' ),
664+ 'scale ' => (isset ($ row ['DATA_SCALE ' ]) ? intval (Arr:: get ($ row , 'DATA_SCALE ' )) : null ),
665+ 'default_value ' => Arr:: get ($ row , 'DEFAULT_VALUE ' ),
665666 ]
666667 ));
667668 }
@@ -969,7 +970,7 @@ protected function doRoutineBinding($statement, array $paramSchemas, array &$val
969970 foreach ($ paramSchemas as $ key => $ paramSchema ) {
970971 switch ($ paramSchema ->paramType ) {
971972 case 'IN ' :
972- $ this ->bindValue ($ statement , ': ' . $ paramSchema ->name , array_get ($ values , $ key ));
973+ $ this ->bindValue ($ statement , ': ' . $ paramSchema ->name , Arr:: get ($ values , $ key ));
973974 break ;
974975 case 'INOUT ' :
975976 case 'OUT ' :
0 commit comments