Вопрос по symfony – Как преобразовать это в формат Doctrine 2 QueryBuilder?

13

Error: User Rate Limit Exceeded

SELECT * FROM layer WHERE layer.id NOT IN 
               (SELECT task_id FROM users_tasks WHERE user_id = 1) 
AND parent_id IS NOT NULL AND leaf IS TRUE

Error: User Rate Limit ExceededSECOND SELECTError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededcreateQueryBuilderError: User Rate Limit ExceededcreateQuery.

Ваш Ответ

2   ответа
34

$subquery = $this->_em->createQueryBuilder()
    ->select('t.id')
    ->from('yourBundle:Task', 't')
    ->innerjoin('t.user','u')
    ->where('u.id = 1')
    ->getDQL();

$query = $this->_em->createQueryBuilder();
$query->select('l')
      ->from('yourBundle:Layer', 'l')
      ->where($query->expr()->notIn('l.id', $subquery))
      ....;

Error: User Rate Limit ExceededcreateQueryBuilder; PMoubed
Error: User Rate Limit Exceeded PMoubed
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededevernote.com/shard/s338/sh/70b0db2c-a1f8-4c82-ac87-8f6b934be18d/…
Error: User Rate Limit Exceeded
1

Похожие вопросы