How to get all contacts associated with a particular segment in mautic?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How to get all contacts associated with a particular segment in mautic?



I want to list all the contacts associated with a particular segment in mautic but could not find any method for that.
Here is my controller code


class DefaultController extends FormController


public function listAction()

$model = $this->getModel('lead.list');


$items = $model->getEntities();

$listIds = array_keys($items->getIterator());

$leadCounts = (!empty($listIds)) ? $model->getRepository()->getLeadCount($listIds) : ;

$parameters = array('items' => $items , 'leadCounts' => $leadCounts);

return $this->delegateView(
array(
'viewParameters' => $parameters,
'contentTemplate' => 'MauticLeadPipelineBundle:Segments:index.html.php',
'passthroughVars' => array(
'activeLink' => 'tes_lead_pipelines',
'route' => $this->generateUrl('test_lead_pipelines')
)
)
);




In view what I need is to show segment name with a list all the contact names associated with it.


<?php foreach ($items as $key => $item) ?>
<th>
<?php echo $item->getAlias();?>


</th>
<?php ?>



I want a way so that I can fetch all the leads from that item object
I have tried $item->getLeads() but that didn't work.


$item->getLeads()









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard