Permalink
Browse files

Remove unused nap code in metadata retrieval. The same can be achieve…

…d by passing the object directly
  • Loading branch information...
flack committed Dec 5, 2018
1 parent 440e2c5 commit af0c743110c8c56163b3322bffa753036d759787
Showing with 1 addition and 11 deletions.
  1. +1 −11 lib/midcom/helper/metadata.php
@@ -531,10 +531,8 @@ public function unapprove()
* - Any class derived from MidgardObject, you must only ensure, that the parameter
* and guid member functions stays available.
* - Any valid GUID
* - Any NAP object structure, the content object is deduced from MIDCOM_NAV_GUID in
* this case.
*
* @param mixed $source The object to attach to, this may be either a MidgardObject, a GUID or a NAP data structure (node or leaf).
* @param mixed $source The object to attach to, this may be either a MidgardObject or a GUID.
* @return midcom_helper_metadata The created metadata object.
*/
public static function retrieve($source)
@@ -544,14 +542,6 @@ public static function retrieve($source)
if (is_object($source)) {
$object = $source;
$guid = $source->guid;
} elseif (is_array($source)) {
if ( !array_key_exists(MIDCOM_NAV_GUID, $source)
|| is_null($source[MIDCOM_NAV_GUID])) {
debug_print_r('We got an invalid input, cannot return metadata:', $source);
return false;
}
$guid = $source[MIDCOM_NAV_GUID];
$object = $source[MIDCOM_NAV_OBJECT];
} else {
$guid = $source;
}

0 comments on commit af0c743

Please sign in to comment.