vendor/coreshop/optimistic-entity-lock-bundle/CoreShopOptimisticEntityLockBundle.php line 21

Open in your IDE?
  1. <?php
  2. /**
  3.  * CoreShop.
  4.  *
  5.  * This source file is subject to the GNU General Public License version 3 (GPLv3)
  6.  * For the full copyright and license information, please view the LICENSE.md and gpl-3.0.txt
  7.  * files that are distributed with this source code.
  8.  *
  9.  * @copyright  Copyright (c) 2015-2020 Dominik Pfaffenbauer (https://www.pfaffenbauer.at)
  10.  * @license    https://www.coreshop.org/license     GNU General Public License version 3 (GPLv3)
  11.  */
  12. namespace CoreShop\Bundle\OptimisticEntityLockBundle;
  13. use Composer\InstalledVersions;
  14. use CoreShop\Bundle\CoreBundle\Application\Version;
  15. use PackageVersions\Versions;
  16. use Pimcore\Extension\Bundle\AbstractPimcoreBundle;
  17. use Pimcore\Extension\Bundle\Traits\PackageVersionTrait;
  18. class CoreShopOptimisticEntityLockBundle extends AbstractPimcoreBundle
  19. {
  20.     /**
  21.      * @return string
  22.      */
  23.     public function getNiceName()
  24.     {
  25.         return 'CoreShop - Optimistic Entity Lock';
  26.     }
  27.     /**
  28.      * @return string
  29.      */
  30.     public function getDescription()
  31.     {
  32.         return 'CoreShop - Optimistic Entity Lock Bundle';
  33.     }
  34.     /**
  35.      * @return string
  36.      */
  37.     public function getVersion()
  38.     {
  39.         $bundleName 'coreshop/optimistic-entity-lock-bundle';
  40.         if (class_exists(InstalledVersions::class)) {
  41.             if (InstalledVersions::isInstalled('coreshop/core-shop')) {
  42.                 return InstalledVersions::getVersion('coreshop/core-shop');
  43.             }
  44.             if (InstalledVersions::isInstalled($bundleName)) {
  45.                 return InstalledVersions::getVersion($bundleName);
  46.             }
  47.         }
  48.         if (class_exists(Versions::class)) {
  49.             if (isset(Versions::VERSIONS[$bundleName])) {
  50.                 return Versions::getVersion($bundleName);
  51.             }
  52.             if (isset(Versions::VERSIONS['coreshop/core-shop'])) {
  53.                 return Versions::getVersion('coreshop/core-shop');
  54.             }
  55.         }
  56.         if (class_exists(Version::class)) {
  57.             return Version::getVersion();
  58.         }
  59.         return '';
  60.     }
  61.     /**
  62.      * {@inheritdoc}
  63.      */
  64.     public function getJsPaths()
  65.     {
  66.         return [];
  67.     }
  68.     /**
  69.      * {@inheritdoc}
  70.      */
  71.     public function getCssPaths()
  72.     {
  73.         return [];
  74.     }
  75.     /**
  76.      * {@inheritdoc}
  77.      */
  78.     public function getEditmodeJsPaths()
  79.     {
  80.         return [];
  81.     }
  82.     /**
  83.      * {@inheritdoc}
  84.      */
  85.     public function getEditmodeCssPaths()
  86.     {
  87.         return [];
  88.     }
  89. }