Returns the variables available when sending a user notification.
@return array
510802
public function getNotificationVars()
    {
        $vars = [
            'name'     => $this->name,
            'email'    => $this->email,
            'username' => $this->username,
            'login'    => $this->getLogin(),
            'password' => $this->getOriginalHashValue('password')
        ];

        /*
         * Extensibility
         */
        $result = Event::fire('rainlab.user.getNotificationVars', [$this]);
        if ($result && is_array($result)) {
            $vars = call_user_func_array('array_merge', $result) + $vars;
        }

        return $vars;
    }
489669
private function discoverNotifiables()
    {
        /** @var ClassMetadata[] $entities */
        $entities = $this->em->getMetadataFactory()->getAllMetadata();
        foreach ($entities as $entity) {
            $class = $entity->name;
            $annotation = $this->annotationReader->getClassAnnotation(new \ReflectionClass($class), 'Mgilet\NotificationBundle\Annotation\Notifiable');
            if ($annotation) {
                $this->notifiables[$annotation->getName()] = [
                    'class' => $entity->name,
                    'annotation' => $annotation,
                    'identifiers' => $entity->getIdentifier()
                ];
            }
        }
    }
355090
public function getVariables()
    {
        if (!$this->getUseIndex()) {
            return array();
        }

        $staticVariables = $this->reflection->getStaticVariables();

        // When looping through the variables, we will only take the variables that are
        // specified in the use clause, and will not take any other static variables
        // that may be used by the Closures, allowing this to re-create its state.
        $usedVariables = array();

        foreach ($this->getUseClauseVariables() as $variable) {
            $variable = trim($variable, ' $&');

            $usedVariables[$variable] = $staticVariables[$variable];
        }

        return $usedVariables;
    }
753503
public function showVars()
    {
        $what = $this->getParameter('scope');
        switch ( $what ) {
            case 'global':
            case 'globals':
            case 'system':
            case 'systems':
                $debug = $this->getGlobals();
                break;

            default:
                $debug = $this->getLocals();
                break;
        }

        return '<pre>' . JSONUtils::encode($debug, true, false) . '</pre>';
    }
142031
private function getCategoryVariables()
    {
        $variables = [];

        if ($this->registry->registry('current_category')) {
            $category = $this->registry->registry('current_category');
            $variables['category.id']    = $category->getId();
            $variables['category.label'] = $category->getName();
            $variables['category.path']  = $category->getPath();
        }

        return $variables;
    }
112643
public static function get_random_notification() {
		if ( ( time() - self::get_last_active_notification_timestamp() ) < self::TIME_BETWEEN_NOTIFICATIONS * DAY_IN_SECONDS ) {
			return [];
		}

		$notifications = self::$notifications;
		$notifications = array_filter(
			$notifications,
			function ( $value ) {
				if ( isset( $value['sticky'] ) && true === $value['sticky'] ) {
					return true;
				}

				return false;
			}
		);
		// No priority notifications, use all.
		if ( empty( $notifications ) ) {
			$notifications = self::$notifications;
		}
		if ( empty( $notifications ) ) {
			return [];
		}
		$notifications = array_values( $notifications );

		return $notifications[ array_rand( $notifications, 1 ) ];

	}
1352842
public function getParams(): array
    {
        $params = [
            'chat_id' => $this->chatId,
            'audio' => $this->audio,
        ];

        if ($this->disableNotification !== null) {
            $params['disable_notification'] = (int)$this->disableNotification;
        }

        if ($this->replyToMessageId) {
            $params['reply_to_message_id'] = $this->replyToMessageId;
        }

        return $params;
    }
477736
public function getVariables()
    {
        $variables = [];

        if ($this->page->getId()) {
            $variables['cms.identifier'] = $this->page->getIdentifier();
            $variables['cms.title']      = $this->page->getTitle();
        }

        return $variables;
    }
