I am trying to represent the function below (PHP function/Symfony2) as a sequence diagram using UML 2.0 and Visual Paradigm:private function getVeevaHcpSync($request, $action, $case){       set_time_limit(0);    $mode = tmb;    $territory_name= ;    if($request->getMethod() == POST)    {        $id = $request->get('app_id');        if($request->get('mode'))            $mode = $request->get('mode');        if($request->get('territory'))            $territory_name = $request->get('territory');        $reptool_records = $this->getRequestedSyncPost(sync,$request);    } else {        $id = $this->getRequested('app_id');        if($this->getRequested('mode'))            $mode = $this->getRequested('mode');        if($this->getRequested('territory'))            $territory_name = $this->getRequested('territory');        $reptool_records = $this->getRequestedSync();    }    $response = new \stdClass();    $response->status = FormUtilities::RESPONSE_STATUS_VALID;    $sync = array();    $veeva_hcp_ids = array();    $terr_hcp_ids = array();    if( ( $salesforceConfig =   $this->getDoctrine()->getRepository('PDOneBundle:RepappConfig')->findOneBy(array(app_id=>$id))) )    {        $project_id = $salesforceConfig->getProjectId();        if (isset($territory_name) && !empty($territory_name))        {            $terrHcps = $this->getDoctrine()->getRepository('PDOneBundle:Hcp')->findAllHcpsByTerritory($territory_name,$project_id);        } else {                    foreach($reptool_records as $reptool_record)            {                $territoryObj = $this->getDoctrine()->getRepository('PDOneBundle:Territory')->findTerritoryByHcpId($reptool_record->id);                if (isset($territoryObj[0]) && !empty($territoryObj[0]))                 {                    $terrHcps = $this->getDoctrine()->getRepository('PDOneBundle:Hcp')->findAllHcpsByTerritory($territoryObj[0]->getTerritory(), $project_id);                    $territory = $territoryObj[0]->getTerritory();                    break;                }             }        }     }    $response->sync = $sync;    $controller_response = new Response( json_encode($response) );    $controller_response->headers->set('Content-Type', 'application/json; charset=utf-8');    return $controller_response;}But I do not know if I should represent the whole flow or just the significant parts, what would you do? This is how my diagram looks like:I'm pretty sure it's complete wrong so:How can assign function returns to a var and use that var in a conditional?How you would do the diagram for this function?
Var assignment in sequence diagram
uml;variables;sequence diagram