Add select attribute WITH multiple options allowed programmatically

Permalink
Hey,

i want to add a page select attribute in my package with multiple options allowed:

$type = AttributeType::getByHandle('select');
$cab = CollectionAttributeKey::add($type, array('akHandle' => 'attribute_key_handle', 'akName' => 'Attribute Name', 'akIsSearchable' => true), $pkg);
// 2DO: allow multiple options to be selected ;)


How can i achieve this?

Thanks in advance,
Matthias

programmieraffe
 
programmieraffe replied on at Permalink Reply
programmieraffe
Ah, found it ('akSelectAllowMultipleValues' => true):

CollectionAttributeKey::add($select, array('akHandle' => $this->pkgHandle . '_' . 'event_categories', 'akName' => t('Event: Kategorien'), 'akIsSearchable' => true, 'akSelectAllowMultipleValues' => true), $pkg)->setAttributeSet($keySet);