PHP code example of dbp / relay-base-course-bundle

1. Go to this page and download the library: Download dbp/relay-base-course-bundle 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/ */

    

dbp / relay-base-course-bundle example snippets


...
Dbp\Relay\BasePersonBundle\DbpRelayBaseCourseBundle::class => ['all' => true],
...
];



namespace App\Service;

use Dbp\Relay\BaseCourseBundle\API\CourseProviderInterface;
use Dbp\Relay\BaseCourseBundle\Entity\Course;

class CourseProvider implements CourseProviderInterface
{
    public function getCourseById(string $identifier, array $options = []): ?Course
    {
        $course = new Course();
        $course->setIdentifier($identifier);
        $course->setName('Field Theory');
        $course->setDescription('News from field theory');

        return $course;
    }
    
    ...
}