Code Duplication    Length = 11-11 lines in 2 locations

src/Field.php 1 location

@@ 174-184 (lines=11) @@
171
     * @return bool|self[] True if material entities has been found and $return is passed
172
     *                      or self[] if only two parameters is passed.
173
     */
174
    public static function byIDs(QueryInterface $query, $fieldIDs, &$return = array(), $executor = 'exec')
175
    {
176
        $return = $query->entity(get_called_class())
177
            ->where('FieldID', $fieldIDs)
178
            ->where('Active', 1)
179
            ->orderBy('priority')
180
            ->$executor();
181
182
        // If only one argument is passed - return null, otherwise bool
183
        return func_num_args() > 2 ? sizeof($return) : $return;
184
    }
185
186
    /**
187
     * Find additional field database record by Name.

src/Material.php 1 location

@@ 42-52 (lines=11) @@
39
     * @param self|array|null $return Variable where request result would be returned
40
     * @return bool|self True if material entities has been found
41
     */
42
    public static function byUrl(QueryInterface $query, $url, & $return = array())
43
    {
44
        // Get entities by filtered identifiers
45
        $return = $query->entity(get_called_class())
46
            ->where('Url', $url)
47
            ->where('Active', 1)
48
            ->first();
49
50
        // If only one argument is passed - return null, otherwise bool
51
        return func_num_args() > 2 ? $return !== null : $return;
52
    }
53
54
    /**
55
     * Set additional material field value by field identifier