Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9095347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:34:33+00:00 2026-06-16T23:34:33+00:00

In my Symfony2 app, people can write texts that will be published on a

  • 0

In my Symfony2 app, people can write texts that will be published on a webpage.
There is an option to write a new text, and you have to select the webpage it will belong to.

What I want to achieve, is that this list of webpages shows webpages that do not yet have a text only. Otherwise you will end up replacing an existing text.

So I would like to write something like this in my form type:

$qb->select('wp')
->from('MyBundle:Webpage', 'wp')
->where('wp.webtexts is null')
->orderBy('wp.id');

The problem arises around the “wp.webtexts is null” statement. This is a (fully functioning) many-to-many relationship, and I would like to test whether there are no relations here. The error I receive, is:

[Semantical Error] line 0, col 70 near ‘webtexts is null’: Error:
Invalid PathExpression. StateFieldPathExpression or
SingleValuedAssociationField expected.

How can I query for webpages, with no relations to any webtexts?

Added:

How could I count the amount of relations? This notation:

 $qb->where($qb->expr()->count('wp.webtexts < 1'))

…gives me:

[Syntax Error] line 0, col 85: Error: Expected
Doctrine\ORM\Query\Lexer::T_CLOSE_PARENTHESIS, got ‘<‘

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:34:34+00:00Added an answer on June 16, 2026 at 11:34 pm

    If you are trying to check against the webtexts object you should query the webtexts id field rather than the webtexts object. Doctrine is still trying to write SQL at the end of the day and in SQL you would have to query a field:

    $qb->select('wp')
        ->from('MyBundle:Webpage', 'wp')
        ->leftJoin('wp.webtexts', 'wt')
        ->where('wt.id IS NULL')
        ->orderBy('wp.id');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Symfony2 app representing a restful application that has no need for
I have a Symfony2 command line app that I've built. It fetches a ton
I have a console app, (written as a Symfony2 command) that is reading input
i'm building a mobile app talking to my symfony2 app via webservices I can't
How can I access web folder from config.yml in a symfony2 app ? I
I have a Symfony2 project with a MySQL db: #app/config/config.yml doctrine: dbal: driver: %database_driver%
I have just installed symfony2 and I used this statement php app/console doctrine:schema:create When
I have a web-app, written in PHP, and I am using Symfony2 as the
As we can read in Symfony2 documentation , JavaScript files have to be declared
In a nutshell I'm writing a Symfony2 / Doctrine2 app and have installed and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.