Skip to content

Commit 2955660

Browse files
committed
Fix ability to use data injection for generated objects; fixes #210
1 parent 187e818 commit 2955660

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

objects/objectinjection.class.tpl

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,26 @@ class %%INJECTIONCLASS%% extends %%CLASSNAME%%
7070
return $lib->getInjectionResults();
7171
}
7272

73+
/**
74+
* Get search options formatted for injection mapping usage in datainjection plugin.
75+
*
76+
* @return array
77+
*/
7378
function getOptions($primary_type = '') {
74-
$parent = get_parent_class($this);
75-
$parentclass = new $parent();
76-
return $parentclass->getObjectSearchOptions(true);
79+
$plugin = new Plugin();
80+
if (!$plugin->isActivated('datainjection')) {
81+
return [];
82+
}
83+
84+
return PluginDatainjectionCommonInjectionLib::addToSearchOptions(
85+
Search::getOptions(get_parent_class($this)),
86+
[
87+
'ignore_fields' => PluginDatainjectionCommonInjectionLib::getBlacklistedOptions(
88+
get_parent_class($this)
89+
),
90+
],
91+
$this
92+
);
7793
}
7894

7995
}

0 commit comments

Comments
 (0)