本文整理汇总了PHP中SQLQBuilder::addNewRecordFeature2方法的典型用法代码示例。如果您正苦于以下问题:PHP SQLQBuilder::addNewRecordFeature2方法的具体用法?PHP SQLQBuilder::addNewRecordFeature2怎么用?PHP SQLQBuilder::addNewRecordFeature2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SQLQBuilder
的用法示例。
在下文中一共展示了SQLQBuilder::addNewRecordFeature2方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addAdmin
/**
* Adds the given employee as a admin to the given project.
* If the employee is already an admin, the request is ignored.
*
* @param int $projectId The project ID
* @param int $empNumber The employee number
* @return true if successful
*/
public function addAdmin($projectId, $empNumber)
{
if (!CommonFunctions::isValidId($projectId) || !CommonFunctions::isValidId($empNumber)) {
throw new ProjectAdminException("Invalid parameters to addAdmin(): emp_number = {$empNumber} , " . "projectId = {$projectId}");
}
$result = true;
if (!$this->isAdmin($empNumber, $projectId)) {
$fields[0] = self::PROJECT_ADMIN_FIELD_PROJECT_ID;
$fields[1] = self::PROJECT_ADMIN_FIELD_EMP_NUMBER;
$values[0] = "'{$projectId}'";
$values[1] = "'{$empNumber}'";
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = self::TABLE_NAME;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $values;
$sqlBuilder->arr_insertfield = $fields;
$sql = $sqlBuilder->addNewRecordFeature2();
$conn = new DMLFunctions();
$result = $conn->executeQuery($sql);
if (!$result || mysql_affected_rows() != 1) {
$result = false;
} else {
$this->id = mysql_insert_id();
}
}
return $result;
}
示例2: _setValue
/**
* Sets the 'value' corresponding to 'key'
* If the 'key' is already availabe, correponding 'value' would be updated.
* If not, a new 'key', 'value' pair would be inserted.
* @param string $key 'key' field corresponding to the value to be set
* @param string $value 'value' that should be set
*/
private static function _setValue($key, $value)
{
$updateFields[0] = "`" . self::DB_FIELD_KEY . "`";
$updateFields[1] = "`" . self::DB_FIELD_VALUE . "`";
$updateValues[0] = "'" . $key . "'";
$updateValues[1] = "'" . $value . "'";
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = self::DB_TABLE_CONFIG;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $updateValues;
$sqlBuilder->arr_insertfield = $updateFields;
$query = $sqlBuilder->addNewRecordFeature2(true, true);
$dbConnection = new DMLFunctions();
$result = $dbConnection->executeQuery($query);
if (!$result) {
throw new Exception("Value corresponding to {$key} was not updated");
}
}
示例3: _insert
/**
* Add new CustomExport object to database
*/
private function _insert()
{
$fields[0] = self::DB_FIELDS_ID;
$fields[1] = self::DB_FIELDS_NAME;
$fields[2] = self::DB_FIELDS_FIELDS;
$fields[3] = self::DB_FIELDS_HEADINGS;
$this->id = UniqueIDGenerator::getInstance()->getNextID(self::TABLE_NAME, self::DB_FIELDS_ID);
$values[0] = $this->id;
$values[1] = "'{$this->name}'";
$values[2] = "'" . implode(",", $this->assignedFields) . "'";
$values[3] = empty($this->headings) ? "''" : "'" . implode(",", $this->headings) . "'";
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = self::TABLE_NAME;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $values;
$sqlBuilder->arr_insertfield = $fields;
$sql = $sqlBuilder->addNewRecordFeature2();
$conn = new DMLFunctions();
$result = $conn->executeQuery($sql);
if (!$result || mysql_affected_rows() != 1) {
throw new CustomExportException("Insert failed. {$sql}", CustomExportException::DB_EXCEPTION);
}
}
示例4: addEmpLang
function addEmpLang()
{
$arrRecordsList[0] = "'" . $this->getEmpId() . "'";
$arrRecordsList[1] = "'" . $this->getEmpLangCode() . "'";
$arrRecordsList[2] = "'" . $this->getEmpLangType() . "'";
$arrRecordsList[3] = "'" . $this->empLangRatGrd . "'";
$arrFieldList[0] = 'EMP_NUMBER';
$arrFieldList[1] = 'LANG_CODE';
$arrFieldList[2] = 'ELANG_TYPE';
$arrFieldList[3] = 'COMPETENCY';
$tableName = 'HS_HR_EMP_LANGUAGE';
$sql_builder = new SQLQBuilder();
$sql_builder->table_name = $tableName;
$sql_builder->flg_insert = 'true';
$sql_builder->arr_insertfield = $arrFieldList;
$sql_builder->arr_insert = $arrRecordsList;
$sqlQString = $sql_builder->addNewRecordFeature2(true, true);
$dbConnection = new DMLFunctions();
$message2 = $dbConnection->executeQuery($sqlQString);
//Calling the addData() function
return $message2;
}
示例5: _insert
private function _insert()
{
$fields[0] = self::DB_FIELD_WORKSHIFT_ID;
$fields[1] = self::DB_FIELD_NAME;
$fields[2] = self::DB_FIELD_HOURS;
$this->workshiftId = UniqueIDGenerator::getInstance()->getNextID(self::WORKSHIFT_TABLE, self::DB_FIELD_WORKSHIFT_ID);
$values[0] = $this->workshiftId;
$values[1] = "'{$this->name}'";
$values[2] = "'{$this->hoursPerDay}'";
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = self::WORKSHIFT_TABLE;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $values;
$sqlBuilder->arr_insertfield = $fields;
$sql = $sqlBuilder->addNewRecordFeature2();
$dbConnection = new DMLFunctions();
$result = $dbConnection->executeQuery($sql);
if (!$result) {
throw new WorkshiftException("Workshift not inserted", WorkshiftException::ERROR_IN_DB_QUERY);
}
if (mysql_affected_rows() != 1) {
throw new WorkshiftException("Workshift not inserted", WorkshiftException::INVALID_ROW_COUNT);
}
return mysql_affected_rows();
}
示例6: addSalCurDet
function addSalCurDet()
{
$arrFieldList[0] = 'SAL_GRD_CODE';
$arrFieldList[1] = 'CURRENCY_ID';
$arrFieldList[2] = 'SALCURR_DTL_MINSALARY';
$arrFieldList[3] = 'SALCURR_DTL_MAXSALARY';
$arrFieldList[4] = 'SALCURR_DTL_STEPSALARY';
$arrRecordList[0] = "'" . $this->getSalGrdId() . "'";
$arrRecordList[1] = "'" . $this->getCurrId() . "'";
$minSal = $this->getMinSal() == '' ? 'null' : $this->getMinSal();
$arrRecordList[2] = $minSal;
$maxSal = $this->getMaxSal() == '' ? 'null' : $this->getMaxSal();
$arrRecordList[3] = $maxSal;
$stepSal = $this->getStepSal() == '' ? 'null' : $this->getStepSal();
$arrRecordList[4] = $stepSal;
$tableName = 'HS_PR_SALARY_CURRENCY_DETAIL';
$sql_builder = new SQLQBuilder();
$sql_builder->table_name = $tableName;
$sql_builder->flg_insert = 'true';
$sql_builder->arr_insert = $arrRecordList;
$sql_builder->arr_insertfield = $arrFieldList;
$sqlQString = $sql_builder->addNewRecordFeature2();
$dbConnection = new DMLFunctions();
$message2 = $dbConnection->executeQuery($sqlQString);
//Calling the addData() function
return $message2;
}
示例7: addProperty
public function addProperty()
{
$dbConnection = new DMLFunctions();
$sqlB->arr_insert = array($this->getPropName());
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = $this->TABLE_NAME;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = array($this->getPropName());
$sqlBuilder->arr_insertfield = array("prop_name");
$sql = $sqlBuilder->addNewRecordFeature2();
$dbConnection->executeQuery($sql);
return 1;
//report success
}
示例8: addEmpBasSal
function addEmpBasSal()
{
$this->getEmpId();
$arrFieldList[0] = "'" . $this->getEmpId() . "'";
$arrFieldList[1] = "'" . $this->getEmpSalGrdCode() . "'";
$arrFieldList[2] = "'" . $this->getEmpCurrCode() . "'";
$arrFieldList[3] = "'" . $this->getEmpBasSal() . "'";
$arrFieldList[4] = empty($this->payPeriod) ? "null" : "'" . $this->payPeriod . "'";
$fields[0] = 'EMP_NUMBER';
$fields[1] = 'SAL_GRD_CODE';
$fields[2] = 'CURRENCY_ID';
$fields[3] = 'EBSAL_BASIC_SALARY';
$fields[4] = 'PAYPERIOD_CODE';
$tableName = 'hs_hr_emp_basicsalary';
$sql_builder = new SQLQBuilder();
$sql_builder->table_name = $tableName;
$sql_builder->flg_insert = 'true';
$sql_builder->arr_insert = $arrFieldList;
$sql_builder->arr_insertfield = $fields;
$sqlQString = $sql_builder->addNewRecordFeature2();
$dbConnection = new DMLFunctions();
$message2 = $dbConnection->executeQuery($sqlQString);
//Calling the addData() function
return $message2;
}
示例9: _insert
/**
* Insert new object to database
*/
private function _insert()
{
$fields[0] = self::DB_FIELD_ID;
$fields[1] = self::DB_FIELD_NAME;
$fields[2] = self::DB_FIELD_DESC;
$fields[3] = self::DB_FIELD_DUTIES;
$this->id = UniqueIDGenerator::getInstance()->getNextID(self::TABLE_NAME, self::DB_FIELD_ID);
$values[0] = $this->id;
$values[1] = "'{$this->name}'";
$values[2] = "'{$this->desc}'";
$values[3] = "'{$this->duties}'";
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = self::TABLE_NAME;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $values;
$sqlBuilder->arr_insertfield = $fields;
$sql = $sqlBuilder->addNewRecordFeature2();
$conn = new DMLFunctions();
$result = $conn->executeQuery($sql);
if (!$result || mysql_affected_rows() != 1) {
throw new JobSpecException("Insert failed. ", JobSpecException::DB_ERROR);
}
return $this->id;
}
示例10: addEmpRepTo
function addEmpRepTo()
{
$arrRecordsList[0] = "'" . $this->getEmpSupId() . "'";
$arrRecordsList[1] = "'" . $this->getEmpSubId() . "'";
$arrRecordsList[2] = "'" . $this->getEmpRepMod() . "'";
$tableName = 'HS_HR_EMP_REPORTTO';
$arrFieldList[0] = 'EREP_SUP_EMP_NUMBER';
$arrFieldList[1] = 'EREP_SUB_EMP_NUMBER';
$arrFieldList[2] = 'EREP_REPORTING_MODE';
$sql_builder = new SQLQBuilder();
$sql_builder->table_name = $tableName;
$sql_builder->flg_insert = 'true';
$sql_builder->arr_insertfield = $arrFieldList;
$sql_builder->arr_insert = $arrRecordsList;
$sqlQString = $sql_builder->addNewRecordFeature2(true, true);
$dbConnection = new DMLFunctions();
$message2 = $dbConnection->executeQuery($sqlQString);
//Calling the addData() function
return $message2;
}
示例11: _insert
/**
* Insert new object to database
*/
private function _insert()
{
// Update name if not set.
if (empty($this->name)) {
$this->_updateName();
}
$fields[0] = self::DB_FIELD_EMP_NUMBER;
$fields[1] = self::DB_FIELD_CODE;
$fields[2] = self::DB_FIELD_NAME;
$fields[3] = self::DB_FIELD_START_DATE;
$fields[4] = self::DB_FIELD_END_DATE;
$values[0] = $this->empNumber;
$values[1] = $this->code;
$values[2] = isset($this->name) ? $this->name : 'null';
$values[3] = $this->startDate;
$values[4] = isset($this->endDate) ? $this->endDate : 'null';
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = $this->tableName;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $values;
$sqlBuilder->arr_insertfield = $fields;
$sql = $sqlBuilder->addNewRecordFeature2();
$conn = new DMLFunctions();
$result = $conn->executeQuery($sql);
if (!$result || mysql_affected_rows() != 1) {
throw new EmpHistoryException("Insert failed. ", EmpHistoryException::DB_ERROR);
}
$this->id = mysql_insert_id();
return $this->id;
}
示例12: _insert
/**
* Insert new object to database
*/
private function _insert()
{
$this->id = UniqueIDGenerator::getInstance()->getNextID(self::TABLE_NAME, self::DB_FIELD_VACANCY_ID);
$fields[0] = self::DB_FIELD_VACANCY_ID;
$fields[1] = self::DB_FIELD_JOBTITLE_CODE;
$fields[2] = self::DB_FIELD_MANAGER_ID;
$fields[3] = self::DB_FIELD_ACTIVE;
$fields[4] = self::DB_FIELD_DESCRIPTION;
$values[0] = $this->id;
$values[1] = "'{$this->jobTitleCode}'";
$values[2] = $this->managerId;
$values[3] = $this->active ? self::STATUS_ACTIVE : self::STATUS_INACTIVE;
$values[4] = "'{$this->description}'";
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = self::TABLE_NAME;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $values;
$sqlBuilder->arr_insertfield = $fields;
$sql = $sqlBuilder->addNewRecordFeature2();
$conn = new DMLFunctions();
$result = $conn->executeQuery($sql);
if (!$result || mysql_affected_rows() != 1) {
throw new JobVacancyException("Insert failed. ", JobVacancyException::DB_ERROR);
}
return $this->id;
}
示例13: updateEmpTax
/**
* Inserts or updates tax information to the employee tax table.
* Note that the tax information is kept separate from the employee table
* since it can be country specific.
*/
function updateEmpTax()
{
$arrRecordsList[0] = "'" . $this->getEmpNumber() . "'";
$arrRecordsList[1] = "'" . $this->getFederalTaxStatus() . "'";
$arrRecordsList[2] = trim($this->getFederalTaxExceptions()) != '' ? "'" . $this->getFederalTaxExceptions() . "'" : "'0'";
$arrRecordsList[3] = "'" . $this->getTaxState() . "'";
$arrRecordsList[4] = "'" . $this->getStateTaxStatus() . "'";
$arrRecordsList[5] = trim($this->getStateTaxExceptions()) != '' ? "'" . $this->getStateTaxExceptions() . "'" : "'0'";
$arrRecordsList[6] = "'" . $this->getTaxUnemploymentState() . "'";
$arrRecordsList[7] = "'" . $this->getTaxWorkState() . "'";
$arrFieldList[0] = self::EMP_TAX_TABLE_EMP_NUMBER;
$arrFieldList[1] = self::EMP_TAX_FEDERAL_STATUS;
$arrFieldList[2] = self::EMP_TAX_FEDERAL_EXCEPTIONS;
$arrFieldList[3] = self::EMP_TAX_STATE;
$arrFieldList[4] = self::EMP_TAX_STATE_STATUS;
$arrFieldList[5] = self::EMP_TAX_STATE_EXCEPTIONS;
$arrFieldList[6] = self::EMP_TAX_UNEMP_STATE;
$arrFieldList[7] = self::EMP_TAX_WORK_STATE;
$sql_builder = new SQLQBuilder();
$sql_builder->table_name = self::EMP_TAX_TABLE_NAME;
$sql_builder->flg_insert = 'true';
$sql_builder->arr_insert = $arrRecordsList;
$sql_builder->arr_insertfield = $arrFieldList;
$sqlQString = $sql_builder->addNewRecordFeature2(true, true);
$dbConnection = new DMLFunctions();
$result = $dbConnection->executeQuery($sqlQString);
return $result;
}
示例14: addCustomField
/**
* Add a new custom field to the database
*/
public function addCustomField()
{
if ($this->_isDuplicateName()) {
throw new CustomFieldsException("Duplicate name", 1);
}
$conn = new DMLFunctions();
$fields[0] = self::DB_FIELDS_NUM;
$fields[1] = self::DB_FIELDS_NAME;
$fields[2] = self::DB_FIELDS_TYPE;
$fields[3] = self::DB_FIELDS_SCREEN;
$fields[4] = self::DB_FIELDS_EXTRA_DATA;
$values[0] = mysql_real_escape_string($this->fieldNumber);
$values[1] = "'" . mysql_real_escape_string($this->name) . "'";
$values[2] = "'" . mysql_real_escape_string($this->fieldType) . "'";
$values[3] = "'" . mysql_real_escape_string($this->screen) . "'";
$values[4] = "'" . mysql_real_escape_string($this->extraData) . "'";
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = self::TABLE_NAME;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $values;
$sqlBuilder->arr_insertfield = $fields;
$sql = $sqlBuilder->addNewRecordFeature2();
$result = $conn->executeQuery($sql);
if (!$result || mysql_affected_rows() != 1) {
throw new CustomFieldsException("Insert failed. ");
}
}
示例15: _insert
private function _insert()
{
$fields[0] = self::DB_FIELD_ACTIVITY_ID;
$fields[1] = self::DB_FIELD_NAME;
$fields[2] = self::DB_FIELD_PROJECT_ID;
$fields[3] = self::DB_FIELD_DELETED;
$this->id = UniqueIDGenerator::getInstance()->getNextID(self::TABLE_NAME, self::DB_FIELD_ACTIVITY_ID);
$values[0] = $this->id;
$values[1] = "'{$this->name}'";
$values[2] = "'{$this->projectId}'";
$values[3] = "'" . intval($this->deleted) . "'";
$sqlBuilder = new SQLQBuilder();
$sqlBuilder->table_name = self::TABLE_NAME;
$sqlBuilder->flg_insert = 'true';
$sqlBuilder->arr_insert = $values;
$sqlBuilder->arr_insertfield = $fields;
$sql = $sqlBuilder->addNewRecordFeature2();
$conn = new DMLFunctions();
$result = $conn->executeQuery($sql);
if (!$result || mysql_affected_rows() != 1) {
throw new ProjectActivityException("Insert failed. ");
}
}