Magento问题?如何在表格中循环添加评论?

|| 我尝试通过循环增加注释数据,有以下代码
 $i=1;
    while($i<=2){
      $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))
          ->setEntityPkValue($product->getId())
          ->setStatusId(Mage_Review_Model_Review::STATUS_APPROVED)
          ->setCustomerId(Mage::getSingleton(\'customer/session\')->getCustomerId())
          ->setStoreId(Mage::app()->getStore()->getId())
          ->setStores(array(Mage::app()->getStore()->getId()))
          ->save();
      $i++;
    }
结果只有一个数据,没有我预期的两个数据。 请求帮助!谢谢!     
已邀请:
        我不知道为什么,但是您不能在方法/循环中两次使用$ variable。 请使用完整的Magento实例,即:
Mage::getModel(\'module/model\')
    
        使用Mage :: getModel(\'review / review \')-> getCollection();函数用于获取特定模块的所有模型数据。     

要回复问题请先登录注册