Skip to content

Instantly share code, notes, and snippets.

View MaximStrutinskiy's full-sized avatar
✍️
Open to new offers.

Maxim Strutinskiy MaximStrutinskiy

✍️
Open to new offers.
View GitHub Profile
//Get password for mapped => false
$pass = $this->getForm()->get('password')->getData();
//Get password for mapped => true
$pass = $this->getForm()->get('password')->getData();
$pass = $this->getForm()->get('password')->getData();
if ($pass !== null) {
$object->setPlainPassword($pass);
}
// if form is mapped => false;
$img = $form->get('img')->getData();
//if form is mapped => true
$img = $user->getImg();
if ($img !== NULL) {
// Generate a unique name for the file before saving it
$fileName = md5(uniqid()) . '.' . $img->getExtension();