MY_Controller_Data
A trait providing various utility methods for handling article types, entity names, and image management in a PHP application.
Overview
The MY_Controller_Data
trait contains utility methods for managing article types, entity names, and image-related operations. It is designed to be used in conjunction with a controller class in a PHP application.
Properties
Identifier for the repository module item.
An array to store repository-related data.
Identifier for the repository module.
Type of the repository module.
Methods
getArticleTypeId
Retrieves the article type ID based on the given type name.
The corresponding article type ID.
getNoArticleTypeId
Retrieves the non-article type ID based on the given type name.
The corresponding non-article type ID.
getEntityName
Retrieves the entity name based on the type ID and whether it’s an article or not.
The name of the entity.
getRowName
Extracts the name or title from an entity object.
The extracted name or title.
getFrontendOrBackendImages
Processes images based on whether the context is frontend or backend.
Processed array of image objects.
prepareModuleImages
Prepares module images by setting module properties and retrieving images.
Merged array of input data and retrieved image data.
getModuleImages
Retrieves and processes images for the current module.
getTeaserImagesFrontend
Processes teaser images for frontend display.
Processed array of frontend teaser images.
getTeaserImages
Retrieves teaser images for the current entity and type.
An array of processed teaser images.
addTeaserImagesData
Adds teaser image data to the repository data.
getBackendTeaserImages
Processes teaser images for backend display.
Processed array of backend teaser images.
Private Methods
_setDocumentRoot
Sets the document root property.
This method is private and used internally by the trait.