@@ 215-228 (lines=14) @@ | ||
212 | * |
|
213 | * @return AssignmentCollection |
|
214 | */ |
|
215 | public function locked() |
|
216 | { |
|
217 | $items = []; |
|
218 | ||
219 | foreach ($this->items as $item) { |
|
220 | if ($item instanceof AssignmentInterface && $field = $item->getField()) { |
|
221 | if ($field->isLocked()) { |
|
222 | $items[] = $item; |
|
223 | } |
|
224 | } |
|
225 | } |
|
226 | ||
227 | return new static($items); |
|
228 | } |
|
229 | ||
230 | /** |
|
231 | * Return only assignments with fields |
|
@@ 236-249 (lines=14) @@ | ||
233 | * |
|
234 | * @return AssignmentCollection |
|
235 | */ |
|
236 | public function notLocked() |
|
237 | { |
|
238 | $items = []; |
|
239 | ||
240 | foreach ($this->items as $item) { |
|
241 | if ($item instanceof AssignmentInterface && $field = $item->getField()) { |
|
242 | if (!$field->isLocked()) { |
|
243 | $items[] = $item; |
|
244 | } |
|
245 | } |
|
246 | } |
|
247 | ||
248 | return new static($items); |
|
249 | } |
|
250 | ||
251 | /** |
|
252 | * An alias for notLocked(); |