Module: appdb Branch: master Commit: e07acae8d9bbf4506058be3e67cbab90eda95ec2 URL: http://source.winehq.org/git/appdb.git/?a=commit;h=e07acae8d9bbf4506058be3e6...
Author: Alexander Nicolaysen Sørnes alex@thehandofagony.com Date: Wed Jul 29 20:47:42 2009 +0200
note: Improve logic in object{Get,Set}Parent
---
include/note.php | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/note.php b/include/note.php index 754e585..4233ac3 100644 --- a/include/note.php +++ b/include/note.php @@ -331,6 +331,11 @@ class Note { return $iVersionId > 0; }
+ public function hasRealVersionId() + { + return note::isRealVersionId($this->iVersionId); + } + function outputEditor($aValues = null) { if($aValues) @@ -493,7 +498,7 @@ class Note {
public function objectGetParent($sClass = '') { - if($this->iVersionId) + if($this->hasRealVersionId()) return new version($this->iVersionId); else return new application($this->iAppId); @@ -501,7 +506,7 @@ class Note {
public function objectSetParent($iNewId, $sClass = '') { - if($this->iVersionId) + if($this->hasRealVersionId()) $this->iVersionId = $iNewId; else $this->iAppId = $iNewId;