for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Cdf\BiCoreBundle\Twig\Extension;
use Cdf\BiCoreBundle\Utils\Entity\DoctrineFieldReader;
class ObjectToTabellaExtension extends \Twig_Extension
Twig_Extension
If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated annotation
ignore-deprecated
class ObjectToTabellaExtension extends /** @scrutinizer ignore-deprecated */ \Twig_Extension
{
private $tableprefix;
public function __construct($tableprefix)
$this->tableprefix = $tableprefix;
}
public function getFunctions()
return array(
new \Twig_SimpleFunction('object2view', array($this, 'object2View', 'is_safe' => array('html'))),
Twig_SimpleFunction
/** @scrutinizer ignore-deprecated */ new \Twig_SimpleFunction('object2view', array($this, 'object2View', 'is_safe' => array('html'))),
new \Twig_SimpleFunction('field2object', array($this, 'field2Object', 'is_safe' => array('html'))),
/** @scrutinizer ignore-deprecated */ new \Twig_SimpleFunction('field2object', array($this, 'field2Object', 'is_safe' => array('html'))),
new \Twig_SimpleFunction('joinfieldid', array($this, 'joinFieldId', 'is_safe' => array('html'))),
/** @scrutinizer ignore-deprecated */ new \Twig_SimpleFunction('joinfieldid', array($this, 'joinFieldId', 'is_safe' => array('html'))),
);
public function object2View($object, $type = null, $decodifiche = null)
$dfr = new DoctrineFieldReader($this->tableprefix);
return $dfr->object2View($object, $type, $decodifiche);
public function field2Object($fieldname, $object, $decodifiche = null)
return $dfr->getField2Object($fieldname, $object, $decodifiche);
public function joinFieldId($object)
$valore = null;
if ($object) {
$valore = $object->getId();
return $valore;