CoreDataObject
in package
implements
SerializableContract
uses
Serializable
FinalYes
Data class to contain the core data for a page being constructed.
It should contain immutable data known at the very start of construction. In addition to the front matter and markdown, the data should contain everything needed to identify the unique page being constructed.
The benefit of using this class over passing around the page object when constructing a page is that the latter's state is unpredictable due to the nature of the construction process continuously mutating the page object. This class on the other hand is immutable, making it highly predictable.
Table of Contents
Interfaces
- SerializableContract
- Specifies that a class can be serialized to an array and/or JSON.
Properties
- $identifier : string
- $markdown : Markdown|false
- $matter : FrontMatter
- $outputPath : string
- $pageClass : string
- $routeKey : string
- $sourcePath : string
Methods
- __construct() : mixed
- arraySerialize() : array<string|int, mixed>
- Recursively serialize Arrayables
- jsonSerialize() : array<string|int, mixed>
- toArray() : array{pageClass: string, identifier: string, sourcePath: string, outputPath: string, routeKey: string}
- Get the instance as an array.
- toJson() : string
- automaticallySerialize() : array<string|int, mixed>
- Automatically serialize all public properties.
Properties
$identifier read-only
public
string
$identifier
$markdown read-only
public
Markdown|false
$markdown
$matter read-only
public
FrontMatter
$matter
$outputPath read-only
public
string
$outputPath
$pageClass read-only
public
string
$pageClass
$routeKey read-only
public
string
$routeKey
$sourcePath read-only
public
string
$sourcePath
Methods
__construct()
public
__construct(FrontMatter $matter, Markdown|false $markdown, string $pageClass, string $identifier, string $sourcePath, string $outputPath, string $routeKey) : mixed
Parameters
- $matter : FrontMatter
- $markdown : Markdown|false
- $pageClass : string
- $identifier : string
- $sourcePath : string
- $outputPath : string
- $routeKey : string
arraySerialize()
Recursively serialize Arrayables
public
arraySerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>jsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>toArray()
Get the instance as an array.
public
toArray() : array{pageClass: string, identifier: string, sourcePath: string, outputPath: string, routeKey: string}
Return values
array{pageClass: string, identifier: string, sourcePath: string, outputPath: string, routeKey: string}toJson()
public
toJson([int $options = 0 ]) : string
Parameters
- $options : int = 0
Return values
stringautomaticallySerialize()
Automatically serialize all public properties.
protected
automaticallySerialize() : array<string|int, mixed>