PHP code example of brotkrueml / schema-virtuallocation

1. Go to this page and download the library: Download brotkrueml/schema-virtuallocation library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

brotkrueml / schema-virtuallocation example snippets




declare(strict_types=1);

namespace MyVendor\MyExtension\Controller;

use Brotkrueml\Schema\Type\TypeFactory;

final class MyController
{
    public function __construct(
        private readonly TypeFactory $typeFactory,
    ) {}

    public function doSomething(): void
    {
        // ...

        $location = $this->typeFactory->create('VirtualLocation');
        $location->setProperty('url', 'https://example.org/join/12345');

        $event = $this->typeFactory->create('Event');
        $event
            ->setProperty('name' 'A virtual event')
            ->setProperty('location', $location)
        ;

        // ...
    }
}