Created
January 19, 2021 21:06
-
-
Save joram77/bd4ae0f640ce81d148045f78cab2cb2b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function setObjectPropertiesFromArray(Entity $item): void | |
{ | |
foreach ($_POST as $var => $value) { | |
if (is_callable(array($item, "set" . ucfirst($var)))) { | |
$item->{"set" . ucfirst($var)}($value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment