public function save() { if (empty($this->id)) { ++static::$count; $this->id = static::$count; static::$nodes[$this->id] = $this->node; } else { static::$nodes[$this->id] = $this->node; } $this->isLink = false; return $this; }