eZ\Publish\Core\REST\Common\FieldTypeProcessorRegistry::getProcessor PHP Method

getProcessor() public method

Returns the processor for $fieldTypeIdentifier.
public getProcessor ( string $fieldTypeIdentifier ) : FieldTypeProcessor
$fieldTypeIdentifier string
return FieldTypeProcessor
    public function getProcessor($fieldTypeIdentifier)
    {
        if (!$this->hasProcessor($fieldTypeIdentifier)) {
            throw new \RuntimeException("No field type processor for '{$fieldTypeIdentifier}' found.");
        }
        return $this->processors[$fieldTypeIdentifier];
    }

Usage Example

 public function testRegisterProcessorsOverwrite()
 {
     $registry = new FieldTypeProcessorRegistry();
     $processorA = $this->getAProcessorMock();
     $processorB = $this->getAProcessorMock();
     $registry->registerProcessor('my-type', $processorA);
     $registry->registerProcessor('my-type', $processorB);
     $this->assertSame($processorB, $registry->getProcessor('my-type'));
 }
All Usage Examples Of eZ\Publish\Core\REST\Common\FieldTypeProcessorRegistry::getProcessor