Code Duplication    Length = 36-36 lines in 2 locations

src/Repositories/CoreConfigDataRepository.php 1 location

@@ 32-67 (lines=36) @@
29
 * @link      https://github.com/techdivision/import
30
 * @link      http://www.techdivision.com
31
 */
32
class CoreConfigDataRepository extends AbstractRepository
33
{
34
35
    /**
36
     * The statement to load the configuration.
37
     *
38
     * @var \PDOStatement
39
     */
40
    protected $coreConfigDataStmt;
41
42
    /**
43
     * Initializes the repository's prepared statements.
44
     *
45
     * @return void
46
     */
47
    public function init()
48
    {
49
50
        // load the utility class name
51
        $utilityClassName = $this->getUtilityClassName();
52
53
        // initialize the prepared statements
54
        $this->coreConfigDataStmt = $this->getConnection()->prepare($utilityClassName::CORE_CONFIG_DATA);
55
    }
56
57
    /**
58
     * Return's an array with the Magento 2 configuration.
59
     *
60
     * @return array The configuration
61
     */
62
    public function findAll()
63
    {
64
        $this->coreConfigDataStmt->execute();
65
        return $this->coreConfigDataStmt->fetchAll(\PDO::FETCH_ASSOC);
66
    }
67
}
68

src/Repositories/LinkAttributeRepository.php 1 location

@@ 32-67 (lines=36) @@
29
 * @link      https://github.com/techdivision/import
30
 * @link      http://www.techdivision.com
31
 */
32
class LinkAttributeRepository extends AbstractRepository
33
{
34
35
    /**
36
     * The statement to load the available link attributes.
37
     *
38
     * @var \PDOStatement
39
     */
40
    protected $linkAttributesStmt;
41
42
    /**
43
     * Initializes the repository's prepared statements.
44
     *
45
     * @return void
46
     */
47
    public function init()
48
    {
49
50
        // load the utility class name
51
        $utilityClassName = $this->getUtilityClassName();
52
53
        // initialize the prepared statements
54
        $this->linkAttributesStmt = $this->getConnection()->prepare($utilityClassName::LINK_ATTRIBUTES);
55
    }
56
57
    /**
58
     * Return's an array with all available link attributes.
59
     *
60
     * @return array The available link attributes
61
     */
62
    public function findAll()
63
    {
64
        $this->linkAttributesStmt->execute();
65
        return $this->linkAttributesStmt->fetchAll(\PDO::FETCH_ASSOC);
66
    }
67
}
68