}
}
+ /**
+ * Sets an array of data into the API, ignoring things in $exclude. Keys
+ * in the array that don't exist in the API will be ignored.
+ *
+ * @param array A dictionary of field names and values to set
+ * @param array Array of keys to exclude
+ */
+ public function setArray(Array $data, $exclude = array())
+ {
+ foreach ($data as $key => $value)
+ {
+ if (in_array($key, $exclude) || !isset($this->fields[$key]))
+ {
+ continue;
+ }
+ $this->set($key, $value);
+ }
+ }
+
/**
* Sets a value, sanitizes it, and validates it
*
- Change: BSPrinterElementTable:__construct() can now take straight strings and convert them into BSPrinterElementLabel's
- New: BSPrinterRootPage::setHeaderCode() allows injecting in between the <head> tag of the root page element (creates BSPrinterRootPage::$headerCode)
- New: BSPrinterAbstract::setId() allows all elements to have an id attribute added in _prepareStyle()
+- New: Added an ability to quick-set API information via an array with BSApi::setArray()