1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-12 16:58:37 +00:00

Added headers field in Entry

This commit is contained in:
Nicolas Lœuillet 2017-05-11 14:18:21 +02:00
parent 7987816d1e
commit dda6a6addc
No known key found for this signature in database
GPG key ID: 7A5E5FFCBA7EF402
4 changed files with 90 additions and 1 deletions

View file

@ -201,6 +201,15 @@ class Entry
*/
private $httpStatus;
/**
* @var array
*
* @ORM\Column(name="headers", type="json_array", nullable=true)
*
* @Groups({"entries_for_user", "export_all"})
*/
private $headers;
/**
* @Exclude
*
@ -716,7 +725,7 @@ class Entry
}
/**
* @return string
* @return array
*/
public function getPublishedBy()
{
@ -734,4 +743,24 @@ class Entry
return $this;
}
/**
* @return array
*/
public function getHeaders()
{
return $this->headers;
}
/**
* @param string $headers
*
* @return Entry
*/
public function setHeaders($headers)
{
$this->headers = $headers;
return $this;
}
}

View file

@ -87,6 +87,10 @@ class ContentProxy
$entry->setPublishedBy($content['authors']);
}
if (!empty($content['all_headers'])) {
$entry->setHeaders($content['all_headers']);
}
$entry->setLanguage(isset($content['language']) ? $content['language'] : '');
$entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : '');
$entry->setReadingTime(Utils::getReadingTime($html));