C5-8.4* Multiple Express objects, can't delete them programmatically
Permalink
I create an Express object within a package, then I try to delete it during package uninstall:
1. Every time I reinstall my package, the Express Entry multiplies in the Custom Entry Locations
2. and nothing gets deleted after package uninstall, I can still see the object in the Express Data Objects and in the Custom Entry Locations.
How do create a single object and delete it?
public function install() { try { $expressObject = Express::getObjectByHandle('my_category'); if (is_object($expressObject)) { Express::deleteEntry($expressObject); } $expressObject = Express::buildObject('my_category', 'my_categories', 'My Category', $pkg); $expressObject->addAttribute('text', 'My Category Name', 'my_category_name'); $expressObject->save(); $form = $expressObject->buildForm('Form'); $form->addFieldset('Basics') ->addAttributeKeyControl('my_category_name'); $form = $form->save(); $expressObject->getEntity()->setDefaultViewForm($form);
Viewing 15 lines of 30 lines. View entire code block.
1. Every time I reinstall my package, the Express Entry multiplies in the Custom Entry Locations
2. and nothing gets deleted after package uninstall, I can still see the object in the Express Data Objects and in the Custom Entry Locations.
How do create a single object and delete it?