public function createFromArray($class, array $attributes)
    {
        $entity = new $class();
        foreach ($attributes as $name => $value) {
            if (property_exists($entity, $name)) {
                $methodName = $this->getSetterName($entity, $name);
                if ($methodName) {
                    $entity->{$methodName}($value);
                } else {
                    throw new InvalidPropertyException('Add/Setter method for property '.$name.' not found');
                }
            }
        }

        return $entity;
    }