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])
파일 보기 프로젝트 열기: bolt/bolt

보호된 프로퍼티들

프로퍼티 타입 설명
$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