Added missing methods into GlobalMedia

This commit is contained in:
Matias Griese
2020-06-04 15:45:51 +03:00
parent 2cf5ecd212
commit 6c5237cdd8
2 changed files with 31 additions and 9 deletions

View File

@@ -221,15 +221,6 @@ class Media extends AbstractMedia
}
}
/**
* @return string|null
* @deprecated 1.6 Use $this->getPath() instead.
*/
public function path(): ?string
{
return $this->getPath();
}
protected function getGrav(): Grav
{
return Grav::instance();
@@ -249,4 +240,13 @@ class Media extends AbstractMedia
{
// TODO: Implement clearCache() method.
}
/**
* @return string|null
* @deprecated 1.6 Use $this->getPath() instead.
*/
public function path(): ?string
{
return $this->getPath();
}
}

View File

@@ -9,7 +9,9 @@
namespace Grav\Common\Page\Medium;
use Grav\Common\Config\Config;
use Grav\Common\Grav;
use Grav\Common\Language\Language;
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
class GlobalMedia extends AbstractMedia
@@ -126,4 +128,24 @@ class GlobalMedia extends AbstractMedia
return $medium;
}
protected function getGrav(): Grav
{
return Grav::instance();
}
protected function getConfig(): Config
{
return $this->getGrav()['config'];
}
protected function getLanguage(): Language
{
return $this->getGrav()['language'];
}
protected function clearCache(): void
{
// TODO: Implement clearCache() method.
}
}