for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Loevgaard\DandomainAltapayBundle\Entity;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
class TerminalRepository extends EntityRepository implements ContainerAwareInterface
{
use ContainerAwareTrait;
/**
* @param string $title
* @param bool $fetch
*
* @return Terminal|null
*/
public function findTerminalByTitle(string $title, $fetch = false): ?Terminal
/** @var Terminal $terminal */
$terminal = $this->findOneBy([
'title' => $title,
]);
if (!$terminal && $fetch) {
$this->sync();
return $this->findTerminalByTitle($title, false);
}
return $terminal;
* @param string $slug
public function findTerminalBySlug(string $slug, $fetch = false): ?Terminal
'slug' => $slug,
return $this->findTerminalBySlug($slug, false);
private function sync()
$this->container->get('loevgaard_dandomain_altapay.terminal_synchronizer')->syncAll();