private function checkCategoryConsistency() { if ($this->getCategory() === null) { throw new CategoryNotAssignedException(); } }