ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilCronJobEntities Class Reference
+ Inheritance diagram for ilCronJobEntities:
+ Collaboration diagram for ilCronJobEntities:

Public Member Functions

 __construct (ilCronJobEntity ... $jobs)
 
 getIterator ()
 
 count ()
 
 add (ilCronJobEntity $job)
 
 filter (callable $callable)
 Returns all the elements of this collection that satisfy the predicate $callable. More...
 
 slice (int $offset, ?int $length=null)
 Extracts a slice of $length elements starting at position $offset from the Collection. More...
 
 toArray ()
 

Private Attributes

ArrayIterator $jobs
 

Detailed Description

Definition at line 21 of file class.ilCronJobEntities.php.

Constructor & Destructor Documentation

◆ __construct()

ilCronJobEntities::__construct ( ilCronJobEntity ...  $jobs)

Definition at line 25 of file class.ilCronJobEntities.php.

26  {
27  $this->jobs = new ArrayIterator($jobs);
28  }

Member Function Documentation

◆ add()

ilCronJobEntities::add ( ilCronJobEntity  $job)

Implements ilCronJobCollection.

Definition at line 43 of file class.ilCronJobEntities.php.

Referenced by CronJobEntityTest\testCollectionCanBeChanged().

43  : void
44  {
45  $this->jobs->append($job);
46  }
+ Here is the caller graph for this function:

◆ count()

ilCronJobEntities::count ( )

Definition at line 38 of file class.ilCronJobEntities.php.

38  : int
39  {
40  return iterator_count($this);
41  }

◆ filter()

ilCronJobEntities::filter ( callable  $callable)

Returns all the elements of this collection that satisfy the predicate $callable.

Parameters
callable$callable
Returns
self

Implements ilCronJobCollection.

Definition at line 48 of file class.ilCronJobEntities.php.

Referenced by CronJobEntityTest\testCollectionCanBeFilteredAndSliced().

49  {
50  return new static(...array_filter(iterator_to_array($this), $callable));
51  }
+ Here is the caller graph for this function:

◆ getIterator()

ilCronJobEntities::getIterator ( )
Returns
ArrayIterator|ilCronJobEntity[]

Definition at line 33 of file class.ilCronJobEntities.php.

References $jobs.

34  {
35  return $this->jobs;
36  }

◆ slice()

ilCronJobEntities::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.

Parameters
int$offsetThe offset to start from.
int | null$lengthThe maximum number of elements to return, or null for no limit.
Returns
self

Implements ilCronJobCollection.

Definition at line 53 of file class.ilCronJobEntities.php.

Referenced by CronJobEntityTest\testCollectionCanBeFilteredAndSliced().

54  {
55  return new static(...array_slice(iterator_to_array($this), $offset, $length, true));
56  }
+ Here is the caller graph for this function:

◆ toArray()

ilCronJobEntities::toArray ( )
Returns
ilCronJobEntity[]

Implements ilCronJobCollection.

Definition at line 61 of file class.ilCronJobEntities.php.

Referenced by CronJobEntityTest\testCollectionCanBeChanged().

61  : array
62  {
63  return iterator_to_array($this);
64  }
+ Here is the caller graph for this function:

Field Documentation

◆ $jobs

ArrayIterator ilCronJobEntities::$jobs
private

Definition at line 23 of file class.ilCronJobEntities.php.

Referenced by getIterator().


The documentation for this class was generated from the following file: