Example #1
0
 /**
  * This method looks for uploaded files. If we have, get the ID of the object, and update the database according the upload field
  * @param Route $route
  * @param object $objectID
  */
 private function processFilesWithID($route, $objectID)
 {
     //Process files
     if (count($_FILES) > 0) {
         //we got files... process them
         foreach ($_FILES as $fileField => $f) {
             if ($route->getFileProcessor($fileField) != NULL) {
                 //We have to process
                 $processor = $route->getFileProcessor($fileField);
                 $upload = $processor->saveUploadFile($objectID, $route->routeName, $f);
                 $newData = array($route->primaryKey->fieldName => $objectID, $fileField => $upload["destination"]);
                 $this->updateObjectFromRoute($route->routeName, $objectID, $newData);
             }
         }
     }
 }