PHP 클래스 PDO4You\PDO4You

부터: 2010-09-07
저자: Giovanni Ramos ([email protected])
상속: implements pdo4you\Config
파일 보기 프로젝트 열기: giovanniramos/pdo4you 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$exception array Stores messages Exception thrown

공개 메소드들

메소드 설명
beginTransaction ( )
clearStyle ( string $value ) : string Removes the style markup in html tags, derived from a text editor
commit ( )
css ( ) : void PDO4You Style
delete ( string $jarr, string $use = null ) : array Method to delete a record in the database
exec ( $query )
execute ( string $json, string $use = null ) : array Method to execute a statement in the database
fireAlert ( string $text, object $error ) : void Triggers a warning via email to the system administrator
getConnection ( ) : string Method to retrieve the name of the current instance of connection
getDatahost ( ) : string Method to retrieve the server name
getDataport ( ) : string Method to retrieve the port number of the server
getDriver ( ) : string Method to retrieve the name of the current driver
getInstance ( string $alias = 'standard', string $type = null, string $user = null, string $pass = null, array $option = null ) : object Method to get a single instance of the database per connection
insert ( string $jarr, string $use = null ) : array Method to insert a new record in the database
lastId ( string $sequence = null ) : array Method that returns the ID of the last inserted row or sequence value Database such as MS SQL Server, PostgreSQL, among others, they make use variable sequence
lastInsertId ( $name )
query ( $query )
rollBack ( )
rowCount ( ) : string Method that returns the number of rows affected by the last CRUD (INSERT, SELECT, UPDATE, or DELETE)
select ( string $sql, string $use = null ) : array Method referring to the fetchAll(PDO::FETCH_ASSOC)
selectAll ( string $sql, string $use = null ) : array Method referring to the fetchAll(PDO::FETCH_BOTH)
selectNum ( string $sql, string $use = null ) : array Method referring to the fetchAll(PDO::FETCH_NUM)
selectObj ( string $sql, string $use = null ) : object Method referring to the fetchAll(PDO::FETCH_OBJ)
setInstance ( string $alias ) Method for setting a connection instance
setPersistent ( boolean $persistent = false ) Method for defining the type of communication with the database The default connection is not persistent
setSettings ( string $settings ) Method to set the file path which contains the settings for each adapter connection with a database
showAvailableDrivers ( ) : void Method to display the PDO drivers installed and supported by the server
showServerInfo ( ) : void Method to display details about the target server's database connected
update ( string $jarr, string $use = null ) : array Method to update a record in the database

비공개 메소드들

메소드 설명
__clone ( ) As the builder, we make __clone private to prevent cloning instance of the class
__construct ( ) The constructor is set to private, preventing direct instance of the class
countWhere ( mixed $value = 1, string $operator = '==', string $conditional = 1 ) : integer Returns the sum of occurrences, in an array of a given condition satisfied
executeQuery ( string $jarr, string $type, string $use ) : array Method for manipulation of records in the database
getErrorInfo ( PDOException $e, boolean $debug = false ) : array Method to capture the error information of an Exception
getHandle ( string $alias ) : object Method to return an object PDO connection
getSettings ( ) : string Method to retrieve the path of the file that contains the configuration of adapters
highlightSource ( string $fileName, string $lineNumber, string $showLines = 5 ) : string Method to highlight the syntax of a code
parseJSON ( string $json ) : array Method that converts a string in JSON format for Array
parse_ini_file_advanced ( string $filename ) : array Interprets an INI file with heritage section
selectRecords ( string $query, string $type, string $use, boolean $count = true ) : mixed Method to query records in the database
setConnection ( string $alias ) Method to define which the current instance of connection
setDatahost ( string $host ) Method to set the server name
setDataport ( string $port ) Method to set the port number of the server
setHandle ( string $alias, PDO $instance ) Method for assigning a new object instance PDO connection
singleton ( string $alias, string $driver, string $user, string $pass, array $option ) : void Method Singleton connection
stackTrace ( PDOException $e, boolean $show = true ) : void Method to display the stack trace of an error Exception

메소드 상세

beginTransaction() 공개 정적인 메소드

public static beginTransaction ( )

clearStyle() 공개 정적인 메소드

Removes the style markup in html tags, derived from a text editor
public static clearStyle ( string $value ) : string
$value string The input string
리턴 string

commit() 공개 정적인 메소드

public static commit ( )

css() 공개 정적인 메소드

PDO4You Style
public static css ( ) : void
리턴 void

delete() 공개 정적인 메소드

Method to delete a record in the database
public static delete ( string $jarr, string $use = null ) : array
$jarr string SQL exclusion in JSON/ARRAY format
$use string OPTIONAL Name of the database defined as a new connection instance
리턴 array Returns an array with the number of rows affected by delete operation

exec() 공개 정적인 메소드

public static exec ( $query )

execute() 공개 정적인 메소드

