/** * @return string $statusMessage */ public static function install() { try { Feed_Plugin_Install::createStaticRoutes(); } catch (Exception $e) { logger::crit($e); return self::getTranslate()->_('feed_install_failed'); } return self::getTranslate()->_('feed_installed_successfully'); }
/** * @return string $statusMessage */ public static function install() { try { $install = new Blog_Plugin_Install(); // create object classes $blogCategory = $install->createClass('BlogCategory'); $blogEntry = $install->createClass('BlogEntry'); // classmap $install->setClassmap(); // create root object folder with subfolders $blogFolder = $install->createFolders(); // create custom view for blog objects $install->createCustomView($blogFolder, array($blogEntry->getId(), $blogCategory->getId())); // create static routes $install->createStaticRoutes(); // create predefined document types $install->createDocTypes(); } catch (Exception $e) { logger::crit($e); return self::getTranslate()->_('blog_install_failed'); } return self::getTranslate()->_('blog_installed_successfully'); }
/** * Executes queries in single transaction. * * @param array $queries * @return boolean */ protected static function _executeQueries(array $queries) { $db = Pimcore_API_Plugin_Abstract::getDb()->getResource(); try { $db->beginTransaction(); foreach ($queries as $query) { Pimcore_API_Plugin_Abstract::getDb()->query($query); } $db->commit(); return true; } catch (Zend_Db_Exception $e) { $db->rollBack(); logger::crit($e->getMessage()); return false; } }