Skip to content

Commit fc68d76

Browse files
committed
update abstract remote function call example in motivation
1 parent 4b86e85 commit fc68d76

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

motivation.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ $result = $function->invoke(['paramName' => 'value']);
4949
```php
5050
<?php
5151

52-
use phpsap\common\AbstractRemoteFunctionCall;
52+
use phpsap\classes\AbstractRemoteFunctionCall;
5353
use phpsap\interfaces\IConfig;
5454
use phpsap\saprfc\SapRfcConnection;
55+
use kbATeam\TypeCast\TypeCastValue;
5556

5657
class MyCoolSapRemoteFunction extends AbstractRemoteFunctionCall
5758
{
@@ -86,6 +87,17 @@ class MyCoolSapRemoteFunction extends AbstractRemoteFunctionCall
8687
}
8788
return $this->setParam('paramA', $value);
8889
}
90+
91+
/**
92+
* Define typecasting for SAP remote function return value.
93+
* @return \kbATeam\TypeCast\TypeCastValue
94+
*/
95+
protected function getReturnTypecast()
96+
{
97+
return new TypeCastValue(function ($res) {
98+
return $res['E_OK'] !== 'X';
99+
});
100+
}
89101
}
90102
```
91103
```php

0 commit comments

Comments
 (0)