Code Duplication    Length = 20-20 lines in 2 locations

src/Subjects/AbstractSubject.php 2 locations

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