shoppingmallv2 init...

This commit is contained in:
최준흠 2023-08-03 14:07:37 +09:00
parent 3a1303a08d
commit e9d2f577d0
4 changed files with 49 additions and 13 deletions

View File

@ -51,11 +51,21 @@ class BoardConfigModel extends BaseModel
}
return $rules;
}
public function getEntity($conditions): BoardConfigEntity
//Form 선택용 Options Data용
public function getOptions(array $conditions = array(), $options = array()): array
{
return parent::getEntity($conditions);
foreach ($this->getEntitys($conditions) as $entity) {
// STATUS가 use가 아닐때 option을 disabled되게 하기위함
if ($entity->getStatus() != DEFAULTS['STATUS']) {
$options[$entity->getPrimaryKey() . "\" disabled=\"disabled"] = $entity->getTitle();
} else {
$options[$entity->getPrimaryKey()] = $entity->getTitle();
}
}
return $options;
}
//Field별 Form Option용
protected function changeFormData(string $action, string $field, array $formDatas, $entity)
{
switch ($field) {
@ -82,6 +92,11 @@ class BoardConfigModel extends BaseModel
}
return $entity;
}
public function getEntity($conditions): BoardConfigEntity
{
return parent::getEntity($conditions);
}
public function create(array $formDatas): BoardConfigEntity
{
return $this->create_process(new BoardConfigEntity(), $formDatas);

View File

@ -40,11 +40,7 @@ class CategoryModel extends BaseHierarchyModel
return $rules;
}
public function getEntity($conditions): CategoryEntity
{
return parent::getEntity($conditions);
}
//Form 선택용 Options Data용
public function getOptions(array $conditions = array(), $options = array()): array
{
//대분류 부분은 선택이 되지 않게 하기위해 따로 만듬 (form_dropdown의 optgroup 기능)
@ -54,12 +50,22 @@ class CategoryModel extends BaseHierarchyModel
$options[$entity->getTitle()] = [];
$old_title = $entity->getTitle();
} else {
$options[$old_title][$entity->getPrimaryKey()] = $entity->getTitle();
// STATUS가 use가 아닐때 option을 disabled되게 하기위함
if ($entity->getStatus() != DEFAULTS['STATUS']) {
$options[$old_title][$entity->getPrimaryKey() . "\" disabled=\"disabled"] = $entity->getTitle();
} else {
$options[$old_title][$entity->getPrimaryKey()] = $entity->getTitle();
}
}
}
return $options;
}
public function getEntity($conditions): CategoryEntity
{
return parent::getEntity($conditions);
}
public function create(array $formDatas): CategoryEntity
{
return $this->create_process(new CategoryEntity(), $formDatas);

View File

@ -60,7 +60,19 @@ class ProductModel extends BaseModel
}
return $rules;
}
//Form 선택용 Options Data용
public function getOptions(array $conditions = array(), $options = array()): array
{
foreach ($this->getEntitys($conditions) as $entity) {
// STATUS가 use가 아닐때 option을 disabled되게 하기위함
if ($entity->getStatus() != DEFAULTS['STATUS']) {
$options[$entity->getPrimaryKey() . "\" disabled=\"disabled"] = $entity->getTitle();
} else {
$options[$entity->getPrimaryKey()] = $entity->getTitle();
}
}
return $options;
}
//Field별 Form Option용
public function getFieldFormOption(string $field): array
{

View File

@ -54,10 +54,7 @@ class UserModel extends BaseModel
}
return $rules;
}
public function getEntity($conditions): UserEntity
{
return parent::getEntity($conditions);
}
//Form 선택용 Options Data용
public function getOptions(array $conditions = array(), $options = array()): array
{
foreach ($this->getEntitys($conditions) as $entity) {
@ -70,6 +67,12 @@ class UserModel extends BaseModel
}
return $options;
}
public function getEntity($conditions): UserEntity
{
return parent::getEntity($conditions);
}
protected function changeFormData(string $action, string $field, array $formDatas, $entity)
{
switch ($field) {