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