Added default tag order to post view proxy

This commit is contained in:
Marcin Kurczewski 2014-10-12 11:30:26 +02:00
parent ec5239607c
commit f114c65355

View file

@ -77,7 +77,13 @@ class PostViewProxy extends AbstractViewProxy
$result->flags->loop = ($post->getFlags() & Post::FLAG_LOOP);
if (!empty($config[self::FETCH_TAGS]))
{
$result->tags = $this->tagViewProxy->fromArray($post->getTags());
usort($result->tags, function($tag1, $tag2)
{
return strcasecmp($tag1->name, $tag2->name);
});
}
if (!empty($config[self::FETCH_USER]))
$result->user = $this->userViewProxy->fromEntity($post->getUser());