Skip to content

Commit

Permalink
Merge pull request #412 from Mondane/patch-1
Browse files Browse the repository at this point in the history
Update known_issues.md
  • Loading branch information
K-Phoen committed Jul 3, 2015
2 parents 04c208e + 081e2dd commit 5c0eff1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Resources/doc/known_issues.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ is the only updated.
A workaround to solve this issue is to manually generate a change:

```php
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;

class Product
{
// ...
Expand All @@ -23,11 +26,13 @@ class Product

// ...

public function setImage($image)
public function setImage(File $image)
{
$this->image = $image;

if ($this->image) {
// Only change the updated af if the file is really uploaded to avoid database updates.
// This is needed when the file should be set when loading the entity.
if ($this->image instanceof UploadedFile) {
$this->updatedAt = new \DateTime('now');
}
}
Expand Down

0 comments on commit 5c0eff1

Please sign in to comment.