Beispiel #1
0
 public function testFetchListAction()
 {
     /** @var $request Request */
     $request = $this->getRequest();
     $result = ['status' => 'error', 'msg' => TextConstants::ERROR];
     try {
         if ($request->isPost() && $request->isXmlHttpRequest()) {
             $connectionTest = new ConnectionTest($this->getServiceLocator());
             $result = $connectionTest->testFetchList($this->apartelId, true);
         } else {
             throw new \Exception(TextConstants::ERROR_BAD_REQUEST);
         }
     } catch (\Exception $ex) {
         $result['msg'] = $ex->getMessage();
     }
     return new JsonModel($result);
 }
Beispiel #2
0
 /**
  * @param $productId
  * @param bool $isApartel
  * @return array
  */
 public function isTestPassed($productId, $isApartel = false)
 {
     $test = new ConnectionTest($this->getServiceLocator());
     return $test->testFetchList($productId, $isApartel);
 }