Skip to content

Commit

Permalink
SoftDelete preDqlDelete conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
fruit committed Sep 15, 2010
1 parent 1203c3d commit 98dbbc2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/vendor/Doctrine/Template/Listener/Cachetaggable.php
Expand Up @@ -84,7 +84,7 @@ public function postDelete (Doctrine_Event $event)
}
catch (sfCacheException $e)
{

}

$this->preDeleteTagName = null;
Expand Down Expand Up @@ -145,7 +145,7 @@ public function postSave (Doctrine_Event $event)
{
$softDeleteTemplate = $object->getTable()->getTemplate('SoftDelete');
$deleteAtField = $softDeleteTemplate->getOption('name');

if (array_key_exists($deleteAtField, $lastModifiedColumns))
{
# skip if SoftDeletes sets deleted_at field
Expand Down Expand Up @@ -208,7 +208,7 @@ public function preDqlUpdate (Doctrine_Event $event)
{
$taggingCache->setTag($object->getTagName(), $updateVersion);
}

$taggingCache->setTag(
sfCacheTaggingToolkit::getBaseClassName(get_class($object)),
$updateVersion,
Expand Down Expand Up @@ -236,6 +236,12 @@ public function preDqlDelete (Doctrine_Event $event)
/* @var $q Doctrine_Query */
$q = clone $event->getQuery();

# SoftDelete mix DELETE with UPDATE type
if ($q->getType() != Doctrine_Query::DELETE)
{
return;
}

$params = $q->getParams();
$params['set'] = array();
$q->setParams($params);
Expand Down

0 comments on commit 98dbbc2

Please sign in to comment.