diff --git a/composer.json b/composer.json index 236c83a..f9c4320 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "oneplace/oneplace-core", "description": "onePlace Core Application", "type": "project", - "version": "1.0.24", + "version": "1.0.25", "license": "BSD-3-Clause", "keywords": [ "laminas", diff --git a/module/Application/src/Controller/CoreApiController.php b/module/Application/src/Controller/CoreApiController.php index 8b7d29c..afd2b64 100644 --- a/module/Application/src/Controller/CoreApiController.php +++ b/module/Application/src/Controller/CoreApiController.php @@ -407,6 +407,14 @@ public function getAction() { } } + if (array_key_exists($this->sSingleForm.'-api-list-before',CoreEntityController::$aEntityHooks)) { + foreach(CoreEntityController::$aEntityHooks[$this->sSingleForm.'-api-list-before'] as $oHook) { + $sHookFunc = $oHook->sFunction; + $aCustomData = $oHook->oItem->$sHookFunc($oItem); + $aPublicItem = array_merge($aPublicItem,$aCustomData); + } + } + # Print Entity $aReturn = ['state'=>'success','message'=>'Item found','oItem'=>$aPublicItem]; echo json_encode($aReturn); diff --git a/module/Application/src/Model/CoreEntityTable.php b/module/Application/src/Model/CoreEntityTable.php index 8cef971..267bc07 100644 --- a/module/Application/src/Model/CoreEntityTable.php +++ b/module/Application/src/Model/CoreEntityTable.php @@ -77,6 +77,7 @@ protected function attachDynamicFields(array $aData,$oObject) { $aData[$sFieldName] = $oObject->$sFieldName; break; case 'currency': + case 'number': $aData[$sFieldName] = (float)$oObject->$sFieldName; break; case 'select': @@ -186,7 +187,7 @@ public function fetchAll($bPaginated = false,$aWhere = []) { * @since 1.0.0 */ public function getSingleEntity($id,$sKey = 'Skeleton_ID') { - $id = (int) $id; + $id = $id; $rowset = $this->oTableGateway->select([$sKey => $id]); $row = $rowset->current(); if (! $row) { diff --git a/module/Application/src/Module.php b/module/Application/src/Module.php index 730810d..555b1a4 100644 --- a/module/Application/src/Module.php +++ b/module/Application/src/Module.php @@ -27,7 +27,7 @@ class Module { * * @since 1.0.0 */ - const VERSION = '1.0.24'; + const VERSION = '1.0.25'; public function getConfig() : array {