public function generate(FileGenerator $generator, array $data = [])
    {
        $result = (new DataBuilderManager())->validateRaw($generator->data_builder, $data);

        if (!$result->ok()) {
            return $result;
        }

        dispatch(new GenerateFile($generator, $data, $this->getAgent()));

        return $result;
    }
public function generate(FileGenerator $generator, array $data = [])
    {
        $result = (new DataBuilderManager())->validateRaw($generator->data_builder, $data);

        if (!$result->ok()) {
            return $result;
        }

        dispatch(new GenerateFile($generator, $data, $this->getAgent()));

        return $result;
    }
public function generate ( FileGenerator $ generator , array $ data = [ ] ) { $ result = ( new DataBuilderManager ( ) ) -> validateRaw ( $ generator -> data_builder , $ data ) ; if ( ! $ result -> ok ( ) ) { return $ result ; } dispatch ( new GenerateFile ( $ generator , $ data , $ this -> getAgent ( ) ) ) ; return $ result ; }
Request a file-generator.

@param FileGenerator $generator
@param array         $data

@return \Railken\Lem\Contracts\ResultContract
Request a file - generator .