1
0
mirror of synced 2025-01-18 22:41:43 +03:00
doctrine2/classes/Session/Mysql.class.php
doctrine 571cb46726
2006-04-13 20:37:28 +00:00

39 lines
1.1 KiB
PHP

<?php
/**
* mysql driver
*/
class Doctrine_Session_Mysql extends Doctrine_Session_Common {
/**
* deletes all data access object from the collection
* @param Doctrine_Collection $coll
*/
/**
public function deleteCollection(Doctrine_Collection $coll) {
$a = $coll->getTable()->getCompositePaths();
$a = array_merge(array($coll->getTable()->getComponentName()),$a);
$graph = new Doctrine_DQL_Parser($this);
foreach($coll as $k=>$record) {
switch($record->getState()):
case Doctrine_Record::STATE_DIRTY:
case Doctrine_Record::STATE_CLEAN:
$ids[] = $record->getID();
break;
endswitch;
}
if(empty($ids))
return array();
$graph->parseQuery("FROM ".implode(", ",$a)." WHERE ".$coll->getTable()->getTableName().".id IN(".implode(", ",$ids).")");
$query = $graph->buildDelete();
$this->getDBH()->query($query);
return $ids;
}
*/
}
?>