From 02c7a5c62c8dc5ab9e50278c096f302b0e58b7a4 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 2 Jul 2015 14:10:40 +0200 Subject: [PATCH] DbObject: don't ->getId() for ->id --- library/Director/Data/Db/DbObject.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/Director/Data/Db/DbObject.php b/library/Director/Data/Db/DbObject.php index c7c28f6b..d0b950e4 100644 --- a/library/Director/Data/Db/DbObject.php +++ b/library/Director/Data/Db/DbObject.php @@ -212,7 +212,8 @@ abstract class DbObject if (substr($func, -2) === '[]') { $func = substr($func, 0, -2); } - if (method_exists($this, $func)) { + // TODO: id check avoids collision with getId. Rethink this. + if ($property !== 'id' && method_exists($this, $func)) { return $this->$func(); }