/** * Transforms an object (WidgetMap) to an array. * * @param WidgetMap|null $widgetMap * @return string */ public function transform($widgetMap) { if (null === $widgetMap) { return array(); } $widgetMapAsArray = array('action' => $widgetMap->getAction(), 'position' => $widgetMap->getPosition(), 'asynchronous' => $widgetMap->isAsynchronous(), 'positionReference' => $widgetMap->getPositionReference(), 'replacedWidgetId' => $widgetMap->getReplacedWidgetId(), 'widgetId' => $widgetMap->getWidgetId()); return $widgetMapAsArray; }