| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Coverage | 73.32% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class ObjectToTabellaExtension extends \Twig_Extension |
||
| 8 | { |
||
| 9 | public $container; |
||
| 10 | |||
| 11 | public function getFunctions() |
||
| 12 | { |
||
| 13 | return array( |
||
| 14 | new \Twig_SimpleFunction('object2view', array($this, 'object2View', 'is_safe' => array('html'))), |
||
| 15 | new \Twig_SimpleFunction('field2object', array($this, 'field2Object', 'is_safe' => array('html'))), |
||
| 16 | new \Twig_SimpleFunction('joinfieldid', array($this, 'joinFieldId', 'is_safe' => array('html'))), |
||
| 17 | ); |
||
| 18 | } |
||
| 19 | |||
| 20 | 7 | public function object2View($object, $type = null, $decodifiche = null) |
|
| 21 | { |
||
| 22 | 7 | $dfr = new DoctrineFieldReader($this->container); |
|
| 23 | 7 | return $dfr->object2View($object, $type, $decodifiche); |
|
| 24 | } |
||
| 25 | |||
| 26 | 7 | public function field2Object($fieldname, $object, $decodifiche = null) |
|
| 27 | { |
||
| 28 | 7 | $dfr = new DoctrineFieldReader($this->container); |
|
| 29 | 7 | return $dfr->getField2Object($fieldname, $object, $decodifiche); |
|
| 30 | } |
||
| 31 | 2 | public function joinFieldId($object) |
|
| 38 | } |
||
| 39 | } |
||
| 40 |