vendor/easycorp/easyadmin-bundle/src/Dto/AssetDto.php line 8

Open in your IDE?
  1. <?php
  2. namespace EasyCorp\Bundle\EasyAdminBundle\Dto;
  3. /**
  4. * @author Javier Eguiluz <javier.eguiluz@gmail.com>
  5. */
  6. final class AssetDto
  7. {
  8. private $value;
  9. private $async;
  10. private $defer;
  11. private $preload;
  12. private $nopush;
  13. private $webpackPackageName;
  14. private $webpackEntrypointName;
  15. private $htmlAttributes;
  16. public function __construct(string $value)
  17. {
  18. $this->value = $value;
  19. $this->async = false;
  20. $this->defer = false;
  21. $this->preload = false;
  22. $this->nopush = false;
  23. $this->webpackPackageName = null;
  24. $this->webpackEntrypointName = '_default';
  25. $this->htmlAttributes = [];
  26. }
  27. public function __toString(): string
  28. {
  29. return $this->getValue();
  30. }
  31. public function getValue(): string
  32. {
  33. return $this->value;
  34. }
  35. public function setAsync(bool $async): void
  36. {
  37. $this->async = $async;
  38. }
  39. public function isAsync(): bool
  40. {
  41. return $this->async;
  42. }
  43. public function setDefer(bool $defer): void
  44. {
  45. $this->defer = $defer;
  46. }
  47. public function isDefer(): bool
  48. {
  49. return $this->defer;
  50. }
  51. public function setPreload(bool $preload): void
  52. {
  53. $this->preload = $preload;
  54. }
  55. public function isPreload(): bool
  56. {
  57. return $this->preload;
  58. }
  59. public function setNopush(bool $nopush): void
  60. {
  61. $this->nopush = $nopush;
  62. }
  63. public function isNopush(): bool
  64. {
  65. return $this->nopush;
  66. }
  67. public function setWebpackPackageName(?string $packageName): void
  68. {
  69. $this->webpackPackageName = $packageName;
  70. }
  71. public function getWebpackPackageName(): ?string
  72. {
  73. return $this->webpackPackageName;
  74. }
  75. public function setWebpackEntrypointName(string $entrypointName): void
  76. {
  77. $this->webpackEntrypointName = $entrypointName;
  78. }
  79. public function getWebpackEntrypointName(): string
  80. {
  81. return $this->webpackEntrypointName;
  82. }
  83. public function setHtmlAttribute(string $attrName, string $attrValue): void
  84. {
  85. $this->htmlAttributes[$attrName] = $attrValue;
  86. }
  87. public function getHtmlAttributes(): array
  88. {
  89. return $this->htmlAttributes;
  90. }
  91. }