SilverWare\Flickr\Components\FlickrPhotosComponent
An extension of the base component class for a Flickr photos component.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2018 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class FlickrPhotosComponent
extends BaseComponent
implements
Flushable
{
- // constants
- const TAG_MODE_ANY = 'any';
- const TAG_MODE_ALL = 'all';
- const TITLE_MODE_NONE = 'none';
- const TITLE_MODE_TITLE = 'title';
- const TITLE_MODE_FOOTER = 'footer';
- // members
- private static array $dependencies = ;
- private static string $singular_name = 'Flickr Photos Component';
- private static string $plural_name = 'Flickr Photos Components';
- private static string $description = 'A component which shows a series of photos from Flickr';
- private static string $icon = 'silverware/flickr: admin/client/dist/images/icons/FlickrPhotosComponent.png';
- private static string $table_name = 'SilverWare_FlickrPhotosComponent';
- private static string $hide_ancestor = BaseComponent::class;
- private static array $db = ;
- private static array $defaults = ;
- private static array $casting = ;
- private static string $flickr_url = 'https://www.flickr.com/photos/%s';
- private static string $flickr_url_tags = 'https://www.flickr.com/photos/%s/tags/%s';
- // methods
- public static void flush()
- public static CacheInterface cache()
- public FieldList getCMSFields()
- public array fieldLabels()
- public void onBeforeWrite()
- public void populateDefaults()
- public ArrayList getPhotos()
- public boolean hasTags()
- public string getFlickrLink()
- public string getFlickrLinkTitle()
- public string getFlickrLogoWidth()
- public string getFlickrLogoURL()
- public string getNoDataMessage()
- public boolean getNoDataMessageShown()
- public string getCacheKey()
- public string getTitleModeAttribute()
- public array getTagModeOptions()
- public array getTitleModeOptions()
- protected void cleanUser()
- protected void cleanTags()
Hierarchy
Extends
- SilverWare\Components\BaseComponent
Implements
- SilverStripe\Core\Flushable
Constants
Name | Value |
---|---|
TAG_MODE_ANY | 'any' |
TAG_MODE_ALL | 'all' |
TITLE_MODE_NONE | 'none' |
TITLE_MODE_TITLE | 'title' |
TITLE_MODE_FOOTER | 'footer' |
Members
private
- $casting
—
array
Maps field and method names to the class names of casting objects. - $db
—
array
Maps field names to field types for this object. - $defaults
—
array
Defines the default values for the fields of this object. - $dependencies
—
array
Defines the injector dependencies for this object. - $description
—
string
Description of this object. - $flickr_url
—
string
Defines the URL for the Flickr link. - $hide_ancestor
—
string
Defines an ancestor class to hide from the admin interface. - $icon
—
string
Icon file for this object. - $plural_name
—
string
Human-readable plural name. - $singular_name
—
string
Human-readable singular name. - $table_name
—
string
Defines the table name to use for this object.
Methods
protected
- cleanTags() — Cleans the tags attribute before writing.
- cleanUser() — Cleans the user attribute before writing.
public
- cache() — Answers the cache object.
- fieldLabels() — Answers the labels for the fields of the receiver.
- flush() — Clears the cache upon flush.
- getCMSFields() — Answers a list of field objects for the CMS interface.
- getCacheKey() — Answers the key used with the cache.
- getFlickrLink() — Answers the URL for the Flickr link.
- getFlickrLinkTitle() — Answers the title for the Flickr link.
- getFlickrLogoURL() — Answers the URL for the Flickr logo vector image.
- getFlickrLogoWidth() — Answers the width for the Flickr logo.
- getNoDataMessage() — Answers a message string to be shown when no data is available.
- getNoDataMessageShown() — Answers true if the no data message is to be shown.
- getPhotos() — Answers a list of photos from the Flickr API.
- getTagModeOptions() — Answers an array of options for the tag mode field.
- getTitleModeAttribute() — Answers the title attribute according to the selected title mode.
- getTitleModeOptions() — Answers an array of options for the title mode field.
- hasTags() — Answers true of the receiver has tags defined.
- onBeforeWrite() — Event method called before the receiver is written to the database.
- populateDefaults() — Populates the default values for the fields of the receiver.