public static function createObject($className, array $params = [])
    {
        $result = new $className;
        foreach ($params as $key => $val) {
            $methodName = 'set'.ucfirst($key);
            if (method_exists($result, $methodName)) {
                $result->$methodName($val);
            }
        }
        return $result;
    }
public static function createObject($className, array $params = [])
    {
        $result = new $className;
        foreach ($params as $key => $val) {
            $methodName = 'set'.ucfirst($key);
            if (method_exists($result, $methodName)) {
                $result->$methodName($val);
            }
        }
        return $result;
    }
public static function createObject ( $ className , array $ params = [ ] ) { $ result = new $ className ; foreach ( $ params as $ key => $ val ) { $ methodName = 'set' . ucfirst ( $ key ) ; if ( method_exists ( $ result , $ methodName ) ) { $ result -> $ methodName ( $ val ) ; } } return $ result ; }
Create object and set params

@param string $className
@param array $params
@return \pwf\helpers\className
Create object and set params