Php 在Symfony中使用spreep进行批量更新

Php 在Symfony中使用spreep进行批量更新,php,join,symfony-1.4,propel,Php,Join,Symfony 1.4,Propel,当我的选择条件中包含连接时,如何使用推进在symfony中进行批量更新?这里有一个我正在尝试做的例子 $conn = Propel::getConnection(BudgetLinePeer::DATABASE_NAME); // Create a Criteria object that will select the correct rows from the database $selectCriteria = new Criteria(); $selectCrit

当我的选择条件中包含连接时,如何使用推进在symfony中进行批量更新?这里有一个我正在尝试做的例子

$conn = Propel::getConnection(BudgetLinePeer::DATABASE_NAME);
// Create a Criteria object that will select the correct rows from the database
$selectCriteria = new Criteria();            
$selectCriteria->add(BudgetLinePeer::IDCOL1, $idcol1, Criteria::EQUAL);
$selectCriteria->addJoin(ProjectBudgetLinePeer::IDBUDGET_LINE, BudgetLinePeer::IDBUDGET_LINE);
$selectCriteria->add(ProjectBudgetLinePeer::IDCLIENT, $idclient, Criteria::EQUAL);
$selectCriteria->add(ProjectBudgetLinePeer::IDPROJECT, $project->getIdproject(), Criteria::EQUAL);
// Create a Criteria object includes the value you want to set
$updateCriteria = new Criteria();
$updateCriteria->add(BudgetLinePeer::STATUS, $status);
// Execute the query
BasePeer::doUpdate($selectCriteria, $updateCriteria, $conn);
我正在尝试在表BudgetLine中进行更新(更新新状态)

编辑:以下是我收到的错误片段:

为中的foreach()提供的参数无效 /Applications/MAMP/htdocs/proj_ict_new/trunk/cbm/plugins/sfpropelloplugin/lib/vendor/prople/runtime/lib/util/BasePeer.php 第369行


这与join语句有关。我试图使用
useXYZQuery()->filterCon()->endUse()
。但最后又出现了同样的错误。

我找到了解决这个问题的另一种方法。以下是解决方案:

$budgetLine_ids = BudgetLineQuery::create()
                 ->filterByIdcol1($col1)
                 ->useProjectBudgetLineQuery()
                 ->filterbyIdproject()->endUse()->find()->toArray('budgetline_id');

$selectCriteria = BudgetLineQuery::create()->filterByIdbudgetLine(array_keys($budgetLine_ids));      

// Create a Criteria object includes the value you want to set
$updateCriteria = new Criteria();
$updateCriteria->add(BudgetLinePeer::STATUS, $status);
// Execute the query
BasePeer::doUpdate($selectCriteria, $updateCriteria, $conn);

那么,问题是什么?