Cms\Classes\CmsCompoundObject

Source: ~/modules/cms/classes/CmsCompoundObject.php

Extends:

Implements:

  • Cms\Contracts\CmsObject
  • ArrayAccess
  • Illuminate\Contracts\Support\Arrayable
  • Illuminate\Contracts\Support\Jsonable
  • JsonSerializable

This is a base class for CMS objects that have multiple sections - pages, partials and layouts. The class implements functionality for the compound object file parsing. It also provides a way to access parameters defined in the INI settings section as the object properties.

Public properties

public array $components

Initialized components defined in the template file.

public array $settings

INI settings defined in the template file. Not to be confused with the attribute called settings. In this array, components are bumped to their own array inside the 'components' key.

public array $viewBag

Contains the view bag properties. This property is used by the page editor internally.

Show inherited public properties

Inherited public properties

Protected properties

protected array $fillable

The attributes that are mass assignable.

protected array $passthru

The methods that should be returned from the collection of all objects.

protected bool $isCompoundObject

Model supports code and settings sections.

protected static array|null $objectComponentPropertyMap

Cache for component properties.

protected mixed $viewBagCache

Cache store for the getViewBag method.

Show inherited protected properties

Inherited protected properties

Public methods

public mixed __call(string $method, array $parameters)

Dynamically handle calls into the query instance.

Parameters
  • string $method
  • array $parameters

public void __get($name)

Implements getter functionality for visible properties defined in the settings section or view bag array.

Parameters
  • $name

public bool __isset(string $key)

Determine if an attribute exists on the object.

Parameters
  • string $key

public void __set(string $key, mixed $value)

Dynamically set attributes on the model.

Parameters
  • string $key
  • mixed $value

public void afterFetch()

Triggered after the object is loaded.

public void beforeSave()

Triggered when the model is saved.

public static void clearCache(Cms\Classes\Theme $theme)

Clears the object cache.

Parameters

public Cms\Classes\ComponentBase getComponent(string $componentName)

Returns a component by its name. This method is used only in the back-end and for internal system needs when the standard way to access components is not an option.

Parameters
  • string $componentName - Specifies the component name.

public array getComponentProperties(string $componentName)

Returns component property names and values. This method implements caching and can be used in the run-time on the front-end.

Parameters
  • string $componentName - Specifies the component name.

public string getTwigContent()

Returns the Twig content string

public Twig_Node_Module getTwigNodeTree(mixed $markup=false)

Returns Twig node tree generated from the object's markup. This method is used by the system internally and shouldn't participate in the front-end request processing.

Parameters
  • mixed $markup - Specifies the markup content. Use FALSE to load the content from the markup section.

public Cms\Components\ViewBag getViewBag()

Returns the configured view bag component. This method is used only in the back-end and for internal system needs when the standard way to access components is not an option.

public mixed hasComponent(string $componentName)

Checks if the object has a component with the specified name.

Parameters
  • string $componentName - Specifies the component name.

public October\Rain\Halcyon\Collection newCollection(array $models=array())

Create a new Collection instance.

Parameters
  • array $models

public void runComponents()

Runs components defined in the settings Process halts if a component returns a value

Show inherited public methods

Inherited public methods

Protected methods

protected void checkSafeMode()

This method checks if safe mode is enabled by config, and the code attribute is modified and populated. If so an exception is thrown.

protected void fillViewBagArray()

Copies view bag properties to the view bag array. This is required for the back-end editors.

protected void parseComponentSettings()

Parse component sections. Replace the multiple component sections with a single "components" element in the $settings property.

protected void parseSettings()

Parses the settings array. Child classes can override this method in order to update the content of the $settings property after the object is loaded from a file.

protected void validateSettings()

If the model is loaded with an invalid INI section, the invalid content will be passed as a special attribute. Look for it, then locate the failure reason.

Show inherited protected methods

Inherited protected methods

  • protected static void boot() - defined in Cms\Classes\CmsObject. The "booting" method of the model.
  • protected static void bootDefaultTheme() - defined in Cms\Classes\CmsObject. Boot all of the bootable traits on the model.
  • protected void bootIfNotBooted() - defined in October\Rain\Halcyon\Model. Check if the model needs to be booted and if so, do it.
  • protected void bootNicerEvents() - defined in October\Rain\Halcyon\Model. Bind some nicer events to this model, in the format of method overrides.
  • protected static void bootTraits() - defined in October\Rain\Halcyon\Model. Boot all of the bootable traits on the model.
  • protected array emitterEventSortEvents(string $eventName) - defined in October\Rain\Halcyon\Model. Sort the listeners for a given event by priority.
  • protected boolean extendableIsAccessible(mixed $class, string $propertyName) - defined in October\Rain\Extension\Extendable. Checks if a property is accessible, property equivalent of is_callabe().
  • protected void extensionExtractMethods(string $extensionName, object $extensionObject) - defined in October\Rain\Extension\Extendable. Extracts the available methods from a behavior and adds it to the.
  • protected array fillableFromArray(array $attributes) - defined in October\Rain\Halcyon\Model. Get the fillable attributes of a given array.
  • protected void finishSave(array $options) - defined in October\Rain\Halcyon\Model. Finish processing on a successful save operation.
  • protected mixed fireModelEvent(string $event, bool $halt=true) - defined in October\Rain\Halcyon\Model. Fire the given event for the model.
  • protected array getArrayableAppends() - defined in October\Rain\Halcyon\Model. Get all of the appendable values that are arrayable.
  • protected mixed getAttributeFromArray(string $key) - defined in October\Rain\Halcyon\Model. Get an attribute from the $attributes array.
  • protected array getValidationAttributes() - defined in Cms\Classes\CmsObject. Returns the model data used for validation.
  • protected static Illuminate\Validation\Validator makeValidator($data, $rules, $customMessages, $attributeNames) - defined in Cms\Classes\CmsObject. Instantiates the validator used by the validation process, depending if the class is being used inside or.
  • protected mixed mutateAttribute(string $key, mixed $value) - defined in October\Rain\Halcyon\Model. Get the value of an attribute using its mutator.
  • protected mixed mutateAttributeForArray(string $key, mixed $value) - defined in October\Rain\Halcyon\Model. Get the value of an attribute using its mutator for array conversion.
  • protected bool originalIsNumericallyEquivalent(string $key) - defined in October\Rain\Halcyon\Model. Determine if the new and old values for a given key are numerically equivalent.
  • protected void performDeleteOnModel() - defined in October\Rain\Halcyon\Model. Perform the actual delete query on this model instance.
  • protected bool performInsert(October\Rain\Halcyon\Builder $query, array $options=array()) - defined in October\Rain\Halcyon\Model. Perform a model insert operation.
  • protected bool performUpdate(October\Rain\Halcyon\Builder $query, array $options=array()) - defined in October\Rain\Halcyon\Model. Perform a model update operation.
  • protected void processValidationRules($rules) - defined in Cms\Classes\CmsObject. Process rules.
  • protected static void registerModelEvent(string $event, Closure|string $callback, int $priority=0) - defined in October\Rain\Halcyon\Model. Register a model event with the dispatcher.
  • protected void throwHalcyonSaveException(Exception $ex) - defined in Cms\Classes\CmsObject. Converts an exception type thrown by Halcyon to a native CMS exception.