775225
public function getVars()
    {
        $vars = new \ArrayObject([], \ArrayObject::ARRAY_AS_PROPS);

        $vars->env = $_ENV;
        $vars->server = $_SERVER;
        $vars->session = $_SESSION;
        $vars->cookies = $_COOKIE;
        $vars->get = $_GET;
        $vars->post = $_POST;
        $vars->files = $_FILES;

        if (function_exists('apache_request_headers')) {
            $vars->headers = apache_request_headers();
        } elseif (function_exists('getallheaders')) {
            $vars->headers = getallheaders();
        } else {
            $vars->headers = [];
            foreach ($_SERVER as $name => $value) {
                if (substr($name, 0, 5) == 'HTTP_') {
                    $vars->headers[ str_replace(' ', '-',
                        ucwords(strtolower(str_replace('_', ' ', substr($name, 5))))) ] = $value;
                }
            }
        }

        return $vars;
    }
756287
public function getQueryVariables()
    {
        $pattern = '`[' . preg_quote('&', '/') . ']`';
        $parts   = preg_split($pattern, $this->_encodedQuery, -1, PREG_SPLIT_NO_EMPTY);
        $return  = array();

        foreach ($parts as $part) {

            if (strpos($part, '=') !== false) {

                list($key, $value) = explode('=', $part, 2);

            } else {

                $key   = $part;
                $value = null;
            }

            $key          = urldecode($key);
            $value        = urldecode($value);
            $return[$key] = $value;
        }

        return $return;
    }
1012302
static public function getNotifiableStates()
    {
        $states = [];
        foreach (static::getConfig() as $state => $config) {
            if ($config[2]) {
                $states[] = $state;
            }
        }
        return $states;
    }
63791
public function getVariables() 
	{
		if(count($this->items) > 1) {
			$this->attributes['name'] .= '[]';
		}
		
		$this->attributes['type'] = 'checkbox';
		
		return array(
			'attributes' 	=> $this->attributes,
			'items'			=> $this->items,
			'selected'		=> $this->value);
	}
378187
protected function getUserMessages()
    {
        $messages = [];

        foreach ($this->repository->all() as $field) {
            foreach ($field->getOption('messages') as $rule => $message) {
                $messages[$field->getName().'.'.$rule] = $message;
            }
        }

        return $messages;
    }
146939
public function getData()
    {
        $subscription = $this->subscriptionManager
            ->findOneBy(
                ['userId' => $this->tokenStorage->getToken()->getUser()->getId(), 'handler' => 'portlet']
            );

        if (!$subscription) {
            return [];
        }

        $filter = $subscription->getFilter();

        if (!$filter) {
            return [];
        }

        $messages = $this->messageManager->findByCriteria($filter->getCriteria(), ['createdAt' => 'DESC'], 20);

        $priorityList = $this->messageManager->getPriorityNames();
        $typeList = $this->messageManager->getTypeNames();

        $data = [];
        foreach ($messages as $message) {
            $subject = '';

            $i = 0;
            do {
                $subject .= ($i ? '<wbr />' : '').mb_substr($message->getSubject(), $i, $i + 30, 'UTF-8');
                $i += 30;
            } while ($i <= strlen($message->getSubject()));

            $data[] = [
                'id' => $message->getId(),
                'subject' => $subject,
                'time' => $message->getCreatedAt()->format('U'),
                'priority' => $priorityList[$message->getPriority()],
                'type' => $typeList[$message->getType()],
                'channel' => $message->getChannel(),
            ];
        }

        return $data;
    }
1020467
public function getVariables() 
	{
		$variables = parent::getVariables();
		
		$loaded = self::$loaded;
		self::$loaded = true;
		
		$variables['loaded'] = $loaded;
		
		return $variables;
	}
1319186
protected function getVariables(): array
    {
        $variables                  = $this->getBasicVariables();
        $variables['request']       = $this->request;
        $variables['className']     = $this->request->getName();

        return $variables;
    }
1088101
public function getVariables() 
	{
		return array(
			'use_wysiwyg' => $this->wysiwyg,
			'fields' => $this->show,
			'labels' => $this->labels,
			'data' => $this->data,
			'errors' => $this->errors,
			'holders' => $this->holders);
	}