GRIS_SEARCHBUCKET
in package
Class for searchbucket
With this class searches can be stored, edited and displayed
PHP version 8
Copyright (c) 2023, Peter Kuntner, Lifbi
Tags
Table of Contents
- dbtable = 'gris_searchbucket'
- The constant for the database table where the settings are stored
- $classname : object
- The name of the class
- $dbconnection : object
- The database object for managing the connection
- $i18n : object
- The object for translations
- $person_id : int
- The person ID
- $settings : object
- The object for settings
- $state : object
- The object for logs
- __construct() : mixed
- The class constructor
- delete_entry() : bool
- Delete a searchbucket with a given ID
- get() : array<string|int, mixed>
- Get all data of a note for a given ID
- get_list() : void
- Get a list of saved searches
- get_list_table() : mixed
- parse_bucket() : array<string|int, mixed>
- Parse the string of a searchentry
- set() : bool
- Store a new Search in Searchbucket
Constants
dbtable
The constant for the database table where the settings are stored
public
mixed
dbtable
= 'gris_searchbucket'
Properties
$classname
The name of the class
protected
object
$classname
= NULL
Tags
$dbconnection
The database object for managing the connection
private
object
$dbconnection
= null
Tags
$i18n
The object for translations
private
object
$i18n
Tags
$person_id
The person ID
private
int
$person_id
Tags
$settings
The object for settings
private
object
$settings
= null
Tags
$state
The object for logs
private
object
$state
Tags
Methods
__construct()
The class constructor
public
__construct([mixed $person_id = NULL ]) : mixed
int $person_id The person ID
Initializes the login state and checks wether the user is already logged in
Parameters
- $person_id : mixed = NULL
Return values
mixed —delete_entry()
Delete a searchbucket with a given ID
public
delete_entry(int $id) : bool
Parameters
- $id : int
-
The ID of the searchbucket to delete
Return values
bool —Returns true on success and false on error
get()
Get all data of a note for a given ID
public
get(int $id) : array<string|int, mixed>
Parameters
- $id : int
-
The note ID
Return values
array<string|int, mixed> —Returns an array with the data of the note
get_list()
Get a list of saved searches
public
get_list() : void
Return values
void —get_list_table()
public
get_list_table(mixed $url) : mixed
Parameters
- $url : mixed
Return values
mixed —parse_bucket()
Parse the string of a searchentry
public
parse_bucket(int $id) : array<string|int, mixed>
Parameters
- $id : int
-
The note ID
Return values
array<string|int, mixed> —Returns an array with the data of the note
set()
Store a new Search in Searchbucket
public
set(string $termtosave[, string $title = "" ]) : bool
Parameters
- $termtosave : string
-
The term to save
- $title : string = ""
-
The title
Return values
bool —Returns true on success and false on error