Hide/Show a repository

@param string $hide
@return bool
173925
final public function hide($hide = 'toggle') {
        global $DB;
        if ($entry = $DB->get_record('repository', array('id'=>$this->id))) {
            if ($hide === 'toggle' ) {
                if (!empty($entry->visible)) {
                    $entry->visible = 0;
                } else {
                    $entry->visible = 1;
                }
            } else {
                if (!empty($hide)) {
                    $entry->visible = 0;
                } else {
                    $entry->visible = 1;
                }
            }
            return $DB->update_record('repository', $entry);
        }
        return false;
    }
1064774
public function removeHidden($hidden)
	{
		if (is_string($hidden)) {
			$hidden = func_get_args();
		}

		$this->hidden = array_diff($this->hidden, $hidden);

		return $this;
	}
769528
function removeThis( $quiet = false )
    {
        $dataType = $this->dataType();
        if ( $dataType->isClassAttributeRemovable( $this ) )
        {
            self::expireCache( $this->ID, $this->attribute( 'contentclass_id' ) );

            $db = eZDB::instance();
            $db->begin();
            $dataType->deleteStoredClassAttribute( $this, $this->Version );
            $this->remove();
            $db->commit();
            return true;
        }
        else
        {
            if ( !$quiet )
            {
                eZDebug::writeError( 'Datatype [' . $dataType->attribute( 'name' ) . '] can not be deleted to avoid system crash' );
            }
            return false;
        }
    }
743918
public function getShow($key = false)
    {
        if (array_key_exists($key, $showConfig = $this->getConfig('show'))) {
            return $showConfig[$key];
        }
    }
217830
public function getRepository($repositoryName)
    {
        $repositoryName = (string)$repositoryName;
        if(!isset($this->config['repositories'][$repositoryName]['class'])) return false;
        $className = $this->config['repositories'][$repositoryName]['class'];
        if (!class_exists($className)) {
            return false;
        }
        $connectionName = isset($this->config['repositories'][$repositoryName]['connection'])?$this->config['repositories'][$repositoryName]['connection']:null;
        return new $className($connectionName);
    }
1190067
public function setRepository(Repository $repository, $default = null, $customName = null)
    {
        if ($default === true) {
            $this->repository = $repository;
        }

        $name = $customName ?: $repository->getName();
        $name = $name ?: uniqid();

        $this->repositories[strtolower($name)] = $repository;

        return $this;
    }
999935
protected function hideParameters($data, $hidden)
    {
        foreach ($hidden as $parameter) {
            if (Arr::get($data, $parameter)) {
                Arr::set($data, $parameter, '********');
            }
        }

        return $data;
    }
1326543
public function show($username, $repository, $label)
    {
        return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label));
    }
676134
protected function allowedCache($method)
    {
        $cacheEnabled = config('repository.cache.enabled', true);

        if (!$cacheEnabled) {
            return false;
        }

        $cacheOnly = isset($this->cacheOnly) ? $this->cacheOnly : config('repository.cache.allowed.only', null);
        $cacheExcept = isset($this->cacheExcept) ? $this->cacheExcept : config('repository.cache.allowed.except', null);

        if (is_array($cacheOnly)) {
            return in_array($method, $cacheOnly);
        }

        if (is_array($cacheExcept)) {
            return !in_array($method, $cacheExcept);
        }

        if (is_null($cacheOnly) && is_null($cacheExcept)) {
            return true;
        }

        return false;
    }
1216862
public function getConfig(): ?Repository
    {
        if (!$this->hasConfig()) {
            $this->setConfig($this->getDefaultConfig());
        }
        return $this->config;
    }
1201101
public function delete($id)
    {
        $obj = $this->find($id);
        Event::fire('repository.deleting', [$obj]);
        return $obj->delete();
    }
792118
private function resolveRepositoryName($repository)
    {
        if ($repository === null) {
            $aliases = array_keys($this->repositories);
            $repository = array_shift($aliases);
        }

        return $repository;
    }
457290
public function hide()
    {
        if ($this->isHidden())
            return;

        $updateHiddenStm = $this->connection->prepare("UPDATE Page SET hidden=? WHERE page_id = ?");
        $updateHiddenStm->bindParam(1, $this->hidden);
        $updateHiddenStm->bindParam(2, $this->page_id);
        $this->hidden = true;
        $updateHiddenStm->execute();
    }
272679
public function getCache(): ?Repository
    {
        if (!$this->hasCache()) {
            $this->setCache($this->getDefaultCache());
        }
        return $this->cache;
    }
826535
public function delete($repository, $keys)
    {
        $context = $this->getCommandContext();

        $context->repository = $repository;
        $context->keys = $keys;
        $context->query = AnDomainQuery::getInstance($repository, $keys)->delete();

        if ($this->getCommandChain()->run('before.delete', $context) !== false) {
            $context->result = $this->execute($context->query);
            $this->getCommandChain()->run('after.delete', $context);
        }

        return $context->result;
    }
443818
public function getSubpages($hide = false)
    {
        if($hide){
            return $this->subpages->filter(function(Page $v){
                return $v->isVisible();
            });
        }
        return $this->subpages;
    }
63118
public function ignore($remove = false)
    {
        return (true === $remove ? $this->removeModifier(Modifiers::IGNORE) : $this->addModifier(Modifiers::IGNORE));
    }