public function getUniqueId($type) { $this->categoriesSum++; if (empty($this->ids[$type])) { $this->ids[$type] = 1; return 1; } $this->ids[$type] += 1; return $this->ids[$type]; }