Example #1
0
 /**
  * 
  * @return array
  */
 public function getUrls()
 {
     if (is_null($this->urls)) {
         $this->urls = array();
         $extractorClass = $this->configuration->getExtractorClassForType($this->getType());
         if (is_null($extractorClass)) {
             return array();
         }
         $extractor = new $extractorClass();
         $urls = $extractor->extract($this->getContent());
         foreach ($urls as $url) {
             $normalisedUrl = (string) new NormalisedUrl($url);
             if (!array_key_exists($normalisedUrl, $this->urls)) {
                 $this->urls[$normalisedUrl] = true;
             }
         }
     }
     return array_keys($this->urls);
 }