PHP Трейт Bolt\Storage\Entity\ContentValuesTrait

This is a breakout of the old Bolt\Content class and serves two main purposes: * Maintain backward compatibility for Bolt\Content through the remainder of the 2.x development/release life-cycle * Attempt to break up former functionality into sections of code that more resembles Single Responsibility Principles These traits should be considered transitional, the functionality in the process of refactor, and not representative of a valid approach.
Автор: Gawain Lynch ([email protected])
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$isRootType Whether this is a "real" contenttype or an embedded ones

Открытые методы

Метод Описание
excerpt ( $length = 200, $includeTitle = false, $focus = null ) Alias for getExcerpt()
get ( string $name ) : mixed Pseudo-magic function, used for when templates use {{ content.get(title) }}, so we can map it to $this->values['title'].
getExcerpt ( integer $length = 200, boolean $includeTitle = false, string | array $focus = null ) : Twig_Markup Create an excerpt for the content.
getImage ( ) : string Get the first image in the content.
getTitle ( $allowBasicTags = false ) : string Get the title, name, caption or subject.
getTitleColumnName ( ) : array Get the columnname of the title, name, caption or subject.
getValues ( boolean $json = false, boolean $stripped = false ) : array Return a content objects values.
hasTemplateFields ( ) : boolean Check if a ContentType field has a template set.
setFromPost ( array $values, string $contenttype ) : void Set a ContentType record values from a HTTP POST.
setValue ( string $key, mixed $value ) Set a ContentType record's individual value.
setValues ( array $values ) Set a ContentType record's values.

Защищенные методы

Метод Описание
getTemplateFieldsContentType ( ) : string Get the template associate with a ContentType field.

Описание методов

excerpt() публичный метод

Alias for getExcerpt()
public excerpt ( $length = 200, $includeTitle = false, $focus = null )

get() публичный метод

Pseudo-magic function, used for when templates use {{ content.get(title) }}, so we can map it to $this->values['title'].
public get ( string $name ) : mixed
$name string
Результат mixed

getExcerpt() публичный метод

Create an excerpt for the content.
public getExcerpt ( integer $length = 200, boolean $includeTitle = false, string | array $focus = null ) : Twig_Markup
$length integer
$includeTitle boolean
$focus string | array
Результат Twig_Markup

getImage() публичный метод

Get the first image in the content.
public getImage ( ) : string
Результат string

getTemplateFieldsContentType() защищенный метод

Get the template associate with a ContentType field.
protected getTemplateFieldsContentType ( ) : string
Результат string

getTitle() публичный метод

Get the title, name, caption or subject.
public getTitle ( $allowBasicTags = false ) : string
Результат string

getTitleColumnName() публичный метод

Get the columnname of the title, name, caption or subject.
public getTitleColumnName ( ) : array
Результат array

getValues() публичный метод

Return a content objects values.
public getValues ( boolean $json = false, boolean $stripped = false ) : array
$json boolean Set to TRUE to return JSON encoded values for arrays
$stripped boolean Set to true to strip all of the base fields
Результат array

hasTemplateFields() публичный метод

Check if a ContentType field has a template set.
public hasTemplateFields ( ) : boolean
Результат boolean

setFromPost() публичный метод

Set a ContentType record values from a HTTP POST.
public setFromPost ( array $values, string $contenttype ) : void
$values array
$contenttype string
Результат void

setValue() публичный метод

Set a ContentType record's individual value.
public setValue ( string $key, mixed $value )
$key string
$value mixed

setValues() публичный метод

Set a ContentType record's values.
public setValues ( array $values )
$values array

Описание свойств

$isRootType защищенное свойство

Whether this is a "real" contenttype or an embedded ones
protected $isRootType