Page

The CMS page class.

 class Cms\Classes\Page
extends Cms\Classes\CmsCompoundObject
implements 
    Cms\Contracts\CmsObject,
    Winter\Storm\Halcyon\ModelInterface,
    ArrayAccess,
    Illuminate\Contracts\Support\Arrayable,
    Illuminate\Contracts\Support\Jsonable,
    JsonSerializable

Extends

Class Description
CmsCompoundObject

This is a base class for CMS objects that have multiple sections - pages, partials and layouts.

Traits

Trait Description
Emitter

Adds event related features to any class.

ExtendableTrait

This extension trait is used when access to the underlying base class is not available, such as classes that belong to the foundation framework (Laravel). It is currently used by the Controller and Model classes.

Validation

Properties

public $apiBag : array

The API bag allows the API handler code to bind arbitrary data to the page object.

public $rules : array

The rules to be applied to the data.

protected $dirName : string

The container name associated with the model, eg: pages.

protected $fillable : array

The attributes that are mass assignable.

inherited public $attributeNames : array

Inherited from CmsCompoundObject

The array of custom attribute names.

inherited public $attributes : array

Inherited from CmsCompoundObject

The model's attributes, saved to the settings area.

inherited public $components : array

Inherited from CmsCompoundObject

Initialized components defined in the template file.

inherited public $customMessages : array

Inherited from CmsCompoundObject

The array of custom error messages.

inherited public $exists : bool

Inherited from CmsCompoundObject

Indicates if the model exists.

inherited public $implement : string | array | null

Inherited from CmsCompoundObject

Extensions implemented by this class.

inherited public $settings : array

Inherited from CmsCompoundObject

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.

inherited public $viewBag : array

Inherited from CmsCompoundObject

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

inherited protected $allowedExtensions : array

Inherited from CmsCompoundObject

Allowable file extensions.

inherited protected $appends : array

Inherited from CmsCompoundObject

The accessors to append to the model's array form.

inherited protected static $booted : array

Inherited from CmsCompoundObject

The array of booted models.

inherited protected static $cache : Illuminate\Cache\CacheManager | null

Inherited from CmsCompoundObject

The cache manager instance.

inherited protected $datasource : string | null

Inherited from CmsCompoundObject

The data source for the model, a directory path.

inherited protected $defaultExtension : string

Inherited from CmsCompoundObject

Default file extension.

inherited protected static $dispatcher : Winter\Storm\Events\Dispatcher | null

Inherited from CmsCompoundObject

The event dispatcher instance.

inherited protected $emitterEventCollection : array

Inherited from CmsCompoundObject

Collection of registered events.

inherited protected $emitterEventSorted : array

Inherited from CmsCompoundObject

Sorted collection of events.

inherited protected $emitterSingleEventCollection : array

Inherited from CmsCompoundObject

Collection of registered events to be fired once only.

inherited protected static $eventsBooted : array

Inherited from CmsCompoundObject

The array of models booted events.

inherited protected static $extendableCallbacks : array

Inherited from CmsCompoundObject

Used to extend the constructor of an extendable class. Eg:

Class::extend(function($obj) { })

inherited protected static $extendableClassLoader : ClassLoader | null

Inherited from CmsCompoundObject

Class loader instance.

inherited protected $extendableConstructed : bool

Inherited from CmsCompoundObject

Indicates if the extendable constructor has completed.

inherited protected static $extendableStaticMethods : array

Inherited from CmsCompoundObject

Collection of static methods used by behaviors.

inherited protected $extensionData : array

Inherited from CmsCompoundObject

Class reflection information, including behaviors.

inherited protected $isCompoundObject : bool

Inherited from CmsCompoundObject

Model supports code and settings sections.

inherited protected $loadedFromCache : bool

Inherited from CmsCompoundObject

Indicated whether the object was loaded from the cache.

inherited protected $localCallbacks : array

Inherited from CmsCompoundObject

This stores any locally-scoped callbacks fired before the extendable constructor had completed.

inherited protected $maxNesting : int

Inherited from CmsCompoundObject

The maximum allowed path nesting level. The default value is 2, meaning that files can only exist in the root directory, or in a subdirectory. Set to null if any level is allowed.

inherited protected static $mutatorCache : array

Inherited from CmsCompoundObject

The cache of the mutated attributes for each class.

inherited protected static $objectComponentPropertyMap : array | null

Inherited from CmsCompoundObject

Cache for component properties.

inherited protected $observables : array

Inherited from CmsCompoundObject

User exposed observable events.

inherited protected $original : array

Inherited from CmsCompoundObject

The model attribute's original state.

inherited protected $passthru : array

Inherited from CmsCompoundObject

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

inherited protected $purgeable : array

Inherited from CmsCompoundObject

List of attribute names which are not considered "settings".

inherited protected static $resolver : Winter\Storm\Halcyon\Datasource\ResolverInterface | null

Inherited from CmsCompoundObject

The datasource resolver instance.

inherited protected $themeCache : Cms\Classes\Theme

Inherited from CmsCompoundObject

A reference to the CMS theme containing the object.

inherited protected $validationErrors : Illuminate\Support\MessageBag

Inherited from CmsCompoundObject

The message bag instance containing validation error messages

inherited protected static $validator : Illuminate\Validation\Validator

Inherited from CmsCompoundObject

The validator instance.

