/** * @param SwiftObject $object * * @throws SwiftException * * @return bool * * @see DriverInterface::updateObject() */ public function updateObject(SwiftObject $object) { if (is_null($object->getLocalFile()) && !$this->objectExists($object)) { throw new SwiftException('Cannot update a new object without a body'); } return $this->driver->updateObject($object); }
/** * @inheritdoc */ public function updateObject(SwiftObject $object) { // persist container $this->updateContainer($object->getContainer()); // see if local file is specified if (is_null($object->getLocalFile())) { // just update the headers return $this->updateObjectMetadata($object); } // timestamp the object $object->setLastModifiedDate(new \DateTime()); $this->logger->info(sprintf('Updating object "%s"', $object->getPath())); $response = $this->put($object->getPath(), null, $object->getUpdateHeaders(), $object->getBody()); return $this->assertResponse($response, [201 => true]); }