/**
  * Delete a sales funnel
  * @trigger : deleteSalesFunnel.pre, deleteSalesFunnel.post
  * @param FrontContactsContactEntity $objContact
  * @param FrontSalesFunnelContactSalesFunnelEntity $objSalesFunnel
  * @return \FrontSalesFunnels\Entities\FrontSalesFunnelContactSalesFunnelEntity
  */
 public function deleteSalesFunnel(FrontContactsContactEntity $objContact, FrontSalesFunnelContactSalesFunnelEntity $objSalesFunnel)
 {
     //trigger pre event
     $result = $this->getEventManager()->trigger(__FUNCTION__ . ".pre", $this, array("objSalesFunnel" => $objSalesFunnel));
     //create the request object
     $objApiRequest = $this->getApiRequestModel();
     //setup the object and specify the action
     $objApiRequest->setApiAction("sales-funnels/admin/" . $objSalesFunnel->get("id") . "?contact_id=" . $objContact->get("id"));
     //execute
     $objResult = $objApiRequest->performDELETERequest(array())->getBody();
     //trigger post event
     $result = $this->getEventManager()->trigger(__FUNCTION__ . ".pre", $this, array("objSalesFunnel" => $objSalesFunnel));
     return $objSalesFunnel;
 }
 /**
  * Update a contact within a profile
  * @trigger : updateContact.pre, updateContact.post
  * @param FrontContactsContactEntity $objContact
  * @param string $form_id - Optional
  * @return \FrontContacts\Entities\FrontContactsContactEntity
  */
 public function updateContact(FrontContactsContactEntity $objContact, $form_id = "")
 {
     //trigger pre event
     $result = $this->getEventManager()->trigger(__FUNCTION__ . ".pre", array("objContact" => $objContact));
     //create the request object
     $objApiRequest = $this->getApiRequestModel();
     //setup the object and specify the action
     if ($form_id != "") {
         $objApiRequest->setApiAction($objContact->getHyperMedia("edit-contact")->url . "?fid={$form_id}");
     } else {
         $objApiRequest->setApiAction($objContact->getHyperMedia("edit-contact")->url);
     }
     //end if
     $objApiRequest->setApiModule(NULL);
     //execute
     $objContact = $objApiRequest->performPUTRequest($objContact->getArrayCopy())->getBody();
     //recreate contact entity
     $objContact = $this->createContactEntity($objContact->data);
     //trigger post event
     $result = $this->getEventManager()->trigger(__FUNCTION__ . ".pre", array("objContact" => $objContact));
     return $objContact;
 }