MediaObjectInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * @package Grav\Framework\Media
  4. *
  5. * @copyright Copyright (c) 2015 - 2022 Trilby Media, LLC. All rights reserved.
  6. * @license MIT License; see LICENSE file for details.
  7. */
  8. namespace Grav\Framework\Media\Interfaces;
  9. use Psr\Http\Message\UploadedFileInterface;
  10. /**
  11. * Class implements media object interface.
  12. *
  13. * @property UploadedFileInterface|null $uploaded_file
  14. */
  15. interface MediaObjectInterface
  16. {
  17. /**
  18. * Returns an array containing the file metadata
  19. *
  20. * @return array
  21. */
  22. public function getMeta();
  23. /**
  24. * Return URL to file.
  25. *
  26. * @param bool $reset
  27. * @return string
  28. */
  29. public function url($reset = true);
  30. /**
  31. * Get value by using dot notation for nested arrays/objects.
  32. *
  33. * @example $value = $this->get('this.is.my.nested.variable');
  34. *
  35. * @param string $name Dot separated path to the requested value.
  36. * @param mixed $default Default value (or null).
  37. * @param string|null $separator Separator, defaults to '.'
  38. * @return mixed Value.
  39. */
  40. public function get($name, $default = null, $separator = null);
  41. }