public function fixAlias() { foreach ($this->action_alias as $action_name => $o) { $_fn = $this->page_loader->getPageAction($this->admin_name, $action_name); if ($_fn) { throw new \Exception(sprintf("web page action `%s:%s` duplicate(alias: %s, %s) ", $this->admin_name, $action_name, $o['controller'], $_fn)); } $alias_admin = $this->page_loader->getPageGeneratorByName($o['admin']); $annot = $alias_admin->action_cache[$o['action']]; if ($alias_admin->page_parent_entity === $this->admin_class) { if ($annot->entity) { throw new \Exception(sprintf("@WebPageRoute(`%s`, entity=true) can not alias to parent @WebPageRoute(`%s:%s`, entity=true) on controller `%s`", $o['name'], $this->admin_name, $action_name, $o['controller'])); } } else { if ($this->page_parent_entity === $alias_admin->admin_class) { if (!$annot->entity) { throw new \Exception(sprintf("@WebPageRoute(`%s`, entity=false) can not alias to child @WebPageRoute(`%s:%s`) on controller `%s`", $o['name'], $this->admin_name, $action_name, $o['controller'])); } } else { throw new \Exception(sprintf("@WebPageRoute(`%s`) can not alias to @WebPageRoute(`%s:%s`) on controller `%s`", $o['name'], $this->admin_name, $action_name, $o['controller'])); } } $this->page_loader->addPageAlias($this->admin_name . ':' . $action_name, $o['name']); } }