src/Model/ContactPerson.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Model;
  3. use App\Helpers\CurrentLocale;
  4. use App\Helpers\LocaleHelper;
  5. use Symfony\Component\Intl\Countries;
  6. class ContactPerson extends \Pimcore\Model\DataObject\ContactPerson
  7. {
  8.     public function translatedRegion(): string
  9.     {
  10.         //TODO isn't the `region` field unused since the introduction of the `enabled` translatable field?
  11.         $region $this->getRegion();
  12.         return $region Countries::getName($region) : '';
  13.     }
  14.     /**
  15.      * For all the selected branches for this ContactPerson we combine this in a list, separating each branch with a comma.
  16.      *
  17.      * @return string
  18.      * @throws \Exception
  19.      */
  20.     public function branchesList(): ?string
  21.     {
  22.         $branches $this->getBranches();
  23.         if (!$branches) {
  24.             return null;
  25.         }
  26.         // Combine all branch names into a string, separate then with a comma and a space.
  27.         return join(', 'array_map(fn($b) => $b->getBranchename(), $branches));
  28.     }
  29. }