Checks if a specific id is in the ancestors array
@param  integer  $id
@return boolean
195200
protected function isAncestors($id)
    {
        $ancestors  = $this->ancestors;
        $baseParent = $this->getAncestors($this->currentPage);
        if (is_array($baseParent) && !empty($baseParent)) {
            $ancestors = array_merge($ancestors, $baseParent);
        }

        return in_array($id, $ancestors);
    }
1335509
private function _checkIdArgument($id)
    {
        $id = strtoupper($id);
        $length = strlen($id);

        if ($length === 15) {
            return $this->_generateShortType($id);
        } elseif ($length === 18) {
            return $this->_generatelongType($id);
        }

        return false;
    }
292244
public static function setCurrentID($id)
    {
        $type = self::getType();
        $appID = App::getCurrentID();
        if (array_key_exists($id, self::$instances[$appID][$type])) {
            self::$id = $id;

            return true;
        }

        return false;
    }
1151160
public function has($id)
    {
        $this->preHas($id);
        $result = $this->dataStore->has($id);
        $this->postHas($result, $id);

        return $result;
    }
454881
public function has($id)
    {
        if (isset($this->aliases[$id])) {
            $id = $this->aliases[$id];
        }

        return isset($this->keys[$id]);
    }
396759
public function isCached($id) {
        if ($id != null) {
            $id = $this->getIDfromOjb($id);
        }

        if ($id == null)
            return false;

        $cachefile = $this->getConfig('cacheDir') . '/' . utf8_decode($id);
        $cachetime = $this->getConfig('cacheTime');

        if (file_exists($cachefile) && time() - $cachetime < fileatime($cachefile)) {
            return true;
        }

        return false;
    }
1034518
public function hasDocument(string $id): bool
    {
        if (isset($this->documents[$id])) {
            return true;
        }

        $path = $this->getDocumentPath($id);

        if ($this->filesystem->has($path)) {
            $info = $this->filesystem->getMetadata($path);

            return $info['type'] === 'file';
        }

        return false;
    }
1331998
public function has( $id ){
		if( $this->cache->has( $this->cacheKey.$id ) )
			return TRUE;
		return (bool) $this->get( $id );
	}
1310290
public function delete($id)
    {
        $primaryKey = isset($this->primaryKey) ? $this->primaryKey : 'id';

        if (method_exists($this, 'beforeDelete')) {
            $this->beforeDelete();
        }

        if ($this->qb->table($this->table)->limit(1)->delete([$primaryKey => $id])) {
            if (method_exists($this, 'afterDelete')) {
                return $this->afterDelete();
            }

            return true;
        }

        return false;
    }
685597
public function hasUser($id)
    {
        if ($id instanceof Eloquent) $id = $id->getKey();

        return $this->users->contains('id', $id);
    }
451548
public function exists($id) {
        return (bool) $this->select()->where($this->getPrimaryKey(), $id)->count();
    }
719447
public function hasComponent($id)
    {
        if (!is_string($id)) {
            $id = array_shift($id);
        }
        return $this->getLocator()->has($id);
    }
735218
public function has($id)
    {
        if ($this->isSilverStripeServiceRequest($id)) {
            return (bool) $this->getSilverStripeService($id);
        } else {
            return parent::has($id);
        }
    }
1236774
public function isValid($id)
    {
        $ttl = $this->hasOption(self::OPTION_TTL) ? $this->getOption(self::OPTION_TTL) : self::DEFAULT_TTL;
        if ($this->getPersistence()->supportsFeature(\common_persistence_KeyValuePersistence::FEATURE_NX)) {
            return $this->getPersistence()->set(self::PREFIX.$id, 't', $ttl, true);
        } else {
            if ($this->getPersistence()->exists(self::PREFIX.$id)) {
                return false;
            }
            return $this->getPersistence()->set(self::PREFIX.$id, 't', $ttl);
        }
    }
1279992
public function in($id, array $ids)
    {
        $allParents = $this->getHierarchy($id);

        /**
         * To increase the efficiency, we can index the results of the parent.
         */
        $allParentsIndexed = [];
        foreach ($allParents as $parent) {
            $allParentsIndexed[$parent->getId()] = $parent;
        }

        foreach ($ids as $possibleParentId) {
            if (isset($allParentsIndexed[$possibleParentId])) {
                return true;
            }
        }

        return false;
    }
624053
function descendants($ID)
	{
		$res = $this->{$this->type ()}->descendantsConditional(/* absolute depths*/false, "ID=?", $ID );
		$out = array ();
		if (is_array ( $res ))
			foreach ( $res as $v )
				$out [$v ['Title']] = $v;
		return $out;
	}
271381
public function contains( $id ) {

		if ( isset ( $this->inMemoryCache[ $id ] ) || array_key_exists( $id, $this->inMemoryCache ) ) {
			return true;
		}

		$this->inMemoryCache[ $id ] = $this->cache->get( $id );

		return !$this->inMemoryCache[ $id ] ? false : true;
	}