src/sap.m/src/sap/m/ViewSettingsDialog.js
function findViewSettingsItemByKey(vItemOrKey, aViewSettingsItems, sErrorMessage) {
		var oItem;

		// convenience, also allow strings
		if (typeof vItemOrKey === "string") {
			// find item with this key
			oItem = getViewSettingsItemByKey(aViewSettingsItems, vItemOrKey);

			if (!oItem) {
				Log.error(sErrorMessage);
			}
		} else {
			oItem = vItemOrKey;
		}

		return oItem;
	}
function findViewSettingsItemByKey(vItemOrKey, aViewSettingsItems, sErrorMessage) {
		var oItem;

		// convenience, also allow strings
		if (typeof vItemOrKey === "string") {
			// find item with this key
			oItem = getViewSettingsItemByKey(aViewSettingsItems, vItemOrKey);

			if (!oItem) {
				Log.error(sErrorMessage);
			}
		} else {
			oItem = vItemOrKey;
		}

		return oItem;
	}
function findViewSettingsItemByKey ( vItemOrKey , aViewSettingsItems , sErrorMessage ) { var oItem ; // convenience, also allow strings if ( typeof vItemOrKey === "string" ) { // find item with this key oItem = getViewSettingsItemByKey ( aViewSettingsItems , vItemOrKey ) ; if ( ! oItem ) { Log . error ( sErrorMessage ) ; } } else { oItem = vItemOrKey ; } return oItem ; }
Finds an sap.m.ViewSettingsItem from a list of items by a given key.
If it does not succeed logs an error.

@param {sap.m.ViewSettingsItem|string} vItemOrKey The searched item or its key
@param {array} aViewSettingsItems The list of sap.m.ViewSettingsItem objects to be searched
@param {string} sErrorMessage The error message that will be logged if the item is not found
@returns {*} The sap.m.ViewSettingsItem found in the list of items
@private
Finds an sap . m . ViewSettingsItem from a list of items by a given key . If it does not succeed logs an error .