Skip to content

Commit cdcf858

Browse files
committed
Add DataObject as configuration param, to be more extesible
1 parent cbb1f4a commit cdcf858

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

app/code/Magento/Ui/Component/Form/Element/DataType/Media/OpenDialogUrl.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace Magento\Ui\Component\Form\Element\DataType\Media;
1010

11+
use Magento\Framework\DataObject;
12+
1113
/**
1214
* Basic configuration for OdenDialogUrl
1315
*/
@@ -21,11 +23,11 @@ class OpenDialogUrl
2123
private $openDialogUrl;
2224

2325
/**
24-
* @param string $url
26+
* @param DataObject $url
2527
*/
26-
public function __construct(string $url = null)
28+
public function __construct(DataObject $url = null)
2729
{
28-
$this->openDialogUrl = $url ?? self::DEFAULT_OPEN_DIALOG_URL;
30+
$this->openDialogUrl = $url;
2931
}
3032

3133
/**
@@ -35,6 +37,9 @@ public function __construct(string $url = null)
3537
*/
3638
public function get(): string
3739
{
38-
return $this->openDialogUrl;
40+
if ($this->openDialogUrl) {
41+
return $this->openDialogUrl->getUrl();
42+
}
43+
return self::DEFAULT_OPEN_DIALOG_URL;
3944
}
4045
}

0 commit comments

Comments
 (0)