Skip to content

Instantly share code, notes, and snippets.

@teresko
Created November 20, 2014 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teresko/4f09e3ed351bcb19d4fe to your computer and use it in GitHub Desktop.
Save teresko/4f09e3ed351bcb19d4fe to your computer and use it in GitHub Desktop.
<?php
namespace Components;
class DomainObject
{
public function setParameters(array $list)
{
foreach ($list as $key => $value) {
$method = 'set' . $key;
if (method_exists($this, $method)) {
$this->{$method}($value);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment