Writes the precursor ion and it's associated fragments to the file associated with this instance

@param PrecursorIon $precursor
The precursor ion to write
16596
public function write(PrecursorIon $precursor)
    {
        if (is_null($this->fileHandle)) {
            throw new \BadMethodCallException('The file handle is closed. Cannot write after close() has been called.');
        }
        
        // TODO: Validate mandatory/optional fields
        fwrite($this->fileHandle, 'BEGIN IONS' . PHP_EOL);
        fwrite($this->fileHandle, 'TITLE=' . $precursor->getTitle() . PHP_EOL);
        fwrite($this->fileHandle, 'PEPMASS=' . $precursor->getMonoisotopicMassCharge());
        if (! is_null($precursor->getIntensity())) {
            fwrite($this->fileHandle, ' ' . $precursor->getIntensity());
        }
        
        fwrite($this->fileHandle, PHP_EOL);
        fwrite($this->fileHandle, 'CHARGE=' . $precursor->getCharge() . '+' . PHP_EOL);
        
        if (! is_null($precursor->getScan())) {
            fwrite($this->fileHandle, 'SCANS=' . $precursor->getScan() . PHP_EOL);
        }
        
        if (! is_null($precursor->getRetentionTime())) {
            if ($precursor->hasRetentionTimeWindow()) {
                fwrite($this->fileHandle, 'RTINSECONDS=' . implode(',', $precursor->getRetentionTimeWindow()) . PHP_EOL);
            } else {
                fwrite($this->fileHandle, 'RTINSECONDS=' . $precursor->getRetentionTime() . PHP_EOL);
            }
        }
        
        foreach ($precursor->getFragmentIons() as $ion) {
            fwrite($this->fileHandle, $ion->getMonoisotopicMassCharge() . ' ');
            fwrite($this->fileHandle, $ion->getIntensity());
            
            if (! is_null($ion->getCharge()) && $ion->getCharge() != 1) {
                fwrite($this->fileHandle, ' ' . $ion->getCharge());
            }
            
            fwrite($this->fileHandle, PHP_EOL);
        }
        
        fwrite($this->fileHandle, 'END IONS' . PHP_EOL);
    }
1185422
public function beforeRun(SourceSetEvent $sourceSetEvent): void
    {
        /** @var SourceInterface $source */
        foreach ($sourceSetEvent->updatedSources() as $source) {
            foreach ($this->extensions as $extension) {
                if (fnmatch("*.{$extension}", $source->filename())) {
                    $source->data()->append('converters', SculpinTextileBundle::CONVERTER_NAME);
                    break;
                }
            }
        }
    }
96917
public function writeDocument( array $document )
    {
        fwrite( $this->stream, "--" . $this->boundary . "\r\n" );
        if ( isset( $document['_attachments'] ) )
        {
            $this->writeMultipartDocument( $document );
        }
        else
        {
            $this->writeSimpleDocument( $document );
        }
    }
961623
public function onWriteOnce($cb)
    {
        if (!$this->writing) {
            $cb($this);
            return;
        }
        $this->onWriteOnce->push($cb);
    }
1115903
protected function appendChildren(DOMDocumentFragment $fragment, QtiComponent $component, $base = '')
    {
        foreach ($this->getRenderingEngine()->getChildrenRenderings($component) as $childrenRendering) {
            $fragment->firstChild->appendChild($childrenRendering);
        }
    }
745303
public function write($sLine)
    {
        $sLine = $this->removeSID($sLine);
        $sLine = str_replace(["\r\n", "\n"], "", $sLine);
        fwrite($this->fpFile, $sLine . "\r\n");
    }
15792
public function setPriority($priority=1)
    {

        $node = $this->getPriority(false);
        if(!$node){
            $node = $this->createElement('priority');
            $this->doc->appendChild($node);
        }
        $node->nodeValue = htmlspecialchars($priority);

    }
559269
public function persist($entity)
    {
        if ($this->evm->hasListeners(Events::prePersist)) {
            $this->evm->dispatchEvent(Events::prePersist, new Event\LifecycleEventArgs($entity, $this->sm));
        }

        $oid = spl_object_hash($entity);
        $this->scheduledForPersist[$oid] = $entity;

        if ($this->evm->hasListeners(Events::postPersist)) {
            $this->evm->dispatchEvent(Events::postPersist, new Event\LifecycleEventArgs($entity, $this->sm));
        }
    }
