set json api functions parameter names
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 27 Jun 2016 12:38:22 +0000 (14:38 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 27 Jun 2016 13:55:59 +0000 (15:55 +0200)
... if those are missing, Ext.Direct/Ajax can't set
 the params correctly

 see 0011760: create smd from model definition

Change-Id: Ied1a5e7835222b2185f6e4ff3b65cf2dd908e74f
Reviewed-on: http://gerrit.tine20.com/customers/3278
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Tinebase/Server/JsonTests.php
tine20/Tinebase/Server/Json.php

index 94ae428..a665d39 100644 (file)
@@ -45,6 +45,7 @@ class Tinebase_Server_JsonTests extends TestCase
                 (
                     'type' => 'array',
                     'optional' => false,
+                    'name' => 'recordData'
                 )
 
             ),
@@ -60,6 +61,7 @@ class Tinebase_Server_JsonTests extends TestCase
                 (
                     'type' => 'array',
                     'optional' => false,
+                    'name' => 'ids'
                 )
 
             ),
index 1e31bbb..1b07357 100644 (file)
@@ -424,22 +424,46 @@ class Tinebase_Server_Json extends Tinebase_Server_Abstract implements Tinebase_
 
                     $commonJsonApiMethods = array(
                         'get' => array(
-                            'params' => array('string'),
+                            'params' => array(
+                                new Zend_Server_Method_Parameter(array(
+                                    'type' => 'string',
+                                    'name' => 'id',
+                                )),
+                            ),
                             'help'   => 'get one ' . $simpleModelName . ' identified by $id',
                             'plural' => false,
                         ),
                         'search' => array(
-                            'params' => array('array', 'array'),
+                            'params' => array(
+                                new Zend_Server_Method_Parameter(array(
+                                    'type' => 'array',
+                                    'name' => 'filter',
+                                )),
+                                new Zend_Server_Method_Parameter(array(
+                                    'type' => 'array',
+                                    'name' => 'pagination',
+                                )),
+                            ),
                             'help'   => 'Search for ' . $simpleModelName . 's matching given arguments',
                             'plural' => true,
                         ),
                         'save' => array(
-                            'params' => array('array'),
+                            'params' => array(
+                                new Zend_Server_Method_Parameter(array(
+                                    'type' => 'array',
+                                    'name' => 'recordData',
+                                )),
+                            ),
                             'help'   => 'Save ' . $simpleModelName . '',
                             'plural' => false,
                         ),
                         'delete' => array(
-                            'params' => array('array'),
+                            'params' => array(
+                                new Zend_Server_Method_Parameter(array(
+                                    'type' => 'array',
+                                    'name' => 'ids',
+                                )),
+                            ),
                             'help'   => 'Delete multiple ' . $simpleModelName . 's',
                             'plural' => true,
                         ),