/**
* Get module by id
*
* @param string $id The id of the module
*
* @return \stdClass The Module object
*
* @since 3.9.0
*/
public static function &getModuleById($id)
{
$modules =& static::load();
$total = \count($modules);
for ($i = 0; $i < $total; $i++) {
// Match the id of the module
if ((string) $modules[$i]->id === $id) {
// Found it
return $modules[$i];
}
}
// If we didn't find it, create a dummy object
$result = static::createDummyModule();
return $result;
}