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

Publish workflow, querying published content only #126

Open
ftassi opened this issue Jan 29, 2014 · 4 comments · May be fixed by #177
Open

Publish workflow, querying published content only #126

ftassi opened this issue Jan 29, 2014 · 4 comments · May be fixed by #177
Assignees

Comments

@ftassi
Copy link

ftassi commented Jan 29, 2014

As for now the publish workflow allows to check if a content is "published" or not.
It would be nice to have something that allows to query the database, filtering only published content.

The typical use case of this is when you want to render a list of contents (maybe a long paginated list): you don't want to get 2k documents from the content repository to just show 20 published content.

@dbu
Copy link
Member

dbu commented Jan 29, 2014

agreed. for the time being, i manually put the filter in my queries:

          AND (publishStartDate <= CAST("'.date('Y-m-d\TH:i:s').'.000'.date('P').'" AS DATE) OR publishStartDate IS NULL)
          AND publishable = true

but this is an awful hack and if you add another voter, you would have to update all queries. just while looking for this example i realized that i missed this in one place.

we could do some helpers or a phpcr-odm listener maybe (if there even is a query event). but the workflow itself is independent of storage layer, so its a bit tricky...

@lsmith77
Copy link
Member

what would be cool if we would provide some decorators for this .. ie. the decorators could be provided by the same package as the voter. it could then either add the necessary filters to the query or if its not possible to execute the logic as a query filter, it would then decorate the result set to apply the filters on iteration

@dbu
Copy link
Member

dbu commented Jan 30, 2014

yep, that sounds right. does the code creating the query need to know about them, or can this automatically happen inside phpcr-odm?

@lsmith77
Copy link
Member

this is probably more of a "stretch goal" for 1.3 ..

@dbu dbu self-assigned this Aug 21, 2015
@dbu dbu linked a pull request Aug 25, 2015 that will close this issue
@dbu dbu removed this from the 1.3 milestone Jan 11, 2016
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

Successfully merging a pull request may close this issue.

4 participants