Plank\Mediable\UrlGenerators\UrlGeneratorFactory::setGeneratorForFilesystemDriver PHP Method

setGeneratorForFilesystemDriver() public method

Set a generator subclass to use for media on a disk with a particular driver.
public setGeneratorForFilesystemDriver ( $class, string $driver ) : void
$driver string
return void
    public function setGeneratorForFilesystemDriver($class, $driver)
    {
        $this->validateGeneratorClass($class);
        $this->driver_generators[$driver] = $class;
    }

Usage Example

 public function test_it_throws_exception_for_invalid_generator()
 {
     $factory = new UrlGeneratorFactory();
     $class = $this->getMockClass(stdClass::class);
     $this->expectException(MediaUrlException::class);
     $factory->setGeneratorForFilesystemDriver($class, 'foo');
 }
All Usage Examples Of Plank\Mediable\UrlGenerators\UrlGeneratorFactory::setGeneratorForFilesystemDriver