Skip to content
Snippets Groups Projects
Commit 64c05212 authored by Sofian pujo's avatar Sofian pujo
Browse files

Ajout du body du message dans aValues

parent 26c71b38
Branches
Tags
No related merge requests found
......@@ -15,10 +15,23 @@ class BoAction Extends Action {
function __construct($oBd, $messageclass_action_id, $oMessage, $aParams, $properties) {
parent::__construct($messageclass_action_id, $oMessage, $aParams);
$iBoId = $oMessage->getBody($this->aParams['bo_id_attribute']);
//On sépare les lignes
$aBodyParameters = preg_split('/\r\n|\r|\n/', $oMessage->getBody());
$aBodyMessage = [];
//On récupère le contenu du body du message
foreach ($aBodyParameters as $iIndice => $sParameters)
{
$aParameters = explode(" : ", $sParameters);
if ($aParameters[0] != 'bo_id')
$aBodyMessage[trim($aParameters[0])] = trim($aParameters[1]);
}
if (!empty($iBoId)){
require_once($properties["vas_home"] ."/rest/ws/" . $this->aParams['module'] . "/" . $this->aParams['class'] . ".class.inc");
$aPath = array($this->aParams['module'], $this->aParams['class'], $iBoId);
$aValues = array($this->aParams['bo_id_attribute'] => $iBoId, "token" => $this->aParams['token']);
$aValues = array_merge($aValues, $aBodyMessage);
$this->oBusinessObject = new $this->aParams['class']($aPath, $aValues, $properties);
$this->oBusinessObject->oConnection->oBd = $oBd;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment