set detected type in pingback content
[stapibas.git] / src / stapibas / Content / Extractor.php
index 6bbfb9ed0a3ca2e8284e927bc1a372c18c2a9f7d..7de4cd56de5a79ebe2e814c60bef1e4633529517 100644 (file)
@@ -78,6 +78,7 @@ class Content_Extractor
                 . ', rc_content = ' . $this->db->quote($data['content'])
                 . ', rc_updated = NOW()'
             );
+            $this->setDetectedType($contentRow, 'comment');
             return;
         }
 
@@ -99,12 +100,23 @@ class Content_Extractor
                 . ', rl_author_image = ' . $this->db->quote($data['author_image'])
                 . ', rl_updated = NOW()'
             );
+            $this->setDetectedType($contentRow, 'link');
             return;
         }
 
+        $this->setDetectedType($contentRow, 'nothing');
         $this->log->info('Nothing found');
     }
 
+    protected function setDetectedType($contentRow, $type)
+    {
+        $this->db->exec(
+            'UPDATE pingbackcontent'
+            . ' SET pc_detected_type = ' . $this->db->quote($type)
+            . ' WHERE pc_id = ' . $this->db->quote($contentRow->pc_id)
+        );
+    }
+
 
     protected function sqlNeedsUpdate()
     {