From: Michael M Slusarz Date: Tue, 18 Nov 2008 21:11:07 +0000 (-0700) Subject: Return success status for remove/alter. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c8fe2540bec70a21b0e52c53589b37e6631ff3e1;p=horde.git Return success status for remove/alter. --- diff --git a/framework/Mime/lib/Horde/Mime/Part.php b/framework/Mime/lib/Horde/Mime/Part.php index 022caca8b..aaf2d3fe2 100644 --- a/framework/Mime/lib/Horde/Mime/Part.php +++ b/framework/Mime/lib/Horde/Mime/Part.php @@ -580,10 +580,12 @@ class Horde_Mime_Part * Remove a subpart. * * @param string $id The MIME ID to delete. + * + * @param boolean Success status. */ public function removePart($id) { - $this->_partAction($id, 'remove'); + return $this->_partAction($id, 'remove'); } /** @@ -591,10 +593,12 @@ class Horde_Mime_Part * * @param string $id The MIME ID to alter. * @param Horde_Mime_Part $mime_part The MIME part to store. + * + * @param boolean Success status. */ public function alterPart($id, $mime_part) { - $this->_partAction($id, 'alter', $mime_part); + return $this->_partAction($id, 'alter', $mime_part); } /** @@ -606,8 +610,7 @@ class Horde_Mime_Part * 'remove', or 'alter'). * @param Horde_Mime_Part $mime_part The object to use for 'alter'. * - * @return mixed For 'get', a pointer to the Horde_Mime_Part object, or - * null if the object is not found. + * @return mixed See calling functions. */ protected function _partAction($id, $action, $mime_part = null) { @@ -629,7 +632,7 @@ class Horde_Mime_Part case 'alter': $mime_part->setMimeId($this->_parts[$val]->getMimeId()); $this->_parts[$val] = $mime_part; - return; + return true; case 'get': return $this->_parts[$val]; @@ -637,14 +640,14 @@ class Horde_Mime_Part case 'remove': unset($this->_parts[$val]); $this->_reindex = true; - return; + return true; } } elseif (strpos($id, $partid) === 0) { return $this->_parts[$val]->_partAction($id, $action, $mime_part); } } - return null; + return ($action == 'get') ? null : false; } /**