如果我执行:
public function addAction()
{
$tag= Util::getTags($web);
$manager= $this->getDoctrine()->getManager();
//var_dump($tag);
for ($j=1; $j<=77;$j++) {
$video = $manager->getRepository('VideoBundle:Categoria')->findByName($tag[$j]);
echo $j;
var_dump($tag[$j]);
if(!$video){
$categor = new Categoria();
$categor->setName($tag[$j]);
$manager->persist($categor);
$manager->flush();
}
}
但如果$ j&lt; = 78未找到!
count($tag) is 1200!
我想也许Symfony只能连续进行77次咨询
抱歉我的英语!