@@ 16-23 (lines=8) @@ | ||
13 | * @param self $return Return self instance |
|
14 | * @return bool|null |
|
15 | */ |
|
16 | public static function byID($identifier, self & $return = null ) |
|
17 | { |
|
18 | // Get field record by identiifer column |
|
19 | $return = static::oneByColumn(new dbQuery(), self::$_primary, $identifier); |
|
20 | ||
21 | // If only one argument is passed - return null, otherwise bool |
|
22 | return func_num_args() > 1 ? $return == null : $return; |
|
23 | } |
|
24 | ||
25 | /** |
|
26 | * Find field database record by name |
|
@@ 31-38 (lines=8) @@ | ||
28 | * @param self $return Return self instance |
|
29 | * @return bool|null |
|
30 | */ |
|
31 | public static function byName($identifier, self & $return = null ) |
|
32 | { |
|
33 | // Get field record by identiifer column |
|
34 | $return = static::oneByColumn(new dbQuery(), self::$_primary, 'Name'); |
|
35 | ||
36 | // If only one argument is passed - return null, otherwise bool |
|
37 | return func_num_args() > 1 ? $return == null : $return; |
|
38 | } |
|
39 | } |
|
40 |