Menu

## Viewpoint
in package
implements CreateableInterface Uses Creator, SceneBasics

Viewpoint.php : 35

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

#### $_description

Viewpoint.php : 68
`private SceneDescription|null $_description = null`

#### $actionGroups

Viewpoint.php : 51
`private array<string|int, mixed> $actionGroups = []`

##### Tags

Column

  (type="array")

#### $attachments

Viewpoint.php : 57
`private array<string|int, mixed> $attachments = []`

##### Tags

Column

  (type="array")

#### $data

Viewpoint.php : 60
`private array<string|int, mixed> $data = []`

##### Tags

Column

  (type="array")

#### $description

SceneBasics.php : 19
`private string $description = "{No scene set}"`

##### Tags

Column

  (type="text")

#### $fillable

Viewpoint.php : 71
`private static array<string|int, mixed> $fillable = ["owner"]`

#### $owner

Viewpoint.php : 45
`private Character $owner`

##### Tags

Id
OneToOne

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

JoinColumn

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

#### $scene

Viewpoint.php : 66
`private Scene|null $scene = null`

##### Tags

ManyToOne

  (targetEntity="Scene")

JoinColumn

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

#### $template

SceneBasics.php : 25
`private SceneTemplate|null $template`

##### Tags

ManyToOne

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

JoinColumn

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

#### $title

SceneBasics.php : 17
`private string $title = "{No scene set}"`

##### Tags

Column

  (type="string", length=255)

#### $twigSceneRenderer

Viewpoint.php : 69
`private TwigSceneRenderer|null $twigSceneRenderer = null`

### Methods

#### addActionGroup()

Viewpoint.php : 266

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()

Viewpoint.php : 314

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 —

#### addAttachment()

Viewpoint.php : 348

Adds an attachment

`public addAttachment(AttachmentInterface $attachment) : mixed`

##### Parameters

$attachment : AttachmentInterface

##### Return values

mixed —

#### addDescriptionParagraph()

Viewpoint.php : 151

Adds a paragraph to the existing description.

`public addDescriptionParagraph(string $paragraph) : mixed`

##### Parameters

$paragraph : string

##### Return values

mixed —

#### changeFromScene()

Viewpoint.php : 165

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

`public changeFromScene(Scene $scene) : mixed`

##### Parameters

$scene : Scene

##### Return values

mixed —

#### changeFromSnapshot()

Viewpoint.php : 199

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()

Viewpoint.php : 132

Clears the description.

`public clearDescription() : void`

##### Return values

void —

#### create()

Creator.php : 25

Creates and returns an entity instance and fills values.

`public static create(array<string|int, mixed> $arguments) : CreateableInterface`

##### Parameters

$arguments : array<string|int, mixed>

  The values the instance should get

##### Tags

throws
  WrongTypeException|UnexpectedArrayKeyException
throws
  AttributeMissingException

##### Return values

CreateableInterface —

The created Entity

#### findActionById()

Viewpoint.php : 397

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()

Viewpoint.php : 296

Returns an action group by id or fails.

`public findActionGroupById(string $actionGroupId) : ActionGroup|null`

##### Parameters

$actionGroupId : string

##### Return values

ActionGroup|null —

#### getActionGroups()

Viewpoint.php : 241

Returns all action groups.

`public getActionGroups() : array<string|int, ActionGroup>`

##### Return values

array<string|int, ActionGroup> —

#### getAttachments()

Viewpoint.php : 330

Returns all attachments.

`public getAttachments() : array<string|int, AttachmentInterface>`

##### Return values

array<string|int, AttachmentInterface> —

#### getData()

Viewpoint.php : 357

Returns all data.

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

##### Return values

array<string|int, mixed> —

#### getDataField()

Viewpoint.php : 377

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()

Viewpoint.php : 142

Returns the current description as a string.

`public getDescription() : string`

##### Return values

string —

#### getOwner()

Viewpoint.php : 89

Returns the owner.

`public getOwner() : Character`

##### Return values

Character —

#### getRenderedDescription()

Viewpoint.php : 447

Returns the rendered version of the description

`public getRenderedDescription() : string`

##### Return values

string —

#### getRenderedTitle()

Viewpoint.php : 432

Returns the rendered version of the title

`public getRenderedTitle() : string`

##### Return values

string —

#### getScene()

Viewpoint.php : 232

Returns the template scene used to create this viewpoint.

`public getScene() : Scene|null`

##### Return values

Scene|null —

#### getSnapshot()

Viewpoint.php : 181

Returns a restoration point that can be used to reconstruct the current viewpoint.

`public getSnapshot() : ViewpointSnapshot`

##### Return values

ViewpointSnapshot —

#### getTemplate()

SceneBasics.php : 76

Returns scene template.

`public getTemplate() : SceneTemplate|null`

##### Return values

SceneTemplate|null —

#### getTitle()

SceneBasics.php : 40

Returns scene title.

`public getTitle() : string`

##### Return values

string —

#### getTwigSceneRenderer()

Viewpoint.php : 114
`public getTwigSceneRenderer() : TwigSceneRenderer|null`

##### Return values

TwigSceneRenderer|null —

#### onLoad()

Viewpoint.php : 78
`public onLoad() : mixed`

##### Tags

PostLoad

##### Return values

mixed —

#### removeActionsWithSceneId()

Viewpoint.php : 414

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

`public removeActionsWithSceneId(int $id) : mixed`

##### Parameters

$id : int

##### Return values

mixed —

#### setActionGroups()

Viewpoint.php : 250

Sets action groups.

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

##### Parameters

$actionGroups : array<string|int, ActionGroup>

##### Return values

mixed —

#### setAttachments()

Viewpoint.php : 339

Sets attachments.

`public setAttachments(array<string|int, AttachmentInterface> $attachments) : mixed`

##### Parameters

$attachments : array<string|int, AttachmentInterface>

##### Return values

mixed —

#### setData()

Viewpoint.php : 366

Sets all data.

`public setData(array<string|int, mixed> $data) : mixed`

##### Parameters

$data : array<string|int, mixed>

##### Return values

mixed —

#### setDataField()

Viewpoint.php : 387

Sets a single data field.

`public setDataField(string $fieldname, mixed $value) : mixed`

##### Parameters

$fieldname : string
$value : mixed

##### Return values

mixed —

#### setDescription()

Viewpoint.php : 123

Sets the description of this viewpoint.

`public setDescription(string $description) : void`

##### Parameters

$description : string

##### Return values

void —

#### setOwner()

Viewpoint.php : 98

Sets the owner.

`public setOwner(Character $owner) : mixed`

##### Parameters

$owner : Character

##### Return values

mixed —

#### setScene()

Viewpoint.php : 223

Sets the template scene used to create this viewpoint.

`public setScene(Scene $scene) : mixed`

##### Parameters

$scene : Scene

##### Return values

mixed —

#### setTemplate()

SceneBasics.php : 67

Sets scene template.

`public setTemplate(SceneTemplate|null $template) : mixed`

##### Parameters

$template : SceneTemplate|null

##### Return values

mixed —

#### setTitle()

SceneBasics.php : 31

Sets scene title.

`public setTitle(string $title) : mixed`

##### Parameters

$title : string

##### Return values

mixed —

#### setTwigSceneRenderer()

Viewpoint.php : 106
`public setTwigSceneRenderer(TwigSceneRenderer $twigSceneRenderer) : mixed`

##### Parameters

$twigSceneRenderer : TwigSceneRenderer

##### Return values

mixed —

## Search results