<?php
namespace {{ namespace }};

use Dtc\GridBundle\Grid\Column\TwigBlockGridColumn;

use Twig_Environment;
use ArrayObject;

class {{ class }}
	extends ArrayObject
{
	public function __construct(Twig_Environment $twig)
	{
		$columns = array();

		$template = $twig->loadTemplate('{{ template_name }}');
		$env = $twig->getGlobals();

		{% for field, title in fields -%}
		$col = new TwigBlockGridColumn('{{ field }}', '{{ title }}', $template, $env);
		$col->setOption('width', 75);
		$columns[] = $col;

		{% endfor -%}
		parent::__construct($columns);
	}
}
