RecordSet::insert
James Cobban edited this page Feb 1, 2020
·
1 revision
Up: class RecordSet
Insert a new record into the RecordSet
in position depending upon the implementation of method $record->compare($other)
. That is unlike $recordSet->push($index, $record)
and $recordSet[$index] = $record
this method maintains the order of the records as defined by method $record->compare($other)
. For example class Event defines $event->compare($other)
as sorting by the date of the event so if the instances of Event
in the RecordSet
are in order by date then they will still be in order by date after $recordSet->insert($newEvent)
.
$recordSet->insert($record);
Next: $recordSet->rewind()