如何在我的存储库中编写它以便能够在我的控制器中使用它?
NSString *string1 = @"Case Number \n 1 \n SKU Barcode";
NSString *string2 = @"Case Number";
if ([string1 rangeOfString:string2].location !=NSNotFound) {
NSLog(@"matched");}
else
{ NSLog(@"not matched");}
}
答案 0 :(得分:0)
试试这个:
public function findWhateverYouWant()
{
$em = $this->getEntityManager();
$rsm = new ResultSetMappingBuilder($em);
$sql = sprintf('SELECT COUNT(id_pnc)
FROM programmevol p
WHERE p.id_pnc IN ( SELECT id_pnc
FROM programmevol A
WHERE p.id_pnc=A.id_pnc
HAVING COUNT(*)>1
)',
$rsm->generateSelectClause()
);
$query = $em->createNativeQuery($sql, $rsm);
return $query->getResult();
}