Exemplo n.º 1
0
 /**
  * Fetch data for this collection.  If your request is a POST, then we'll
  * get the data from the request.  If it's not a POST, we ask the
  * fetchDataCallback for the initial data set.
  *
  * @param string $mode
  * @return array|mixed
  */
 public function getData($mode = self::DATA_MODE_COLUMN_NAMES)
 {
     if (!$this->request->isPost()) {
         return call_user_func($this->fetchDataCallback);
     } else {
         return $this->getDataFromRequest($this->request->getPost(), $mode);
     }
 }
Exemplo n.º 2
0
 public function testIsPostWorksWhenMethodIsNotPost()
 {
     $request = new Request(array(), array(), 'GET');
     $this->assertFalse($request->isPost());
 }