X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=src%2FWallabag%2FCoreBundle%2FHelper%2FEntriesExport.php;h=de259e7ffc25246acbab2299078b63afd38778cd;hb=4fc7eba34904a062cddf1e61956c48f27cb2e06c;hp=d749dcf91adc422a832ec207bed4362af4085f80;hpb=07320a2bd25c6ace1f9b1aa06b1b08e8dbf4f4fa;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index d749dcf9..de259e7f 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -2,12 +2,12 @@ namespace Wallabag\CoreBundle\Helper; -use JMS\Serializer; use JMS\Serializer\SerializationContext; use JMS\Serializer\SerializerBuilder; use PHPePub\Core\EPub; use PHPePub\Core\Structure\OPF\DublinCore; use Symfony\Component\HttpFoundation\Response; +use Wallabag\CoreBundle\Entity\Entry; /** * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest. @@ -73,7 +73,9 @@ class EntriesExport } /** - * Sets the author for just one entry. + * Sets the author for one entry or category. + * + * The publishers are used, or the domain name if empty. * * @param string $method Method to get articles * @@ -81,10 +83,17 @@ class EntriesExport */ public function updateAuthor($method) { - $this->author = $method.' authors'; + if ('entry' !== $method) { + $this->author = $method . ' authors'; - if ('entry' === $method) { - $this->author = $this->entries[0]->getDomainName(); + return $this; + } + + $this->author = $this->entries[0]->getDomainName(); + + $publishedBy = $this->entries[0]->getPublishedBy(); + if (!empty($publishedBy)) { + $this->author = implode(', ', $publishedBy); } return $this; @@ -418,7 +427,7 @@ class EntriesExport * * @param string $format * - * @return Serializer + * @return string */ private function prepareSerializingContent($format) {