public function type(string $readModelType)
    {
        if (!is_subclass_of($readModelType, IReadModel::class, true)) {
            throw InvalidArgumentException::format(
                'Invalid class supplied to read model mapper definition: expecting instance of %s, %s given',
                IReadModel::class, $readModelType
            );
        }

        $this->readDefinition->type($readModelType);
        /** @var string|IReadModel|TypedObject $readModelType */
        $this->class = $readModelType::definition();
    }
public function type(string $readModelType)
    {
        if (!is_subclass_of($readModelType, IReadModel::class, true)) {
            throw InvalidArgumentException::format(
                'Invalid class supplied to read model mapper definition: expecting instance of %s, %s given',
                IReadModel::class, $readModelType
            );
        }

        $this->readDefinition->type($readModelType);
        /** @var string|IReadModel|TypedObject $readModelType */
        $this->class = $readModelType::definition();
    }
public function type ( string $ readModelType ) { if ( ! is_subclass_of ( $ readModelType , IReadModel :: class , true ) ) { throw InvalidArgumentException :: format ( 'Invalid class supplied to read model mapper definition: expecting instance of %s, %s given' , IReadModel :: class , $ readModelType ) ; } $ this -> readDefinition -> type ( $ readModelType ) ; /** @var string|IReadModel|TypedObject $readModelType */ $ this -> class = $ readModelType :: definition ( ) ; }
Defines the read model type

@param string $readModelType

@return void
@throws InvalidArgumentException
Defines the read model type