Check whether an item has an update available or not.

@param string $slug The plugin/theme slug

@return bool
559419
protected function has_update( $slug ) {
		$update_list = get_site_transient( $this->upgrade_transient );

		return isset( $update_list->response[ $slug ] );
	}
431042
public function hasIn(array $items = [])
    {
        if (\is_null($slug = $this->slug)) {
            return isset($items[$this->value]);
        }

        return isset($items[$slug]);
    }
763262
def is_slug_available(self, slug, **kwargs):
        
        try:
            self.get(slug=slug, **kwargs)
            return False
        except self.model.DoesNotExist:
            return True
162179
public function has($key): bool
    {
        return isset($this->items[$key]) || array_key_exists($key, $this->items);
    }
551349
public function has(?string $key) : bool
    {
        return $key === null ? false : isset($this->themes[$key]);
    }
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;
    }
262002
public function has($key)
    {
        $key = strval($key);
        $key = $this->getSlugFromName($key);

        return (!empty($key) && in_array($key, $this->items));
    }
1086470
public function exists($slug)
    {
        return ($this->slugs()->contains($slug) || $this->slugs()->contains(str_slug($slug)));
    }
879520
private function packageExists($slug, $package)
    {
        $path = Grav::instance()['locator']->findResource($package->package_type . '://' . $slug);
        Installer::isValidDestination($path);
        return Installer::lastErrorCode();
    }
545538
public function is_plugin_installed( $slug )
	{
		$element = $this->search_plugin( $slug );
		if ( count( $element ) ) {
			return true;
		} else {
			return false;
		}
	}
466326
public function updateBySlug(array $attributes, $slug)
    {
        $album = $this->findBySlug($slug);

        return $this->update($attributes, $album->id);
    }
336297
public static function grab($slug)
    {
        /*
         * Comment out prior to 0.2 launch. Will cause massive amount
         * of Database queries. Only for adding new settings while
         * in development and testing.
         */
        //       Cache::flush();

        $setting = Cache::remember('ticketit::settings.'.$slug, 60, function () use ($slug) {
            $settings = Cache::remember('ticketit::settings', 60, function () {
                return Table::all();
            });

            $setting = $settings->where('slug', $slug)->first();

            if ($setting->lang) {
                return trans($setting->lang);
            }

            if (self::is_serialized($setting->value)) {
                $setting = unserialize($setting->value);
            } else {
                $setting = $setting->value;
            }

            return $setting;
        });

        return $setting;
    }
77941
public function has($key)
    {
        try {
            $ttlColumn = $this->columns['ttl'];

            return (bool) $this->db->from($this->table)
                    ->where($this->columns['key'])->eq($this->prefix . $key)
                    ->andWhere(function ($group) use ($ttlColumn) {
                        $group->where($ttlColumn)->eq(0)
                        ->orWhere($ttlColumn)->gt(time());
                    })
                    ->count();
        } catch (PDOException $e) {
            return false;
        }
    }
823573
function has( $key ) {
            $cache_entry = $this->_options->get_option( $key, false );

            return ( is_object( $cache_entry ) &&
                     isset( $cache_entry->timestamp ) &&
                     is_numeric( $cache_entry->timestamp )
            );
        }
256451
private function checkUpdatingSlug($slug)
    {
        if ($this->id >= 1) {

            $found = false;
            foreach ($this->uniqueModels() as $class) {

                // find entries matching slug, exclude updating entry
                $builder = $this->eloqent($class)->where('slug', $slug);

                // same model - exlude check
                if ($class == self::class) {
                    $builder = $builder->where('id', '!=', $this->id);
                }

                // found same slug - break, need new slug
                if ($found = $builder->first()) {
                    break;
                }
            }

            // save to use current slug for update
            if ($found == false || $found == null) {
                return $slug;
            }
        }

        // new unique slug needed
        return false;
    }
760638
protected function checkValidSlug($slug)
    {
        if (preg_match_all('#^([a-z,A-Z,0-9,\-,_]*)(.+)?$#', $slug, $matches)
            && (strlen($matches[2][0]) > 0)
        ) {
            throw new \RuntimeException(
                sprintf(
                    'Error: prefix "%s" is invalid. It must only contain letters, numbers, underscores and hyphens. ' .
                    'Found problem near: "%s"',
                    $slug,
                    $matches[2][0]
                )
            );
        }
    }
416802
public static function isExistBySlug( $slug ) {

		$user = self::find()->where( 'slug=:slug', [ ':slug' => $slug ] )->one();

		return isset( $user );
	}