/** * Static method to retrieve Ext.Element objects. * Uses simple caching to consistently return the same object. Automatically fixes if an object was recreated with the same id via AJAX or DOM. * To retrieve an element by Id use {@link PhpExt_Element::getById} * @param string $id The DOM node to retrieve * @return PhpExt_Element */ public static function getByDOM($domNode) { if (!PhpExt_Javascript::isJavascriptStm($domNode)) { $domNode = PhpExt_Javascript::variable($domNode); } $e = new PhpExt_Element(); $e->domNode = $domNode; $args = array($domNode); $methodSig = $e->createMethodSignature("get", $args, true); $e->createMethod = $e->getMethodInvokeStm('Ext.Element', $methodSig, true); return $e; }