Documentation

EventInterface

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
$this

getContent()

Get the event content.

public getContent() : string
Return values
string

getCreatedAt()

Get the event created time.

public getCreatedAt() : int
Return values
int

getId()

Get the Id.

public getId() : string
Return values
string

getKind()

Returns the kind.

public getKind() : int
Return values
int

getPublicKey()

Get the public key.

public getPublicKey() : string
Return values
string

getSignature()

Get the signature.

public getSignature() : string
Return values
string

getTags()

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
$this

setCreatedAt()

Set the event created time.

public setCreatedAt(int $time) : $this
Parameters
$time : int
Return values
$this

setId()

Set the id.

public setId(string $id) : $this
Parameters
$id : string
Return values
$this

setKind()

Set the event kind.

public setKind(int $kind) : $this
Parameters
$kind : int
Return values
$this

setPublicKey()

Set the public key.

public setPublicKey(string $public_key) : $this
Parameters
$public_key : string
Return values
$this

setSignature()

Set the signature.

public setSignature(string $sig) : $this
Parameters
$sig : string
Return values
$this

setTags()

Set the event tags with values.

public setTags(array<string|int, mixed> $tags) : $this
Parameters
$tags : array<string|int, mixed>

[] [ ["e", "..."], ["p", "...", "..."], ]

Return values
$this

toArray()

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
string

verify()

Returns true if event object encodes to a valid Nostr event JSON string.

public verify() : bool
Return values
bool

        
On this page

Search results