Callback for $this->menuWidget() method.
@param array $data data to process.
@return array processed data.
970799
public function menuCallback($data)
    {
        $contextMenu          = ARTreeMenuWidget::this()->commonOptions()['contextmenu'];
        $contextMenu['items'] = [
            'create' => $contextMenu['items']['create'],
            'delete' => $contextMenu['items']['delete']
        ];
        $data['options']      = ['types' => $this->types, 'contextmenu' => $contextMenu];
        $items = AuthItem::find()
            ->where(['type' => \yii\rbac\Item::TYPE_ROLE])
            ->indexBy('name')->all();
        $relations = AuthItemChild::find()->all();
        $data['items'] = $this->generateTree($items, $relations);
        return $data;
    }
999788
public function setPropertyData(array $data)
    {
        $this->propertyData = $data;

        if (!$this->isMergingWidgetData) {
            $this->setCoreData($this->propertyData);
        }

        if ($this->property) {
            $this->property->setData($data);
        }

        return $this;
    }
391893
public function readFromArray(array $data) : array
    {
        foreach($data as $key => $value)
        {
            if (is_string($value)){
                $value = $this->macro_processor->process($value);
                $data[$key] = $value;
            }
            else if(is_array($value)){
                $data[$key] = $this->readFromArray($value);
            }
        }
        return $data;
    }
1142678
private function process(array $data) {
    // Group items at first.
    $grouped = [];
    foreach ($data as $locationId => $locationItems) {
      foreach ($locationItems as $item) {
        $grouped[$locationId][$item['class_id']][] = $item;
      }
    }

    $hashes = [];
    $processed = [];

    foreach ($grouped as $locationId => $locationData) {
      foreach ($locationData as $classId => $classData) {
        $hashes[$locationId][$classId] = (string) md5(serialize($classData));

        foreach ($classData as $class) {
          $this->cleanUpTitle($class);
          $class['location_id'] = $locationId;
          $processed[$locationId][$classId][] = $class;
        }
      }
    }

    $this->hashes = $hashes;

    return $processed;
  }
1374487
protected function fromArray($data)
    {
        if (empty($data)) {
            return $this;
        }

        $this->data = array_replace_recursive($this->data, $data);

        return $this;
    }
533693
public function data(...$args)
    {
        if (isset($args[0]) && is_array($args[0])) {
            $this->data = array_merge($this->data, array_change_key_case($args[0]));

            // Cascade data to item's children if cascade_data option is enabled
            if ($this->menu->config->cascadeData) {
                $this->cascadeData(...$args);
            }
            return $this;
        } elseif (isset($args[0]) && isset($args[1])) {
            $this->data[strtolower($args[0])] = $args[1];

            // Cascade data to item's children if cascade_data option is enabled
            if ($this->menu->config->cascadeData) {
                $this->cascadeData(...$args);
            }
            return $this;
        } elseif (isset($args[0])) {
            return isset($this->data[$args[0]]) ? $this->data[$args[0]] : null;
        }

        return $this->data;
    }
1329760
protected function __apiStore(array $data = null)
    {
        if (is_null($data))
            $data = $this->getInputData();

        $record = HCPages::create(array_get($data, 'record'));
        $record->updateTranslations(array_get($data, 'translations'));
        $record->categories()->sync(array_get($data, 'categories', []));


        return $this->apiShow($record->id);
    }
8058
public function get($data = [])
	{
		// Process data given.
		$processPayload = $this->process(__FUNCTION__, $data);

		if( ! $processPayload->isStatus(Payload::STATUS_VALID))
		{
			return $processPayload;
		}

		return $this->dataSource->get($data);
	}
884495
protected function prepareData($data)
    {
        $profiler = $data->item['profiler'];

        // Find system process points
        $points = (array) $profiler->getPoints();

        $data->systemProcess = TimelineHelper::prepareTimeline($points, 'system.process');
        $data->allProcess    = TimelineHelper::prepareTimeline($points);
    }
1268796
public function getChartData(array $data = []) : array
    {
        $chartData = parent::getChartData($data);

        $chartData["options"]["dataChart"]["type"] = $this->type;

        return $chartData;
    }
261923
private function asData(array $data)
    {
        foreach ($data as $key => $value) {
            if ($value instanceof RawSqlFragmentInterface) {
                $data[$key] = $value->getFragment();
            } elseif ($value instanceof RawBindingInterface) {
                $data[$key] = $value->getTarget();
            } else {
                $placeholder = $this->getUniqPlaceholder();

                $data[$key] = $placeholder;
                $this->bind($placeholder, $value);
            }
        }

        return $data;
    }
1336405
public function getChartData(array $data = []) : array
    {
        $chartData = [
            'chart' => $this->type,
            'options' => [
                'element' => $this->getContainerId(),
                'resize' => true,
            ],
        ];

        $options = [
            'data' => $data,
        ];

        $chartData['options'] = array_merge($chartData['options'], $options);

        if (!empty($data)) {
            $this->setData($chartData);
        }

        return $chartData;
    }
34629
public static function getRoutesDataFromData(array $data): array
    {
        assert(array_key_exists(self::KEY_ROUTES_DATA, $data));
        $result = $data[self::KEY_ROUTES_DATA];

        return $result;
    }
1338390
private function mergePresetWidget(array $data)
    {
        if (!isset($data['preset']) || !is_string($data['preset'])) {
            return $data;
        }

        $widgetIdent = $data['preset'];

        if ($this instanceof ObjectContainerInterface) {
            if ($this->hasObj()) {
                $widgetIdent = $this->obj()->render($widgetIdent);
            }
        } elseif ($this instanceof ModelInterface) {
            $widgetIdent = $this->render($widgetIdent);
        }

        $presetWidgets = $this->config('widgets');
        if (!isset($presetWidgets[$widgetIdent])) {
            return $data;
        }

        $widgetData = $presetWidgets[$widgetIdent];
        if (isset($widgetData['attachable_objects'])) {
            $widgetData['attachable_objects'] = $this->mergePresetAttachableObjects(
                $widgetData['attachable_objects']
            );
        }

        if (isset($widgetData['default_attachable_objects'])) {
            $widgetData['attachable_objects'] = $this->mergePresetAttachableObjects(
                $widgetData['default_attachable_objects']
            );
        }

        return array_replace_recursive($widgetData, $data);
    }
463283
public function applyOrderAndAliases(array $data)
    {
        if ($this->orderAndAliases === null) {
            return $data;
        }

        $processedData = [];

        foreach ($this->orderAndAliases as $key => $value) {
            if (\is_integer($key)) {
                $fieldName = $value;
                $fieldAlias = $value;
            } else {
                $fieldName = $key;
                $fieldAlias = $value;
            }

            $processedData[$fieldAlias] = null;
            if (array_key_exists($fieldName, $data)) {
                $processedData[$fieldAlias] = $data[$fieldName];
            }
        }

        return $processedData;
    }
1248959
public function get_data() {
		$data = parent::get_data();

		$settings = $this->get_settings()[ $this->number ];

		if ( ! isset( $settings['menu'] ) ) {
			return $data;
		}

		$menu_items = wp_get_nav_menu_items( $settings['menu'] );

		foreach ( $menu_items as $menu_item ) {
			if ( ! $menu_item->menu_item_parent ) {
				$data['items'][] = [
					'title' => $menu_item->title,
					'link' => str_replace( site_url(), '', $menu_item->url ),
					'items' => self::get_sub_menu_items( $menu_items, $menu_item->ID ),
				];
			}
		}

		return $data;
	}
572627
public function selected( array $data )
    {
        if ( isset( $data['proxyData'] ) && is_string( $data['proxyData'] ) )
        {
            $data['proxyData'] = $this->parseProxyData( $data['proxyData'] );
        }

        return parent::selected( $data );
    }