| @@ 36-46 (lines=11) @@ | ||
| 33 | * @return bool|self[] True if material entities has been found and $return is passed |
|
| 34 | * or self[] if only two parameters is passed. |
|
| 35 | */ |
|
| 36 | public static function byIDs(QueryInterface $query, $fieldIDs, &$return = array(), $executor = 'exec') |
|
| 37 | { |
|
| 38 | $return = $query->entity(get_called_class()) |
|
| 39 | ->where('FieldID', $fieldIDs) |
|
| 40 | ->where('Active', 1) |
|
| 41 | ->orderBy('priority') |
|
| 42 | ->$executor(); |
|
| 43 | ||
| 44 | // If only one argument is passed - return null, otherwise bool |
|
| 45 | return func_num_args() > 2 ? sizeof($return) : $return; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * Get current entity identifiers collection by navigation identifier. |
|
| @@ 125-135 (lines=11) @@ | ||
| 122 | * @return bool|self[] True if material entities has been found and $return is passed |
|
| 123 | * or self[] if only two parameters is passed. |
|
| 124 | */ |
|
| 125 | public static function byIDs(QueryInterface $query, $materialIDs, &$return = array(), $executor = 'exec') |
|
| 126 | { |
|
| 127 | $return = $query->entity(get_called_class()) |
|
| 128 | ->where('MaterialID', $materialIDs) |
|
| 129 | ->where('Active', 1) |
|
| 130 | ->where('Published', 1) |
|
| 131 | ->$executor(); |
|
| 132 | ||
| 133 | // If only one argument is passed - return null, otherwise bool |
|
| 134 | return func_num_args() > 2 ? sizeof($return) : $return; |
|
| 135 | } |
|
| 136 | ||
| 137 | /** |
|
| 138 | * Get self[] by field identifier and its value. |
|
| @@ 270-280 (lines=11) @@ | ||
| 267 | * @param self|array|null $return Variable where request result would be returned |
|
| 268 | * @return bool|self True if material entities has been found |
|
| 269 | */ |
|
| 270 | public static function byUrl(QueryInterface $query, $url, & $return = array()) |
|
| 271 | { |
|
| 272 | // Get entities by filtered identifiers |
|
| 273 | $return = $query->entity(get_called_class()) |
|
| 274 | ->where('Url', $url) |
|
| 275 | ->where('Active', 1) |
|
| 276 | ->first(); |
|
| 277 | ||
| 278 | // If only one argument is passed - return null, otherwise bool |
|
| 279 | return func_num_args() > 2 ? $return !== null : $return; |
|
| 280 | } |
|
| 281 | ||
| 282 | /** |
|
| 283 | * Set additional material field value by field identifier |
|