The Article_Entity_Content trait provides functionality for managing entities that have associated articles. It defines a structure for displaying, filtering, and managing these entities.

Main Method

normals()

This method sets up the configuration for managing normal entities with associated articles.

Key actions:

  1. Sets up group name and table type
  2. Defines list and filter columns
  3. Prepares select data for flags and colors
  4. Defines input fields (columns) for the entity

Configuration Properties

groupName
string
default: "Articles"

Defines the group name for these entities.

typeOfTable
constant
default: "TABLE_ENTITY_WITH_ARTICLE"

Specifies the type of table. Options include:

  • TABLE_ENTITY_WITH_ARTICLE
  • TABLE_NOARTICLE_WITH_ALL_BUTTONS
  • TABLE_NOARTICLE_JUST_CLONE

Columns and Filters

listColumns

An array defining the columns to be displayed in the list view. Includes:

  • name
  • entities_tags_relation
  • [table]_tags_relation
  • id
  • date_added

filterColumns

An array defining the columns that can be used for filtering. Similar to listColumns but may include additional fields like ‘description’.

Input Fields

The method defines a set of input fields (columns) for the entity. Key fields include:

id
hidden

The unique identifier for the entity.

date_added
hidden

The date the entity was added, automatically set to the current date and time.

name
text

The internal name of the entity.

entities_tags_relation
m_n_relation

Manages the many-to-many relationship between entities and tags.

[table]_tags_relation
m_n_relation

Manages the many-to-many relationship between the specific entity type and its tags.