I have a product object and it has an images field that stores the names of images from the product, but the names of the images depend on the part_number field, which is unique, so if the user makes an error in the part number and he wants to edit it, then I also need to change image names
I tried this, but it does not work:
// class ProductsAdmin extends Admin public function preUpdate($product) { $old_product = $this->getSubject(); if ($old_product->getPartNumber() != $product->getPartNumber) { // change file names } $this->saveFile($product); }
How to get the source string in the preUpdate () function?
tttony
source share