Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

implement voter for SitemapAwareDocuments #247

Merged

Conversation

ElectricMaxxx
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #240
License MIT
Doc PR symfony-cmf/symfony-cmf-docs#692

*/
class SitemapAwareDocumentVoter implements VoterInterface
{

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra blank line

@ElectricMaxxx ElectricMaxxx force-pushed the feature/ISSUE-240_voter_for_sitemap_aware_docuemtents branch from aa06325 to 3abdaa5 Compare July 31, 2015 10:54
*/
public function exposeOnSitemap($content, $sitemap)
{
return $content instanceof SitemapAwareInterface && $content->isVisibleInSitemap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the voters need to be unanimous, right? and there is no 3rd option "abstain"? i think whe need to say if (!$content instanceof SitemapAwareInterface) {return true;}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we don't split that, every content that does not implement the interface will automatically be hidden from all sitemaps. imo if we want only such models, it would be the job of the provider to not load others in the first place.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think, we just have a true/false return on the voters, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhh now i understand.

@dbu
Copy link
Member

dbu commented Jul 31, 2015

lets squash the commits and merge, looks good!

@ElectricMaxxx
Copy link
Member Author

no, forgot to change my tests that fits the preor case

change method signature

fix cs and result

fix tests

fix ocurances on method call, fix tests
@ElectricMaxxx ElectricMaxxx force-pushed the feature/ISSUE-240_voter_for_sitemap_aware_docuemtents branch from c8fec78 to 52a1356 Compare July 31, 2015 13:47
@ElectricMaxxx
Copy link
Member Author

merge this when happy.

@dbu
Copy link
Member

dbu commented Jul 31, 2015

this also needs to be documented

@ElectricMaxxx
Copy link
Member Author

ElectricMaxxx commented Jul 31, 2015 via email

ElectricMaxxx added a commit that referenced this pull request Jul 31, 2015
…sitemap_aware_docuemtents

implement voter for SitemapAwareDocuments
@ElectricMaxxx ElectricMaxxx merged commit 6b82dc3 into master Jul 31, 2015
@lsmith77 lsmith77 removed the wip/poc label Jul 31, 2015
@ElectricMaxxx ElectricMaxxx deleted the feature/ISSUE-240_voter_for_sitemap_aware_docuemtents branch July 31, 2015 14:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants