public function save() { if (!$this->cssgenerator instanceof CSSGenerator) { throw new \Exception('CSSGenerator not set'); } return parent::save(); }