Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
gav- committed Mar 24, 2023
2 parents c0e3802 + 7780c68 commit db47d51
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 4 deletions.
13 changes: 11 additions & 2 deletions lib/RESTfm/BackendFileMakerDataApi/FileMakerDataApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,10 @@ public function getRecords ($layout,
$params['_offset'] = $offset;
$params['_limit'] = $limit;

if (! empty($sort)) {
$params['_sort'] = json_encode($sort);
}

$queryString = $this->_dataToQueryString($params);
if (!empty($queryString)) { $queryString = '?' . $queryString;}

Expand Down Expand Up @@ -560,6 +564,11 @@ public function findRecords (
// 'Pcode' => '==0810',
//));

if (empty($query)) {
// Do a "get" instead of a "find" if $query is empty
return $this->getRecords($layout, $limit, $offset, $sort, $params);
}

$params['query'] = $query;
$params['offset'] = (string)$offset;
$params['limit'] = (string)$limit;
Expand All @@ -573,7 +582,7 @@ public function findRecords (
'/layouts/' .
rawurlencode($layout) .
'/_find',
'POST', $params);
'POST', $params);

$result = $this->curl_exec();

Expand Down Expand Up @@ -819,7 +828,7 @@ protected function databasesUrl () {
*
* @return string
*/
protected function productinfoUrl () {
protected function productInfoUrl () {
return('/fmi/data/' . self::BACKEND_VERSION . '/productinfo');
}

Expand Down
8 changes: 7 additions & 1 deletion lib/RESTfm/BackendFileMakerDataApi/OpsField.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,17 @@
class OpsField extends \RESTfm\OpsFieldAbstract {

/**
* @var \RESTfm\BackendFileMakerDataApi\Backend
* @var \RESTfm\BackendFileMakerDataApi\Backend|null
* Handle to backend object.
*/
protected $_backend = NULL;

/**
* @var string
* Layout name.
*/
protected $_layout = '';

/**
* Construct a new Field-level Operation object.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/RESTfm/BackendFileMakerDataApi/OpsLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class OpsLayout extends \RESTfm\OpsLayoutAbstract {
* @var string
* Layout name.
*/
protected $_layout;
protected $_layout = '';

/**
* Construct a new Record-level Operation object.
Expand Down
6 changes: 6 additions & 0 deletions lib/RESTfm/BackendFileMakerDataApi/OpsRecord.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class OpsRecord extends \RESTfm\OpsRecordAbstract {
*/
protected $_backend = NULL;

/**
* @var string
* Layout name.
*/
protected $_layout = '';

/**
* Construct a new Record-level Operation object.
*
Expand Down

0 comments on commit db47d51

Please sign in to comment.