\Pluf_SQL

Generate the WHERE SQL clause in an easy and SQL proof way.

Summary

Methods
Properties
Constants
__construct()
gen()
Q()
SAnd()
SOr()
SDef()
keywords()
$ands
No constants found
No protected methods found
$db
$where
N/A
No private methods found
No private properties found
N/A

Properties

$ands

$ands : 

Type

$db

$db : 

Type

$where

$where : 

Type

Methods

__construct()

__construct(  $base = '',   $args = array()) 

Construct the constructor with a default condition.

Parameters

$base
$args

gen()

gen() : string

Returns the where clause.

Returns

string —

Where clause without the WHERE

Q()

Q(  $base,   $args = array()) 

Add a condition.

Parameters

$base
$args

SAnd()

SAnd(  $sql) 

Add another SQL as a AND.

Parameters

$sql

SOr()

SOr(  $sql) 

Add another SQL as a OR

Parameters

$sql

SDef()

SDef(  $sql,   $k = 'AND') 

Add another SQL to the current

Parameters

$sql
$k

keywords()

keywords(  $string,   $del = ' ') : array

Get keywords.

Considering a query string, explode the query string in keywords given a defined delimiter.

Parameters

$string
$del

Returns

array —

Array of keywords