Commit 29ffc289 authored by Raph El's avatar Raph El
Browse files

add fonction genereteanswerbeforeSave

parent 50cf1c90
......@@ -28,16 +28,20 @@ class Answer{
$formList = null ;
if( !empty($costum["form"]) && !empty($costum["form"]["ids"]) ){
$formList = $costum["form"]["ids"];
$ans["formId"] = implode("|", $formList);
$ans["formList"] = count($formList);
//$ans["step"] = $formList[0];
}
if( !empty($formList) ) {
$ans["formId"] = implode("|", $formList);
PHDB::insert(Answer::COLLECTION, $ans);
$answer = PHDB::findOne( Answer::COLLECTION, [ "_id" => new MongoId($ans["_id"]) ] ) ;
return $answer;
} else
return null;
if(Costum::isSameFunction("generateAnswerBeforeSave")){
$paramBeforeSave=Costum::sameFunction("generateAnswerBeforeSave",
array("answer" => $ans, "formList"=>$formList) );
$ans = $paramBeforeSave["answer"];
}
PHDB::insert(Answer::COLLECTION, $ans);
$answer = PHDB::findOne( Answer::COLLECTION, [ "_id" => new MongoId($ans["_id"]) ] ) ;
return $answer;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment