Gets an associative array of data that can be accessed in
notification fields and templates
@return array
186900
public function getNotificationTemplateData()
    {
        $fields = $this->Context->getValues();
        if (!is_array($fields)) {
            $fields = [];
        }
        $fields['Content'] = $this->Content;
        return $fields;
    }
99214
public function toArray()
    {
        $data = [
            'name' => $this->getName(),
            'text' => $this->getText(),
            'type' => $this->getType(),
            'style' => $this->getStyle(),
        ];

        if($this->getUrl()) $data['url'] = $this->getUrl();
        if($this->getValue()) $data['value'] = $this->getValue();
        if($this->getConfirm()) $data['confirm'] = $this->getConfirm()->toArray();
        if($this->getOptions()) $data['options'] = $this->getOptions();
        if($this->getOptionGroups()) $data['option_groups'] = $this->getOptionGroups();
        if($this->getDataSource()) $data['data_source'] = $this->getDataSource();
        if($this->getSelectedOptions()) $data['selected_options'] = $this->getSelectedOptions();
        if($this->getMinQueryLength()) $data['min_query_length'] = $this->getMinQueryLength();

        return $data;
    }
39868
public function getData()
    {
        $data = [];

        $problems = $this->fetcher->fetch();

        $allowedSeverities = [
            Problem::SEVERITY_CRITICAL,
            Problem::SEVERITY_WARNING,
        ];

        foreach ($problems as $problem) {
            if (!in_array($problem->getSeverity(), $allowedSeverities)) {
                continue;
            }

            $data[] = [
                'id' => strlen($problem->getId()) ? $problem->getId() : md5(serialize($problem)),
                'iconCls' => $problem->getIconClass(),
                'severity' => $problem->getSeverity(),
                'msg' => $problem->getMessage(),
                'hint' => $problem->getHint(),
                'link' => $problem->getLink(),
            ];
        }

        if (!count($data)) {
            $data = false;
        }

        return $data;
    }
778306
public function getAccessTokenData()
    {
        if ($this->isOauth1()) {
            return array(
                'access_token'        => $this->_access_token,
                'access_token_secret' => $this->_access_token_secret,
                'expires'             => $this->_expires,
            );
        }

        return array(
            'access_token'  => $this->_access_token,
            'expires'       => $this->_expires,
            'token_type'    => $this->_token_type,
            'refresh_token' => $this->_refresh_token
        );
    }
1078957
public function toArray()
    {
        return [
            'text' => $this->getText($this->getModel()),
            'attributes' => $this->getConditionAttributes($this->model)->htmlAttributesToString(),
            'url' => $this->getUrl($this->getModel()),
            'position' => $this->getPosition(),
            'icon' => $this->getIcon(),
            'hideText' => $this->hideText,
        ];
    }
418387
protected function buttonMessageToArray()
    {
        $message = [];
        $message['recipient'] = $this->recipient;
        $message['notification_type'] = $this->notificationType;
        $message['message']['attachment']['type'] = 'template';
        $message['message']['attachment']['payload']['template_type'] = 'button';
        $message['message']['attachment']['payload']['text'] = $this->text;
        $message['message']['attachment']['payload']['buttons'] = $this->buttons;

        return $message;
    }
1209882
public function toArray()
	{
		$result = parent::toArray();

		if (isset($result['activated']))
		{
			$result['activated'] = $this->getActivatedAttribute($result['activated']);
		}
		if (isset($result['permissions']))
		{
			$result['permissions'] = $this->getPermissionsAttribute($result['permissions']);
		}
		if (isset($result['suspended_at']))
		{
			$result['suspended_at'] = $result['suspended_at']->format('Y-m-d H:i:s');
		}

		return $result;
	}
313843
public function toArray(): array
    {
        return [
            'name' => $this->name,
            'text' => $this->text,
            'type' => $this->type,
            'value' => $this->value,
            'style' => $this->style,
            'confirm' => $this->confirmation,
        ];
    }
754688
public function getData()
    {
        return [
            'recipient' => $this->user_ref ? ['user_ref' => $this->recipient] : ['id' => $this->recipient],
            'message' => [
                'text' => $this->text
            ],
            'tag'=> $this->tag,
            'notification_type'=> $this->notification_type,
            'messaging_type' => $this->messaging_type
        ];
    }
319491
public function getTemplateData($context, $user = null, $extraData = [])
    {
        // useful global data
        $data = [
            'ThemeDirs' => new ArrayList(SSViewer::get_themes()),
            'SiteConfig' => SiteConfig::current_site_config(),
        ];

        // the context object, keyed by it's class name
        $clsPath = explode('\\', get_class($context));
        $data[end($clsPath)] = $context;
        $data['Context'] = $context;

        // data as defined by the context object
        $contextData = method_exists($context, 'getNotificationTemplateData') ? $context->getNotificationTemplateData() : null;
        if (is_array($contextData)) {
            $data = array_merge($data, $contextData);
        }

        // the member the notification is being sent to
        $data['Member'] = $user;

        // extra data
        $data = array_merge($data, $extraData);

        return ArrayData::create($data);
    }
536022
public function getData()
    {
        $return = array();
        $relations = $this->ContentObjectAttribute->attribute( 'content' );
        foreach ( $relations['relation_list'] as $relation )
        {
            $object = eZContentObject::fetch( $relation['contentobject_id'] );
            if ( $object instanceof eZContentObject )
            {
                $return[] = $object->attribute( 'name' );
            }
        }

        return implode( ', ', $return );
    }
1082158
public function getNotificationDetails()
    {
        $notificationDetails = [
            'portfolio' => [
                'id' => $this->portfolio->getId(),
                'title' => $this->portfolio->getTitle(),
                'slug' => $this->portfolio->getSlug(),
            ],
        ];

        return $notificationDetails;
    }
22733
public function getFieldDatabaseNameArray()
    {
        $fields = [];
        foreach ($this->fields as $field) {
            $fields[] = $field->toSelectString();
        }
        return $fields;
    }
672434
public function actionIndex()
    {
        $userId = Yii::$app->getUser()->getId();
        $query = (new Query())
            ->from('{{%notifications}}')
            ->andWhere(['or', 'user_id = 0', 'user_id = :user_id'], [':user_id' => $userId]);

        $pagination = new Pagination([
            'pageSize' => 20,
            'totalCount' => $query->count(),
        ]);

        $list = $query
            ->orderBy(['id' => SORT_DESC])
            ->offset($pagination->offset)
            ->limit($pagination->limit)
            ->all();

        $notifs = $this->prepareNotifications($list);

        return $this->render('index', [
            'notifications' => $notifs,
            'pagination' => $pagination,
        ]);
    }
55664
public function getData()
    {
        $users = $this->userManager->findLoggedInUsers();

        $data = [];
        foreach ($users as $user) {
            $data[] = [
                'uid' => $user->getId(),
                'username' => $user->getUsername(),
                'image' => '/bundles/users/images/male-black-blonde.png',
            ];
        }

        return $data;
    }
1075686
public function toArray(): array
    {
        $problem = [
            'status'   => $this->getStatusCode(),
            'title'    => $this->getTitle(),
            'detail'   => $this->getDetail(),
            'type'     => $this->getType(),
            'instance' => $this->getInstance(),
        ];

        // Required fields should always overwrite additional fields
        // Use array_filter to remove empty fields in the default fields
        // And don't array_filter $additionalData in case there is a bool = false value
        return $this->mergeArrays(array_filter($problem), $this->additionalData);
    }
445392
public function get()
    {
        $notifications = $this->stack->getNotifications()->get();
        $alerts        = $this->stack->getAlerts()->get();
        $count         = $this->stack->getCount();
        $return        = [
            'notifications' => [
                'items' => $this->decorator->decorate($notifications),
                'count' => array_get($count, 'notifications', 0),
            ],
            'alerts'        => [
                'items' => $this->decorator->decorate($alerts, 'alert'),
                'count' => array_get($count, 'alerts', 0)
            ],
        ];
        return new JsonResponse($return, 200);
    }