Go to the source code of this file.
◆ toNewObject()
Definition at line 21 of file 06-to-new-object.php.
References $DIC, ILIAS\Repository\$refinery, and ILIAS\MetaData\Repository\Validation\Data\__construct().
25 private string $firstParameter;
26 private int $secondParameter;
27 private string $thirdParameter;
30 string $firstParameter,
32 string $thirdParameter
34 $this->firstParameter = $firstParameter;
35 $this->secondParameter = $secondParameter;
36 $this->thirdParameter = $thirdParameter;
39 public function say(): string
41 return $this->firstParameter;
44 public function getFirstParameter(): string
46 return $this->firstParameter;
49 public function getSecodParameter():
int 51 return $this->secondParameter;
54 public function getThirdParameter(): string
56 return $this->thirdParameter;
64 $transformation =
$refinery->to()->toNew(SomeOtherClass::class);
66 $result = $transformation->transform([
'firstParameter', 2,
'thirdParameter']);
68 return assert(
'firstParameter' === $result->getFirstParameter());
Refinery Factory $refinery