Skip to content
Snippets Groups Projects
Select Git revision
  • 28056f5ddc909f733fa870a80a11e07dc4af9e2b
  • main default protected
  • demo protected
  • master
  • icon-set-mapping
  • production protected
  • revert-62666d1a
  • favorites-and-recent-files
  • lit2
  • wc-part
  • mark-downloaded-files
  • feature/annotpdf-test
  • fix-zip-upload
  • config-cleanup
  • wip
  • app-shell-update
16 results

index.html

Blame
  • ExternalApi.php 944 B
    <?php
    
    declare(strict_types=1);
    
    namespace DBP\API\StarterBundle\Service;
    
    use DBP\API\StarterBundle\Entity\Place;
    
    class ExternalApi implements PlaceProviderInterface
    {
        private $places;
    
        public function __construct(MyCustomService $service)
        {
            $service = $service;
    
            $this->places = [];
            $place1 = new Place();
            $place1->setIdentifier('graz');
            $place1->setName('Graz');
    
            $place2 = new Place();
            $place2->setIdentifier('vienna');
            $place2->setName('Vienna');
    
            $this->places[] = $place1;
            $this->places[] = $place2;
        }
    
        public function getPlaceById(string $identifier): ?Place
        {
            foreach ($this->places as $place) {
                if ($place->getIdentifier() === $identifier) {
                    return $place;
                }
            }
    
            return null;
        }
    
        public function getPlaces(): array
        {
            return $this->places;
        }
    }