1 <?php
2
3 4 5 6 7 8
9 class CatalogMemberDecorator extends DataObjectDecorator {
10 function () {
11 return array(
12 'db' => array(
13 'CatalogOptions' => 'Varchar(255)',
14 )
15 );
16 }
17
18 19 20 21 22 23 24
25 function getCatalogOption($name) {
26 $options = @unserialize($this->owner->CatalogOptions);
27 if (!$options || !is_array($options) || !isset($options[$name]))
28 return;
29 return $options[$name];
30 }
31
32 33 34 35 36 37
38 function setCatalogOption($name, $val) {
39 $options = @unserialize($this->owner->CatalogOptions);
40 if (!$options || !is_array($options))
41 $options = array();
42 $options[$name] = $val;
43 $this->owner->CatalogOptions = serialize($options);
44 if ($this->owner->isChanged('CatalogOptions'))
45 $this->owner->write();
46 }
47 }
[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the
Silverstripe Forums to ask development related questions.
-