public function __construct($id) { if (empty($id)) { throw new \InvalidParameterException('Id missing for WidgetDefinition'); } $this->id = $id; }