Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7bf51a8

Browse files
committed
[symfony#2454] Manually adding changes that wouldn't patch cleanly to 2.0
1 parent803b3cf commit7bf51a8

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

‎cookbook/doctrine/file_uploads.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ object, which is what's returned after a ``file`` field is submitted::
321321
$this->path = $this->getFile()->getClientOriginalName();
322322

323323
// clean up the file property as you won't need it anymore
324-
$this->setFile(null);
324+
$this->file =null;
325325
}
326326

327327
Using Lifecycle Callbacks
@@ -407,16 +407,14 @@ Next, refactor the ``Document`` class to take advantage of these callbacks::
407407
// the entity from being persisted to the database on error
408408
$this->getFile()->move($this->getUploadRootDir(), $this->path);
409409

410-
411-
412410
// check if we have an old image
413411
if (isset($this->temp)) {
414412
// delete the old image
415413
unlink($this->getUploadRootDir().'/'.$this->temp);
416414
// clear the temp image path
417415
$this->temp = null;
418416
}
419-
$this->setFile(null);
417+
$this->file =null;
420418
}
421419

422420
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp