Returns current slugs for this module from CMS slugs table

@param string $likeSlug          if set, only returns slugs that are like the string
@param bool   $limitToLanguage   if true, only returns matches within the language
@return null|object
163788
protected function getAllSlugsForModuleFromCmsTable($likeSlug = null, $limitToLanguage = true)
    {
        /** @var CmsModel|SluggableTrait $this */

        $config         = $this->getSluggableConfig();
        $includeTrashed = $config['include_trashed'];
        $separator      = $config['separator'];


        $existing = DB::table(static::$slugsTable)
            ->select([ 'id', static::$slugsColumn . ' as slug' ])
            ->where(static::$slugsModuleKey, $this->getModuleNumber())
            ->where(function ($query) use ($likeSlug, $separator) {
                $query->where(static::$slugsColumn, $likeSlug);
                $query->orWhere(static::$slugsColumn, 'LIKE', $likeSlug . $separator . '%');
            });


        if ( ! $includeTrashed && static::$slugsActiveColumn) {
            $existing->where(static::$slugsActiveColumn, true);
        }

        if ($limitToLanguage) {

            $existing->where(static::$slugsLanguageKey, $this->storeSlugForLanguageId());
        }

        $list = $existing->lists(static::$slugsColumn, static::$slugsEntryKey);

        // Laravel 5.0/5.1 check
        return $list instanceof Collection ? $list->all() : $list;
    }
377242
public static function get($slug)
    {
        $locale = I18n::getLocale();
        $slug = array_filter(explode('/', $slug));
        $cache = sprintf('page_%s_locale_%s', md5(serialize($slug)), $locale);
        $page = Cache::read($cache, 'static_pages');

        if (empty($page)) {
            //Sets the (partial) filename
            $filename = implode(DS, $slug);

            //Sets the filename patterns
            $patterns = [$filename . '-' . $locale];
            if (preg_match('/^(\w+)_\w+$/', $locale, $matches)) {
                $patterns[] = $filename . '-' . $matches[1];
            }
            $patterns[] = $filename;

            //Checks if the page exists in APP
            foreach ($patterns as $pattern) {
                $filename = self::getAppPath() . $pattern . '.ctp';

                if (is_readable($filename)) {
                    $page = DS . 'StaticPages' . DS . $pattern;

                    break;
                }
            }

            //Checks if the page exists in each plugin
            foreach (Plugin::all() as $plugin) {
                foreach ($patterns as $pattern) {
                    $filename = self::getPluginPath($plugin) . $pattern . '.ctp';

                    if (is_readable($filename)) {
                        $page = $plugin . '.' . DS . 'StaticPages' . DS . $pattern;

                        break;
                    }
                }
            }

            Cache::write($cache, $page, 'static_pages');
        }

        return $page;
    }
832136
public function scopeWhereSlug($scope, $slug, $locale = null, $forHasQuery = false)
    {
        /** @var CmsModel|SluggableTrait $model */
        $model = new static;

        if ($model->storeSlugLocally()) {
            return $this->CviebrockScopeWhereSlug($scope, $slug);
        }

        // build scope with join to slugs table ..
        $scope = $scope->join(
            static::$slugsTable,
            function($join) use ($model, $locale) {

                $idKey = $this->isTranslationModel()
                    ?   config('pxlcms.translatable.translation_foreign_key')
                    :   $this->getKeyName();

                $join->on($model->getTable() . '.' . $idKey, '=', static::$slugsTable . '.' . static::$slugsEntryKey);
                $join->on(static::$slugsTable . '.' . static::$slugsModuleKey, '=', DB::raw( (int) $model->getModuleNumber()));

                if ( ! empty($locale) && $model->isTranslationModel()) {
                    $languageId = $model->lookUpLanguageIdForLocale($locale);

                    $join->on(static::$slugsTable . '.' . static::$slugsLanguageKey, '=', DB::raw( (int) $languageId));
                }
            }
        );

        return $scope->where(static::$slugsTable . '.' . static::$slugsColumn, $slug)
                     ->select($this->getTable() . '.' . ($forHasQuery ? 'id' : '*'));
    }
169597
public function getFullSlug() : string
    {
        $categories = Category::with('ancestors')->ancestorsAndSelf($this->category->id);

        $slug = "";

        foreach ($categories as $category) {
            $translation = $category->translations->where('locale', $this->locale)->first();
            $slug .= $translation->slug . '/';
        }

        $slug = substr($slug, 0, -1);

        return $slug;
    }
685982
public function getBySlug($sSlug)
    {
        foreach ($this->aComponents as $oComponent) {
            if ($sSlug == $oComponent->slug) {
                return $oComponent;
            }
        }

        return null;
    }
