Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

BinaryProcessor.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\REST\Common\FieldTypeProcessor;
8
9 class BinaryProcessor extends BinaryInputProcessor
10 {
18 protected $hostPrefix;
19
24 public function __construct($temporaryDirectory, $hostPrefix)
25 {
26 parent::__construct($temporaryDirectory);
27 $this->hostPrefix = $hostPrefix;
28 }
29
33 public function postProcessValueHash($outgoingValueHash)
34 {
35 if (!is_array($outgoingValueHash)) {
36 return $outgoingValueHash;
37 }
38
39 $outgoingValueHash['uri'] = $this->generateUrl($outgoingValueHash['uri']);
40
41 // url is kept for BC, but uri is the right one
42 $outgoingValueHash['url'] = $outgoingValueHash['uri'];
43
44 return $outgoingValueHash;
45 }
46
54 protected function generateUrl($path)
55 {
56 $url = $path;
57 if ($this->hostPrefix) {
58 // url should start with a /
59 $url = $this->hostPrefix . $url;
60 }
61
62 return $url;
63 }
64 }
eZ\Publish\Core\REST\Common\FieldTypeProcessor\BinaryInputProcessor
Definition: BinaryInputProcessor.php:12
eZ\Publish\Core\REST\Common\FieldTypeProcessor\BinaryInputProcessor\$temporaryDirectory
$temporaryDirectory
Definition: BinaryInputProcessor.php:14
eZ\Publish\Core\REST\Common\FieldTypeProcessor\BinaryProcessor
Definition: BinaryProcessor.php:10
eZ\Publish\Core\REST\Common\FieldTypeProcessor\BinaryProcessor\generateUrl
generateUrl($path)
Generates a URL for $path.
Definition: BinaryProcessor.php:54
eZ\Publish\Core\REST\Common\FieldTypeProcessor\BinaryProcessor\postProcessValueHash
postProcessValueHash($outgoingValueHash)
{Perform manipulations on an a generated $outgoingValueHash.This method is called by the REST output ...
Definition: BinaryProcessor.php:33
eZ\Publish\Core\REST\Common\FieldTypeProcessor\BinaryProcessor\__construct
__construct($temporaryDirectory, $hostPrefix)
Definition: BinaryProcessor.php:24
eZ\Publish\Core\REST\Common\FieldTypeProcessor\BinaryProcessor\$hostPrefix
$hostPrefix
Definition: BinaryProcessor.php:18
eZ\Publish\Core\REST\Common\FieldTypeProcessor
Definition: AuthorProcessor.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.