Method to execute a statement in the database
public static execute ( string $json, string $use = null ) : array
$json string SQL statement in JSON format
$use string OPTIONAL Name of the database defined as a new connection instance
리턴 array Returns an array with the number of rows affected by type of operation

fireAlert() 공개 정적인 메소드

Triggers a warning via email to the system administrator
public static fireAlert ( string $text, object $error ) : void
$text string Error Message
$error object Object of diagnostic of the errors
리턴 void

getConnection() 공개 정적인 메소드

Method to retrieve the name of the current instance of connection
public static getConnection ( ) : string
리턴 string

getDatahost() 공개 정적인 메소드

Method to retrieve the server name
public static getDatahost ( ) : string
리턴 string

getDataport() 공개 정적인 메소드

Method to retrieve the port number of the server
public static getDataport ( ) : string
리턴 string

getDriver() 공개 정적인 메소드

Method to retrieve the name of the current driver
public static getDriver ( ) : string
리턴 string

getInstance() 공개 정적인 메소드

Method to get a single instance of the database per connection
public static getInstance ( string $alias = 'standard', string $type = null, string $user = null, string $pass = null, array $option = null ) : object
$alias string Pseudonym that will be used as a pointer to an instance of established connection
$type string Connection type if using "Initial Setup" or "Full DSN"
$user string Username of the database
$pass string Password of the database
$option array Configuration the connection driver
리턴 object

insert() 공개 정적인 메소드

Method to insert a new record in the database
public static insert ( string $jarr, string $use = null ) : array
$jarr string SQL insertion in JSON/ARRAY format
$use string OPTIONAL Name of the database defined as a new connection instance
리턴 array Returns an array with the number of rows affected by insert operation

lastId() 공개 정적인 메소드

Method that returns the ID of the last inserted row or sequence value Database such as MS SQL Server, PostgreSQL, among others, they make use variable sequence
public static lastId ( string $sequence = null ) : array
$sequence string Name of the variable sequence requested for some database
리턴 array

lastInsertId() 공개 정적인 메소드

public static lastInsertId ( $name )

query() 공개 정적인 메소드

public static query ( $query )

rollBack() 공개 정적인 메소드

public static rollBack ( )

rowCount() 공개 정적인 메소드

Method that returns the number of rows affected by the last CRUD (INSERT, SELECT, UPDATE, or DELETE)
public static rowCount ( ) : string
리턴 string

select() 공개 정적인 메소드

Method referring to the fetchAll(PDO::FETCH_ASSOC)
public static select ( string $sql, string $use = null ) : array
$sql string Instruction SQL of query of records
$use string OPTIONAL Name of the database defined as a new connection instance
리턴 array Returns an array indexed by column name

selectAll() 공개 정적인 메소드

Method referring to the fetchAll(PDO::FETCH_BOTH)
public static selectAll ( string $sql, string $use = null ) : array
$sql string Instruction SQL of query of records
$use string OPTIONAL Name of the database defined as a new connection instance
리턴 array Returns an array indexed both by the name as the column number

selectNum() 공개 정적인 메소드

Method referring to the fetchAll(PDO::FETCH_NUM)
public static selectNum ( string $sql, string $use = null ) : array
$sql string Instruction SQL of query of records
$use string OPTIONAL Name of the database defined as a new connection instance
리턴 array Returns an array indexed by column number

selectObj() 공개 정적인 메소드

Method referring to the fetchAll(PDO::FETCH_OBJ)
public static selectObj ( string $sql, string $use = null ) : object
$sql string Instruction SQL of query of records
$use string OPTIONAL Name of the database defined as a new connection instance
리턴 object Returns an object with column names as properties

setInstance() 공개 정적인 메소드

Method for setting a connection instance
public static setInstance ( string $alias )
$alias string Pseudonym of a connection instance

setPersistent() 공개 정적인 메소드

Method for defining the type of communication with the database The default connection is not persistent
public static setPersistent ( boolean $persistent = false )
$persistent boolean Sets a persistent connection

setSettings() 공개 정적인 메소드

Method to set the file path which contains the settings for each adapter connection with a database
public static setSettings ( string $settings )
$settings string Path of the file that contains the configuration of adapters

showAvailableDrivers() 공개 정적인 메소드

Method to display the PDO drivers installed and supported by the server
public static showAvailableDrivers ( ) : void
리턴 void

showServerInfo() 공개 정적인 메소드

Method to display details about the target server's database connected
public static showServerInfo ( ) : void
리턴 void

update() 공개 정적인 메소드

Method to update a record in the database
public static update ( string $jarr, string $use = null ) : array
$jarr string SQL update in JSON/ARRAY format
$use string OPTIONAL Name of the database defined as a new connection instance
리턴 array Returns an array with the number of rows affected by update operation

프로퍼티 상세

$exception 공개적으로 정적으로 프로퍼티

Stores messages Exception thrown
public static array $exception
리턴 array