|
|
|
|
|
|
|
|
use Lc\SovBundle\Component\FileComponent; |
|
|
use Lc\SovBundle\Component\FileComponent; |
|
|
use Lc\SovBundle\Component\MetaComponent; |
|
|
use Lc\SovBundle\Component\MetaComponent; |
|
|
use Lc\SovBundle\Component\StringComponent; |
|
|
use Lc\SovBundle\Component\StringComponent; |
|
|
|
|
|
use Lc\SovBundle\Doctrine\EntityInterface; |
|
|
use Lc\SovBundle\Form\Newsletter\NewsletterType; |
|
|
use Lc\SovBundle\Form\Newsletter\NewsletterType; |
|
|
use Lc\SovBundle\Model\File\FileInterface; |
|
|
use Lc\SovBundle\Model\File\FileInterface; |
|
|
use Lc\SovBundle\Repository\Reminder\ReminderStore; |
|
|
use Lc\SovBundle\Repository\Reminder\ReminderStore; |
|
|
|
|
|
|
|
|
new TwigFunction('day_by_number', [$this, 'getDayByNumber']), |
|
|
new TwigFunction('day_by_number', [$this, 'getDayByNumber']), |
|
|
new TwigFunction('user_current', [$this, 'getUserCurrent']), |
|
|
new TwigFunction('user_current', [$this, 'getUserCurrent']), |
|
|
new TwigFunction('ea_url_short', [$this, 'generateEaUrl']), |
|
|
new TwigFunction('ea_url_short', [$this, 'generateEaUrl']), |
|
|
|
|
|
new TwigFunction('is_instance_of', [$this, 'isInstanceOf']), |
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function isInstanceOf(EntityInterface $entity, string $interfaceName) |
|
|
|
|
|
{ |
|
|
|
|
|
$reflection = new \ReflectionClass($entity); |
|
|
|
|
|
$interfaceNameArray = $reflection->getInterfaceNames(); |
|
|
|
|
|
|
|
|
|
|
|
foreach($interfaceNameArray as $interfaceNameEntity) { |
|
|
|
|
|
if(strpos($interfaceNameEntity, $interfaceName) !== false) { |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public function sovCache($file) |
|
|
public function sovCache($file) |
|
|
{ |
|
|
{ |
|
|
$cacheTime = filemtime($this->kernel->getProjectDir() . '/public' . $file); |
|
|
$cacheTime = filemtime($this->kernel->getProjectDir() . '/public' . $file); |