public function build(StoreModel $entity = null) { $do = new StoreDO(); if ($entity) { $entityData = $entity->toArray(); $entityData['views'] = $this->storeViewBuilder->buildThem($entity->views); $entityData['attribute_sets'] = $this->attributeSetBuilder->buildThem($entity->attributeSets); $do->update($entityData); } return $do; }
public function handle(CreateStoreDO $do) { $store = new StoreModel(); $store->label = $do->label; $store->save(); }