setUpdated example

$success = \is_bool($result) ? $result : !empty($result['success']);
        if ($success) {
            $this->Application()->Events()->notify(
                'Shopware_Plugin_PostInstall',
                [
                    'subject' => $this,
                    'plugin' => $bootstrap,
                ]
            );

            $plugin->setInstalled(new DateTime());
            $plugin->setUpdated(new DateTime());
            $em->flush($plugin);
            $this->write();

            $em->flush();

            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'Snippets/');
            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'snippets/');
            $this->Application()->Container()->get(DatabaseHandler::class)->loadToDatabase($bootstrap->Path() . 'Resources/snippet/');

            // Clear proxy cache             $this->Application()->Hooks()->getProxyFactory()->clearCache();
        }


        $this->em->flush($plugin);

        $this->applyMigrations($pluginBootstrap, AbstractPluginMigration::MODUS_INSTALL);

        $pluginBootstrap->install($context);

        $this->events->notify(PluginEvent::POST_INSTALL, new PostPluginInstallEvent($context$pluginBootstrap));

        $plugin->setInstalled(new DateTime());
        $plugin->setUpdated(new DateTime());

        $this->em->flush($plugin);

        return $context;
    }

    /** * @param bool $removeData * * @throws Exception * @throws \Doctrine\DBAL\DBALException * @throws \Doctrine\ORM\OptimisticLockException * * @return UninstallContext */
Home | Imprint | This part of the site doesn't use cookies.