@@ -96,6 +96,12 @@ class FMBaseBuilder extends Builder
9696 */
9797 public array $ limitPortals = [];
9898
99+ /**
100+ * An array of portals which should have the offset set it the response.
101+ * This is actually the "starting record", and so the default value is 1.
102+ */
103+ public array $ offsetPortals = [];
104+
99105 public const ASCEND = 'ascend ' ;
100106
101107 public const DESCEND = 'descend ' ;
@@ -112,7 +118,7 @@ class FMBaseBuilder extends Builder
112118 *
113119 * @var array
114120 */
115- public $ portal ;
121+ public $ portal = [] ;
116122
117123 /**
118124 * @var int
@@ -334,23 +340,34 @@ public function limit($value): FMBaseBuilder
334340 return $ this ;
335341 }
336342
337- public function limitPortal ($ portalName , $ limit ): FMBaseBuilder
343+ public function limitPortal (string $ portalName , int $ limit ): FMBaseBuilder
338344 {
339345 $ this ->limitPortals [] = ['portalName ' => $ portalName , 'limit ' => $ limit ];
340346
341347 return $ this ;
342348 }
343349
350+ /**
351+ * Set an offset for a given portal.
352+ * This is actually the "starting record", and so the default value is 1.
353+ */
354+ public function offsetPortal (string $ portalName , int $ startingRecord ): FMBaseBuilder
355+ {
356+ $ this ->offsetPortals [] = ['portalName ' => $ portalName , 'offset ' => $ startingRecord ];
357+
358+ return $ this ;
359+ }
360+
344361 public function offset ($ value ): FMBaseBuilder
345362 {
346363 $ this ->offset = $ value ;
347364
348365 return $ this ;
349366 }
350367
351- public function script ($ name , $ param = null ): FMBaseBuilder
368+ public function script ($ scriptName , $ param = null ): FMBaseBuilder
352369 {
353- $ this ->script = $ name ;
370+ $ this ->script = $ scriptName ;
354371
355372 // set the script parameter if one was passed in
356373 if ($ param ) {
@@ -360,16 +377,16 @@ public function script($name, $param = null): FMBaseBuilder
360377 return $ this ;
361378 }
362379
363- public function scriptParam ($ param ): FMBaseBuilder
380+ public function scriptParam (string $ param ): FMBaseBuilder
364381 {
365382 $ this ->scriptParam = $ param ;
366383
367384 return $ this ;
368385 }
369386
370- public function scriptPresort ($ name , $ param = null ): FMBaseBuilder
387+ public function scriptPresort (string $ scriptName , $ param = null ): FMBaseBuilder
371388 {
372- $ this ->scriptPresort = $ name ;
389+ $ this ->scriptPresort = $ scriptName ;
373390
374391 // set the script parameter if one was passed in
375392 if ($ param ) {
@@ -379,16 +396,16 @@ public function scriptPresort($name, $param = null): FMBaseBuilder
379396 return $ this ;
380397 }
381398
382- public function scriptPresortParam ($ param ): FMBaseBuilder
399+ public function scriptPresortParam (string $ param ): FMBaseBuilder
383400 {
384401 $ this ->scriptPresortParam = $ param ;
385402
386403 return $ this ;
387404 }
388405
389- public function scriptPrerequest ($ name , $ param = null ): FMBaseBuilder
406+ public function scriptPrerequest (string $ scriptName , string $ param = null ): FMBaseBuilder
390407 {
391- $ this ->scriptPrerequest = $ name ;
408+ $ this ->scriptPrerequest = $ scriptName ;
392409
393410 // set the script parameter if one was passed in
394411 if ($ param ) {
@@ -398,16 +415,16 @@ public function scriptPrerequest($name, $param = null): FMBaseBuilder
398415 return $ this ;
399416 }
400417
401- public function scriptPrerequestParam ($ param ): FMBaseBuilder
418+ public function scriptPrerequestParam (string $ param ): FMBaseBuilder
402419 {
403420 $ this ->scriptPrerequestParam = $ param ;
404421
405422 return $ this ;
406423 }
407424
408- public function layoutResponse ($ name ): FMBaseBuilder
425+ public function layoutResponse (string $ layoutName ): FMBaseBuilder
409426 {
410- $ this ->layoutResponse = $ name ;
427+ $ this ->layoutResponse = $ layoutName ;
411428
412429 return $ this ;
413430 }
@@ -640,7 +657,7 @@ public function createRecord()
640657 * @param $array array
641658 * @return $this
642659 */
643- public function fieldData ($ array )
660+ public function fieldData (array $ array )
644661 {
645662 $ this ->fieldData = $ this ->mapFieldNamesForArray ($ array );
646663
@@ -653,7 +670,7 @@ public function fieldData($array)
653670 * @param $array array
654671 * @return $this
655672 */
656- public function portalData ($ array )
673+ public function portalData (array $ array )
657674 {
658675 $ this ->portalData = $ array ;
659676
@@ -797,7 +814,6 @@ public function portal($portalName)
797814 // It's a single value, so append it on the array
798815 array_push ($ this ->portal , $ portalName );
799816 }
800- $ this ->portal = $ portalName ;
801817
802818 return $ this ;
803819 }
0 commit comments