The updateItemInCollection
hook is called when an item is added or updated in the collection.
\Isotope\Model\ProductCollectionItem $item
The item that is added or updated.
array $set
The set of data that is used to update the item.
\Isotope\Model\ProductCollection $collection
The collection the item is added or updated in.
The return value is the set of data that is used to update the item.
// src/EventListener/Isotope/UpdateItemInCollectionListener.php
namespace App\EventListener\Isotope;
use Isotope\Model\ProductCollection;
use Isotope\Model\ProductCollectionItem;
use Isotope\ServiceAnnotation\IsotopeHook;
/**
* @IsotopeHook("updateItemInCollection")
*/
class UpdateItemInCollectionListener
{
public function __invoke(ProductCollectionItem $item, array $set, ProductCollection $collection): array
{
return $set;
}
}