EventInterface
in
Table of Contents
Methods
- addTag() : $this
- Add an event tag.
- getContent() : string
- Get the event content.
- getCreatedAt() : int
- Get the event created time.
- getId() : string
- Get the Id.
- getKind() : int
- Returns the kind.
- getPublicKey() : string
- Get the public key.
- getSignature() : string
- Get the signature.
- getTags() : array<string|int, mixed>
- Get the event tags.
- setContent() : $this
- Set the event content.
- setCreatedAt() : $this
- Set the event created time.
- setId() : $this
- Set the id.
- setKind() : $this
- Set the event kind.
- setPublicKey() : $this
- Set the public key.
- setSignature() : $this
- Set the signature.
- setTags() : $this
- Set the event tags with values.
- toArray() : array<string|int, mixed>
- Convert the object to an array.
- toJson() : string
- Convert the event object to a JSON string.
- verify() : bool
- Returns true if event object encodes to a valid Nostr event JSON string.
Methods
addTag()
Add an event tag.
public
addTag(array<string|int, mixed> $tag) : $this
Parameters
- $tag : array<string|int, mixed>
Return values
$thisgetContent()
Get the event content.
public
getContent() : string
Return values
stringgetCreatedAt()
Get the event created time.
public
getCreatedAt() : int
Return values
intgetId()
Get the Id.
public
getId() : string
Return values
stringgetKind()
Returns the kind.
public
getKind() : int
Return values
intgetPublicKey()
Get the public key.
public
getPublicKey() : string
Return values
stringgetSignature()
Get the signature.
public
getSignature() : string
Return values
stringgetTags()
Get the event tags.
public
getTags() : array<string|int, mixed>
Return values
array<string|int, mixed>setContent()
Set the event content.
public
setContent(string $content) : $this
Parameters
- $content : string
Return values
$thissetCreatedAt()
Set the event created time.
public
setCreatedAt(int $time) : $this
Parameters
- $time : int
Return values
$thissetId()
Set the id.
public
setId(string $id) : $this
Parameters
- $id : string
Return values
$thissetKind()
Set the event kind.
public
setKind(int $kind) : $this
Parameters
- $kind : int
Return values
$thissetPublicKey()
Set the public key.
public
setPublicKey(string $public_key) : $this
Parameters
- $public_key : string
Return values
$thissetSignature()
Set the signature.
public
setSignature(string $sig) : $this
Parameters
- $sig : string
Return values
$thissetTags()
Set the event tags with values.
public
setTags(array<string|int, mixed> $tags) : $this
Parameters
- $tags : array<string|int, mixed>
-
[] [ ["e", "..."], ["p", "...", "..."], ]
Return values
$thistoArray()
Convert the object to an array.
public
toArray([array<string|int, mixed> $ignore_properties = [] ]) : array<string|int, mixed>
Parameters
- $ignore_properties : array<string|int, mixed> = []
Return values
array<string|int, mixed>toJson()
Convert the event object to a JSON string.
public
toJson() : string
Return values
stringverify()
Returns true if event object encodes to a valid Nostr event JSON string.
public
verify() : bool