Data_Frontend
A trait for handling frontend data operations in a CodeIgniter application
Overview
The Data_Frontend
trait provides methods for handling various frontend data operations, including article retrieval, entity information, event handling, and search functionality.
Article Information
getArticleInfo
Retrieves all information about an article.
Returns the article object with additional information or false
if the article is not found or not visible.
getItemVisibility
Checks if an item is visible based on its publish date and visibility settings.
Returns true
if the item is visible, false
otherwise.
Entity Information
getEntityTemplate
Retrieves and formats information for a generic entity.
Returns the entity object with additional information.
getNormalInfo
Retrieves information for a normal entity type.
Returns the normal entity object with additional information.
getLocationInfo
Retrieves information for a location entity type.
Returns the location entity object with additional information.
Event Handling
getFutureEvents
Retrieves all future events of a certain type.
Returns an array of future event objects, sorted by start date.
getEventsOfCategory
Retrieves all events of a certain category.
Returns an array of event objects belonging to the specified category.
getFutureEvent
Determines if an event is in the future.
Returns the event item if it’s in the future, false
otherwise.
General Information
addCategoryInfo
Adds additional information to a category object.
Returns the category object with additional information.
getColor
Retrieves the hex color code for a given color ID.
Returns the hex color code.
getGeneralTags
Retrieves general tags based on a tag relation array.
Returns an array of tag objects.
Group Data
getArticleGroupByType
Retrieves all articles of a certain type.
Returns an array of article objects of the specified type.
getArticleGroupByCategory
Retrieves all articles of a certain category.
Returns an array of article objects belonging to the specified category.
getArticleGroupFromArray
Retrieves articles based on an array of entity IDs.
Returns an array of article objects.
getArticlesInfo
Retrieves information for an array of article items.
Returns an array of article objects with additional information or a single article object with additional information.
Related Items
getRelated
Retrieves related items from a related table.
Returns an array of related item objects.
Search
search_item
Searches for a term within an item’s attributes and modules.
Returns true
if the term is found, false
otherwise.
Shop Information
getGlobalShopInfo
Retrieves global shop information, including product details.
Returns an array containing shop information, including an array of product objects.