Correct way adding External classes to Custom Post type and output their methods to template

So I'm creating Custom Post Type, and I have 3 external classes with namespace Test\Events\Model; Those 3 classes are final class Location, final class Event, and final class Person. Example of method:

public function street(): string
    {
        return 'Street name 2';
    }`

For template, I'm using single-event.php. My question is, How to hook all those classes and their methods? Everything I have tried it's not working, so I'm missing something for sure.

Thank you all!

Topic post-class plugin-development posts custom-post-types Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.