Code Duplication    Length = 13-17 lines in 3 locations

src/MySql/AuditDataLayer.php 3 locations

@@ 293-309 (lines=17) @@
290
   *
291
   * @return \array[]
292
   */
293
  public static function getTableColumns($schemaName, $tableName)
294
  {
295
    $sql = sprintf('
296
select COLUMN_NAME        as column_name
297
,      COLUMN_TYPE        as column_type
298
,      IS_NULLABLE        as is_nullable
299
,      CHARACTER_SET_NAME as character_set_name
300
,      COLLATION_NAME     as collation_name
301
from   information_schema.COLUMNS
302
where  TABLE_SCHEMA = %s
303
and    TABLE_NAME   = %s
304
order by ORDINAL_POSITION',
305
                   self::$dl->quoteString($schemaName),
306
                   self::$dl->quoteString($tableName));
307
308
    return self::executeRows($sql);
309
  }
310
311
  //--------------------------------------------------------------------------------------------------------------------
312
  /**
@@ 320-334 (lines=15) @@
317
   *
318
   * @return array
319
   */
320
  public static function getTableOptions($schemaName, $tableName)
321
  {
322
    $sql = sprintf('
323
SELECT t1.TABLE_COLLATION    as table_collation
324
,      t1.ENGINE             as engine
325
,      t2.CHARACTER_SET_NAME as character_set_name
326
FROM       information_schema.TABLES                                t1
327
inner join information_schema.COLLATION_CHARACTER_SET_APPLICABILITY t2  on  t2.COLLATION_NAME = t1.TABLE_COLLATION
328
WHERE t1.TABLE_SCHEMA = %s
329
AND   t1.TABLE_NAME   = %s',
330
                   self::$dl->quoteString($schemaName),
331
                   self::$dl->quoteString($tableName));
332
333
    return self::executeRow1($sql);
334
  }
335
336
  //--------------------------------------------------------------------------------------------------------------------
337
  /**
@@ 345-357 (lines=13) @@
342
   *
343
   * @return \array[]
344
   */
345
  public static function getTableTriggers($schemaName, $tableName)
346
  {
347
    $sql = sprintf('
348
select TRIGGER_NAME as trigger_name
349
from   information_schema.TRIGGERS
350
where  TRIGGER_SCHEMA     = %s
351
and    EVENT_OBJECT_TABLE = %s
352
order by Trigger_Name',
353
                   self::$dl->quoteString($schemaName),
354
                   self::$dl->quoteString($tableName));
355
356
    return self::executeRows($sql);
357
  }
358
359
  //--------------------------------------------------------------------------------------------------------------------
360
  /**