Resolve the user's preferences tags.

@return null/array
559994
protected function resolveUserPreferences()
	{
		if ($this->user) {
			return $this->user->preferences;
		}

		if (Auth::check()) {
			return Auth::user()->preferences;
		}

		return null;
	}
1135552
protected function getTagsFromSphinx()
    {
        if (is_array($this->searchResults) && count($this->searchResults)) {
            return array_map(
                function ($row) {
                    return $row['tags'];
                },
                $this->searchResults
            );
        } else {
            return array();
        }
    }
254254
public function listTags(): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/tags', $this->getOwner(),
            $this->getRepo()));
    }
1361146
public function tags(): array
    {

        if (property_exists($this, 'tags')) {
            if (is_null($this->token))
                return array_merge($this->tags, ['public']);

            return array_merge($this->tags, ['character_id:' . $this->getCharacterId()]);
        }

        if (is_null($this->token))
            return ['unknown_tag', 'public'];

        return ['unknown_tag', 'character_id:' . $this->getCharacterId()];
    }
959110
public function loadDefaults()
    {
        // Obtain Default and Current Site Config:
        
        $default = SiteConfig::create();
        $current = SiteConfig::current_site_config();
        
        // Check App Title:
        
        if (!is_null($this->config()->title)) {
            
            // Update Site Title:
            
            if ($current->Title == $default->Title) {
                $current->Title = $this->config()->title;
            }
            
        }
        
        // Check App Tagline:
        
        if (!is_null($this->config()->tagline)) {
            
            // Update Site Tagline:
            
            if ($current->Tagline == $default->Tagline) {
                $current->Tagline = $this->config()->tagline;
            }
            
        }
        
        // Save Site Config Changes:
        
        if ($current->isChanged('Title') || $current->isChanged('Tagline')) {
            
            if ($current->isChanged('Title')) {
                
                DB::alteration_message(
                    sprintf(
                        'Updating App Title to "%s"',
                        $current->Title
                    ),
                    'changed'
                );
                
            }
            
            if ($current->isChanged('Tagline')) {
                
                DB::alteration_message(
                    sprintf(
                        'Updating App Tagline to "%s"',
                        $current->Tagline
                    ),
                    'changed'
                );
                
            }
            
            $current->write();
            
        }
        
    }
1327468
private function resolveElements()
    {
        foreach ($this->unresolvedColumns as $name => $info) {
            $this->columns[$name] = $this->createColumn($name, $info['type'], $info['options']);
        }
        $this->unresolvedColumns = [];

        foreach ($this->unresolvedFilters as $name => $info) {
            $this->filters[$name] = $this->createFilter($name, $info['type'], $info['options']);
        }
        $this->unresolvedFilters = [];

        foreach ($this->unresolvedActions as $name => $info) {
            $this->actions[$name] = $this->createAction($name, $info['type'], $info['options']);
        }
        $this->unresolvedActions = [];
    }
386954
protected function init(): void
    {
        $this->getGroupTags = static function (Type\Group $group) { return ['type-group-' . $group->id]; };
        $this->getGroupKeys = static function (Type\Group $group) {
            return [
                'ez-content-type-group-' . $group->id,
                'ez-content-type-group-' . $group->identifier . '-by-identifier',
            ];
        };

        $this->getTypeTags = static function (Type $type) { return ['type-' . $type->id]; };
        $this->getTypeKeys = static function (Type $type, int $status = Type::STATUS_DEFINED) {
            return [
                'ez-content-type-' . $type->id . '-' . $status,
                'ez-content-type-' . $type->identifier . '-by-identifier',
                'ez-content-type-' . $type->remoteId . '-by-remote',
            ];
        };
    }
642243
public function getTags()
    {
        $apiUrl = 'https://qyapi.weixin.qq.com/cgi-bin/tag/list';

        $result = $this->_curl($apiUrl, [
            'access_token' => $this->getAccessToken(),
        ]);

        return ($result and isset($result['taglist'])) ? $result['taglist'] : null;
    }
134227
private function getAllTags(): array
    {
        if ($this->tags === null) {
            $this->tags = $this->loadAllTags();
        }

        return $this->tags;
    }
51080
public function getPopularTags()
    {
        $question = $this->findAll();

        $tagsMultiArray = array_map(function ($question) {
            return explode(',', $question->tags);
        }, $question);

        // Merge multi array, count values, sort high to low
        $tagArr = array_count_values(call_user_func_array("array_merge", $tagsMultiArray));
        arsort($tagArr);
        return $tagArr;
    }
1008351
protected function getTagValues()
    {
        // Step1 Get tags value from cache
        $keys = array_map(array($this, 'getTagKey'), $this->tags);
        $values = $this->cache->getMulti($keys);

        // Step2 Initialize new tags value
        $emptyKeys = array_diff($values, array_filter($values));
        if ($emptyKeys) {
            $newValues = $this->setTagValues($emptyKeys);
            $values = array_merge($values, $newValues);
        }

        return $values;
    }
1051979
public function resolveTagIds($tagIds)
    {
        $resolvedTags = [];

        foreach ($tagIds as $tagId) {
            $tag = $this->findById($tagId);
            if (null !== $tag) {
                $resolvedTags[] = $tag->getName();
            }
        }

        return $resolvedTags;
    }
365469
private static function _getTagSupportForCache()
    {
        $backend = self::$_cache->getBackend();
        if ($backend instanceof Zend_Cache_Backend_ExtendedInterface) {
            $cacheOptions = $backend->getCapabilities();
            self::$_cacheTags = $cacheOptions['tags'];
        } else {
            self::$_cacheTags = false;
        }

        return self::$_cacheTags;
    }
1219837
public function get_preferences_as_booleans() {
        $preferences = [];
        $preferences[$this->view] = true;
        $preferences[$this->sort] = true;
        $preferences[$this->grouping] = true;

        return $preferences;
    }
1117882
public function getTags()
    {
        if (null === $this->tags) {
            $this->tags = new ArrayCollection();

            if ($this->lazyTagLoader) {
                call_user_func($this->lazyTagLoader, $this);
            }
        }

        return $this->tags;
    }
1322224
private function resolve(array $tags, array $routeProps)
    {
        foreach (static::$strategies as $strategy) {
            $strategy = new $strategy();

            /** @var Response[]|null $response */
            $responses = $strategy($this->route, $tags, $routeProps);

            if (! is_null($responses)) {
                return array_map(function (Response $response) {
                    return ['status' => $response->getStatusCode(), 'content' => $this->getResponseContent($response)];
                }, $responses);
            }
        }
    }
780747
public static function getInstantiatedTagObjects()
    {
        $context = self::getInstance();
        foreach ($context->tags as $key => $config) {
            $context->instantiatTag($key);
        }
        
        return $context->tags;
    }