Firebrand\Hail\Models\Article
Hail Article DataObject
- Author: Maxime Rainville, Firebrand
Synopsis
class Article
extends ApiObject
{
- // members
- public static string $object_endpoint = "articles";
- public static array $object_parameters = ;
- protected static array $api_map = ;
- private static string $table_name = "HailArticle";
- private static array $db = ;
- private static string $default_sort = "Date DESC";
- private static array $has_one = ;
- private static array $belongs_many_many = ;
- private static array $many_many = ;
- private static array $summary_fields = ;
- private static array $indexes = ;
- private static array $create_table_options = ;
- // Inherited members from ApiObject
- public static array $fetchables;
- public static $object_endpoint;
- public static array $object_parameters;
- protected static $api_map;
- // methods
- public void canDelete()
- public void getCMSFields()
- protected void importing()
- public void fetchImages()
- public void fetchVideos()
- public string Link()
- public string getLinkForPage()
- public string AbsoluteLink()
- public string getType()
- public string getMenuTitle()
- public string getPlaceHolderHero()
- public string getTagList()
- public ArrayList getAllImages()
- public ArrayList getAllVideos()
- public boolean hasHeroImage()
- public boolean hasHeroVideo()
- public boolean hasGalleryImages()
- public boolean hasGalleryVideos()
- public boolean hasImages()
- public boolean hasVideos()
- public Image|null ImagesForSitemap()
- // Inherited methods from ApiObject
- public void getCMSFields()
- public boolean isOutdated()
- public static boolean isFetchable()
- public ApiObject refresh()
- protected boolean importHailData()
- protected void importing()
- protected boolean excluded()
- public static void fetchForOrg()
- public static void fetchAll()
- public void canView()
- public void canDelete()
- public void canCreate()
- public void canEdit()
- protected void makeRecordViewer()
- protected void processPublicTags()
- protected void processPrivateTags()
- protected void processHeroImage()
- protected void processHeroVideo()
- protected void processAttachments()
Hierarchy
Extends
Members
private
- $belongs_many_many
- $create_table_options
- $db
- $default_sort
- $has_one
- $indexes
- $many_many
- $summary_fields
- $table_name
protected
- $api_map
- $api_map
—
array
Map the fields returned by the Hail API with the SilverStripe DB Fields
public
- $fetchables
—
array
List of all the subclasses of Hail ApiObject that can be fetched from Hail - $object_endpoint
- $object_endpoint
—
string
Hail API endpoint name for this object - $object_parameters
- $object_parameters
—
string
Hail API extra endpoint parameters to be passed with every request
Methods
protected
public
- AbsoluteLink() — Return the absolute Article link
- ImagesForSitemap() — Returns hero image to be added to article sitemap when googlesitemap module is installed
- Link() — Return the Article link for the current HailPageController
- canDelete()
- fetchImages() — Fetch the image gallery of this article from the Hail API
- fetchVideos() — Fetch the video gallery of this article from the Hail API
- getAllImages() — List of this Article's images
- getAllVideos() — List of this Article's videos
- getCMSFields()
- getLinkForPage() — Return the Article link for specified HailPage
- getMenuTitle() — Helper to return the title from the breadcrumbs
- getPlaceHolderHero() — Return the placeholder HeroImage link
- getTagList() — List of this Article's public tag names separated by spaces.
- getType() — Helper to return the object type
- hasGalleryImages() — Checks if Article has an Image Gallery
- hasGalleryVideos() — Checks if Article has a Video Gallery
- hasHeroImage() — Checks if Article has a HeroImage
- hasHeroVideo() — Checks if Article has a HeroVideo
- hasImages() — Checks if Article has any Images attached (Hero and / or Gallery)
- hasVideos() — Checks if Article has any Videos attached (Hero and / or Gallery)
Inherited from Firebrand\Hail\Models\ApiObject
protected
- excluded() — Determine if this object is to be excluded based on the provided data (public and private tags).
- importHailData() — Process the json data from Hail API and writes to SS db
- importing() — Is called by {@link importHailData()} to allow children classes to perform additional data assignment
- makeRecordViewer() — Helper function to add a ReadOnly gridfield for a relation
- processAttachments() — Go through the attachments and assign them to this object.
- processHeroImage() — Match the hero image if there's one and assign it to this object
- processHeroVideo() — Match the hero video if there's one and assign it to this object
- processPrivateTags() — Go through the list of private tags and assign them to this object.
- processPublicTags() — Go through the list of public tags and assign them to this object.
public
- canCreate() — Create permission
- canDelete() — Delete permission
- canEdit() — Edit permission
- canView() — View permission
- fetchAll() — Fetch from Hail API for all configured organisations
- fetchForOrg() — Fetch from Hail API for a specified Organisation
- getCMSFields()
- isFetchable() — Determines if the object is fetchable
- isOutdated() — Determines if the object is outdated
- refresh() — Retrieves the latest version of this object from the Hail API