Last active
April 13, 2021 13:00
-
-
Save HongKilDong/33370b89edb1133d2892c3f95e6c7b35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Entity; | |
use Symfony\Component\HttpFoundation\File\File; | |
class Attachment | |
{ | |
/** | |
* @param File|null $image | |
* @throws \Exception | |
*/ | |
public function setMediaFile(File $image) | |
{ | |
$this->mediaFile = $image; | |
$this->setContentHash(md5_file($image-getPathname())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment