$query->
where('shop.id = :id'
);
$query->
setParameter(':id',
$shop['id'
]);
$shop =
$query->
getQuery()->
getOneOrNullResult(AbstractQuery::HYDRATE_OBJECT
);
return $this->
fixActive($shop);
} private function getShopsArrayByHost(string
$host): array
{ $query =
$this->
getDbalShopsQuery();
$query->
andWhere('shop.active = 1'
);
$query->
andWhere('(shop.host = :host OR (shop.host IS NULL AND main_shop.host = :host))'
);
$query->
setParameter(':host',
$host);
$shops =
$query->
execute()->
fetchAllAssociative();
usort($shops,
function Darray
$a, array
$b): int
{ if ($a['is_main'
] && !
$b['is_main'
]) { return -1;
} if (!
$a['is_main'
] &&
$b['is_main'
]) {