Answer the question
In order to leave comments, you need to log in
Why is it written that you cannot call a function inside a controller?
Hello
public function isCorrectChat($resultData)
{
if(array_key_exists ('event_name', $resultData )){
$eventName = $resultData['event_name'];
if ($eventName === 'chat_finished'){
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* @Route("/decode", name="decode")
*/
public function decode()
{
$loader = $this->getDoctrine()
->getRepository(PlainJson::class)
->find(1);
$json = $loader->getJson();
$resultData = json_decode($json, true);
if(isCorrectChat($resultData)){ ----- вот тут
$cargo = array();
....
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question