Definition at line 39 of file json_query.inc.
◆ __construct()
JSONQuery::__construct |
( |
|
$class, |
|
|
|
$constraints = "" |
|
) |
| |
◆ create()
static JSONQuery::create |
( |
|
$class, |
|
|
|
$constraints = "" |
|
) |
| |
|
static |
◆ execute()
Reimplemented from AbstractQuery.
Definition at line 55 of file json_query.inc.
58 if (!$json)
return null;
60 $json = json_decode($json);
62 if (is_object($json)) $json = array($json);
64 foreach($json as $jsonItem)
68 $item->fromJSON($jsonItem);
◆ executeRaw()
JSONQuery::executeRaw |
( |
| ) |
|
Definition at line 96 of file json_query.inc.
101 if (!
startsWith($query,
"SELECT ")) $query =
"SELECT $query";
107 $result = $db->prepare($query);
108 $result->execute($this->
params);
112 $line = $result->fetch();
113 trace(print_r($line,
true), 1);
122 catch(PDOException $e)
124 $err =
"JSONQuery failed - " . $e->getMessage();
params($params)
Sets the bound parameters array.
static getConnection()
Retrieves a reference to the global database connection.
trace($msg, $lvl=3, $callStack=null)
Send output to the trace log.
startsWith($text, $start)
Tests whether a string starts with a given sub-string.
◆ executeSingle()
JSONQuery::executeSingle |
( |
| ) |
|
Definition at line 76 of file json_query.inc.
79 trace(print_r($json,
true), 1);
80 if (!$json)
return null;
84 throw new FakoliException(
"Ambiguous Singleton Query - JSON");
89 $item->fromJSON($json);
91 trace(print_r($item,
true), 1);
◆ groupBy()
JSONQuery::groupBy |
( |
|
$groupBy | ) |
|
◆ $groupBy
The documentation for this class was generated from the following file: