public function addTakeawayEntry($takeawayRequest, $userInfo) { $takeawayResult = $this->getTableObj()->takeawayInsert($takeawayRequest, $userInfo->restaurantId); if ($takeawayResult) { $takeawayEntry = $this->getTableObj()->getSingleTakeaway($takeawayResult, $userInfo->restaurantId); $syncController = new SyncController(); $syncResult = $syncController->takeawayEntry($takeawayRequest->userId, json_encode($takeawayEntry), INSERT_OPERATION, $userInfo->restaurantId); } return $takeawayResult; }