00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00016 final class ManyToManyLinkedLazy extends ManyToManyLinkedWorker
00017 {
00022 public function sync(&$insert, &$update = array(), &$delete)
00023 {
00024 Assert::isTrue($update === array());
00025
00026 $dao = $this->container->getDao();
00027
00028 $db = DBPool::getByDao($dao);
00029
00030 if ($insert)
00031 for ($i = 0, $size = count($insert); $i < $size; ++$i)
00032 $db->queryNull($this->makeInsertQuery($insert[$i]));
00033
00034 if ($delete) {
00035 $db->queryNull($this->makeDeleteQuery($delete));
00036
00037 $dao->uncacheByIds($delete);
00038 }
00039
00040 return $this;
00041 }
00042
00046 public function makeFetchQuery()
00047 {
00048 $uc = $this->container;
00049
00050 return
00051 $this->joinHelperTable(
00052 $this->makeSelectQuery()->
00053 dropFields()->
00054 get(
00055 new DBField(
00056 $uc->getChildIdField(),
00057 $uc->getHelperTable()
00058 )
00059 )
00060 );
00061 }
00062 }
00063 ?>