private function _resolve_object_title() { if (method_exists($this->_object, 'get_label')) { return $this->_object->get_label(); } $vars = get_object_vars($this->_object->__object); if (array_key_exists('title', $vars)) { return $this->_object->title; } else { if (array_key_exists('name', $vars)) { return $this->_object->name; } else { return "#{$this->_object->id}"; } } }