/** * @param string $content * @return Tx_Asdis_Domain_Model_Asset_Collection */ public function scrape($content) { $paths = array(); $masks = array(); $matches = array(); preg_match_all('/data-src-[^=]*\\s?=\\s?([\'"])(.*?)([\'"])/i', $content, $matches); if (is_array($matches) && sizeof($matches) > 1 && is_array($matches[2])) { $paths = $matches[2]; $masks = $matches[1]; } return $this->assetFactory->createAssetsFromPaths($paths, $masks); }
/** * @param string $tagName * @param string $attributeName * @param string $content * @param array $requiredOtherAttributes * @return Tx_Asdis_Domain_Model_Asset_Collection */ protected function getAssets($tagName, $attributeName, $content, array $requiredOtherAttributes = array()) { $attributes = $this->xmlTagAttributeExtractor->getAttributeFromTag($tagName, $attributeName, $content, $requiredOtherAttributes); return $this->assetFactory->createAssetsFromPaths($attributes['paths'], $attributes['masks']); }
/** * @param $content * @return Tx_Asdis_Domain_Model_Asset_Collection */ public function scrape($content) { $urls = $this->extractUrlPaths($content); return $this->assetFactory->createAssetsFromPaths($urls['paths'], $urls['masks']); }