Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement CAST and handle ISCHILDNODE joins #267

Open
lsmith77 opened this issue May 2, 2015 · 1 comment
Open

implement CAST and handle ISCHILDNODE joins #267

lsmith77 opened this issue May 2, 2015 · 1 comment

Comments

@lsmith77
Copy link
Member

lsmith77 commented May 2, 2015

SELECT u.*
             FROM [nt:unstructured] AS u
              INNER JOIN [nt:unstructured] AS c ON ISCHILDNODE(c, u)
             WHERE ISDESCENDANTNODE(u, [$newsDataPath])
               AND (u.publishable = true)
               AND (u.publishStartDate IS NULL OR u.publishStartDate <= CAST('$now' AS DATE))
               AND (u.publishEndDate IS NULL OR u.publishEndDate > CAST('$now' AS DATE) OR u.publishEndDate = CAST('2008-01-01T00:00:00.000+01:00' AS DATE))
               AND u.[phpcr:class] = 'Liipch\\NewsBundle\\Document\\NewsItem'
               AND NAME(c) = 'phpcr_locale:$locale'
             ORDER BY u.publishStartDate DESC
@lsmith77
Copy link
Member Author

lsmith77 commented May 2, 2015

for the ISCHILDNODE join some inspiration can maybe be taken from #178

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant