ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities Class Reference
+ Inheritance diagram for ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities:
+ Collaboration diagram for ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities:

Public Member Functions

 __construct (\ILIAS\Cron\Job\JobEntity ... $jobs)
 
 getIterator ()
 
 count ()
 
 add (\ILIAS\Cron\Job\JobEntity $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 23 of file JobEntities.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities::__construct ( \ILIAS\Cron\Job\JobEntity ...  $jobs)

Definition at line 30 of file JobEntities.php.

31  {
32  $this->jobs = new \ArrayIterator(array_values($jobs));
33  }

Member Function Documentation

◆ add()

ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities::add ( \ILIAS\Cron\Job\JobEntity  $job)

Implements ILIAS\BackgroundTasks\Task\Job\JobCollection.

Definition at line 48 of file JobEntities.php.

48  : void
49  {
50  $this->jobs->append($job);
51  }

◆ count()

ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities::count ( )

Definition at line 43 of file JobEntities.php.

43  : int
44  {
45  return iterator_count($this);
46  }

◆ filter()

ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities::filter ( callable  $callable)

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

Parameters
callable(

Implements ILIAS\BackgroundTasks\Task\Job\JobCollection.

Definition at line 53 of file JobEntities.php.

53  : static
54  {
55  return new static(...array_values(array_filter(iterator_to_array($this), $callable)));
56  }

◆ getIterator()

ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities::getIterator ( )
Returns
<int, >

Definition at line 38 of file JobEntities.php.

References ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities\$jobs.

38  : \ArrayIterator
39  {
40  return $this->jobs;
41  }

◆ slice()

ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities::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
static

Implements ILIAS\BackgroundTasks\Task\Job\JobCollection.

Definition at line 58 of file JobEntities.php.

58  : static
59  {
60  return new static(...\array_slice(iterator_to_array($this), $offset, $length, true));
61  }

◆ toArray()

ILIAS\BackgroundTasks\Task\Job\Collection\JobEntities::toArray ( )
Returns
list<>

Implements ILIAS\BackgroundTasks\Task\Job\JobCollection.

Definition at line 66 of file JobEntities.php.

66  : array
67  {
68  return iterator_to_array($this);
69  }

Field Documentation

◆ $jobs

ArrayIterator ILIAS\BackgroundTasks\Task\Job::Collection\JobEntities::$jobs
private

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