inherited protected $viewBagCache : mixed

Inherited from CmsCompoundObject

Cache store for the getViewBag method.

inherited protected $wrapCode : bool

Inherited from CmsCompoundObject

Wrap code section in PHP tags.

Methods

public __construct (array $attributes = [])

Creates an instance of the object and associates it with a CMS theme.

Parameters
Property Description
$attributes
array
Returns
mixed

public getCodeClassParent () : mixed

Returns name of a PHP class to us a parent for the PHP class created for the object's PHP section.

Returns
mixed

Returns the class name or null.

public getLayoutOptions () : array

Returns a list of layouts available in the theme.

This method is used by the form widget.

Returns
array

Returns an array of strings.

public static getMenuTypeInfo (string $type) : array

Handler for the pages.menuitem.getTypeInfo event.

Returns a menu item type information. The type information is returned as array with the following elements:

  • references - a list of the item type reference options. The options are returned in the ["key"] => "title" format for options that don't have sub-options, and in the format ["key"] => ["title"=>"Option title", "items"=>[...]] for options that have sub-options. Optional, required only if the menu item type requires references.
  • nesting - Boolean value indicating whether the item type supports nested items. Optional, false if omitted.
  • dynamicItems - Boolean value indicating whether the item type could generate new menu items. Optional, false if omitted.
  • cmsPages - a list of CMS pages (objects of the Cms\Classes\Page class), if the item type requires a CMS page reference to resolve the item URL.
Parameters
Property Description
$type
string

Specifies the menu item type

Returns
array

Returns an array

public static getNameList () : array

Helper that returns a nicer list of pages for use in dropdowns.

Returns
array

public static getRichEditorTypeInfo (string $type) : array

Handler for the backend.richeditor.getTypeInfo event.

Returns a menu item type information. The type information is returned as array

Parameters
Property Description
$type
string

Specifies the page link type

Returns
array

public static resolveMenuItem (object $item, string $url, Cms\Classes\Theme $theme) : array | null

Handler for the pages.menuitem.resolveItem event.

Returns information about a menu item. The result is an array with the following keys:

  • url - the menu item URL. Not required for menu item types that return all available records. The URL should be returned relative to the website root and include the subdirectory, if any. Use the Url::to() helper to generate the URLs.
  • isActive - determines whether the menu item is active. Not required for menu item types that return all available records.
  • items - an array of arrays with the same keys (url, isActive, items) + the title key. The items array should be added only if the $item's $nesting property value is TRUE.
Parameters
Property Description
$item
object

Specifies the menu item.

$url
string
$theme
Cms\Classes\Theme
Returns
array | null

public static url (mixed $page, array $params = []) : string | null

Helper that makes a URL for a page in the active theme.

Parameters
Property Description
$page
mixed

Specifies the Cms Page file name.

$params
array

Route parameters to consider in the URL.

Returns
string | null

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

Inherited from CmsCompoundObject

Dynamically handle calls into the query instance.

Parameters
Property Description
$method
string
$parameters
array
Returns
mixed

inherited public static __callStatic (string $method, array $parameters) : mixed

Inherited from CmsCompoundObject

Handle dynamic static method calls into the method.

Parameters
Property Description
$method
string
$parameters
array
Returns
mixed

inherited public __get ($name)

Inherited from CmsCompoundObject

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

Parameters
Property Description
$name
mixed
Returns
mixed

inherited public __isset (string $key) : bool

Inherited from CmsCompoundObject

Determine if an attribute exists on the object.

Parameters
Property Description
$key
string
Returns
bool

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

Inherited from CmsCompoundObject

Dynamically set attributes on the model.

Parameters
Property Description
$key
string
$value
mixed
Returns
void

inherited public __toString () : string

Inherited from CmsCompoundObject

Convert the model to its string representation.

Returns
string

inherited public __unset (string $key) : void

Inherited from CmsCompoundObject

Unset an attribute on the model.

Parameters
Property Description
$key
string
Returns
void

inherited public addDynamicMethod (string $dynamicName, callable $method, string $extension = null)

Inherited from CmsCompoundObject

Programmatically adds a method to the extendable class

Parameters
Property Description
$dynamicName
string
$method
callable
$extension
string
Returns
mixed

inherited public addDynamicProperty (string $dynamicName, mixed $value = null) : void

Inherited from CmsCompoundObject

Programmatically adds a property to the extendable class

Parameters
Property Description
$dynamicName
string

The name of the property to add

$value
mixed

The value of the property

Returns
void

inherited public addObservableEvents (array | mixed $observables) : void

Inherited from CmsCompoundObject

Add an observable event name.

Parameters
Property Description
$observables
array | mixed
Returns
void

inherited public addPurgeable (array | string | null $attributes = null) : $this

Inherited from CmsCompoundObject

Adds an attribute to the purgeable attributes list

Parameters
Property Description
$attributes
array | string | null
Returns
$this

inherited public afterFetch () : void

Inherited from CmsCompoundObject

Triggered after the object is loaded.

Returns
void

inherited public static all () : Winter\Storm\Halcyon\Collection

Inherited from CmsCompoundObject

Get all of the models from the datasource.

Returns

inherited public asExtension (string $shortName) : mixed

Inherited from CmsCompoundObject

Short hand for getClassExtension() method, except takes the short extension name, example:

$this->asExtension('FormController')

Parameters
Property Description
$shortName
string
Returns
mixed

inherited public attributesToArray () : array

Inherited from CmsCompoundObject

Convert the model's attributes to an array.

Returns
array

inherited public beforeSave () : void

Inherited from CmsCompoundObject

Triggered when the model is saved.

Returns
void

inherited public bindEvent (string | Closure | QueuedClosure $event, mixed $callback = null, integer $priority) : self

Inherited from CmsCompoundObject

Create a new event binding.

Parameters
Property Description
$event
string | Closure | QueuedClosure
$callback
mixed

when the third parameter is omitted and a Closure or QueuedClosure is provided this parameter is used as an integer this is used as priority variable

$priority
integer
Returns
self

inherited public bindEventOnce (string | Closure | QueuedClosure $event, QueuedClosure | Closure | null $callback = null) : self

Inherited from CmsCompoundObject

Create a new event binding that fires once only

Parameters
Property Description
$event
string | Closure | QueuedClosure
$callback
QueuedClosure | Closure | null

When a Closure or QueuedClosure is provided as the first parameter this parameter can be omitted

Returns
self

inherited public static bootValidation () : void

Inherited from CmsCompoundObject

Boot the validation trait for this model.

Returns
void

inherited public static cacheMutatedAttributes (string $class) : void

Inherited from CmsCompoundObject

Extract and cache all the mutated attributes of a class.

Parameters
Property Description
$class
string
Returns
void

inherited public static clearBootedModels () : void

Inherited from CmsCompoundObject

Clear the list of booted models so they will be re-booted.

Returns
void

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

Inherited from CmsCompoundObject

Clears the object cache.

Parameters
Property Description
$theme

Specifies a parent theme.

Returns
void

inherited public static clearExtendedClasses () : void

Inherited from CmsCompoundObject

Clear the list of extended classes so they will be re-extended.

Returns
void

inherited public static create (array $attributes = []) : static

Inherited from CmsCompoundObject

Save a new model and return the instance.

Parameters
Property Description
$attributes
array
Returns
static

inherited public static created (Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register a created model event with the dispatcher.

Parameters
Property Description
$callback
Closure | string
$priority
integer
Returns
void

inherited public static creating (Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register a creating model event with the dispatcher.

Parameters
Property Description
$callback
Closure | string
$priority
integer
Returns
void

inherited public delete () : bool | null

Inherited from CmsCompoundObject

Delete the model from the database.

Returns
bool | null

inherited public static deleted (Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register a deleted model event with the dispatcher.

Parameters
Property Description
$callback
Closure | string
$priority
integer
Returns
void

inherited public static deleting (Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register a deleting model event with the dispatcher.

Parameters
Property Description
$callback
Closure | string
$priority
integer
Returns
void

inherited public errors () : Illuminate\Support\MessageBag

Inherited from CmsCompoundObject

Get validation error message collection for the Model

Returns
Illuminate\Support\MessageBag

inherited public extendClassWith (string $extensionName) : void

Inherited from CmsCompoundObject

Dynamically extend a class with a specified behavior

Parameters
Property Description
$extensionName
string
Returns
void

inherited public static extendableAddExtension (callable $callback, boolean $scoped = false, $outerScope = null) : void

Inherited from CmsCompoundObject

Extends the class using a closure.

The closure will be provided a single parameter which is the instance of the extended class, by default.

You may optionally specify the callback as a scoped callback, which inherits the scope of the extended class and provides access to protected and private methods and properties. This makes any call using $this act on the extended class, not the class providing the extension.

If you use a scoped callback, you can provide the "outer" scope - or the scope of the class providing the extension, with the third parameter. The outer scope object will then be passed as the single parameter to the closure.

Parameters
Property Description
$callback
callable
$scoped
boolean
$outerScope
mixed
Returns
void

inherited public extendableCall (string $name, array $params = null) : mixed

Inherited from CmsCompoundObject

Magic method for __call().

Callback priority is as follows:

  • "Dynamic Methods" added locally to the object via addDynamicMethod($name, $callable)
  • Methods available on Behaviors that have been implemented by the object
  • Pass it to the parent's __call() method if it defines one
Parameters
Property Description
$name
string
$params
array
Returns
mixed

inherited public static extendableCallStatic (string $name, array $params = null) : mixed

Inherited from CmsCompoundObject

Magic method for __callStatic()

Parameters
Property Description
$name
string
$params
array
Returns
mixed

inherited public extendableConstruct ()

Inherited from CmsCompoundObject

This method should be called as part of the constructor.

Returns
mixed

inherited public static extendableExtendCallback (callable $callback, boolean $scoped = false, $outerScope = null) : void

Inherited from CmsCompoundObject

Helper method for ::extend() static method.

Parameters
Property Description
$callback
callable
$scoped
boolean
$outerScope
mixed
Returns
void

inherited public extendableGet (string $name) : mixed | null

Inherited from CmsCompoundObject

Magic method for __get()

Parameters
Property Description
$name
string
Returns
mixed | null

inherited public extendableSet (string $name, mixed $value) : void

Inherited from CmsCompoundObject

Magic method for __set()

Parameters
Property Description
$name
string
$value
mixed
Returns
void

inherited public static fetched (Closure | string $callback) : void

Inherited from CmsCompoundObject

Create a new native event for handling afterFetch().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited public static fetching (Closure | string $callback) : void

Inherited from CmsCompoundObject

Create a new native event for handling beforeFetch().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited public fill (array $attributes) : $this

Inherited from CmsCompoundObject

Fill the model with an array of attributes.

Parameters
Property Description
$attributes
array
Returns
$this

inherited public fireEvent (string $event, array $params = [], boolean $halt = false) : array | mixed | null

Inherited from CmsCompoundObject

Fire an event and call the listeners.

Parameters
Property Description
$event
string

Event name

$params
array

Event parameters

$halt
boolean

Halt after first non-null result

Returns
array | mixed | null

If halted, the first non-null result. If not halted, an array of event results. Returns null if no listeners returned a result.

inherited public static flushDuplicateCache () : void

Inherited from CmsCompoundObject

Flush the memory cache.

Returns
void

inherited public static flushEventListeners () : void

Inherited from CmsCompoundObject

Remove all of the event listeners for the model.

Returns
void

inherited public forceSave ($options = null) : bool

Inherited from CmsCompoundObject

Force save the model even if validation fails.

Parameters
Property Description
$options
mixed
Returns
bool

inherited public getAllowedExtensions () : array

Inherited from CmsCompoundObject

Returns the allowable file extensions supported by this model.

Returns
array

inherited public getAttribute (string $key) : mixed

Inherited from CmsCompoundObject

Get a plain attribute.

Parameters
Property Description
$key
string
Returns
mixed

inherited public getAttributes () : array

Inherited from CmsCompoundObject

Get all of the current attributes on the model.

Returns
array

inherited public getBaseFileName () : string

Inherited from CmsCompoundObject

Returns the file name without the extension.

Returns
string

inherited public getBaseFileNameAttribute () : string

Inherited from CmsCompoundObject

Returns the file name without the extension.

Returns
string

inherited public static getCacheManager () : Illuminate\Cache\CacheManager | null

Inherited from CmsCompoundObject

Get the cache manager instance.

Returns
Illuminate\Cache\CacheManager | null

inherited public getClassExtension (string $name) : mixed

Inherited from CmsCompoundObject

Returns a behavior object from an extendable class, example:

$this->getClassExtension('Backend.Behaviors.FormController')

Parameters
Property Description
$name
string

Fully qualified behavior name

Returns
mixed

inherited public getClassMethods () : array

Inherited from CmsCompoundObject

Get a list of class methods, extension equivalent of get_class_methods()

Returns
array

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

Inherited from CmsCompoundObject

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
Property Description
$componentName
string

Specifies the component name.

Returns

Returns the component instance or null.

inherited public getComponentProperties (string $componentName) : array

Inherited from CmsCompoundObject

Returns component property names and values.

This method implements caching and can be used in the run-time on the front-end.

Parameters
Property Description
$componentName
string

Specifies the component name.

Returns
array

Returns an associative array with property names in the keys and property values in the values.

inherited public getContent () : string

Inherited from CmsCompoundObject

Returns the file content.

Returns
string

inherited public getDatasource () : Winter\Storm\Halcyon\Datasource\DatasourceInterface

Inherited from CmsCompoundObject

Get the datasource for the model.

Returns

inherited public getDatasourceName () : string

Inherited from CmsCompoundObject

Get the current datasource name for the model.

Returns
string

inherited public static getDatasourceResolver () : Winter\Storm\Halcyon\Datasource\ResolverInterface

Inherited from CmsCompoundObject

Get the datasource resolver instance.

Returns

inherited public getDirty () : array

Inherited from CmsCompoundObject

Get the attributes that have been changed since last sync.

Returns
array

inherited public getDynamicProperties () : array

Inherited from CmsCompoundObject

Returns all dynamic properties and their values

Returns
array

['property' => 'value']

inherited public static getEventDispatcher () : Winter\Storm\Events\Dispatcher

Inherited from CmsCompoundObject

Get the event dispatcher instance.

Returns

inherited public getFileName () : string

Inherited from CmsCompoundObject

Returns the file name.

Returns
string

inherited public getFileNameParts ($fileName = null)

Inherited from CmsCompoundObject

Returns the base file name and extension. Applies a default extension, if none found.

Parameters
Property Description
$fileName
mixed
Returns
mixed

inherited public getFilePath (string $fileName = null) : string

Inherited from CmsCompoundObject

Returns the full path to the template file corresponding to this object.

Parameters
Property Description
$fileName
string
Returns
string

inherited public getId () : string

Inherited from CmsCompoundObject

Helper for {{ page.id }} or {{ layout.id }} twig vars Returns a unique string for this object.

Returns
string

inherited public getIdAttribute () : string

Inherited from CmsCompoundObject

Helper for {{ page.id }} or {{ layout.id }} twig vars Returns a semi-unique string for this object.

Returns
string

inherited public getMaxNesting () : int

Inherited from CmsCompoundObject

Returns the maximum directory nesting allowed by this template.

Returns
int

inherited public static getModelValidator () : Illuminate\Validation\Validator

Inherited from CmsCompoundObject

Get the validator instance.

Returns
Illuminate\Validation\Validator

inherited public getMutatedAttributes () : array

Inherited from CmsCompoundObject

Get the mutated attributes for a given instance.

Returns
array

inherited public getObjectTypeDirName () : string

Inherited from CmsCompoundObject

Returns the directory name corresponding to the object type.

For pages the directory name is "pages", for layouts - "layouts", etc.

Returns
string

inherited public getObservableEvents () : array

Inherited from CmsCompoundObject

Get the observable event names.

Returns
array

inherited public getOriginal (string | null $key = null, mixed $default = null) : array

Inherited from CmsCompoundObject

Get the model's original attribute values.

Parameters
Property Description
$key
string | null
$default
mixed
Returns
array

inherited public getSettingsAttribute () : array

Inherited from CmsCompoundObject

The settings is attribute contains everything that should be saved to the settings area.

Returns
array

inherited public getThemeAttribute () : Cms\Classes\Theme

Inherited from CmsCompoundObject

Returns the CMS theme this object belongs to.

Returns

inherited public getTwigCacheKey () : string

Inherited from CmsCompoundObject

Returns the key used by the Twig cache.

Returns
string

inherited public getTwigContent () : string

Inherited from CmsCompoundObject

Returns the Twig content string

Returns
string

inherited public getTwigNodeTree (boolean $markup = false) : Twig\Node\ModuleNode

Inherited from CmsCompoundObject

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
Property Description
$markup
boolean

Specifies the markup content. Use FALSE to load the content from the markup section.

Returns
Twig\Node\ModuleNode

A node tree

inherited public getViewBag () : Cms\Components\ViewBag

Inherited from CmsCompoundObject

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.

Returns

Returns the view bag component instance.

inherited public getWrapCode () : bool

Inherited from CmsCompoundObject

Returns true if the code section will be wrapped in PHP tags.

Returns
bool

inherited public hasComponent (string $componentName) : mixed

Inherited from CmsCompoundObject

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

Parameters
Property Description
$componentName
string

Specifies the component name.

Returns
mixed

Return false or the full component name used on the page (it could include the alias).

inherited public hasGetMutator (string $key) : bool

Inherited from CmsCompoundObject

Determine if a get mutator exists for an attribute.

Parameters
Property Description
$key
string
Returns
bool

inherited public hasSetMutator (string $key) : bool

Inherited from CmsCompoundObject

Determine if a set mutator exists for an attribute.

Parameters
Property Description
$key
string
Returns
bool

inherited public static hydrate (array $items, string | null $datasource = null) : Winter\Storm\Halcyon\Collection

Inherited from CmsCompoundObject

Create a collection of models from plain arrays.

Parameters
Property Description
$items
array
$datasource
string | null
Returns

inherited public static inTheme (Cms\Classes\Theme $theme) : $this

Inherited from CmsCompoundObject

Prepares the theme datasource for the model.

Parameters
Property Description
$theme

Specifies a parent theme.

Returns
$this

inherited public static initCacheItem (mixed $item)

Inherited from CmsCompoundObject

Initializes the object properties from the cached data. The extra data set here becomes available as attributes set on the model after fetch.

Parameters
Property Description
$item
mixed
Returns
mixed

inherited public isAttributeRequired (string $attribute) : bool

Inherited from CmsCompoundObject

Determines if an attribute is required based on the validation rules.

Parameters
Property Description
$attribute
string
Returns
bool

inherited public isClassExtendedWith (string $name) : bool

Inherited from CmsCompoundObject

Check if extendable class is extended with a behavior object

Parameters
Property Description
$name
string

Fully qualified behavior name

Returns
bool

inherited public isCompoundObject () : bool

Inherited from CmsCompoundObject

Returns true if this template supports code and settings sections.

Returns
bool

inherited public isDirty (array | string | null $attributes = null) : bool

Inherited from CmsCompoundObject

Determine if the model or given attribute(s) have been modified.

Parameters
Property Description
$attributes
array | string | null
Returns
bool

inherited public isFillable (string $key) : bool

Inherited from CmsCompoundObject

Determine if the given attribute may be mass assigned.

Parameters
Property Description
$key
string
Returns
bool

inherited public isLoadedFromCache () : bool

Inherited from CmsCompoundObject

Returns true if the object was loaded from the cache.

Returns
bool

inherited public jsonSerialize () : array

Inherited from CmsCompoundObject

Convert the object into something JSON serializable.

Returns
array

inherited public static listInTheme (Cms\Classes\Theme $theme, boolean $skipCache = false) : CmsObjectCollection

Inherited from CmsCompoundObject

Returns the list of objects in the specified theme.

This method is used internally by the system.

Parameters
Property Description
$theme

Specifies a parent theme.

$skipCache
boolean

Indicates if objects should be reloaded from the disk bypassing the cache.

Returns
CmsObjectCollection

Returns a collection of CMS objects.

inherited public static load (mixed $theme, string $fileName) : mixed

Inherited from CmsCompoundObject

Loads the object from a file.

This method is used in the CMS back-end. It doesn't use any caching.

Parameters
Property Description
$theme
mixed

Specifies the theme the object belongs to.

$fileName
string

Specifies the file name, with the extension. The file name can contain only alphanumeric symbols, dashes and dots.

Returns
mixed

Returns a CMS object instance or null if the object wasn't found.

inherited public static loadCached (Cms\Classes\Theme $theme, string $fileName) : mixed

Inherited from CmsCompoundObject

Loads the object from a cache.

This method is used by the CMS in the runtime. If the cache is not found, it is created.

Parameters
Property Description
$theme

Specifies the theme the object belongs to.

$fileName
string

Specifies the file name, with the extension.

Returns
mixed

Returns a CMS object instance or null if the object wasn't found.

inherited public methodExists (string $name) : bool

Inherited from CmsCompoundObject

Checks if a method exists, extension equivalent of method_exists()

Parameters
Property Description
$name
string
Returns
bool

inherited public newCollection (array $models = []) : Winter\Storm\Halcyon\Collection

Inherited from CmsCompoundObject

Create a new Collection instance.

Parameters
Property Description
$models
array
Returns

inherited public newFromBuilder (array $attributes = [], string | null $datasource = null) : static

Inherited from CmsCompoundObject

Create a new model instance that is existing.

Parameters
Property Description
$attributes
array
$datasource
string | null
Returns
static

inherited public newInstance (array $attributes = [], boolean $exists = false) : static

Inherited from CmsCompoundObject

Create a new instance of the given model.

Parameters
Property Description
$attributes
array
$exists
boolean
Returns
static

inherited public newQuery () : Winter\Storm\Halcyon\Builder

Inherited from CmsCompoundObject

Get a new query builder for the object

Returns

inherited public offsetExists (mixed $offset) : bool

Inherited from CmsCompoundObject

Determine if the given attribute exists.

Parameters
Property Description
$offset
mixed
Returns
bool

inherited public offsetGet (mixed $offset) : mixed

Inherited from CmsCompoundObject

Get the value for a given offset.

Parameters
Property Description
$offset
mixed
Returns
mixed

inherited public offsetSet (mixed $offset, mixed $value) : void

Inherited from CmsCompoundObject

Set the value for a given offset.

Parameters
Property Description
$offset
mixed
$value
mixed
Returns
void

inherited public offsetUnset (mixed $offset) : void

Inherited from CmsCompoundObject

Unset the value for a given offset.

Parameters
Property Description
$offset
mixed
Returns
void

inherited public static on (string | null $datasource = null) : Winter\Storm\Halcyon\Model

Inherited from CmsCompoundObject

Begin querying the model on a given datasource.

Parameters
Property Description
$datasource
string | null
Returns

inherited public propertyExists (string $name) : bool

Inherited from CmsCompoundObject

Checks if a property exists, extension equivalent of property_exists()

Parameters
Property Description
$name
string
Returns
bool

inherited public static query () : Winter\Storm\Halcyon\Builder

Inherited from CmsCompoundObject

Begin querying the model.

Returns

inherited public removeObservableEvents (array | mixed $observables) : void

Inherited from CmsCompoundObject

Remove an observable event name.

Parameters
Property Description
$observables
array | mixed
Returns
void

inherited public static resolveDatasource (string | null $datasource = null) : Winter\Storm\Halcyon\Datasource\DatasourceInterface

Inherited from CmsCompoundObject

Resolve a datasource instance.

Parameters
Property Description
$datasource
string | null
Returns

inherited public runComponents () : void

Inherited from CmsCompoundObject

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

Returns
void

inherited public save (array $options = null) : bool

Inherited from CmsCompoundObject

Save the object to the theme.

Parameters
Property Description
$options
array
Returns
bool

inherited public saveInternal (array $options = []) : bool

Inherited from CmsCompoundObject

Save the model to the database. Is used by {@link save()} and {@link forceSave()}.

Parameters
Property Description
$options
array
Returns
bool

inherited public static saved (Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register a saved model event with the dispatcher.

Parameters
Property Description
$callback
Closure | string
$priority
integer
Returns
void

inherited public static saving (Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register a saving model event with the dispatcher.

Parameters
Property Description
$callback
Closure | string
$priority
integer
Returns
void

inherited public setAttribute (string $key, mixed $value) : $this

Inherited from CmsCompoundObject

Set a given attribute on the model.

Parameters
Property Description
$key
string
$value
mixed
Returns
$this

inherited public static setCacheManager (Illuminate\Cache\CacheManager $cache) : void

Inherited from CmsCompoundObject

Set the cache manager instance.

Parameters
Property Description
$cache
Illuminate\Cache\CacheManager
Returns
void

inherited public setDatasource (string $name) : $this

Inherited from CmsCompoundObject

Set the datasource associated with the model.

Parameters
Property Description
$name
string
Returns
$this

inherited public static setDatasourceResolver (Winter\Storm\Halcyon\Datasource\ResolverInterface $resolver) : void

Inherited from CmsCompoundObject

Set the datasource resolver instance.

Parameters
Property Description
$resolver
Winter\Storm\Halcyon\Datasource\ResolverInterface
Returns
void

inherited public static setEventDispatcher (Illuminate\Contracts\Events\Dispatcher $dispatcher) : void

Inherited from CmsCompoundObject

Set the event dispatcher instance.

Parameters
Property Description
$dispatcher
Illuminate\Contracts\Events\Dispatcher
Returns
void

inherited public setFileNameAttribute (mixed $value)

Inherited from CmsCompoundObject

File name should always contain an extension.

Parameters
Property Description
$value
mixed
Returns
mixed

inherited public setLoadedFromCache ($value) : void

Inherited from CmsCompoundObject

Returns true if the object was loaded from the cache.

Parameters
Property Description
$value
mixed
Returns
void

inherited public static setModelValidator ($validator) : void

Inherited from CmsCompoundObject

Set the validator instance.

Parameters
Property Description
$validator
mixed
Returns
void

inherited public setObservableEvents (array $observables) : $this

Inherited from CmsCompoundObject

Set the observable event names.

Parameters
Property Description
$observables
array
Returns
$this

inherited public setRawAttributes (array $attributes, boolean $sync = false) : $this

Inherited from CmsCompoundObject

Set the array of model attributes. No checking is done.

Parameters
Property Description
$attributes
array
$sync
boolean
Returns
$this

inherited public setSettingsAttribute (mixed $value)

Inherited from CmsCompoundObject

Filling the settings should merge it with attributes.

Parameters
Property Description
$value
mixed
Returns
mixed

inherited public syncOriginal () : $this

Inherited from CmsCompoundObject

Sync the original attributes with the current.

Returns
$this

inherited public syncOriginalAttribute (string $attribute) : $this

Inherited from CmsCompoundObject

Sync a single original attribute with its current value.

Parameters
Property Description
$attribute
string
Returns
$this

inherited public toArray () : array

Inherited from CmsCompoundObject

Convert the model instance to an array.

Returns
array

inherited public toJson (integer $options) : string

Inherited from CmsCompoundObject

Convert the model instance to JSON.

Parameters
Property Description
$options
integer
Returns
string

inherited public unbindEvent (string | array | object $event = null) : self

Inherited from CmsCompoundObject

Destroys an event binding.

Parameters
Property Description
$event
string | array | object

Event to destroy

Returns
self

inherited public static unsetCacheManager () : void

Inherited from CmsCompoundObject

Unset the cache manager for models.

Returns
void

inherited public static unsetDatasourceResolver () : void

Inherited from CmsCompoundObject

Unset the datasource resolver for models.

Returns
void

inherited public static unsetEventDispatcher () : void

Inherited from CmsCompoundObject

Unset the event dispatcher for models.

Returns
void

inherited public static unsetModelValidator () : void

Inherited from CmsCompoundObject

Unset the validator for models.

Returns
void

inherited public update (array $attributes = []) : bool | int

Inherited from CmsCompoundObject

Update the model in the database.

Parameters
Property Description
$attributes
array
Returns
bool | int

inherited public static updated (Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register an updated model event with the dispatcher.

Parameters
Property Description
$callback
Closure | string
$priority
integer
Returns
void

inherited public static updating (Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register an updating model event with the dispatcher.

Parameters
Property Description
$callback
Closure | string
$priority
integer
Returns
void

inherited public validate ($rules = null, $customMessages = null, $attributeNames = null) : bool

Inherited from CmsCompoundObject

Validate the model instance

Parameters
Property Description
$rules
mixed
$customMessages
mixed
$attributeNames
mixed
Returns
bool

inherited public static validated (Closure | string $callback) : void

Inherited from CmsCompoundObject

Create a new native event for handling afterValidate().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited public static validating (Closure | string $callback) : void

Inherited from CmsCompoundObject

Create a new native event for handling beforeValidate().

Parameters
Property Description
$callback
Closure | string
Returns
void

inherited protected static boot () : void

Inherited from CmsCompoundObject

The "booting" method of the model.

Returns
void

inherited protected static bootDefaultTheme () : void

Inherited from CmsCompoundObject

Boot all of the bootable traits on the model.

Returns
void

inherited protected bootIfNotBooted () : void

Inherited from CmsCompoundObject

Check if the model needs to be booted and if so, do it.

Returns
void

inherited protected bootNicerEvents ()

Inherited from CmsCompoundObject

Bind some nicer events to this model, in the format of method overrides.

Returns
mixed

inherited protected static bootTraits () : void

Inherited from CmsCompoundObject

Boot all of the bootable traits on the model.

Returns
void

inherited protected checkSafeMode () : void

Inherited from CmsCompoundObject

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

Returns
void

inherited protected emitterEventSortEvents (string $eventName) : void

Inherited from CmsCompoundObject

Sort the listeners for a given event by priority.

Parameters
Property Description
$eventName
string
Returns
void

inherited protected extendableAddLocalExtension (Closure $callback, $outerScope = null)

Inherited from CmsCompoundObject

Adds local extensibility to the current instance.

This rebinds a given closure to the current instance, making it able to access protected and private methods. This makes any call using $this within the closure act on the extended class, not the class providing the extension.

An outer scope may be provided by providing a second parameter, which will then be passed through to the closure as its first parameter. If this is not given, the current instance will be provided as the first parameter.

Parameters
Property Description
$callback
Closure
$outerScope
mixed
Returns
mixed

inherited protected extendableIsAccessible (mixed $class, string $propertyName) : bool

Inherited from CmsCompoundObject

Checks if a property is accessible, property equivalent of is_callable()

Parameters
Property Description
$class
mixed
$propertyName
string
Returns
bool

inherited protected extensionCallMethod (ReflectionClass $class, string $method, array $params)

Inherited from CmsCompoundObject

Calls a method through reflection.

Parameters
Property Description
$class
ReflectionClass
$method
string
$params
array
Returns
mixed

inherited protected extensionExtractMethods (string $extensionName, object $extensionObject) : void

Inherited from CmsCompoundObject

Extracts the available methods from a behavior and adds it to the list of callable methods.

Parameters
Property Description
$extensionName
string
$extensionObject
object
Returns
void

inherited protected extensionGetClassLoader () : Winter\Storm\Support\ClassLoader | null

Inherited from CmsCompoundObject

Gets the class loader

Returns
Winter\Storm\Support\ClassLoader | null

inherited protected extensionGetParentClass ($instance = null) : ReflectionClass | false

Inherited from CmsCompoundObject

Gets the parent class using reflection.

The parent class must either not be the Extendable class, or must not be using the ExtendableTrait trait, in order to prevent infinite loops.

Parameters
Property Description
$instance
mixed
Returns
ReflectionClass | false

inherited protected extensionMethodExists (ReflectionClass $class, string $methodName) : bool

Inherited from CmsCompoundObject

Determines if the given class reflection contains the given method.

Parameters
Property Description
$class
ReflectionClass
$methodName
string
Returns
bool

inherited protected extensionNormalizeClassName (string $name) : string

Inherited from CmsCompoundObject

Normalizes the provided extension name allowing for the ClassLoader to inject aliased classes

Parameters
Property Description
$name
string
Returns
string

inherited protected fillViewBagArray () : void

Inherited from CmsCompoundObject

Copies view bag properties to the view bag array.

This is required for the back-end editors.

Returns
void

inherited protected fillableFromArray (array $attributes) : array

Inherited from CmsCompoundObject

Get the fillable attributes of a given array.

Parameters
Property Description
$attributes
array
Returns
array

inherited protected finishSave () : void

Inherited from CmsCompoundObject

Finish processing on a successful save operation.

Returns
void

inherited protected fireModelEvent (string $event, boolean $halt = true) : mixed

Inherited from CmsCompoundObject

Fire the given event for the model.

Parameters
Property Description
$event
string
$halt
boolean
Returns
mixed

inherited protected getArrayableAppends () : array

Inherited from CmsCompoundObject

Get all of the appendable values that are arrayable.

Returns
array

inherited protected getAttributeFromArray (string $key) : mixed

Inherited from CmsCompoundObject

Get an attribute from the $attributes array.

Parameters
Property Description
$key
string
Returns
mixed

inherited protected getValidationAttributes () : array

Inherited from CmsCompoundObject

Returns the model data used for validation.

Returns
array

inherited protected static makeValidator ($data, $rules, $customMessages, $attributeNames) : Illuminate\Validation\Validator

Inherited from CmsCompoundObject

Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel.

Parameters
Property Description
$data
mixed
$rules
mixed
$customMessages
mixed
$attributeNames
mixed
Returns
Illuminate\Validation\Validator

inherited protected mutateAttribute (string $key, mixed $value) : mixed

Inherited from CmsCompoundObject

Get the value of an attribute using its mutator.

Parameters
Property Description
$key
string
$value
mixed
Returns
mixed

inherited protected mutateAttributeForArray (string $key, mixed $value) : mixed

Inherited from CmsCompoundObject

Get the value of an attribute using its mutator for array conversion.

Parameters
Property Description
$key
string
$value
mixed
Returns
mixed

inherited protected originalIsNumericallyEquivalent (string $key) : bool

Inherited from CmsCompoundObject

Determine if the new and old values for a given key are numerically equivalent.

Parameters
Property Description
$key
string
Returns
bool

inherited protected parseComponentSettings () : void

Inherited from CmsCompoundObject

Parse component sections.

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

Returns
void

inherited protected parseEventAndPayload (mixed $event, mixed $payload = null) : array

Inherited from CmsCompoundObject

Parse the given event and payload and prepare them for dispatching.

Parameters
Property Description
$event
mixed
$payload
mixed
Returns
array

inherited protected parseSettings () : void

Inherited from CmsCompoundObject

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.

Returns
void

inherited protected performDeleteOnModel () : void

Inherited from CmsCompoundObject

Perform the actual delete query on this model instance.

Returns
void

inherited protected performInsert (Winter\Storm\Halcyon\Builder $query) : bool

Inherited from CmsCompoundObject

Perform a model insert operation.

Parameters
Property Description
$query
Winter\Storm\Halcyon\Builder
Returns
bool

inherited protected performUpdate (Winter\Storm\Halcyon\Builder $query) : bool

Inherited from CmsCompoundObject

Perform a model update operation.

Parameters
Property Description
$query
Winter\Storm\Halcyon\Builder
Returns
bool

inherited protected processRuleFieldNames (array $rules) : array

Inherited from CmsCompoundObject

Processes field names in a rule array.

Converts any field names using array notation (ie. field[child]) into dot notation (ie. field.child)

Parameters
Property Description
$rules
array

Rules array

Returns
array

inherited protected processValidationRules ($rules)

Inherited from CmsCompoundObject

Process rules

Parameters
Property Description
$rules
mixed
Returns
mixed

inherited protected static registerModelEvent (string $event, Closure | string $callback, integer $priority) : void

Inherited from CmsCompoundObject

Register a model event with the dispatcher.

Parameters
Property Description
$event
string
$callback
Closure | string
$priority
integer
Returns
void

inherited protected throwHalcyonSaveException (Exception $ex)

Inherited from CmsCompoundObject

Converts an exception type thrown by Halcyon to a native CMS exception.

Parameters
Property Description
$ex
Exception
Returns
mixed

inherited protected validateSettings () : void

Inherited from CmsCompoundObject

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.

Returns
void
Copyright © 2024 Winter CMS