public function getTool($toolId, $instanceId) { foreach ($this->getToolAll() as $id => $class) { if ($toolId === $id) { return $this->container->make($class, ['instanceId' => $instanceId]); } } return null; }
/** * Get activated tools for the editor * * @return AbstractTool[] */ public function getTools() { if ($this->tools === null) { $this->tools = []; foreach ($this->getActivateToolIds() as $toolId) { if ($tool = $this->editors->getTool($toolId, $this->instanceId)) { $this->tools[] = $tool; } } } return $this->tools; }