Returns current slug from CMS slugs table

@return object|null
167050
protected function getSlugRecordFromCmsTable()
    {
        /** @var CmsModel|SluggableTrait $this */

        $languageId = $this->storeSlugForLanguageId();

        $entryId = $this->isTranslationModel()
            ?   $this->getAttribute(config('pxlcms.translatable.translation_foreign_key'))
            :   $this->getKey();

        $existing = DB::table(static::$slugsTable)
            ->select([ 'id', static::$slugsColumn . ' as slug' ])
            ->where(static::$slugsModuleKey, $this->getModuleNumber())
            ->where(static::$slugsEntryKey, $entryId);

        // if language is null, we need to take into account that some weird
        // cms hook setups will use '0' or '' (and do not have nullable language columns)
        if (is_null($languageId)) {

            $existing = $existing->where(function($query) {
                return $query->whereNull(static::$slugsLanguageKey)
                    ->orWhere(static::$slugsLanguageKey, 0)
                    ->orWhere(static::$slugsLanguageKey, '');
            });

        } else {

            $existing = $existing->where(static::$slugsLanguageKey, $languageId);
        }

        $existing = $existing->limit(1)
                             ->first();

        if (empty($existing)) return null;

        return $existing;
    }
315884
public function retrieveActiveBySlug($slug)
    {
        $query = $this->createQueryBuilder('c')
            ->where('c.isActive = :isActive')
            ->andWhere('c.slug = :slug')
            ->orderBy('c.rank', 'ASC')
            ->setMaxResults(1)
            ->getQuery();

        $query->setParameter('isActive', true);
        $query->setParameter('slug', $slug);

        return $query->getOneOrNullResult();
    }
1137363
public function currentUrl()
    {
        $context = $this->contextObject();

        if ($context && isset($context['url'])) {
            return $this->createAbsoluteUrl($context['url']);
        }

        return null;
    }
718001
public function getAdminWrapperAction()
    {
        $allowed = $this->cmsPermissionChecks->siteAdminCheck($this->currentSite);

        if (!$allowed) {
            return null;
        }

        /** @var RouteMatch $routeMatch */
        $routeMatch = $this->getEvent()->getRouteMatch();
        $siteId = $this->currentSite->getSiteId();
        $sourcePageName = $routeMatch->getParam('page', 'index');

        if ($sourcePageName instanceof Page) {
            $sourcePageName = $sourcePageName->getName();
        }

        $pageType = $routeMatch->getParam('pageType', 'n');

        $view = new ViewModel();
        $view->setVariable('restrictions', false);
        if ($this->cmsPermissionChecks->isPageRestricted($siteId, $pageType, $sourcePageName, 'read') == true) {
            $view->setVariable('restrictions', true);
        }

        $view->setVariable('adminMenu', $this->adminPanelConfig);
        $view->setTemplate('rcm-admin/admin/admin');

        return $view;
    }
863600
public function findOneBySlug($slug)
    {
        // select
        $qb = $this->getQueryBuilder()
            ->select('p.id, t.title, t.description, t.metaTitle, t.metaDescription, t.metaTags, p.active');

        //join
        $qb->leftJoin('p.translations', 't');
        
        $qb->where('t.slug LIKE :slug')
           ->andWhere('p.active LIKE :active')
            ->setParameter('slug', '%'.$slug.'%')
            ->setParameter('active', true);

        return $qb->getQuery()->getSingleResult();
    }
1348793
protected function getCurrentTaxonomy()
	{
		if (!isset($this->args['taxonomies']) || empty($this->args['taxonomies']))
		{
			$this->args['taxonomies'] = $this->getDefaultTaxonomies();
		}

		foreach ($this->args['taxonomies'] as $tax)
		{
			if ($tax = get_term_by('slug', get_query_var($tax), $tax))
			{
				return $tax;
				break;
			}
		}

		return null;
	}
122118
public function get_value() {
		$data  = $this->get_data();
		$value = null;
		if ( null !== $data && null !== $data[ $this->slug ] ) {
			$value = $data[ $this->slug ];
		}

		return $value;
	}
770178
public function getLegend()
    {
        return (isset($this->fieldsets[$this->current])) ?
            $this->fieldsets[$this->current]->getLegend() : null;
    }
148593
public function findRecordIdForSlugFromCmsTable($slug, $locale = null, $limitToLanguage = false)
    {
        /** @var CmsModel|SluggableTrait $this */

        $existing = DB::table(static::$slugsTable)
            ->select([ static::$slugsEntryKey . ' as entry' ])
            ->where(static::$slugsModuleKey, $this->getModuleNumber())
            ->where(static::$slugsColumn, $slug);

        if ($locale || $limitToLanguage) {

            if ($locale) {
                $existing->where(static::$slugsLanguageKey, $this->lookUpLanguageIdForLocale($locale));
            } else {
                $existing->where(static::$slugsLanguageKey, $this->storeSlugForLanguageId());
            }
        }

        $existing = $existing->orderBy('id', 'asc')
                             ->limit(1)
                             ->first();

        if (empty($existing)) return null;

        return $existing->entry;
    }
1023708
public function get_post_type_by_slug( $slug ) {
		if ( ! isset( $this->_custom_posts_mapper[ $slug ] ) ) {
			return null;
		}

		return $this->get_custom_post_type( $this->_custom_posts_mapper[ $slug ] );
	}
1090496
public function current()
    {
        return call_user_func(
            $this->fetchCallback,
            pg_fetch_array( $this->resource, $this->fetchRowNumber, $this->fetchType )
        );
    }
1213607
public function bySlug(string $slug = null)
    {
        if (isset($slug)) {
            return $this->apps_by_slug[$slug] ?? null;
        } else {
            return $this->apps_by_slug;
        }
    }
481829
public function getCurrentProfile()
    {
        $urlSegment = $this->request->param('URLSegment');
        if ($urlSegment) {
            $filter = URLSegmentFilter::create();
            // url encode unless it's multibyte (already pre-encoded in the database)
            // see https://github.com/silverstripe/silverstripe-cms/pull/2384
            if (!$filter->getAllowMultibyte()) {
                $urlSegment = rawurlencode($urlSegment);
            }

            return Member::get()
                ->filter('URLSegment', $urlSegment)
                ->first();
        }

        return null;
    }
1086680
protected function getContentBySlug($slug) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $query = $this->CmsContent->find('all');
        $query->where(['name' => $slug]);
        $data = $query->first();
        return $data;
    }
342866
public function current()
    {
        $page = $this->pageIterator->current();

        return isset($page[$this->pageIndex])
            ? $page[$this->pageIndex]
            : null;
    }
211914
public function current() {
		if(!($r = $this->tmp_dal->current()))
			return null;
		else {
			$entity = $this->definition->make([], $this->locale);
			return $this->hydrate($entity, $r);
		}
	}
1022949
public function get($slug){
        return empty($this->index[$slug]) ? null : $this->index[$slug];
    }