use getTitle method
[phorkie.git] / src / phorkie / Repository.php
index c854cf167186455fc77049914b2c32212be936de..a57239ef8097c1f014c1e880e41d593260694702 100644 (file)
@@ -180,6 +180,16 @@ class Repository
             && Tools::recursiveDelete($this->gitDir);
     }
 
+    public function getTitle()
+    {
+        $desc = $this->getDescription();
+        if (trim($desc) != '') {
+            return $desc;
+        }
+
+        return 'paste #' . $this->id;
+    }
+
     public function getDescription()
     {
         if (!is_readable($this->gitDir . '/description')) {