Skip to content

Commit 78990c2

Browse files
committed
Types of URL parameters defined now
1 parent 1973739 commit 78990c2

File tree

1 file changed

+50
-49
lines changed

1 file changed

+50
-49
lines changed

src/FlexiPeeHP/FlexiBeeRO.php

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
class FlexiBeeRO extends \Ease\Sand
1717
{
18+
1819
use \Ease\RecordKey;
1920
/**
2021
* Where to get JSON files with evidence stricture etc.
@@ -109,7 +110,7 @@ class FlexiBeeRO extends \Ease\Sand
109110
public $company = null;
110111

111112
/**
112-
* Server[:port]
113+
* [protocol://]Server[:port]
113114
* @var string
114115
*/
115116
public $url = null;
@@ -275,43 +276,43 @@ class FlexiBeeRO extends \Ease\Sand
275276
* @var array
276277
*/
277278
public $urlParams = [
278-
'add-global-version',
279-
'add-row-count',
280-
'as-gui',
281-
'auth',
282-
'authSessionId',
283-
'code-as-id',
284-
'code-in-response',
285-
'delimeter',
286-
'detail', //See: https://www.flexibee.eu/api/dokumentace/ref/detail-levels
287-
'dir',
288-
'dry-run', // See: https://www.flexibee.eu/api/dokumentace/ref/dry-run/
289-
'encoding',
290-
'export-settings',
291-
'fail-on-warning',
292-
'filter',
293-
'format',
294-
'idUcetniObdobi',
295-
'includes',
296-
'inDesktopApp', // Note: Undocumented function (html only)
297-
'limit',
298-
'mode',
299-
'no-ext-ids',
300-
'no-http-errors',
301-
'no-ids',
302-
'only-ext-ids',
303-
'order',
304-
'relations',
305-
'report-lang',
306-
'report-name',
307-
'report-sign',
308-
'skupina-stitku',
309-
'sort',
310-
'start',
311-
'stitky-as-ids',
312-
'use-ext-id',
313-
'use-internal-id',
314-
'xpath', // See: https://www.flexibee.eu/api/dokumentace/ref/xpath/
279+
'add-global-version' => 'boolean',
280+
'add-row-count' => 'boolean',
281+
'as-gui' => 'boolean',
282+
'auth' => 'string',
283+
'authSessionId' => 'string',
284+
'code-as-id' => 'boolean',
285+
'code-in-response' => 'boolean',
286+
'delimeter' => 'string',
287+
'detail' => 'string', //See: https://www.flexibee.eu/api/dokumentace/ref/detail-levels
288+
'dir' => 'string',
289+
'dry-run' => 'boolean', // See: https://www.flexibee.eu/api/dokumentace/ref/dry-run/
290+
'encoding' => 'string',
291+
'export-settings' => 'boolean',
292+
'fail-on-warning' => 'boolean',
293+
'filter' => 'string',
294+
'format' => 'string',
295+
'idUcetniObdobi' => 'string', //See: https://www.flexibee.eu/api/dokumentace/ref/stavy-uctu/
296+
'includes' => 'string',
297+
'inDesktopApp' => 'boolean', // Note: Undocumented function (html only)
298+
'limit' => 'integer',
299+
'mode' => 'string',
300+
'no-ext-ids' => 'boolean',
301+
'no-http-errors' => 'boolean',
302+
'no-ids' => 'boolean',
303+
'only-ext-ids' => 'boolean',
304+
'order' => 'string',
305+
'relations' => 'string',
306+
'report-lang' => 'string',
307+
'report-name' => 'string',
308+
'report-sign' => 'string',
309+
'skupina-stitku' => 'string',
310+
'sort' => 'string',
311+
'start' => 'integer',
312+
'stitky-as-ids' => 'boolean',
313+
'use-ext-id' => 'boolean',
314+
'use-internal-id' => 'boolean',
315+
'xpath' => 'string', // See: https://www.flexibee.eu/api/dokumentace/ref/xpath/
315316
];
316317

317318
/**
@@ -1296,7 +1297,7 @@ public function getFlexiRow($recordID)
12961297
*/
12971298
public function extractUrlParams(&$conditions, &$urlParams)
12981299
{
1299-
foreach ($this->urlParams as $urlParam) {
1300+
foreach (array_keys($this->urlParams) as $urlParam) {
13001301
if (isset($conditions[$urlParam])) {
13011302
\Ease\Functions::divDataArray($conditions, $urlParams, $urlParam);
13021303
}
@@ -1768,8 +1769,8 @@ public function logResult($resultData = null, $url = null)
17681769
{
17691770
$logResult = false;
17701771
if (isset($resultData['success']) && ($resultData['success'] == 'false')) {
1771-
$this->addStatusMessage('Error '.$this->lastResponseCode.': '.urldecode($url) . (array_key_exists('message',
1772-
$resultData) ? ' ' . $resultData['message'] : '') , 'warning');
1772+
$this->addStatusMessage('Error '.$this->lastResponseCode.': '.urldecode($url).(array_key_exists('message',
1773+
$resultData) ? ' '.$resultData['message'] : ''), 'warning');
17731774
unset($url);
17741775
}
17751776
if (is_null($resultData)) {
@@ -1820,11 +1821,11 @@ public function saveDebugFiles()
18201821
$fname = $this->evidence.'-'.$this->curlInfo['when'].'.'.$this->format;
18211822
$reqname = $tmpdir.'/request-'.$fname;
18221823
$respname = $tmpdir.'/response-'.$fname;
1823-
$header = '# '. (new \DateTime())->format('Y-m-d\TH:i:s.u') .' '. $this->curlInfo['url']. ' ('.urldecode($this->curlInfo['url']).')';
1824-
if (file_put_contents($reqname, $header . "\n".$this->postFields)) {
1824+
$header = '# '.(new \DateTime())->format('Y-m-d\TH:i:s.u').' '.$this->curlInfo['url'].' ('.urldecode($this->curlInfo['url']).')';
1825+
if (file_put_contents($reqname, $header."\n".$this->postFields)) {
18251826
$this->addStatusMessage($reqname, 'debug');
18261827
}
1827-
if (file_put_contents($respname, $header . "\n".$this->lastCurlResponse)) {
1828+
if (file_put_contents($respname, $header."\n".$this->lastCurlResponse)) {
18281829
$this->addStatusMessage($respname, 'debug');
18291830
}
18301831
}
@@ -2221,10 +2222,10 @@ public function getOnlineColumnsInfo($evidence = null)
22212222
$flexinfo = $this->performRequest('/c/'.$this->company.'/'.$evidence.'/properties.json');
22222223
if (!empty($flexinfo) && array_key_exists('properties', $flexinfo)) {
22232224
foreach ($flexinfo['properties']['property'] as $evidenceProperty) {
2224-
$key = $evidenceProperty['propertyName'];
2225-
$properties[$key] = $evidenceProperty;
2226-
if(array_key_exists('name', $evidenceProperty)){
2227-
$proerties[$key]['name'] = $evidenceProperty['name'];
2225+
$key = $evidenceProperty['propertyName'];
2226+
$properties[$key] = $evidenceProperty;
2227+
if (array_key_exists('name', $evidenceProperty)) {
2228+
$proerties[$key]['name'] = $evidenceProperty['name'];
22282229
}
22292230
$properties[$key]['type'] = $evidenceProperty['type'];
22302231
if (array_key_exists('url', $evidenceProperty)) {
@@ -2448,7 +2449,7 @@ public function setMyKey($myKeyValue)
24482449
$extIds);
24492450
}
24502451
} else {
2451-
$res = $this->setDataValue($this->getMyKey(), $myKeyValue);
2452+
$res = $this->setDataValue($this->getMyKey(), $myKeyValue);
24522453
}
24532454
$this->updateApiURL();
24542455
return $res;

0 commit comments

Comments
 (0)