Added setObjects method to AbstractDatabaseObjectAction
authorMarcel Werk <burntime@woltlab.com>
Wed, 2 Nov 2011 21:06:06 +0000 (22:06 +0100)
committerMarcel Werk <burntime@woltlab.com>
Wed, 2 Nov 2011 21:06:06 +0000 (22:06 +0100)
wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php

index f5672f2d3508e700767ce86d69db11469c1d4a64..5f66ed84123eca053d284c2c486080210058fbdb 100644 (file)
@@ -152,6 +152,15 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction {
                return $this->objectIDs;
        }
        
+       /**
+        * Sets the database objects.
+        * 
+        * @param       array<wcf\data\DatabaseObject>          $objects
+        */
+       public function setObjects(array $objects) {
+               $this->objects = $objects;
+       }
+       
        /**
         * @see wcf\data\IDatabaseObjectAction::getParameters()
         */
@@ -205,7 +214,9 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction {
                }
                
                // read data
-               $this->readObjects();
+               if (!count($this->objects)) {
+                       $this->readObjects();
+               }
                
                if (!count($this->objects)) {
                        throw new ValidateActionException('Invalid object id');
@@ -230,7 +241,9 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction {
                }
                
                // read data
-               $this->readObjects();
+               if (!count($this->objects)) {
+                       $this->readObjects();
+               }
                
                if (!count($this->objects)) {
                        throw new ValidateActionException('Invalid object id');