Last active
August 29, 2015 14:22
-
-
Save signalpoint/11c144109cfbdcdbb660 to your computer and use it in GitHub Desktop.
Drupal Devel dpm() on EntityMetaDataWrapper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @see https://www.drupal.org/documentation/entity-metadata-wrappers | |
* @example usage: my_dpm($wrapped_object); | |
*/ | |
function my_dpm($w) { | |
$values = array(); | |
foreach ($w->getPropertyInfo() as $key => $val) { | |
$values[$key] = $w->$key->value(); | |
} | |
$callers = debug_backtrace(); | |
dpm($callers[1]['function']); | |
dpm($values); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment