/** * Gets the data for the edit action * @param integer $id Primary key of the data to retrieve * @return mixed Data object for the provided id */ public function getData($id) { $data = parent::getData($id); if (!$this->user || $this->user->isSuperUser()) { return $data; } elseif ($data->isSuperUser()) { $this->addWarning(self::TRANSLATION_WARNING_EDIT); return null; } return $data; }