Using DQL to generate SQL TRIM code won't trim '0'.
For ex., this expression doesn't work:
$queryBuilder->andWhere("TRIM (LEADING '0' FROM t.field) LIKE :field")
This is happening as whenever TRIM DQL is converted into SQL, trimming character is checked for being 'false' multiple times. In php, both 0 and '0' are equaled to false.