Because of the way the Date Query class currently works (it being inherited from WordPress) the resulting MySQL string needs to be stashed temporarily in a private variable, so that it can be referred to later in a different method.
This is not ideal for a few reasons:
It does not match the way Meta & Compare queries work
It is not obvious that it works this way
It no longer needs to work this way, now that we've brought our own implementation of the Date Query in-house
It would be much better for it to work more like Meta & Compare, and simply return everything it needs all at once, and provide a subsequent get_sql() method to retrieve the query string part as needed.
Because of the way the Date Query class currently works (it being inherited from WordPress) the resulting MySQL string needs to be stashed temporarily in a private variable, so that it can be referred to later in a different method.
This is not ideal for a few reasons:
It would be much better for it to work more like Meta & Compare, and simply return everything it needs all at once, and provide a subsequent
get_sql()
method to retrieve the query string part as needed.