Example #1
0
 /**
  * Resets the state of this update service
  * @return $this
  */
 public function reset()
 {
     $this->joinMap = array();
     return parent::reset();
 }
 protected function search(Params $params, SearchService $searchService)
 {
     return new JsonModel($this->fzySearchResult($searchService->search($params)));
 }
Example #3
0
 /**
  * @param  Param                                    $params
  * @param  bool                                     $readonly
  * @return $this
  * @throws \FzyCommon\Exception\Update\FailedLookup
  */
 public function setMainEntityFromParam(Params $params, SearchService $search)
 {
     $mainEntity = null;
     try {
         $mainEntity = $search->identitySearch($params);
         $this->setOperation(self::OPERATION_UPDATE);
     } catch (NotFound $e) {
         $mainEntity = $this->createNewEntity($params);
         $this->setOperation(self::OPERATION_CREATE);
     }
     $this->setEntity($mainEntity);
     return $this;
 }