function save(eModule &$eModule) { try { if ($eModule->isEmpty()) { $eModule->id = $this->genId(); $this->insert($eModule->toData()); Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_INSERT); } else { $this->update($eModule->toData(FALSE), $eModule->id); Helper_App_Log::write($this->lastQuery(), FALSE, Helper_App_Log::LOG_UPDATE); } } catch (Exception $e) { throw new Exception($e->getMessage()); } }
public function setModuleEntity(eModule $eModule) { if ($eModule->isEmpty()) { return; } if (!empty($eModule->id)) { $this->id_module = $eModule->id; } if (!empty($eModule->id_parent)) { $this->id_parent_module = $eModule->id_parent; } $this->name = $eModule->name; $this->name_key = $eModule->name_key; $this->description = $eModule->description; }