Get relation data from many to many relation

I created a new model : Supplier. And in product page I tried to get the supplier details but I get an error :
My code

<?php foreach ($this->product->getSuppliers() as $item): ?>
     <?php foreach ($item->getLocalizedFields()->getItems() as $supplier): ?>
            <p><?php echo $supplier->getEmail(); ?></p>
      <?php endforeach; ?>
<?php endforeach; ?>

And I get the error :

# Call to undefined method getItems in class Pimcore\Model\DataObject\Localizedfield

Please help me. Thx in advance.

I use a lot of “dump(…)” statements to get to the root of things. I also have a quick an easy command that I can feed an object id from the command line and it will dump its methods and values. Some things you just have to tease out a trail to get to the result you want. Also, xdebug.