ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilCronJobEntities.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
24 
25  public function __construct(ilCronJobEntity ...$jobs)
26  {
27  $this->jobs = new ArrayIterator($jobs);
28  }
29 
33  public function getIterator(): ArrayIterator
34  {
35  return $this->jobs;
36  }
37 
38  public function count(): int
39  {
40  return iterator_count($this);
41  }
42 
43  public function add(ilCronJobEntity $job): void
44  {
45  $this->jobs->append($job);
46  }
47 
48  public function filter(callable $callable): ilCronJobCollection
49  {
50  return new static(...array_filter(iterator_to_array($this), $callable));
51  }
52 
53  public function slice(int $offset, ?int $length = null): ilCronJobCollection
54  {
55  return new static(...array_slice(iterator_to_array($this), $offset, $length, true));
56  }
57 
61  public function toArray(): array
62  {
63  return iterator_to_array($this);
64  }
65 }
slice(int $offset, ?int $length=null)
Extracts a slice of $length elements starting at position $offset from the Collection.
__construct(ilCronJobEntity ... $jobs)
filter(callable $callable)
Returns all the elements of this collection that satisfy the predicate $callable. ...
add(ilCronJobEntity $job)