PropertyGroup.php 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\View\Asset;
  7. /**
  8. * Association of arbitrary properties with a list of page assets
  9. */
  10. class PropertyGroup extends Collection
  11. {
  12. /**
  13. * Properties
  14. *
  15. * @var array
  16. */
  17. protected $properties = [];
  18. /**
  19. * Constructor
  20. *
  21. * @param array $properties
  22. */
  23. public function __construct(array $properties)
  24. {
  25. $this->properties = $properties;
  26. }
  27. /**
  28. * Retrieve values of all properties
  29. *
  30. * @return array
  31. */
  32. public function getProperties()
  33. {
  34. return $this->properties;
  35. }
  36. /**
  37. * Retrieve value of an individual property
  38. *
  39. * @param string $name
  40. * @return mixed
  41. */
  42. public function getProperty($name)
  43. {
  44. return $this->properties[$name] ?? null;
  45. }
  46. }