Skip to content

Commit bac7612

Browse files
committed
Fix file error
1 parent 595d6ef commit bac7612

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cookbook/doctrine/file_uploads.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ look like this::
120120
Next, create this property on your ``Document`` class and add some validation
121121
rules::
122122

123-
use Symfony\Component\HttpFoundation\File\UploadedFile;
123+
use Symfony\Component\HttpFoundation\File\UploadedFile;
124124

125125
// ...
126+
126127
class Document
127128
{
128129
/**
@@ -322,7 +323,7 @@ object, which is what's returned after a ``file`` field is submitted::
322323
$this->path = $this->getFile()->getClientOriginalName();
323324

324325
// clean up the file property as you won't need it anymore
325-
$this->setFile(null);
326+
$this->file = null;
326327
}
327328

328329
Using Lifecycle Callbacks
@@ -417,7 +418,7 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
417418
// clear the temp image path
418419
$this->temp = null;
419420
}
420-
$this->setFile(null);
421+
$this->file = null;
421422
}
422423

423424
/**

0 commit comments

Comments
 (0)