src/Website/Tool/ForceInheritance.php line 30

Open in your IDE?
  1. <?php
  2. /**
  3.  * Pimcore
  4.  *
  5.  * This source file is available under two different licenses:
  6.  * - GNU General Public License version 3 (GPLv3)
  7.  * - Pimcore Enterprise License (PEL)
  8.  * Full copyright and license information is available in
  9.  * LICENSE.md which is distributed with this source code.
  10.  *
  11.  *  @copyright  Copyright (c) Pimcore GmbH (http://www.pimcore.org)
  12.  *  @license    http://www.pimcore.org/license     GPLv3 and PEL
  13.  */
  14. namespace App\Website\Tool;
  15. use Pimcore\Model\DataObject\AbstractObject;
  16. class ForceInheritance
  17. {
  18.     /**
  19.      * @param \Closure $callable
  20.      * @return mixed
  21.      */
  22.     public static function run($callable)
  23.     {
  24.         $inheritanceBackup AbstractObject::getGetInheritedValues();
  25.         AbstractObject::setGetInheritedValues(true);
  26.         $result $callable();
  27.         AbstractObject::setGetInheritedValues($inheritanceBackup);
  28.         return $result;
  29.     }
  30. }