public function import(ImportSpecification $specification)
{
$specification = clone $specification;
$records = $this->fetch($specification->getResource(), $specification->getCacheAdvice());
if (!$records instanceof ProviderRecords) {
$records = $this->createProviderRecords($records, $specification->getResource());
}
if ($specification->getFilter()) {
$records = $this->filter($records, $specification->getFilter(), $specification->getContext());
}
if ($specification->getMapping()) {
$records = $this->map($records, $specification->getMapping(), $specification->getContext());
}
return $this->createPorterRecords($records, $specification);
}