Code Duplication    Length = 10-10 lines in 2 locations

src/Entity.php 2 locations

@@ 85-94 (lines=10) @@
82
     * @param string $navigationID Navigation identifier
83
     * @return self[] Collection of entity instances
84
     */
85
    public function byNavigationID($navigationID)
86
    {
87
        $return = array();
88
        /** @var array $materialIds Collection of entity identifiers filtered by additional field */
89
        if (sizeof($materialIds = $this->idsByNavigationID($navigationID))) {
90
            $return = $this->byIDs($materialIds);
91
        }
92
93
        return $return;
94
    }
95
96
    /**
97
     * Get current entity instances amount by navigation identifier.
@@ 102-111 (lines=10) @@
99
     * @param string $navigationID Navigation identifier
100
     * @return integer Amount of entities related to Navigation identifier
101
     */
102
    public function amountByNavigationID($navigationID)
103
    {
104
        $return =0;
105
        /** @var array $materialIds Collection of entity identifiers filtered by additional field */
106
        if (sizeof($materialIds = $this->idsByNavigationID($navigationID))) {
107
            $return = $this->byIDs($materialIds, 'count');
108
        }
109
110
        return $return;
111
    }
112
}
113