0

In extbase, how can I find all records that do not have a value in the foreign link column.

I have a model that can relate to a different object. The relation is 1:n and it is called "dayend".

I now create a query like this in the responding repository:

$query->equals("dayend", null);

This does not work, meaning that constraint is completely ignored. The original value in that column is "0". Thus, I also tried

$query->equals("dayend.uid", 0);

However, this throws an error: "Could not determine type of relation."

My goal is to get all objects that are NOT related to any "dayend" object. Any ideas?

Martin
  • 1,889
  • 3
  • 20
  • 25
  • Actually, in my first example, the line is constraint is not being ignored but the query results in an empty query result. – Martin Feb 21 '13 at 16:55
  • 2
    Just two ideas, not tested: use `$query->isEmpty("dayend");` or use something like `$query->statement("SELECT * from WHERE dayend IS NULL AND deleted = 0 AND hidden = 0");`. – Jost Feb 21 '13 at 23:35
  • isEmpty does not exist in extbase: http://forge.typo3.org/issues/8596. I now use the statement. Thanks. – Martin Feb 22 '13 at 08:14

0 Answers0