private function deleteRows(PersistentCollection $coll, array $options)
{
list($propertyPath, $parent) = $this->getPathAndParent($coll);
$deleteDiff = $coll->getDeleteDiff();
if ($deleteDiff) {
$query = array($this->cmd.'unset' => array());
foreach ($deleteDiff as $key => $document) {
$query[$this->cmd.'unset'][$propertyPath.'.'.$key] = true;
}
$this->executeQuery($parent, $query, $options);
/**
* @todo This is a hack right now because we don't have a proper way to remove
* an element from an array by its key. Unsetting the key results in the element
* being left in the array as null so we have to pull null values.
*
* "Using "$unset" with an expression like this "array.$" will result in the array item becoming null, not being removed. You can issue an update with "{$pull:{x:null}}" to remove all nulls."
* http://www.mongodb.org/display/DOCS/Updating#Updating-%24unset
*/
$this->executeQuery($parent, array($this->cmd.'pull' => array($propertyPath => null)), $options);
}
}