Code Duplication    Length = 20-20 lines in 2 locations

src/Subjects/AbstractSubject.php 2 locations

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