...
Codeblock | ||||||
---|---|---|---|---|---|---|
| ||||||
use Brandbox\Framework\Base\File;
use Brandbox\PrintCore\PrintDocument\Image as PrintDocumentImage;
use Brandbox\PrintStyleguide;
public function get(Render\Lib\Struct\ScopeElement $scope): PrintStyleguide\Entity\PrintImage
{
$element = new PrintStyleguide\Entity\PrintImage();
$this->image($element, $scope->settings);
return $element;
}
private function image(PrintStyleguide\Entity\PrintImage $element, array $settings): void
{
$file = $this->getFile($settings['image']);
$image = $this->getImage($file);
if ('' !== $image) {
$element->settings['src'] = $image;
}
}
private function getImage(File\lib\entity\mamFile $file): string
{
return $this
->staticController(PrintDocumentImage\Manager::class)
->get($file)
;
}
private function getFile(string $path): File\lib\entity\mamFile
{
return $this
->staticController(File\Manager::class)
->findByPath($path, true)
;
} |
...