\Pvra\ResultCollection

Class Collection

Summary

Methods
Properties
Constants
add()
remove()
has()
getHighestDemandingResult()
getIterator()
count()
jsonSerialize()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
recalculateHighestDemandingResult()
$results
$highestDemand
N/A

Properties

$results

$results : array<mixed,\Pvra\AnalysisResult>

Result instances that are part of this collection

Type

array<mixed,\Pvra\AnalysisResult>

$highestDemand

$highestDemand : string

The targetId of the currently highest demanding result

Type

string

Methods

add()

add(\Pvra\AnalysisResult  $result, boolean  $ignoreIfExists = true) : $this

Add a result to this collection

Parameters

\Pvra\AnalysisResult $result

The result to be added

boolean $ignoreIfExists

Do not add+override an already existing result with the same targetId.

Returns

$this

remove()

remove(string|\Pvra\AnalysisResult  $result) : true

Remove a result from the collection

Removes a result, which is identified by its analysis target id from the current collection.

Parameters

string|\Pvra\AnalysisResult $result

Returns

true

has()

has(string|\Pvra\AnalysisResult  $result) : boolean

Checks whether a given result is part of this collection

Parameters

string|\Pvra\AnalysisResult $result

Analysis target Id or instance of Analysis Result

Returns

boolean

getHighestDemandingResult()

getHighestDemandingResult() : null|\Pvra\AnalysisResult

Get the currently highest demanding result

Returns

null|\Pvra\AnalysisResult

getIterator()

getIterator() : \Traversable|array<mixed,\Pvra\AnalysisResult>

Retrieve an external iterator

Returns

\Traversable|array<mixed,\Pvra\AnalysisResult>

count()

count() : integer

Count attached results

Returns

integer —

The custom count as an integer. The return value is cast to an integer.

jsonSerialize()

jsonSerialize() : mixed

Specify data which should be serialized to JSON

Returns

mixed —

data which can be serialized by json_encode, which is a value of any type other than a resource.

recalculateHighestDemandingResult()

recalculateHighestDemandingResult() 

Recalculates the highest demanding result of this collection

This can be expensive. Only do this if really necessary.