ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilCronJobEntities.php
Go to the documentation of this file.
1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
11 private $jobs;
12
17 public function __construct(array $jobs = [])
18 {
19 $this->jobs = new ArrayIterator($jobs);
20 }
21
25 public function getIterator()
26 {
27 return $this->jobs;
28 }
29
33 public function count()
34 {
35 return iterator_count($this);
36 }
37
41 public function add(ilCronJobEntity $job) : void
42 {
43 $this->jobs->append($job);
44 }
45
49 public function filter(callable $callable) : ilCronJobCollection
50 {
51 return new static(array_filter(iterator_to_array($this), $callable));
52 }
53
57 public function slice(int $offset, ?int $length = null) : ilCronJobCollection
58 {
59 return new static(array_slice(iterator_to_array($this), $offset, $length, true));
60 }
61
65 public function toArray() : array
66 {
67 return iterator_to_array($this);
68 }
69}
An exception for terminatinating execution or to throw for unit testing.
Class ilCronJobEntities.
toArray()
ilCronJobEntity[]
filter(callable $callable)
Returns all the elements of this collection that satisfy the predicate $callable.self
slice(int $offset, ?int $length=null)
Extracts a slice of $length elements starting at position $offset from the Collection....
__construct(array $jobs=[])
ilCronJobs constructor.
add(ilCronJobEntity $job)
Class ilCronJobEntity.
Class ilCronJobCollection.