Documentation

Viewpoint
in package
implements CreateableInterface Uses Creator, SceneBasics

A Viewpoint is the current Scene a character is experiencing with all changes from modules included.

Tags
Entity
Table

(name="viewpoints")

HasLifecycleCallbacks

Interfaces, Classes and Traits

CreateableInterface
Interface for createable models.

Table of Contents

$_description  : SceneDescription|null
$actionGroups  : array<string|int, mixed>
$attachments  : array<string|int, mixed>
$data  : array<string|int, mixed>
$description  : string
$fillable  : array<string|int, mixed>
$owner  : Character
$scene  : Scene|null
$template  : SceneTemplate|null
$title  : string
$twigSceneRenderer  : TwigSceneRenderer|null
addActionGroup()  : void
Adds a new action group to a viewpoint.
addActionToGroupId()  : mixed
Add the specified action to the group with the provided id. Does nothing if the id is not present.
addAttachment()  : mixed
Adds an attachment
addDescriptionParagraph()  : mixed
Adds a paragraph to the existing description.
changeFromScene()  : mixed
Copies the static data from a scene to this Viewpoint entity.
changeFromSnapshot()  : mixed
Changes the current viewpoint to the state saved in the given restoration point.
clearDescription()  : void
Clears the description.
create()  : CreateableInterface
Creates and returns an entity instance and fills values.
findActionById()  : Action|null
Returns the action that corresponds to the given ID, if present.
findActionGroupById()  : ActionGroup|null
Returns an action group by id or fails.
getActionGroups()  : array<string|int, ActionGroup>
Returns all action groups.
getAttachments()  : array<string|int, AttachmentInterface>
Returns all attachments.
getData()  : array<string|int, mixed>
Returns all data.
getDataField()  : mixed
Returns a single data field.
getDescription()  : string
Returns the current description as a string.
getOwner()  : Character
Returns the owner.
getRenderedDescription()  : string
Returns the rendered version of the description
getRenderedTitle()  : string
Returns the rendered version of the title
getScene()  : Scene|null
Returns the template scene used to create this viewpoint.
getSnapshot()  : ViewpointSnapshot
Returns a restoration point that can be used to reconstruct the current viewpoint.
getTemplate()  : SceneTemplate|null
Returns scene template.
getTitle()  : string
Returns scene title.
getTwigSceneRenderer()  : TwigSceneRenderer|null
onLoad()  : mixed
removeActionsWithSceneId()  : mixed
Removes any actions that correspond to a given scene ID, if present.
setActionGroups()  : mixed
Sets action groups.
setAttachments()  : mixed
Sets attachments.
setData()  : mixed
Sets all data.
setDataField()  : mixed
Sets a single data field.
setDescription()  : void
Sets the description of this viewpoint.
setOwner()  : mixed
Sets the owner.
setScene()  : mixed
Sets the template scene used to create this viewpoint.
setTemplate()  : mixed
Sets scene template.
setTitle()  : mixed
Sets scene title.
setTwigSceneRenderer()  : mixed

Properties

$actionGroups

private array<string|int, mixed> $actionGroups = []
Tags
Column

(type="array")

$attachments

private array<string|int, mixed> $attachments = []
Tags
Column

(type="array")

$data

private array<string|int, mixed> $data = []
Tags
Column

(type="array")

$description

private string $description = "{No scene set}"
Tags
Column

(type="text")

$fillable

private static array<string|int, mixed> $fillable = ["owner"]

$owner

private Character $owner
Tags
Id
OneToOne

(targetEntity="Character", inversedBy="viewpoint", cascade="persist")

JoinColumn

(fieldName="owner_id", referencedColumnName="id")

$scene

private Scene|null $scene = null
Tags
ManyToOne

(targetEntity="Scene")

JoinColumn

(name="scene_id", referencedColumnName="id")

$template

private SceneTemplate|null $template
Tags
ManyToOne

(targetEntity="SceneTemplate", fetch="EAGER")

JoinColumn

(name="template", referencedColumnName="class", nullable=true)

$title

private string $title = "{No scene set}"
Tags
Column

(type="string", length=255)

Methods

addActionGroup()

Adds a new action group to a viewpoint.

public addActionGroup(ActionGroup $group[, string|null $after = null ]) : void
Parameters
$group : ActionGroup

The new group to add.

$after : string|null = null

Optional group id that comes before.

Tags
throws
ArgumentException
Return values
void

addActionToGroupId()

Add the specified action to the group with the provided id. Does nothing if the id is not present.

public addActionToGroupId(Action $action, string $actionGroupId) : mixed
Parameters
$action : Action
$actionGroupId : string
Return values
mixed

addDescriptionParagraph()

Adds a paragraph to the existing description.

public addDescriptionParagraph(string $paragraph) : mixed
Parameters
$paragraph : string
Return values
mixed

changeFromScene()

Copies the static data from a scene to this Viewpoint entity.

public changeFromScene(Scene $scene) : mixed
Parameters
$scene : Scene
Return values
mixed

changeFromSnapshot()

Changes the current viewpoint to the state saved in the given restoration point.

public changeFromSnapshot(EntityManager $entityManager, ViewpointSnapshot $snapshot) : mixed
Parameters
$entityManager : EntityManager
$snapshot : ViewpointSnapshot
Return values
mixed

clearDescription()

Clears the description.

public clearDescription() : void
Return values
void

findActionById()

Returns the action that corresponds to the given ID, if present.

public findActionById(string $id) : Action|null
Parameters
$id : string
Return values
Action|null

findActionGroupById()

Returns an action group by id or fails.

public findActionGroupById(string $actionGroupId) : ActionGroup|null
Parameters
$actionGroupId : string
Return values
ActionGroup|null

getData()

Returns all data.

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDataField()

Returns a single data field.

public getDataField(string $fieldname[, mixed $default = null ]) : mixed
Parameters
$fieldname : string

Fieldname

$default : mixed = null

Default value

Return values
mixed

getDescription()

Returns the current description as a string.

public getDescription() : string
Return values
string

getRenderedDescription()

Returns the rendered version of the description

public getRenderedDescription() : string
Return values
string

getRenderedTitle()

Returns the rendered version of the title

public getRenderedTitle() : string
Return values
string

getScene()

Returns the template scene used to create this viewpoint.

public getScene() : Scene|null
Return values
Scene|null

getTitle()

Returns scene title.

public getTitle() : string
Return values
string

onLoad()

public onLoad() : mixed
Tags
PostLoad
Return values
mixed

removeActionsWithSceneId()

Removes any actions that correspond to a given scene ID, if present.

public removeActionsWithSceneId(int $id) : mixed
Parameters
$id : int
Return values
mixed

setActionGroups()

Sets action groups.

public setActionGroups(array<string|int, ActionGroup$actionGroups) : mixed
Parameters
$actionGroups : array<string|int, ActionGroup>
Return values
mixed

setData()

Sets all data.

public setData(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

setDataField()

Sets a single data field.

public setDataField(string $fieldname, mixed $value) : mixed
Parameters
$fieldname : string
$value : mixed
Return values
mixed

setDescription()

Sets the description of this viewpoint.

public setDescription(string $description) : void
Parameters
$description : string
Return values
void

setScene()

Sets the template scene used to create this viewpoint.

public setScene(Scene $scene) : mixed
Parameters
$scene : Scene
Return values
mixed

setTitle()

Sets scene title.

public setTitle(string $title) : mixed
Parameters
$title : string
Return values
mixed

Search results