/** * @param string $modelId * @param EntityPerPage $entityPerPage * @param TermIndex $termIndex * @param EntityContentDataCodec $contentCodec * @param EntityConstraintProvider $constraintProvider * @param ValidatorErrorLocalizer $errorLocalizer * @param EntityIdParser $entityIdParser * @param callable|null $legacyExportFormatDetector Callback to determine whether a serialized * blob needs to be re-serialized on export. The callback must take two parameters, * the blob an the serialization format. It must return true if re-serialization is needed. * False positives are acceptable, false negatives are not. * * @throws InvalidArgumentException */ public function __construct($modelId, EntityPerPage $entityPerPage, TermIndex $termIndex, EntityContentDataCodec $contentCodec, EntityConstraintProvider $constraintProvider, ValidatorErrorLocalizer $errorLocalizer, EntityIdParser $entityIdParser, $legacyExportFormatDetector = null) { $formats = $contentCodec->getSupportedFormats(); parent::__construct($modelId, $formats); if ($legacyExportFormatDetector && !is_callable($legacyExportFormatDetector)) { throw new InvalidArgumentException('$legacyExportFormatDetector must be a callable (or null)'); } $this->entityPerPage = $entityPerPage; $this->termIndex = $termIndex; $this->contentCodec = $contentCodec; $this->constraintProvider = $constraintProvider; $this->errorLocalizer = $errorLocalizer; $this->entityIdParser = $entityIdParser; $this->legacyExportFormatDetector = $legacyExportFormatDetector; }