| @@ 78-88 (lines=11) @@ | ||
| 75 | * @return bool|self[] True if material entities has been found and $return is passed |
|
| 76 | * or self[] if only two parameters is passed. |
|
| 77 | */ |
|
| 78 | public static function byIDs(QueryInterface $query, $fieldIDs, &$return = array(), $executor = 'exec') |
|
| 79 | { |
|
| 80 | $return = $query->entity(get_called_class()) |
|
| 81 | ->where('FieldID', $fieldIDs) |
|
| 82 | ->where('Active', 1) |
|
| 83 | ->orderBy('priority') |
|
| 84 | ->$executor(); |
|
| 85 | ||
| 86 | // If only one argument is passed - return null, otherwise bool |
|
| 87 | return func_num_args() > 2 ? sizeof($return) : $return; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * Get current entity identifiers collection by navigation identifier. |
|
| @@ 57-67 (lines=11) @@ | ||
| 54 | * @param self|array|null $return Variable where request result would be returned |
|
| 55 | * @return bool|self True if material entities has been found |
|
| 56 | */ |
|
| 57 | public static function byUrl(QueryInterface $query, $url, & $return = array()) |
|
| 58 | { |
|
| 59 | // Get entities by filtered identifiers |
|
| 60 | $return = $query->entity(get_called_class()) |
|
| 61 | ->where('Url', $url) |
|
| 62 | ->where('Active', 1) |
|
| 63 | ->first(); |
|
| 64 | ||
| 65 | // If only one argument is passed - return null, otherwise bool |
|
| 66 | return func_num_args() > 2 ? $return !== null : $return; |
|
| 67 | } |
|
| 68 | ||
| 69 | /** |
|
| 70 | * Set additional material field value by field identifier |
|