private function getFields($module, $except = array(), $alias = '') { $result = array(); $rows = array_flip(PMSEEngineUtils::getAllFieldsBean($module)); $rows = PMSEEngineUtils::unsetCommonFields($rows, $except); foreach ($rows as $key => $value) { if (!empty($alias)) { $result[] = $alias . '.' . $key; } else { $result[] = $key; } } return $result; }
/** * Method to save record in database * @param $projectData * @return bool */ public function saveProjectData($projectData) { global $current_user; //Unset common fields $projectData = PMSEEngineUtils::unsetCommonFields($projectData, array('name', 'description')); //unset($projectData['assigned_user_id']); if (!isset($projectData['assigned_user_id'])) { $projectData['assigned_user_id'] = $current_user->id; } //Check Name of project if (isset($projectData[$this->suffix . 'name']) && !empty($projectData[$this->suffix . 'name'])) { $name = $this->getNameWithSuffix($projectData[$this->suffix . 'name']); } else { $name = $this->getNameWithSuffix($projectData[$this->name]); } $projectData[$this->name] = $name; foreach ($projectData as $key => $field) { $this->bean->{$key} = $field; } //$this->bean->new_with_id = true; //$this->bean->validateUniqueUid(); $new_id = $this->bean->save(); if (!$this->bean->in_save) { return $new_id; } else { return false; } }