コード例 #1
0
 public function testRequestProviderIsAbleToBeOverridden()
 {
     $environment = new Environment($requestProvider = m::mock('Cartalyst\\DataGrid\\RequestProviders\\ProviderInterface'));
     $this->assertEquals($requestProvider, $environment->getRequestProvider());
     $environment->setRequestProvider($requestProvider2 = m::mock('Cartalyst\\DataGrid\\RequestProviders\\ProviderInterface'));
     $this->assertEquals($requestProvider2, $environment->getRequestProvider());
     $this->assertNotSame($requestProvider, $environment->getRequestProvider());
 }
コード例 #2
0
ファイル: _ide_helper.php プロジェクト: blargent/pimplot
 /**
  * Returns the active request instance.
  *
  * @return \Cartalyst\DataGrid\RequestProviders\ProviderInterface 
  * @static 
  */
 public static function getRequestProvider()
 {
     return \Cartalyst\DataGrid\Environment::getRequestProvider();
 }
コード例 #3
0
ファイル: DataGrid.php プロジェクト: sohailaammarocs/lfc
 /**
  * Returns the instance as an array.
  *
  * @return array
  */
 public function toArray()
 {
     $handler = $this->dataHandler;
     $requestProvider = $this->env->getRequestProvider();
     return array('total' => $handler->getTotalCount(), 'filtered' => $handler->getFilteredCount(), 'throttle' => $requestProvider->getThrottle(), 'threshold' => $requestProvider->getThreshold(), 'page' => $handler->getPage(), 'pages' => $handler->getPagesCount(), 'previous_page' => $handler->getPreviousPage(), 'next_page' => $handler->getNextPage(), 'per_page' => $handler->getPerPage(), 'sort' => $handler->getSort(), 'direction' => $handler->getDirection(), 'default_column' => $handler->getDefaultColumn(), 'results' => $handler->getResults());
 }