/** * Subroutine for buildLink and buildSample * * @param Sample $resourceData * @param SampleInterface $dataObject * @return null */ protected function setBasicFields($resourceData, $dataObject) { $dataObject->setId($resourceData->getId()); $storeTitle = $resourceData->getStoreTitle(); $title = $resourceData->getTitle(); if (!empty($storeTitle)) { $dataObject->setTitle($storeTitle); } else { $dataObject->setTitle($title); } $dataObject->setSortOrder($resourceData->getSortOrder()); $dataObject->setSampleType($resourceData->getSampleType()); $dataObject->setSampleFile($resourceData->getSampleFile()); $dataObject->setSampleUrl($resourceData->getSampleUrl()); }
/** * Subroutine for buildLink and buildSample * * @param \Magento\Downloadable\Model\Link|\Magento\Downloadable\Model\Sample $resourceData * @param Data\DownloadableLinkInfoBuilder|Data\DownloadableSampleInfoBuilder $builder * @return null */ protected function setBasicFields($resourceData, $builder) { $builder->populateWithArray([]); $builder->setId($resourceData->getId()); $storeTitle = $resourceData->getStoreTitle(); $title = $resourceData->getTitle(); if (!empty($storeTitle)) { $builder->setTitle($storeTitle); } else { $builder->setTitle($title); } $builder->setSortOrder($resourceData->getSortOrder()); $builder->setSampleResource($this->entityInfoGenerator('sample', $resourceData)); }