Listing 19.6. Metoda fromArray() klasy Entity
/**
 * Sets properties using array
 *
 * @param array $data
 */
public function fromArray(array $data)
{
    foreach ($data as $key => $value) {
        $methodName = 'set' . ucfirst($key);
        $this->$methodName($value);
    }
}