if ($this->useTimestamps &&
$this->updatedField && !
array_key_exists($this->updatedField,
$data)) { $data[$this->updatedField
] =
$date;
} $eventData =
['data' =>
$data];
if ($this->tempAllowCallbacks
) { $eventData =
$this->
trigger('beforeInsert',
$eventData);
} $result =
$this->
doInsert($eventData['data'
]);
$eventData =
[ 'id' =>
$this->insertID,
'data' =>
$eventData['data'
],
'result' =>
$result,
];
if ($this->tempAllowCallbacks
) { // Trigger afterInsert events with the inserted data and new ID
$this->
trigger('afterInsert',
$eventData);
}