Code Duplication    Length = 11-11 lines in 2 locations

src/Material.php 1 location

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

src/Field.php 1 location

@@ 126-136 (lines=11) @@
123
     * @return bool|self[] True if material entities has been found and $return is passed
124
     *                      or self[] if only two parameters is passed.
125
     */
126
    public static function byIDs(QueryInterface $query, $fieldIDs, &$return = array(), $executor = 'exec')
127
    {
128
        $return = $query->entity(get_called_class())
129
            ->where('FieldID', $fieldIDs)
130
            ->where('Active', 1)
131
            ->orderBy('priority')
132
            ->$executor();
133
134
        // If only one argument is passed - return null, otherwise bool
135
        return func_num_args() > 2 ? sizeof($return) : $return;
136
    }
137
138
    /**
139
     * Get current entity identifiers collection by navigation identifier.