@ -13,37 +13,37 @@ use OCP\AppFramework\Db\Entity;
/**
/**
* @ method void setId ( int $id )
* @ method void setId ( int $id )
* @ method int getId ()
* @ method int getId ()
* @ method void setActorId ( string $actorId )
* @ method string getActorId ()
* @ method void setActorType ( string $actorType )
* @ method void setActorType ( string $actorType )
* @ method string getActorType ()
* @ method string getActorType ()
* @ method void setActorId ( string $actorId )
* @ method string getActorId ()
* @ method void setRoomId ( int $roomId )
* @ method void setRoomId ( int $roomId )
* @ method int getRoomId ()
* @ method int getRoomId ()
* @ method void setBannedId ( string $bannedId )
* @ method string getBannedId ()
* @ method void setBannedType ( string $bannedType )
* @ method void setBannedType ( string $bannedType )
* @ method string getBannedType ()
* @ method string getBannedType ()
* @ method void setBannedId ( string $bannedId )
* @ method string getBannedId ()
* @ method void setBannedTime ( \DateTime $bannedTime )
* @ method void setBannedTime ( \DateTime $bannedTime )
* @ method \DateTime getBannedTime ()
* @ method \DateTime getBannedTime ()
* @ method void setInternalNote ( string $internalNote )
* @ method void setInternalNote ( string $internalNote )
* @ method string getInternalNote ()
* @ method string getInternalNote ()
*/
*/
class Ban extends Entity implements \JsonSerializable {
class Ban extends Entity implements \JsonSerializable {
protected string $actorId = '' ;
protected string $actorType = '' ;
protected string $actorType = '' ;
protected string $actorId = '' ;
protected int $roomId = 0 ;
protected int $roomId = 0 ;
protected string $bannedId = '' ;
protected string $bannedType = '' ;
protected string $bannedType = '' ;
protected string $bannedId = '' ;
protected ? \DateTime $bannedTime = null ;
protected ? \DateTime $bannedTime = null ;
protected ? string $internalNote = null ;
protected ? string $internalNote = null ;
public function __construct () {
public function __construct () {
$this -> addType ( 'id' , 'int' );
$this -> addType ( 'id' , 'int' );
$this -> addType ( 'actorId' , 'string' );
$this -> addType ( 'actorType' , 'string' );
$this -> addType ( 'actorType' , 'string' );
$this -> addType ( 'actorId' , 'string' );
$this -> addType ( 'roomId' , 'int' );
$this -> addType ( 'roomId' , 'int' );
$this -> addType ( 'bannedId' , 'string' );
$this -> addType ( 'bannedType' , 'string' );
$this -> addType ( 'bannedType' , 'string' );
$this -> addType ( 'bannedId' , 'string' );
$this -> addType ( 'bannedTime' , 'datetime' );
$this -> addType ( 'bannedTime' , 'datetime' );
$this -> addType ( 'internalNote' , 'string' );
$this -> addType ( 'internalNote' , 'string' );
}
}
@ -51,11 +51,11 @@ class Ban extends Entity implements \JsonSerializable {
public function jsonSerialize () : array {
public function jsonSerialize () : array {
return [
return [
'id' => $this -> getId (),
'id' => $this -> getId (),
'actorId' => $this -> getActorId (),
'actorType' => $this -> getActorType (),
'actorType' => $this -> getActorType (),
'actorId' => $this -> getActorId (),
'roomId' => $this -> getRoomId (),
'roomId' => $this -> getRoomId (),
'bannedId' => $this -> getBannedId (),
'bannedType' => $this -> getBannedType (),
'bannedType' => $this -> getBannedType (),
'bannedId' => $this -> getBannedId (),
'bannedTime' => $this -> getBannedTime () ? $this -> getBannedTime () -> getTimestamp () : null ,
'bannedTime' => $this -> getBannedTime () ? $this -> getBannedTime () -> getTimestamp () : null ,
'internalNote' => $this -> getInternalNote (),
'internalNote' => $this -> getInternalNote (),
];
];