Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Oct 8th, 2010  |  syntax: PHP  |  size: 2.89 KB  |  views: 118  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Index: www/dataobject_manager/code/HasManyFileDataObjectManager.php
  2. ===================================================================
  3. --- www/dataobject_manager/code/HasManyFileDataObjectManager.php        (revision 90)
  4. +++ www/dataobject_manager/code/HasManyFileDataObjectManager.php        (working copy)
  5. @@ -58,23 +58,23 @@
  6.        
  7.         function getQuery($limitClause = null) {
  8.                 if($this->customQuery) {
  9. -                       $query = $this->customQuery;
  10. +                       $query = clone $this->customQuery;
  11.                         $query->select[] = "{$this->sourceClass}.ID AS ID";
  12.                         $query->select[] = "{$this->sourceClass}.ClassName AS ClassName";
  13.                         $query->select[] = "{$this->sourceClass}.ClassName AS RecordClassName";
  14.                 }
  15.                 else {
  16. -                       $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter, $this->sourceSort, $limitClause, $this->sourceJoin);
  17. +                       $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter(), $this->sourceSort, $limitClause, $this->sourceJoin);
  18.                        
  19.                         // Add more selected fields if they are from joined table.
  20.  
  21. -                       $SNG = singleton($this->sourceClass);
  22. +                       /*$SNG = singleton($this->sourceClass);
  23.                         foreach($this->FieldList() as $k => $title) {
  24.                                 if(! $SNG->hasField($k) && ! $SNG->hasMethod('get' . $k))
  25.                                         $query->select[] = $k;
  26. -                       }
  27. +                       }*/
  28.                 }
  29. -               return clone $query;
  30. +               return $query;
  31.         }
  32.        
  33.         public function setParentClass($class)
  34. Index: www/dataobject_manager/code/ManyManyFileDataObjectManager.php
  35. ===================================================================
  36. --- www/dataobject_manager/code/ManyManyFileDataObjectManager.php       (revision 90)
  37. +++ www/dataobject_manager/code/ManyManyFileDataObjectManager.php       (working copy)
  38. @@ -132,21 +132,21 @@
  39.                
  40.         function getQuery($limitClause = null) {
  41.                 if($this->customQuery) {
  42. -                       $query = $this->customQuery;
  43. +                       $query = clone $this->customQuery;
  44.                         $query->select[] = "{$this->sourceClass}.ID AS ID";
  45.                         $query->select[] = "{$this->sourceClass}.ClassName AS ClassName";
  46.                         $query->select[] = "{$this->sourceClass}.ClassName AS RecordClassName";
  47.                 }
  48.                 else {
  49. -                       $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter, $this->sourceSort, $limitClause, $this->sourceJoin);
  50. +                       $query = singleton($this->sourceClass)->extendedSQL($this->sourceFilter(), $this->sourceSort, $limitClause, $this->sourceJoin);
  51.                        
  52.                         // Add more selected fields if they are from joined table.
  53.  
  54. -                       $SNG = singleton($this->sourceClass);
  55. +                       /*$SNG = singleton($this->sourceClass);
  56.                         foreach($this->FieldList() as $k => $title) {
  57.                                 if(! $SNG->hasField($k) && ! $SNG->hasMethod('get' . $k))
  58.                                         $query->select[] = $k;
  59. -                       }
  60. +                       }*/
  61.                         $parent = $this->controllerClass();
  62.                         $mm = $this->manyManyTable;
  63.                         $if_clause = "IF(`$mm`.`{$this->manyManyParentClass}ID` IS NULL, '0', '1')";
  64. @@ -155,7 +155,7 @@
  65.                         if($this->OnlyRelated())
  66.                          $query->where[] = $if_clause;
  67.                 }
  68. -               return clone $query;
  69. +               return $query;
  70.         }