Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update known_issues.md #412

Merged
merged 1 commit into from
Jul 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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