Code Duplication    Length = 20-20 lines in 2 locations

src/Subjects/AbstractSubject.php 2 locations

@@ 363-382 (lines=20) @@
360
     *
361
     * @return array The array with the default column values
362
     */
363
    public function getDefaultColumnValues()
364
    {
365
366
        // initialize the array for the default column values
367
        $defaultColumnValues = array();
368
369
        // load the entity type from the execution context
370
        $entityTypeCode = $this->getExecutionContext()->getEntityTypeCode();
371
372
        // load the column values from the configuration
373
        $columnValues = $this->getConfiguration()->getDefaultValues();
374
375
        // query whether or not default column values for the entity type are available
376
        if (isset($columnValues[$entityTypeCode])) {
377
            $defaultColumnValues = $columnValues[$entityTypeCode];
378
        }
379
380
        // return the default column values
381
        return $defaultColumnValues;
382
    }
383
384
    /**
385
     * Load the default header mappings from the configuration.
@@ 389-408 (lines=20) @@
386
     *
387
     * @return array The array with the default header mappings
388
     */
389
    public function getDefaultHeaderMappings()
390
    {
391
392
        // initialize the array for the default header mappings
393
        $defaultHeaderMappings = array();
394
395
        // load the entity type from the execution context
396
        $entityTypeCode = $this->getExecutionContext()->getEntityTypeCode();
397
398
        // load the header mappings from the configuration
399
        $headerMappings = $this->getConfiguration()->getHeaderMappings();
400
401
        // query whether or not header mappings for the entity type are available
402
        if (isset($headerMappings[$entityTypeCode])) {
403
            $defaultHeaderMappings = $headerMappings[$entityTypeCode];
404
        }
405
406
        // return the default header mappings
407
        return $defaultHeaderMappings;
408
    }
409
410
    /**
411
     * Tries to format the passed value to a valid date with format 'Y-m-d H:i:s'.