@@ -43,7 +43,7 @@ class Ajax
4343 *
4444 * @var string
4545 */
46- protected $ type ;
46+ protected $ method ;
4747
4848 /**
4949 * Data to be sent.
@@ -90,17 +90,17 @@ public function configureOptions(OptionsResolver $resolver)
9090 {
9191 $ resolver ->setDefaults (array (
9292 'url ' => null ,
93- 'type ' => 'GET ' ,
93+ 'method ' => 'GET ' ,
9494 'data ' => null ,
9595 'pipeline ' => 0 ,
9696 ));
9797
9898 $ resolver ->setAllowedTypes ('url ' , array ('null ' , 'string ' ));
99- $ resolver ->setAllowedTypes ('type ' , 'string ' );
99+ $ resolver ->setAllowedTypes ('method ' , 'string ' );
100100 $ resolver ->setAllowedTypes ('data ' , array ('null ' , 'array ' ));
101101 $ resolver ->setAllowedTypes ('pipeline ' , 'int ' );
102102
103- $ resolver ->setAllowedValues ('type ' , array ('GET ' , 'POST ' ));
103+ $ resolver ->setAllowedValues ('method ' , array ('GET ' , 'POST ' ));
104104
105105 return $ this ;
106106 }
@@ -134,29 +134,49 @@ public function setUrl($url)
134134 }
135135
136136 /**
137- * Get type .
137+ * Get method .
138138 *
139139 * @return string
140140 */
141+ public function getMethod ()
142+ {
143+ return $ this ->method ;
144+ }
145+
146+ /**
147+ * @return string
148+ * @deprecated Use getMethod() instead
149+ */
141150 public function getType ()
142151 {
143- return $ this ->type ;
152+ return $ this ->getMethod () ;
144153 }
145154
146155 /**
147- * Set type .
156+ * Set method .
148157 *
149- * @param string $type
158+ * @param string $method
150159 *
151160 * @return $this
152161 */
153- public function setType ( $ type )
162+ public function setMethod ( $ method )
154163 {
155- $ this ->type = $ type ;
164+ $ this ->method = $ method ;
156165
157166 return $ this ;
158167 }
159168
169+ /**
170+ * @param $method
171+ *
172+ * @return \Sg\DatatablesBundle\Datatable\Ajax
173+ * @deprecated Use setMethod() instead
174+ */
175+ public function setType ($ method )
176+ {
177+ return $ this ->setMethod ($ method );
178+ }
179+
160180 /**
161181 * Get data.
162182 *
0 commit comments