Мне нужно документировать в диаграмме последовательности UML метод setRepresentative
. Это метод код:Поток для условных выражений внутри диаграммы последовательности
class ReptoolController extends PageController {
private function setRepresentative($request, $action, $case)
{
...
$repappConfig = new RepappConfig();
$repappConfig = $this->getDoctrine()->getRepository('AppBundle:RepappConfig')->findOneBy(array("app_id"=>$id));
$project_id = $repappConfig->getProjectId();
$company_id = $repappConfig->getCompanyId();
$project = $this->getDoctrine()->getRepository('AppBundle:Project')->find($project_id);
$brand = $this->getDoctrine()->getRepository('AppBundle:Brand')->findOneBy(array("project"=>$project_id));
$company = $this->getDoctrine()->getRepository('AppBundle:Company')->find($company_id);
$territory = new Territory();
if(is_numeric($territory_name))
{
$tempName = "ID";
}
else
{
$tempName = "territory";
}
if($territory = $this->getDoctrine()->getRepository('AppBundle:Territory')->findOneBy(array($tempName=>$territory_name)))
{
$territory_id = $territory->getID();
$response->territory_id = $territory_id;
if($brand)
{
$is_enabled = 1;
$position = 1;
$brand_id = $brand->getID();
$terr_brand_xrf = $this->getDoctrine()->getRepository('AppBundle:TerritoryBrandXref')->findOneBy(array("territory"=>$territory_id, "brand"=>$brand_id));
if(!$terr_brand_xrf)
{
$terr_brand_xref = new TerritoryBrandXref($territory,$brand,$position);
$terr_brand_xref->setIsEnabled($is_enabled);
$terr_brand_xref->updateTimestamps();
$em = $this->getDoctrine()->getEntityManager();
$em->persist($terr_brand_xref);
$em->flush();
}
}
}
else
{
$territory->setTerritory($territory_name);
$territory->setProject($project);
$em = $this->getDoctrine()->getEntityManager();
$em->persist($territory);
$em->flush();
$territory_id = $territory->getID();
$response->territory_id = $territory_id;
if($brand)
{
$is_enabled = 1;
$position = 1;
$brand_id = $brand->getID();
$response->brand_id= $brand_id;
$terr_brand_xref = new TerritoryBrandXref($territory,$brand,$position);
$terr_brand_xref->setIsEnabled($is_enabled);
$terr_brand_xref->updateTimestamps();
$em = $this->getDoctrine()->getEntityManager();
$em->persist($terr_brand_xref);
$em->flush();
}
}
$controller_response = new Response(json_encode($response));
$controller_response->headers->set('Content-Type', 'application/json; charset=utf-8');
return $controller_response;
}
}
Это диаграмма, как я сейчас:
Как диаграмме условными внутри этой части кода:
if($territory = $this->getDoctrine()->getRepository('PDOneBundle:Territory')->findOneBy(array($tempName=>$territory_name)))
{
...
} else {
...
}
Как мне вызвать внутренние методы?
Пожалуйста, не просите нас решить проблему за вас. Покажите нам, как _you_ попытался решить проблему самостоятельно, а затем покажите нам _exactly_, каким был результат, и скажите, почему вы считаете, что это не сработало. См. «[Что вы пробовали?] (Http://whathaveyoutried.com/)» за отличную статью, которую вы действительно должны прочитать. –
@JohnSaunders мой плохой, я забыл прикрепить изображение, я уже исправил его, посмотрите – ReynierPM
Разрешение изображения слишком мало, чтобы его прочитать ... –