From d84bf834190798003cf707d861ba7e2c6073a6b9 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 23 Jul 2016 21:00:57 +0200 Subject: [PATCH] Created function File->setTitle(str) --- classes/File.php | 7 +++++++ 1 file changed, 7 insertions(+) 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)) { -- 2.39.5