for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) 2015 ublaboo <[email protected]>
* @author Pavel Janda <[email protected]>
* @package Ublaboo
*/
namespace Ublaboo\DataGrid\Utils;
use Nette\Database\Table\Selection;
final class NetteDatabaseSelectionHelper
{
public static function getDriver(Selection $selection)
$connection = self::getContext($selection)->getConnection();
return $connection->getSupplementalDriver();
}
public static function getContext(Selection $selection)
$reflection = new \ReflectionClass($selection);
$context_property = $reflection->getProperty('context');
$context_property->setAccessible(TRUE);
return $context_property->getValue($selection);