From: Mikael Nordfeldth Date: Sat, 23 Jul 2016 19:00:57 +0000 (+0200) Subject: Created function File->setTitle(str) X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d84bf834190798003cf707d861ba7e2c6073a6b9;p=quix0rs-gnu-social.git Created function File->setTitle(str) --- diff --git a/classes/File.php b/classes/File.php index 7bd7da27ba..b0da3f09f3 100644 --- a/classes/File.php +++ b/classes/File.php @@ -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)) {