_model = new ProductModel(); } //Category모델 final protected function getCategoryModel(): CategoryModel { return is_null($this->_categoryModel) ? new CategoryModel() : $this->_categoryModel; } //Field별 Form Option용 public function getFieldFormOption(string $field): array { switch ($field) { case 'category_uid': $options = $this->_category_uids = $this->_category_uids ?: $this->getCategoryModel()->getFieldFormOptions(['status' => 'use']); break; default: return parent::getFieldFormOption($field); break; } if (!is_array($options)) { throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true)); } return $options; } }