573996
public function attach(EventManagerInterface $events, $priority = 1)
    {
        $events->attach(PageEvent::EVENT_ADD_PRE, [$this, 'setStandardParams']);
        $events->attach(PageEvent::EVENT_EDIT_PRE, [$this, 'setStandardParams']);
        $events->attach(PageEvent::EVENT_APPROVED, [$this, 'setStandardParams']);

        $events->attach(PageEvent::EVENT_ADD_PRE, [$this, 'setSlug']);
        $events->attach(PageEvent::EVENT_EDIT_PRE, [$this, 'setSlug']);
        $events->attach(PageEvent::EVENT_APPROVED, [$this, 'setSlug']);

        $events->attach(PageEvent::EVENT_APPROVED, [$this, 'saveNavigation']);

        $events->attach(PageEvent::EVENT_APPROVED, [$this, 'updateCache']);
    }
1309127
public function writeLink($target)
    {
        $fileName = basename($target);
        $realTarget = realpath($target);
        $relativePathToTarget = $this->makePathRelative(dirname($realTarget), $this->binaryDir).basename($realTarget);

        // If Windows cmd link
        if (pathinfo($target, PATHINFO_EXTENSION) == "cmd") {
            $this->writeWindows($fileName, $relativePathToTarget);
        } else {
            $this->writeBash($fileName, $relativePathToTarget);
        }
    }
1341794
public function attach(string $fqcn, FilterInterface $filter, int $priority = self::DEFAULT_PRIORITY): void
    {
        $chain = $this->factory->getChainFor($fqcn);
        $chain->attach($filter, $priority);
    }
1000445
public function writePoFile(string $file): void
    {
        $source = $this->dumpString();
        $testName = file_exists($file) ? $file : dirname($file);
        $status = is_writable($testName);
        if ($status === true) {
            $status = file_put_contents($file, $source);
        }
        if (false === $status) {
            throw new FileNotWritableException($file);
        }
    }
691534
public function clientWrite($filename, $source)
    {
        $path = $this->clientPath($filename);
        file_put_contents($path, $source);
    }
1310956
public function write($export, TemporaryFile $temporaryFile, string $writerType): TemporaryFile
    {
        $this->exportable = $export;

        $this->spreadsheet->setActiveSheetIndex(0);

        $this->raise(new BeforeWriting($this, $this->exportable));

        $writer = WriterFactory::make(
            $writerType,
            $this->spreadsheet,
            $export
        );

        $writer->save(
            $path = $temporaryFile->getLocalPath()
        );

        if ($temporaryFile instanceof RemoteTemporaryFile) {
            $temporaryFile->updateRemote();
        }

        $this->spreadsheet->disconnectWorksheets();
        unset($this->spreadsheet);

        return $temporaryFile;
    }
930251
def write(self, proto):
    
    regionImpl = proto.regionImpl.as_struct(self.getSchema())
    self.writeToProto(regionImpl)
1022331
public function prepend(ContainerBuilder $container): void
    {
        // get all Bundles
        $bundles = $container->getParameter('kernel.bundles');
        // determine if McfedrQueueManagerBundle is registered
        if (isset($bundles['McfedrQueueManagerBundle'])) {
            $container->prependExtensionConfig('mcfedr_queue_manager', [
                'drivers' => [
                    'periodic' => [
                        'class' => PeriodicQueueManager::class,
                        'options' => [
                            'delay_manager' => null,
                            'delay_manager_options' => [],
                        ],
                    ],
                    'beanstalkd' => [
                        'class' => BeanstalkQueueManager::class,
                        'options' => [
                            'host' => '127.0.0.1',
                            'port' => 11300,
                            'default_queue' => 'default',
                            'connection' => [
                                'timeout' => 2,
                                'persistent' => false,
                            ],
                        ],
                        'command_class' => BeanstalkCommand::class,
                    ],
                    'doctrine_delay' => [
                        'class' => DoctrineDelayQueueManager::class,
                        'options' => [
                            'entity_manager' => null,
                            'default_manager' => null,
                            'default_manager_options' => [],
                        ],
                        'command_class' => DoctrineDelayRunnerCommand::class,
                    ],
                    'sqs' => [
                        'class' => SqsQueueManager::class,
                        'options' => [
                            'queues' => [],
                        ],
                        'command_class' => SqsRunnerCommand::class,
                    ],
                ],
            ]);
        }
    }
488791
public function write(OutputInterface $output): void
    {
        $outputPath = $this->outputDir.'/'.$output->permalink()->relativeFilePath();
        if ($output->hasFileReference()) {
            $this->filesystem->copy($output->file(), $outputPath, true);
        } else {
            $this->filesystem->mkdir(dirname($outputPath));
            $this->filesystem->dumpFile($outputPath, $output->formattedContent());
        }
    }