protected function checkFieldsSet($fields)
    {
        foreach ($fields as $field) {
            if (property_exists($this, $field) && $this->$field === null) {
                throw new \Exception("'$field' is required");
            }

        }

    }