]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Created function File->setTitle(str)
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 23 Jul 2016 19:00:57 +0000 (21:00 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 23 Jul 2016 19:00:57 +0000 (21:00 +0200)
classes/File.php

index 7bd7da27ba5b96b7a8fcefbc0d9b12f54c444b85..b0da3f09f3e418548f6e9827707d61f5f7251702 100644 (file)
@@ -693,6 +693,13 @@ class File extends Managed_DataObject
         return $title ?: null;
     }
 
+    public function setTitle($title)
+    {
+        $orig = clone($this);
+        $this->title = mb_strlen($title) > 0 ? $title : null;
+        return $this->update($orig);
+    }
+
     static public function hashurl($url)
     {
         if (empty($url)) {