Code Duplication    Length = 8-8 lines in 2 locations

src/Material.php 1 location

@@ 33-40 (lines=8) @@
30
     * @param self[]|array|null $return Variable where request result would be returned
31
     * @return bool|self[] True if material entities has been found
32
     */
33
    public static function byUrl(QueryInterface $query, $url, & $return = array())
34
    {
35
        // Get field record by identifier column
36
        $return = static::collectionByColumn($query, 'Url', $url);
37
38
        // If only one argument is passed - return null, otherwise bool
39
        return func_num_args() > 1 ? $return == null : $return;
40
    }
41
42
    /**
43
     * Set additional material field value by field identifier

src/Field.php 1 location

@@ 23-30 (lines=8) @@
20
     * @param self $return Variable to return found database record
21
     * @return bool|null|self  Field instance or null if 3rd parameter not passed
22
     */
23
    public static function byName(QueryInterface $query, $name, self & $return = null)
24
    {
25
        // Get field record by name column
26
        $return = static::oneByColumn($query, 'Name', $name);
27
28
        // If only one argument is passed - return null, otherwise bool
29
        return func_num_args() > 1 ? $return == null : $return;
30
    }
31
32
    /**
33
     * Find additional field database record by Name or ID.