/** Adds an option
* @param array &$options where the option is to be added to
* @param Object $obj of $type
* @param string $type of $object
* @param PntStringConverter $cnv initialized to convert id and $obj toLabel and toHtml
* @param PntPropertyDescriptor $idProp to derive the id from the object
*/
function (&$options, $obj, $type, $cnv, $idProp) {
$id = $cnv->( $idProp->($obj), $idProp->() );
$label = $cnv->($obj, $type);
$options[$id] = $cnv->($label, false, 2);
$this->optionsMaxLength = max($this->optionsMaxLength, strLen($label));
return $id == $this->();
}
|