PHP 클래스 Microweber\Providers\DatabaseManager

상속: extends Microweber\Providers\Database\Utils, use trait Microweber\Traits\QueryFilter, use trait Microweber\Traits\ExtendedSave
파일 보기 프로젝트 열기: microweber/microweber

공개 프로퍼티들

프로퍼티 타입 설명
$app Microweber\Application
$use_cache

공개 메소드들

메소드 설명
__construct ( $app = null ) trait to save extended data, such as attributes, categories and images
delete_by_id ( string $table, integer | string $id, string $field_name = 'id' ) : boolean Deletes item by id from db table.
get ( $table, string | array $params = null ) : mixed Get items from the database.
get_by_id ( string $table, integer | string $id, string $field_name = 'id' ) : array | boolean | mixed Get table row by id.
last_id ( $table ) : boolean | integer Get last id from a table.
q ( $q, $silent = false )
query ( string $q, string | boolean $cache_id = false, string | boolean $cache_group = 'global', boolean $only_query = false, array | boolean $connection_settings = false ) : array | boolean | mixed Executes plain query in the database.
save ( $table, $data = false, boolean $data_to_save_options = false ) : string | integer Generic save data function, it saves data to the database.
table ( $table )

메소드 상세

__construct() 공개 메소드

trait to save extended data, such as attributes, categories and images
public __construct ( $app = null )

delete_by_id() 공개 메소드

Deletes item by id from db table.
public delete_by_id ( string $table, integer | string $id, string $field_name = 'id' ) : boolean
$table string Your da table name
$id integer | string The id to delete
$field_name string You can set custom column to delete by it, default is id
리턴 boolean

get() 공개 메소드

You can use this handy function to get whatever you need from any db table.
public get ( $table, string | array $params = null ) : mixed
$params string | array parameters for the DB
리턴 mixed Array with data or false or integer if page_count is set

get_by_id() 공개 메소드

It returns full db row from a db table
public get_by_id ( string $table, integer | string $id, string $field_name = 'id' ) : array | boolean | mixed
$table string Your table
$id integer | string The id to get
$field_name string You can set custom column to get by it, default is id
리턴 array | boolean | mixed

last_id() 공개 메소드

Get last id from a table.
public last_id ( $table ) : boolean | integer
$table
리턴 boolean | integer

q() 공개 메소드

public q ( $q, $silent = false )

query() 공개 메소드

You can use this function to make queries in the db by writing your own sql The results are returned as array or false if nothing is found
public query ( string $q, string | boolean $cache_id = false, string | boolean $cache_group = 'global', boolean $only_query = false, array | boolean $connection_settings = false ) : array | boolean | mixed
$q string Your SQL query
$cache_id string | boolean It will save the query result in the cache. Set to false to disable
$cache_group string | boolean Stores the result in certain cache group. Set to false to disable
$only_query boolean If set to true, will perform only a query without returning a result
$connection_settings array | boolean
리턴 array | boolean | mixed

save() 공개 메소드

Generic save data function, it saves data to the database.
public save ( $table, $data = false, boolean $data_to_save_options = false ) : string | integer
$table
$data
$data_to_save_options boolean
리턴 string | integer The id of the saved row.

table() 공개 메소드

public table ( $table )

프로퍼티 상세

$app 공개적으로 프로퍼티

public Application,Microweber $app
리턴 Microweber\Application

$use_cache 공개적으로 프로퍼티

public $use_cache