762829
public function getlanguages($limit=10,$offset=0,$keyword=''){	
//		echo $limit.PHP_EOL;
//		echo $offset.PHP_EOL;
//		echo $keyword.PHP_EOL;
		$keyword=mb_strtolower($keyword,'utf8');
		$db=BMySQL::getInstanceAndConnect();
		if(empty($db)){
			return NULL;
			}
		$qr='SELECT * from `languages`';
		
		if(!empty($keyword)){
			$qr.=' where (lower(const) like '.$db->escapeString('%'.$keyword.'%').')or'.
				       '(lower(ru) like '.$db->escapeString('%'.$keyword.'%').')or'.
				       '(lower(ua) like '.$db->escapeString('%'.$keyword.'%').')';
			}
			
		if($limit!=0)
			$qr.=' limit '.$limit.' offset '.$offset; 
		$q=$db->Query($qr);
		if(empty($q)){
			echo('<br>error!<br>'.$qr);
			return NULL;
			}
		$languages=array();
		while($l=$db->fetch($q)){
			$languages[]=$l;
			}	
		return $languages;

		}
990965
public function getBySlug($sSlug)
    {
        $aAvailable = $this->getAll();

        foreach ($aAvailable as $oDefault) {

            if ($oDefault->slug == $sSlug) {

                if (!isset($oDefault->instance)) {
                    $oDefault->instance = Factory::factory(
                        $oDefault->component,
                        $oDefault->provider
                    );
                }

                return $oDefault->instance;
            }
        }

        return null;
    }
807845
public function getDocumentBySlug($slug)
    {
        $search = $this->repository->createSearch();
        $search->addQuery(new TermQuery('slug', $slug), 'must');

        $results = $this->repository->execute($search);

        if (count($results) === 0) {
            $this->logger && $this->logger->warning(
                sprintf("Can not render snippet for '%s' because content was not found.", $slug)
            );

            return null;
        }

        return $results->current();
    }
1098413
public static function queryBySlug( $slug, $config = [] ) {

		$ignoreSite	= isset( $config[ 'ignoreSite' ] ) ? $config[ 'ignoreSite' ] : false;

		if( static::isMultiSite() && !$ignoreSite ) {

			$siteId	= isset( $config[ 'siteId' ] ) ? $config[ 'siteId' ] : Yii::$app->core->siteId;

			return static::find()->where( 'slug=:slug AND siteId=:siteId', [ ':slug' => $slug, ':siteId' => $siteId ] );
		}
		else {

			return static::find()->where( 'slug=:slug', [ ':slug' => $slug ] );
		}
	}
586374
public function slug($str, $limiter = '_')
    {
        $str = mb_strtolower($str, $this->encoding);
        $limiter = in_array($limiter, array('-', '_')) ? $limiter : '_';

        $search = array(
            0 => '/\s/',
            1 => '/ä/',
            2 => '/ö/',
            3 => '/ü/',
            4 => '/ß/',
            5 => '/[^a-zA-Z0-9_-]/'
        );

        $replace = array(
            0 => $limiter,
            1 => 'ae',
            2 => 'oe',
            3 => 'ue',
            4 => 'ss',
            5 => ''
        );

        return preg_replace($search, $replace, $str);
    }
1329647
protected function getExistingSlugs($slug)
    {
        return static::where($this->slugOptions->slugField, 'LIKE', "{$slug}%")
            ->withoutGlobalScopes()// ignore scopes
            ->withTrashed()// trashed, when entry gets activated again
            ->orderBy($this->slugOptions->slugField)
            ->get()
            ->pluck($this->slugOptions->slugField);
    }
784962
public static function findBySlug($slug,$languageSlug = "")
    {
        $getMenuLink = array_where(
            MenuLink::all(), function ($value) use ($slug) {
                return ($value['slug'] == $slug);
            }
        );

        if($getMenuLink) {
            return array_first($getMenuLink);
        }
        return false;
    }
210476
public function getSuggestions($lang = null)
	{
		// Check the rate limit for remaining hits
		$this->checkRateLimit('users', 'suggestions');

		// Set the API path
		$path = '/users/suggestions.json';

		$data = array();

		// Check if entities is true
		if ($lang)
		{
			$data['lang'] = $lang;
		}

		// Send the request.
		return $this->sendRequest($path, 'GET', $data);
	}
1195174
public function getGlobalBySlugType( $slug, $type, $config = [] ) {

		$modelClass = static::$modelClass;

		return $modelClass::findGlobalBySlugType( $slug, $type, $config );
	}
1075482
public static function setCurrent(string $languageSlug)
    {
        $languageData  = self::findBySlug($languageSlug);
        if ($languageData) {
            App::setLocale($languageSlug);
            Carbon::setLocale($languageSlug);
            self::$current = $languageData;
        } else {
            self::$current = self::$default;
            \Request::route()->setParameter('lang', self::$current->slug);
        }
    }
34959
protected function getRelatedSlugs($slug, $id = 0)
    {
        return $this->select('slug')->where('slug', 'like', $slug.'%')->where('id', '<>', $id)->get();
    }
1086680
protected function getContentBySlug($slug) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $query = $this->CmsContent->find('all');
        $query->where(['name' => $slug]);
        $data = $query->first();
        return $data;
    }