original_string: protected function vcard_get_handler($xml) {
  		$vcard_array = array();
  		$vcard = $xml->sub('vcard');
  		// go through all of the sub elements and add them to the vcard array
  		foreach ($vcard->subs as $sub) {
  			if ($sub->subs) {
  				$vcard_array[$sub->name] = array();
  				foreach ($sub->subs as $sub_child) {
  					$vcard_array[$sub->name][$sub_child->name] = $sub_child->data;
  				}
  			} else {
  				$vcard_array[$sub->name] = $sub->data;
  			}
  		}
  		$vcard_array['from'] = $xml->attrs['from'];
  		$this->event('vcard', $vcard_array);
  	}
code: protected function vcard_get_handler($xml) {
  		$vcard_array = array();
  		$vcard = $xml->sub('vcard');
  		// go through all of the sub elements and add them to the vcard array
  		foreach ($vcard->subs as $sub) {
  			if ($sub->subs) {
  				$vcard_array[$sub->name] = array();
  				foreach ($sub->subs as $sub_child) {
  					$vcard_array[$sub->name][$sub_child->name] = $sub_child->data;
  				}
  			} else {
  				$vcard_array[$sub->name] = $sub->data;
  			}
  		}
  		$vcard_array['from'] = $xml->attrs['from'];
  		$this->event('vcard', $vcard_array);
  	}
code_tokens: protected function vcard_get_handler ( $ xml ) { $ vcard_array = array ( ) ; $ vcard = $ xml -> sub ( 'vcard' ) ; // go through all of the sub elements and add them to the vcard array foreach ( $ vcard -> subs as $ sub ) { if ( $ sub -> subs ) { $ vcard_array [ $ sub -> name ] = array ( ) ; foreach ( $ sub -> subs as $ sub_child ) { $ vcard_array [ $ sub -> name ] [ $ sub_child -> name ] = $ sub_child -> data ; } } else { $ vcard_array [ $ sub -> name ] = $ sub -> data ; } } $ vcard_array [ 'from' ] = $ xml -> attrs [ 'from' ] ; $ this -> event ( 'vcard' , $ vcard_array ) ; }
docstring: VCard retrieval handler
  
  @param XML Object $xml
docstring_tokens: VCard retrieval handler