check_target(); $result = []; $result['name'] = $this->target->name; if ($this->target->has_id()) { $result['id'] = $this->target->get_id(); } return $result; } public function load_array(array $target) : self { $this->check_all_exists($target, ['name']); $this->target = new group($this->id_or_null($target)); $this->target->name = $target['name']; return $this; } }