Code Duplication    Length = 11-11 lines in 2 locations

src/Material.php 1 location

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