Set slug.

@param string $slug

@return Tag|false
499565
public function setSlug($slug)
    {
        if (!empty($this->slug)) {
            return false;
        }
        $this->slug = $slug;

        return $this;
    }
644575
public function getActive($slug)
    {
        $bc = $this->getBreadCrumb();
        foreach ($bc as $bcItem) {
            if ($bcItem->getSlug() == $slug) {
                return true;
            }
        }

        return false;
    }
940754
protected function setSlug($slug)
    {
        $config  = $this->getSluggableConfig();
        $save_to = $config['save_to'];

        if ($this->storeSlugLocally()) {
            $this->setAttribute($save_to, $slug);
            return;
        }

        $this->setSlugInCmsTable($slug);
    }
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();
    }
794915
public function findActiveBySlug($slug)
    {
        $query = $this->createValuedQueryBuilder('c')
            ->where('c.slug = :slug')
            ->andWhere('c.active = :active')
            ->setParameters(['slug' => $slug, 'active' => true])
            ->getQuery();

        return $query->useResultCache(true, self::CACHE_TTL)->getSingleResult();
    }
260752
public function attachRoleBySlug($slug)
    {
        $role = Role::where('slug', $slug)->first();

        return $this->attachRole($role);
    }
695330
public function findBySlug($slug)
    {
        return $this->plugger
            ->setModel($this)
            ->setAdapter(Post::class)
            ->plugIn(get_page_by_path($slug, OBJECT, $this->getSlug()))
            ->getConnected()
            ->first();
    }
300096
function checkSlugInCategories($slug){
        $repet=true;
        $counter=1;
        $newSlug=$slug;

        while ($repet)
        {
            if(Categories::where('slug',$newSlug)->where('model_type',$this->type)->first())
            {
                $newSlug=$slug.'-'.$counter;
                $counter++;
            }
            else
                $repet=false;
        }

        return $newSlug;
    }
674365
public function getEntity(string $slug): self
    {
        $this->entity = Dashboard::getEntities()->where('slug', $slug)->first();

        throw_if(is_null($this->entity), EntityTypeException::class, "{$slug} Type is not found");

        return $this;
    }
1162590
private function createUniqueNumericSlug($slug)
    {
        if ($this->isNumericSlug($slug)) {
            // Extract last number and increment it
            $number = substr($slug, -1, 1);
            $number++;

            // Replace with new number
            $string = substr($slug, 0, strlen($slug) - 1) . $number;

            return $string;
        } else {
            return $slug;
        }
    }
982641
public static function unsluggify($slug)
    {
        $str = str_replace("-", " ", $slug);
        $words  = explode(" ", $str);
        $words  = array_map('ucfirst', $words);

        return implode(" ", $words);
    }
917243
public function checkIfSlugIsUnique($slug)
    {
        $i = 0;
        $this->base_slug = $slug;

        while ($this->post->whereSlug($slug)->get()->count() > 0) {
            $i++;
            $slug = "$this->base_slug-$i";
        }

        return $slug;
    }
136966
public function deleteImageSetBySlug($slug)
    {
        $imageSet = $this->getImageSet();

        foreach ($imageSet as $key => $set) {
            if ($set->slug == $slug) {
                unset($imageSet[$key]);
            }
        }
        $imageSet = array_values($imageSet);
        $this->repository->imageSet = $imageSet;
        $this->save();
    }
987451
protected function reset($slug)
    {
        if (! $this->packages->exists($slug)) {
            return $this->error('Package does not exist.');
        }

        $this->requireMigrations($slug);

        //
        $this->migrator->setconnection($this->input->getOption('database'));

        $pretend = $this->input->getOption('pretend');

        while (true) {
            $count = $this->migrator->rollback($pretend, $slug);

            foreach ($this->migrator->getNotes() as $note) {
                $this->output->writeln($note);
            }

            if ($count == 0) break;
        }
    }
1086680
protected function getContentBySlug($slug) {
        $this->CmsContent = TableRegistry::get('CmsContent');
        $query = $this->CmsContent->find('all');
        $query->where(['name' => $slug]);
        $data = $query->first();
        return $data;
    }
939799
public function set($theme)
    {
        list($theme, $parent) = $this->resolveTheme($theme);

        if (! $this->isCurrently($theme->get('slug')) and (! is_null($this->getCurrent()))) {
            $this->removeRegisteredLocation();
        }

        $this->setCurrent($theme->get('slug'));
        
        $this->registerAutoload($this->format($theme->get('slug')));
        $this->addRegisteredLocation($theme, $parent);
        $this->symlinkPublicDirectory();
        $this->registerServiceProvider($this->format($theme->get('slug')));
    }
598106
public function removeAction($slug)
    {
        if (array_key_exists($slug, $this->actions)) {
            unset($this->actions[$slug]);

            return true;
        } else {
            return false;
        }
    }