valueProcessor = $valueProcessor; parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** * Add paths filter to collection * * @param array $paths * @return $this */ public function addPathsFilter(array $paths) { $this->addFieldToFilter('path', ['in' => $paths]); return $this; } /** * Add scope ID filter to collection * * @param int $scopeId * @return $this */ public function addScopeIdFilter($scopeId) { $this->addFieldToFilter('scope_id', (int)$scopeId); return $this; } /** * @inheritDoc */ protected function _afterLoad() { foreach ($this->_items as $item) { $item->setData( 'value', $this->valueProcessor->process( $item->getData('value'), $this->getData('scope'), $this->getData('scope_id'), $item->getData('path') ) ); } parent::_afterLoad(); } }