\Copilot\ClientNews

This class represents a news item from the co*pilot news feed.

Summary

Methods
Properties
Constants
getId()
getHeadline()
getTeaser()
getText()
getDatePublished()
getMainImageLink()
getMainImage()
hasArtistReferences()
getReferences()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

getId()

getId() : string

Returns the id of the news entry

Returns

string —

The id of the news entry

getHeadline()

getHeadline() : string

Returns the headline of the news entry

Returns

string —

The headline

getTeaser()

getTeaser() 

Returns an unformatted teaser text

getText()

getText() 

Returns the news text in HTML format

getDatePublished()

getDatePublished(string  $format = "d.m.Y H:i") : string

Returns the date the news has been published

Parameters

string $format

The format for the date (default is d.m.Y H:i)

Returns

string —

The formatted date string or an empty string if the date could not be parsed

getMainImageLink()

getMainImageLink(\Copilot\Client\unknown  $width) : string

Returns a link to the main image of the news entry for the given image width

Parameters

\Copilot\Client\unknown $width

The width in pixels

Returns

string —

The link form where to fetch the image. Might be empty when no image is available

getMainImage()

getMainImage() : \Copilot\Client\Asset

Returns the asset that corresponds to the main image

Returns

\Copilot\Client\Asset

The asset or null if no image is set.

hasArtistReferences()

hasArtistReferences() 

Returns whether or not the news is referencing some artist

getReferences()

getReferences() 

Returns the references the news are pointing to.

This is usually returning [{ type : ARTIST, id : xyz }] This means that the news is related to the artist with the id xyz. Could be useful for linking to an artists detail page.