Skip to content

Commit

Permalink
Revert "Merge pull request #449 from acseo/master"
Browse files Browse the repository at this point in the history
This reverts commit 08f109c, reversing
changes made to 7541ae2.
  • Loading branch information
PETIT Yoann committed May 11, 2015
1 parent 08f109c commit 312cdf9
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 518 deletions.
60 changes: 0 additions & 60 deletions Command/GenerateGridCommand.php

This file was deleted.

1 change: 0 additions & 1 deletion DependencyInjection/APYDataGridExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function load(array $configs, ContainerBuilder $container)
$loader->load('services.xml');
$loader->load('columns.xml');

$container->setParameter('apy_data_grid.drivers', $config['drivers']);
$container->setParameter('apy_data_grid.limits', $config['limits']);
$container->setParameter('apy_data_grid.theme', $config['theme']);
$container->setParameter('apy_data_grid.persistence', $config['persistence']);
Expand Down
11 changes: 0 additions & 11 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ public function getConfigTreeBuilder()
->defaultValue(array(20 => '20', 50 => '50', 100 => '100'))
->prototype('scalar')->end()
->end()
->arrayNode("drivers")
/*->validate()
->ifTrue(function($v) {
return !in_array($v, array("yml", "annotation"));
})
->thenInvalid("Some drivers are not known")
->end()
*/
->defaultValue(array('annotation', 'yml'))
->prototype('scalar')->end()
->end()
->booleanNode('persistence')->defaultFalse()->end()
->scalarNode('theme')->defaultValue('APYDataGridBundle::blocks.html.twig')->end()
->scalarNode('no_data_message')->defaultValue('No data')->end()
Expand Down
53 changes: 0 additions & 53 deletions Generator/GridYamlGenerator.php

This file was deleted.

1 change: 1 addition & 0 deletions Grid/Export/DSVExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function computeData($grid)
}

fclose($outstream);

$this->content = $content;
}

Expand Down
4 changes: 1 addition & 3 deletions Grid/Mapping/Driver/Annotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ protected function loadMetadataFromReader($className, $group = 'default')
}

if (empty($this->columns[$className][$group])) {
// Return empty array instead of array keys
$this->columns[$className][$group] = array();
//$this->columns[$className][$group] = array_keys($this->fields[$className][$group]);
$this->columns[$className][$group] = array_keys($this->fields[$className][$group]);
} else {
foreach ($this->columns[$className][$group] as $columnId) {
// Ignore mapped fields
Expand Down
176 changes: 0 additions & 176 deletions Grid/Mapping/Driver/Yaml.php

This file was deleted.

31 changes: 1 addition & 30 deletions Grid/Mapping/Metadata/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ class Manager
*/
protected $drivers;

protected $container;

public function __construct($container)
public function __construct()
{
$this->container = $container;
$this->drivers = new DriverHeap();
}

Expand All @@ -34,28 +31,6 @@ public function addDriver($driver, $priority)
$this->drivers->insert($driver, $priority);
}

/**
* Add drivers to the driver list
*/
public function setDrivers($driverList)
{
$priority = 1;
foreach ($driverList as $driverName) {
switch ($driverName) {
case "annotation" :
$driver = $this->container->get("grid.metadata.driver.annotation");
break;
case "yml" :
$driver = $this->container->get("grid.metadata.driver.yaml");
break;
default :
throw new \Exception("Driver $driverName not found");
}
$this->addDriver($driver, $priority);
$priority++;
}
}

/**
* @todo remove this hack
* @return \APY\DataGridBundle\Grid\Mapping\Metadata\DriverHeap
Expand Down Expand Up @@ -94,10 +69,6 @@ public function getMetadata($className, $group = 'default')
}
}

if (empty($cols)) {
throw new \Exception(sprintf("No metadata information has been found for %s (group : %s)", $className, $group));
}

$metadata->setFields($cols);
$metadata->setFieldsMappings($mappings);
$metadata->setGroupBy($groupBy);
Expand Down
Loading

0 comments on commit 312cdf9

Please sign in to comment.