vendor/pimcore/pimcore/models/DataObject/ClassDefinition/Helper/VarExport.php line 58

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 Commercial License (PCL)
  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 PCL
  13. */
  14. namespace Pimcore\Model\DataObject\ClassDefinition\Helper;
  15. /**
  16. * @internal
  17. */
  18. trait VarExport
  19. {
  20. /**
  21. * @var array
  22. */
  23. protected $blockedVarsForExport = [];
  24. /**
  25. * @return array
  26. */
  27. public function getBlockedVarsForExport(): array
  28. {
  29. return $this->blockedVarsForExport;
  30. }
  31. /**
  32. * @return array
  33. */
  34. public function resolveBlockedVars(): array
  35. {
  36. $defaultBlockedVars = [
  37. 'fieldDefinitionsCache',
  38. 'columnType',
  39. 'queryColumnType',
  40. ];
  41. return array_merge($defaultBlockedVars, $this->getBlockedVarsForExport());
  42. }
  43. /**
  44. * @param array $data
  45. *
  46. * @return static
  47. */
  48. public static function __set_state($data)
  49. {
  50. $obj = new static();
  51. $obj->setValues($data);
  52. return $obj;
  53. }
  54. }