Is a place name used in any tree?

@param string $place_name

@return bool
509423
private function isLocationActive(string $place_name): bool
    {
        $places = explode(Gedcom::PLACE_SEPARATOR, $place_name);

        $query = DB::table('places AS p0')
            ->where('p0.p_place', '=', $places[0])
            ->select(['pl0.*']);

        array_shift($places);

        foreach ($places as $n => $place) {
            $query->join('places AS p' . ($n + 1), static function (JoinClause $join) use ($n, $place): void {
                $join
                    ->on('p' . ($n + 1) . '.p_id', '=', 'p' . $n . '.p_parent_id')
                    ->where('p' . ($n + 1) . '.p_place', '=', $place);
            });
        }

        return $query->exists();
    }
796547
protected function _hasPragma($pragma_name) {
		if (array_key_exists($pragma_name, $this->_localPragmas) && $this->_localPragmas[$pragma_name]) {
			return true;
		} else {
			return false;
		}
	}
31953
public function isSecondaryLocal()
    {
        if (!$this->isSecondary()) {
            return false;
        }

        $hashKey        = $this->getHashKey()->getPropertyMetadata()->name;
        $hashKeyPrimary = $this->class->getIndex()->getHashKey()->getPropertyMetadata()->name;

        return $hashKey === $hashKeyPrimary;
    }
1271400
public function createBucket($bucket_name)
    {
        if ($this->doesBucketExist($bucket_name)) {
            $this->addMessage("Bucket $bucket_name already exists");
            return true;
        }

        if (mkdir('s3://' . $bucket_name)) {
            return true;
        } else {
            $this->addMessage('Could not create bucket ' . $bucket_name);
            return false;
        }
    }
582382
public function isValidAttributeNS($namespace_uri, $local_name)
    {
        if (!$this->isHandledNamespace($namespace_uri)) return false;

        $attrs = $this->namespaces_by_uri[$namespace_uri]->getAttributes();
        return isset($attrs[$local_name]);
    }
536766
public function __isset($name) {
        if(isset($this->tmp[$name])) {
            return true;
        }
        if (method_exists($this, '_' . $name)) {
            return true;
        }
        if (isset($this->row[$name])) { //array_key_exists($name, $this->_row)
            return true;
        }
        if(isset($this->stack[$name])){
            $this->row = &$this->stack;
            return true;
        }
        return false;
    }
1087027
public static function valid_alternative_database_name($name)
    {
        if (Director::isLive() || empty($name)) {
            return false;
        }

        $prefix = Environment::getEnv('SS_DATABASE_PREFIX') ?: 'ss_';
        $pattern = strtolower(sprintf('/^%stmpdb\d{7}$/', $prefix));
        return (bool)preg_match($pattern, $name);
    }
431016
private static boolean localNameIsDeclaredByClass(Node clazz) {
    checkArgument(clazz.isClass(), clazz);

    if (clazz.getFirstChild().isEmpty()) {
      return false; // There must be a name.
    } else if (NodeUtil.isStatement(clazz)) {
      return false; // The name must be local.
    }

    return true;
  }
446085
public function useTemplate($template_name = false)
    {
        $templates = $this->getTemplates();

        // set the default template
        if ($template_name == false) {
            $template_name = $templates[0]->name;
        }

        // actually use the template
        if ($template_name) {
            $this->{$template_name}();
        }
    }
1362152
protected function findIndividualsByPlace(Place $place, Tree $tree): array
    {
        return DB::table('individuals')
            ->join('placelinks', static function (JoinClause $join): void {
                $join
                    ->on('pl_file', '=', 'i_file')
                    ->on('pl_gid', '=', 'i_id');
            })
            ->where('i_file', '=', $tree->id())
            ->where('pl_p_id', '=', $place->id())
            ->pluck('i_id')
            ->all();
    }
688908
public function getSourceByName($source_name)
    {
        if ($this->hasSourceName($source_name)) {
            foreach ($this->sources() as $source) {
                if ($source->getName() === $source_name) {
                    return $source;
                }
            }
        }
    }
877357
public function importsFunction($function_name = NULL) {
    if (!$this->useFunction) {
      return FALSE;
    }
    if ($function_name) {
      foreach ($this->getDeclarations() as $declaration) {
        if ($declaration->getName()->getPath() === $function_name) {
          return TRUE;
        }
      }
      return FALSE;
    }
    else {
      return TRUE;
    }
  }
437476
public function fetchByName($str_key_name)
    {
        $arr_results = $this->fetchByNames([$str_key_name]);
        if(count($arr_results) > 0) {
            return $arr_results[0];
        }
        return null;
    }
824429
function deleteWhere($table_name, $where_with_placeholders, $named_parameters) {

            if (empty($where_with_placeholders) || !$table_name) {
                return false;
            }

            $sql_query = 'DELETE FROM ' . $table_name . ' WHERE ' . $where_with_placeholders;

            Event::dispatch(EventData::forBefore(Event::BEFORE_DELETE, $table_name, $named_parameters, $sql_query));
            try {
                //Run Delete query, collect stats
                $stmt = $this->db_connection->prepare($sql_query);
                if (!empty($named_parameters)) {
                    foreach ($named_parameters as $k => $v) {
                        $stmt->bindValue($k, $v);
                    }
                }

                $stmt->execute();
            } catch (Exception $ex) {
                Event::dispatch(EventData::forException($ex, $sql_query, $named_parameters));

                throw new QueryException($ex->getMessage(), $ex->getCode(), $ex);
            }

            $rows_affected = $stmt->rowCount();
            Event::dispatch(EventData::forAfter(Event::AFTER_DELETE, $table_name, $named_parameters, $sql_query, $rows_affected));

            return $rows_affected;

        }
1068269
public function selectionExist($group_name, $name = 'group')
    {
        if(!array_key_exists($group_name, $this->units))
        {
            return false;
        }

        if(!array_key_exists($name, $this->units[$group_name]))
        {
            return false;
        }

        return true;
    }
113961
public function isRouteName($name)
    {
        if (!$request = $this->requestStack->getMasterRequest()) {
            return false;
        }

        return $name === $request->get('_route');
    }
168669
public function hasClass($class_name)
    {
        foreach ($this->nodes as $node) {
            if ($node instanceof \DOMElement && $node_class_attr = $node->getAttribute('class')) {
                $node_classes = explode(' ', $node_class_attr);
                if (\in_array($class_name, $node_classes, true)) {
                    return true;
                }
            }
        }

        return false;
    }