public function getId() { if (isset($this->id)) { return $this->id; } $id = parent::getFullyQualifiedName(); // Bail early if no array notation detected if (!strstr($id, '[')) { return $id; } // Strip array notation if ('[]' == substr($id, -2)) { $id = substr($id, 0, strlen($id) - 2); } $id = str_replace('][', '-', $id); $id = str_replace(array(']', '['), '-', $id); $id = trim($id, '-'); return $id; }