| Total Complexity | 4 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 66.67% |
| 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 | 7 | ||
| 20 | public function object2View($object, $type = null, $decodifiche = null) |
||
| 21 | 7 | { |
|
| 22 | 7 | $dfr = new DoctrineFieldReader($this->container); |
|
| 23 | return $dfr->object2View($object, $type, $decodifiche); |
||
| 24 | } |
||
| 25 | 7 | ||
| 26 | public function field2Object($fieldname, $object, $decodifiche = null) |
||
| 27 | 7 | { |
|
| 28 | 7 | $dfr = new DoctrineFieldReader($this->container); |
|
| 29 | return $dfr->getField2Object($fieldname, $object, $decodifiche); |
||
| 30 | } |
||
| 31 | public function joinFieldId($object) |
||
| 34 | } |
||
| 35 | } |
||
| 36 |