/** * Adds a new WidgetArea to the product if not existing yet. * * @param WidgetArea $widgetArea Optional WidgetArea to use as fallback * * @return WidgetArea * * @author Sebastian Diel <*****@*****.**> * @since 06.03.2014 */ public function addWidgetAreaIfNotExists($widgetArea = null) { if ($this->WidgetAreaID == 0 || $widgetArea instanceof WidgetArea && !$widgetArea->exists()) { $widgetArea = new WidgetArea(); $widgetArea->write(); $this->WidgetAreaID = $widgetArea->ID; $this->write(); } return $widgetArea; }