File tree Expand file tree Collapse file tree 3 files changed +57
-7
lines changed Expand file tree Collapse file tree 3 files changed +57
-7
lines changed Original file line number Diff line number Diff line change 1
- UNDER CONSTRUCTION - DO NOT USE
2
- ===============================
3
-
4
1
php-quickbase
5
2
=============
6
3
4
+ [ ![ License] ( https://poser.pugx.org/tflanagan/quickbase/license )] ( https://packagist.org/packages/tflanagan/quickbase ) [ ![ Latest Stable Version] ( https://poser.pugx.org/tflanagan/quickbase/version )] ( https://packagist.org/packages/tflanagan/quickbase ) [ ![ Total Downloads] ( https://poser.pugx.org/tflanagan/quickbase/downloads )] ( https://packagist.org/packages/tflanagan/quickbase ) [ ![ Build Status] ( https://travis-ci.org/tflanagan/php-quickbase.svg?branch=master )] ( https://travis-ci.org/tflanagan/php-quickbase )
5
+
7
6
A lightweight, very flexible QuickBase API
8
7
8
+ Install
9
+ -------
10
+ ```
11
+ $ composer require tflanagan/quickbase
12
+ ```
13
+
14
+ Example
15
+ -------
16
+ ``` php
17
+
18
+ try {
19
+ $qb = new QuickBase(array(
20
+ 'realm' => 'www',
21
+ 'appToken' => '****'
22
+ ));
23
+
24
+ $qb->api('API_Authenticate', array(
25
+ 'username' => getenv('username'),
26
+ 'password' => getenv('password')
27
+ ));
28
+
29
+ $response = $qb->api('API_DoQuery', array(
30
+ 'dbid' => '*****',
31
+ 'clist' => '3.12',
32
+ 'options' => 'num-5'
33
+ ));
34
+
35
+ foreach($response['table']['records'] as $record){
36
+ $qb->api('API_EditRecord', array(
37
+ 'dbid' => '*****',
38
+ 'rid' => $record[3],
39
+ 'fields' => array(
40
+ array( 'fid' => 12, 'value' => $record[12])
41
+ )
42
+ ));
43
+ }
44
+
45
+ $response = $qb->api('API_DoQuery', array(
46
+ 'dbid' => '*****',
47
+ 'clist' => '3.12',
48
+ 'options' => 'num-5'
49
+ ));
50
+
51
+ var_dump($response['table']['records']);
52
+ }catch(Exception $err){
53
+ var_dump($err);
54
+ }
55
+
56
+ ```
57
+
9
58
License
10
59
-------
11
60
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ protected function constructPayload(){
128
128
$ this ->payload = '' ;
129
129
130
130
if ($ this ->parent ->settings ['flags ' ]['useXML ' ]){
131
- $ xmlDoc = new \ SimpleXMLElement (implode ('' , array (
131
+ $ xmlDoc = new SimpleXMLElement (implode ('' , array (
132
132
'<?xml version="1.0" encoding=" ' ,
133
133
$ this ->options ['encoding ' ],
134
134
'"?> ' ,
@@ -215,7 +215,7 @@ protected function transmit(){
215
215
throw new QuickBaseError (curl_errno ($ ch ), curl_error ($ ch ));
216
216
}
217
217
218
- $ this ->xmlResponse = new \ SimpleXmlIterator ($ response );
218
+ $ this ->xmlResponse = new SimpleXmlIterator ($ response );
219
219
220
220
return $ this ;
221
221
}
@@ -377,7 +377,7 @@ public static function API_DoQuery(&$query){
377
377
}
378
378
379
379
if (!isset ($ query ->options ['fmt ' ]) && isset ($ query ->parent ->settings ['flags ' ]['fmt ' ])){
380
- $ query ->options ['returnPercentage ' ] = $ query ->parent ->settings ['flags ' ]['fmt ' ];
380
+ $ query ->options ['fmt ' ] = $ query ->parent ->settings ['flags ' ]['fmt ' ];
381
381
}
382
382
383
383
if (!isset ($ query ->options ['includeRids ' ]) && isset ($ query ->parent ->settings ['flags ' ]['includeRids ' ])){
Original file line number Diff line number Diff line change 17
17
18
18
$ qb ->api ('API_DoQuery ' , array (
19
19
'dbid ' => getenv ('dbid ' ),
20
- 'query ' => "{'3'.XEX.''} "
20
+ 'query ' => "{'3'.XEX.''} " ,
21
+ 'clist ' => '1.2.3.4.5 '
21
22
));
22
23
23
24
?>
You can’t perform that action at this time.
0 commit comments