public function updateAssignedCategory() { $categoryId = $this->getProperty('category_id'); if ($categoryId) { /** @var msCategoryOption $ftCat */ $ftCat = $this->modx->getObject('msCategoryOption', array('option_id' => $this->object->get('id'), 'category_id' => $categoryId)); if ($ftCat) { $ftCat->fromArray($this->getProperties()); $ftCat->save(); } } }
/** * @param msOption $option * @return null|msOptionType */ public function getOptionType($option) { $className = $this->loadOptionType($option->get('type')); if (class_exists($className)) { return new $className($option); } else { $this->modx->log(modX::LOG_LEVEL_ERROR, 'Could not initialize miniShop2 option type class: "' . $className . '"'); return null; } }