DirectorDatafield: Properly cache category in getCategory()

Makes `getCategoryName()` work.
This commit is contained in:
Johannes Meyer 2021-12-14 09:04:56 +01:00
parent bf591093d8
commit 9919b65fc5

View File

@ -74,7 +74,8 @@ class DirectorDatafield extends DbObjectWithSettings
if ($this->category) { if ($this->category) {
return $this->category; return $this->category;
} elseif ($id = $this->get('category_id')) { } elseif ($id = $this->get('category_id')) {
return DirectorDatafieldCategory::loadWithAutoIncId($id, $this->getConnection()); $this->category = DirectorDatafieldCategory::loadWithAutoIncId($id, $this->getConnection());
return $this->category;
} else { } else {
return null; return null;
} }