callBehavior('addTranslaterProposalTool', $this); } public function addTool($id) { if (!class_exists($id)) { return; } $r = new ReflectionClass($id); $p = $r->getParentClass(); if (!$p || $p->name != 'translaterProposalTool') { return; } $this->stack[$id] = new $id(); } public function getTools() { return $this->stack; } public function getTool($id) { return array_key_exists($id, $this->stack) ? $this->stack[$id] : null; } public function hasTool($id) { return array_key_exists($id, $this->stack); } }