Code Duplication    Length = 13-17 lines in 3 locations

src/MySql/AuditDataLayer.php 3 locations

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