diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-21 16:45:36 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-10-21 16:45:36 +0200 |
commit | 42d69a95f3276a2d6089ca68f635c4e2f6aa7a23 (patch) | |
tree | 6a17fd7998f291e6dec1d996c1e7c724b92b8e58 /db/feed.php | |
parent | 0e6598b0734fb927109f745d9c0f3a8605a30ca5 (diff) |
convert tabs indention to indention with 4 spaces because of mixing of both variants in code and better readability on github and websites because you cant set the indention width there and 8 spaces will be used for a tab
Diffstat (limited to 'db/feed.php')
-rw-r--r-- | db/feed.php | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/db/feed.php b/db/feed.php index c5b76656e..0f5a9ba47 100644 --- a/db/feed.php +++ b/db/feed.php @@ -43,94 +43,94 @@ use \OCP\AppFramework\Db\Entity; */ class Feed extends Entity implements IAPI, \JsonSerializable { - use EntityJSONSerializer; - - protected $userId; - protected $urlHash; - protected $url; - protected $title; - protected $faviconLink; - protected $added; - protected $folderId; - protected $unreadCount; - protected $link; - protected $preventUpdate; - protected $deletedAt; - protected $articlesPerUpdate; - - public function __construct(){ - $this->addType('parentId', 'integer'); - $this->addType('added', 'integer'); - $this->addType('folderId', 'integer'); - $this->addType('unreadCount', 'integer'); - $this->addType('preventUpdate', 'boolean'); - $this->addType('deletedAt', 'integer'); - $this->addType('articlesPerUpdate', 'integer'); - } - - - /** - * Turns entitie attributes into an array - */ - public function jsonSerialize() { - $serialized = $this->serializeFields([ - 'id', - 'userId', - 'urlHash', - 'url', - 'title', - 'faviconLink', - 'added', - 'folderId', - 'unreadCount', - 'link', - 'preventUpdate', - 'deletedAt', - 'articlesPerUpdate', - ]); - - $url = parse_url($this->link)['host']; - - // strip leading www. to avoid css class confusion - if (strpos($url, 'www.') === 0) { - $url = substr($url, 4); - } - - $serialized['cssClass'] = 'custom-' . str_replace('.', '-', $url); - - return $serialized; - } - - - public function toAPI() { - return $this->serializeFields([ - 'id', - 'url', - 'title', - 'faviconLink', - 'added', - 'folderId', - 'unreadCount', - 'link' - ]); - } - - - public function setUrl($url) { - $url = trim($url); - if(strpos($url, 'http') === 0) { - parent::setUrl($url); - $this->setUrlHash(md5($url)); - } - } - - - public function setLink($url) { - $url = trim($url); - if(strpos($url, 'http') === 0) { - parent::setLink($url); - } - } + use EntityJSONSerializer; + + protected $userId; + protected $urlHash; + protected $url; + protected $title; + protected $faviconLink; + protected $added; + protected $folderId; + protected $unreadCount; + protected $link; + protected $preventUpdate; + protected $deletedAt; + protected $articlesPerUpdate; + + public function __construct(){ + $this->addType('parentId', 'integer'); + $this->addType('added', 'integer'); + $this->addType('folderId', 'integer'); + $this->addType('unreadCount', 'integer'); + $this->addType('preventUpdate', 'boolean'); + $this->addType('deletedAt', 'integer'); + $this->addType('articlesPerUpdate', 'integer'); + } + + + /** + * Turns entitie attributes into an array + */ + public function jsonSerialize() { + $serialized = $this->serializeFields([ + 'id', + 'userId', + 'urlHash', + 'url', + 'title', + 'faviconLink', + 'added', + 'folderId', + 'unreadCount', + 'link', + 'preventUpdate', + 'deletedAt', + 'articlesPerUpdate', + ]); + + $url = parse_url($this->link)['host']; + + // strip leading www. to avoid css class confusion + if (strpos($url, 'www.') === 0) { + $url = substr($url, 4); + } + + $serialized['cssClass'] = 'custom-' . str_replace('.', '-', $url); + + return $serialized; + } + + + public function toAPI() { + return $this->serializeFields([ + 'id', + 'url', + 'title', + 'faviconLink', + 'added', + 'folderId', + 'unreadCount', + 'link' + ]); + } + + + public function setUrl($url) { + $url = trim($url); + if(strpos($url, 'http') === 0) { + parent::setUrl($url); + $this->setUrlHash(md5($url)); + } + } + + + public function setLink($url) { + $url = trim($url); + if(strpos($url, 'http') === 0) { + parent::setLink($url); + } + } }
\ No newline at end of file |