public function findByRequest(Request $request)
    {
        $qb = $this->createQueryBuilder('s');

        if ($request->get('attribute')) {
            $qb->join('s.allowedInAttributes', 'a')
                ->andWhere('a.id = :attributeId')
                ->setParameter('attributeId', $request->get('attribute'));
        }

        return $qb->getQuery()->getArrayResult();
    }