public function add($autodate = true, $null_values = false) { $this->position = CMSCategory::getLastPosition((int) $this->id_parent); $this->level_depth = $this->calcLevelDepth(); foreach ($this->name as $k => $value) { if (preg_match('/^[1-9]\\./', $value)) { $this->name[$k] = '0' . $value; } } $ret = parent::add($autodate, $null_values); $this->cleanPositions($this->id_parent); return $ret; }