The sqlGetFromDca
hook is triggered when sql definitions in DCA files are evaluated. It passes
the generated SQL definition and expects the same as return value.
array $sql
The parsed SQL definition.
Return $sql
after adding your custom definitions.
// src/EventListener/SqlGetFromDcaListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
#[AsHook('sqlGetFromDca')]
class SqlGetFromDcaListener
{
public function __invoke(array $sql): array
{
// Modify the array of SQL statements
return $sql;
}
}