Skip to content

Instantly share code, notes, and snippets.

@linxlad
Created July 3, 2015 12:12
Show Gist options
  • Save linxlad/69cc750e4d35dd0fb9b5 to your computer and use it in GitHub Desktop.
Save linxlad/69cc750e4d35dd0fb9b5 to your computer and use it in GitHub Desktop.
// Configure any shout boxes
$shoutBoxes = [];
$shouts = $this->entityManager->getRepository('AppBundle:ShoutBox')
->findBy(['active' => 'active', 'deleted' => 0]);
if (!empty($shouts)) {
foreach ($shouts as $index => $shout) {
$shoutBoxes[$index] = [
'name' => $shout->getName(),
'icon' => '',
'title' => $shout->getTitle(),
'content' => $shout->getContent()
];
foreach ($shout->getActions() as $action) {
$shoutBoxes[$index]['actions'] = [
'label' => $action->getLabelText(),
'icon' => $action->getIcon(),
'url' => $action->getUrl()
];
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment