\Charcoal\Cms\SectionBlocksSection

Blocks-content section

Types of sections

There can be different types of section. 4 exists in the CMS module:

  • blocks
  • content
  • empty
  • external

External implementations

Sections implement the following Interface / Trait:

  • From the Charcoal\Object namespace (in charcoal-base)
    • Hierarchical
    • Routable
  • From the local Charcoal\Cms namespace
    • Metatag
    • Searchable

Summary

Methods
Properties
Constants
__construct()
isDeletable()
hierarchicalLabel()
loadChildren()
setSectionType()
setInMenu()
setKeywords()
setSummary()
setExternalUrl()
setLocked()
setTitle()
setSubtitle()
setContent()
setImage()
sectionType()
title()
subtitle()
content()
image()
inMenu()
keywords()
summary()
externalUrl()
locked()
canonicalUrl()
defaultMetaTitle()
defaultMetaDescription()
defaultMetaImage()
parseAsMultiple()
postSave()
postUpdate()
preSave()
preUpdate()
preDelete()
setMetaTitle()
metaTitle()
setMetaDescription()
metaDescription()
setMetaImage()
metaImage()
setMetaAuthor()
metaAuthor()
metaTags()
setFacebookAppId()
facebookAppId()
setOpengraphTitle()
opengraphTitle()
setOpengraphSiteName()
opengraphSiteName()
setOpengraphDescription()
opengraphDescription()
setOpengraphType()
opengraphType()
setOpengraphImage()
opengraphImage()
setOpengraphAuthor()
opengraphAuthor()
setOpengraphPulisher()
opengraphPublisher()
opengraphTags()
generateDefaultMetaTags()
isEmptyMeta()
setSearchProperties()
searchProperties()
setSearchKeywords()
searchKeywords()
setTemplateIdent()
templateIdent()
setControllerIdent()
controllerIdent()
setTemplateOptions()
templateOptions()
blocks()
loadBlocks()
No public properties found
TYPE_BLOCKS
TYPE_CONTENT
TYPE_EMPTY
TYPE_EXTERNAL
DEFAULT_TYPE
translator()
$inMenu
$keywords
$summary
$externalUrl
$locked
$metaTitle
$metaDescription
$metaImage
$metaAuthor
$facebookAppId
$opengraphTitle
$opengraphSiteName
$opengraphDescription
$opengraphType
$opengraphImage
$opengraphAuthor
$opengraphPublisher
N/A
No private methods found
$sectionType
$title
$subtitle
$content
$image
$searchProperties
$searchKeywords
$templateIdent
$controllerIdent
$templateOptions
$blocks
N/A

Constants

TYPE_BLOCKS

TYPE_BLOCKS

TYPE_CONTENT

TYPE_CONTENT

TYPE_EMPTY

TYPE_EMPTY

TYPE_EXTERNAL

TYPE_EXTERNAL

DEFAULT_TYPE

DEFAULT_TYPE

Properties

$inMenu

$inMenu : array<mixed,string>

The menus this object is shown in.

Type

array<mixed,string>

$keywords

$keywords : array

Type

array

$summary

$summary : \Charcoal\Translator\Translation|string

Type

\Charcoal\Translator\Translation|string

$externalUrl

$externalUrl : string

Type

string

$locked

$locked : boolean

Type

boolean

$metaTitle

$metaTitle : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$metaDescription

$metaDescription : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$metaImage

$metaImage : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$metaAuthor

$metaAuthor : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$facebookAppId

$facebookAppId : string

Type

string

$opengraphTitle

$opengraphTitle : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$opengraphSiteName

$opengraphSiteName : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$opengraphDescription

$opengraphDescription : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$opengraphType

$opengraphType : string

Type

string

$opengraphImage

$opengraphImage : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$opengraphAuthor

$opengraphAuthor : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$opengraphPublisher

$opengraphPublisher : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$sectionType

$sectionType : string

Type

string

$title

$title : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$subtitle

$subtitle : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$content

$content : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$image

$image : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$searchProperties

$searchProperties : array

Type

array

$searchKeywords

$searchKeywords : \Charcoal\Translator\Translation|string|null

Type

\Charcoal\Translator\Translation|string|null

$templateIdent

$templateIdent : mixed

The object's template identifier.

Type

mixed

$controllerIdent

$controllerIdent : mixed

The object's template controller identifier.

Type

mixed

$templateOptions

$templateOptions : array

The customized template options.

Type

array

$blocks

$blocks : \Charcoal\Cms\Section\Collection

Type

\Charcoal\Cms\Section\Collection

Methods

__construct()

__construct(array  $data = null) 

Section constructor.

Parameters

array $data

Init data.

isDeletable()

isDeletable() : boolean

Determine if the object can be deleted.

Returns

boolean

hierarchicalLabel()

hierarchicalLabel() : string

Retrieve the object's title.

Returns

string

loadChildren()

loadChildren() : \ArrayAccess|\Traversable

HierarchicalTrait > loadChildren

Returns

\ArrayAccess|\Traversable

setSectionType()

setSectionType(string  $type) : self

Set the section's type.

Parameters

string $type

The section type.

Throws

\InvalidArgumentException

If the section type is not a string or not a valid section type.

Returns

self

setInMenu()

setInMenu(string|array<mixed,string>  $menu) : self

Set the menus this object belongs to.

Parameters

string|array<mixed,string> $menu

One or more menu identifiers.

Returns

self

setKeywords()

setKeywords(string|array<mixed,string>  $keywords) : self

Set the object's keywords.

Parameters

string|array<mixed,string> $keywords

One or more entries.

Returns

self

setSummary()

setSummary(\Charcoal\Translator\Translation|string|null  $summary) : self

Parameters

\Charcoal\Translator\Translation|string|null $summary

The summary.

Returns

self

setExternalUrl()

setExternalUrl(\Charcoal\Translator\Translation|string|null  $externalUrl) : self

Parameters

\Charcoal\Translator\Translation|string|null $externalUrl

The external url.

Returns

self

setLocked()

setLocked(boolean  $locked) : self

Section is locked when you can't change the URL

Parameters

boolean $locked

Prevent new route creation about that object.

Returns

self

setTitle()

setTitle(\Charcoal\Translator\Translation|string|null  $title) : self

Parameters

\Charcoal\Translator\Translation|string|null $title

The section title (localized).

Returns

self

setSubtitle()

setSubtitle(\Charcoal\Translator\Translation|string|null  $subtitle) : self

Parameters

\Charcoal\Translator\Translation|string|null $subtitle

The section subtitle (localized).

Returns

self

setContent()

setContent(\Charcoal\Translator\Translation|string|null  $content) : self

Parameters

\Charcoal\Translator\Translation|string|null $content

The section content (localized).

Returns

self

setImage()

setImage(mixed  $image) : self

Parameters

mixed $image

The section main image (localized).

Returns

self

sectionType()

sectionType() : string

Overrides `AbstractSection::section_type()`

Returns

string

title()

title() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

subtitle()

subtitle() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

content()

content() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

image()

image() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

inMenu()

inMenu() : \Charcoal\Translator\Translation|string|null

Retrieve the menus this object belongs to.

Returns

\Charcoal\Translator\Translation|string|null

keywords()

keywords() : array<mixed,string>

Retrieve the object's keywords.

Returns

array<mixed,string>

summary()

summary() : \Charcoal\Translator\Translation|string|null

HierarchicalTrait > loadChildren

Returns

\Charcoal\Translator\Translation|string|null

externalUrl()

externalUrl() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

locked()

locked() : boolean

Returns

boolean —

Or Null.

canonicalUrl()

canonicalUrl() : string

Returns

string

defaultMetaTitle()

defaultMetaTitle() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

defaultMetaDescription()

defaultMetaDescription() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

defaultMetaImage()

defaultMetaImage() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

parseAsMultiple()

parseAsMultiple(mixed  $value, string|\Charcoal\Cms\PropertyInterface  $separator = ',') : array

Parse the property value as a "multiple" value type.

Parameters

mixed $value

The value being converted to an array.

string|\Charcoal\Cms\PropertyInterface $separator

The boundary string.

Returns

array

postSave()

postSave() : boolean

Route generated on postSave in case it contains the ID of the section, which you only get once you have save

Returns

boolean

postUpdate()

postUpdate(array|null  $properties = null) : boolean

Check whatever before the update.

Parameters

array|null $properties

Properties.

Returns

boolean

preSave()

preSave() : boolean

{@inheritdoc}

Returns

boolean

preUpdate()

preUpdate(array  $properties = null) : boolean

{@inheritdoc}

Parameters

array $properties

Optional properties to update.

Returns

boolean

preDelete()

preDelete() : boolean

Event called before _deleting_ the object.

Returns

boolean

setMetaTitle()

setMetaTitle(mixed  $title) : self

Parameters

mixed $title

The meta tile (localized).

Returns

self

metaTitle()

metaTitle() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setMetaDescription()

setMetaDescription(mixed  $description) : self

Parameters

mixed $description

The meta description (localized).

Returns

self

metaDescription()

metaDescription() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setMetaImage()

setMetaImage(mixed  $image) : self

Parameters

mixed $image

The meta image (localized).

Returns

self

metaImage()

metaImage() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setMetaAuthor()

setMetaAuthor(mixed  $author) : self

Parameters

mixed $author

The meta author (localized).

Returns

self

metaAuthor()

metaAuthor() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

metaTags()

metaTags() : string

Returns

string

setFacebookAppId()

setFacebookAppId(string  $appId) : self

Parameters

string $appId

The facebook App ID (numeric string).

Returns

self

facebookAppId()

facebookAppId() : string

Returns

string

setOpengraphTitle()

setOpengraphTitle(mixed  $title) : self

Parameters

mixed $title

The opengraph title (localized).

Returns

self

opengraphTitle()

opengraphTitle() : \Charcoal\Translator\Translation|string|null

Get the opengraph title.

If not expilicitely defined, use the meta title as opengraph title.

Returns

\Charcoal\Translator\Translation|string|null

setOpengraphSiteName()

setOpengraphSiteName(mixed  $siteName) : self

Parameters

mixed $siteName

The site name (localized).

Returns

self

opengraphSiteName()

opengraphSiteName() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setOpengraphDescription()

setOpengraphDescription(mixed  $description) : self

Parameters

mixed $description

The opengraph description (localized).

Returns

self

opengraphDescription()

opengraphDescription() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setOpengraphType()

setOpengraphType(string  $type) : self

Parameters

string $type

The opengraph type.

Returns

self

opengraphType()

opengraphType() : string

Returns

string

setOpengraphImage()

setOpengraphImage(mixed  $image) : self

Parameters

mixed $image

The opengraph image (localized).

Returns

self

opengraphImage()

opengraphImage() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setOpengraphAuthor()

setOpengraphAuthor(mixed  $author) : self

Parameters

mixed $author

The opengraph author (localized).

Returns

self

opengraphAuthor()

opengraphAuthor() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setOpengraphPulisher()

setOpengraphPulisher(mixed  $publisher) : self

Parameters

mixed $publisher

The opengraph publisher (localized).

Returns

self

opengraphPublisher()

opengraphPublisher() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

opengraphTags()

opengraphTags() : string

Returns

string

generateDefaultMetaTags()

generateDefaultMetaTags() : self

Generates the default metatags for the current object.

Prevents some problem where the defaultMetaTag method content isn't set at the moment of setting the meta. Should be called on preSave and preUpdate of the object.

Returns

self —

$this.

isEmptyMeta()

isEmptyMeta(mixed  $meta) : boolean

Check if the meta is empty. Method exists because at this point we don't really know what's in the meta.

Possible param type:

  • [ lang => value, lang => value ]
  • Translation
  • null

Parameters

mixed $meta

Current meta value.

Returns

boolean —

Empty or not.

setSearchProperties()

setSearchProperties(array  $properties) : self

Parameters

array $properties

The properties to search into.

Returns

self

searchProperties()

searchProperties() : array

Returns

array

setSearchKeywords()

setSearchKeywords(mixed  $keywords) : self

Parameters

mixed $keywords

The search keywords (localized).

Returns

self

searchKeywords()

searchKeywords() : \Charcoal\Translator\Translation|string|null

Returns

\Charcoal\Translator\Translation|string|null

setTemplateIdent()

setTemplateIdent(mixed  $template) : self

Set the renderable object's template identifier.

Parameters

mixed $template

The template ID.

Returns

self

templateIdent()

templateIdent() : mixed

Retrieve the renderable object's template identifier.

Returns

mixed

setControllerIdent()

setControllerIdent(mixed  $ident) : self

Set the renderable object's template controller identifier.

Parameters

mixed $ident

The template controller identifier.

Returns

self

controllerIdent()

controllerIdent() : mixed

Retrieve the renderable object's template controller identifier.

Returns

mixed

setTemplateOptions()

setTemplateOptions(mixed  $options) : self

Customize the template's options.

Parameters

mixed $options

Template options.

Returns

self

templateOptions()

templateOptions() : array

Retrieve the template's customized options.

Returns

array

blocks()

blocks() : \Charcoal\Cms\Section\Collection

Returns

\Charcoal\Cms\Section\Collection —

List of Block objects

loadBlocks()

loadBlocks() : \Charcoal\Cms\Section\Collection

Returns

\Charcoal\Cms\Section\Collection

translator()

translator() : \Charcoal\Translator\Translator

Returns

\Charcoal\Translator\Translator