-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
62 lines (55 loc) · 1.33 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
use BenMajor\JQL\JQL;
require 'src/JQL.php';
require 'src/QueryException.php';
require 'src/SyntaxException.php';
$json = [
[
'forename' => 'Ben',
'surname' => 'Major',
'email' => 'ben.major88@gmail.com',
'age' => 31
],
[
'forename' => 'Dave',
'surname' => 'Aaronson',
'email' => 'dave.aaron@gmail.com',
'age' => 41
],
[
'forename' => 'Chris',
'surname' => 'Major',
'email' => 'chris.major@example.com',
'age' => 63,
'tags' => [
'dad', 'father'
]
],
[
'forename' => 'Joe',
'surname' => 'Bloggs',
'email' => 'jbloggs@example.com',
'age' => null
]
];
$query = new JQL( $json );
try
{
print_r(
$query->setTimezone('Europe/Paris')
->select(['forename'])->select(['CURTIME()'])
->where('tags IS NOT EMPTY')
->fetch()
);
/*print_r(
$query->update([ 'forename' => 'UPPER(forename)' ])
->update([ 'surname' => 'PREPEND(surname, \'Mr. \')'])
->where('tags CONTAINS father AND forename = chris')
->order('surname', 'ASC')
->fetch()
);*/
}
catch( Exception $e )
{
die( $e->getMessage() );
}