PHP Class Bolt\Legacy\Content

Deprecation: Deprecated since 3.0, to be removed in 4.0.
Inheritance: implements ArrayAccess, use trait Bolt\Storage\Entity\ContentRelationTrait, use trait Bolt\Storage\Entity\ContentRouteTrait, use trait Bolt\Storage\Entity\ContentSearchTrait, use trait Bolt\Storage\Entity\ContentTaxonomyTrait, use trait Bolt\Storage\Entity\ContentValuesTrait
ファイルを表示 Open project: bolt/bolt Class Usage Examples

Public Properties

Property Type Description
$config
$contenttype
$group
$id
$relation
$sortorder
$taxonomy
$user
$values

Protected Properties

Property Type Description
$app Silex\Application

Public Methods

Method Description
__call ( string $name, array $arguments ) : mixed Magic __call function, used for when templates use {{ content.title }}, so we can map it to $this->values['title'].
__construct ( Silex\Application $app, string $contenttype = '', array $values = [], boolean $isRootType = true )
fieldinfo ( string $key ) : array Get field information for the given field.
fieldtype ( string $key ) : string Get the fieldtype for a given fieldname.
getBaseColumns ( ) Gets a list of the base columns that are hard-coded into all content types (rather than configured through contenttypes.yml).
getDecodedValue ( string $name ) : mixed Get the decoded version of a value of the current object.
getTemplateContext ( )
next ( string $field = 'datepublish', array $where = [] ) : Content Get the next record. In this case 'next' is defined as 'first one published after this one' by default. You can pass a parameter like 'id' or '-title' to use that as the column to sort on.
offsetExists ( mixed $offset ) : boolean ArrayAccess support.
offsetGet ( mixed $offset ) : mixed ArrayAccess support.
offsetSet ( string $offset, mixed $value ) ArrayAccess support.
offsetUnset ( string $offset ) ArrayAccess support.
preParse ( string $snippet, boolean $allowtwig ) : string If passed snippet contains Twig tags, parse the string as Twig, and return the results.
previous ( string $field = 'datepublish', array $where = [] ) : Content Get the previous record. In this case 'previous' is defined as 'latest one published before this one' by default. You can pass a parameter like 'id' or '-title' to use that as the column to sort on.
setContenttype ( array | string $contenttype ) Set the Contenttype for the record.

Method Details

__call() public method

Magic __call function, used for when templates use {{ content.title }}, so we can map it to $this->values['title'].
public __call ( string $name, array $arguments ) : mixed
$name string Method name originally called
$arguments array Arguments to the call
return mixed return value of the call

__construct() public method

public __construct ( Silex\Application $app, string $contenttype = '', array $values = [], boolean $isRootType = true )
$app Silex\Application
$contenttype string
$values array
$isRootType boolean

fieldinfo() public method

Get field information for the given field.
public fieldinfo ( string $key ) : array
$key string
return array An associative array containing at least the key 'type', and, depending on the type, other keys.

fieldtype() public method

Get the fieldtype for a given fieldname.
public fieldtype ( string $key ) : string
$key string
return string

getBaseColumns() public static method

Gets a list of the base columns that are hard-coded into all content types (rather than configured through contenttypes.yml).
public static getBaseColumns ( )

getDecodedValue() public method

Get the decoded version of a value of the current object.
public getDecodedValue ( string $name ) : mixed
$name string name of the value to get
return mixed The decoded value or null when no value available

getTemplateContext() public method

public getTemplateContext ( )

next() public method

Get the next record. In this case 'next' is defined as 'first one published after this one' by default. You can pass a parameter like 'id' or '-title' to use that as the column to sort on.
public next ( string $field = 'datepublish', array $where = [] ) : Content
$field string
$where array
return Content

offsetExists() public method

ArrayAccess support.
public offsetExists ( mixed $offset ) : boolean
$offset mixed
return boolean

offsetGet() public method

ArrayAccess support.
public offsetGet ( mixed $offset ) : mixed
$offset mixed
return mixed

offsetSet() public method

ArrayAccess support.
public offsetSet ( string $offset, mixed $value )
$offset string
$value mixed

offsetUnset() public method

ArrayAccess support.
public offsetUnset ( string $offset )
$offset string

preParse() public method

If passed snippet contains Twig tags, parse the string as Twig, and return the results.
public preParse ( string $snippet, boolean $allowtwig ) : string
$snippet string
$allowtwig boolean
return string

previous() public method

Get the previous record. In this case 'previous' is defined as 'latest one published before this one' by default. You can pass a parameter like 'id' or '-title' to use that as the column to sort on.
public previous ( string $field = 'datepublish', array $where = [] ) : Content
$field string
$where array
return Content

setContenttype() public method

Set the Contenttype for the record.
public setContenttype ( array | string $contenttype )
$contenttype array | string

Property Details

$app protected_oe property

protected Application,Silex $app
return Silex\Application

$config public_oe property

public $config

$contenttype public_oe property

public $contenttype

$group public_oe property

public $group

$id public_oe property

public $id

$relation public_oe property

public $relation

$sortorder public_oe property

public $sortorder

$taxonomy public_oe property

public $taxonomy

$user public_oe property

public $user

$values public_oe property

public $values