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

repoModuleItemId
boolean|int

Identifier for the repository module item.

repoData
array

An array to store repository-related data.

repoModuleId
boolean|int

Identifier for the repository module.

repoModuleType
boolean|string

Type of the repository module.

Methods

getArticleTypeId

Retrieves the article type ID based on the given type name.

return
int

The corresponding article type ID.

getNoArticleTypeId

Retrieves the non-article type ID based on the given type name.

return
int

The corresponding non-article type ID.

getEntityName

Retrieves the entity name based on the type ID and whether it’s an article or not.

return
string

The name of the entity.

getRowName

Extracts the name or title from an entity object.

return
string

The extracted name or title.

getFrontendOrBackendImages

Processes images based on whether the context is frontend or backend.

return
array

Processed array of image objects.

prepareModuleImages

Prepares module images by setting module properties and retrieving images.

return
array

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.

return
array

Processed array of frontend teaser images.

getTeaserImages

Retrieves teaser images for the current entity and type.

return
array

An array of processed teaser images.

addTeaserImagesData

Adds teaser image data to the repository data.

getBackendTeaserImages

Processes teaser images for backend display.

return
array

Processed array of backend teaser images.

Private Methods

_setDocumentRoot

Sets the document root property.

This method is private and used internally by the trait.