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

Implemented twig methods sulu_article_load_recent sulu_article_load_similar #193

Merged

Conversation

trickreich
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Fixed tickets fixes --
Related issues/PRs --
License MIT

What's in this PR?

Implemented twig methods sulu_article_load_recent sulu_article_load_similar and ArticleViewDocumentRepository.

Copy link
Member

@wachterjohannes wachterjohannes left a comment

Choose a reason for hiding this comment

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

functionality is good

use Sulu\Bundle\ArticleBundle\Document\ArticleViewDocumentInterface;
use Sulu\Component\DocumentManager\DocumentManagerInterface;

class ArticleResourceItemFactory
Copy link
Member

Choose a reason for hiding this comment

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

phpdoc also on classes and interfaces

*
* @return ArticleResourceItem
*/
public function getResourceItem(ArticleViewDocumentInterface $articleViewDocument)
Copy link
Member

Choose a reason for hiding this comment

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

use createResurceItem - factory creates items

@@ -86,6 +86,17 @@ public function getConfigTreeBuilder()
->end()
->end()
->scalarNode('display_tab_all')->defaultTrue()->info("Display tab 'all' in list view")->end()
->arrayNode('search_fields')
Copy link
Member

Choose a reason for hiding this comment

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

update config:dump in installation.md

use Sulu\Bundle\ArticleBundle\Metadata\ArticleViewDocumentIdTrait;
use Sulu\Component\DocumentManager\DocumentManagerInterface;

class ArticleViewDocumentRepository
Copy link
Member

Choose a reason for hiding this comment

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

phpdoc

}

/**
* @param int $limit
Copy link
Member

Choose a reason for hiding this comment

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

always add a description for function

$search->addQuery(new TermQuery('uuid', $excludeUuid), BoolQuery::MUST_NOT);
}

$search->addSort(new FieldSort('published'));
Copy link
Member

Choose a reason for hiding this comment

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

hmm in my opinion should be authored

*
* @return DocumentIterator
*/
public function findRecent($excludeUuid = null, $limit, array $types = null, $locale)
Copy link
Member

Choose a reason for hiding this comment

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

provide a default for limit

@wachterjohannes wachterjohannes merged commit e1680ba into sulu:develop Jun 14, 2017
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 this pull request may close these issues.

2 participants