Add Peer
class and conversion method in RegisteredPeerRecord
This commit is contained in:
parent
a3976742d6
commit
d732c89632
2 changed files with 119 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
use Socialbox\Classes\Configuration;
|
||||
use Socialbox\Enums\Flags\PeerFlags;
|
||||
use Socialbox\Interfaces\SerializableInterface;
|
||||
use Socialbox\Objects\Standard\Peer;
|
||||
use Socialbox\Objects\Standard\SelfUser;
|
||||
|
||||
class RegisteredPeerRecord implements SerializableInterface
|
||||
|
@ -191,6 +192,16 @@
|
|||
return new SelfUser($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the current instance to a Peer object.
|
||||
*
|
||||
* @return Peer The Peer representation of the current instance.
|
||||
*/
|
||||
public function toPeer(): Peer
|
||||
{
|
||||
return Peer::fromArray($this->toArray());
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue