Skip to content

Commit

Permalink
Added docs and readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Firesphere committed Dec 27, 2019
1 parent 576cc2d commit db58683
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Extensions/DataObjectExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function clearIDs(DataObject $owner, array $ids, DirtyClass $record):
* Register the exception of the attempted index for later clean-up use
*
* @param array $ids
* @param $record
* @param DirtyClass $record
* @param Exception $error
* @throws ValidationException
* @throws GuzzleException
Expand Down Expand Up @@ -215,7 +215,8 @@ public function onAfterDelete(): void
$ids = json_decode($record->IDs, 1) ?: [];

try {
(new SolrCoreService())->updateItems(ArrayList::create([$owner]), SolrCoreService::DELETE_TYPE);
(new SolrCoreService())
->updateItems(ArrayList::create([$owner]), SolrCoreService::DELETE_TYPE);
// If successful, remove it from the array
// Added bonus, array_flip removes duplicates
$this->clearIDs($owner, $ids, $record);
Expand Down

0 comments on commit db58683

Please sign in to comment.