ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 }
slice(int $offset, ?int $length=null)
Extracts a slice of $length elements starting at position $offset from the Collection.If $length is null it returns all elements from $offset to the end of the Collection. Calling this method will only return the selected slice and NOT change the elements contained in the collection slice is called on. The offset to start from. The maximum number of elements to return, or null for no limit. self
__construct(array $jobs=[])
ilCronJobs constructor.
toArray()
ilCronJobEntity[]
Class ilCronJobEntities.
Class ilCronJobEntity.
filter(callable $callable)
Returns all the elements of this collection that satisfy the predicate $callable.self ...
Class ilCronJobCollection.
add(ilCronJobEntity $job)