protected function entityToArray(): array
    {
        $array = [
                "id" => (string) $this->id,
                "label" => $this->label(),
                "attributes" => $this->attributes->toArray()
        ];
        if(isset($this->listeners)&&isset($this->listeners_flat)) {
            $array["listeners"] = $this->listeners_flat;
        }
        return $array;
    }
protected function entityToArray(): array
    {
        $array = [
                "id" => (string) $this->id,
                "label" => $this->label(),
                "attributes" => $this->attributes->toArray()
        ];
        if(isset($this->listeners)&&isset($this->listeners_flat)) {
            $array["listeners"] = $this->listeners_flat;
        }
        return $array;
    }
protected function entityToArray ( ) : array { $ array = [ "id" => ( string ) $ this -> id , "label" => $ this -> label ( ) , "attributes" => $ this -> attributes -> toArray ( ) ] ; if ( isset ( $ this -> listeners ) && isset ( $ this -> listeners_flat ) ) { $ array [ "listeners" ] = $ this -> listeners_flat ; } return $ array ; }
Converts the object to array

Used for serialization/unserialization. Converts internal
object properties into a simple format to help with
reconstruction.

@see toArray for actual implementation of this method by subclasses.

@return array The object in array format.
Converts the object to array