PHP Class Bolt\Storage\Entity\Content

Inheritance: extends Bolt\Storage\Entity\Entity, use trait ContentRouteTrait, use trait Bolt\Storage\Mapping\ContentTypeTitleTrait
显示文件 Open project: bolt/bolt Class Usage Examples

Protected Properties

Property Type Description
$_legacy Bolt\Storage\ContentLegacyService
$contenttype
$datechanged DateTime
$datecreated DateTime
$datedepublish DateTime
$datepublish DateTime
$group array @deprecated Deprecated since 3.0, to be removed in 4.0.
$id integer
$ownerid integer
$relation Bolt\Storage\Collection\Relations
$slug string
$sortorder integer
$status string
$taxonomy Bolt\Storage\Collection\Taxonomy

Public Methods

Method Description
get ( string $key ) : mixed Getter for templates using {{ content.get(title) }} functions.
getContenttype ( )
getDatechanged ( ) : DateTime Get change date.
getDatecreated ( ) : DateTime Get creation date.
getDatedepublish ( ) : DateTime
getDatepublish ( ) : DateTime
getGroup ( ) : array
getId ( ) : integer
getLegacy ( ) : Bolt\Storage\ContentLegacyService
getOwnerid ( ) : integer
getRelation ( string | null $contentType = null ) : Relations
getSlug ( ) : string
getSortorder ( ) : integer
getStatus ( ) : string
getTaxonomy ( ) : Taxonomy
getTemplatefields ( )
getTitle ( ) : string Getter for a record's 'title' field.
set ( string $key, mixed $value ) Setter for content values.
setContenttype ( $value )
setDatechanged ( DateTime | string | null $date ) Set change date.
setDatecreated ( DateTime | string | null $date ) Set creation date.
setDatedepublish ( DateTime | string | null $date ) Set depublished date.
setDatepublish ( DateTime | string | null $date ) Set published date.
setGroup ( array $group )
setId ( integer $id )
setLegacyService ( Bolt\Storage\ContentLegacyService $service )
setOwnerid ( integer $ownerid )
setRelation ( Relations $rel )
setSlug ( string $slug )
setSortorder ( integer $sortorder )
setStatus ( string $status )
setTaxonomy ( Taxonomy $taxonomy )
setTemplatefields ( $value )
setValues ( array $values ) Helper to set an array of values

Protected Methods

Method Description
getValidDateObject ( DateTime | string | null $date ) : DateTime | null Get a valid date property to persist.

Method Details

get() public method

Getter for templates using {{ content.get(title) }} functions.
public get ( string $key ) : mixed
$key string
return mixed

getContenttype() public method

public getContenttype ( )

getDatechanged() public method

Get change date.
public getDatechanged ( ) : DateTime
return DateTime

getDatecreated() public method

Get creation date.
public getDatecreated ( ) : DateTime
return DateTime

getDatedepublish() public method

public getDatedepublish ( ) : DateTime
return DateTime

getDatepublish() public method

public getDatepublish ( ) : DateTime
return DateTime

getGroup() public method

public getGroup ( ) : array
return array

getId() public method

public getId ( ) : integer
return integer

getLegacy() public method

public getLegacy ( ) : Bolt\Storage\ContentLegacyService
return Bolt\Storage\ContentLegacyService

getOwnerid() public method

public getOwnerid ( ) : integer
return integer

getRelation() public method

public getRelation ( string | null $contentType = null ) : Relations
$contentType string | null
return Bolt\Storage\Collection\Relations

getSlug() public method

public getSlug ( ) : string
return string

getSortorder() public method

public getSortorder ( ) : integer
return integer

getStatus() public method

public getStatus ( ) : string
return string

getTaxonomy() public method

public getTaxonomy ( ) : Taxonomy
return Bolt\Storage\Collection\Taxonomy

getTemplatefields() public method

public getTemplatefields ( )

getTitle() public method

If there is no field called 'title' then we just return the first text type field.
public getTitle ( ) : string
return string

getValidDateObject() protected method

Get a valid date property to persist.
protected getValidDateObject ( DateTime | string | null $date ) : DateTime | null
$date DateTime | string | null
return DateTime | null

set() public method

Setter for content values.
public set ( string $key, mixed $value )
$key string
$value mixed

setContenttype() public method

public setContenttype ( $value )

setDatechanged() public method

Set change date.
public setDatechanged ( DateTime | string | null $date )
$date DateTime | string | null

setDatecreated() public method

Set creation date.
public setDatecreated ( DateTime | string | null $date )
$date DateTime | string | null

setDatedepublish() public method

Set depublished date.
public setDatedepublish ( DateTime | string | null $date )
$date DateTime | string | null

setDatepublish() public method

Set published date.
public setDatepublish ( DateTime | string | null $date )
$date DateTime | string | null

setGroup() public method

public setGroup ( array $group )
$group array

setId() public method

public setId ( integer $id )
$id integer

setLegacyService() public method

public setLegacyService ( Bolt\Storage\ContentLegacyService $service )
$service Bolt\Storage\ContentLegacyService

setOwnerid() public method

public setOwnerid ( integer $ownerid )
$ownerid integer

setRelation() public method

public setRelation ( Relations $rel )
$rel Bolt\Storage\Collection\Relations

setSlug() public method

public setSlug ( string $slug )
$slug string

setSortorder() public method

public setSortorder ( integer $sortorder )
$sortorder integer

setStatus() public method

public setStatus ( string $status )
$status string

setTaxonomy() public method

public setTaxonomy ( Taxonomy $taxonomy )
$taxonomy Bolt\Storage\Collection\Taxonomy

setTemplatefields() public method

public setTemplatefields ( $value )

setValues() public method

Helper to set an array of values
public setValues ( array $values )
$values array

Property Details

$_legacy protected_oe property

protected ContentLegacyService,Bolt\Storage $_legacy
return Bolt\Storage\ContentLegacyService

$contenttype protected_oe property

protected $contenttype

$datechanged protected_oe property

protected DateTime $datechanged
return DateTime

$datecreated protected_oe property

protected DateTime $datecreated
return DateTime

$datedepublish protected_oe property

protected DateTime $datedepublish
return DateTime

$datepublish protected_oe property

protected DateTime $datepublish
return DateTime

$group protected_oe property

@deprecated Deprecated since 3.0, to be removed in 4.0.
protected array $group
return array

$id protected_oe property

protected int $id
return integer

$ownerid protected_oe property

protected int $ownerid
return integer

$relation protected_oe property

protected Relations,Bolt\Storage\Collection $relation
return Bolt\Storage\Collection\Relations

$slug protected_oe property

protected string $slug
return string

$sortorder protected_oe property

protected int $sortorder
return integer

$status protected_oe property

protected string $status
return string

$taxonomy protected_oe property

protected Taxonomy,Bolt\Storage\Collection $taxonomy
return Bolt\Storage\Collection\Taxonomy