query
stringlengths
10
8.11k
document
stringlengths
17
398k
negatives
sequencelengths
19
20
metadata
dict
If a milestone exists in Destination but not in Source, delete it from Destination
private function deleteOrphanedMilestones() { foreach ($this->destinationMilestones as $destinationKey => $destinationMilestone) { $found = FALSE; foreach ($this->sourceMilestones as $sourceMilestone) { if ($this->equalMilestones($sourceMilestone, $destinationMilestone)) { $found = TRUE; break; } } if ($found == FALSE) { $this->deleteMilestone($destinationMilestone); unset($this->destinationMilestones[$destinationKey]); } } }
[ "private function matchMilestones()\n\t{\n\t\tforeach ($this->sourceMilestones as &$sourceMilestone) {\n\t\t\tforeach ($this->destinationMilestones as $destinationMilestone) {\n\t\t\t\tif ($this->equalMilestones($sourceMilestone, $destinationMilestone)) {\n\t\t\t\t\t$sourceMilestone['destination_id'] = $destinationMilestone['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function clean()\n {\n $sourceKey = $this->entity->_getRaw( $this->sourceCol );\n $this->getJoinDao()->where(\n $this->sourceDao->given( $this->joinSourceCol )->is( $sourceKey )\n )->delete();\n }", "public function testProjectAssignmentsUndelete()\n {\n }", "public function copyMilestones()\n\t{\n\t\tforeach ($this->sourceMilestones as &$sourceMilestone) {\n\t\t\tif (!isset($sourceMilestone['destination_id'])) {\n\t\t\t\t$destinationMilestone = $this->addMilestone($this->destinationProject, $sourceMilestone);\n\t\t\t\t$sourceMilestone['destination_id'] = $destinationMilestone['id'];\n\t\t\t}\n\t\t}\n\t}", "private function deleteOrphanedCases(&$sourceCases, &$destinationCases)\n\t{\n\t\tforeach ($destinationCases as $destinationKey => $destinationCase) {\n\t\t\t$found = FALSE;\n\t\t\tforeach ($sourceCases as $sourceCase)\n\t\t\t{\n\t\t\t\tif ($this->equalCases($sourceCase, $destinationCase))\n\t\t\t\t{\n\t\t\t\t\t$found = TRUE;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($found == FALSE) {\n\t\t\t\t$this->deleteCase($destinationCase);\n\t\t\t\tunset($destinationCase[$destinationKey]);\n\t\t\t}\n\t\t}\n\t}", "private function syncMilestones()\n\t{\n\t\t$this->sourceMilestones = $this->getMilestones($this->sourceProject);\n\t\t$this->destinationMilestones = $this->getMilestones($this->destinationProject);\n\n\t\t$this->deleteOrphanedMilestones();\n\t\t$this->matchMilestones();\n\t\t$this->copyMilestones();\n\t}", "function move_another_milestone($space_url, $api_key, $project_key, $issue, $old_id, $new_id){\n $milestone_ids = array();\n foreach($issue['milestone'] as $milestone){\n if($milestone['id'] == $old_id){\n array_push($milestone_ids, $new_id);\n }else{\n array_push($milestone_ids, $milestone['id']);\n }\n }\n update_issue($space_url, $api_key, $issue['issueKey'], array(\n 'milestoneId' => $milestone_ids\n ));\n}", "public function deleteConflictingEntries()\n {\n $this->db->exec('DELETE vendor_schedule FROM vendor_schedule RIGHT JOIN vendor_schedule_backup \n ON (vendor_schedule.id=vendor_schedule_backup.id)\n ');\n }", "function deleteRelatedMilestones($journalid)\n\t{\n\t\t$obj = new clsBabyJournal();\n\t\t$mysqli = $obj->db_connect();\t\t\t\n\t\tif(!($stmt = $mysqli->prepare(\"DELETE FROM journalMilestones WHERE journal_id = ?\"))){\n\t\t\techo \"Prepare failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t}\t\t\n\t\tif(!($stmt->bind_param(\"i\",$journalid))){\n\t\t\t\techo \"Bind failed: \" . $stmt->errno . \" \" . $stmt->error;\n\t\t\t}\n\t\tif(!$stmt->execute()){\n\t\t\techo \"Execute failed: \" . $mysqli->connect_errno . \" \" . $mysqli->connect_error;\n\t\t}\t\t\t\t\n\t\t$stmt->fetch();\t\t\n\t}", "private function deleteMilestone($milestone)\n\t{\n\t\t$this->send_post(\"delete_milestone/{$milestone['id']}\", array());\n\t}", "public function testDeleteDestination()\n {\n }", "public function afterDelete() {\n foreach ($this->Task->find('all', array('conditions' => array('milestone_id' => $this->id, 'task_status_id <' => 3))) as $task) {\n $this->Task->id = $task['Task']['id'];\n $this->Task->set('milestone_id', null);\n $this->Task->save();\n }\n $this->Task->deleteAll(array('milestone_id' => $this->id), false);\n }", "public function testDeleteDestinationDispatches()\n {\n }", "public function remove_assignment(){\n\t\t$this->autoRender = FALSE;\n\t\tif(!empty($this->request->data)){\n\t\t\t$conditions = array(\n\t\t\t\t'TargetOwner.target_id'=>$this->request->data['target_id'],\n\t\t\t\t'TargetOwner.employee_id'=>$this->request->data['employee_id']\n\t\t\t);\n\n\t\t\tif($this->Target->TargetOwner->deleteAll($conditions)){\n\t\t\t\treturn json_encode(array('success'=>true,'message'=>''));\n\t\t\t}\n\t\t}\n\t\treturn json_encode(array('success'=>false,'message'=>'An error occured'));\n\t}", "public function clearPubssRelatedByDestUserId()\n\t{\n\t\t$this->collPubssRelatedByDestUserId = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function deleteMappingsBySourceId($migration_id, $source_id);", "public function deleteDestination(array $destination_key) {\n $map_query = $this->connection->delete($this->mapTable);\n $message_query = $this->connection->delete($this->messageTable);\n $source_key = $this->lookupSourceID($destination_key);\n if (!empty($source_key)) {\n $count = 1;\n foreach ($destination_key as $key_value) {\n $map_query->condition('destid' . $count, $key_value);\n $count++;\n }\n $map_query->execute();\n $count = 1;\n foreach ($source_key as $key_value) {\n $message_query->condition('sourceid' . $count, $key_value);\n $count++;\n }\n $message_query->execute();\n }\n }", "function goxeedmodule_game_mission_remove ($nid, $target_nid)\n{\n $node = goxeedmodule_node_secure_load ($nid);\n $items = goxeedmodule_field_secure_get_items ('node', $node, 'field_goxeed_mission_nid');\n if ($items) foreach ($items as $key => $item)\n {\n if ($item[\"value\"] == $target_nid)\n {\n unset($node->field_goxeed_mission_nid['und'][$key]);\n }\n }\n node_save ($node);\n}", "public function testAcquisitionAssignmentsUndelete()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns latest status and total amount of specified assessment report.
public function getStatusAndTotal(int $assessmentReportId): array;
[ "public function retrieveTotalReport()\n {\n return $this->start()->uri(\"/api/report/totals\")\n ->get()\n ->go();\n }", "public function getSummaryReport(){\n $payPalReportData = $this->getPayPalReport();\n $moneybookersReportData = $this->getMoneybookersReport();\n\n $summaryReportData = array();\n foreach($payPalReportData as &$payPalReportElement){\n $summaryReportData[$payPalReportElement['u_id']] = $payPalReportElement;\n $summaryReportData[$payPalReportElement['u_id']]['paypal_amount'] = $payPalReportElement['p_amount'];\n unset($summaryReportData[$payPalReportElement['u_id']]['p_amount']);\n unset($payPalReportElement);\n }\n \n foreach($moneybookersReportData as &$moneybookersReportElement){\n //add and sum\n if(isset($summaryReportData[$moneybookersReportElement['u_id']])){\n $summaryReportData[$moneybookersReportElement['u_id']]['moneybookers_amount'] = $moneybookersReportElement['p_amount'];\n }else {\n $summaryReportData[$moneybookersReportElement['u_id']] = $moneybookersReportElement;\n $summaryReportData[$moneybookersReportElement['u_id']]['moneybookers_amount'] = $moneybookersReportElement['p_amount'];\n }\n \n unset($summaryReportData[$moneybookersReportElement['u_id']]['p_amount']);\n unset($moneybookersReportData); \n }\n \n //make sum of amount\n foreach($summaryReportData as &$summaryReportElement){\n if(!isset($summaryReportElement['paypal_amount']))\n $summaryReportElement['paypal_amount'] = 0;\n \n if(!isset($summaryReportElement['moneybookers_amount']))\n $summaryReportElement['moneybookers_amount'] = 0;\n \n $summaryReportElement['total_amount'] = round($summaryReportElement['paypal_amount'] + $summaryReportElement['moneybookers_amount'], 2);\n }\n \n return $summaryReportData;\n }", "public function allotmentReport()\n {\n\t\t$query = \"SELECT * FROM allotment_details WHERE updated='yes' ORDER BY reg_no\";\n\t\t\n\t\t$this->sql->query = $query;\n\t\t$arrayq = $this->sql->process();\n\t\treturn $arrayq;\n\t}", "private function getBasicAssessmentStatistics()\n {\n // get active runs, users, document groups, and rating options from database\n DatabaseUtils::setEntityManager($this->em);\n $active_run_names = DatabaseUtils::getActiveRuns()['run_names'];\n $active_user_names = DatabaseUtils::getActiveUsers()['active_user_names_without_admins'];\n $active_user_groups = DatabaseUtils::getActiveUsers()['active_user_groups_without_admins'];\n $active_doc_groups = DatabaseUtils::getDocumentGroups()['document_groups'];\n $active_doc_groups_short = DatabaseUtils::getDocumentGroups()['document_groups_short'];\n $rating_levels = DatabaseUtils::getRatingOptions();\n\n // calculate progress for users\n Progress::setEntityManager($this->em);\n $user_progress = $this->getProgressForUsers($active_user_names, $active_user_groups);\n\n // calculate number of total and finished DQCombinations (without multiple assessments)\n $progress_dq = $this->getProgressForDQCombinations();\n $total_assessments = $progress_dq['total'];\n $finished_assessments = $progress_dq['finished'];\n $assessment_prop = $progress_dq['proportion'];\n\n // calculate number of skipped documents\n $skipped = (float)$this->g_repo->assessmentByRating(Constants::SKIPPED)[0][\"col_\" . Constants::SKIPPED];\n\n // calculate progress for all document groups\n $progress_groups = $this->getProgressForDocGroups($active_doc_groups_short);\n $nr_evaluations = $progress_groups['nr_evaluations'];\n $doc_groups_assessments_total = $progress_groups['doc_groups_assessments_total'];\n $doc_groups_assessments = $progress_groups['doc_groups_assessments'];\n $doc_groups_assessments_complete = $progress_groups['doc_groups_assessments_complete'];\n\n // calculate progress for multiple assessments\n $mltple = $this->getProgressForMultipleAssessments(\n $active_doc_groups_short,\n $finished_assessments,\n $doc_groups_assessments_total,\n $doc_groups_assessments_complete\n );\n $total_incl_multiple = $mltple['total_incl_multiple'];\n $finished_incl_multiple = $mltple['finished_incl_multiple'];\n $finished_incl_multiple_prop = $mltple['finished_incl_multiple_prop'];\n\n // get ratings for all runs\n $run_ratings = $this->countRatingsForRuns(\n $this->g_repo,\n $rating_levels,\n $active_run_names\n );\n $run_data = $this->getNumbersForRuns($this->g_repo, $active_run_names);\n $run_nr_assessed = $run_data['assessed'];\n $run_nr_total = $run_data['total'];\n\n // calculate progress for different rating options in all runs\n /** @var $rel_lev RatingOption */\n $rating_for_different_levels = array();\n if ($rating_levels != null) {\n foreach ($rating_levels as $rel_lev) {\n $rating_for_different_levels[$rel_lev->getName()] =\n (float)$this->g_repo->assessmentByRating(\n $rel_lev->getName(),\n $rel_lev->getShortName()\n )[0][\"col_\" . $rel_lev->getShortName()];\n }\n }\n\n return array(\n 'run_names' => $active_run_names,\n 'user_names' => $active_user_names,\n 'doc_groups_names' => $active_doc_groups,\n 'doc_groups' => $active_doc_groups_short,\n 'user_progress' => $user_progress,\n 'total_assessments' => $total_assessments,\n 'finished_assessments' => $finished_assessments,\n 'assessment_prop' => $assessment_prop,\n 'skipped' => $skipped,\n 'nr_evaluations' => $nr_evaluations,\n 'doc_groups_assessments_total' => $doc_groups_assessments_total,\n 'doc_groups_assessments' => $doc_groups_assessments,\n 'doc_groups_assessments_complete' => $doc_groups_assessments_complete,\n 'total_incl_multiple' => $total_incl_multiple,\n 'finished_incl_multiple' => $finished_incl_multiple,\n 'finished_incl_multiple_prop' => $finished_incl_multiple_prop,\n 'rating_levels_in_runs' => $run_ratings,\n 'run_number_assessed' => $run_nr_assessed,\n 'run_number_total' => $run_nr_total,\n 'rating_for_different_levels' => $rating_for_different_levels\n );\n }", "function getTotalofReports(){\r\n $books = getReportofTotal();\r\n $totalIncome = 0;\r\n\r\n for($ctr = 0; $ctr < count($books); $ctr++){\r\n $totalIncome += $books[$ctr][2];\r\n }\r\n\r\n return $totalIncome;\r\n }", "public function getCurrentMonthlySummary(){\n\t\t$start_date = date('Y'). '-'. date('m'). '-01';\n\t\t$end_date = date('Y'). '-'. date('m'). '-'. date('d'). ' 23:59:59';\n\t\t\n\t\t//Current counters for the current month\n\t\t$sqlQuery = <<<QUERY\n\t\t\t\t\tSELECT \tsum(visitors) as visitors,\n\t\t\t\t\t\t\tsum(purchases) as sales, \n\t\t\t\t\t\t\tsum(purchase_sum * $this->currency_rate) as revenue,\n\t\t\t\t\t\t round((((sum(original_sum) - sum(purchase_sum))/IF(sum(original_sum) > 0 ,sum(original_sum), 1))*100),2) as discount, \n\t\t\t\t\t\t sum(submitted) as offers\n\t\t\t\t\tFROM dwh.daily_funnel \n\t\t\t\t\tWHERE \tthe_date >= '$start_date' and \n\t\t\t\t\t\t\tthe_date <= '$end_date'\nQUERY;\n\t\t\n\t\t$subQuery = ' ';\n\t\n\t\tif($this->filters['affiliateId'] != '-1')\n\t\t\t$subQuery.=' and affiliate_id = ' . $this->filters['affiliateId'];\n\t\t\n\t\t$sqlQuery.= $subQuery;\n\t\t$model = new ReportsModel();\n\t\t$ds = $model->executeQuery($sqlQuery);\n\t\n\t\tlist( $visitors_p, $sales_p, $revenue_p, $discount_p, $offers_p ) = $this->getCurrentMonthProjection();\n\t\n\t\t$result = array();\n\t\tif(sizeof($ds) > 0)\n\t\t{\n\t\t\t$visitorsProjection = $ds[0]['visitors'] + $visitors_p;\n\t\t\t$offersProjection = $ds[0]['offers'] + $offers_p;\n\t\t\t$salesProjection = $ds[0]['sales'] + $sales_p;\n\t\t\t$revenueProjection = $ds[0]['revenue'] + $revenue_p;\n\t\t\t$discountProjection = $discount_p;\n\t\n\t\t\tarray_push($result , array(\"title\"=> \"\" , \"num\" => \"All\" , \"projection\"=> \"\"));\n\t\t\tarray_push($result , array(\"title\"=>_t(\"ProductArena.total_unique_visitors\") , \"num\" => _d($ds[0]['visitors'],0) , \"projection\"=> _d($visitorsProjection,0)));\n\t\t\tarray_push($result , array(\"title\"=>_t(\"ProductArena.offer_submitted\") , \"num\" => _d($ds[0]['offers'],0) , \"projection\"=>_d($offersProjection,0) ));\n\t\t\tarray_push($result , array(\"title\"=>_t(\"ProductArena.sales\") , \"num\" => _d($ds[0]['sales'],0) , \"projection\"=>_d($salesProjection,0) ));\n\t\t\tarray_push($result , array(\"title\"=>_t(\"ProductArena.revenue_generated\") , \"num\" => $this->_currency(). _d($ds[0]['revenue'],0) , \"projection\"=>$this->_currency()._d($revenueProjection) ));\n\t\t\tarray_push($result , array(\"title\"=>_t(\"ProductArena.average_discount\") , \"num\" => $ds[0]['discount'] > 0 ? _d($ds[0]['discount']).' %' : 'N/A' , \"projection\"=>$discountProjection. ' %' ));\n\t\t\t\n\t\t}\n\t\n\t\treturn $result;\n\t}", "public function getDetailedReport() {\n if ($this->session->userdata('role') == 100) {\n $request = $_REQUEST;\n $param = datatable_param($request, 'agenti.businessname');\n $campuses = @$request['campuses'];\n $agents = @$request['agents'];\n $sqlPart = $this->sqlPart($campuses, $agents);\n if (empty($sqlPart)) {\n echo datatable_json($request['draw'], 0, array());\n exit(0);\n } else {\n $reportData = $this->invoice->paginateDetailedReportData($sqlPart, $param);\n $reportCount = $this->invoice->getDetailedReportCount($sqlPart);\n $reportCount = isset($reportCount->count) ? $reportCount->count : 0;\n echo datatable_json($request['draw'], $reportCount, $reportData);\n exit(0);\n }\n }\n }", "public function getDetailReport() {\n $aData = [];\n if (!empty($this->approve_id) && !empty($this->date_report)) {\n $aData['PAY'] = $this->getReceipts($this->date_report, $this->date_report, array(Receipts::STATUS_RECEIPTIONIST));\n $aData['ALL_PAY'] = $this->getReceipts($this->date_report, $this->date_report, array(Receipts::STATUS_RECEIPTIONIST), true);\n $aData['UN_PAY'] = $this->getReceipts($this->date_report, $this->date_report, array(Receipts::STATUS_DOCTOR));\n }\n return $aData;\n }", "private function reportGet(){\n $reportID = $this->args[0];\n $report = new Report();\n $report->fetch($reportID);\n return $report->toArray();\n }", "public static function PR($json_report)\n {\n // If $replace flag is ON, clear out existing records first\n if (self::$replace) {\n PlatformReport::where([['prov_id','=',self::$prov],\n ['inst_id','=',self::$inst],\n ['yearmon','=',self::$yearmon]])->delete();\n }\n\n // Setup array to hold per-item counts\n $ICounts = ['Searches_Platform' => 0, 'Total_Item_Investigations' => 0, 'Total_Item_Requests' => 0,\n 'Unique_Item_Investigations' => 0, 'Unique_Item_Requests' => 0,\n 'Unique_Title_Investigations' => 0, 'Unique_Title_Requests' => 0];\n $_metric_keys = array_keys($ICounts);\n $_metric_count = count($ICounts);\n\n // Decode JSON and put header and report records into variables\n $header = $json_report->Report_Header;\n $ReportItems = $json_report->Report_Items;\n\n // Loop through all ReportItems\n foreach ($ReportItems as $reportitem) {\n // Platform is required; if Null, skip the item.\n $_platform = (isset($reportitem->Platform)) ? $reportitem->Platform : \"\";\n if ($_platform == \"\") {\n continue;\n }\n $platform_id = self::getPlatform($_platform);\n\n // Pick up the optional attributes\n $accessmethod_id = (isset($reportitem->Access_Method)) ? self::getAccessMethod($reportitem->Access_Method)\n : 1;\n $datatype = (isset($reportitem->Data_Type)) ? self::getDataType($reportitem->Data_Type)\n : self::getDataType(\"Unknown\");\n\n // Loop $reportitem->Performance elements and store counts when time-periods match\n foreach ($reportitem->Performance as $perf) {\n if (\n $perf->Period->Begin_Date == self::$begin &&\n $perf->Period->End_Date == self::$end &&\n isset($perf->Instance)\n ) {\n foreach ($perf->Instance as $instance) {\n // ignore unrecognized metrics\n if (isset($instance->Count) && isset($ICounts[$instance->Metric_Type])) {\n $ICounts[$instance->Metric_Type] += $instance->Count;\n }\n }\n }\n } // foreach performance clause\n\n\n // Insert the record\n PlatformReport::insert(['plat_id' => $platform_id, 'prov_id' => self::$prov, 'inst_id' => self::$inst,\n 'yearmon' => self::$yearmon, 'datatype_id' => $datatype->id, 'accessmethod_id' => $accessmethod_id,\n 'searches_platform' => $ICounts['Searches_Platform'],\n 'total_item_investigations' => $ICounts['Total_Item_Investigations'],\n 'total_item_requests' => $ICounts['Total_Item_Requests'],\n 'unique_item_investigations' => $ICounts['Unique_Item_Investigations'],\n 'unique_item_requests' => $ICounts['Unique_Item_Requests'],\n 'unique_title_investigations' => $ICounts['Unique_Title_Investigations'],\n 'unique_title_requests' => $ICounts['Unique_Title_Requests']]);\n // 'created_at' => self::$now]);\n\n // Reset metric counts\n for ($_m = 0; $_m < $_metric_count; $_m++) {\n $ICounts[$_metric_keys[$_m]] = 0;\n }\n } // foreach $ReportItems\n\n return 'Success';\n }", "function getReport() ;", "public function final_report()\n {\n $batch_id = (int)$this->uri->segment(3, $this->input->post('batch_id'));\n\n // do all our calculations, pass true to do a complete report\n $data = new stdClass();\n $data->batch = Doctrine_Core::getTable('Batch')\n ->getReportArray($batch_id, true);\n $this->_dieIfQueryFailed($data->batch);\n\n $data->title = 'Final report -- Al - Be extraction from quartz';\n $data->todays_date = date('Y-m-d');\n $data->main = 'quartz_chem/final_report';\n $this->load->view('quartz_chem/report_template', $data);\n }", "public function updateReport()\n {\n $this->data['current_report'] = $this->xhprof->getReport();\n }", "public function getReport();", "public function getReport(){\n\t $yesterday_date=date(\"m/d/Y\", mktime(0, 0, 0, date(\"m\"),date(\"d\")-1,date(\"Y\")));\n\t$contents=file_get_contents(\"http://192.168.100.212:1111/IVRMIS/UtilizationReport?startdate=\".$yesterday_date.'&operator=' . 'Reliance' );\n\treturn $contents;\t\n\t\t}", "public function calcSummary() {\n //$this->setParseErrorCount($this->userDataRepository->getByStatusId(ENTRY_STATUS_PARSE_ERROR));\n //$this->setParseBadIdCount($this->userDataRepository->getByStatusId(ENTRY_STATUS_PARSE_BAD_ID));\n //$this->setIdDuplicateCount($this->userDataRepository->getByStatusId(ENTRY_STATUS_ID_DUPLICATE));\n //$this->setCardNumberDuplicateCount($this->userDataRepository->getByStatusId(ENTRY_STATUS_CARDNUMBER_DUPLICATE));\n //$this->setDbDuplicateCount($this->userDataRepository->getByStatusId(ENTRY_STATUS_CARDNUMBER_ALREADY_TAKEN));\n $this->setToRejectCount($this->entryRepository->getByStatusId(ENTRY_STATUS_REJECTED));\n $this->setToAddCount($this->entryRepository->getByStatusId(ENTRY_STATUS_TO_ADD));\n $this->setToUpdateCount($this->entryRepository->getByStatusId(ENTRY_STATUS_TO_UPDATE));\n $this->setToRestoreCount($this->entryRepository->getByStatusId(ENTRY_STATUS_TO_RESTORE));\n $this->setNotChangedCount($this->entryRepository->getByStatusId(ENTRY_STATUS_NOT_CHANGED));\n $this->setToDeleteCount($this->entryRepository->countEntriesToDelete());\n $this->setCantDeleteCount($this->entryRepository->countEntriesCantDelete());\n $this->setTotalEntryCount($this->entryRepository->countTotalEntries());\n }", "function summary_print_by_reporter() {\n\t\t$t_mantis_bug_table = config_get( 'mantis_bug_table' );\n\t\t$t_mantis_user_table = config_get( 'mantis_user_table' );\n\t\t$t_reporter_summary_limit = config_get( 'reporter_summary_limit' );\n\t\t\n\t\t$t_project_id = helper_get_current_project();\n\n\t\tif ( ALL_PROJECTS == $t_project_id ) {\n\t\t\t//$specific_where = ' 1=1';\n\t\t\t$t_project_perm = current_user_get_accessible_projects(); \n\t\t $specific_where = \" project_id IN ('\".implode(\"','\", $t_project_perm).\"')\";\n\t\t}else {\n\t\t\t$specific_where = \" project_id='$t_project_id'\";\n\t\t}\n\n\t\t$query = \"SELECT reporter_id, COUNT(*) as num\n\t\t\t\tFROM $t_mantis_bug_table\n\t\t\t\tWHERE $specific_where\n\t\t\t\tGROUP BY reporter_id\n\t\t\t\tORDER BY num DESC\n\t\t\t\tLIMIT $t_reporter_summary_limit\";\n\t\t$result = db_query( $query );\n\t\twhile ( $row = db_fetch_array( $result ) ) {\n\t\t\t$v_reporter_id = $row['reporter_id'];\n\t\t\t$query = \"SELECT status FROM $t_mantis_bug_table\n\t\t\t\t\tWHERE reporter_id=$v_reporter_id\n\t\t\t\t\tAND $specific_where\";\n\t\t\t$result2 = db_query( $query );\n\n\t\t\t$last_reporter = -1;\n\t\t\t$t_bugs_open = 0;\n\t\t\t$t_bugs_resolved = 0;\n\t\t\t$t_bugs_closed = 0;\n\t\t\t$t_bugs_total = 0;\n\n\t\t\t$t_resolved_val = RESOLVED;\n\t\t\t$t_closed_val = CLOSED;\n\n\t\t\twhile ( $row2 = db_fetch_array( $result2 ) ) {\n\t\t\t\t$t_bugs_total++;\n\n\t\t\t\tswitch( $row2['status'] ) {\n\t\t\t\t\tcase $t_resolved_val:\n\t\t\t\t\t\t$t_bugs_resolved++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase $t_closed_val:\n\t\t\t\t\t\t$t_bugs_closed++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$t_bugs_open++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( 0 < $t_bugs_total ) {\n\t\t\t\t$query = \"SELECT user_username as username\n\t\t\t\t\t\tFROM $t_mantis_user_table\n\t\t\t\t\t\tWHERE user_id=$v_reporter_id\";\n\t\t\t\t$result3 = db_query( $query );\n\t\t\t\t$row3 = db_fetch_array( $result3 );\n\t\t\t\tsummary_helper_print_row(\n\t\t\t\t$row3['username']\n\t\t\t\t, $t_bugs_open, $t_bugs_resolved\n\t\t\t\t, $t_bugs_closed, $t_bugs_total );\n\t\t\t}\n\t\t}\n\t}", "private function getTotalOverview(){\n $query = \"SELECT promised_grades.assignment_id AS id, title, promised, fullfilled\n FROM (\n SELECT assignment_id, title, COUNT(*) as promised\n FROM allocations, staff, assignments\n WHERE allocations.staff_id = staff.id\n AND staff.type != 2\n AND allocations.assignment_id = assignments.id\n GROUP BY assignment_id\n ORDER BY title ASC) AS promised_grades,\n (SELECT assignment_id, COUNT(grading.grade) AS fullfilled\n FROM grading, submissions, staff\n WHERE grading.submission_id = submissions.id\n AND grading.staff_id = staff.id\n AND staff.type != 2\n AND grading.type = 'Score'\n GROUP BY assignment_id) AS fullfilled_grades\n WHERE promised_grades.assignment_id = fullfilled_grades.assignment_id\";\n return $this->database->query($query)->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getPayPalReport(){\n return $this->getReportData('PayPalTransaction');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[Output only] True if you can create media items in this album. This field is based on the scopes granted and permissions of the album. If the scopes are changed or permissions of the album are changed, this field is updated. Generated from protobuf field bool is_writeable = 4;
public function setIsWriteable($var) { GPBUtil::checkBool($var); $this->is_writeable = $var; return $this; }
[ "public static function isPhotoMaterialFolderWritable()\n {\n if (is_dir(Config::get('PATH_MATERIALS')) AND is_writable(Config::get('PATH_MATERIALS'))) {\n return true;\n }\n\n Session::add('feedback_negative', Text::get('FEEDBACK_PHOTOMATERIAL_FOLDER_DOES_NOT_EXIST_OR_NOT_WRITABLE'));\n return false;\n }", "public function canWrite()\n {\n if ($this->contentContainer instanceof \\humhub\\modules\\user\\models\\User) {\n if ($this->contentContainer->id === Yii::$app->user->getIdentity()->id) {\n return true;\n }\n }\n \n return $this->contentContainer->permissionManager->can(new \\humhub\\modules\\cfiles\\permissions\\WriteAccess());\n }", "public function groupCanWrite()\n {\n return $this->groupIsOwner() && ($this->node->mode() & self::MODE_GROUP_WRITE);\n }", "public function isWriteable() {\n return $this->exists() && is_writeable($this->_path);\n }", "public function canWrite()\n {\n return is_writeable( $this->path );\n }", "public function isWriteable(): bool;", "public static function isAvatarFolderWritable()\n {\n if (is_dir(Config::get('PATH_AVATARS_STUDENTS')) AND is_writable(Config::get('PATH_AVATARS_STUDENTS'))) {\n return true;\n }\n\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_FOLDER_DOES_NOT_EXIST_OR_NOT_WRITABLE'));\n return false;\n }", "public function isWriteable(): bool\n {\n return is_writeable($this->getPath());\n }", "public function mediaTypePermissions() {\n // Generate media permissions for all media types.\n $media_types = $this->entityTypeManager->getStorage('media_type')->loadMultiple();\n return $this->generatePermissions($media_types, [$this, 'buildPermissions']);\n }", "public function accessMediasFolder()\n {\n return $this->isNotUser();\n }", "public function isMedia() : bool\n {\n return $this->media;\n }", "public function createMediaItemMutation() {\n\n\t\t/**\n\t\t * Set up the createMediaItem mutation\n\t\t */\n\t\t$mutation = '\n\t\t\tmutation createMediaItem( $input: CreateMediaItemInput! ){\n\t\t\t createMediaItem(input: $input){\n\t\t\t clientMutationId\n\t\t\t mediaItem{\n\t\t\t id\n\t\t\t mediaItemId\n\t\t\t mediaType\n\t\t\t date\n\t\t\t dateGmt\n\t\t\t slug\n\t\t\t status\n\t\t\t title\n\t\t\t commentStatus\n\t\t\t pingStatus\n\t\t\t altText\n\t\t\t caption\n\t\t\t description\n\t\t\t mimeType\n\t\t\t parent {\n\t\t\t ... on Post {\n\t\t\t id\n\t\t\t }\n\t\t\t }\n\t\t\t sourceUrl\n\t\t\t mediaDetails {\n\t\t\t file\n\t\t\t height\n\t\t\t meta {\n\t\t\t aperture\n\t\t\t credit\n\t\t\t camera\n\t\t\t caption\n\t\t\t createdTimestamp\n\t\t\t copyright\n\t\t\t focalLength\n\t\t\t iso\n\t\t\t shutterSpeed\n\t\t\t title\n\t\t\t orientation\n\t\t\t }\n\t\t\t width\n\t\t\t sizes {\n\t\t\t name\n\t\t\t file\n\t\t\t width\n\t\t\t height\n\t\t\t mimeType\n\t\t\t sourceUrl\n\t\t\t }\n\t\t\t }\n\t\t\t }\n\t\t\t }\n\t\t\t}\n\t\t';\n\n\t\t$actual = do_graphql_request( $mutation, 'createMediaItem', $this->create_variables );\n\n\t\treturn $actual;\n\t}", "public static function checkWriteableUpload()\n {\n $cache = Cache::path();\n\n if (!file_exists($cache)) {\n add_action('admin_notices', '\\Bladerunner\\Init::noticeCreateCache');\n } else {\n Cache::setPermissions();\n $is_writable = false;\n try {\n file_put_contents($cache.'/folder_writable.php', '<?php echo \"folder writable!\";');\n $is_writable = true;\n } catch (\\Exception $ex) {\n }\n if (!$is_writable) {\n add_action('admin_notices', '\\Bladerunner\\Init::noticeWritableCache');\n }\n }\n }", "public function manageMediaPermissions($action, $isAdding = true)\r\n {\r\n\r\n if (!$this->client->hasCredentials()) {\r\n throw new Service_Exception_Authentication();\r\n }\r\n $this->httpRequest->appendToUrl(\"/\" . $this->UUID . \"/permissions\");\r\n if ($isAdding) {\r\n $this->httpRequest->setRequestMethod(\"PUT\");\r\n } else {\r\n $this->httpRequest->setRequestMethod(\"DELETE\");\r\n }\r\n\r\n foreach ($action as $k => $v) {\r\n $this->httpRequest->setQueryParam($k, $v);\r\n }\r\n $this->httpRequest->setRequestHeaders(array(\"Content-Length\" => 0));\r\n\r\n return $this->requestWithAuthentication();\r\n\r\n }", "public function getCanShareFolder()\n {\n return $this->getProperty(\"CanShareFolder\");\n }", "public function is_writable(): bool;", "public function hasMedia()\n {\n return $this->getData('has_media') === true;\n }", "function mediashare_editapi_addMediaItem(&$args)\r\n{\r\n if (!array_key_exists('albumId', $args))\r\n return mediashareErrorAPI(__FILE__, __LINE__, 'Missing albumId in mediashare_editapi_addMediaItem'); \r\n\r\n $albumId = (int)$args['albumId'];\r\n\r\n // Calculate title\r\n $mediaTitle = $args['title'];\r\n if ($mediaTitle == '')\r\n {\r\n $mediaTitle = $args['filename'];\r\n if (!(($p=strrpos($mediaTitle,'.')) === false)) // Strip trailing extension\r\n $mediaTitle = substr($mediaTitle,0,$p);\r\n }\r\n $mediaTitle = str_replace('_', ' ', $mediaTitle);\r\n\r\n // Check upload limits\r\n\r\n $userInfo = pnModAPIFunc('mediashare', 'edit', 'getUserInfo');\r\n if ($userInfo === false)\r\n return mediashareErrorAPIGet();\r\n\r\n if (!array_key_exists('ignoreSizeLimits',$args) || !$args['ignoreSizeLimits'])\r\n {\r\n $fileSize = $args['fileSize'];\r\n\r\n if ($fileSize > $userInfo['mediaSizeLimitSingle'])\r\n return mediashareErrorAPI(null, null, \"$mediaTitle: \" . _MSMEDIAITEMTOOBIG); \r\n \r\n if ($fileSize + $userInfo['totalCapacityUsed'] > $userInfo['mediaSizeLimitTotal'])\r\n return mediashareErrorAPI(__FILE__, __LINE__, _MSMEDIAITEMEXEEDQUOTA);\r\n }\r\n\r\n // Find a media handler\r\n\r\n if (!pnModAPILoad('mediashare', 'mediahandler'))\r\n return mediashareErrorAPI(__FILE__, __LINE__, 'Failed to load Mediashare mediahandler API');\r\n\r\n $handlerInfo = pnModAPIFunc('mediashare', 'mediahandler', 'getHandlerInfo',\r\n array('mimeType' => $args['mimeType'],\r\n 'filename' => $args['filename']));\r\n if ($handlerInfo === false)\r\n return false;\r\n\r\n $handlerName = $handlerInfo['handlerName'];\r\n\r\n // Make sure we use sanitized results from the database (like \"image/pjpeg\" => \"image/jpeg\")\r\n $args['mimeType'] = $handlerInfo['mimeType'];\r\n $args['fileType'] = $handlerInfo['fileType'];\r\n\r\n\r\n // Load media handler\r\n\r\n $handlerApi = \"media_$handlerName\";\r\n if (!pnModAPILoad('mediashare', $handlerApi))\r\n return mediashareErrorAPI(__FILE__, __LINE__, \"Missing '$handlerApi' handler in mediashare_editapi_addMediaItem\");\r\n\r\n $handler = pnModAPIFunc('mediashare', $handlerApi, 'buildHandler');\r\n\r\n\r\n // Ask media handler to generate thumbnail and preview images\r\n\r\n $tmpDir = pnModGetVar('mediashare', 'tmpDirName');\r\n if (($thumbnailFilename = tempnam($tmpDir, 'Preview')) === false)\r\n return mediashareErrorAPI(__FILE__, __LINE__, \"Failed to create thumbnail filename in mediashare_editapi_addMediaItem\");\r\n\r\n if (($previewFilename = tempnam($tmpDir, 'Preview')) === false)\r\n {\r\n @unlink($thumbnailFilename);\r\n return mediashareErrorAPI(__FILE__, __LINE__, \"Failed to create preview filename in mediashare_editapi_addMediaItem\");\r\n }\r\n\r\n $thumbnailSize = (int)pnModGetVar('mediashare', 'thumbnailSize');\r\n\r\n $previews = array( array('outputFilename' => $thumbnailFilename,\r\n 'imageSize' => $thumbnailSize,\r\n 'isThumbnail' => true),\r\n array('outputFilename' => $previewFilename,\r\n 'imageSize' => (int)pnModGetVar('mediashare', 'previewSize'),\r\n 'isThumbnail' => false) );\r\n\r\n $previewResult = $handler->createPreviews($args, $previews);\r\n if ($previewResult === false)\r\n {\r\n @unlink($thumbnailFilename);\r\n @unlink($previewFilename);\r\n return false;\r\n }\r\n\r\n // Get virtual file system handler\r\n $vfsHandlerName = pnModGetVar('mediashare', 'vfs');\r\n $vfsHandlerApi = \"vfs_$vfsHandlerName\";\r\n if (!pnModAPILoad('mediashare', $vfsHandlerApi))\r\n {\r\n @unlink($thumbnailFilename);\r\n @unlink($previewFilename);\r\n return mediashareErrorAPI(__FILE__, __LINE__, \"Missing '$vfsHandlerApi' in mediashare_editapi_addMediaItem\");\r\n }\r\n\r\n $vfsHandler = pnModAPIFunc('mediashare', $vfsHandlerApi, 'buildHandler');\r\n if ($vfsHandler === false)\r\n return false;\r\n\r\n // Store thumbnail, preview, and original in virtual file system\r\n\r\n $baseFileRef = $vfsHandler->getNewFileReference();\r\n $previewResult[0]['baseFileRef'] = $baseFileRef;\r\n $previewResult[0]['fileMode'] = 'tmb';\r\n $previewResult[1]['baseFileRef'] = $baseFileRef;\r\n $previewResult[1]['fileMode'] = 'pre';\r\n $previewResult[2]['baseFileRef'] = $baseFileRef;\r\n $previewResult[2]['fileMode'] = 'org';\r\n\r\n $result = array();\r\n\r\n if (($thumbnailFileRef=$vfsHandler->createFile($thumbnailFilename, $previewResult[0])) === false)\r\n {\r\n @unlink($thumbnailFilename);\r\n @unlink($previewFilename);\r\n return false;\r\n }\r\n $previewResult[0]['fileRef'] = $result['thumbnailFileRef'] = $thumbnailFileRef;\r\n\r\n if (($originalFileRef=$vfsHandler->createFile($args['mediaFilename'],$previewResult[2])) === false)\r\n {\r\n $vfsHandler->deleteFile($thumbnailFileRef);\r\n $vfsHandler->deleteFile($previewFileRef);\r\n @unlink($thumbnailFilename);\r\n @unlink($previewFilename);\r\n return false;\r\n }\r\n $previewResult[2]['fileRef'] = $result['originalFileRef'] = $originalFileRef;\r\n\r\n if (!array_key_exists('useOriginal',$previewResult[1]) || !(bool)$previewResult[1]['useOriginal'])\r\n {\r\n if (($previewFileRef=$vfsHandler->createFile($previewFilename, $previewResult[1])) === false)\r\n {\r\n $vfsHandler->deleteFile($thumbnailFileRef);\r\n @unlink($thumbnailFilename);\r\n @unlink($previewFilename);\r\n return false;\r\n }\r\n $previewResult[1]['fileRef'] = $result['previewFileRef'] = $previewFileRef;\r\n }\r\n else\r\n $previewResult[1]['fileRef'] = $result['previewFileRef'] = $originalFileRef;\r\n\r\n\r\n $id = pnModAPIFunc('mediashare', 'edit', 'storeMediaItem',\r\n array('title' => $mediaTitle,\r\n 'keywords' => $args['keywords'],\r\n 'description' => $args['description'],\r\n 'ownerId' => array_key_exists('ownerId',$args) ? $args['ownerId'] : pnUserGetVar('uid'),\r\n 'albumId' => $albumId,\r\n 'mediaHandler' => $handlerName,\r\n 'thumbnail' => $previewResult[0],\r\n 'preview' => $previewResult[1],\r\n 'original' => $previewResult[2]));\r\n if ($id === false)\r\n {\r\n $vfsHandler->deleteFile($thumbnailFileRef);\r\n $vfsHandler->deleteFile($previewFileRef);\r\n $vfsHandler->deleteFile($originalFileRef);\r\n @unlink($thumbnailFilename);\r\n @unlink($previewFilename);\r\n return false;\r\n }\r\n\r\n pnModCallHooks('item', 'create', \"media-$id\", array('module' => 'mediashare',\r\n 'mediaId' => $id));\r\n\r\n @unlink($thumbnailFilename);\r\n @unlink($previewFilename);\r\n\r\n $ok = pnModAPIFunc('mediashare', 'edit', 'ensureMainAlbumId',\r\n array('albumId' => $albumId,\r\n 'mediaId' => $id));\r\n if ($ok === false)\r\n {\r\n // Don't clean up, just report error. Upload actually worked.\r\n return false; \r\n }\r\n\r\n $result['message'] = \"$mediaTitle: \" . _MSADDEDMEDIAITEM;\r\n $result['mediaId'] = $id;\r\n\r\n return $result;\r\n}", "public function writable() : bool\n {\n\n /**\n * When I say same method, I mean currently this is locally,\n * if we was an S3 bucket or network drive, or Google Drive,\n * how we check something being writable will differ,\n * making the below code redundant.\n *\n * If that ever does happen, I only need to implement the\n * change in this file providing everywhere is using this\n * accessible method and not written their own.\n */\n\n return is_writable(pathinfo($this->resource)['dirname']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new Marriage record and refreshes the marrital status for both this person and the spouse
public function CreateMarriageWith(Person $objSpouse = null, QDateTime $dttStartDate = null, QDateTime $dttEndDate = null, $intMarriageStatusTypeId = MarriageStatusType::Married) { $objMarriage = new Marriage(); $objMarriage->Person = $this; $objMarriage->MarriedToPerson = $objSpouse; $objMarriage->MarriageStatusTypeId = $intMarriageStatusTypeId; $objMarriage->DateStart = $dttStartDate; $objMarriage->DateEnd = $dttEndDate; $objMarriage->Save(); // Updated Link record (if applicable) if ($objSpouse) $objMarriage->UpdateLinkedMarriage(); // Refresh Stats $this->RefreshMaritalStatusTypeId(); if ($objSpouse) $objSpouse->RefreshMaritalStatusTypeId(); return $objMarriage; }
[ "public function SaveMarriage() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstLinkedMarriage) $this->objMarriage->LinkedMarriageId = $this->lstLinkedMarriage->SelectedValue;\n\t\t\t\tif ($this->lstPerson) $this->objMarriage->PersonId = $this->lstPerson->SelectedValue;\n\t\t\t\tif ($this->lstMarriedToPerson) $this->objMarriage->MarriedToPersonId = $this->lstMarriedToPerson->SelectedValue;\n\t\t\t\tif ($this->lstMarriageStatusType) $this->objMarriage->MarriageStatusTypeId = $this->lstMarriageStatusType->SelectedValue;\n\t\t\t\tif ($this->calDateStart) $this->objMarriage->DateStart = $this->calDateStart->DateTime;\n\t\t\t\tif ($this->calDateEnd) $this->objMarriage->DateEnd = $this->calDateEnd->DateTime;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\t\t\t\tif ($this->lstMarriageAsLinked) $this->objMarriage->MarriageAsLinked = Marriage::Load($this->lstMarriageAsLinked->SelectedValue);\n\n\t\t\t\t// Save the Marriage object\n\t\t\t\t$this->objMarriage->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}", "public function addMarriageRequest () {\n $id = request('id');\n $exist = UserActionHistory::existPendingMarriageRequest($id);\n if ($exist) {\n return ['status' => 'error', 'msg' => 'Already have a pending request for this character'];\n }\n $result = UserActionHistory::addMarriageRequest($id);\n if ($result) {\n return ['status' => 'ok', 'msg' => 'Request Saved successfully'];\n } else {\n return ['status' => 'error', 'msg' => 'Request Not Saved'];\n }\n }", "public function store(CreateMaritalStatusRequest $request)\n {\n $input = $request->all();\n\n $maritalStatus = $this->maritalStatusRepository->create($input);\n\n Flash::success('Marital Status saved successfully.');\n\n return redirect(route('maritalStatuses.index'));\n }", "public function setMarried(bool $status) : void\r\n {\r\n $this->married = $status;\r\n }", "public static function createMarriage($marriageId, $partners, $occurredOn)\n {\n $marriage = new Marriage();\n // After instantiation of the object we apply the \"MarriageCreatedEvent\".\n $marriage->apply(new MarriageCreatedEvent($marriageId, $partners, $occurredOn));\n return $marriage;\n }", "public function created(Remission $remission)\n {\n $total = Remission::where('order_details_id', $remission->order_details_id)->sum('delivered');\n\n if ($total == $remission->orderDetail->quantity) {\n \n $remission->orderDetail->status = 0;\n $remission->orderDetail->save();\n } else {\n $remission->orderDetail->status = 1;\n $remission->orderDetail->save();\n }\n }", "public function postDoAddMaritalStatus(Request $request)\n\t{\n\t\t$validator = Validator::make($request->all(), [\n\t\t\t\t'description' => 'required|unique:lookup_marital_statuses'\n\t\t]);\n\t\t\n\t\tif ($validator->fails()) {\n\t\t\treturn redirect()\n\t\t\t\t->route('add-marital-status')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput();\n\t\t}\n\t\t$user = (new AuthUserRetriever())->retrieveUser();\n\t\t$marital_status = new LookupMaritalStatus();\n\t\t$marital_status->description = Util::getQueryParameter($request->description);\n\t\t$marital_status->created_by_id = $user->id;\n\t\t$marital_status->save();\n\t\treturn redirect()->action('MaritalStatusController@getViewMaritalStatus', ['marital_status_Id' => $marital_status->id])\n\t\t\t->with(['message' => 'Marital Status saved']);\n\t}", "public function actionCreate()\n {\n $model = new Carriage();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function store(CreateLandlordRemittanceRequest $request)\n {\n $input = $request->all();\n $input['remitted_by'] = Auth::user()->mf_id;\n\n $landlordRemittance = $this->landlordRemittanceRepository->create($input);\n\n Flash::success('Landlord Remittance saved successfully.');\n\n return redirect(route('landlordRemittances.index'));\n }", "public function createFundedLoanLendersRepaymentScheduleRecord()\n {\n if (!empty($this->current_loan_details)) {\n foreach($this->funded_loan_lenders['lenders'] as $lender) {\n $loan = array('lender_id' => $lender['lender_id'],\n 'loan_id' => $this->current_loan_details['loans'][0]['id'],\n 'expected_payment_date' => $this->currentLoanRepaymentExpectedDate,\n 'expected_payment_amount' => $this->currentLoanRepaymentExpectedAmount\n );\n \n if(!$this->db->createLoanLenderRepaymentsSchedule($loan)) return false;\n }\n \n return true;\n }\n \n return false; // oops?\n }", "public function claim($rewardID)\n {\n $reward = DB::table('SCAN_TOTAL')\n ->join('REWARD', 'REWARD.businessID','=','SCAN_TOTAL.businessID')\n ->join('BUSINESS', 'BUSINESS.businessID','=','REWARD.businessID')\n ->where([\n ['SCAN_TOTAL.patronID', Auth::user()->email],\n ['REWARD.rewardID', $rewardID],\n ])\n ->latest('SCAN_TOTAL.dateTime')\n ->select('SCAN_TOTAL.total','REWARD.*','BUSINESS.businessName')->first();\n\n $pointsTotal = $reward->total;\n $pointsSpent = $reward->pointsNeeded;\n if($pointsTotal >= $pointsSpent)\n {\n $status = DB::table('CLAIMED_REWARD')\n ->insert([\n 'patronID' => Auth::user()->email,\n 'rewardID' => $rewardID,\n 'claimTimeStamp' => date('Y-m-d H:i:sO'),\n 'pointsSpent' => $pointsSpent,\n 'status' => 'new'\n ]);\n if($status)\n {\n\n $rewardInfo = [\n 'name' => Auth::user()->firstName .' '. Auth::user()->lastName,\n 'pointsSpent' => $pointsSpent,\n 'pointsRemaining' => $pointsTotal - $pointsSpent,\n 'title' => $reward->title,\n 'descr' => $reward->descr,\n 'businessName' => $reward->businessName\n ];\n\n Mail::to(Auth::user()->email)->send(new rewardClaimed($rewardInfo));\n }\n }\n return redirect('/rewards');\n }", "public function createReward()\n {\n //Get reward name\n $rewardName = request()->rewardName;\n //Get module list ID\n $moduleID = request()->moduleList;\n //Get the amount number\n $amountAchieve = request()->amountAchieve;\n\n //Get module from module ID\n $module = Module::find($moduleID);\n\n //Check errors\n $error = $this->checkCreateRewardError($module, $rewardName, $amountAchieve);\n if (sizeof($error) == 0) {\n $this->saveReward($rewardName, $amountAchieve, $moduleID);\n session(['rewardSuccess' => 'Reward has created']);\n } else {\n session(['rewardError' => $error]);\n }\n\n //Redirect to the reward page\n return redirect('/reward');\n\n }", "public function createAction()\n {\n if (!$this->request->isPost()) {\n $this->dispatcher->forward(array(\n 'controller' => \"rent\",\n 'action' => 'index'\n ));\n\n return;\n }\n\n $rent = new Rent();\n $rent->setBranchofficeId($this->request->getPost(\"branchoffice_id\"));\n $rent->setClientId($this->request->getPost(\"client_id\"));\n $rent->setMovieId($this->request->getPost(\"movie_id\"));\n $rent->setRentStardate($this->request->getPost(\"rent_stardate\"));\n $rent->setRentReturndate($this->request->getPost(\"rent_returndate\"));\n $rent->setRentValue($this->request->getPost(\"rent_value\"));\n $rent->setRentAmount($this->request->getPost(\"rent_amount\"));\n \n\n if (!$rent->save()) {\n foreach ($rent->getMessages() as $message) {\n $this->flash->error($message);\n }\n\n $this->dispatcher->forward(array(\n 'controller' => \"rent\",\n 'action' => 'new'\n ));\n\n return;\n }\n\n $this->flash->success(\"rent was created successfully\");\n\n $this->dispatcher->forward(array(\n 'controller' => \"rent\",\n 'action' => 'index'\n ));\n }", "public function setClaimed()\n {\n $this->status = self::STATUS_CLAIMED;\n $this->save();\n }", "public function create() {\n $this->car_rides_model->set_car_ride();\n redirect('/car_rides/own/');\n }", "public function putRent($id)\n {\n $pelicula = Movie::find($id);\n\n if(!$pelicula) {\n \\Log::info('Error al buscar la película: '.$id. ', es inexistente o fué eliminada.');\n return response()->json(['error' => true, 'msg' => 'Registro no encontrado'], 404);\n }\n\n $pelicula->rented = true;\n $pelicula->save();\n\n return response()->json(['error' => false, 'msg' => 'La Pelicula ha sido rentada.']);\n }", "function create() {\n\t\t$this->new_row = true;\n\t\t$this->save();\n\t}", "public function addclaimstatus(){\n $response = $this->insertInToTable(CLAIM_STATUS, array(array('claim_status_name'=>$this->getData['addnewclaimstatus'], 'created_by'=>$this->Useconfig['user_id'], 'created_ip'=>commonfunction::loggedinIP())));\n return $response;\n }", "public function actionUpdateMedicalRecord() {\n try {\n $result = ApiModule::$defaultFailedResponse;\n // Check format of request\n $this->checkRequest();\n // Parse json\n $root = json_decode(filter_input(INPUT_POST, DomainConst::KEY_ROOT_REQUEST));\n // Check required parameters\n $this->checkRequiredParam($root, array(\n DomainConst::KEY_TOKEN,\n DomainConst::KEY_ID,\n DomainConst::KEY_RECORD_NUMBER,\n DomainConst::KEY_MEDICAL_HISTORY\n ));\n // Get user\n $mUser = $this->getUserByToken($result, $root->token);\n $mCustomer = $this->getCustomerById($result, $root->id);\n// $this->handleUpdateUser($result, $mUser, $root);\n $this->handleUpdateMedicalRecord($result, $mCustomer, $root);\n $result = ApiModule::$defaultSuccessResponse;\n $result[DomainConst::KEY_MESSAGE] = DomainConst::CONTENT00035;\n ApiModule::sendResponse($result, $this);\n } catch (Exception $exc) {\n ApiModule::catchError($exc, $this);\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to import taxonomy terms. When this function is used without the designated form, you should assign an array with a key value pair for form with key 'style' and value 'full', 'safe' or 'force' to apply that import style.
public function importTaxonomies(array $form, FormStateInterface $form_state = NULL) { StructureSyncHelper::logMessage('Taxonomy import started'); // Check if the import style has been defined in the form (state) and else // get it from the form array. if (is_object($form_state) && $form_state->hasValue('import_voc_list')) { $taxonomiesSelected = $form_state->getValue('import_voc_list'); $taxonomiesSelected = array_filter($taxonomiesSelected, 'is_string'); } if (array_key_exists('style', $form)) { $style = $form['style']; } else { StructureSyncHelper::logMessage('No style defined on taxonomy import', 'error'); return; } StructureSyncHelper::logMessage('Using "' . $style . '" style for taxonomy import'); // Get taxonomies from config. $taxonomiesConfig = $this->config->get('taxonomies'); $taxonomies = []; if (isset($taxonomiesSelected)) { foreach ($taxonomiesConfig as $taxKey => $taxValue) { if (in_array($taxKey, $taxonomiesSelected)) { $taxonomies[$taxKey] = $taxValue; } } } else { $taxonomies = $taxonomiesConfig; } // Sorts taxonomies so that all parent terms come before -- and therefore // are created before -- their respective child terms foreach ($taxonomies as $taxonomy => $terms) { $parents = []; foreach ($terms as $key => $term_data) { $parents[$key] = $term_data['parent']; } array_multisort($parents, SORT_ASC, $taxonomies[$taxonomy]); } if (array_key_exists('drush', $form) && $form['drush'] === TRUE) { $context = []; $context['drush'] = TRUE; switch ($style) { case 'full': self::deleteDeletedTaxonomies($taxonomies, $context); self::importTaxonomiesFull($taxonomies, $context); self::taxonomiesImportFinishedCallback(NULL, NULL, NULL); break; case 'safe': self::importTaxonomiesSafe($taxonomies, $context); self::taxonomiesImportFinishedCallback(NULL, NULL, NULL); break; case 'force': self::deleteTaxonomies($context); self::importTaxonomiesForce($taxonomies, $context); self::taxonomiesImportFinishedCallback(NULL, NULL, NULL); break; } return; } // Import the taxonomies with the chosen style of importing. switch ($style) { case 'full': $batch = [ 'title' => $this->t('Importing taxonomies...'), 'operations' => [ [ '\Drupal\structure_sync\Controller\TaxonomiesController::deleteDeletedTaxonomies', [$taxonomies], ], [ '\Drupal\structure_sync\Controller\TaxonomiesController::importTaxonomiesFull', [$taxonomies], ], ], 'finished' => '\Drupal\structure_sync\Controller\TaxonomiesController::taxonomiesImportFinishedCallback', ]; batch_set($batch); break; case 'safe': $batch = [ 'title' => $this->t('Importing taxonomies...'), 'operations' => [ [ '\Drupal\structure_sync\Controller\TaxonomiesController::importTaxonomiesSafe', [$taxonomies], ], ], 'finished' => '\Drupal\structure_sync\Controller\TaxonomiesController::taxonomiesImportFinishedCallback', ]; batch_set($batch); break; case 'force': $batch = [ 'title' => $this->t('Importing taxonomies...'), 'operations' => [ [ '\Drupal\structure_sync\Controller\TaxonomiesController::deleteTaxonomies', [], ], [ '\Drupal\structure_sync\Controller\TaxonomiesController::importTaxonomiesForce', [$taxonomies], ], ], 'finished' => '\Drupal\structure_sync\Controller\TaxonomiesController::taxonomiesImportFinishedCallback', ]; batch_set($batch); break; default: StructureSyncHelper::logMessage('Style not recognized', 'error'); break; } }
[ "public function process_terms() {\n $this->terms = apply_filters( 'wp_import_terms', $this->terms );\n\n if ( empty( $this->terms ) ) {\n return;\n }\n\n foreach ( $this->terms as $term ) {\n // if the term already exists in the correct taxonomy leave it alone\n $term_id = term_exists( $term['slug'], $term['term_taxonomy'] );\n\n if ( $term_id ) {\n if ( is_array( $term_id ) ) {\n $term_id = $term_id['term_id'];\n }\n\n if ( isset( $term['term_id'] ) ) {\n $this->processed_terms[ intval( $term['term_id'] ) ] = (int) $term_id;\n }\n continue;\n }\n\n if ( empty( $term['term_parent'] ) ) {\n $parent = 0;\n } else {\n $parent = term_exists( $term['term_parent'], $term['term_taxonomy'] );\n\n if ( is_array( $parent ) ) {\n $parent = $parent['term_id'];\n }\n }\n $description = isset( $term['term_description'] ) ? $term['term_description'] : '';\n $termarr = [\n 'slug' => $term['slug'],\n 'description' => $description,\n 'parent' => intval( $parent ),\n ];\n\n $id = wp_insert_term( $term['term_name'], $term['term_taxonomy'], $termarr );\n\n if ( ! is_wp_error( $id ) ) {\n if ( isset( $term['term_id'] ) ) {\n $this->processed_terms[ intval( $term['term_id'] ) ] = $id['term_id'];\n }\n } else {\n // translators: 1: taxnomy name, 2: term name\n printf( __( 'Failed to import %1$s %2$s', 'dokan' ), esc_html( $term['term_taxonomy'] ), esc_html( $term['term_name'] ) );\n\n if ( defined( 'IMPORT_DEBUG' ) && IMPORT_DEBUG ) {\n echo ': ' . $id->get_error_message();\n }\n echo '<br />';\n continue;\n }\n }\n\n unset( $this->terms );\n }", "function _process_terms() {\r\n $this->terms = apply_filters( 'wp_import_terms', $this->terms );\r\n\r\n if ( empty( $this->terms ) )\r\n return;\r\n\r\n foreach ( $this->terms as $term ) {\r\n $cat['taxonomy'] = $term['term_taxonomy']; //by hoang, since we save term in result table & i need to know what taxonomy for the current term\r\n // if the term already exists in the correct taxonomy leave it alone\r\n $term_id = term_exists( $term['slug'], $term['term_taxonomy'] );\r\n if ( $term_id ) {\r\n if ( is_array($term_id) ) $term_id = $term_id['term_id'];\r\n $term['term_id'] = (int)$term_id; //by hoang, because we not use import_id feature\r\n if ( !empty($term['term_id']) ) {\r\n $this->tracker->add_import('term', ($term), $term);\r\n $this->processed_terms[intval($term['term_id'])] = (int) $term_id;\r\n\r\n }\r\n //bind menu location\r\n if(!empty($term['menu_location']) && class_exists('HW_NAVMENU', false)) {\r\n HW_NAVMENU::set_menu_location($term['menu_location'], $term_id);\r\n }\r\n continue;\r\n }\r\n if(!empty($term['term_parent']) && $term['term_parent'] instanceof HWIE_Module_Import_Results) { //import result for term_parent\r\n $term['term_parent']->init($this->parser->importer, $this->parser->_get_option('data', array()));\r\n $term['term_parent'] = $term['term_parent']->parse_data()->value; //parse category parent id\r\n if(is_array($term['term_parent'])) $term['term_parent'] = $term['term_parent']['term_id'];\r\n }\r\n if ( empty( $term['term_parent'] ) ) {\r\n $parent = 0;\r\n } else {\r\n $parent = term_exists( $term['term_parent'], $term['term_taxonomy'] );\r\n if ( is_array( $parent ) ) $parent = $parent['term_id'];\r\n }\r\n $description = isset( $term['term_description'] ) ? $term['term_description'] : '';\r\n $termarr = array( 'slug' => $term['slug'], 'description' => $description, 'parent' => intval($parent) );\r\n\r\n $id = wp_insert_term( $term['term_name'], $term['term_taxonomy'], $termarr );\r\n if ( ! is_wp_error( $id ) ) {\r\n $term['term_id'] = $id['term_id']; //by hoang, because we not use import_id feature\r\n if ( !empty($term['term_id']) ){\r\n $this->tracker->add_import('term', ($term), $term );\r\n $this->processed_terms[intval($term['term_id'])] = $id['term_id'];\r\n\r\n }\r\n //bind menu location\r\n if(!empty($term['menu_location']) && class_exists('HW_NAVMENU', false)) {\r\n HW_NAVMENU::set_menu_location($term['menu_location'], $term['term_id']);\r\n }\r\n } else {\r\n printf( __( 'Failed to import %s %s', 'wordpress-importer' ), esc_html($term['term_taxonomy']), esc_html($term['term_name']) );\r\n if ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\r\n echo ': ' . $id->get_error_message();\r\n echo '<br />';\r\n continue;\r\n }\r\n }\r\n\r\n unset( $this->terms );\r\n }", "function er_batch_import_taxonomy($file_path, &$context){\n\t$name = basename($file_path);\n\twatchdog('er', t('Now processing taxonomy: @name', array('@name' => $name)));\n\tmodule_load_include('inc', 'taxonomy', 'includes/taxonomy.export');\n\tif (function_exists('bundle_copy_import_submit')){\n\t\tif (($contents = prep_file_contents($file_path)) !== FALSE){\n\t\t\t$form = array();\n\t\t\t$form_state = array();\n\t\t\t$form_state['values']['macro'] = $contents;\n\t\t\t// for these imports, work gets done in the _validate and _submit functions to do the actual import\n\t\t\tbundle_copy_import_submit('', $form_state); // function doesn't use first arg\n\t\t\t$message = t(\"Taxonomy Vocabulary @name imported successfully.\", array('@name'=>$name));\n\t\t\t$context['message'] = $message;\n\t\t\twatchdog('er', $message);\n\t\t}else{\n\t\t\t$error = \"Taxonomy Vocabulary $name was not imported! File not found or is invalid: $file_path\";\n\t\t\twatchdog('er', $error, NULL, WATCHDOG_CRITICAL);\n\t\t\tdrupal_set_message($error, 'error');\n\t\t}\n\t}else{\n\t\t$error = 'No bundle_copy_import_submit function found, Taxonomy Vocabulary installation cannot proceed.';\n\t\twatchdog('er', $error, NULL, WATCHDOG_CRITICAL);\n\t\tdrupal_set_message($error, 'error');\n\t}\n}", "function drush_iasc_taxonomy_import_terms($file = '', $vocabulary = '') {\n // Start process.\n drush_print('Checking options...');\n\n // If we don't have a file, then don't continue.\n if (empty($file) || !file_exists($file)) {\n drush_set_error('Missing csv file', dt('You need to set the correct path to the file to import.'));\n return;\n }\n\n // If we don't have a proper vocabulary machine name, then don't continue.\n if (empty($vocabulary) || !$vocab = taxonomy_vocabulary_machine_name_load($vocabulary)) {\n return drush_set_error('Missing vocabulary name', dt('The vocabulary machine name is required.'));\n }\n\n // Set required options.\n $options = array();\n $options['file'] = $file;\n $options['vid'] = $vocab->vid;\n\n // Set additional options.\n $delimiter = drush_get_option('delimiter');\n $options['delimiter'] = ($delimiter == NULL) ? ';' : $delimiter;\n\n $enclosure = drush_get_option('enclosure');\n $options['enclosure'] = ($enclosure == NULL) ? '\"' : $enclosure;\n\n $options['delete_terms'] = (drush_get_option('delete-terms') == NULL) ? FALSE : TRUE;\n\n // Login as the admin user.\n global $user;\n $user = user_load(1);\n\n // Setup our batch process.\n $messages = iasc_taxonomy_import($options);\n\n if (count($messages)) {\n foreach ($messages as $message) {\n $msg = str_replace('<br />', \" \\n\", $message);\n drush_log('- ' . $msg, 'error');\n }\n return;\n }\n\n // Process the batch.\n drush_print('Starting import process. Please wait...');\n $batch =& batch_get();\n $batch['progressive'] = FALSE;\n drush_backend_batch_process();\n\n drush_print('Finished importing terms!');\n}", "public function import_terms( $args, $assoc_args ) {\n\n\t\t$taxonomy = $args[0];\n\n\t\t// Bail if a taxonomy isn't specified\n\t\tif ( empty( $taxonomy ) ) {\n\t\t\tWP_CLI::error( __( 'Please specify the taxonomy you would like to import your terms for', 'wp-migration' ) );\n\t\t}\n\n\t\t$filename = $assoc_args['file'];\n\n\t\t// Bail if a filename isn't specified, or the file doesn't exist\n\t\tif ( empty( $filename ) || ! file_exists( $filename ) ) {\n\t\t\tWP_CLI::error( __( 'Please specify the filename of the csv you are trying to import', 'wp-migration' ) );\n\t\t}\n\n\t\t// If the taxonomy doesn't exist, bail\n\t\tif ( false === get_taxonomy( $taxonomy ) ) {\n\t\t\tWP_CLI::error( sprintf( __( 'The taxonomy with the name %s does not exist, please use a taxonomy that does exist', 'wp-migration' ), $taxonomy ) );\n\t\t}\n\n\t\t// Use the wp-cli built in uitility to open up the csv file and position the pointer at the beginning of it.\n\t\t$terms = new \\WP_CLI\\Iterators\\CSV( $filename );\n\n\t\tWP_CLI::success( __( 'Starting import process...', 'wp-migration' ) );\n\t\t$terms_added = 0;\n\n\t\t// Loop through each of the rows in the csv\n\t\tforeach ( $terms as $term_row ) {\n\n\t\t\t// dynamically get the array keys for the row. Essentially a way to reference each of the columns in the row\n\t\t\t$array_keys = array_keys( $term_row );\n\t\t\t$term_parent = '';\n\n\t\t\t$i = 0;\n\n\t\t\t// Loop through each of the columns within the current row we are in\n\t\t\tforeach ( $term_row as $term ) {\n\n\t\t\t\t// If the cell is empty skip it.\n\t\t\t\tif ( empty( $term ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$parent_id = 0;\n\n\t\t\t\t// If we are on the first column of the row, we can skip this since there will be no parent\n\t\t\t\tif ( 0 !== $i ) {\n\n\t\t\t\t\t// Continue looking for a parent until we find one\n\t\t\t\t\tfor ( $count = $i; $count > 0; ++$count ) {\n\n\t\t\t\t\t\t// Find the key for the previous column\n\t\t\t\t\t\t$term_parent_key = $array_keys[ ( $count - 1 ) ];\n\n\t\t\t\t\t\t// move array pointer back one key to find the parent term (if there is one)\n\t\t\t\t\t\t$term_parent = $term_row[ $term_parent_key ];\n\n\t\t\t\t\t\tif ( ! empty( $term_parent ) ) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// If there's a parent term in the cell to the left, find the ID and pass it when creating the term\n\t\t\t\tif ( ! empty( $term_parent ) ) {\n\n\t\t\t\t\t// Retrieve the parent term object by the name in the cell so we can grab the ID.\n\t\t\t\t\tif ( function_exists( 'wpcom_vip_get_term_by' ) ) {\n\t\t\t\t\t\t$parent_obj = wpcom_vip_get_term_by( 'name', $term_parent, $taxonomy );\n\t\t\t\t\t\t$parent_id = $parent_obj->term_id;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$parent_obj = get_term_by( 'name', $term_parent, $taxonomy );\n\t\t\t\t\t\t$parent_id = $parent_obj->term_id;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Find out if the term already exists.\n\t\t\t\tif ( function_exists( 'wpcom_vip_term_exists' ) ) {\n\t\t\t\t\t$term_exists = wpcom_vip_term_exists( $term, $taxonomy, $parent_id );\n\t\t\t\t} else {\n\t\t\t\t\t$term_exists = term_exists( $term, $taxonomy, $parent_id );\n\t\t\t\t}\n\n\t\t\t\t// Don't do anything if the term already exists\n\t\t\t\tif ( ! $term_exists ) {\n\n\t\t\t\t\t// Attempt to insert the term.\n\t\t\t\t\t$result = wp_insert_term( $term, $taxonomy, array( 'parent' => $parent_id ) );\n\n\t\t\t\t\tif ( ! is_wp_error( $result ) ) {\n\t\t\t\t\t\tWP_CLI::success( sprintf( __( 'Successfully added the term: %1$s to the %2$s taxonomy with a parent of: %3$s', 'wp-migration' ), $term, $taxonomy, $term_parent ) );\n\t\t\t\t\t\t$terms_added++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tWP_CLI::warning( sprintf( __( 'Could not add term: %s error printed out below', 'wp-migration' ), $term ) );\n\t\t\t\t\t\tWP_CLI::warning( $result );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$i++;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Woohoo! We made it!\n\t\tWP_CLI::success( sprintf( __( 'Successfully imported %d terms. See the taxonomy structure below', 'wp-migration' ), $terms_added ) );\n\t\t$term_tree = WP_CLI::runcommand( sprintf( 'term list %s --fields=term_id,name,parent', $taxonomy ) );\n\t\techo esc_html( $term_tree );\n\n\t}", "private function import_taxonomy_metas() {\n\t\t$terms = get_terms( get_taxonomies(), [ 'hide_empty' => false ] );\n\t\t$tax_meta = get_option( 'wpseo_taxonomy_meta' );\n\n\t\tforeach ( $terms as $term ) {\n\t\t\t$this->import_taxonomy_description( $tax_meta, $term->taxonomy, $term->term_id );\n\t\t\t$this->import_taxonomy_robots( $tax_meta, $term->taxonomy, $term->term_id );\n\t\t}\n\n\t\tupdate_option( 'wpseo_taxonomy_meta', $tax_meta );\n\t}", "function odinstall_api_create_taxonomy_terms() {\n odinstall_api_create_taxonomy_terms_from_csv();\n}", "function metatag_importer_nodewords_form_submit($form, &$form_state) {\n $types = array_filter($form_state['values']['types']);\n _metatag_importer_import($types);\n}", "public function importTermMeta() {\n\t\tif ( ! aioseo()->db->tableExists( 'yoast_indexable' ) ) {\n\t\t\taioseo()->transients->delete( 'import_term_meta_yoast_seo' );\n\t\t\treturn;\n\t\t}\n\n\t\t$termsPerAction = 100;\n\t\t$publicTaxonomies = implode( \"', '\", aioseo()->helpers->getPublicTaxonomies( true ) );\n\t\t$timeStarted = gmdate( 'Y-m-d H:i:s', aioseo()->transients->get( 'import_term_meta_yoast_seo' ) );\n\n\t\t$terms = aioseo()->db\n\t\t\t->start( 'yoast_indexable' . ' as yi' )\n\t\t\t->select( 'yi.*' )\n\t\t\t->leftJoin( 'aioseo_terms as at', '`yi`.`object_id` = `at`.`term_id`' )\n\t\t\t->where( 'yi.object_type', 'term' )\n\t\t\t->whereRaw( \"( yi.object_sub_type IN ( '$publicTaxonomies' ) )\" )\n\t\t\t->whereRaw( \"( at.term_id IS NULL OR at.updated < '$timeStarted' )\" )\n\t\t\t->orderBy( 'yi.object_id DESC' )\n\t\t\t->limit( $termsPerAction )\n\t\t\t->run()\n\t\t\t->result();\n\n\t\tif ( ! $terms || ! count( $terms ) ) {\n\t\t\taioseo()->transients->delete( 'import_term_meta_yoast_seo' );\n\t\t\treturn;\n\t\t}\n\n\t\t$mappedMeta = [\n\t\t\t'title' => 'title',\n\t\t\t'description' => 'description',\n\t\t\t'canonical' => 'canonical_url',\n\t\t\t'is_robots_noindex' => 'robots_noindex',\n\t\t\t'is_robots_nofollow' => 'robots_nofollow',\n\t\t\t'is_robots_noarchive' => 'robots_noarchive',\n\t\t\t'is_robots_noimageindex' => 'robots_noimageindex',\n\t\t\t'is_robots_nosnippet' => 'robots_nosnippet',\n\t\t\t'open_graph_title' => 'og_title',\n\t\t\t'open_graph_description' => 'og_description',\n\t\t\t'open_graph_image' => 'og_image_custom_url',\n\t\t\t'open_graph_image_source' => 'og_image_type',\n\t\t\t'open_graph_image_meta' => '',\n\t\t\t'twitter_title' => 'twitter_title',\n\t\t\t'twitter_description' => 'twitter_description',\n\t\t\t'twitter_image' => 'twitter_image_custom_url',\n\t\t\t'twitter_image_source' => 'twitter_image_type',\n\t\t];\n\n\t\tforeach ( $terms as $term ) {\n\t\t\t$meta = [\n\t\t\t\t'term_id' => (int) $term->object_id,\n\t\t\t];\n\n\t\t\tforeach ( $mappedMeta as $name => $mapping ) {\n\t\t\t\tif ( empty( $term->$name ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$value = $term->$name;\n\t\t\t\tswitch ( $name ) {\n\t\t\t\t\tcase 'is_robots_noindex':\n\t\t\t\t\tcase 'is_robots_nofollow':\n\t\t\t\t\tcase 'is_robots_noarchive':\n\t\t\t\t\tcase 'is_robots_noimageindex':\n\t\t\t\t\tcase 'is_robots_nosnippet':\n\t\t\t\t\t\tif ( (bool) $value ) {\n\t\t\t\t\t\t\t$meta[ $mapping ] = ! empty( $value );\n\t\t\t\t\t\t\t$meta['robots_default'] = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'open_graph_image':\n\t\t\t\t\t\t$meta['og_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mapping ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'twitter_image':\n\t\t\t\t\t\t$meta['twitter_use_og'] = false;\n\t\t\t\t\t\t$meta['twitter_image_type'] = 'custom_image';\n\t\t\t\t\t\t$meta[ $mapping ] = esc_url( $value );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'open_graph_image_meta':\n\t\t\t\t\t\t$imageMeta = json_decode( $value );\n\t\t\t\t\t\tif ( ! empty( $imageMeta->width ) && intval( $imageMeta->width ) ) {\n\t\t\t\t\t\t\t$meta['og_image_width'] = intval( $imageMeta->width );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( ! empty( $imageMeta->height ) && intval( $imageMeta->height ) ) {\n\t\t\t\t\t\t\t$meta['og_image_height'] = intval( $imageMeta->height );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'title':\n\t\t\t\t\tcase 'description':\n\t\t\t\t\tcase 'open_graph_title':\n\t\t\t\t\tcase 'open_graph_description':\n\t\t\t\t\t\t$value = aioseo()->importExport->yoastSeo->helpers->macrosToSmartTags( $value, null, 'term' );\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$meta[ $mapping ] = esc_html( wp_strip_all_tags( strval( $value ) ) );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$aioseoTerm = Models\\Term::getTerm( (int) $term->object_id );\n\t\t\t$aioseoTerm->set( $meta );\n\t\t\t$aioseoTerm->save();\n\t\t}\n\n\t\tif ( count( $terms ) === $termsPerAction ) {\n\t\t\ttry {\n\t\t\t\tas_schedule_single_action( time() + 5, aioseo()->importExport->yoastSeo->termActionName, [], 'aioseo' );\n\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\t// Do nothing.\n\t\t\t}\n\t\t} else {\n\t\t\taioseo()->transients->delete( 'import_term_meta_yoast_seo' );\n\t\t}\n\t}", "function gsb_feature_migrate_taxonomy_form_submit($form, &$form_state) {\n variable_set('gsb_feature_migrate_taxonomy_import_fid', $form_state['values']['upload']);\n gsb_feature_migrate_taxonomy_import($form_state['complete form']['upload']['#file']->uri);\n}", "public function importTaxonomy($vocabularies = array()){\n\t\t$vocabularies = !empty($vocabularies) ? $vocabularies : $this->vocabularies;\n\t\tif(!empty($vocabularies)){\n\t\t\tforeach($vocabularies as $machine_name => $values){\n\t\t\t\tif(is_array($values)){\n\t\t\t\t\tforeach($values as $type => $data){\n\t\t\t\t\t\tswitch($type){\n\t\t\t\t\t\tcase 'parent':\n\t\t\t\t\t\t\t$exists = taxonomy_vocabulary_machine_name_load($machine_name);\n\t\t\t\t\t\t\tif(!$exists){\n\t\t\t\t\t\t\t\t$this->createTaxonomyVocabulary($data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'children':\n\t\t\t\t\t\t\tif(is_array($values)){\n\t\t\t\t\t\t\t\t$parent_vocabulary = taxonomy_vocabulary_machine_name_load($machine_name);\n\t\t\t\t\t\t\t\t$vid = $parent_vocabulary->vid;\n\t\t\t\t\t\t\t\tforeach($data as $children){\n\t\t\t\t\t\t\t\t\tunset($children->tid);\n\t\t\t\t\t\t\t\t\t$children->vid = $vid;\n\t\t\t\t\t\t\t\t\t$children->parents = $vid;\n\t\t\t\t\t\t\t\t\t$this->createTaxonomyChildren($children);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function ads_import_vocabulary($voc, &$context) {\n // Note: drupal_get_path('profile', 'ads') didn't work here.\n $import_dir = dirname(__FILE__) . '/taxonomy_import/';\n\n // Use Taxonomy CSV to import terms from a file.\n $module_dir = dirname(__FILE__) . '/modules/taxonomy_csv';\n require_once \"$module_dir/import/taxonomy_csv.import.api.inc\";\n\n // Import terms for each voc, where a .csv file exits.\n $filename = $import_dir . $voc->machine_name . '.csv';\n if (!file_exists($filename)) {\n return;\n }\n\n // Set options for import.\n $options['import_format'] = TAXONOMY_CSV_FORMAT_TREE;\n $options['enclosure'] = '\"';\n $options['vocabulary_target'] = 'existing';\n $options['vocabulary_id'] = $voc->vid;\n $options['check_hierarchy'] = FALSE;\n $options['set_hierarchy'] = 1;\n $options['source_choice'] = 'text';\n $options['url'] = $filename;\n taxonomy_csv_import($options);\n\n $context['results'][] = t('Imported terms for vocabulary @voc_name', array('@voc_name' => $voc->name));\n}", "function field_tools_taxonomy_apply_form_submit($form, &$form_state) {\n //dsm($form_state['values']);\n $vocabulary = $form['#vocabulary'];\n $field_name = 'taxonomy_' . $vocabulary->machine_name;\n $field = field_info_field($field_name);\n $field_exists = isset($field);\n\n if (!$field_exists) {\n $field = array(\n 'field_name' => $field_name,\n 'type' => 'taxonomy_term_reference',\n 'cardinality' => ($form_state['values']['multiple'] ? FIELD_CARDINALITY_UNLIMITED : 1),\n 'settings' => array(\n 'allowed_values' => array(\n array(\n 'vocabulary' => $vocabulary->machine_name,\n 'parent' => 0,\n ),\n ),\n ),\n );\n //dsm($field);\n field_create_field($field);\n drupal_set_message(t('Term reference field %field has been created.', array(\n '%field' => $field_name,\n )));\n }\n\n foreach (array_filter($form_state['values']['bundles']) as $option_key) {\n list($entity_type, $bundle_type) = explode(':', $option_key);\n\n if (isset($field['bundles'][$entity_type]) && in_array($bundle_type, $field['bundles'][$entity_type])) {\n // Skip existing instances.\n continue;\n }\n\n $instance = array(\n 'field_name' => $field_name,\n 'entity_type' => $entity_type,\n 'label' => $vocabulary->name,\n 'bundle' => $bundle_type,\n 'description' => $vocabulary->description,\n 'required' => $form_state['values']['required'],\n 'widget' => array(\n 'type' => $form_state['values']['widget_type'],\n ),\n 'display' => array(\n 'default' => array(\n 'type' => 'taxonomy_term_reference_link',\n ),\n ),\n );\n //dsm($instance);\n field_create_instance($instance);\n }\n}", "function cptui_do_convert_taxonomy_terms() {\n\n\t/**\n\t * Whether or not to convert taxonomy terms.\n\t *\n\t * @since 1.4.3\n\t *\n\t * @param bool $value Whether or not to convert.\n\t */\n\tif ( apply_filters( 'cptui_convert_taxonomy_terms', false ) ) {\n\t\tcheck_admin_referer( 'cptui_addedit_taxonomy_nonce_action', 'cptui_addedit_taxonomy_nonce_field' );\n\n\t\tcptui_convert_taxonomy_terms( sanitize_text_field( $_POST['tax_original'] ), sanitize_text_field( $_POST['cpt_custom_tax']['name'] ) );\n\t}\n}", "public function createTaxonomy();", "public function imported_term() {\n\t\t$this->emit_sse_message( array(\n\t\t\t'action' => 'updateDelta',\n\t\t\t'type' => 'terms',\n\t\t\t'delta' => 1,\n\t\t));\n\t}", "function odinstall_api_create_taxonomy_terms_from_csv() {\n module_load_include('inc', 'taxonomy_xml', 'formats/csvancestry_format');\n module_load_include('inc', 'taxonomy_xml', 'formats/csv_format');\n\n $csv_file_prefix = drupal_get_path(\"module\", \"odinstall\") . \"/data/taxonomy_\";\n\n $context = array();\n foreach (array(\n // \"example_taxonomy\",\n ) as $machine_name) {\n // Get text and vocabulary object.\n $text = file_get_contents(\"$csv_file_prefix$machine_name.csv\");\n $vocabulary = taxonomy_vocabulary_machine_name_load($machine_name);\n\n // Function taxonomy_xml_csvancestry_parse() only works in batch mode, so we\n // reproduce its control flow here.\n $rows = explode(\"\\n\", $text);\n // Fake batch context.\n $context[$vocabulary->vid] = array();\n\n // Each row becomes a taxonomy term.\n foreach ($rows as $weight => $row) {\n // Try to get term name; quit if it's blank.\n $row_data = csv_string_to_array($row);\n $term_name = trim($row_data[0]);\n if (!$term_name) {\n continue;\n }\n\n // Even cvsancestry_import_row is rubbish: doesn't preserve weight.\n // (Yes, that's CVSancestry_import_row.)\n $term = (object) array(\n 'vid' => $vocabulary->vid,\n 'name' => $row_data[0],\n 'weight' => $weight,\n );\n\n // Save term and add it to the context to return.\n taxonomy_term_save($term);\n $context[$vocabulary->vid]['new_terms'][] = $term;\n }\n }\n return $context;\n}", "function term_fields_admin_new() {\n\t$form = array();\n\t$vocabs = taxonomy_get_vocabularies();\n\tif (!empty($vocabs)) {\n\t\t$vocabs_select = array();\n\t\tforeach ($vocabs as $key => $value) {\n\t\t\t$vocabs_select[$key] = $value->name;\n\t\t}\n\t\n\t\t$form['vid'] = array(\n\t\t\t'#type' => 'select',\n\t\t\t'#title' => t('Vocabulary'),\n\t\t\t'#options' => $vocabs_select,\n\t\t\t'#description' => t('Choose a vocabulary to assign this field to. Only terms in this vocabulary will\n\t\t\t\t\t\t\t\t\t\t\t\tbe able to use this field. Cannot be changed later.')\n\t\t);\n\t\t$form['fid'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Field ID'),\n\t\t\t'#description' => t('An ID used by Drupal to identify this field. It must be unique. Only alphanumeric characters and underscores allowed. Cannot be changed later.'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#maxlength' => 32\n\t\t);\n\t\t$form['title'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Title'),\n\t\t\t'#description' => t('The readable name of this field. Can be changed later.'),\n\t\t\t'#required' => TRUE,\n\t\t\t'#element_validate' => array('title_validate'),\n\t\t\t'#maxlength' => 50\n\t\t);\n\t\t$form['description'] = array(\n\t\t\t'#type' => 'textfield',\n\t\t\t'#title' => t('Description'),\n\t\t\t'#description' => t('Enter a short description of this field to explain what the field is used for. Can be changed later.'),\n\t\t\t'#maxlength' => 100\n\t\t);\n\t\t$form['type'] = array(\n\t\t\t'#type' => 'radios',\n\t\t\t'#title' => t('Type'),\n\t\t\t'#options' => array(\n\t\t\t\t'textfield' => t('Single row textbox'),\n\t\t\t\t'textarea' => t('Multi-row textarea'),\n\t\t\t\t'numeric' => t('Numeric'),\n\t\t\t\t'select' => t('Select box'),\n\t\t\t\t'date' => t('Date'),\n\t\t\t\t'file' => t('File')\n\t\t\t),\n\t\t\t'#description' => t('Define what type of field to use. Single line textboxes should\n\t\t\t\t\t\t\t\t\t\t\t\t\tbe used for fields such as names and dates, while multi line textareas\n\t\t\t\t\t\t\t\t\t\t\t\t\tshould be used for longer fields, such as biographies. Cannot be changed later.'),\n\t\t\t'#required' => TRUE\n\t\t);\n\t\t$form['weight'] = array(\n\t\t\t'#type' => 'weight',\n\t\t\t'#title' => t('Weight'),\n\t\t\t'#default_value' => 0,\n\t\t\t'#description' => t('Heaveier weighted items get put at the bottom of lists. Can be changed later.')\n\t\t);\n\t\t$form['fields']['submit'] = array(\n\t\t\t'#type' => 'submit',\n\t\t\t'#value' => t('Submit'),\n\t\t);\n\t}\n\telse {\n\t\t$form['empty'] = array(\n\t\t\t'#type' => 'item',\n\t\t\t'#value' => t('You have to !add before you can add fields.', array('!add' => l('add a vocabulary', 'admin/content/taxonomy/add/vocabulary')))\n\t\t);\n\t}\n\treturn $form;\n}", "public function save_taxonomy() {\n\t\tif ( ! is_int( $this->post_id ) ) {\n\t\t\t$tax = json_encode( $this->tax_input );\n\t\t\tLogger::log( \"Can't save taxonomy for {$this->filename} since we haven't saved the post yet, taxonomy is: {$tax}\");\n\t\t\treturn;\n\t\t}\n\n\t\tif ( array_key_exists( 'category_id', $this->tax_input ) ) {\n\t\t\t$category = wp_set_object_terms( $this->post_id, $this->tax_input[ 'category_id' ], 'category' );\n\t\t\t/**\n\t\t\t * We only need to handle WP_Error case since we're setting based on term_id since WP doesn't care if term doesn't exist.\n\t\t\t * We on the other hand DO know that term exists since the IDs are set in Mappings::init();\n\t\t\t */\n\t\t\tif ( is_wp_error( $category ) ) {\n\t\t\t\t$cat_id = $this->tax_input[ 'category_id' ];\n\t\t\t\tLogger::log( \"Unable to add category with ID {$cat_id} to post ID {$this->post_id} for export file: {$this->filename}\");\n\t\t\t}\n\t\t}\n\t\tif ( array_key_exists( 'tags', $this->tax_input ) ) {\n\t\t\t$tags = wp_set_object_terms( $this->post_id, $this->tax_input['tags'], 'post_tag' );\n\t\t\t/**\n\t\t\t * We only need to handle WP_Error case since we're setting based on term_id since WP doesn't care if term doesn't exist.\n\t\t\t * We on the other hand DO know that term exists since the IDs are set in Mappings::init();\n\t\t\t */\n\t\t\tif ( is_wp_error( $tags ) ) {\n\t\t\t\t$tag_ids = json_encode( $this->tax_input[ 'tags' ] );\n\t\t\t\tLogger::log( \"Unable to add tags with IDs {$tag_ids} to post ID {$this->post_id} for export file: {$this->filename}\");\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the categories of a post
public function getPostCategories( $postId );
[ "static function get_post_categories()\n {\n $args = array(\n 'type' => 'post',\n 'orderby' => 'name',\n 'order' => 'ASC',\n 'hide_empty' => 1,\n );\n return get_categories( $args );\n }", "public function getCatPost()\n {\n $db = $this->dbConnect();\n $req = $db->query(\"\n SELECT name, post_id\n FROM cat_post cp\n JOIN categories c ON cp.cat_id = c.id\n JOIN posts p ON cp.post_id = p.id\");\n\n $categories = array();\n\n while ($data = $req->fetch()) {\n $category = new Category();\n $category->hydrate($data);\n $categories[] = $category;\n }\n\n $req->closeCursor(); \n\n return $categories;\n }", "public function getPostCategories($postid)\r\n {\r\n $cat=\"\";\r\n $categories = Cat_relation::where('postid', '=', $postid)->get();\r\n foreach($categories as $category)\r\n {\r\n $cat[]=$category->catid;\r\n }\r\n return $cat;\r\n }", "public function GetPostCategories($post) {\n\t\t$sql = \"SELECT `t1`.`id` AS `id`, `t1`.`name` AS `name` FROM `categories` AS `t1` INNER JOIN `post_category_rel` AS `t2` ON `t2`.`category`=`t1`.`id` WHERE `t2`.`post`=? ORDER BY `t1`.`name`\";\n\t\t$statement = parent::GetSqlManager()->GetStatement($sql);\n\t\t$results = array();\n\t\t\n\t\tif($statement) {\n\t\t\t$statement->bind_param(\"i\", @sprintf((int)$post));\n\t\t\t$statement->execute();\n\t\t\t$statement->bind_result($id, $name);\n\t\t\t\n\t\t\twhile($statement->fetch()) {\n\t\t\t\t$results[count($results)] = array('id'=>$id, 'name'=>$name);\n\t\t\t}\t// end while\n\t\t\t\n\t\t\t$statement->close();\n\t\t}\t// end if\n\t\t\n\t\treturn $results;\n\t}", "public function get_post_categories() {\n $categoryData = get_the_category();\n $categories = array();\n foreach($categoryData as $item) {\n $category = (object) array();\n $category->name = $item->name;\n $category->id = $item->cat_ID;\n $category->slug = $item->slug;\n array_push($categories, $category);\n }\n return $categories;\n }", "public function get_post_categories() {\n\t\tglobal $posts;\n\t\t$categories_as_string = '';\n\n\t\t$categories = get_the_category( $posts[0]->ID );\n\t\tif ( is_array( $categories ) && ! empty( $categories ) ) {\n\t\t\t$category_names = wp_list_pluck( $categories, 'cat_name' );\n\t\t\t$categories_as_string = implode( ', ', $category_names );\n\t\t}\n\n\t\t/**\n\t\t * Filter the categories as derived by this function.\n\t\t *\n\t\t * @param string $categories_as_string The derived category list. Comma-separated list.\n\t\t * @param array $categories The array of post category objects.\n\t\t */\n\t\treturn apply_filters( 'amt_get_the_categories', $categories_as_string, $categories );\n\t}", "public function getCategories()\n {\n return $this->hasMany(Category::className(), ['id' => 'category_id'])->viaTable(self::tablePrefix().'cms_post_category', ['post_id' => 'id']);\n }", "public function postCategories()\n {\n\n $postCategoryGroups = $this->postgroup->postCategoryGroups()->get();\n\n $postCategories = new Collection();\n foreach ($postCategoryGroups as $key => $postCategoryGroup){\n\n $postCategories = $postCategories->concat($postCategoryGroup->postCategories->where(\"language\", \"=\", $this->language));\n }\n\n return $postCategories;\n }", "public static function listCategories()\n\t{\n\t\treturn static::orderBy('name', 'ASC')->with('posts')->get();\n\t}", "public function getPostCategory()\n {\n $blogCat = $this->BlogCategory;\n $set = new ArrayList;\n $leftJoinTable = 'BlogEntry_BlogCategories';\n $leftJoin = '\"BlogEntry_BlogCategories\".\"BlogCategoryID\" = \"BlogCategory\".\"ID\"';\n\n if ($blogCat == null) {\n return false;\n } else {\n foreach(BlogCategory::get()\n ->leftJoin($leftJoinTable, $leftJoin, null)\n ->where('BlogCategoryID = ' . $blogCat) \n as $obj)\n $set->push($obj);\n return $set;\n }\n }", "public function getCategories()\n {\n $table = Engine_Api::_()->getDbTable('categories', 'blog');\n return $table->fetchAll($table->select()->order('category_name ASC'));\n }", "public function getPostCategories($post_id=null)\n\t{\n\t\tif(is_null($post_id)){\n\t\t\t$this->logger->logError('No Post ID provided.','Input Error');\n\t\t\treturn false;\n\t\t}\n\t\t$q = \"SELECT in_categories.category_name FROM in_categories INNER JOIN in_posts_categories \";\n\t\t$q.= \"ON in_categories.id=in_posts_categories.category_id \"; \n\t\t$q.=\"WHERE in_posts_categories.post_id=:post_id\";\n\t\t$vars = array(\n\t\t\t\":post_id\"=>$post_id\n\t\t);\n\t\t$ps = $this->execute($q,$vars);\n\t\t$result = $this->getDataRowsAsArray($ps);\n\t\treturn $result;\n\t}", "public static function getCategories() {\n return Blog::category()->orderBy('name')->all();\n }", "public function getCategories();", "private function getCategories()\n\t{\n\t\t$blogCategories = BlogCategory::where('status', '=', 1)->whereHas('blogPosts', function($query)\n\t\t{\n\t\t\t$query->active();\n\t\t})->get();\n\n\t\treturn $blogCategories;\n\t}", "public static function getPostCategories(int $id){\n $sql='SELECT * FROM categories\n WHERE id IN ( SELECT categoryId FROM postCategories\n WHERE postId=? AND categoryId NOT IN(\n SELECT mainCategory FROM posts\n WHERE id=?))';\n return Db::execute($sql,[$id,$id])->fetchAll();\n }", "public function getCountPostByCat()\n {\n \n $db = $this->dbConnect();\n $req = $db->query(\"SELECT COUNT(post_id) AS post_id, name FROM cat_post cp JOIN categories c ON cp.cat_id = c.id JOIN posts p ON cp.post_id = p.id WHERE published = TRUE GROUP BY name\");\n\n $categories = array();\n\n while ($data = $req->fetch()) {\n $category = new Category();\n $category->hydrate($data);\n $categories[] = $category;\n\n }\n\n $req->closeCursor();\n\n return $categories;\n }", "public static function post_category(){\n \treturn array('1' =>'News','2' =>'Articles','3' =>'Uaa','4' =>'Events','6' =>'Resolution','7' =>'Blog','13' =>'Resources');\t\n }", "private function getPostCategory()\n\t{\n\t\t$default_category=$this->pluginOptions['default_category'];\n\n\t\t$this->categoriesStringToArray();\n\n\t\t$categories=$this->feed_item->categories;\n\n\t\t$this->feed_item->category=$default_category;\n\n\t\tif(count($categories)==0&&count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t$this->feed_item->category='';\n\t\t\t//\n\t\t}\n\t\telse if(count($categories)==0)\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tif($k=='')\n\t\t\t\t{\n\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}\n\t\telse if(count($this->feed->categories_array)==0)\n\t\t{\n\t\t\t//\n\t\t}\n\t\t/* */\n\t\telse\n\t\t{\n\t\t\tforeach($this->feed->categories_array as $k=>$v)\n\t\t\t{\n\t\t\t\tforeach($categories as $cat)\n\t\t\t\t{\n\t\t\t\t\tif($cat==$k||$k=='')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->feed_item->category=$v;\n\t\t\t\t\t}\n\t\t\t\t\tif($cat==$k)\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets claim a group form
public function getClaimForm() { Engine_Api::_()->getApi('Core', 'siteapi')->setView(); $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null; $url = $view->url(array('action' => 'terms'), 'sitegroup_claimgroups', true); $response = array(); $response['info'] = array(); $response['info']['title'] = Engine_Api::_()->getApi('Core', 'siteapi')->translate('Claim a Page'); $response['info']['description'] = Engine_Api::_()->getApi('Core', 'siteapi')->translate('Below, you can file a claim for a group on this community that you believe should be owned by you. Your request will be sent to the administration.'); $response['form'] = array(); // claimer name $response['form'][] = array( 'type' => 'Text', 'name' => 'nickname', 'label' => $this->translate('Your Name'), 'has Validator' => 'true' ); // claimer email $response['form'][] = array( 'type' => 'Text', 'name' => 'email', 'label' => $this->translate('Your Email'), 'has Validator' => 'true' ); // claimer about $response['form'][] = array( 'type' => 'Text', 'name' => 'about', 'label' => $this->translate('About you and the group'), 'has Validator' => 'true' ); // claimer contactno $response['form'][] = array( 'type' => 'Text', 'name' => 'contactno', 'label' => $this->translate('Your Contact number.'), 'has Validator' => 'true' ); // claimer comments $response['form'][] = array( 'type' => 'Text', 'name' => 'usercomments', 'label' => $this->translate('Comments'), ); $description = $description = sprintf(Zend_Registry::get('Zend_Translate')->_("I have read and agree to the <a href='javascript:void(0);' onclick=window.open('%s','mywindow','width=500,height=500')>terms of service</a>."), $url); $response['form'][] = array( 'type' => 'checkbox', 'name' => 'terms', 'label' => $this->translate('Terms of Service'), 'description' => $description, 'hasValidator' => true, ); $response['form'][] = array( 'type' => 'Submit', 'name' => 'send', 'label' => $this->translate('Send'), ); return $response; }
[ "public function getClaim($name);", "public function getClaimForm() {\n Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;\n $url = $view->url(array('action' => 'terms'), 'sitepage_claimpages', true);\n $response = array();\n $response['info'] = array();\n $response['info']['title'] = Engine_Api::_()->getApi('Core', 'siteapi')->translate('Claim a Page');\n $response['info']['description'] = Engine_Api::_()->getApi('Core', 'siteapi')->translate('Below, you can file a claim for a page on this community that you believe should be owned by you. Your request will be sent to the administration.');\n $response['form'] = array();\n\n // claimer name\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'nickname',\n 'label' => $this->translate('Your Name'),\n 'has Validator' => 'true'\n );\n\n // claimer email\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'email',\n 'label' => $this->translate('Your Email'),\n 'has Validator' => 'true'\n );\n\n // claimer about\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'about',\n 'label' => $this->translate('About you and the page'),\n 'has Validator' => 'true'\n );\n\n // claimer contactno\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'contactno',\n 'label' => $this->translate('Your Contact number.'),\n 'has Validator' => 'true'\n );\n\n // claimer comments\n $response['form'][] = array(\n 'type' => 'Text',\n 'name' => 'usercomments',\n 'label' => $this->translate('Comments'),\n );\n\n\n $description = $description = sprintf(Zend_Registry::get('Zend_Translate')->_(\"I have read and agree to the <a href='javascript:void(0);' onclick=window.open('%s','mywindow','width=500,height=500')>terms of service</a>.\"), $url);\n\n\n $response['form'][] = array(\n 'type' => 'checkbox',\n 'name' => 'terms',\n 'label' => $this->translate('Terms of Service'),\n 'description' => $description,\n 'hasValidator' => true,\n );\n\n $response['form'][] = array(\n 'type' => 'Submit',\n 'name' => 'send',\n 'label' => $this->translate('Send'),\n );\n\n return $response;\n }", "public function getClaim($name)\n {\n foreach ($this->claims as $claim) {\n if ($claim->getName() == $name) {\n return $claim;\n }\n }\n return;\n }", "public function get_form( $form_id );", "public function getGroup($group)\n\t{\n\t\treturn $this->get($group);\n\t}", "public function getGroupObject() {\n return $this->groups[0];\n }", "public function getClaim(): string\n {\n return $this->claim;\n }", "public function getGroup() {\n \tif(count($this->groups))\n \t return $this->groups[0]->getName();\n \telse\n \t return null;\n }", "function get_claim($id)\n {\n return $this->db->get_where('claim', array('id' => $id))->row_array();\n }", "function get_assessor_by_group()\n { //check User_login and Pass_login in database\n $sql = \"SELECT *\n\t\t\tFROM pefs_database.pef_group_assessor \n WHERE gro_grp_id =? \n\t\t\t\";\n $query = $this->db->query($sql, array($this->gro_grp_id));\n return $query;\n }", "static function _get_edit_group_quota($group) {\n $record = ORM::factory(\"groups_quota\")->where(\"group_id\", \"=\", $group->id)->find();\n $form = new Forge(\n \"admin/quotas/edit_quota/$group->id\", \"\", \"post\", array(\"id\" => \"g-edit-quota-form\"));\n $group = $form->group(\"edit_quota\")->label(t(\"Edit group quota\"));\n $group->input(\"group_quota\")->label(t(\"Limit (MB)\"))->id(\"g-group_quota\")->value($record->storage_limit / 1024 / 1024)\n ->error_messages(\"required\", t(\"A value is required\"));\n\n $group->submit(\"\")->value(t(\"Save\"));\n return $form;\n }", "public function getGroupDetails()\n {\n\n $whereArray = [\n [\"group_id\", '=', $this->request->input(\"group_id\")]\n ];\n $this->groupModel->setWhere($whereArray);\n $group = $this->groupModel->getData();\n\n return $group;\n }", "function get_group_detail($group_id)\n {\n $data = $this->make_request('groups/'.$group_id, 'GET');\n return $data;\n }", "public function getFormClaimsBatch($form_claims_batch_id = '')\n {\n $data = [];\n $query = $this->db->where('form_claims_batch', $form_claims_batch_id)->get('form_claims_batch');\n $form_claims_batch = $query->result_array();\n if (count($form_claims_batch) > 0) {\n $data = $form_claims_batch;\n }\n\n return $data;\n }", "function has_groups($form) {\n return $form->getGroups();\n}", "private function getAccountGroup()\n {\n return $this->get('session')->get('client.accounts.account_group');\n }", "public function getClaim(string $claimName, $default = null);", "public function getClaimInfo()\n {\n return $this->claimInfo;\n }", "public function getDomainGroupRecord();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
protected $guarded = ['id', 'category_id']; Scope a query to only include news ready for publishing.
public function scopeForPublishing($query) { return $query->where('status', NewsStatus::SCHEDULED) ->where('published_at', '<=', Carbon::now()); }
[ "public static function news(){\r\n\r\n $news = static::whereHas('category', function($query){\r\n $query->where('name','NOT LIKE','A venir');\r\n })\r\n ->where('featured',1)\r\n ->get();\r\n return $news;\r\n }", "public function scopePublished($query){\n \n $query->where('published_at','<=',Carbon::now());\n\n }", "public function scopePublished($query){\n \t$query->where('published_at', '<=', Carbon::now());\n }", "public function scopePublished($query) {\n\t\t$query->where('posted_at', '<=', Carbon::now());\n\t}", "public function scopePublished($query)\n {\n \t$query->where('published_at', '<=', Carbon::now());\n }", "public function scopeUnpub($query){\n \t$query->where('published_at', '>', Carbon::now());\n }", "public function scopePublished($query)\n {\n return $query->where(\"status\", \"=\", 1);\n }", "public function allNewsCategory() {\n $bll = new News();\n $news = $bll->GetNews()->orderBy('news.id', 'desc')->paginate(6);\n// $news = News::select(\"news.*\")->join(\"categories\",\"categories.id\",\"=\",\"news.category_id\")\n// ->where('published', '=', 1)\n// ->where(\"categories.title\" ,\"!=\" , \\App\\Model\\Utility::$whatWeOffer)\n// ->orderBy('news.id', 'desc')->paginate(6);\n// $news = News::paginate(5);\n return view('front.news-category', compact('news'));\n }", "public function scopeUnpublished($query){\n $query->where('published_at', '>=', Carbon::now())->get();\n }", "public function scopeUnpublished($query)\n {\n $query->where('published_at', '>', Carbon::now());\n }", "public function scopeUnpublished($query) \n\t{\n\t\t$query->where('published_at', '>=', Carbon::now());\n\t}", "public function filterByNewsPostsOnly(){\n $this->filter(false, '(ak_alert_warning != 1 AND ak_alert_critical != 1)');\n }", "public static function news()\n {\n return ForumTopic::where('news',1)\n ->where(function ($q){\n $q->whereNull('start_on')\n ->orWhere('start_on', '<=', Carbon::now()->format('Y-M-d'));\n })\n ->whereHas('section', function($q){\n $q->where('is_active', 1)->where('is_general', 1);\n })->orderBy('created_at', 'desc');\n }", "public function scopeVisible($query)\n {\n return $query->where('published_at', '<=', now());\n }", "public function scopePublish($query)\n {\n return $query->where('publish', 1);\n }", "public function scopeUnpublished($query)\n {\n $query->where('published_at', '>', Carbon::now());\n }", "public function scopeUnPublished($query)\n {\n return $query->where('published_at' ,'>',Carbon::now())->orderBy('published_at') ;\n }", "abstract public function commentsExistInNewsToPublish($news_id);", "public function scheduled(){\n return $this->whereStatus(true)\n ->whereArchived(false)\n ->whereDate('published_at','>',\\Carbon\\Carbon::now())\n ->orderBy('published_at', 'desc')\n ->get();\n\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test config for empty title and description.
public function testEmptyTitleDescriptionConfig(): void { $config = $this->processor->processConfiguration($this->configuration, [ 'api_platform' => [], ]); $this->assertSame('', $config['title']); $this->assertSame('', $config['description']); }
[ "function test_no_configuration() {\n\n\t\t// Test with no SEO settings ate all.\n\t\t// Use event as representative sample.\n\t\t$term = get_term_by( 'name', 'event', Wordlift_Entity_Types_Taxonomy_Service::TAXONOMY_NAME );\n\t\t$this->assertEquals( $term->name, 'Event' );\n\t\t$this->assertEquals( $term->description, 'An event.' );\n\n\t\t// Test with empty settings.\n\t\t// Use person as representative sample.\n\t\tupdate_option( 'wl_entity_type_settings', array() );\n\t\t$term = get_term_by( 'name', 'person', Wordlift_Entity_Types_Taxonomy_Service::TAXONOMY_NAME );\n\t\t$this->assertEquals( $term->name, 'Person' );\n\t\t$this->assertEquals( $term->description, 'A person (or a music artist).' );\n\n\t}", "public function testEmptyTitle()\n {\n $expected = ['title' => __('Title can\\'t be empty.')];\n\n $this->assertTrue($this->invalidCategory($expected));\n }", "public function testGetConfig()\n {\n $this->assertNotEmpty($this->module->getConfig());\n }", "public function testGenerateTitleAndDescription()\n {\n $config = array(\n 'title' => 'Hello',\n 'description' => 'World',\n );\n\n $this->generate($config);\n $output = $this->output->fetch();\n $this->assertContains('Hello', $output);\n }", "public function testValidationDefaultDescriptionNotEmpty(): void\n {\n $data = $this->Roles->get(RolesFixture::ID)->toArray();\n $data['description'] = null;\n $validator = $this->Roles->getValidator('default');\n $errors = $validator->validate($data);\n $this->assertCount(1, $errors);\n $this->assertArrayHasKey('description', $errors);\n $this->assertArrayHasKey('_empty', $errors['description']);\n }", "public function testCommandHasADescription()\n {\n self::assertNotEmpty($this->command->getDescription());\n }", "public function testNonExistentDescription()\r\n {\r\n $description = $this->property->getDescription('DOESNOTEXIST');\r\n $this->assertEquals('', $description);\r\n }", "function testEmptyTitle(){\r\n\t\t\t$updateValue = [\r\n\t\t\t\t'title' => '',\r\n\t\t\t\t'start_date' => '2019-5-10',\r\n\t\t\t\t'end_date' => '2019-05-20',\r\n\t\t\t\t'description' => 'This is description.'\r\n\t\t\t];\r\n\t\t\t// values send to testUpdateForm function\r\n\t\t\t$rowCheck = testUpdateForm($updateValue);\r\n\t\t\t//testing with boolean value\r\n\t\t\t$this->assertFalse($rowCheck);\r\n\t\t}", "public function testATaskRequiresADescription()\n {\n $this->signIn();\n\n $this->createTask(['title' => null])\n ->assertSessionHasErrors('title');\n }", "public function testMinimalConfig() {\n $this->assertInstalledConfig([]);\n }", "public function test_can_not_get_config_content_if_config_empty() {\n global $DB;\n\n $this->setAdminUser();\n\n $course = $this->getDataGenerator()->create_course();\n $quiz = $this->create_test_quiz($course, \\quizaccess_seb\\settings_provider::USE_SEB_NO);\n\n $user = $this->getDataGenerator()->create_user();\n $this->getDataGenerator()->enrol_user($user->id, $course->id);\n $this->setUser($user); // Log user in.\n\n $this->expectException(moodle_exception::class);\n $this->expectExceptionMessage(\"No SEB config could be found for quiz with cmid: $quiz->cmid\");\n \\quizaccess_seb\\helper::get_seb_config_content($quiz->cmid);\n }", "public function testOfferDescription(){\r\n\t\t\t$testSpecialOffer =[\r\n\t\t\t\t'title'=>'Dashain Offer',\r\n\t\t\t\t'description' =>'',\r\n\t\t\t\t'start_date' =>'2019-1-9',\r\n\t\t\t\t'end_date' =>'2019-2-3',\r\n\t\t\t\t'image' =>'2.jpg'\r\n\r\n\t\t\t];\r\n\t\t\t$validTest = specialOfferTest($testSpecialOffer);\r\n\t\t\t$this->assertFalse($validTest);\r\n\t\t}", "public function testSlugIsEmptyWithNoTitle() {\n\t\t$this->assertSame('', $this->article->getSlug());\n\t}", "public function testGetConfig()\n {\n if (method_exists($this->module, 'getConfig')) {\n $config = $this->module->getConfig();\n $this->assertNotEmpty($config);\n }\n }", "public function testGetConfig()\n {\n $config = $this->api->getConfig();\n $this->assertTrue(!is_null($config['clientid']), \"Please fill out the configuration files\");\n }", "public function testGettingNonExistentValue()\n {\n $this->assertNull(Config::get('foo', 'bar'));\n $this->assertEquals('baz', Config::get('foo', 'bar', 'baz'));\n $this->assertFalse(Config::has('foo', 'bar'));\n }", "public function is_empty_seo_description() {\n\t\treturn ! $this->get_meta( 'description' );\n\t}", "public function test_config_search_non_configs()\n {\n $this->Test_config_search_non_config(\n 'reaction_names',\n [\n 'systemic' => [\n 0 => 'N',\n 1 => 'Y',\n ],\n 'local' => [\n 0 => 'None',\n 1 => 'Dime',\n 2 => 'Nickel',\n 3 => 'Quarter',\n ]\n ]\n );\n $this->Test_config_search_non_config('enforceLogout', 'F');\n $this->Test_config_search_non_config('allowLogout', 'F');\n $this->Test_config_search_non_config('doQuestions', 'F');\n $this->Test_config_search_non_config('enforceQuestionnaire', 'F');\n $this->Test_config_search_non_config('doDailyInjectionReport', 'F');\n $this->Test_config_search_non_config('questionnaireIdConfirm', 'F');\n }", "public function testWithoutBrowserConfiguration()\n\t{\n\t\t$suite = WithoutBrowserConfig::suite(self::TEST_CASE_WITHOUT_CONFIG);\n\n\t\t$this->assertInstanceOf(self::SUITE_CLASS, $suite);\n\n\t\t$this->checkArray($suite->tests(), 2, self::TEST_CASE_WITHOUT_CONFIG);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get code of the field.
public function getCode() { return $this->code; }
[ "function GetCode()\r\n\t{\r\n\t\treturn $this->m_code;\r\n\t}", "final public function getCode() {\n\t\t$this->prepare();\n\n\t\treturn $this->getSurroundedByLayoutDiv($this->getFieldCode());\n\t}", "public function getCode()\n {\n return isset($this->Code) ? $this->Code : null;\n }", "protected function getCode()\n {\n return $this->request->get('code');\n }", "protected function getCode()\n {\n return $this->request->input('code');\n }", "public function getCode()\n\t{\n\t\tif( isset( $this->values['coupon.code.code'] ) ) {\n\t\t\treturn (string) $this->values['coupon.code.code'];\n\t\t}\n\t}", "public function getCodeFormule()\n {\n return $this->codeFormule;\n }", "function getCode() {\n return $this->getParam(CODE);\n }", "public function code() {\n if(!is_null($this->code)) return $this->code;\n return $this->filterBy('type', 'code');\n }", "function get_codigo()\n\t{\n\t\treturn parent::getCode(false, true);\n\t}", "public function getCodeId()\n {\n return $this->code_id;\n }", "public function getCode(){\n return $this->getParameter('code');\n }", "public function getCodeID()\n {\n return $this->codeID;\n }", "function get_code() {\n\t\treturn $this->get('barcode_object_obj_id').'/'.$this->get('article_id').'/'.$this->id;\n\t}", "function getCodeType() {\n\t\t\treturn $this->codeType;\n\t\t}", "public function getCodeType() {\n return $this->codeType;\n }", "public function getCodeType()\n {\n return $this->codeType;\n }", "public function getCode() : string\n {\n return $this->get( 'product.code', '' );\n }", "public function getFormCode()\n {\n return $this->form_code;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a job object from an ID
public function getJob($id);
[ "public function getJobById($id);", "abstract public function getJob( $id );", "function byId($job) {\n return new Job($this->connector, $this->connector->apiCall(\n \"job.api/get/$job\",\n function($result) { return $result['Job']; }\n ));\n }", "public function getJob($id) {\n $this->setRequestUrl('/job/'.$id);\n $this->setRequestObject(null);\n $this->setRequestMethod('GET');\n\n $job = new Job();\n try {\n return $job->cast($this->execute());\n } catch (Exception $e) {\n throw $e;\n }\n }", "public function find($id) {\n if ($attributes = $this->backend->find($id)) {\n return $this->deserializeJob($attributes);\n }\n }", "public function findJob($id)\n {\n // Todo: implement this method...\n }", "private function get_job($id)\n {\n $query = 'SELECT `jb_id` AS id, `jb_position` AS position, `jb_description` AS description, `jb_status` as status , `jb_created_on` AS crated_on\n FROM `jobs`\n WHERE jb_id = :id';\n $params = array(array(':id', $id, PDO::PARAM_INT));\n $job = $this->db->get_row($query, $params);\n if ($job === false) {\n $job = array('message' => 'Requested job not found');\n }\n\n return $job;\n\n }", "public function getSingleJob($id) //This needs to reflect naturalresourcesjobs.greenrivertech.net (can be called getSingleJob)\r\n {\r\n\r\n $select = \"SELECT * FROM job_table\r\n WHERE job_number=:id\";\r\n\r\n $statement = $this->_pdo->prepare($select);\r\n\r\n $statement->bindValue(':id', $id, PDO::PARAM_INT);\r\n $statement->execute();\r\n\r\n $row = $statement->fetch(PDO::FETCH_ASSOC);\r\n return $row;\r\n }", "public function resolve(string $id): JobInterface;", "public function findJobByID($id) {\n $conn = new DBConnect();\n $dbObj = $conn->getDBConnect();\n $this->DAO = new JobHistoryDAO($dbObj);\n return $this->DAO->findJobByID($id);\n }", "public function getBuild(Job $job, $id);", "public function getJobById($jobId)\n {\n }", "public function getJobPostById($id): JobModel;", "public function getJob();", "function getCronJobInstance($a_job_id)\n\t{\n\t\t$job = new ilViteroLPCronJob();\n\n\t\treturn $job;\n\t}", "public function getJobFromId($identifier)\n {\n return array_key_exists($identifier, $this->identifierToId)\n ? $this->jobs[$identifier]\n : null;\n }", "public function getHoverJobByJobId($id)\n\t{\n\t\treturn $this->model->whereJobId($id)->first();\n\t}", "public function get_job_id()\n\t{\n\t\treturn $this->job->getId();\n\t}", "public function getId()\n {\n return $this->job->getId();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Stores the rights of the current user in session.
private function storeRightsInSession() { $rights = $this->rightsDao->getRightsForUser($this->userService->getUserId()); $rightsAssoc = array(); foreach ($rights as $right) { // Note: we store the serialized version of the right instead of the right itself in session. // This is because in some cases (e.g. Drupal integration), the session will be loaded // before the class is loaded. $rightsAssoc[$right->getName()] = serialize($right); $this->currentUserRights[$right->getName()] = $right; } $_SESSION[$this->sessionPrefix.self::$RIGHTS_SESSION_NAME] = $rightsAssoc; }
[ "public function saveUserLevel()\n {\n $_SESSION[SESSION_AR_USER_LEVEL] = $this->UserLevel;\n $_SESSION[SESSION_AR_USER_LEVEL_PRIV] = $this->UserLevelPriv;\n }", "public function saveToSession()\n {\n $_SESSION[PMF_SESSION_CURRENT_USER] = $this->getUserId();\n }", "public function SetUserToSession(){\n\t\t$_SESSION['user']['id'] = $this->id;\n\t\t$_SESSION['user']['email'] = $this->email;\n\t\t$_SESSION['user']['name'] = $this->name;\n\t\t$_SESSION['user']['role'] = $this->user_role;\n\t}", "public function setSession()\n {\n $_SESSION['user'] = [\n\n\n 'id' => $this->id, \n 'email' => $this->email,\n 'roles' => $this->roles\n\n \n \n ];\n\n }", "function SaveUserLevel() {\r\n\t\t$_SESSION[EW_SESSION_AR_USER_LEVEL] = $this->UserLevel;\r\n\t\t$_SESSION[EW_SESSION_AR_USER_LEVEL_PRIV] = $this->UserLevelPriv;\r\n\t}", "public function setSessionPermissions()\n {\n if (!$this->Session->check('Alaxos.Acl.permissions')) {\n $actions = $this->AclReflector->getAllActions();\n\n $user = $this->Auth->user();\n\n if ($user) {\n $user = array(Configure:: read('acl.aro.user.model') => $user);\n $permissions = array();\n\n foreach ($actions as $action) {\n $aco_path = $this->AclReflector->getRootNodeName() . '/' . $action;\n\n $permissions[$aco_path] = $this->Acl->check($user, $aco_path);\n }\n\n $this->Session->write('Alaxos.Acl.permissions', $permissions);\n }\n }\n }", "public function save()\n {\n // ensure autheticated user is loaded\n if ($this->isAuthenticated()) {\n // get from session\n foreach($this->getPersistKeys() as $key) {\n $this->Session->$key = $this->$key;\n }\n }\n parent::save();\n }", "public function saveToSession()\n {\n $this->destroyUserSession();\n $_SESSION['loggedinuser'] = serialize($this);\n }", "protected function storeInSession() \r\n\t{\r\n\t\t$_SESSION['user_id'] = $this->id;\r\n\t}", "protected function _saveToSession()\n {\n if ($this->_userId && $this->_userDetails)\n {\n $_SESSION[self::SECURITY_SESSION]['userId'] = $this->_userId;\n $_SESSION[self::SECURITY_SESSION]['userDetails'] = $this->_userDetails;\n $_SESSION[self::SECURITY_SESSION]['lastSecurityUpdateTime'] = $this->_lastSecurityUpdateTime;\n $_SESSION[self::SECURITY_SESSION]['lastLoginTime'] = $this->_lastLoginTime;\n }\n else\n {\n unset($_SESSION[self::SECURITY_SESSION]);\n }\n }", "public function saveIntoSession() {\n // Mise en place de la session\n self::startSession() ;\n // Mémorisation de l'Utilisateur\n $_SESSION[self::session_key]['admin'] = $this ;\n\n }", "public function setSessionFromUser()\n {\n $_SESSION['userData'] = $this;\n }", "public function SetUserToSession(){\n\t\t$_SESSION['user']['id'] = $this->id;\n\t\t$_SESSION['user']['user_name'] = $this->user_name;\n\t\t$_SESSION['user']['email'] = $this->email;\n\t\t$_SESSION['user']['l_name'] = $this->l_name;\n\t\t$_SESSION['user']['f_name'] = $this->f_name;\n\t\t$_SESSION['user']['name'] = $this->f_name.\" \".$this->l_name;\n\t}", "public function updateSession()\n {\n if (!isset($_SESSION)) {\n session_start();\n }\n $_SESSION['user'] = $this;\n }", "function SaveUserLevel()\n{\n\t$_SESSION[ewSessionArUserLevel] = $GLOBALS[\"arUserLevel\"];\n\t$_SESSION[ewSessionArUserLevelPriv] = $GLOBALS[\"arUserLevelPriv\"];\n}", "private function storeSessionData()\r\n {\r\n $_SESSION['user'] = serialize($this);\r\n }", "private function saveToSession($user) {\n $_SESSION[Constants::USER_SESSION_VAR] = $user->getAttributes();\n }", "protected function storeSessionData()\n\t{\n\t\t$this->sessionData[ 'formData' ] = $this->formData;\n\t\t$this->sessionData[ 'passedActionMethodNames' ] = $this->passedActionMethodNames;\n \n\t\t$GLOBALS[ 'TSFE' ]->fe_user->setKey( 'ses', $this->sessionDataStorageKey, $this->sessionData );\n\t\t$GLOBALS[ 'TSFE' ]->fe_user->storeSessionData();\n\t}", "public static function persist()\n {\n $GLOBALS['TSFE']->fe_user->storeSessionData();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Override method from Project so you can select by first letter of name.
function proj_initial_popup_selection_method() { # can be overridden by child class return 'select_by_first_letter_of_name'; }
[ "function GetName()\n {\n if(strlen($this->Name)>0)\n {\n return $this->Name;\n }\n\n if(!$this->Id)\n {\n echo \"SubProject GetName(): Id not set\";\n return false;\n }\n\n $project = pdo_query(\"SELECT name FROM subproject WHERE id=\".qnum($this->Id));\n if(!$project)\n {\n add_last_sql_error(\"SubProject GetName\");\n return false;\n }\n $project_array = pdo_fetch_array($project);\n $this->Name = $project_array['name'];\n\n return $this->Name;\n }", "function getProjectThatBelongsToAGivenDelta($project_name){\n\t\t$project_arr = explode(\"_\",$project_name);\n\t\tif(count($project_arr)>0){\n\t\t\treturn $project_arr[0];\n\t\t}else{\n\t\t\treturn \"\";\n\t\t}\n\t}", "public function dropdown_project()\n {\n $sql = \"SELECT DISTINCT P_Name_ind {$this->sql_from()} {$this->sql_where()} ORDER BY P_Name_ind ASC\";\n $rows = \\NMI::db()->query($sql)->fetchAll();\n return \\Arr::assoc_to_keyval($rows, 'P_Name_ind', 'P_Name_ind');\n }", "protected function determineName()\n {\n return Str::slug(Helpers::ask(\n 'What is the name of this project',\n basename(Path::current())\n ));\n }", "function getSelect($name)\n {\n return $name;\n }", "public function getProjectName()\r\n {\r\n return $this->project_name;\r\n }", "function find_projects_like($name) {\n\t\t$query = \"SELECT name FROM projects WHERE name LIKE '%\".$name.\"%' AND public='1' LIMIT 10\"; \n\t\t$statement = $this->conn->prepare($query); \n\t\t$statement->execute();\n\t\treturn $statement->fetchAll();\n\t}", "function deltaList_selectAnProject($delta_name){\n\t\tfor($i=0;$i<count($this->deltas_list);$i++){\n\t\t\tif($this->deltas_list[$i]['name']==$delta_name){\n\t\t\t\t$this->deltas_list[$i]['selected'] = true;\n\t\t\t}else{\n\t\t\t\t$this->deltas_list[$i]['selected'] = false;\n\t\t\t}\n\t\t}\n\t}", "public function getProjectName()\n {\n \treturn $this->projectName;\n }", "public function getNamePart() {}", "public static function get_project_name() : string {\n return 'whatever';\n }", "public function getProjectLower(): string\n {\n return $this->projectLower;\n }", "public function projectsIDName(){\n\t\t\t\n\t\t$sql = \"select id, name from core_projects\";\n\t\t$projects = $this->runRequest($sql);\n\t\treturn $projects->fetchAll();\n\t}", "function project_get_name( $project_id ) {\n\n\tglobal $db;\n\n\t$project_tbl \t\t\t\t= PROJECT_TBL;\n\t$f_proj_id\t\t\t\t\t= $project_tbl .'.'. PROJ_ID;\n\t$f_proj_name\t\t\t\t= $project_tbl .'.'. PROJ_NAME;\n\n\t$q = \"\tSELECT\t$f_proj_name\n\t\t\tFROM\t$project_tbl\n\t\t\tWHERE\t$f_proj_id = '$project_id'\";\n\n\t$row = db_fetch_row($db, db_query($db, $q));\n\treturn $row[PROJ_NAME];\n}", "function findByNameTest()\n {\n $productDao = new ProductDao();\n return $productDao->findByName(\"trung\");\n }", "function getProjectName($projectsid)\n{\n\tglobal $log;\n\t$log->debug(\"Entering getProjectName() method ...\");\n\t$projectname = \"\";\n\tif($projectsid != \"\") {\n\t\tglobal $adb;\n\t\t$sql = \"select projectname from ec_projects where projectsid=\".$projectsid;\n\t\t$result = $adb->query($sql);\n\t\t$projectname = $adb->query_result($result,0,\"projectname\");\n\n\t}\n\t$log->debug(\"Exiting getProjectName method ...\");\n\treturn $projectname;\n}", "private function getNewNameProject() {\n\t\treturn 'my_new_project_name';\n\t}", "public function getByName($name);", "public function projectionName(): string;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Only administrators can create resources.
public function testOnlyAdminUsersCanCreateResources() { $admin = factory(User::class)->states('admin')->create(); $user = factory(User::class)->create(); $this->assertTrue($admin->can('create', Resource::class)); $this->assertFalse($user->can('create', Resource::class)); }
[ "public function testNonAdminUsersCanNotStoreResources(): void\n {\n $user = User::factory()->create();\n\n $this->storeResource([], $user)\n ->assertStatus(403);\n\n $this->assertCount(0, Resource::all());\n }", "public function testNonAdminUsersCanNotStoreResources()\n {\n $user = factory(User::class)->create();\n $resource = factory(Resource::class)->make();\n\n $response = $this->actingAs($user)->post('resources', [\n 'name' => $resource->name,\n ]);\n\n $response->assertStatus(403);\n $this->assertDatabaseMissing('resources', [\n 'name' => $resource->name,\n ]);\n }", "function allow_create_users()\n {\n }", "private function checkCreateRight() {\n // Check if user can write anonymously a comment\n if ($this->container->getParameter(ARVBlogParameters::IS_SECURE)) {\n if (!$this->container->getParameter(ARVBlogParameters::WRITE_AS_ANONYMOUS)) {\n $this->denyAccessUnlessGranted(ARVBlogRoles::ROLE_USER, null, 'arv.blog.exception.forbidden');\n }\n }\n }", "private function createAdmin()\n {\n $adminRole = Role::create(['name' => 'admin']);\n $adminRole->givePermissionTo(Permission::all());\n }", "public function testOnlyAdminUsersCanViewAResource()\n {\n $admin = factory(User::class)->states('admin')->create();\n $user = factory(User::class)->create();\n\n $resource = factory(Resource::class)->create();\n\n $this->assertTrue($admin->can('view', $resource));\n $this->assertFalse($user->can('view', $resource));\n }", "public function canCreateAccounts()\n\t{\n\t\treturn false;\n\t}", "function canCreateAccounts() {\r\n\t\treturn false;\r\n\t}", "public function allowAction()\n {\n $roleName = $this->getOption('n');\n $resourceName = $this->getOption('r');\n\n $acl = $this->getAcl();\n\n $role = $acl->getRole($roleName);\n $resource = $acl->getResource($resourceName);\n\n $access = $this->getOption('a');\n if ($access && !$resource->hasAccess($access)) {\n throw new ResourceNotExistsException($access);\n }\n $accessList = $access ? [$access] : array_keys($resource->getAccesses());\n\n foreach ($accessList as $access) {\n $acl->allow($role->getName(), $resource->getName(), $access);\n }\n\n $this->putText('Success.');\n }", "public static function admin_only() {\n\t\tif ( ! User::is_admin() ) {\n\t\t\twp_die( '{ \"error\": \"Insufficient permissions\" }', '', 403 );\n\t\t}\n\t}", "function canCreateAccounts () {\n return false;\n }", "public function testOnlyAdminUsersCanDeleteAResource(): void\n {\n $admin = User::factory()->admin()->create();\n $user = User::factory()->create();\n\n $resource = Resource::factory()->create();\n\n $this->assertTrue($admin->can('delete', $resource));\n $this->assertFalse($user->can('delete', $resource));\n }", "protected function canCreate()\n {\n return Mage::helper('analytic_dashboard')->isSectionAllowed('dashboards_create');\n }", "public function testOnlyAdminUsersCanDeleteAResource()\n {\n $admin = factory(User::class)->states('admin')->create();\n $user = factory(User::class)->create();\n\n $resource = factory(Resource::class)->create();\n\n $this->assertTrue($admin->can('delete', $resource));\n $this->assertFalse($user->can('delete', $resource));\n }", "public function canCreate()\n {\n return $this->permission('create');\n }", "protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Layout());\n }", "protected function ensureAdminRoleIfRequested() {}", "public function testAdminCantCreate()\n {\n $user = User::findOrFail(\"1\"); // Gets root admin user.\n $this->be($user); // Mocks Auth::user with this user.\n\n $this->assertTrue(ModulePermission::canCreate());\n }", "public function cannotCreate() {\n\t\treturn !$this->canCreate($author);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set which player will use the given wonder in a round
public function setWonder($round, $wonder, $player) { // Set up the query on the first run if (!isset($this->queries['setWonder'])) { $this->queries['setWonder'] = $this->db->prepare( 'INSERT INTO Games (RoundNum, WonderID, PlayerID) VALUES(?, ?, ?)'); } $this->queries['setWonder']->execute($round, $wonder, $player); }
[ "public function setWins()\n {\n $this->wins++;\n }", "public function set_winner()\n {\n if ($this->red->get_size() <= 0) {\n $this->winner = $this->blue;\n } elseif ($this->blue->get_size() <= 0) {\n $this->winner = $this->red;\n }\n }", "public function setWinner(Player $winning_player) {\n $this->gameOver($winning_player);\n }", "public function setUsing($wonders)\n\t{\n\t\t$this->db->query('UPDATE Wonders SET WonderUse = 0');\n\n\t\t$seats = range(1, count($wonders));\n\n\t\t$q = $this->db->prepare(\n\t\t\t\t'UPDATE\tWonders\n\t\t\t\tSET\t\tWonderUse = 1,\n\t\t\t\t\t\tWonderSide = ?,\n\t\t\t\t\t\tSeatNum = ?\n\t\t\t\tWHERE\tWonderID = ?');\n\t\tforeach($wonders AS $id)\n\t\t{\n\t\t\t$side = mt_rand(1,2) == 1 ? 'A' : 'B';\n\n\t\t\t$seatID = array_rand($seats);\n\t\t\t$q->execute($side, $seats[$seatID], $id);\n\t\t\tunset($seats[$seatID]);\n\t\t}\n\t}", "public function win()\n {\n $this->totalWins++;\n }", "public function placeMatch($won){\n\t\tif($won)\n\t\t\t$winLoss+=1;\n\t\telse if(!$won)\n\t\t\t$winLoss-=1;\n\t}", "public function setWinners($winners)\n\t{\n\t\t$this->winners = $winners;\n\t}", "public function changeCurrentPlayerGame(): void\n {\n if ($this->gameRound->getCurrentPlayer() === \"You\") {\n $this->createNewGameRoundGame(\"Computer\");\n } else {\n $this->createNewGameRoundGame(\"You\");\n }\n }", "private function nextPlayer() {\r\n if($this->playersTurn == 'x'){\r\n if($this->gameType == 'single')\r\n $this->cpuTurn = true;\r\n $this->playersTurn = 'o';\r\n } else {\r\n if($this->gameType == 'single')\r\n $this->cpuTurn = false;\r\n $this->playersTurn = 'x';\r\n }\r\n }", "private function setNextPlayer(): void {\n $this->currentPlayer++;\n if ($this->currentPlayer >= count($this->players)) {\n $this->currentPlayer = 0;\n }\n }", "public function decideWhoStarts() : void\n {\n $startHand = new Hand();\n $startHand->setup();\n foreach (array_keys($this->players) as $player) {\n $startHand->rollDice();\n $diceFace = $startHand->showHand()[0];\n if ($this->winningThrow == 0 || $diceFace > $this->winningThrow) {\n $this->winningThrow = $diceFace;\n $this->playersTurn = $player;\n }\n }\n }", "private function playTurn(){\n echo(PHP_EOL.\"New turn!\".PHP_EOL);\n $punchNumber = random_int(0, 100);\n if($this->isPlayerOnesTurn){\n $this->applyTurnsEffects($punchNumber, $this->playerOne, $this->playerTwo);\n }else{\n $this->applyTurnsEffects($punchNumber, $this->playerTwo, $this->playerOne);\n }\n $this->isPlayerOnesTurn = !$this->isPlayerOnesTurn;\n echo(\"\\t- \".$this->playerOne->toString().PHP_EOL);\n echo(\"\\t- \".$this->playerTwo->toString().PHP_EOL);\n }", "public function setPlayerNumber($num)\n {\n $this->palyerNumber = $num;\n }", "public function play_round()\n {\n foreach ( $this->matches as $match ) {\n $winner = $match->battle();\n array_push($this->winners, $winner);\n }\n return $this->winners;\n }", "public function IncreaseRounds(){\n $this->rounds++;\n }", "function countScores() //todo if none busted and dealer has more point no one wins. <- this solution ugly af\n {\n $playerPoints = $this->player->calculatePoints();\n $dealerPoints = $this->dealer->calculatePoints();\n\n if ($dealerPoints > $playerPoints && $dealerPoints <= $this->maxWinningValue) {\n $this->setWinner($this->dealer);\n } elseif ($dealerPoints === $playerPoints) {\n $this->setWinner('Tie');\n }\n }", "public function testRoundSetScore()\n {\n $player = new Player();\n $diceRound = new DiceRound($player, 10);\n\n $diceRound->setRoundScore(10);\n $res = $diceRound->getRoundScore();\n $exp = 20;\n $this->assertEquals($exp, $res);\n }", "public function playChallenge($players){\n $matches = $this->winChances($players);\n //once again we are using intervals to check for a winner\n $count = 0;\n //pick a random number (between 0 and 100 since we are using percent)\n $rand = rand(0,100);\n \n //then check which player interval contains the random number\n foreach($matches as $match){\n if(\n $rand >= $count && \n $rand <= $match[\"winChancePercent\"] + $count\n ){\n //if a players interval contains the random number\n // we have a winner, end function using return\n return $match[\"player\"];\n } else {\n //if not a winner, find out how close to winning they were\n }\n //if this player was not a winner, increase interval and try again...\n $count += $match[\"winChancePercent\"];\n }\n }", "public function saveRound(string $winner): void\n {\n if (isset($_SESSION[$winner])) {\n $_SESSION[$winner] = $_SESSION[$winner] + 1;\n return;\n }\n $_SESSION[$winner] = 1;\n return;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reputationReportWithHttpInfo Report: report spam calls received to better tune our algorithms based upon spam calls you receive
public function reputationReportWithHttpInfo($call_report) { // verify the required parameter 'call_report' is set if ($call_report === null) { throw new \InvalidArgumentException('Missing the required parameter $call_report when calling reputationReport'); } // parse inputs $resourcePath = "/api/2015-11-01/Report"; $httpBody = ''; $queryParams = array(); $headerParams = array(); $formParams = array(); $_header_accept = ApiClient::selectHeaderAccept(array('application/json', 'text/json', 'application/xml', 'text/xml')); if (!is_null($_header_accept)) { $headerParams['Accept'] = $_header_accept; } $headerParams['Content-Type'] = ApiClient::selectHeaderContentType(array('application/json','text/json','application/xml','text/xml','application/x-www-form-urlencoded')); // default format to json $resourcePath = str_replace("{format}", "json", $resourcePath); // body params $_tempBody = null; if (isset($call_report)) { $_tempBody = $call_report; } // for model (json/xml) if (isset($_tempBody)) { $httpBody = $_tempBody; // $_tempBody is the method argument, if present } elseif (count($formParams) > 0) { $httpBody = $formParams; // for HTTP post (form) } // make the API Call try { list($response, $statusCode, $httpHeader) = $this->apiClient->callApi( $resourcePath, 'POST', $queryParams, $httpBody, $headerParams ); return array(null, $statusCode, $httpHeader); } catch (ApiException $e) { switch ($e->getCode()) { } throw $e; } }
[ "function getReputation($app=array(APPLICATION_NAME), $producer=array()){\r\n\r\n\t$rep = new ReputationSimple($app, $producer);\r\n\t$res = $rep->send();\r\n\tif($res->status != 200) {\r\n\t\tthrow new Exception($res->description);\r\n\t} else {\r\n\t\treturn formatReputation($res->dataObject->reputation);\r\n\t}\r\n}", "public static function calculate_reputation($id);", "private function getReputation($resultList) {\r\n\t\tforeach($resultList as $item) :\r\n\t\t\t\r\n\t\t$request = new Request(\"ReputationRequestHandler\", READ);\r\n\t\t$request->addArgument(\"application\", APPLICATION_NAME);\r\n\t\t$request->addArgument(\"producer\", $item->id.$item->publisherID);\r\n\t\t$request->addArgument(\"consumer\", $_SESSION['user']->id);\r\n\t\r\n\t\t$responsejSon = $request->send();\r\n\t\t$responseObject = json_decode($responsejSon);\r\n\t\r\n\t\tif (isset($responseObject->data->reputation)) {\r\n\t\t\t$value = json_decode($responseObject->data->reputation) * 100;\r\n\t\t} else {\r\n\t\t\t$value = 100;\r\n\t\t}\r\n\t\r\n\t\t// Save reputation values\r\n\t\t$this->reputationMap[$item->id.$item->publisherID] = $value;\r\n\t\t$this->noOfRatesMap[$item->id.$item->publisherID] = $responseObject->dataObject->reputation->noOfRatings;\r\n\t\r\n\t\tendforeach;\r\n\t\r\n\t}", "public static function Google_PR($host)\r\n\t{\r\n\t\t$domain = 'http://'.$host;\r\n\t\tif(USE_PAGERANK_CHECKSUM_API == true)\r\n\t\t{\r\n\t\t\t$str = SEOstats::cURL( SEOstats::PAGERANK_CHECKSUM_API_URI . $domain );\r\n\t\t\t$data = json_decode($str);\r\n\r\n\t\t\t$checksum = $data->CH;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$checksum = self::genhash($domain);\r\n\t\t}\r\n\t\t$googleurl = 'http://toolbarqueries.google.com/search?features=Rank&sourceid=navclient-ff&client=navclient-auto-ff';\r\n\t\t$googleurl .= '&googleip=O;66.249.81.104;104&ch='.$checksum.'&q=info:'.urlencode($domain);\r\n\t\t$out = SEOstats::cURL($googleurl);\r\n\t\t\r\n\t\t$pagerank = trim(substr($out, 9));\t\r\n\t\tif (!preg_match('/^[0-9]/',$pagerank))\r\n\t\t{\r\n\t\t\t$pagerank = 'Failed to generate a valid hash for PR check.';\r\n\t\t}\r\n\t\treturn $pagerank;\r\n\t}", "public function get_info() {\n $this->numgetinfocalls++;\n if ($this->numgetinfocalls <= 3) {\n return array('http_code' => 429);\n }\n return array('http_code' => 200);\n }", "function send_statistics($action)\n {\n try {\n $api = new WebAPI('publicapi', 'publicapi');\n\n $phone = new SimpleXMLElement('<request></request>');\n $phone->addChild('action', 'stats');\n $phone->addChild('application', 'AdMangler');\n $phone->addChild('version', $this->codeVersion);\n $phone->addChild('database', $this->dbVersion);\n $phone->addChild('status', $action);\n $phone->addChild('domain', urlencode($_SERVER['SERVER_NAME']));\n $api->add_request($phone);\n $api->request();\n //file_put_contents(dirname(__FILE__).\"/log.txt\", var_export($api, true). \"\\n\", FILE_APPEND);\n } catch (Exception $e) { /*file_put_contents(dirname(__FILE__).\"/log.txt\", var_export($e, true). \"\\n\", FILE_APPEND);*//* Fail quitely */ }\n \n }", "function Users_GetUserBadges($id){\n\t$db = new Db;\n\t$badges_html = '';\n\t$all_posts_count = count($db->get_results(\"SELECT * FROM \" . TABLES_PREFIX . \"posts WHERE user_id =\".intval($id) ));\n\t$started_threads_count = count($db->get_results(\"SELECT * FROM \" . TABLES_PREFIX . \"posts WHERE is_question = 'y' AND user_id =\".intval($id) ));\n\t$replies_count = $all_posts_count - $started_threads_count;\n\t$months_query = $db->get_var(\"SELECT added_on FROM \" . TABLES_PREFIX . \"users WHERE id = \" . intval($id));\n\tif($months_query){\n\t\t$months_count = intval(floor(abs(time() - strtotime($months_query))/(60*60*24*30)));\n\t}else{\n\t\t$months_count = 0;\n\t}\n\t\n\t$achievements_query = $db->get_var(\"SELECT achievements FROM \" . TABLES_PREFIX . \"users WHERE id = \" . intval($id));\n\tif($achievements_query){\n\t\t$achievements_array = unserialize($achievements_query);\n\t\t$manual_achievements = $db->get_results(\"SELECT * FROM \" . TABLES_PREFIX . \"achievements WHERE id IN ( \". implode(\",\", $achievements_array) .\")\");\n\t\tif($manual_achievements){\n\t\t\tforeach($manual_achievements as $b){\n\t\t\t\t$badges_html .= '<img src=\"'.FORUM_URL.$b->icon.'\" title=\"' . $b->name . '\"/>&nbsp;';\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\t$all_posts_badge = $db->get_results(\"SELECT * FROM \" . TABLES_PREFIX . \"achievements WHERE type = 'all_posts' AND start_from <= $all_posts_count AND end_at >= $all_posts_count\");\n\t$started_threads_badge = $db->get_results(\"SELECT * FROM \" . TABLES_PREFIX . \"achievements WHERE type = 'started_threads' AND start_from <= $started_threads_count AND end_at >= $started_threads_count\");\n\t$replies_badge = $db->get_results(\"SELECT * FROM \" . TABLES_PREFIX . \"achievements WHERE type = 'replies' AND start_from <= $replies_count AND end_at >= $replies_count\");\n\t\n\t$months_badge = $db->get_results(\"SELECT * FROM \" . TABLES_PREFIX . \"achievements WHERE type = 'membership_time' AND start_from <= $months_count AND end_at >= $months_count\");\n\t\n\tif($all_posts_badge){\n\t\tforeach($all_posts_badge as $b){\n\t\t\t$badges_html .= '<img src=\"'.FORUM_URL.$b->icon.'\" title=\"' . $b->name . '\"/>&nbsp;';\n\t\t}\n\t}\n\t\n\tif($started_threads_badge){\n\t\tforeach($started_threads_badge as $b){\n\t\t\t$badges_html .= '<img src=\"'.FORUM_URL.$b->icon.'\" title=\"' . $b->name . '\"/>&nbsp;';\n\t\t}\n\t}\n\t\n\tif($replies_badge){\n\t\tforeach($replies_badge as $b){\n\t\t\t$badges_html .= '<img src=\"'.FORUM_URL.$b->icon.'\" title=\"' . $b->name . '\"/>&nbsp;';\n\t\t}\n\t}\n\tif($months_badge){\n\t\tforeach($months_badge as $b){\n\t\t\t$badges_html .= '<img src=\"'.FORUM_URL.$b->icon.'\" title=\"' . $b->name . '\"/>&nbsp;';\n\t\t}\n\t}\n\treturn $badges_html;\n}", "function limit_reached($response);", "function getOverallInternetBallance();", "public function badgesAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $systemConfig = $this->view->systemConfig;\n $validator = $this->view->validator;\n\n $this->view->format = 'json';\n\n $validator->checkOAuthToken( $site, 'read', false, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors', 0, self::HTTP_RC_BAD_REQUEST );\n }\n\n // set the input params\n $requiredParams = array(\n 'appKey',\n );\n\n $optionalParams = array(\n 'status',\n 'count',\n 'offset',\n );\n\n $input = $this->processInput( $requiredParams, $optionalParams, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors', 0, self::HTTP_RC_BAD_REQUEST );\n }\n\n // get the values\n $status = !empty($input->status) ? $input->status : 'active';\n $count = $input->count ? $input->count : 25;\n $offset = $input->offset ? $input->offset : 0;\n\n // get the response data object\n $responseData = $site->getFactory()->getResponseData();\n $responseData->addSiteBadges( $site, $status );\n $this->view->responseData = $responseData;\n\n return $this->renderPage( 'responseData', $systemConfig->getSetting( 'SYSTEM_API_HTTP_CACHE_TTL' ) );\n }", "function generateStatsByReferringUrl()\n\t{\n\t\t$return = array();\n\t\t$res = $this->db->query(\"select referring_url, uniq from Hit,ReferringUrls where Hit.ReferringUrl_id = ReferringUrls.id and affiliate_id=? and hit_type='first' and datetime >= ? and datetime<=?\", array($this->getAffiliateId(), $this->getBeginDate(), $this->getEndDate()));\n\t\tif(DB::isError($res))\n\t\t\tprint_r($res);\n\t\twhile(list($refurl, $uniq) = $res->fetchRow())\n\t\t{\n\t\t\tif(!$refurl)\n\t\t\t\t$refurl = 'No Ref URL';\n\t\t\t$return[$refurl]['hits']++;\n\t\t\tif($uniq)\n\t\t\t\t$return[$refurl]['uniques']++;\t\n\t\t\t\t\n\t\t\t$return[$refurl]['signups'] = 0;\n\t\t\t$return[$refurl]['ratio'] = \"0:\" . $return[$refurl]['uniques'];\n\t\t}\n\n\t\t$res = $this->db->query(\"select ReferringUrls.referring_url, Sale.id, Sale.affiliate_payout from Sale, Hit,ReferringUrls where Hit.id=Sale.hits_id and Hit.ReferringUrl_id=ReferringUrls.id and Sale.type='newsale' and Sale.affiliate_id=? and Sale.datetime >= ? and Sale.datetime<=?\", array($this->getAffiliateId(), $this->getBeginDate(), $this->getEndDate()));\t\n\t\tif(DB::isError($res))\n\t\t\tprint_r($res);\n\t\twhile(list($refurl, $id, $income) = $res->fetchRow())\n\t\t{\n\t\t\tif(!$refurl)\n\t\t\t\t$refurl = 'No Ref URL';\n\t\t\t$return[$refurl]['signups']++;\n\t\t\t$return[$refurl]['income']+=$income;\n\t\t\t$return[$refurl]['ratio']= $this->getRatio($return[$refurl]['uniques'], $return[$refurl]['signups']);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "function overall_hit_rate() {\n $db = new database();\n $db->dblink();\n\n // get the number of hits\n $hit_result = $db->get_recs(\"trials\", \"hit\", \"status='\".COMPLETE.\"' AND \".\n \"hit='\".HIT.\"'\");\n $hit_recs = $db->fetch_objects($hit_result);\n $hits = count($hit_recs);\n\n // count the total number of completed trials\n $complete_trials = count_completed_trials();\n\n // calculate and return the hit rate as a percentage\n return round(($hits / $complete_trials) * 100, 2);\n}", "public function actionStatistics() {\n try {\n $response = array('success' => FALSE, 'msg' => '');\n $disucssionId = '';\n $preparedData = array();\n if (array_key_exists('id', $_GET)) {\n $disucssionId = $_GET['id'];\n }\n $discussion = new Discussion;\n $discussion->id = $disucssionId;\n $discussionInfo = $discussion->getDiscussionDetail();\n $staticsPoint = array();\n $graphData = array('age' => array(), 'age_range' => array(), 'sex' => array(),\n 'education_level' => array(), 'citizenship' => array(), 'work' => array(),\n 'public_authority' => array(), 'residence' => array(), 'profession' => array(),\n 'association' => array());\n $finalArr = array();\n $canAccessReport = checkPermission('access_report');\n if ($canAccessReport == false || !ctype_digit($disucssionId)) {\n $this->redirect(BASE_URL);\n }\n Yii::app()->clientScript->registerCssFile(THEME_URL . 'css/bootstrap.css');\n $this->setHeader('2.0');\n if (isModuleExist('backendconnector') == false) {\n throw new Exception(Yii::t('discussion', 'backendconnector module is missing'));\n }\n $module = Yii::app()->getModule('backendconnector');\n if (empty($module)) {\n throw new Exception(Yii::t('discussion', 'backendconnector module is missing or not defined'));\n }\n if (defined('STATS')) {\n $staticsPoint = json_decode(STATS, TRUE);\n }\n $discussionDetail = $this->_getDiscussionProposalOpinionAndAuthor($disucssionId);\n $question = json_decode(ADDITIONAL_INFORMATION, TRUE);\n $userIdentityApi = new UserIdentityAPI();\n $author = array_unique($discussionDetail['author']);\n $userEmail = $userIdentityApi->getUserDetail(IDM_USER_ENTITY, array('id' => $author), TRUE, false);\n $emails = array();\n if (array_key_exists('_items', $userEmail) && !empty($userEmail['_items'])) {\n foreach ($userEmail['_items'] as $email) {\n $emails[] = $email['email'];\n }\n }\n $contributorsEmail = $this->getAuthorEmail($author, TRUE);\n $userInfo = array();\n if (!empty($contributorsEmail)) {\n $userInfo = $userIdentityApi->getUserDetail(IDM_USER_ENTITY, array('email' => $contributorsEmail['user']));\n }\n if (array_key_exists('_items', $userInfo)) {\n foreach ($userInfo['_items'] as $user) {\n if (array_key_exists('age', $user)) {\n $graphData['age'][] = $user['age'];\n }\n if (array_key_exists('age-range', $user)) {\n $graphData['age_range'][] = $user['age-range'];\n }\n if (array_key_exists('education-level', $user)) {\n if (!array_key_exists($user['education-level'], $question['education_level']['value'])) {\n $graphData['education_level'][] = 'other';\n } else {\n $graphData['education_level'][] = $user['education-level'];\n }\n }\n if (array_key_exists('sex', $user) && array_key_exists(0, $user['sex']) &&\n array_key_exists($user['sex'][0], $question['sex']['value'])) {\n $graphData['sex'][] = $user['sex'][0];\n }\n if (array_key_exists('citizenship', $user) && array_key_exists($user['citizenship'], $question['citizenship']['value'])) {\n $graphData['citizenship'][] = $user['citizenship'];\n }\n if (array_key_exists('work', $user) && array_key_exists($user['work'], $question['work']['value'])) {\n $graphData['work'][] = $user['work'];\n }\n if (array_key_exists('public-authority', $user) && array_key_exists('name', $user['public-authority'])) {\n if (array_key_exists($user['public-authority']['name'], $question['public_authority']['value'])) {\n $graphData['public_authority'][] = $user['public-authority']['name'];\n }\n }\n if (array_key_exists('profile-info', $user) && !empty($user['profile-info'])) {\n if (array_key_exists('residence', $user['profile-info'])) {\n $graphData['residence'][] = $user['profile-info']['residence'];\n }\n if (array_key_exists('profession', $user['profile-info'])) {\n $graphData['profession'][] = $user['profile-info']['profession'];\n }\n if (array_key_exists('association', $user['profile-info']) &&\n array_key_exists($user['profile-info']['association'], $question['association']['value'])) {\n $graphData['association'][] = $user['profile-info']['association'];\n }\n }\n }\n foreach ($graphData as $key => $val) {\n $finalArr[$key] = array_count_values($graphData[$key]);\n }\n }\n if (!empty($finalArr)) {\n $preparedData = $this->_prepareChartData($finalArr, $question);\n $_SESSION['user']['statistics'] = $preparedData;\n } else {\n unset($_SESSION['user']['statistics']);\n }\n if (!empty(Yii::app()->globaldef->params['user_additional_info_question'])) {\n $additionalQuestion = array_map('trim', explode(\",\", Yii::app()->globaldef->params['user_additional_info_question']));\n foreach ($staticsPoint as $key => $value) {\n if (!in_array($key, $additionalQuestion)) {\n unset($staticsPoint[$key]);\n if (array_key_exists($key, $preparedData)) {\n unset($preparedData[$key]);\n }\n }\n }\n }\n $response['success'] = TRUE;\n } catch (Exception $e) {\n Yii::log($e->getMessage(), ERROR, 'Error in actionStatistics');\n $response['msg'] = Yii::t('discussion', 'Some technical problem occurred, For more detail check log file');\n }\n $this->render('statistics', array('satistics_point' => $staticsPoint,\n 'response' => $response,\n 'chart_detail' => $preparedData,\n 'discussionTitle' => $discussionInfo['title']\n )\n );\n }", "public function getReputation()\n {\n return $this->response['data']['reputation'] ?: null;\n }", "function process_response($request, $response)\n {\n if (!Pluf::f('google_analytics_id', false)) {\n return $response;\n }\n if (!in_array($response->status_code,\n array(200, 201, 202, 203, 204, 205, 206, 404, 501))) {\n return $response;\n }\n $ok = false;\n $cts = array('text/html', 'text/html', 'application/xhtml+xml');\n foreach ($cts as $ct) {\n if (false !== strripos($response->headers['Content-Type'], $ct)) {\n $ok = true;\n break;\n }\n }\n if ($ok == false) {\n return $response;\n }\n $track = Pluf::f('google_analytics_id', '');\n $domain = Pluf::f('google_analytics_domain', '');\n $js = <<<EOT\n<script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n ga('create', '$track', '$domain');\n ga('send', 'pageview');\n\n</script>\nEOT;\n $response->content = str_replace('</body>', $js.'</body>', $response->content);\n return $response;\n }", "function bim_get_question_response_stats( $questions )\n{\n global $CFG;\n\n if ( empty($questions)) return NULL;\n\n foreach ( $questions as $question )\n {\n // get count of student posts in each status for this question\n $sql = \"select status,count(id) as x from {$CFG->prefix}bim_marking where \" .\n \"question=$question->id and status!='Unallocated' \" .\n \"group by status\";\n $marking_details = get_records_sql( $sql );\n \n // get ready to update $question->status with information\n $question->status = array();\n $status = array( \"Unallocated\", \"Submitted\", \"Released\", \"Marked\", \n \"Suspended\" );\n\n foreach ( $status as $field )\n {\n // if there was a post in that status, update $question->status\n if ( isset( $marking_details[$field] ) )\n {\n $question->status[$field] = $marking_details[$field]->x;\n }\n else\n {\n $question->status[$field] = 0;\n }\n }\n }\n return $questions;\n}", "function update_post_counts($response){\r\n \t$count_key = 'post_views_count';\r\n \t$success = 0;\r\n \t$failure = 0;\r\n \tforeach ($response as $item){\r\n\t \t$post_id = $item[\"post_id\"];\r\n\t \tif(update_post_meta($post_id, $count_key, $item[\"views\"])) {\r\n\t \t\t$success++;\r\n\t \t} else {\r\n\t \t\t$failure++;\r\n\t \t}\r\n\t\t}\r\n\r\n\t\treturn array('success' => $success, 'failure' => $failure);\r\n\t}", "function pb_get_ga_statistics() {\n\n\t$gaID = polarbear_setting(\"GoogleAnalyticsReportID\");\n\t$gaEmail = polarbear_setting(\"GoogleAnalyticsEmail\");\n\t$gaPassword = polarbear_setting(\"GoogleAnalyticsPassword\");\n\t$maxAge = 3600; // seconds to store data in cache. 3600 = one hour\n\t\n\tif (empty($gaID) || empty($gaEmail) || empty($gaPassword)) {\n\t\techo \"<p>Can not load statistics: no settings found.</p>\";\n\t\treturn false;\n\t}\n\n\t$ga = polarbear_storage_get(\"pb_google_analytics_GAPI_1\", $expired); // get\n\tif ($expired) {\n\t\t$ga = polarbear_storage(\"pb_google_analytics_GAPI_1\", new gapi($gaEmail, $gaPassword), $maxAge); // store\n\t}\n\n\t$gaTmp = polarbear_storage_get(\"pb_google_analytics_GAPI_date\", $expired);\n\tif ($expired) {\n\t\t$ga->requestReportData($gaID,array('date'),array('pageviews','visits','uniquePageviews',\"timeOnPage\",\"timeOnSite\",\"bounces\"), array(\"date\"));\n\t\t$ga = polarbear_storage(\"pb_google_analytics_GAPI_date\", $ga, $maxAge);\n\t} else {\n\t\t$ga = $gaTmp;\n\t}\n\n\t$maxVisitsPerDay = 0;\n\t$chartData = \"\";\n\t$arrDays = array();\n\t$loopNum = 0;\n\tforeach($ga->getResults() as $result):\n\t\tif ($result->getVisits() > $maxVisitsPerDay) {\n\t\t\t$maxVisitsPerDay = $result->getVisits();\n\t\t}\n\t\t$chartData .= $result->getVisits() . \",\";\n\t\t// don't add all days, just every..eh.. fifth?\n\t\tif ($loopNum % 5 == 0) {\n\t\t\t$day = strftime(\"%b %e\", strtotime($result));\n\t\t\t$arrDays[] = $day;\n\t\t}\n\t\t$loopNum++;\n\tendforeach;\n\t#$arrDays = array_reverse($arrDays);\n\t// also add the last day fetched\n\t$day = strftime(\"%b %e\", strtotime($result));\n\t$arrDays[] = $day;\n\t$labelDay = \"|\" . implode($arrDays, \"|\");\n\n\t// Generate chart with visits per day\n\t$chartData = preg_replace(\"/,$/\", \"\", $chartData);\n\t$chartImg = \"http://chart.apis.google.com/chart?\";\n\t$chartImg .= \"chs=600x125&cht=lc\"; // chart type and size\n\t$chartImg .= \"&chm=B,e6f2fa,0,0.0,0.0\"; // blue solid fill\n\t//$chartImg .= \"|N,666666,0,-1,10,0\"; // label on each day\n\t$chartImg .= \"&chco=0077cc\"; // colors\n\t$chartImg .= \"&chd=t:$chartData\"; // data\n\t$chartImg .= \"&chds=0,$maxVisitsPerDay\"; // min and max\n\t$chartImg .= \"&chg=25,50\"; // grid lines\n\t$chartImg .= \"&chxt=x,y,r\"; // labels\n\t$labelVisits = \"||\" . ceil($maxVisitsPerDay/2) . \"|\" . $maxVisitsPerDay;\n\t$chartImg .= \"&chxl=0:{$labelDay}|1:{$labelVisits}|2:{$labelVisits}\";\n\n\tif ($ga->getVisits()>0) {\n\t\t$bounceRate = round(($ga->getBounces() / $ga->getVisits())*100,2);\t\t\n\t\t$pagesPerVisit = $ga->getPageviews() / $ga->getVisits();\n\t\t$avgTimeOnSite = ceil($ga->getTimeOnSite() / $ga->getVisits());\n\t} else {\n\t\t$bounceRate = 0;\n\t\t$pagesPerVisit = 0;\n\t\t$avgTimeOnSite = 0;\n\t}\n\t\n\t$visits = $ga->getVisits();\n\t$pageviews = $ga->getPageviews();\n\t\n\t?>\n\t\t<p class=\"stats\">\n\t\t\tThe last 30 days <?php polarbear_domain() ?> had \n\t\t\t<em><?php echo $visits ?> visits</em>\n\t\t\tand <em><?php echo $pageviews ?> pageviews</em>.\n\t\t\tThat's about <em><?php echo round($pagesPerVisit, 2) ?> pages per visit</em>.\n\t\t</p>\n\t\t<p class=\"stats\">\n\t\t\t<em>Average time on site was <?php echo $avgTimeOnSite ?> seconds</em> \n\t\t\tand the <em>bounce rate was <?php echo $bounceRate ?>%</em>.\n\t\t</p>\n\t\n\t\t<h3>Visits per day</h3>\t\n\t\t<p><img src=\"<?php echo $chartImg ?>\" alt=\"Chart showing visitor count for the last 30 days\" /></p>\n\t\n\t\n\t\t<div id=\"overview-statistics-tabs\">\n\t\t\t<ul>\n\t\t\t\t<li><a href=\"#overview-statistics-top-content\"><span>Top Content</span></a></li>\n\t\t\t\t<li><a href=\"#overview-statistics-keywords\"><span>Top Keywords</span></a></li>\n\t\t\t\t<li><a href=\"#overview-statistics-sources\"><span>Top Sources</span></a></li>\n\t\t\t\t<li><a href=\"#overview-statistics-medium\"><span>Medium</span></a></li>\n\t\t\t</ul>\n\t\t\t<div id=\"overview-statistics-top-content\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Page</th>\n\t\t\t\t\t\t<th>Pageviews</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<?php\n\t\t\t\t\t// info about most visited pages\n\n\t\t\t\t\t$gaTmp = polarbear_storage_get(\"pb_google_analytics_GAPI_pagePath\", $expired);\n\t\t\t\t\tif ($expired) {\n\t\t\t\t\t\t$ga->requestReportData($gaID,array('pagePath'),array('pageviews'), \"-pageviews\");\n\t\t\t\t\t\t$ga = polarbear_storage(\"pb_google_analytics_GAPI_pagePath\", $ga, $maxAge);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ga = $gaTmp;\n\t\t\t\t\t}\n\n\t\t\t\t\t$loopNum = 0;\n\t\t\t\t\tforeach($ga->getResults() as $result):\n\t\t\t\t\t\tif ($loopNum>=10) { break; }\n\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\techo \"<td>$result</td>\";\n\t\t\t\t\t\techo \"<td>\" . $result->getPageviews() . \"</td>\";\n\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t\t$loopNum++;\n\t\t\t\t\tendforeach;\n\t\t\t\t\t?>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div id=\"overview-statistics-keywords\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Keyword</th>\n\t\t\t\t\t\t<th>Pageviews</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<?php\n\t\t\t\t\t// search keywords\n\t\t\t\t\t$gaTmp = polarbear_storage_get(\"pb_google_analytics_GAPI_keyword\", $expired);\n\t\t\t\t\tif ($expired) {\n\t\t\t\t\t\t$ga->requestReportData($gaID,array('keyword'),array('pageviews'), array(\"-pageviews\"));\n\t\t\t\t\t\t$ga = polarbear_storage(\"pb_google_analytics_GAPI_keyword\", $ga, $maxAge);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ga = $gaTmp;\n\t\t\t\t\t}\n\n\t\t\t\t\t$loopNum = 0;\n\t\t\t\t\tforeach($ga->getResults() as $result) {\n\t\t\t\t\t\tif ($result == \"(not set)\") { continue; }\n\t\t\t\t\t\tif ($loopNum > 10) { break; }\n\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\techo \"<td>$result</td>\";\n\t\t\t\t\t\techo \"<td>\" . $result->getPageviews() . \"</tr>\";\n\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t\t$loopNum++;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</table>\n\t\t\t\n\t\t\t</div>\n\t\t\t<div id=\"overview-statistics-sources\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Source</th>\n\t\t\t\t\t\t<th>Pageviews</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<?php\n\t\t\t\t\t// referers\n\t\t\t\t\t$gaTmp = polarbear_storage_get(\"pb_google_analytics_GAPI_source\", $expired);\n\t\t\t\t\tif ($expired) {\n\t\t\t\t\t\t$ga->requestReportData($gaID,array('source'),array('pageviews'), array(\"-pageviews\"));\n\t\t\t\t\t\t$ga = polarbear_storage(\"pb_google_analytics_GAPI_source\", $ga, $maxAge);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ga = $gaTmp;\n\t\t\t\t\t}\n\n\t\t\t\t\t$loopNum = 0;\n\t\t\t\t\tforeach($ga->getResults() as $result) {\n\t\t\t\t\t\tif ($result == \"(direct)\") { continue; }\n\t\t\t\t\t\tif ($loopNum > 10) { break; }\n\t\t\t\t\t\techo \"<tr>\";\n\t\t\t\t\t\techo \"<td>$result</td>\";\n\t\t\t\t\t\techo \"<td>\" . $result->getPageviews() . \"</tr>\";\n\t\t\t\t\t\techo \"</tr>\";\n\t\t\t\t\t\t$loopNum++;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t<div id=\"overview-statistics-medium\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Source</th>\n\t\t\t\t\t\t<th>Pageviews</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<?php\n\t\t\t\t\t// medium\n\t\t\t\t\t$gaTmp = polarbear_storage_get(\"pb_google_analytics_GAPI_medium\", $expired);\n\t\t\t\t\tif ($expired) {\n\t\t\t\t\t\t$ga->requestReportData($gaID,array('medium'),array('pageviews'), array(\"-pageviews\"));\n\t\t\t\t\t\t$ga = polarbear_storage(\"pb_google_analytics_GAPI_medium\", $ga, $maxAge);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$ga = $gaTmp;\n\t\t\t\t\t}\n\n\t\t\t\t\t$loopNum = 0;\n\t\t\t\t\tforeach($ga->getResults() as $result) {\n\t\t\t\t\t\t#if ($result == \"(direct)\") { continue; }\n\t\t\t\t\t\tif ($loopNum > 10) { break; }\n\t\t\t\t\t\techo \"<td>$result</td>\";\n\t\t\t\t\t\techo \"<td>\" . $result->getPageviews() . \"</tr>\";\n\t\t\t\t\t\t$loopNum++;\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\n\t\t</div>\n\t\t\n\t\t<p>\n\t\t\t<a href=\"http://www.google.com/analytics/\">Visit Google Analytics</a> for more detailed statistics.\n\t\t\tStatistics updated on <?php echo strftime(\"%b %e, %H:%M\", strtotime($ga->getUpdated())) ?>\n\t\t</p>\n\n\t<?php\n}", "public function get_reputation_score($user_id)\n {\n $revokes = BannedUserTask::where('user_id', $user_id)->count();\n $activity_score = UserReputationActivityScore::where('user_id', $user_id)->first();\n\n if($activity_score['activity_score'] == 0 && $revokes == 0) {\n return ['reputation' => null, 'activity_score' => null];\n }\n\n if($activity_score['activity_score'] == 0) {\n return ['reputation' => $activity_score['reputation'], 'activity_score' => 0];\n }\n\n if($revokes > 0 && $activity_score['activity_score'] != 0) {\n $reputation = @($revokes / $activity_score->activity_score) * 100 - 100;\n if($activity_score) {\n $activity_score->reputation = abs($reputation);\n $activity_score->save();\n }\n return ['reputation' => round(abs($reputation)), 'activity_score' => $activity_score['activity_score']];\n }\n\n return ['reputation' => $activity_score['reputation'], 'activity_score' => $activity_score['activity_score']];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Comprobamos si existe actividades
function existe_actividades() { $this->Seek(); if ($this->feedback['code'] === '70011') return true; else return false; }
[ "public function verActividades()\n {\n // section -64--88-1-102-9622ab2:134173cef74:-8000:000000000000176E begin\n \t$sql = \"SELECT * FROM actividades\";\n\t\t return $this->ejecutarQuery($sql);\n // section -64--88-1-102-9622ab2:134173cef74:-8000:000000000000176E end\n }", "public function iniciarActividad() {\n require_once 'DB.php';\n\n $id_texto = $this->generarTexto();\n $actividadNueva = array(\n \"id_usuario\" => $this->id_usuario,\n \"id_actividad\" => $this->id_actividad,\n \"id_texto\" => $id_texto,\n \"iniciada\" => 1,\n \"fecha_inicio\" => time(),\n \"fecha_fin\" => \"--\"\n );\n\n $textoAsignado = array(\n \"asignado\" => 1\n );\n $condicion = \"id_texto=\" . DB::limpiarSQL($id_texto);\n\n $db = new DB();\n $db->conectar();\n\n if ($db->insertarArreglo(\"actividades_por_usuario\", $actividadNueva) && $db->actualizarArreglo($textoAsignado, \"textos\", $condicion)) {\n $db->desconectar();\n return true;\n }\n return false;\n }", "public function activos()\n {\n //verificar sesion de usuario\n if(!$this->validUser())\n {\n return false;\n }\n \n // cargar modelo, ejecutar la accion, pasar los datos a una variable\n $model = $this->loadModel('PersonasModel');\n try\n {\n $personaList = $model->listPersonasActivas(); \n }\n catch (Exception $e) \n {\n $this->errorMessageView($e->getMessage());\n return;\n } \n \n // cargar vistas en las que se maneje la variable\n require 'application/views/_templates/header.php';\n require 'application/views/_templates/navbar.php';\n require 'application/views/personas/index.php';\n require 'application/views/_templates/footer.php';\n }", "private function chargeLesActivites()\r\n\t\t{\r\n\t\t$resultat=$this->maBD->chargement('activite');\r\n\t\t$nb=0;\r\n\t\twhile ($nb<sizeof($resultat))\r\n\t\t\t{\r\n\t\t\t//instanciation de la chambre et ajout de celle-ci dans la collection\r\n\t\t\t$this->toutesLesActivites->ajouteUneActivite($resultat[$nb][0],$resultat[$nb][1]);\r\n\t\t\t$nb++;\r\n\t\t\t}\r\n\t\t}", "function activos(){\n\t\tglobal $db;\n\t\t$db = connect_db();\n\t\t$sql = $db->prepare(\"SELECT * FROM usuarios WHERE id_status=1\");\n\t\t$sql -> execute();\n\t\t$res = $sql->rowCount();\n\t\treturn $res;\n\t\t}", "public function arreglarPaqueteActivado()\n {\n $users = User::where([\n ['status', '=', 1],\n ['ID', '!=', 1]\n ])->select('ID')->get();\n\n foreach ($users as $user) {\n $this->activarUsuarios($user->ID);\n }\n }", "function comExiste($nombre) {\r\n\t\tglobal $tsCore, $tsUser;\r\n\t\t$dato = db_exec('fetch_assoc', db_exec(array(__FILE__, __LINE__), 'query', 'SELECT c_id, c_nombre FROM c_comunidades LEFT JOIN u_miembros ON user_id = c_autor WHERE c_nombre_corto = \\''.$tsCore->setSecure($nombre).'\\' '.($tsUser->is_admod == 1 ? '' : 'AND user_activo = \\'1\\' AND user_baneado = \\'0\\' AND c_estado = \\'0\\'').' LIMIT 1'));\r\n\t\tif($dato['c_nombre']) {\r\n\t\t\treturn $dato['c_id'];\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function postVerificaexistecicloactivo()\r\n {\r\n $organizacion_id = Input::get('organizacion_id');\r\n $ciclo_activo = CicloLectivo::verificaExisteCicloActivo($organizacion_id);\r\n\r\n $existe = ($ciclo_activo) ? TRUE : FALSE;\r\n\r\n return Response::json($existe);\r\n }", "public function inyectoresActivos()\r\n\t\t{\r\n\t\t\t$cant = 0;\r\n\r\n\t\t\tforeach ($this->inyectores as $inyector) \r\n\t\t\t{\r\n\t\t\t\tif($inyector->getdanoPorcentaje() < 100)\r\n\t\t\t\t\t$cant ++;\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\treturn $cant;\r\n\r\n\t\t}", "function existen_cortes_control()\n\t{\n\t\t$cortes_activos = 0;\n\t\tif (is_null($this->_cortes_def)) {\t\t\t\t\t\t//Si no hay cortes procesados aun, tomo los definidos en base\n\t\t\t$cortes_activos = count($this->_info_cuadro_cortes);\n\t\t} elseif (! empty($this->_cortes_def)) {\n\t\t\t$datos_corte = reset($this->_cortes_def);\t\t\t//Ciclo por los cortes que se procesaron en la definicion\n\t\t\tdo {\n\t\t\t\tif ($datos_corte['habilitado'] == 1) {\t\t\t\t//Si el corte esta activo dejo de buscar.\n\t\t\t\t\t$cortes_activos++;\n\t\t\t\t}\n\t\t\t} while ($datos_corte = next($this->_cortes_def) && $cortes_activos == 0);\n\t\t}\n\t\treturn (($cortes_activos > 0) && !$this->_salida_sin_cortes);\n\t}", "public static function getAllTblnivelaccesoAct(){\n\t \n\t $activado=1;\n\t\t$consulta = \"SELECT * FROM tblniveleacceso WHERE tblniveleacceso_activado = ?\";\n\t\t\n\t\ttry{\n\n\t\t\t$resultado = ConexionDB::getInstance()->getDb()->prepare($consulta);\n\t\t\t$resultado->bindParam(1,$activado,PDO::PARAM_INT);\n\t\t\t$resultado->execute();\n\t\t\treturn $resultado->fetchAll(PDO::FETCH_ASSOC); //retorna los campos del registro \n\t\t} catch(PDOException $e){\n\t\t\treturn false;\n\t\t}\n\t}", "public function listActivos()\n {\n \treturn $this->createQuery('w')\n \t->innerJoin('w.productoItem pi')\n \t->innerJoin('pi.producto p')\n \t->addWhere('p.activo = true')\n \t->addwhere('p.id_eshop IS NULL')\n \t->orderBy('w.id_producto_item')\n \t->execute();\n }", "private function checaTransacaoInicializada()\n\t{\n\t\t// retornando se existe transacao inicializada\n\t\treturn ($this->_transactionCount > 0);\n\t}", "function inactivos(){\n\t\tglobal $db;\n\t\t$db = connect_db();\n\t\t$sql = $db->prepare(\"SELECT * FROM usuarios WHERE id_status=1\");\n\t\t$sql -> execute();\n\t\t$res = $sql->rowCount();\n\t\treturn $res;\n }", "function existe_proyecto() {\n\n $this->seek_existe_proyecto();\n if ($this->feedback['code'] === '40011'){\n $this->feedback['ok'] = true;\n $this->feedback['code'] = '20034';\n return true;\n }\n return false;\n }", "function existe_proyecto() {\n\n $this->seek_existe_proyecto();\n if ($this->feedback['code'] === '40011'){\n $this->feedback['ok'] = true;\n return true;\n }\n return false;\n }", "public function nuevo($campos)\n {\n\n //GUARDAR ACTIVIDAD\n $registrosAfectados = $this->app['db']->insert(\n 'mantenimientos_checklist',[\n 'equipo_id' => $campos['equipo_id'],\n 'checklist_nombre' => $campos['checklist_nombre'],\n 'checklist_so' => $campos['checklist_so'],\n 'checklist_estatus' => 0,\n ]\n );\n\n //VERIFICAR QUE SE AGREGÓ LA EMPRESA\n if ($registrosAfectados > 0) {\n\n $this->mensaje = \"La actividad fué agregada con éxito\";\n return TRUE;\n\n } else {\n\n $this->mensaje = \"Error al incluir la Actividad\";\n return FALSE;\n\n }\n\n }", "public function checkEnableActivities($id_lectura,$tipo_actividad){\n $id_usuario = $this->session->userdata('USER_ID'); \n $view_check_activity = $this->Actividad_model->checkIfExistActivities($id_lectura,$id_usuario);\n $tabla_lectura_array = $this->Lectura_modelo->getLecturaArray($id_lectura);\n\n switch ($tipo_actividad) {\n case 1://opcion multiple\n if($view_check_activity['check_exist_om'] != 0){\n $data = array( 'check_om' => 1, );\n $this->Lectura_model->updateLectura($id_lectura,$data);\n } else if($view_check_activity['check_exist_om'] == 0){\n $data = array( 'check_om' => 0, );\n $this->Lectura_model->updateLectura($id_lectura,$data);\n }\n break;\n case 2://verdadero falso\n if($view_check_activity['check_exist_vf'] != 0){\n $data = array( 'check_vf' => 1, );\n $this->Lectura_model->updateLectura($id_lectura,$data);\n } else if($view_check_activity['check_exist_vf'] == 0){\n $data = array( 'check_vf' => 0, );\n $this->Lectura_model->updateLectura($id_lectura,$data);\n }\n break;\n case 3://relacionar columnas\n if($view_check_activity['check_exist_rc'] != 0){\n $data = array( 'check_rc' => 1, );\n $this->Lectura_model->updateLectura($id_lectura,$data);\n } else if($view_check_activity['check_exist_rc'] == 0){\n $data = array( 'check_rc' => 0, );\n $this->Lectura_model->updateLectura($id_lectura,$data);\n }\n break;\n }\n\n $tbl_lec = $this->Lectura_modelo->getLecturaArray($id_lectura);\n $num_active_activities = ($tbl_lec['check_om']+$tbl_lec['check_vf']+$tbl_lec['check_rc']);\n $data = array( 'num_active_activities' => $num_active_activities, );\n if($this->Lectura_model->updateLectura($id_lectura,$data)){\n return true;\n } else {\n return false;\n }\n }", "function ver_competenciasActividad($id_realiza,$idactividad,$idarea,$masivo){\n\t\t\tparent::conectar();\n\t\t\t $sql=\"SELECT ID_COMPETENCIA,NOMBRECOMPETENCIA FROM view_competencias_ev WHERE ID_AREA=$idarea AND ID_REALIZA=$id_realiza ORDER BY NOMBRECOMPETENCIA\";\n\t\t\t $record_consulta = $this->obj_con->Execute($sql);\n\t\t\t /*obteniendo las competencias de la actividad que tiene actualmente*/\n\t\t\t $sql2=\"SELECT ID_COMPETENCIA FROM competencias_actividadesmasivas WHERE ID_MASIVO=$masivo\";\n\t\t\t $record_consulta2 = $this->obj_con->Execute($sql2);\n $competenciasActividad[]=array();\n $i=0;\n\t\t\t while(!$record_consulta2->EOF){\n\t\t\t \t$id_competenciaAct=$record_consulta2->fields[\"ID_COMPETENCIA\"];\n\t\t\t \t$competenciasActividad[$i]=$id_competenciaAct;\n\t\t\t \t$record_consulta2->MoveNext();\n\t\t\t \t$i++;\n\t\t\t }\n\t\t\t/*preparar array con true or false*/\t\t\t\n\t\t\t\t\t while (!$record_consulta->EOF)\n\t\t\t\t\t {\n\t\t\t\t\t $id_competencia=$record_consulta->fields[\"ID_COMPETENCIA\"];\n\t\t\t\t\t $nombrecompetencia=$record_consulta->fields[\"NOMBRECOMPETENCIA\"];\n\t\t\t\t\t $asignado=false;\n\t\t\t\t\t foreach ($competenciasActividad as $id_competenciaAct) {\n\t\t\t\t\t \t if($id_competenciaAct==$id_competencia){\n\t\t\t\t\t \t \t$asignado=true;/*fue asignada la competencia*/\n\t\t\t\t\t \t }\n\t\t\t\t\t }\n\t\t\t\t\t\t $data1[] = array('id_comp'=>$id_competencia,'nombreC'=>$nombrecompetencia,'selected'=>$asignado);\n\t\t\t\t\t $record_consulta->MoveNext();\n\t\t\t\t\t }\n\t\t\t\t\t\t\tif(isset($data1)){\n\t\t\t\t $respuesta= array('success' => true,'data'=>$data1);\n\t\t\t\t }else{\n\t\t\t\t $respuesta= array('success' =>false);\n\t\t\t\t }\t\t\t\t\t \n return $respuesta;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
$isAReq[aReqCode] is true just gimme an array of all requirement codes (with _ not space) from Category:Requirements while you're at it, audit if flag is on while you're at it, store it in $allReqCodes global and fill $allReqLevels and $eachReqParent (see above)
function GetAllReqCodes($audit = false) { global $AuditReport; global $allReqCodes, $allReqLevels, $eachReqParent; if ($allReqCodes) return $allReqCodes; $allReqCodes = array(); $allReqLevels = array(); $src = cwGetPageText('Category:Requirements'); if (!$src) die("no such page Category:Requirements, in ". __FILE__.__LINE__); if ($audit) scanForBadChars($src, "[[:Category:Requirements]]"); $entryLines = explode("\n", $src); $startPart = true; $endPart = false; $parents = array(''); foreach ($entryLines as $line) { // skip over intro which is freeform prose if ($startPart && ($line == '' || $line[0] != '*')) continue; $startPart = false; // and skip over the end part, starts upon first blank line if ($line == '') $endPart == true; if ($endPart) continue; // now the starred lines if (preg_match('/^(\*+) \[\[:Category:([^|]*)\|(.*)\]\]/', $line, $match) != 1) { if ($audit) $AuditReport .= "* stray line in Category:Requirements, '$line'<br>\n"; } else { if ($audit) { if (codeToTitle($match[2]) != $match[3]) $AuditReport .= "* bad req line in [[:Category:Requirements]], '" . $match[2] ."' != '". $match[3] ."'<br>\n"; if (strlen($match[0]) >= strlen($line)) $AuditReport .= "* should have description in Category:Requirements, '" . $match[2] ."'<br>\n"; } // now collect req name $allReqCodes[] = $reqCode = str_replace('Category:', '', titleToCode($match[2])); $allReqLevels[] = $depth = strlen($match[1]); // who's your daddy? $eachReqParent[$reqCode] = $parents[$depth-1]; $parents[$depth] = $reqCode; } } return $allReqCodes; }
[ "function checkAdmissibleStatus($conn,$olvl,$ProgId,$Regno){\n//$ProgId=37;\n$core_array=array();//this will be used to form array for comparison\n$opt_array=array();//this will be used to form array for comparison\n$deficient=array();//this holds the deficient subjects\n$requiredSubjects = array();//this holds the candidates correct subjects that matches requirement\n$corecount=0;\n//$d=\"1=4||2=4||4=4||7=7||5=7||6=7||13=4||16=8||15=7###1=4||2=4||4=4||7=7||5=9||6=7||13=4||16=8||15=7\";\n//checkAR($olvlRstDet);\n//$OlevelResult=explode(\"###\",$olvl);\n$OlevelResult = explode(\"###\",$olvl);\n//check if candidate submitted awaiting result.\n\n\nif(empty($OlevelResult[1]) || $OlevelResult[1]==\"\"){\n\t$CAND_subj=$OlevelResult[0];\n}else{\n\t$CAND_subj=$OlevelResult[0].\"||\".$OlevelResult[1];\n}\n//print($CAND_subj);\n$olvl_sub_grade=explode(\"||\",$CAND_subj);\n//print_r($olvl_sub_grade); \n\n\n\t//$subjgrade[0];//subject\n\t//$subjgrade[1];//cand olvl grade\n//echo $subjgrade[0].lb();\n//echo $subjgrade[1];\n//pick requirement from the table;check if it has optional\n$conditionsQuery = mysqli_fetch_assoc(Select4rmdbtb($conn,\"waec_require\",$fields = array(\"Subj_comb\", \"Special_cons\"),$cond = \"ProgID = '\".$ProgId.\"'\"));\n \t\n$x= $conditionsQuery['Subj_comb'];\n$z=explode(\"&\",$x);//EXPLODE REQUIREMENT\n//print_r($z[0]);\n//$Core_array=array();\n///CHECK AGAINST CORE\nif(strpos($z[0],\"~\")){\n\t//if the core is more than one subject\n\t$Core_array=explode(\"~\",$z[0]);\n\t//print_r($Core_array);\n\tforeach($Core_array as $corereq){\n\t\t\t\t$core=explode(\":\",$corereq);\n\t\t\t\t$corenum=count($core);\n\t\t\t\t$core_arr[]=$core[0];\n\t\t\t\t//$core[0];\n\t\t\t\t/********************************************************************************/\n\t\t\t\tforeach($olvl_sub_grade as $Olevel){\n\t\t\t\t\t\t//CHECK AGAINST CORE\n\t\t\t\t\t\t$subjgrade=explode(\"=\",$Olevel);//1,7\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t//$core[1];\n\t\t\t\t\t\tif(($core[0]==$subjgrade[0]) && ($subjgrade[1] <= $core[1])){\n\t\t\t\t\t\t\t\t\t$requiredSubjects[]= $subjgrade[0];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//echo $core[0].\"----\".$subjgrade[0].\"----\".$core[1].\"----\".$subjgrade[1].\"<p style= 'color: green;'>&#10004;</p>\";\n\t\t\t\t\t\t\t\t}else if(($core[0]==$subjgrade[0]) && ($subjgrade[1] > $core[1])){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$deficient[]=$subjgrade[0];\n\t\t\t\t\t\t\t\t\t//\tprint_r($deficient);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}else if(($core[0]!=$subjgrade[0])){\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} \n\t\t\t\t}//end of foreach\n\t}\n}else{\n\t//if the core is one\n\t$Core_array=$z[0];\n\t$core=explode(\":\",$Core_array);\n\t$corenum=count($core);\n\t$core_array[]=$core[0];\n\t$core[0];\n\t$core[1];\n\tforeach($olvl_sub_grade as $Olevel){\n\t\t//CHECK AGAINST CORE\n\t\t$subjgrade=explode(\"=\",$Olevel);//1,7\n\t\t\n\t\t\n\n\t\t//$core[1];\n\t\tif(($core[0]==$subjgrade[0]) && ($subjgrade[1] <= $core[1])){\n\t\t\t\t\t$requiredSubjects[]= $subjgrade[0];\n\t\t\t\t\t\n\t\t\t\t\t//echo $core[0].\"----\".$subjgrade[0].\"----\".$core[1].\"----\".$subjgrade[1].\"<p style= 'color: green;'>&#10004;</p>\";\n\t\t\t\t}else if(($core[0]==$subjgrade[0]) && ($subjgrade[1] > $core[1])){\n\t\t\t\t\t\n\t\t\t\t\t$deficient[]=$subjgrade[0];\n\t\t\t\t\t//\tprint_r($deficient);\n\t\t\t\t\t\n\t\t\t\t}else if(($core[0]!=$subjgrade[0])){\n\t\t\t\t\t//do nothing\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t}//end of foreach\n}\n//echo $Core_array;\n\n\n///////////////////////////end of core checks\n/************************process optional requirement********************************/\n$optional_arr=array();\n$optchk=0;\n\n//$z=explode(\"&\",$x);//EXPLODE REQUIREMENT\n\nif($z[1]!=\"NONE\"){//that means that the optional part is present\n$optional_array=explode(\"#\",$z[1]);\n\nforeach($optional_array as $optreq){\n\t$optional=explode(\":\",$optreq);\n\t$optnum=count($optional);\n\t$opt_array[]=$optional[0];\n//check the students result against conditional\n\nforeach($olvl_sub_grade as $Olevel){\n\t\t//CHECK AGAINST CORE\n\t$subjgrade=explode(\"=\",$Olevel);//1,7\n\t//$subjgrade[0];//subject\n\t//$subjgrade[1];//cand olvl grade\n\t\t\t\t\t\tif(($optional[0]==$subjgrade[0]) && ($subjgrade[1] <= $optional[1])){\n\t\t\t\t\t\t\t$optional_arr[]=$subjgrade[0];//assign the \n\t\t\t\t\t\t\t$requiredSubjects[]= $subjgrade[0];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t//echo $optional[0].\"----\".$subjgrade[0].\"----\".$optional[1].\"----\".$subjgrade[1].\"<p style= 'color: green;'>&#10004;</p>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}else if(($optional[0]==$subjgrade[0]) && ($subjgrade[1] > $optional[1])){\n\t\t\t\t\t\t$deficient[]=$subjgrade[0];\n\n\t\t\t\t\t}else if(($optional[0]!=$subjgrade[0])){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t} \n\t\t\t\n\t\t\t}//end of foreach\n\t\n\t}\n\n//break;\n}else{//75101645GJbreak;\n} \n/************************************conditional courses*******************************************/\n$tempValue=0;\n$noconditional = mysqli_fetch_assoc(Select4rmdbtb($conn,\"waec_require\",\"no_conditional\",$cond = \"ProgID = '\".$ProgId.\"'\"));\n \t\t\t\n\n\t//$subjgrade[0];//subject\n\t//$subjgrade[1];//cand olvl grade\n$z=explode(\"&\",$x);//EXPLODE REQUIREMENT\n\nif($z[2]!=\"NONE\"){\n\t$cond_array=explode(\"||\",$z[2]);\n\t\t\tforeach($cond_array as $condreq){\n\t\t\t\t$cond=explode(\":\",$condreq);\n\t\t\t\t$optnum=count($cond);\n\t\t\t\t$cond[0];\n\n\t\t\t\t\t\t\tforeach($olvl_sub_grade as $Olevel){\n\t\t\t\t\t\t\t\t\t//CHECK AGAINST CORE\n\t\t\t\t\t\t\t\t$subjgrade=explode(\"=\",$Olevel);//1,7\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(($cond[0]==$subjgrade[0]) && ($subjgrade[1] <= $cond[1])){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(!(in_array($cond[0] , $requiredSubjects))){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t++$tempValue;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($tempValue <= $noconditional['no_conditional']){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$requiredSubjects[]= $cond[0];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo $cond[0].\"----\".$subjgrade[0].\"----\".$cond[1].\"----\".$subjgrade[1].\"<p style= 'color: green;'>&#10004;</p>\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}else if(($cond[0]!=$subjgrade[0])){\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}//end of foreach\n\n//break;\n\t\t\t\t\t\t}//end of foreach\n\n\n}else{//break;\n}\n\n$unique_requiredSubject=array_unique($requiredSubjects);\n// this part is to ensure the two optional course that is required is not selectedl\nif($z[1]!=\"NONE\"){\n\n$optarray=array_unique($optional_arr);\n\n\n\t\t\t\t\tif(is_array($optarray) && (count($optarray) ==2)){\n\n\t\t\t\t\t\t\t\tif(in_array($optarray[0],$unique_requiredSubject) && in_array($optarray[1],$unique_requiredSubject)){\n\t\t\t\t\t\t\t\t\t\t\t// this checks if the required subject contains the both optional subjects\n\t\t\t\t\t\t\t\t\t\t\t\t$available=count($unique_requiredSubject);\n\n\t\t\t\t\t\t\t\t\t\t\t\t// this reduces the total number of subjects in the \n\t\t\t\t\t\t\t\t\t\t\t$result=$available-1;\n\t\t\t\t\t\t\t\t\t\t\t//echo $result;this is to make sure only one subject is used even if two optional are available\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}else if(is_array($optarray) && (count($optarray) ==1)){\n\t\t\t\t\t\t$result=count($unique_requiredSubject);\n\t\t\t\t\t\t\t\t//echo $result;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}else if(is_array($optarray) && (count($optarray) ==0)){\n\t\t\t\t\t\t\t\t$result=count($unique_requiredSubject);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\n\t\t\t}else{\n\t$result=count($unique_requiredSubject);\n\t\t\t\t}\n\n/////////////////////////now compare the deficient subject array against the core course to find the course that is deficient\n$def=array_unique($deficient);\n//print_r($def);\n$x=array_diff($def,$requiredSubjects);\n//print_r($x);\n\n$sub_def=implode($x,\"~\");\n//echo $sub_def;\n\n\n//$exist=Exist($conn,\"RegNo\",$Regno,\"deficiency\");\n\n//if($exist[0]==FALSE){//if it does not exist insert\n\t//echo $Regno;\n$fields=array('RegNo' => $Regno,'Olvl_Deficiency' => $sub_def);\t\t\t\t\n\t$exist_q=getAllRecord($conn,\"deficency\",\"RegNo = '$Regno'\",\"\",\"\");\n\t\t\t\t\t$q_num=mysqli_num_rows($exist_q);\n\n\t\t\t\t\n\n\t\t\t\t\tif($q_num > 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$exist_array=mysqli_fetch_array($exist_q);\n\t\t\t\t\t\t\t$exist_id=$exist_array[0];\n\t\t\t\t\t\t\t$sqlres =Updatedbtb($conn,'deficency',$fields,$cond = \"id='$exist_id'\");\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t$sqlres =Insert2DbTb($conn,$fields,'deficency');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t//$listid=mysqli_insert_id($conn);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/* \telseif($exist[0]==TRUE){//if it exist update\n\t\t\t\t\t\t\t\t\t$listid=$exist[1];\n\t\t\t\t\t\t\t\t\t//echo\"<br/>candidate already exist\";\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$fields=array('RegNo' => $Regno,'Olvl_Deficiency' => $sub_def);\n\t\t\t\t\t\t\t\t\t$sqlupdate=Updatedbtb($conn,'deficiency',$fields,\"RegNo='$Regno'\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t} */\n/////////////////first form the core array \n\n\n/* $cre=array_unique($core_arr);//the unique core subjects\n//$cre=array_unique($core_arr);//the unique core subjects\n\nforeach($cre as $cores){\n\tif(in_array($cores,$def)){\n\t\techo \"<p style='color:red'>\".getSubject($conn, $cores).\" is required in Olvl</p>\";\n\t}\n\t\n}\n//$def_subj=array_diff($cre,$def);\n///////////////////end of core check\n$availdefopt=0;\n$opt_sub=array_unique($opt_array);//get the unique array\nprint_r($opt_sub);\n\nforeach($opt_sub as $opts){\n\tif(in_array($opts,$def)){\n\t\t$availdefopt++;\n\t\t\n\t\tif($availdefopt!=count($opt_sub)){\n\t\t\techo \"<p style='color:red'>\".getSubject($conn, $opts).\" is required in Olvl</p>\";\n\t\t}else{\n\t\t\t//if candidate does not have both optional courses\n\t\t\t$def_both=1;\n\t\t//\techo \"<p style='color:red'>\".getSubject($conn, $opts[0]).\" Or\".getSubject($conn, $opts[1]).\" is required in Olvl</p>\";\n\t\t\t\n\t\t}\n\n\t}\n\t\n}\nif(isset($def_both) && $def_both==1){\n\t//echo \"<p style='color:red'>\".getSubject($conn, $opts[0]).\" Or\".getSubject($conn, $opts[1]).\" is required in Olvl</p>\";\n\t\t\t\n}\n//$def_subj=array_diff($cre,$def);\n\n\n//print_r($def_subj);\n\n\n\n\n//echo \"<br/>\".$corenum;\n//print_r($optional); */\n//implode()\n\n\n\n//print_r($def);\nreturn $result;\n}", "function AuditReqConstruction($reqName, $ss) {\n\tglobal $cwAuditReport;\n//flLog(\"^^^^^^^^^^^^^^^^^^^^^^ new cwReq, auditing.\");\n//flExport($ss);\n//flExport(count($ss));\n\t//if (strlen($s[0]) > 0)\n\t//\t$cwAuditReport .= \"* Stray text ahead of title for requirement '$reqName'<br>\\n\";\n\t\n\t// make sure the categories line at the end is exactly right\n\tif (isset($ss[1])) {\n\t\t$cl = trim($ss[1]);\n\t\t$shouldBe = drawAllReqFeatLinks($reqName) .' [[Category:Requirements]]';\n//flLog(\"^^^^^^^^^^^^^^^^^^^^^^ new cwReq, catline='$cl', shbe='$shouldBe'.\");\n\t\tif ($cl != $shouldBe) {\n\t\t\t$cwAuditReport .= \"\\n* for requirement /<a href=\". cwFullWikiURL(\"Category:\". $reqName) .\">$reqName</a>/: category line is wrong.<br>\\n\";\n\t\t\t$cwAuditReport .= \"** should be: <nowiki>$shouldBe</nowiki><br>\\n\";\n\t\t\t$cwAuditReport .= \"** was instead: <nowiki>$cl</nowiki><br>\\n\";\n\t\t}\n\t}\n\telse\n\t\t$cwAuditReport .= \"\\n* for requirement /<a href=\". cwFullWikiURL(\"Category:\". $reqName) .\">$reqName</a>/: category line is absent, or ---- line isn't above it.<br>\\n\";\n}", "function checkRequirement($conn, $subjId, $gradeId, $ProgId){\n \t$result = FALSE;\n\n \t$conditionsQuery = mysqli_fetch_assoc(Select4rmdbtb($conn,\"waec_require\",$fields = array(\"Subj_comb\", \"Special_cons\"),$cond = \"ProgID = '\".$ProgId.\"'\"));\n \t$core = explode(\"~\",$conditionsQuery['Subj_comb']);\n\n \t//echo \"COre count \".count($core); \n \tfor ($i=0; $i < count($core); $i++) { \n \t\t# code...\n \t\tif(!stripos($core[$i], \"||\")){\n \t\t\t$coreGrade = explode(\":\", $core[$i]);\n\n \t\t\tif ($subjId == $coreGrade[0] && $gradeId <= $coreGrade[1]) {\n \t\t\t\t$result = TRUE;\n \n \t\t\t}else{\n \n \t\t\t}\n \t\t\t\n \t\t}else if (stripos($core[$i], \"||\")){\n\n\n \t\t\t$condSubjGrade = explode(\"||\", $core[$i]);\n \t\t\t$tempResult = FALSE;\n \t\t\t\n \t\t\tfor ($j=0; $j < count($condSubjGrade); $j++) { \n \t\t\t\t# code...\n \t\t\t\t$condGrade = explode(\":\", $condSubjGrade[$j]);\n\n\t \t\t\tif ($subjId == $condGrade[0] && $gradeId <= $condGrade[1]) {\n\n\t \t\t\t\t$tempResult = TRUE;\n\t \t\t\t}else{\n\n\t \t\t\t}\n \t\t\t}\n\n \t\t\tif($tempResult){\n \t\t\t\t$result = TRUE;\n \t\t\t}\n \t\t}\n \t}\n\n \treturn $result;\n}", "protected function getRequesters() {\n\t\t$mapParentId = array();\n\t\t$mapAroId = array();\n\n\t\t$aros = $this->Aro->getAll();\n\t\t$permissions = $this->Permission->getAll();\n\n\t\t// Map ACOs to AROs indexed by IDs\n\t\tforeach ($permissions as $permission) {\n\t\t\t$permission = $permission['ObjectPermission'];\n\n\t\t\t$mapAroId[$permission['aro_id']][$permission['aco_id']] = $permission;\n\t\t}\n\n\t\t// Map IDs to parent IDs\n\t\tforeach ($aros as $aro) {\n\t\t\t$mapParentId[$aro['RequestObject']['id']] = $aro['RequestObject'];\n\t\t}\n\n\t\t// Loop through AROs and determine permissions\n\t\t// While taking into account inheritance\n\t\tforeach ($aros as &$aro) {\n\t\t\t$id = $aro['RequestObject']['id'];\n\t\t\t$parent_id = $aro['RequestObject']['parent_id'];\n\t\t\t$inheritance = array();\n\n\t\t\twhile (isset($mapParentId[$parent_id])) {\n\t\t\t\tarray_unshift($inheritance, $parent_id);\n\t\t\t\t$parent_id = $mapParentId[$parent_id]['parent_id'];\n\t\t\t}\n\n\t\t\t$inheritance[] = $id;\n\n\t\t\t// Fetch permissions from parents\n\t\t\t$perms = array();\n\t\t\t$parent_id = $aro['RequestObject']['parent_id']; // reset $parent_id\n\n\t\t\tforeach ($inheritance as $pid) {\n\t\t\t\tif (isset($mapAroId[$pid])) {\n\t\t\t\t\t$perms = Hash::merge($perms, array_map(function($value) use ($id, $parent_id) {\n\n\t\t\t\t\t\t// If the ARO on the permission doesn't match the current ARO\n\t\t\t\t\t\t// It is being inherited, so force it to 0\n\t\t\t\t\t\tif ($id != $value['aro_id']) {\n\t\t\t\t\t\t\t$value = array_merge($value, array(\n\t\t\t\t\t\t\t\t'_create' => 0,\n\t\t\t\t\t\t\t\t'_read' => 0,\n\t\t\t\t\t\t\t\t'_update' => 0,\n\t\t\t\t\t\t\t\t'_delete' => 0\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t// Top level AROs cant inherit from nothing\n\t\t\t\t\t\t// So change those values to denied\n\t\t\t\t\t\t} else if (empty($parent_id)) {\n\t\t\t\t\t\t\tforeach (array('_create', '_read', '_update', '_delete') as $action) {\n\t\t\t\t\t\t\t\tif ($value[$action] == 0) {\n\t\t\t\t\t\t\t\t\t$value[$action] = -1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn $value;\n\t\t\t\t\t}, $mapAroId[$pid]));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$aro['ObjectPermission'] = $perms;\n\t\t}\n\n\t\treturn $aros;\n\t}", "function techproject_print_requirements($project, $group, $fatherid, $cmid, $propagated = null) {\n global $USER, $DB, $OUTPUT;\n static $level = 0;\n static $startuplevelchecked = false;\n\n techproject_check_startup_level('requirement', $fatherid, $level, $startuplevelchecked);\n\n $sql = \"\n SELECT DISTINCT\n r.*,\n COUNT(str.specid) as specifs,\n c.collapsed\n FROM\n {techproject_requirement} r\n LEFT JOIN\n {techproject_spec_to_req} str\n ON\n r.id = str.reqid\n LEFT JOIN\n {techproject_collapse} c\n ON\n r.id = c.entryid AND\n c.entity = 'requirements' AND\n c.userid = $USER->id\n WHERE\n r.groupid = $group AND\n r.projectid = {$project->id} AND\n fatherid = $fatherid\n GROUP BY\n r.id\n ORDER BY\n ordering\n \";\n if ($requirements = $DB->get_records_sql($sql)) {\n $i = 1;\n foreach ($requirements as $requirement) {\n echo '<div class=\"entitynode nodelevel'.$level.'\">';\n $level++;\n $propagatedroot = $propagated;\n if ($propagated == null) {\n $propagatedroot = new StdClass();\n }\n techproject_print_single_requirement($requirement, $project, $group, $cmid, count($requirements));\n\n if ($requirement->collapsed) {\n // Give signal for lower branch.\n $propagatedroot->collapsed = true;\n $visibility = 'display: none';\n } else {\n // Give signal for lower branch.\n $propagatedroot->collapsed = false;\n $visibility = 'display: block';\n }\n echo '<div id=\"sub'.$requirement->id.'\" class=\"treenode\" style=\"'.$visibility.'\" >';\n if (!@$propagated->collapsed) {\n techproject_print_requirements($project, $group, $requirement->id, $cmid, $propagatedroot);\n }\n echo '</div>';\n $level--;\n echo '</div>';\n }\n } else {\n if ($level == 0) {\n echo $OUTPUT->box_start();\n print_string('norequirements', 'techproject');\n echo $OUTPUT->box_end();\n }\n }\n}", "function mfcs_miscellaneous_check_requests_requester($request_id = NULL) {\n if (!is_null($request_id) && !cf_is_integer($request_id)) {\n cf_error::invalid_integer('request_id');\n return FALSE;\n }\n\n // only join roles if the classification and rid would be the same (logically the same, because their numeric values likely differ).\n $role_student = user_role_load_by_name('student role');\n $role_student_id = (int) $role_student->rid;\n unset($role_student);\n\n $role_camp = user_role_load_by_name('camp role');\n $role_camp_id = (int) $role_camp->rid;\n unset($role_camp);\n\n $role_employee = user_role_load_by_name('employee role');\n $role_employee_id = (int) $role_employee->rid;\n unset($role_employee);\n\n $role_external = user_role_load_by_name('external role');\n $role_external_id = (int) $role_external->rid;\n unset($role_external);\n\n $complex_join_roles = 'and (';\n $complex_join_roles .= '(mer.classification = ' . MFCS_REQUEST_CLASSIFICATION_STUDENT . ' and ur.rid = ' . $role_student_id . ')';\n $complex_join_roles .= 'or (mer.classification = ' . MFCS_REQUEST_CLASSIFICATION_CAMPS . ' and ur.rid = ' . $role_camp_id . ')';\n $complex_join_roles .= 'or (mer.classification = ' . MFCS_REQUEST_CLASSIFICATION_FACULTY . ' and ur.rid = ' . $role_employee_id . ')';\n $complex_join_roles .= 'or (mer.classification = ' . MFCS_REQUEST_CLASSIFICATION_EXTERNAL . ' and ur.rid = ' . $role_external_id . ')';\n $complex_join_roles .= ' )';\n\n unset($role_student_id);\n unset($role_camp_id);\n unset($role_employee_id);\n unset($role_external_id);\n\n $requests = array();\n\n try {\n // only join if request classification and user classification would both be the same.\n // this will allow for a simple is NULL test to see if the user is not allowed to utilize the content.\n $complex_join = 'and (';\n $complex_join .= ' (mer.classification = ' . MFCS_REQUEST_CLASSIFICATION_STUDENT . ' and mbertu.event_role_id = ' . MFCS_REQUEST_CLASSIFICATION_STUDENT . ')';\n $complex_join .= ' or (mer.classification = ' . MFCS_REQUEST_CLASSIFICATION_CAMPS . ' and mbertu.event_role_id = ' . MFCS_REQUEST_CLASSIFICATION_CAMPS . ')';\n $complex_join .= ' or (mer.classification = ' . MFCS_REQUEST_CLASSIFICATION_FACULTY . ' and mbertu.event_role_id = ' . MFCS_REQUEST_CLASSIFICATION_FACULTY . ')';\n $complex_join .= ' or (mer.classification = ' . MFCS_REQUEST_CLASSIFICATION_EXTERNAL . ' and mbertu.event_role_id = ' . MFCS_REQUEST_CLASSIFICATION_EXTERNAL . ')';\n $complex_join .= ' )';\n\n $query = db_select('mfcs_requests', 'mer');\n $query->innerJoin('users', 'u', 'mer.user_id = u.uid');\n $query->leftJoin('users_roles', 'ur', 'u.uid = ur.uid ' . $complex_join_roles);\n $query->leftJoin('role', 'r', 'ur.rid = r.rid');\n $query->leftJoin('mfcs_users', 'mu', 'u.uid = mu.user_id');\n $query->leftJoin('mfcs_banner_event_roles_to_users', 'mbertu', 'mer.user_id = mbertu.user_id and mbertu.disabled = 0 ' . $complex_join);\n $query->leftJoin('mfcs_banner_event_roles', 'mber', 'mbertu.event_role_id = mber.id');\n\n unset($complex_join_roles);\n unset($complex_join);\n\n $query->addField('mer', 'id', 'id');\n $query->addField('mer', 'title', 'title');\n $query->addField('mer', 'location', 'location');\n $query->addField('mer', 'building', 'building');\n $query->addField('mer', 'room', 'room');\n $query->addField('u', 'uid', 'user_id');\n $query->addField('u', 'name', 'name');\n $query->addField('u', 'status', 'status');\n $query->addField('mu', 'banner_id', 'banner_id');\n $query->addField('mu', 'first_name', 'first_name');\n $query->addField('mu', 'last_name', 'last_name');\n $query->addField('mbertu', 'event_role_id', 'user_classification');\n $query->addField('mber', 'machine_name', 'user_classification_machine_name');\n $query->addField('r', 'rid', 'role_id');\n $query->addField('r', 'name', 'role_name');\n\n $status = array(\n MFCS_REQUEST_STATUS_LOCKED,\n MFCS_REQUEST_STATUS_UNLOCKED,\n\n // do not include closed and accepted because the users classifications and status may have long since changed.\n // enabling this would likely result in numerous false positives.\n #MFCS_REQUEST_STATUS_CLOSED_ACCEPTED,\n );\n\n $query->condition('mer.status', $status, 'IN');\n\n if (!is_null($request_id)) {\n $query->condition('mer.id', $request_id);\n }\n\n $or = db_or();\n $or->condition('u.status', 0);\n $or->isNull('mu.banner_id');\n\n $and = db_and();\n $and->isNull('mbertu.event_role_id');\n $and->isNull('ur.rid');\n $or->condition($and);\n\n $query->condition($or);\n\n $results = $query->execute()->fetchAll();\n\n if (!is_array($results)) {\n return FALSE;\n }\n\n if (!empty($results)) {\n foreach ($results as $result) {\n $requests[$result->id] = array(\n 'id' => $result->id,\n 'title' => $result->title,\n 'location' => $result->location,\n 'building' => $result->building,\n 'room' => $result->room,\n 'requester' => array(\n 'user_id' => $result->user_id,\n 'name' => $result->name,\n 'first_name' => $result->first_name,\n 'last_name' => $result->last_name,\n 'banner_id' => $result->banner_id,\n 'classification' => $result->user_classification,\n 'classification_machine_name' => $result->user_classification_machine_name,\n 'status' => $result->status,\n 'role_id' => $result->role_id,\n 'role_name' => $result->role_name\n ),\n );\n }\n }\n }\n catch (Error $e) {\n cf_error::on_query_execution($e);\n\n return FALSE;\n }\n catch (Exception $e) {\n cf_error::on_query_execution($e);\n\n return FALSE;\n }\n\n return $requests;\n}", "public function build_login_requirements()\n\t{\n\t\t$grouped_requirements = array();\n\t\t$individual_requirements = array();\n\t\t\n\t\t$login_requirements = new login_requirement_catalog();\n\t\t$login_requirements->load_by_country_and_groups(@$_SESSION['wizard']['new_customer']['country_id']);\n\t\t\n\t\t//separate into group and individually displayed requirements\n\t\tforeach($login_requirements->records as $record)\t{\n\t\t\tif (end(explode(\"/\", $record['edit_class'])) == 'login_requirement_document')\t{\n\t\t\t\t$grouped_requirements[$record['login_requirement_id']] = $record;\n\t\t\t} else {\n\t\t\t\t$individual_requirements[$record['login_requirement_id']] = $record;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (count($grouped_requirements)>0)\t{\n\t\t\t$page_name = login_requirement_view::WIZARD_ELEMENT_PREFIX . implode(\"_\", array_keys($grouped_requirements));\n\t\t\t$this->$page_name = new wizard_step('login_requirements/login_requirements_grouped_document');\n\t\t\t$this->$page_name->set_object_parameters(array($grouped_requirements));\n\t\t\t$this->$page_name->set_display_name(\"Login Requirements\");\n\t\t}\n\t\tif (count($individual_requirements)>0)\t{\n\t\t\tforeach($individual_requirements as $id=>$requirement)\t{\n\t\t\t\t$page_name = login_requirement_view::WIZARD_ELEMENT_PREFIX . $id;\n\t\t\t\t$this->$page_name = new wizard_step($requirement['edit_class']);\n\t\t\t\t$this->$page_name->set_object_parameters(array($id));\n\t\t\t\t$this->$page_name->set_display_name(\"Login Requirements\");\n\t\t\t}\n\t\t}\n\n\t}", "function tweak_itin(){\n\tglobal $itin_node_ids, $itin_edge_ids;\n\tglobal $attractions_info,$attractions_info_by_name,$attractions_info_by_id;\n\tglobal $subcatlist;\n\tglobal $attractions_seq_1d;\n\tglobal $subcat_attraction;\n\tglobal $attractions;\n\tglobal $itin_info_time_by_name;\n\t\n\t// $subcatlist\n\t\n\t// maintain a pool of attractions\n\t// at get_user_preference stage, algo should select a pool of high rating attractions with those subcat\n\t// note that if there are no attractions of that subcategory, we cannot do anything about it\n\n\t// first examine the itin and ask whether it has each customized attraction\n\t$general_attractions_list = array();\n\t$subcatlist2 = $subcatlist;\n\t\n\t$outputtext = \"<script> console.log('subcatlist(line 708) :\". implode(',',$subcatlist) . \"');</script>\";\n\t\t\techo \t$outputtext ;\n\t\t\t\n\t\t\t\n\tforeach ($attractions as $attractions_pt){\n\t\tif ( ($attractions_pt !==\"D\") or ($attractions_pt !==\"L\")){\n\t\t\t$temparray = explode('|',$attractions_info_by_name[$attractions_pt][\"subcategory\"]);\n\t\t\t$subcatlist2 = array_diff($subcatlist2, $temparray);\n\t\t\t$outputtext = \"<script> console.log('subcatlist2(line 716) :\". implode(',',$subcatlist2) . \"');</script>\";\n\t\t\techo \t$outputtext ;\n\t\t\t\n\t\t\t$outputtext = \"<script> console.log('attractions_pt(with subcat) (line 712) $attractions_pt :\". $attractions_info_by_name[$attractions_pt][\"subcategory\"] . \"');</script>\";\n\t\t\techo \t$outputtext ;\n\t\t\t\n\t\t\t\n\t\t\t// if attractions_pt do not have that subcat, put it in general attractions\n\t\t\t// and it is not a restaurant\t\t\t\n\t\t\tif (($attractions_info_by_name[$attractions_pt][\"category\"]!==\"restaurant\")and(count(array_intersect($temparray,$subcatlist))==0)) {\n\t\t\t\tarray_push($general_attractions_list,$attractions_pt);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t$general_attractions_list = array_diff($general_attractions_list,$attractions_seq_1d);\n\t\n\t\n\t\n\t// remaining subcat to take care about\n\t\n\t\n\t// then substitute general attraction by specific attraction\n\t// afterwards, see if it matches time constraint because timeslot may have moved\n\n\t// if it need one more attraction of that subcat, find the nearest general one and replace it with that specific attraction\n\t\n\t// if user has chosen N subcat, \n\n\t// for itin, pick out general attractions, that is, attractions that is not core-core, and not user preference\n\t// e.g. if user only choose mall, then things like church temple would be general attractions\n\t\n\t$to_be_replace = array();\n\t// compute all distance\n\t\n\t$outputtext = \"<script> console.log('subcatlist2(line 751) :\". implode(',',$subcatlist2) . \"');</script>\";\n\t\techo \t$outputtext ;\n\tforeach($subcatlist2 as $subcat_option){\n\t\t$subcat_attraction_list = $subcat_attraction[$subcat_option];\n\t\t$outputtext = \"<script> console.log('subcat_attraction_list(line 754) $subcat_option :\". implode(',',$subcat_attraction_list) . \"');</script>\";\n\t\techo \t$outputtext ;\n\t\t\n\t\t$temp_subcat_array=array();\t\n\t\t$temp_subcat_array_to_general=array();\n\t\t$temp_subcat_array_to_dist=array();\n\t\tforeach($subcat_attraction_list as $subcat_attraction_point){\n\t\n\t\t\t//$subcat_attraction_point = $subcat_attraction_list[0];\n\t\t\t$distance = array();\n\t\t\t\n\t\t\t$lat1 = $attractions_info_by_id[$subcat_attraction_point][\"latitude\"];\n\t\t\t$long1 = $attractions_info_by_id[$subcat_attraction_point][\"longitude\"];\n\t\t\t\n\t\t\tforeach($general_attractions_list as $general_attractions_pt){\n\t\t\t\t// compute distance only if replacing it will fit time constraint\n\t\t\t\t\n\t\t\t\t// compute time at the start of reaching that general attraction\n\t\t\t\t$current_time = $itin_info_time_by_name[$general_attractions_pt]- $attractions_info_by_name[$general_attractions_pt][\"duration\"]*60; \n\t\t\t\t\n\t\t\t\t$subcat_attraction_point_name = $attractions_info_by_id[$subcat_attraction_point][\"name\"];\n\t\t\t\tif (($current_time >= $attractions_info[$subcat_attraction_point_name][\"start_time\"]) and ($current_time +$attractions_info[$subcat_attraction_point_name][\"duration\"]*60<= $attractions_info[ $subcat_attraction_point_name][\"end_time\"])){\n\t\t\t\t\t$lat2 = $attractions_info_by_name[$general_attractions_pt][\"latitude\"];\n\t\t\t\t\t$long2 = $attractions_info_by_name[$general_attractions_pt][\"longitude\"];\n\t\t\t\t\t$distance[$general_attractions_pt] = get_distance($lat1,$long1,$lat2,$long2);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\t\t\n\t\t\tif (count($distance)>0){\n\t\t\t\tasort($distance);\n\t\t\t\t$first_value = reset($distance);\n\t\t\t\t$first_key = key($distance);\n\t\t\t\t//$temp_subcat_array[$first_key] = $first_value;\n\t\t\t\t\n\t\t\t\t$temp_subcat_array_to_dist[ $subcat_attraction_point ] =$first_value;\n\t\t\t\t$temp_subcat_array_to_general[$subcat_attraction_point] = $first_key;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\tif (count($temp_subcat_array_to_dist)>0){\n\t\t\tasort($temp_subcat_array_to_dist);\n\t\t\t$first_dist2= reset($temp_subcat_array_to_dist);\n\t\t\t$first_subcat2 = key($temp_subcat_array_to_dist);\n\t\t\t\n\t\t\t$first_general2 = $temp_subcat_array_to_general[$first_subcat2];\n\t\t\t\n\t\t\t// replace first_key by that subcat_attraction_point\n\t\t\t$to_be_replace[$first_general2] = $first_subcat2;\n\t\t\t$general_attractions_list=array_values(array_diff($general_attractions_list,array($first_general2)));\n\t\t}\n\t}\n\t\n\t$outputtext = \"<script> console.log('to_be_replace (line 757) \". implode( ',' , $to_be_replace ) . \"');</script>\";\n\techo \t$outputtext ;\n\t// find the one with minimum distance\n\t// for this do a single pass\n\n\t// regenerate itin\n\t\n\tforeach($itin_node_ids as $day=>$this_day_node_ids){\n\t\t\n\t\tforeach($this_day_node_ids as $index=>$current_node_ids){\n\t\t\t\n\t\t\t//$result = array_search($attractions_info_by_id[\"current_node_ids\"][\"name\"],$to_be_replace );\n\t\t\tif (( $current_node_ids!== \"L\") and ($current_node_ids!==\"D\")and ( array_key_exists($attractions_info_by_id[$current_node_ids][\"name\"],$to_be_replace))){\n\t\t\t\t$itin_node_ids[$day][$index] = $to_be_replace[$attractions_info_by_id[$current_node_ids][\"name\"]];\n\t\t\t\t\n\t\t\t\tif (($index>0) and ($itin_node_ids[$day][$index-1] !==\"D\") and ($itin_node_ids[$day][$index-1] !==\"L\")) {\n\t\t\t\t\t// replace previous edge\n\t\t\t\t\t$start_point = $attractions_info_by_id[$itin_node_ids[$day][$index-1]][\"name\"];\n\t\t\t\t\t$end_point = $attractions_info_by_id[$itin_node_ids[$day][$index]][\"name\"];\n\t\t\t\t\t$this_edge_id = get_edge($start_point,$end_point);\n\t\t\t\t\t$itin_edge_ids[$day][$index-1]=$this_edge_id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (($index<count($itin_node_ids[$day]))and ($itin_node_ids[$day][$index+1] !==\"D\") and ($itin_node_ids[$day][$index+1] !==\"L\")){\n\t\t\t\t\t// replace next edge\n\t\t\t\t\t$start_point = $attractions_info_by_id[$itin_node_ids[$day][$index]][\"name\"];\n\t\t\t\t\t$end_point = $attractions_info_by_id[$itin_node_ids[$day][$index+1]][\"name\"];\n\t\t\t\t\t$this_edge_id = get_edge($start_point,$end_point);\n\t\t\t\t\t$itin_edge_ids[$day][$index]=$this_edge_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\t// right now, assume we only need it such that there only need to be 1 attraction per subcat\n\t// for each missing subcat, find the highest ranking (custom rating + TA ranking) in that subcat\n\t\n\t// for all (subcat attraction, general attraction), compute distance/ travel time\n\t// which could be geographic distance, or increase in travel time\n\t\n\t// find the pair with minimum travel time, and replace it with \n\t\n\t\n}", "public function getApproverLevel($emp_id,$request_id)\n {\n $approver_level = \"view\";\n if($emp_id != '' && $request_id != '')\n {\n $db = Zend_Db_Table::getDefaultAdapter();\n $app_query = \"select approver_1,approver_2,approver_3,approver_status_1,approver_status_2,approver_status_3 \"\n . \"from main_sd_requests where id = \".$request_id.\" and isactive = 1 and status = 'To management approve'\";\n $app_result = $db->query($app_query);\n $app_row = $app_result->fetch();\n \n if(count($app_row) > 0)\n {\n if($pos = array_search($emp_id,$app_row))\n { \n $app_pos = substr($pos,-1);\n if($app_pos == 1)\n {\n if($app_row['approver_status_'.$app_pos] == '')\n $approver_level = $app_pos;\n else \n $approver_level = 'view';\n }\n else\n {\n if($app_row['approver_status_'.$app_pos] == '' && $app_row['approver_status_'.($app_pos-1)] == 'Approve')\n $approver_level = $app_pos;\n else \n $approver_level = \"view\";\n }\n $max_app = 0;\n for($i=1;$i<=3;$i++)\n {\n if($app_row['approver_'.$i] != '')\n $max_app++;\n }\n if($approver_level != 'view')\n {\n $approver_level = array('app_pos' => $app_pos,'max_app' => $max_app);\n }\n }\n }\n }\n return $approver_level;\n }", "public function apcGhgProtocolScopeAssessment() {\n\t\tif(($client_id = @$GLOBALS['core']->plugin->clients->client->client_id) == false) return;\n\t\t$this->clientChecklist = new clientChecklist($this->db);\n\t\t$this->clientChecklist->autoIssueChecklist(70, $client_id, true);\n\t\tdie();\n\t}", "function requirement_delete($project_id, $req_id) {\n\n global $db;\n\n\t$tbl_req \t\t\t\t\t= REQ_TBL;\n\t$f_req_id \t\t\t\t\t= $tbl_req .\".\". REQ_ID;\n\t$f_req_unique_id \t\t\t= $tbl_req .\".\". REQ_UNIQUE_ID;\n\t$f_req_parent\t \t\t\t= $tbl_req .\".\". REQ_PARENT;\n\n\t$tbl_req_ver\t\t\t\t= REQ_VERS_TBL;\n\t$f_req_ver_uid\t\t\t\t= $tbl_req_ver .\".\". REQ_VERS_UNIQUE_ID;\n\t$f_req_ver_req_id\t\t\t= $tbl_req_ver .\".\". REQ_VERS_REQ_ID;\n\n $tbl_test_req_assoc\t\t\t= TEST_REQ_ASSOC_TBL;\n $f_test_req_assoc_id\t\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_ID;\n $f_test_req_assoc_req_id\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_REQ_ID;\n $f_test_req_assoc_test_id\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_TEMPEST_TEST_ID;\n\t$f_test_req_assoc_covered\t= $tbl_test_req_assoc .\".\". TEST_REQ_ASSOC_PERCENT_COVERED;\n\n\t$tbl_req_ver_assoc_rel\t\t= REQ_VERS_ASSOC_REL;\n\t$f_req_ver_assoc_rel_id\t\t= $tbl_req_ver_assoc_rel.\".\".REQ_VERS_ASSOC_REL_ID;\n\t$f_req_ver_assoc_rel_req_id\t= $tbl_req_ver_assoc_rel.\".\".REQ_VERS_ASSOC_REL_REQ_ID;\n\t$f_req_ver_assoc_rel_rel_id\t= $tbl_req_ver_assoc_rel.\".\".REQ_VERS_ASSOC_REL_REL_ID;\n\n\t$tbl_discussion\t\t\t= DISC_TBL;\n\t$f_discussion_id\t\t= DISC_TBL .\".\". DISC_ID;\n\t$f_discussion_req_id\t= DISC_TBL .\".\". DISC_REQ_ID;\n\n\t$project_properties = session_get_project_properties();\n\n\tforeach( requirement_get_detail($project_id, $req_id) as $rows_req) {\n\n\t\tif($rows_req[REQ_VERS_FILENAME]!=\"\") {\n\t\t\tunlink($project_properties[PROJ_REQ_UPLOAD_PATH].$rows_req[REQ_VERS_FILENAME]);\n\t\t}\n\t}\n\n\t# DELETE REQUIREMENT VERSIONS\n\t$q = \"\tDELETE FROM $tbl_req_ver\n\t\t\tWHERE $f_req_ver_req_id = $req_id\";\n\n db_query( $db, $q );\n\n\t# DELETE REQUIREMENT\n\t$q = \"\tDELETE FROM $tbl_req\n\t\t\tWHERE $f_req_id = $req_id\";\n\n\tdb_query( $db, $q );\n\n\t# REMOVE REQUIREMENT ASSOCIATIONS\n\t$q = \"\tUPDATE $tbl_req\n\t\t\tSET $f_req_parent = 0\n\t\t\tWHERE $f_req_parent = $req_id\";\n\n\t# REMOVE TEST ASSOCIATIONS\n\t$q = \"\tDELETE FROM $tbl_test_req_assoc\n\t\t\tWHERE $f_test_req_assoc_req_id = $req_id\";\n\n\tdb_query( $db, $q );\n\n\t# REMOVE RELEASE ASSOCIATIONS\n\t$q = \"\tDELETE FROM $tbl_req_ver_assoc_rel\n\t\t\tWHERE $f_req_ver_assoc_rel_req_id = $req_id\";\n\n\tdb_query( $db, $q );\n\n\t# DELETE DISCUSSIONS\n\t$q = \"\tSELECT $f_discussion_id\n\t\t\tFROM $tbl_discussion\n\t\t\tWHERE $f_discussion_req_id = $req_id\";\n\n\t$rs = db_query( $db, $q );\n\t$rows = db_fetch_array($db, $rs);\n\tforeach($rows as $row) {\n\n\t\t$discussion_id = $row[DISC_ID];\n\n\t\tdiscussion_delete($discussion_id);\n\t}\n}", "function approved_subject_create_new_list($txt_approval_number) {\n\t$currentdate = strtoupper(date('d-M-Y h:i:s A'));\n\t$sql_descode = select_query_json(\"Select distinct ATYCODE , TARNUMB , APMNAME , TOPCORE , SUBCORE , ENTSRNO FROM approval_subject_add where APRNUMB = '\".$txt_approval_number.\"'\", \"Centra\", \"TCS\");\n\t//$s_no = 0;\n\tforeach($sql_descode as $sectionrow) {\n\t\t$txt_apmcode = select_query_json(\"Select nvl(Max(APMCODE),0)+1 maxarqcode From approval_master\", \"Centra\", \"TCS\");\n\t\t\t$ivqry = delete_dbquery(\"INSERT INTO approval_master select distinct '\".$txt_apmcode[0]['MAXARQCODE'].\"', ATYCODE, '1', APMNAME, '1', '\".$_SESSION['tcs_usrcode'].\"', sysdate , '', '', 'N', '', '', TARNUMB, SUBCORE, TOPCORE from approval_subject_add where APRNUMB = '\".$txt_approval_number.\"' and ATYCODE = '\".$sectionrow['ATYCODE'].\"' and ENTSRNO = '\".$sectionrow['ENTSRNO'].\"'\");\n\n\t\tif ($sectionrow['ATYCODE'] != '1') {\n\t\t\t$sql_descode_1 = select_query_json(\"Select * FROM approval_subject_add where APRNUMB = '\".$txt_approval_number.\"' AND ENTSRNO = '\".$sectionrow['ENTSRNO'].\"' ORDER BY BRNHDSR\", \"Centra\", \"TCS\");\n\t\t\t$BRNHDCD = select_query_json(\"Select nvl(Max(BRNHDCD),0)+1 maxarqcode From approval_branch_head\", \"Centra\", \"TCS\"); // subject group\n\n\t\t\tforeach($sql_descode_1 as $sectionrow_new) {\n\t\t\t\tif ($sectionrow_new['TARNUMB'] == '0') {\n\t\t\t\t\t$apm_code = $txt_apmcode[0]['MAXARQCODE'];\n\t\t\t\t\t$apm_value = '0';\n\t\t\t\t\t$apm_tarnumb = '0';\n\t\t\t\t\t$apm_depcode = '0';\n\t\t\t\t}else {\n\t\t\t\t\t$apm_code = '0';\n\t\t\t\t\t$apm_value = '1000000000';\n\t\t\t\t\t$apm_tarnumb = $sectionrow_new['EMPNAME'];\n\t\t\t\t\t$apm_depcode = $sectionrow_new['SUBCORE'];\n\t\t\t\t}\n\t\t\t\t$ivqrya = delete_dbquery(\"INSERT INTO approval_branch_head select '\".$BRNHDCD[0]['MAXARQCODE'].\"', BRNCODE, EMPSRNO, EMPCODE, EMPNAME, '\".$_SESSION['tcs_usrcode'].\"', sysdate , '', '', 'N', '' , '' , '\".$sectionrow_new['BRNHDSR'].\"', '\".$apm_depcode.\"', '\".$apm_tarnumb.\"', '\".$apm_value.\"', '\".$apm_code.\"', '' from approval_subject_add where APRNUMB = '\".$txt_approval_number.\"' and ATYCODE = '\".$sectionrow['ATYCODE'].\"' and BRNHDSR = '\".$sectionrow_new['BRNHDSR'].\"'\");\n\t\t\t}\n\n\t\t}\n\t}\n}", "public function getReqCodes($req_status,$flag = '')\n {\n if($flag != '')\n $data = $this->fetchAll(\"isactive = 1 and req_status in ('Approved','In process')\")->toArray();\n else \n $data = $this->fetchAll(\"isactive = 1 and req_status = '\".$req_status.\"' \")->toArray();\n return $data;\n }", "function formatReqMenu($selReqCode, $allItem = false, $chooseItem = false, $urlFilter = null) {\n\tglobal $allReqLevels;\n\n\t$reqMenu = \"<select name=req>\\n\";\n\tif ($allItem)\n\t\t$reqMenu .= \"<option value=*\". ($selReqCode=='*' ? ' selected' : '') .\n\t\t\t\t\">All Requirements</option>\\n\";\n\tif ($chooseItem)\n\t\t$reqMenu .= \"<option value=choose\". ($selReqCode=='choose' ? ' selected' : '') .\n\t\t\t\t\">Choose Chapter</option>\\n\";\n\t$reqs = GetAllReqCodes();\n\tforeach ($reqs as $r => $reqCode) {\n\t\t$ti = codeToTitle($reqCode);\n\t\t$val = $urlFilter ? $urlFilter($reqCode) : $reqCode;\n\t\t$reqMenu .= \"<option value='$val'\". \n\t\t\t\t($selReqCode==$reqCode ? ' selected' : '') .\">\" . \n\t\t\t\tsubstr(\"********\", 0, $allReqLevels[$r]-1) .' '. $ti .\"</option>\\n\";\n\t}\n\treturn $reqMenu .\"</select>\\n\";\n}", "public function generateReqs ( )\n\t{\n\t\tif ( is_array( $this->items ) )\n\t\t\tforeach ( $this->items as $item )\n\t\t\t\t$item->generateReqs( );\n\t}", "public function requestCompanyToUnit(Request $request){\n try{\n // Collect all request based on company id\n $companyUser = $request->user();\n if(!$companyUser || !$companyUser->hasRole('company'))\n throw new Exception(\"Must be send by company\");\n\n $validator = Validator::make($request->all(), [\n 'condemnation_id'=>'required'\n ]);\n\n if( $validator->fails()){\n $validatorErrors = [];\n foreach($validator->messages()->getMessages() as $fieldName => $messages) {\n foreach( $messages as $message){\n $validatorErrors[$fieldName] = $message;\n }\n }\n throw new Exception(implode(' ',$validatorErrors));\n }\n\n $activeCondemnation = Condemnation::where(['id'=>$request->input('condemnation_id'),'status'=>0]);\n if(!$activeCondemnation)\n throw new Exception(\"Sorry condemnation not found!\");\n\n $company_term = TermRelation::where(['user_id'=>$companyUser->id,'role'=>4, 'term_type'=>0])->first();\n\n // Get all solder request that approve by company\n $allPendingRequest = SolderItemRequest::where([\n 'company_id'=>$company_term->company_id,\n 'status'=>2\n ])->get();\n\n if(count($allPendingRequest) === 0 )\n throw new Exception(\"Pending request not found!\");\n\n // Get company term\n\n $requestJsonData = array();\n $requestItems = 0;\n $collectedKitTypes = [];\n $mainCollection =[];\n foreach( $allPendingRequest as $key=>$pendingRequest ){\n // Get request item\n $kitItem = SolderKits::find($pendingRequest->solder_kit_id);\n\n // Collect item Ids\n if(isset($requestJsonData['kit_ids'])){\n $requestJsonData['kit_ids'] = $requestJsonData['kit_ids'].','.$kitItem->item_id;\n }else {\n $requestJsonData['kit_ids'] = (string)$kitItem->item_id;\n }\n // Get kit types\n $item_types = ItemType::find($kitItem->item_type_id);\n\n if(isset($collectedKitTypes[$item_types->type_name])){\n $collectedKitTypes[$item_types->type_name]['items'] +=1;\n }else {\n $collectedKitTypes[$item_types->type_name]['items'] = 1;\n $collectedKitTypes[$item_types->type_name]['type_id'] = $kitItem->item_type_id;\n }\n\n $requestItems += 1;\n $pendingRequest->status = 2;\n $pendingRequest->save();\n }\n\n if(count($collectedKitTypes)>0){\n foreach($collectedKitTypes as $type_name=>$kitType ){\n array_push($mainCollection, ['type_name'=>$type_name,'quantity'=>$kitType['items'], 'type_id'=>$kitType['type_id']]);\n }\n }\n\n $companyUnitUser = TermRelation::getCompanyUnitUser($company_term->unit_id);\n if( count($requestJsonData) > 0 ) {\n $requestJsonData = (object) $requestJsonData;\n $requestJsonData->kit_types = $mainCollection;\n // Check if it has already a request\n $unitRequest = KitItemRequest::where([\n 'condemnation_id'=>$request->input('condemnation_id'),\n 'company_user_id'=>$companyUser->id,\n 'stage'=>1,\n 'status'=> 1 // unit level\n ])->first();\n\n if(!$unitRequest )\n $unitRequest = new KitItemRequest();\n $unitRequest->stage = 1;\n $unitRequest->status = 1; // For unit\n $unitRequest->request_items = $requestItems;\n $unitRequest->kit_items = \\GuzzleHttp\\json_encode($requestJsonData);\n $unitRequest->unit_user_id = $companyUnitUser->user_id;\n $unitRequest->company_user_id = $companyUser->id;\n $unitRequest->condemnation_id = $request->input('condemnation_id');\n $unitRequest->save();\n\n //Send push notification to unit level\n\n }else {\n throw new Exception(\"Sorry request item not found!\");\n }\n\n return ['success'=>true, 'message'=>\"Request send to unit level!\", 'data'=>$company_term ];\n }catch (Exception $e){\n return ['success'=>false, 'message'=>$e->getMessage()];\n }\n }", "public function getERInitScopeInfo($ReqID){\n $strquery = \"SELECT\n [IS_Architecture_Owner] as owner\n ,[IS_FW_Scoping] as FW\n ,[IS_Operations_Scoping] as Operations\n ,[IS_Publications_Scoping] as Publications\n ,[IS_HSW_Scoping] as HSW\n ,[IS_PCT_Scoping] as PCT\n ,[IS_Driver_Scoping] as Driver\n ,[IS_Assumptions] as Assumptions\n FROM [View_LSIP2_EnhancementRequest] WHERE id = '$ReqID'\";\n $this->query = mssql_query($strquery, $this->dbLinkID);\n\t $result = mssql_fetch_assoc($this->query);\n\t //$result = array(\"FeatureCQID\"=>$result['FeatureCQID'],\"HeadLine\"=>mb_convert_encoding($result['Headline'], 'Windows-1252', 'UTF-8'),\"Description\"=>mb_convert_encoding($result['Description'], 'Windows-1252', 'UTF-8'));\n\t return $result;\n }", "function ProcessAdHocRequests(&$statusMessage)\n{\n $requests = RetrieveAdHocAbsenceRequests();\n $return = true;\n \n foreach ($requests as $request)\n {\n \t$id \t\t\t= $request[AD_HOC_REQ_ID];\n \t$employeeID\t\t= $request[AD_HOC_EMP_ID];\n\t$startDate\t\t= $request[AD_HOC_START];\n\t$endDate\t\t= $request[AD_HOC_END];\n\t$absenceTypeID = $request[AD_HOC_ABSENCE_TYPE_ID];\n \n $employee = RetrieveEmployeeByID($employeeID);\n $statusMessage.=\"<b>[Processing AdHoc request for \".\n $employee[EMP_NAME].\"]</b><br/>\";\n\n \t$result = ProcessAbsenceRequest($employeeID,$startDate,$endDate,\n $absenceTypeID,$statusMessage);\n if ($result == false)\n {\n $return = false;\n }\n \n \tDeleteAdHocAbsenceRequest($id);\n }\n return $return;\n}", "public function checkPreReqs($studentId, $courseId, $courseOfferingId){\r\n\t\tglobal $_DB;\r\n\t\t$view = new AdminView();\r\n\t\t$courseController = new CourseController();\r\n\t\t$preReqs = $_DB->query(\"SELECT * FROM Prerequisites WHERE CourseID = '\" . $_DB->escape($courseId) .\"'\");\r\n\t\tIf ($preReqs){\r\n\t\t\tforeach($preReqs as $preReq){\r\n\t\t\t\t$taken = $_DB->query(\"SELECT R.CourseOfferingID FROM Registered R \r\n\t\t\t\t\t\t\t\t\t\tINNER JOIN CourseOffering CO ON (CO.CourseOfferingID = R.CourseOfferingID)\r\n\t\t\t\t\t\t\t\t\t\tWHERE R.StudentID = \".$_DB->escape($studentId).\" AND CO.CourseID = '\" .$_DB->escape($preReq['PrerequisiteID']).\"'\" );\r\n\t\t\t\tif($taken){\r\n\t\t\t\t\t//check to make sure grade was passing and that it was taken in past\r\n\t\t\t\t\tlist($info) = $_DB->query(\"SELECT M.Grade, CO.Year, CO.Semester\r\n\t\t\t\t\t\t\t\tFROM Student as S \r\n\t\t\t\t\t\t\t\tinner join Marks as M on M.StudentID = S.StudentID\r\n\t\t\t\t\t\t\t\tinner join CourseOffering as CO on CO.CourseOfferingID = M.CourseOfferingID\r\n\t\t\t\t\t\t\t\tinner join Course as C on C.CourseID = CO.CourseID\r\n\t\t\t\t\t\t\t\tWHERE S.StudentID = \" . $_DB->escape($studentId) . \"\r\n\t\t\t\t\t\t\t\tAND C.CourseID = '\" . $_DB->escape($preReq['PrerequisiteID']) . \"'\");\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tif($info['Grade'] != 'F'){\r\n\t\t\t\t\t\t$year = $_DB->query(\"SELECT Year FROM CourseOfferingID WHERE CourseOfferingID = \" .$_DB->escape($courseOfferingId));\r\n\t\t\t\t\t\tif ($year == $info['Year']){\r\n\t\t\t\t\t\t\t$semester = $_DB->query(\"SELECT Semester FROM CourseOfferingID WHERE CourseOfferingID = '\" .$_DB->escape($courseOfferingId).\"'\");\r\n\t\t\t\t\t\t\tif ($info['Semester'] >= $semester){\r\n\t\t\t\t\t\t\t\t$view->set('error','Cannot Take Course Concurrently with - ' .$_DB->escape($preReq['PrerequisiteID']));\r\n \t\t\t\t\t\t\t\t$_SESSION['siteMessage'] = $view->sUseTemplate('/components/main/views/error.tpl.php');\r\n\t\t\t\t\t\t\t\treturn false;//$courseController->search();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {return true;}\r\n\t\t\t\t\t\t}else{return true;}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$view->set('error','You have not passed prerequisite - ' .$_DB->escape($preReq['PrerequisiteID']));\r\n \t\t\t\t\t\t$_SESSION['siteMessage'] = $view->sUseTemplate('/components/main/views/error.tpl.php');\r\n\t\t\t\t\t\treturn false;//$courseController->search();die;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$view->set('error','You have not taken prerequisite - ' .$_DB->escape($preReq['PrerequisiteID']));\r\n \t\t\t\t\t$_SESSION['siteMessage'] = $view->sUseTemplate('/components/main/views/error.tpl.php');\r\n\t\t\t\t\treturn false;//$courseController->search();die;\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}else{return true;}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setArsttaxexemnbr() Set the value of [intbwhse] column.
public function setIntbwhse($v) { if ($v !== null) { $v = (string) $v; } if ($this->intbwhse !== $v) { $this->intbwhse = $v; $this->modifiedColumns[ArShipToTableMap::COL_INTBWHSE] = true; } return $this; }
[ "public function setIntbwhse($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->intbwhse !== $v) {\n $this->intbwhse = $v;\n $this->modifiedColumns[SoHeaderTableMap::COL_INTBWHSE] = true;\n }\n\n return $this;\n }", "public function setIntbwhse($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->intbwhse !== $v) {\n $this->intbwhse = $v;\n $this->modifiedColumns[SalesHistoryDetailTableMap::COL_INTBWHSE] = true;\n }\n\n return $this;\n }", "public function setIdsexo($idsexo){\n $this->idsexo = $idsexo;\n }", "public function setTaxNo($taxno);", "public function set_isbn($isbn)\n\t{\n\t\treturn $this->set_exth_record(self::EXTH_RECORD_TYPE_ISBN, $isbn);\n\t}", "public function testSetEdDucsNbEx() {\n\n $obj = new ConstantesEntreprise();\n\n $obj->setEdDucsNbEx(\"edDucsNbEx\");\n $this->assertEquals(\"edDucsNbEx\", $obj->getEdDucsNbEx());\n }", "public function setTbLivroIsbn13($tbLivroIsbn13){\n\t$this->tbLivroIsbn13 = $tbLivroIsbn13;\n}", "public function setSexe(string $sexe)\n {\n $this->sexe = $sexe;\n\n return $this;\n }", "public function setSexe($sexe)\n {\n $this->sexe = $sexe;\n\n return $this;\n }", "public function setNbVente($_nbvente) { $this->nbvente = $_nbvente; }", "public function setExtn(string $extn)\n\t{\n\t\t$this->extn=$extn; \n\t\t$this->keyModified['extn'] = 1; \n\n\t}", "public function getArcutaxexemnbr()\n {\n return $this->arcutaxexemnbr;\n }", "public function setIntbwhsestat($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->intbwhsestat !== $v) {\n $this->intbwhsestat = $v;\n $this->modifiedColumns[WarehouseTableMap::COL_INTBWHSESTAT] = true;\n }\n\n return $this;\n }", "public function testEditDocumentXlsxSetCellByIdentifier()\n {\n }", "public function setNb($nb)\n\t{\n\t\t$this->nb = $nb;\n\t}", "public function setIntbwhseorig($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->intbwhseorig !== $v) {\n $this->intbwhseorig = $v;\n $this->modifiedColumns[SalesOrderTableMap::COL_INTBWHSEORIG] = true;\n }\n\n return $this;\n }", "public function setRowspan($num)\n {\n parent::setAttr(\"rowspan\", $num);\n }", "function setExponent($int_exp)\r\n\t{\r\n\t\t$this->_exp = (int) $int_exp;\r\n\t}", "public function setSexe($sexe)\n {\n $this->sexe = $sexe;\n\n return $this;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
//////////////////////////////////////////////////////////////////////////////////// KB Articles ////////////////////////////////////////////////////////////////////////////////////
public function getKbArticles($array = array()) { $endpoint = $this->host . '/api/KBArticle'; return $this->exec('GET',$endpoint, $array); }
[ "public function imported_articles(){\r\n\r\n\t\t}", "public function article()\n {\n $this->load->module('article');\n $this->article->index();\n }", "function article($atts)\n\t{\n\t\tglobal $pretext;\n\t\treturn ($pretext['id']) ? doArticle($atts) : doArticles($atts);\n\t}", "public function articles() {\n return $this->hasMany('App\\Models\\Knowledgebase', 'knowledgebase_categoryid', 'category_id');\n }", "function controller_article($app, $options = []) {\n global $u_level, $__LANG;\n $pageObj = $app->page;\n $siteObj = $app->site;\n $scope = $app->page->scope;\n $obj_type = 'article';\n $fields = array(\"id\", \"type\", \"title\", \"content\");\n\n $scope->auth_add_article = $auth_add = $auth_edit = $u_level >= USER_LEVEL_EDITOR ? 1 : 0;\n\n $id = $scope->obj_id = $app->object_id;\n $options['article_id'] = $obj_id;\n\n $scope->type = $type = pick_first($options['object_subtype'], $scope->object_subtype, $pageObj->object_subtype);\n\n $lang = $options['language'] ?: $__LANG;\n $user_level = $u_level ?: 0;\n\n $page_size = isset($options['page_size']) ? $options['page_size'] : 5; // for pagination\n $hard_limit = 20;\n\n $scope->start = $start = isset($_GET['start']) ? $_GET['start'] : 0;\n $scope->limit = $limit = $page_size ?: $hard_limit;\n\n $add = $scope->add = isset($_GET['add']) && $auth_add;\n\n $search = ['site_id' => $siteObj->id, 'type' => $type, 'language' => $lang, 'active' => 1, 'user_level' => array('<=', $u_level ?: 0)];\n if(!$auth_add) $search['published'] = 1;\n\n $searchOptions = [\"sort\" => \"post_date DESC\", \"start\" => $start, \"limit\" => $limit];\n $articles = find_objects($obj_type, $search, $searchOptions); \n\n $sidebar_limit = 5;\n $scope->recent = find_objects($obj_type, $search, array('sort' => 'created desc', 'limit' => $sidebar_limit)); \n $scope->popular = find_objects($obj_type, $search, array('sort' => 'views desc', 'limit' => $sidebar_limit)); \n\n if($id) { \n $obj = get_object($obj_type, $id);\n $scope->article_id = $obj->id;\n $scope->auth_edit_article = $obj->auth_edit_article = $auth_edit = $u_level >= USER_LEVEL_EDITOR || auth_article($obj);\n $scope->comments = find_objects('comment', array(\"article_id\" => $id, 'active' => 1));\n if($auth_edit) {\n jfu_dependencies($app); // load scripts + css for new file uploader\n if(isset($_GET['publish'])) {\n $publish = $_GET['publish'] ? 1 : 0; \n if($publish != $obj->published) {\n list($id, $errors) = update_object('article', ['published' => $publish], $id);\n if($errors) return controller_error($app, $errors); \n $obj->published = $published;\n }\n }\n\n //$scope->article->json_data = object_json_data($obj_type, $obj, $fields);\n $scope->comments = $comments = find_objects('comment', ['article_id' => $id, 'active' => 1], ['sort' => 'created']);\n $scope->comment_count = count($comments); \n } elseif(!$obj->published) {\n return controller_error($app, \"Not authorized\");\n }\n\n $scope->edit = $edit = isset($_GET['edit']) && $auth_edit;\n if(!$edit) object_increment($obj_type, $id, 'views');\n $scope->article = $obj;\n\n } elseif($add) {\n // do nothing\n } elseif($type) {\n if($auth_edit) {\n foreach($articles as &$article) {\n //$article->json_data = object_json_data($obj_type, $article, $fields);\n $article->auth_edit_article = $u_level >= USER_LEVEL_EDITOR || auth_article($article);\n }\n }\n $scope->count = $count = count_objects('article', $search);\n //echo(\"Found $count articles\");dump($search);\n $scope->articles = $articles;\n //dump($articles);\n } else {\n $scope->error = \"No article ID or type set\";\n }\n return;\n }", "public function getArticlesList();", "public function frontPageArticles() {\n\t\t\t$db = new DatabaseModule();\n\n\t\t\t$getArticles = $db->Handle->prepare('SELECT id FROM ms_articles ORDER BY articleDate DESC LIMIT 5');\n\t\t\t$getArticles->execute();\n\t\t\t$articles = $getArticles->fetchAll();\n\n\t\t\t$first = true;\n\n\t\t\tforeach($articles as $articleID) {\n\t\t\t\t$article = new Article($articleID['id']);\n\n\t\t\t\t$Link = \"blog/blog.php?do=read&article=\" . $article->ID;\n\n\t\t\t\tif($article->Comments < 10) {\n\t\t\t\t\t$cBox = \"<div class=\\\"cBox\\\"> <span style=\\\"position: relative; left: 3px;\\\">\". $article->Comments . \"</span> </div>\";\n\t\t\t\t} else {\n\t\t\t\t\t$cBox = \"<div class=\\\"cBox\\\"> <span>\". $article->Comments . \"</span> </div>\";\n\t\t\t\t}\n\n\t\t\t\tif($first) {\n\t\t\t\t\techo <<<FIRST\n\t\t\t\t\t\t<a class=\"latestArticle\" href=\"{$Link}\">\n\t\t\t\t\t\t\t<img src=\"Resources/Images/Covers/BlogPosts/{$article->Cover}.png\" alt=\"{$article->Title}\" title=\"{$article->Title}\" />\n\n\t\t\t\t\t\t\t{$cBox}\n\n\t\t\t\t\t\t\t<div class=\"headline\">\n\t\t\t\t\t\t\t\t{$article->Title}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</a>\nFIRST;\n\n\t\t\t\t\t$first = false;\n\t\t\t\t} else {\n\t\t\t\t\techo <<<ARTICLE\n\t\t\t\t\t\t<a class=\"article\" href=\"{$Link}\">\n\t\t\t\t\t\t\t<img src=\"Resources/Images/Covers/BlogPosts/{$article->Cover}.png\" />\n\n\t\t\t\t\t\t\t{$cBox}\n\n\t\t\t\t\t\t\t<div class=\"headline\">{$article->Title}</div>\n\t\t\t\t\t\t</a>\nARTICLE;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function knowledge_base_articles()\n {\n if (get_option('use_knowledge_base') == 0) {\n redirect(site_url('admin'));\n }\n\n $this->load->model('knowledge_base_model');\n $data['groups'] = $this->knowledge_base_model->get_kbg();\n $data['title'] = _l('kb_reports');\n $this->load->view('admin/reports/knowledge_base_articles', $data);\n }", "public function get_articles( )\r\n\t\t{\r\n\t\t\t$feed_settings = $this->get_feed_settings(); \r\n\r\n\t\t\tif ( isset( $_FILES['brafton-archive']['tmp_name'] ) ) //todo add archive file upload settings\r\n\t\t\t{\r\n\t\t\t\tbrafton_log( array( 'message' => \"Archive option selected. Importing articles from xml archive file.\" ) );\r\n\t\t\t\t$articles = NewsItem::getNewsList( $_FILES['brafton-archive']['tmp_name'], \"html\" );\r\n\t\t\t} \r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\tif ( preg_match( \"/\\.xml$/\", $feed_settings['api_key'] ) ){\r\n\t\t\t\t\t$articles = NewsItem::getNewsList( $feed_settings['api_key'], 'news' );\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$url = 'http://' . $feed_settings['api_url'];\r\n\t\t\t\t\t$ApiHandler = new ApiHandler( $feed_settings['api_key'], $url );\r\n\t\t\t\t\t$articles = $ApiHandler->getNewsHTML(); \t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn $articles; \r\n\t\t}", "function get_articles() {\n\tglobal $ofy, $articleclass;\n\n\tif(isset($_POST['save'])) {\n\t\t$localekey = $_POST['localeinput'];\n\t} else {\n\t\t$localekey = $_REQUEST['locale'];\t\n\t}\t\n\t\n\t$articles = $ofy->query($articleclass)->filter('locale',$localekey)->list();\n\t\n\tif($articles->size()>0) {\n\t\n\t\techo '<h2>Edit Locale Articles</h2>';\n\t\n\t\techo '<ol>';\t\n\t\n\t\tforeach($articles as $article) {\n\t\t\t$stubvalue = $article->getStub();\n\t\t\techo '<li><a href=\"./cmseditarticle?locale='.$localekey.'&article='.$stubvalue.'\">'.$stubvalue.'</a></li>';\n\t\t}\n\t\n\t\techo '</ol>';\n\t}\n\t\n}", "public function listArticle() {\n\t\t$articles = new Model_Article();\n\t\t$listArticles = $articles->listArticles();\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"IMIE/Equipedia/views/admins/article.php\");\n\t}", "function xwl_display_article($article, $index, $content)\n{\necho <<< END\n <article index=\"$index\" content=\"$content\">\n <!-- metadata -->\n <id>{$article['id']}</id>\n <topic>\n <name>{$article['topic_name']}</name>\n <icon>{$article['topic_icon']}</icon>\n <url>topic.php?id={$article['topic']}</url>\n </topic>\n <language>{$article['language']}</language>\n <url>article.php?id={$article['id']}</url>\n\n <!-- \"header\" info -->\n <title>{$article['title']}</title>\n <author>\n <name>{$article['user_name']}</name>\n <mail>{$article['user_mail']}</mail>\n </author>\n <date>{$article['date']}</date>\n\n <!-- actual content -->\n <leader>\n{$article['leader']}\n </leader>\n <content>\n{$article['content']}\n </content>\n\n <!-- comments (not yet implemented) -->\n </article>\n\nEND;\n}", "public function getKbArticleIds()\n {\n return $this->kb_article_ids;\n }", "public function listArticles() {\n\n\t\t\t$articles = new Model_Article();\n\t\t\t$listArticles = $articles->listArticles();\n\t\t\trequire_once($_SERVER['DOCUMENT_ROOT'].'exo-circulaire/views/articles/list.php');\n\t\t}", "function get10Articles(string $keyword);", "public function articles() {\n $manager = new ArticleManager();\n $articles = $manager->getAll();\n\n $this->render('articles', 'Mes articles', [\n 'articles' => $articles,\n ]);\n }", "function getarticles()\n {\n\n \t$result = array();\n\n $this->model->action('article','getArticles',\n array('result' => & $result,\n 'limit' => array('perPage' => $this->limit,\n 'numPage' => 1),\n 'order' => array('pubdate', 'desc'),\n 'fields' => array('title','id_article')));\n\n echo \"### Print articles ###\\n\\n\";\n\n foreach($result as $article)\n {\n \techo \"id_article:\\t\" . $article['id_article'] . \"\\n\";\n \techo \"title:\\t\\t\" . $article['title'] . \"\\n\\n\";\n }\n }", "public function articles()\n\t{\n\t\n\t\t/*PAGE INCLUDES*/\n\t\n\t\n\t\t/*DISPLAY PAGE*/\n\t\treturn view('pages.articles');\n\t\n\t}", "public function testGetArticle() {\n\n $article = $this->client->getObject(static::DCX_ARTICLE_ID);\n\n $this->assertTrue($article instanceof Article);\n $this->assertSame(static::DCX_ARTICLE_ID, $article->data()['id']);\n $this->assertSame('„Meine Ehrlichkeit hat mir oft geschadet“', $article->data()['title']);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Test case for objectAssignmentsDelete Delete selected objectAssignment.
public function testObjectAssignmentsDelete() { }
[ "public function deleting(assignment $assignment)\n {\n //code...\n }", "public function testProjectAssignmentsUndelete()\n {\n }", "public function testAcquisitionAssignmentsUndelete()\n {\n }", "public function actionAuthAssignmentDelete()\n {\n if (Yii::$app->request->post()) {\n try {\n $names = Yii::$app->request->post();\n\n $array = [];\n foreach ($names as $key => $name) {\n foreach ($name as $item) {\n $array[] = $item;\n }\n }\n AuthAssignment::deleteAll(['in', 'item_name', $array]);\n } catch (ErrorException $e) {\n Yii::error($e->getMessage(), 'route');\n }\n } else {\n Yii::error('Not post!', 'route');\n }\n }", "public function delete($object);", "public function testDeleteObjectItem()\n {\n }", "public function test_delete() {\n $this->get_tournament_inactive();\n $this->assertTrue($this->object->delete());\n $this->assertNull($this->object->id);\n $this->assertNull($this->object->title);\n }", "function testDeleteObjectReference()\r\n {\r\n $params['app'] = \"crm\";\r\n $params['obj_type'] = \"calendar_event_proposal\"; \r\n \r\n $appController = new ApplicationController($this->ant, $this->user);\r\n $appController->debug = true;\r\n \r\n $ret = $appController->deleteObjectReference($params);\r\n $this->assertTrue($ret > 0);\r\n \r\n // test delete object reference\r\n $ret = $appController->deleteObjectReference($params);\r\n $this->assertTrue($ret > 0);\r\n }", "public function testDelete() {\n\t\t$deleted_object = ilObjTrainingProgramme::getInstanceByRefId($this->root_object_ref_id);\n\n\t\t$this->assertTrue($deleted_object->delete());\n\t}", "public function deleteAssignment($formData) {\n $assignmentId = $formData->assignmentId;\n $updateDataQuery = 'DELETE FROM dlvry_assignment WHERE a_id = \"' . $assignmentId . '\" ';\n $this->db->trans_start(); // to lock the db tables\n $updateData = $this->db->query($updateDataQuery);\n $this->db->trans_complete();\n return true;\n }", "public function testDeleteAllocationUsingDelete()\n {\n }", "public function testDeleteObjectTemplate()\n {\n }", "protected function confirmMCObjectiveDeletion()\n\t{\n\t\t$this->confirmObjectiveDeletion(\"MC\");\n\t}", "public function deleteFor($obj_id);", "public function forceDeleted(AssignmentSubmitted $assignmentSubmitted)\n {\n //\n }", "public function deleteOne($object);", "public function testDelete()\n {\n $this->clientAuthenticated->request('DELETE', '/person/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Person', 'personId', self::$objectId);\n }", "public function testDelete()\n {\n //Tests by id\n $this->clientAuthenticated->request('DELETE', '/pickup/delete/' . self::$objectId);\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Tests by registrationId\n $this->clientAuthenticated->request('DELETE', '/pickup/delete-registration/1');\n $response = $this->clientAuthenticated->getResponse();\n $this->assertJsonResponse($response, 200);\n\n //Deletes physically the entity created by test\n $this->deleteEntity('Pickup', 'pickupId', self::$objectId);\n $this->deleteEntity('Pickup', 'pickupId', self::$objectId + 1);\n $this->deleteEntity('Pickup', 'pickupId', self::$objectId + 2);\n $this->deleteEntity('Pickup', 'pickupId', self::$objectId + 3);\n $this->deleteEntity('Pickup', 'pickupId', self::$objectId + 4);\n }", "public function testDeleteAssocation()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update an existing announcement type.
function updateAnnouncementType(&$announcementType) { return $this->update( sprintf('UPDATE announcement_types SET journal_id = ?, type_name = ? WHERE type_id = ?'), array( $announcementType->getJournalId(), $announcementType->getTypeName(), $announcementType->getTypeId() ) ); }
[ "public function update(AgentTypeInterface $agentType);", "public function updated(Type $type)\n {\n //\n }", "public function updateType($old_type, $new_type);", "function update_type($new_type) { \n\n\t\tif ($this->_update_item('type',$new_type,'100')) { \n\t\t\t$this->type = $new_type;\n\t\t}\n\n\t}", "public function testUpdateFulfillmentType()\n {\n }", "public function testUpdateNotificationType()\n {\n }", "public function testUpdateContentType()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->put($this->url('content-types/1'), [\n 'name' => 'logo 2',\n 'display_name' => 'Logo II'\n ]);\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'school_id',\n 'name',\n 'type'\n ]);\n\n $response->assertJson([\n 'name' => 'logo 2',\n 'display_name' => 'Logo II'\n ]);\n }", "public function update (ExpenseTypeVO $expenseTypeVO);", "function _setAnnouncementTypeAssocId(&$announcementType) {\n\t\t$journal =& Request::getJournal();\n\t\t$announcementType->setAssocType(ASSOC_TYPE_JOURNAL);\n\t\t$announcementType->setAssocId($journal->getId());\n\t}", "public function update() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $type = $ad->type;\n\n $ad->update([\n 'city' => $this->params['city'],\n 'description' => $this->params['description'],\n 'price' => $this->params['price'],\n 'type' => $type,\n 'author_id' => $this->current_user->id,\n 'console_id' => $this->params['console_id'],\n \"{$type}_id\" => $this->params[$type . '_id'],\n 'published' => $this->params['published']\n ]);\n\n $this->notify_subscribed_users($ad);\n\n redirect(\n '/ads/edit',\n ['notice' => 'Ad updated successfully'],\n ['id' => $ad->id]\n );\n }", "public function update()\n {\n $this->model->load('type');\n $type = $this->model->type->findById($_POST['id']);\n $type->name = $_POST['name']; ;\n $type->update();\n\n go_back();\n }", "public function update(Request $request, Type $type)\n {\n return view('back.updateType')\n ->with('type', $type);\n }", "private function update_type_name() {\n\t\t$old_type_name = $this->type_name;\n\t\t$new_type_name = $this->type_name_from_name();\n\t\tif ( ! is_null( $old_type_name ) && $old_type_name !== $new_type_name ) {\n\t\t\t$posts = $this->get_all_posts();\n\t\t\tforeach ( $posts as $post ) {\n\t\t\t\twp_update_post(\n\t\t\t\t\t[\n\t\t\t\t\t\t'ID' => $post->ID,\n\t\t\t\t\t\t'post_type' => $new_type_name,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t$this->type_name = $new_type_name;\n\t}", "public function testUpdate()\n {\n // Create a announcement\n $announcement = factory(Announcement::class)->make();\n $this->announcementRepository->create($announcement);\n\n // User without permissions\n $route = route('api.announcement.update', $announcement->getId());\n $this->assertRejectsUnauthorizedAccessToRoute($route, 'put', 'api');\n\n // User with permissions\n $user = $this->createUser(['permissions' => ['use-master-module', 'announcement-update']]);\n $this->actingAs($user, 'api');\n\n // Test existing announcement with incomplete data\n $response = $this->put($route);\n $response->assertStatus(422);\n $response->assertJsonValidationErrors(['name']);\n\n // Test existing announcement with complete data\n $data = factory(Announcement::class)->raw();\n $response = $this->put($route, $data);\n $response->assertOk();\n $response->assertJson(['updated' => true]);\n\n // Test non existing announcement\n $route = route('api.announcement.update', ['random']);\n $response = $this->put($route);\n $response->assertNotFound();\n }", "public function updateNode($type) {\n $this->current->updateType($type);\n }", "public function updating(ActivityType $activityType)\n {\n $activityType->updated_by_user_id = Auth::id();\n }", "private function updateCase($caseId, $type, $messageId)\n {\n $case = $this->case->find($caseId);\n\n if ($type == 'twitter') {\n $case->latest_tweet_id = $messageId;\n } else {\n $case->latest_fb_id = $messageId;\n }\n\n $case->save();\n }", "public function testUpdateSpecimenType(){\n //TODO: Incorporate a JS supporting client like casperjs or selenium\n }", "public function testUpdate()\n {\n // Create a announcement\n $announcement = factory(\\App\\Models\\Announcement::class)->make();\n $this->announcementRepository->create($announcement);\n\n // User without permissions\n $route = route('master.announcement.update', [$id = $announcement->getId()]);\n $this->assertRejectsUnauthorizedAccessToRoute($route, 'put');\n\n // User with permissions. Incomplete data\n $user = $this->createUser(['permissions' => ['use-master-module', 'announcement-update']]);\n $referer = route('master.announcement.edit', [$id]);\n $response = $this->actingAs($user)->from($referer)->put($route);\n $response->assertRedirect($referer);\n $response->assertSessionHasErrors();\n\n // User with permissions. Complete data\n $data = factory(\\App\\Models\\Announcement::class)->raw();\n $response = $this->put($route, $data);\n $response->assertRedirect(route('master.announcement.show', [$id]));\n $response->assertSessionHasNoErrors();\n $response->assertSessionHas('success');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
panggil fungsi return_json dari BaseController dengan model 'pegawai_model'
public function pegawai_json() { $data = $this->return_json_users('pegawai_model', 'ms_pegawai'); header('Content-Type: application/json'); echo json_encode($data); }
[ "function get_mapel4_json() {\n header('Content-Type: application/json');\n echo $this->pengajar_model->get_all_mapel4();\n }", "function get_mapel3_json() {\n header('Content-Type: application/json');\n echo $this->pengajar_model->get_all_mapel3();\n }", "function get_mapel7_json() {\n header('Content-Type: application/json');\n echo $this->pengajar_model->get_all_mapel7();\n }", "function get_mapel6_json() {\n header('Content-Type: application/json');\n echo $this->pengajar_model->get_all_mapel6();\n }", "function get_mapel2_json() {\n header('Content-Type: application/json');\n echo $this->pengajar_model->get_all_mapel2();\n }", "public function Api(){\n \t$data = $this -> Mahasiswa_model -> getAll();//berfungsi untuk memanggil data dari database melalui file mahasiswa_model\n \techo json_encode($data -> result_array());//befungsi untuk menampilkan data keseluruhan dari database dalam bentuk JSON.\n }", "public function fetch_dudi(){\n $id_jur=$this->input->get('jurusan');\n $data=$this->Models->fetch_dudi($id_jur);\n echo json_encode($data);\n }", "public function obtProfesoresInfo(){\n $idTipo = $_POST['tipo'];\n // $idTipo = $this->input->post('tipo');\n $dato = $this->model_profesor->obtProfesoresCoordinadores($idTipo);\n\n echo json_encode($dato);\n }", "public function return_json(){\n\t\t$this->output\n\t ->set_content_type('application/json')\n\t ->set_output(json_encode($this->response));\n\t}", "public function haalDeelnemersOpJson(){\n $optieId = $this->input->get('optieId');\n \n $this->load->model('InschrijvingsOptie_model');\n $inschrijfOpties = $this->InschrijvingsOptie_model->getIngeschrevenBijOptie($optieId);\n \n echo json_encode($inschrijfOpties);\n }", "function contratosjson()\n\t\t{\n\t\t\t$idpersona = $this->User->field('idpersona',array('username'=>$this->Session->read('User.username')));\n\t\t\t$contratos = $this->Contratosupervisor->find('all',array(\n\t\t\t\t'fields' => array('Contratosupervisor.idproyecto','Contratosupervisor.idcontrato', 'Contratosupervisor.codigocontrato'),\n\t\t\t\t'conditions'=>array('Contratosupervisor.idpersona='.$idpersona),\n\t\t\t\t'order' => array('Contratosupervisor.codigocontrato')\n\t\t\t));\n\t\t\t\n\t\t\t$this->set('contratos', Hash::extract($contratos, \"{n}.Contratosupervisor\"));\n\t\t\t$this->set('_serialize', 'contratos');\n\t\t\t$this->render('/json/jsondatad');\n\t\t}", "public function jsonHistoryPengajuan()\n {\n header('Content-Type: application/json');\n\n $join = array(\n ['tbl_status','tbl_pengajuan.id_status=tbl_status.id_status','LEFT'],\n ['tbl_perizinan','tbl_pengajuan.id_perizinan=tbl_perizinan.id_perizinan','LEFT']\n );\n\n echo $this->Dashboard->jsonGlobalJoinAssWhere(\n '\n tbl_pengajuan.id_pengajuan AS id_pengajuan,\n tbl_pengajuan.tgl_pengajuan AS tgl_pengajuan,\n tbl_pengajuan.tgl_disetujui AS tgl_disetujui,\n tbl_pengajuan.id_perusahaan AS id_perusahaan,\n tbl_pengajuan.id_status AS id_status,\n tbl_pengajuan.catatan AS catatan,\n tbl_status.keterangan AS keterangan,\n tbl_perizinan.nama_perizinan AS nama_perizinan\n ',\n 'tbl_pengajuan',\n ['tbl_pengajuan.id_perusahaan' => $this->session->userdata('id_perusahaan')],\n $join\n );\n }", "public function get_ajax_data(){\n\n // Envio en formato json las franquicias obtenidas en el modelo\n $this->output->set_content_type('application/json')->set_output(json_encode($this->franquicias->get_ajax_data()));\n }", "public function actionAutocompleteInfoPegawai() {\n if (Yii::app()->request->isAjaxRequest) {\n $format = new MyFormatter();\n $returnVal = array();\n $nomorindukpegawai = isset($_GET['nomorindukpegawai']) ? $_GET['nomorindukpegawai'] : null;\n $nama_pegawai = isset($_GET['nama_pegawai']) ? $_GET['nama_pegawai'] : null;\n $criteria = new CDbCriteria();\n $criteria->group = 'pegawai_id,nomorindukpegawai,nama_pegawai,gelardepan,gelarbelakang_nama,alamat_pegawai,jeniskelamin';\n $criteria->select = $criteria->group;\n $criteria->compare('LOWER(nomorindukpegawai)', strtolower($nomorindukpegawai), true);\n $criteria->compare('LOWER(nama_pegawai)', strtolower($nama_pegawai), true);\n $criteria->order = 'nomorindukpegawai, nama_pegawai';\n $criteria->limit = 5;\n $models = FAPegawaiV::model()->findAll($criteria);\n foreach ($models as $i => $model) {\n $attributes = $model->attributeNames();\n foreach ($attributes as $j => $attribute) {\n $returnVal[$i][\"$attribute\"] = $model->$attribute;\n }\n $returnVal[$i]['label'] = $model->nomorindukpegawai . ' - ' . $model->NamaLengkap;\n $returnVal[$i]['value'] = $model->nomorindukpegawai;\n }\n\n echo CJSON::encode($returnVal);\n }\n Yii::app()->end();\n }", "public function getKeputusan()\n {\n\n $anggota = $this->db->select('keputusan.id_keputusan, keputusan.jenis_kptsn')\n ->where('keputusan.id_keputusan not in (select anggota_puk.id_keputusan from anggota_puk)')\n ->get('keputusan');\n\n echo json_encode($anggota->result_array());\n // return $anggota->result_array();\n }", "function get_kelas1g_json() {\n header('Content-Type: application/json');\n echo $this->bagikelas_model->get_all_kelas1g();\n }", "public function hapusPelanggan() {\r\n $id = $this->input->post('id');\r\n $hasil = $this->model_service->hapusPelanggan($id);\r\n if ($hasil) {\r\n $hasil = $this->sukses(\"Berhasil menghapus pelanggan\");\r\n } else {\r\n $hasil = $this->error(\"Gagal menghapus pelanggan\");\r\n }\r\n echo json_encode($hasil);\r\n }", "public function carregarListaEquipamentoFilialEstatisticaJson(){\n // CARREGA O MODELO PARA ESTE VIEW/OPERAÇÃO\n $equipeModelo = $this->load_model('equipamento/equipamento-model');\n\n $dadosEquips = $equipeModelo->listarEquipamentosFilialCliente($_POST['idCliente'], $_POST['idFilial']);\n\n if(!empty($dadosEquips['status'])){\n\n //MONTA A TABELA DE EQUIPAMENTOS\n $listaEquip = $dadosEquips['equipamentos'];\n\n $tabela = \"\";\n $tabela .=\"<thead><tr>\n <th>Equipamento</th>\n <th>Modelo</th>\n <th>Unidade</th>\n <th class='txt-center'>Estatisticas</th>\n </tr></thead>\";\n if($listaEquip){\n\n $tabela .=\"<tbody>\";\n foreach ($listaEquip as $equip) {\n\n $tabela .=\"<tr>\";\n\n $tabela .=\"<td>\";\n $tabela .=html_entity_decode($equip['tipoEquip']);\n $tabela .=\"</td>\";\n $tabela .=\"<td>\";\n $tabela .=html_entity_decode($equip['nomeModeloEquipamento']);\n $tabela .=\"</td>\";\n $tabela .=\"<td>\";\n $tabela .= (isset($equip['filial'])) ? html_entity_decode($equip['filial']) : \"Matriz\";\n $tabela .=\"</td>\";\n $tabela .=\"<td>\";\n $link = HOME_URI.\"/grafico/graficoFisicoParametrosEquipamentoCliente/\".$equip['id'].\"\";\n $tabela .= \"<a href='\".$link.\"'><i class='fa fa-list-alt fa-2x'></i></a>\";\n $tabela .=\"</td>\";\n\n $tabela .=\"</tr>\";\n }\n $tabela .=\"</tbody>\";\n\n\n }else{\n $tabela .=\"<tbody>\";\n $tabela .=\"<tr>\";\n $tabela .=\"<td colspan='4'>Nenhum equipamento cadastrado até o momento</td>\";\n $tabela .=\"</tr>\";\n $tabela .=\"</tbody>\";\n }\n exit(json_encode(array('status' => true, 'equipamentos' => $tabela)));\n }else{\n\n //GERA TABELA VAZIA\n $tabela =\"<thead><tr>\n <th>Equipamento</th>\n <th>Modelo</th>\n <th>Unidade</th>\n <th class='txt-center'>Estatisticas</th>\n </tr></thead>\";\n $tabela .=\"<tbody>\";\n $tabela .=\"<tr>\";\n $tabela .=\"<td colspan='4'>Nenhum equipamento cadastrado até o momento</td>\";\n $tabela .=\"</tr>\";\n $tabela .=\"</tbody>\";\n\n exit(json_encode(array('status' => false, 'equipamentos' => $tabela)));\n }\n\n }", "public function json()\n\t{\n\t\treturn Response::json(Manufacturer::all());\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create request for operation 'groupsKick'
protected function groupsKickRequest($token = null, $user = null, $channel = null) { $resourcePath = '/groups.kick'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; // header params if ($token !== null) { $headerParams['token'] = ObjectSerializer::toHeaderValue($token); } // form params if ($user !== null) { $formParams['user'] = ObjectSerializer::toFormValue($user); } // form params if ($channel !== null) { $formParams['channel'] = ObjectSerializer::toFormValue($channel); } // body params $_tempBody = null; if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], ['application/x-www-form-urlencoded', 'application/json'] ); } // for model (json/xml) if (isset($_tempBody)) { // $_tempBody is the method argument, if present if ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody)); } else { $httpBody = $_tempBody; } } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { $multipartContents[] = [ 'name' => $formParamName, 'contents' => $formParamValue ]; } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); } elseif ($headers['Content-Type'] === 'application/json') { $httpBody = \GuzzleHttp\json_encode($formParams); } else { // for HTTP post (form) $httpBody = \GuzzleHttp\Psr7\build_query($formParams); } } // this endpoint requires OAuth (access token) if ($this->config->getAccessToken() !== null) { $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); } $defaultHeaders = []; if ($this->config->getUserAgent()) { $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); } $headers = array_merge( $defaultHeaders, $headerParams, $headers ); $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody ); }
[ "public function requestgroupmembershipAction() {\n if ($this->getRequest()->isPost()) {\n $userId = $_SESSION['Incite']['USER_DATA']['id'];\n $groupId = $_POST['groupId'];\n $privilege = -1;\n\n $groupsUsers = new InciteGroupsUsers;\n $groupsUsers->group_id = $groupId;\n $groupsUsers->user_id = $userId;\n $groupsUsers->group_privilege = $privilege;\n $groupsUsers->seen_instruction = 0;\n $groupsUsers->save();\n\n echo json_encode('true');\n }\n }", "public function postKick()\n {\n $this->hasPermission('admin.scoreboard.kick');\n\n foreach ($this->players as $player) {\n try {\n $this->data[] = $this->repository->adminKick($player, Input::get('message', null));\n } catch (PlayerNotFoundException $e) {\n $this->errors[] = [\n 'player' => $player,\n 'message' => $e->getMessage(),\n ];\n }\n }\n\n return $this->_response();\n }", "protected function groupsRequest()\n {\n\n $resourcePath = '/groups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'application/xml']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'application/xml'],\n ['application/json', 'multipart/form-data']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function testGroupV2KickMember()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function createGroup();", "public function create() {\n if($_SERVER['REQUEST_METHOD'] == \"POST\") {\n $name = trim($_POST['name']); //group name\n $exist = Database::select(\"SELECT COUNT(*) AS count FROM groups WHERE g_name = \\\"$name\\\"\")[0]['count'];\n if(($name != '') and (0 == $exist) and (count($_POST) > 1)) {\n Database::insert(\"groups\", [\"g_id\" => null, \"g_name\" => $name]); //new group creation\n $ks = array_keys($_POST);\n $keys = [];\n foreach ($ks as $k) {\n if ($k != \"name\") {\n $keys = array_merge($keys, [$k]);\n }\n }\n foreach ($keys as $key) { //keys with user's ids. Here I add user ids to DB\n $g_id = Database::select(\"SELECT g_id FROM groups WHERE g_name = \\\"$name\\\"\")[0]['g_id'];\n Database::insert(\"m2m_user_groups\", [\"ug_id\" => null, \"u_id\" => $key, \"g_id\" => $g_id]);\n }\n }\n else {\n $_SESSION['message'] = \"Группа с таким названием существует\";\n }\n }\n header(\"Location: /group\");\n }", "protected function sspsGroupsGetRequest()\n {\n\n $resourcePath = '/ssps/groups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api_key');\n if ($apiKey !== null) {\n $queryParams['api_key'] = $apiKey;\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function creategroupAction() {\n if ($this->getRequest()->isPost()) {\n $groupName = $_POST['groupName'];\n $groupType = $_POST['groupType'];\n $user = $_SESSION['Incite']['USER_DATA'];\n\n $group = new InciteGroup;\n $group->name = $groupName;\n $group->creator_id = $user->id;\n $group->group_type = $groupType;\n $group->instructions = \"\";\n $group->save();\n\n $groups_users = new InciteGroupsUsers;\n $groups_users->user_id = $user->id;\n $groups_users->group_id = $group->id;\n $groups_users->group_privilege = 0;\n $groups_users->seen_instruction = 1;\n $groups_users->save();\n\n $groupId = $group->id;\n\n if ($groupId > 0) {\n echo $groupId;\n } else {\n system_log('failed to create group');\n echo 'false';\n }\n }\n }", "public function post()\n {\n return \"/V1/customerGroups\";\n }", "public function make_wop_group(Request $request)\n {\n $cart_ids = $request->input('cart_ids');\n\n $cart_ids = explode(',', $cart_ids);\n\n $group_id = $this->get_new_group_id();\n foreach ($cart_ids as $cid) {\n $cart = WechatCart::find($cid);\n $wop = $cart->order_item;\n if ($wop) {\n $wop->group_id = $group_id;\n $wop->save();\n }\n }\n\n //store this group id for cart to session\n session(['group_id' => $group_id]);\n\n return response()->json(['status' => 'success']);\n\n }", "public function testCreateGroupRest()\n {\n $this->_markTestAsRestOnly();\n\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => self::RESOURCE_PATH,\n 'httpMethod' => \\Magento\\Framework\\Webapi\\Rest\\Request::HTTP_METHOD_POST,\n ],\n ];\n\n $groupData = [\n CustomerGroup::ID => null,\n CustomerGroup::CODE => 'Create Group REST',\n CustomerGroup::TAX_CLASS_ID => 3,\n ];\n $requestData = ['group' => $groupData];\n\n $groupId = $this->_webApiCall($serviceInfo, $requestData)[CustomerGroup::ID];\n $this->assertNotNull($groupId);\n\n $newGroup = $this->groupRepository->getById($groupId);\n $this->assertEquals($groupId, $newGroup->getId(), 'The group id does not match.');\n $this->assertEquals($groupData[CustomerGroup::CODE], $newGroup->getCode(), 'The group code does not match.');\n $this->assertEquals(\n $groupData[CustomerGroup::TAX_CLASS_ID],\n $newGroup->getTaxClassId(),\n 'The group tax class id does not match.'\n );\n }", "function setGroups()\n {\n include_once (\"FDL/Lib.Usercard.php\");\n \n global $_POST;\n $err = '';\n $gidnew = isset($_POST[\"gidnew\"]) ? $_POST[\"gidnew\"] : '';\n $tgid = array(); // group ids will be modified\n if ($gidnew == \"Y\") {\n /**\n * @var int[] $gids\n */\n $gids = $_POST[\"gid\"];\n if ($gids == \"\") $gids = array();\n \n $gAccount = $this->getAccount();\n $rgid = $gAccount->GetGroupsId();\n if ((count($rgid) != count($gids)) || (count(array_diff($rgid, $gids)) != 0)) {\n $gdel = array_diff($rgid, $gids);\n $gadd = array_diff($gids, $rgid);\n // add group\n $g = new Group(\"\", $gAccount->id);\n foreach ($gadd as $gid) {\n $g->iduser = $gAccount->id;\n $g->idgroup = $gid;\n // insert in folder group\n $gdoc = $this->getDocUser($gid);\n // $gdoc->insertMember($this->id);\n $err.= $gdoc->insertDocument($this->id); // add in group is set here by postInsert\n $tgid[$gid] = $gid;\n }\n foreach ($gdel as $gid) {\n $g->iduser = $gid;\n //$aerr.=$g->SuppressUser($user->id,true);\n // delete in folder group\n $gdoc = $this->getDocUser($gid);\n if (!method_exists($gdoc, \"deleteMember\")) AddWarningMsg(\"no group $gid/\" . $gdoc->id);\n else {\n // $gdoc->deleteMember($this->id);\n $err = $gdoc->removeDocument($this->id);\n $tgid[$gid] = $gid;\n }\n }\n // $g->FreedomCopyGroup();\n //if ($user->isgroup=='Y') $tgid[$user->id]=$user->id;\n \n }\n }\n // it is now set in bacground\n // refreshGroups($tgid,true);\n return $err;\n }", "function CreateGroup ($name, $description, $grouptype, $parentgroupid, $autocreateapps = 'False') {\n $path = REST_PATH . 'groups.xml';\n \n $name = filter_var($name, FILTER_SANITIZE_STRING);\n $description = filter_var($description, FILTER_SANITIZE_STRING); \n\n // Setup the POST NAME/VALUE pairs\n $postdata = http_build_query(\n array(\n 'Name' => $name,\n 'GroupType' => $grouptype,\n\t'Description' => $description,\n\t'ParentGroupId' => $parentgroupid,\n\t'AutoCreateApplications' => $autocreateapps\n )\n );\n\n // Call Rest API\n $result = CallRestApi($path, $postdata, 'POST');\n \n // Read the returned XML\n $xml = simplexml_load_string($result) or die(\"Error: Cannot create object\");\n\n // Get the Group ID\n $newGroupId = $xml->Group->Id;\n\n if ($newGroupId == '')\n $newGroupId = -1;\n\n return $newGroupId;\n}", "function AJaddRemGroupResource() {\n\t\t$newids = getContinuationVar('newids');\n\t\tif(is_null($newids)) {\n\t\t\t$rscid = processInputVar('id', ARG_NUMERIC);\n\t\t\t$resources = getUserResources(array($this->restype . \"Admin\"), array(\"manageGroup\"));\n\t\t\tif(! array_key_exists($rscid, $resources[$this->restype])) {\n\t\t\t\t$arr = array('status' => 'noaccess');\n\t\t\t\tsendJSON($arr);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$groups = getUserResources(array($this->restype . \"Admin\"), array(\"manageGroup\"), 1);\n\t\t$tmp = processInputVar('listids', ARG_STRING);\n\t\t$tmp = explode(',', $tmp);\n\t\t$groupids = array();\n\t\tforeach($tmp as $id) {\n\t\t\tif(! is_numeric($id))\n\t\t\t\tcontinue;\n\t\t\tif(! array_key_exists($id, $groups[$this->restype])) {\n\t\t\t\t$arr = array('status' => 'noaccess');\n\t\t\t\tsendJSON($arr);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$groupids[] = $id;\n\t\t}\n\n\t\t$args = $this->defaultGetDataArgs;\n\t\tif(is_null($newids))\n\t\t\t$args['rscid'] = $rscid;\n\t\t$resdata = $this->getData($args);\n\n\t\t$mode = getContinuationVar('mode');\n\n\t\tif($mode == 'add') {\n\t\t\t$adds = array();\n\t\t\tif(is_null($newids)) {\n\t\t\t\tforeach($groupids as $id)\n\t\t\t\t\t$adds[] = \"({$resdata[$rscid]['resourceid']}, $id)\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tforeach($newids as $newrscid) {\n\t\t\t\t\tforeach($groupids as $id)\n\t\t\t\t\t\t$adds[] = \"({$resdata[$newrscid]['resourceid']}, $id)\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$query = \"INSERT IGNORE INTO resourcegroupmembers \"\n\t\t\t\t\t . \"(resourceid, resourcegroupid) VALUES \";\n\t\t\t$query .= implode(',', $adds);\n\t\t\tdoQuery($query);\n\t\t}\n\t\telse {\n\t\t\t$rems = implode(',', $groupids);\n\t\t\tif(is_null($newids))\n\t\t\t\t$query = \"DELETE FROM resourcegroupmembers \"\n\t\t\t\t\t\t . \"WHERE resourceid = {$resdata[$rscid]['resourceid']} AND \"\n\t\t\t\t\t\t . \"resourcegroupid IN ($rems)\";\n\t\t\telse {\n\t\t\t\t$allrscids = array();\n\t\t\t\tforeach($newids as $newrscid)\n\t\t\t\t\t$allrscids[] = $resdata[$newrscid]['resourceid'];\n\t\t\t\t$allrscids = implode(',', $allrscids);\n\t\t\t\t$query = \"DELETE FROM resourcegroupmembers \"\n\t\t\t\t\t\t . \"WHERE resourceid IN ($allrscids) AND \"\n\t\t\t\t\t\t . \"resourcegroupid IN ($rems)\";\n\t\t\t}\n\t\t\tdoQuery($query);\n\t\t}\n\n\t\t$_SESSION['userresources'] = array();\n\t\t$regids = \"^\" . implode('$|^', $groupids) . \"$\";\n\t\t$arr = array('status' => 'success',\n\t\t 'regids' => $regids,\n\t\t 'inselobj' => 'ingroups',\n\t\t 'outselobj' => 'outgroups');\n\t\tsendJSON($arr);\n\t}", "function CreateGroup(){\n $grpname = \"\"; $grpdesc=\"\";\n extract($_POST);\n $grpid = $this->generateGuid();\n $vs = [$grpname, $grpid, $grpdesc];\n $f = array(\"grpname\", \"grpid\", \"grpdesc\");\n $cg = $this->Insert($this->grptable, $f, $vs);\n return $cg;\n }", "public function sendGroup()\n\t{\n\t}", "public function createGroupWithUuid(string $uuid, $createRequest): MeshRequest;", "public function addUserGroupServiceGroupsRequest($options)\n {\n // unbox the parameters from the associative array\n $user_group_id = array_key_exists('user_group_id', $options) ? $options['user_group_id'] : null;\n $request_body = array_key_exists('request_body', $options) ? $options['request_body'] : null;\n\n // verify the required parameter 'user_group_id' is set\n if ($user_group_id === null || (is_array($user_group_id) && count($user_group_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $user_group_id when calling addUserGroupServiceGroups'\n );\n }\n\n $resourcePath = '/user-groups/{user_group_id}/service-groups';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($user_group_id !== null) {\n $resourcePath = str_replace(\n '{' . 'user_group_id' . '}',\n ObjectSerializer::toPathValue($user_group_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($request_body)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($request_body));\n } else {\n $httpBody = $request_body;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API token authentication\n $apiToken = $this->config->getApiTokenWithPrefix('Fastly-Key');\n if ($apiToken !== null) {\n $headers['Fastly-Key'] = $apiToken;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHosts = [\"https://api.fastly.com\"];\n if ($this->hostIndex < 0 || $this->hostIndex >= sizeof($operationHosts)) {\n throw new \\InvalidArgumentException(\"Invalid index {$this->hostIndex} when selecting the host. Must be less than \".sizeof($operationHosts));\n }\n $operationHost = $operationHosts[$this->hostIndex];\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'POST',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function postGetGroupingsAction()\n {\n return $this->getGetGroupingsAction();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
A QUERY for retrieving comments directly attached to this one.
public function comment_query () { $this->assert ($this->exists (), 'Comment does not exist yet.', 'comment_query', 'COMMENT'); $class_name = $this->app->final_class_name ('ENTRY_COMMENT_QUERY', 'webcore/db/entry_comment_query.php'); $Result = new $class_name ($this->entry ()); $Result->restrict ("com.parent_id = $this->id"); if (isset ($this->_sub_comments)) { $Result->cache ($this->_sub_comments); } return $Result; }
[ "public function queryComments ()\n\t{\n\t\t// Query a list of comments\n\t\t$comment_list = $this->data->query ();\n\n\t\t// Check if comments could be queried\n\t\tif (!empty ($comment_list)) {\n\t\t\t// If so, set comments as comment list\n\t\t\t$this->commentList = $comment_list;\n\n\t\t\t// And organize comments\n\t\t\t$this->organizeComments ();\n\t\t}\n\t}", "public function getCommentsList()\n\t{\n\t\treturn (new \\App\\Db\\Query())\n\t\t\t->select(['comments' => 'commentcontent'])\n\t\t\t->from('vtiger_modcomments')\n\t\t\t->where(['related_to' => $this->getId()])->column();\n\t}", "public function getAllComments()\n {\n $result = self::$dbInterface -> query(\"SELECT commentID, comment, card_cardID, user_userID \n FROM comment\");\n return $result;\n }", "public function getComments() {\n if(!isset($this->comments))\n {\n $mapper = new Application_Model_CommentsMapper();\n $this->comments = $mapper->findAllByFieldsAndValues(array(\"id\"=>$this->id));\n }\n return $this->comments;\n }", "function comments(){\r\n\t\tglobal $user;\r\n\t\t$comments = []; // start with an empty array\r\n\t\t$sql = \"SELECT * FROM comments WHERE post_id = '$this->id' \";\r\n\t\tif ( $result = $this->db->q($sql) ){\r\n\t\t\twhile ( $comment = $result->fetch_object(\"Comment\") ){\r\n\t\t\t\t$comments[] = $comment;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\techo $this->db->err() ; }\r\n\t\treturn $comments;\r\n\t}", "public function fetchComments();", "public function getComments() {\r\n\t\treturn CN_Comment::getFromPost( $this->id );\r\n\t}", "public function getComments()\n {\n return $this->buildall(\"FacebookComment\",$this->api->api(\"/{$this->id}/comments\")); \n }", "public function getComments()\n {\n return Comment::whereIdFor(Auth()->user()->id)->get();\n }", "public function getComments() {\n\t\treturn $this->api->getCommentsByPhotoId($this->getId());\n\t}", "public function getComments()\n {\n // Lets load the data if it doesn't already exist\n if(empty($this->_comments))\n {\n $query = $this->_buildQuery();\n $this->_comments = $this->_getList($query, $this->getStart(), $this->getState('list.limit'));\n\n foreach($this->_comments as $key => $comment)\n {\n if($comment->userid > 0)\n {\n $this->_comments[$key]->cmtname = JHTML::_('joomgallery.displayname', $comment->userid);\n }\n\n $this->_comments[$key]->cmttext = JoomHelper::processText($comment->cmttext);\n }\n }\n\n return $this->_comments;\n }", "public function getComments()\n {\n return Comment::getAllByThread($this->id);\n }", "private function fetchComments()\n\t{\n\t\t$sql_ary = array(\n\t\t\t'SELECT'\t=> 'pc.id,\n\t\t\t\t\t\t\tpc.comment,\n\t\t\t\t\t\t\tpc.commenter_id,\n\t\t\t\t\t\t\tpc.comment_options,\n\t\t\t\t\t\t\tpc.comment_bitfield,\n\t\t\t\t\t\t\tpc.comment_uid,\n\t\t\t\t\t\t\tpc.ctime',\n\t\t\t'FROM'\t\t=> array(\n\t\t\t\tBLOG_POST_COMMENTS_TABLE => 'pc',\n\t\t\t),\n\t\t\t'WHERE'\t\t=> 'pc.post_id = ' . $this->id,\n\t\t\t'ORDER_BY'\t=> 'pc.ctime DESC',\n\t\t);\n\n\t\t$sql\t\t= $this->db->sql_build_query('SELECT', $sql_ary);\n\t\t$result\t\t= $this->db->sql_query($sql);\n\t\t$comments\t= $this->db->sql_fetchrowset($result);\n\t\t$this->db->sql_freeresult($result);\n\n\t\tforeach ($comments as $c)\n\t\t{\n\t\t\t$comment = new phpbb_ext_blog_core_comment($this->db);\n\t\t\t$comment->setCommentID($c['id']);\n\t\t\t$comment->setCommentData($c);\n\t\t\t$this->comments[] = $comment;\n\t\t}\n\t}", "public function FetchComments()\n {\n $comments = array();\n $stmt = Bugdar::$db->Prepare(\"\n SELECT comments.*, users.alias as post_alias\n FROM \" . TABLE_PREFIX . \"comments comments\n LEFT JOIN \" . TABLE_PREFIX . \"users users\n ON (comments.post_user_id = users.user_id)\n WHERE comments.bug_id = ?\n ORDER BY comments.post_date\n \");\n $stmt->Execute(array($this->bug_id));\n while ($comment = $stmt->FetchObject())\n $comments[] = $comment;\n return $comments;\n }", "public function get_all_comments()\n {\n $comments = $this->get_comments();\n return $this->prepare_replies($comments);\n }", "public function getAllComments() {\r\n\t\t$query = 'SELECT comments.id, comments.author_id, comments.post_id, users.username, comments.comment, comments.date FROM comments\r\n\t\t\t\t\tLEFT JOIN users ON comments.author_id = users.id ORDER BY date ASC';\r\n\t\t\r\n\t\t$result = $this->dbaccess->run_query($query);\r\n\t\r\n\t\t$commentArray = Array();\r\n\t\twhile ($comment = $result->fetchObject('Comment'))\r\n\t\t{\r\n\t\t\t$commentArray[] = $comment;\r\n\t\t}\r\n\t\r\n\t\treturn $commentArray;\r\n\t}", "public function getComments()\n\t{\n\t\t$comments = array();\n\t\t$db = DB::conn();\n\t\t$rows = $db->rows(\n\t\t\t'SELECT * FROM comment WHERE thread_id = ? ORDER BY created ASC',\n\t\t\tarray($this->id)\n\t\t);\n\t\t\tforeach ($rows as $row) {\n\t\t\t\t$comments[] = new Comment($row);\n\t\t\t}\n\treturn $comments;\n\t}", "public function getComments();", "public function getAllComments()\n\t{\n\t\treturn $this->all_comments;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get a single basket item by id
public function item($id);
[ "private function getBasketItemById(int $id): BasketItem\n {\n $item = $this->basket->getItemById($id);\n if (!$item) {\n $this->getResponse()->setStatus(\n 404\n );\n throw new \\Exception(\n \\sprintf('Basket item with id %d not found.', $id)\n );\n }\n\n return $item;\n }", "public function getItem ($id);", "public function getItem($id);", "public function get_by_id( $id )\n\t{\n//\t\texit;\n\t\treturn $this->get_connection()->get($this->name_space . 'item' . $id);\n\t}", "public static function getItemById($id)\n {\n return self::find($id);\n }", "function getItem($item_id) {\n $db = Database::instance()->db();\n $stmt = $db->prepare('SELECT * FROM item WHERE item_id = ?');\n $stmt->execute(array($item_id));\n return $stmt->fetch();\n }", "public function showItem($id)\n {\n $item = Items::where('id', $id)->first();\n if ($item) {\n return $item;\n } else {\n return response()->json([\n 'message' => 'Item not found',\n ]);\n }\n }", "function get($id)\n {\n $this->db->where('id', $id);\n $query = $this->db->get('nieuwsitem');\n return $query->row();\n }", "public function itemsForBasket($id) {\n\n try {\n\n $baskets = $this->basket->setPresenter(ItemsForBasketPresenter::class);\n return $baskets->find(intval($id));\n\n } catch (ModelNotFoundException $e) {\n\n return response()->json(['responseJSON' => $e->getMessage(), 'code' => $e->getCode()], $e->getCode());\n } catch (\\Exception $e) {\n\n return response()->json(['responseJSON' => 'Error appeared. Please connect to admin.', 'code' => $e->getCode(), $e->getCode()], $e->getCode());\n }\n }", "public function test_get_basket_item()\n\t{\n\t\t$basket = new Model_Basket;\n\n\t\t$item = $this->get_item();\n\t\t$item->identifer = 1;\n\t\t$basket->add_item($item);\n\n\t\t$basket_item = $basket->get_basket_item($item->get_identifier());\n\n\t\t$this->assertSame((string)$item->get_identifier(), (string)$basket_item->item_identifier);\n\t}", "public function getItem($id)\n {\n if ($id == \"all\") {\n return response()->json([\"result\" => ItemDoc::all()], 200);\n }\n else {\n return response()->json(\n [\"result\" => ItemDoc::where('Itemcode' , $id)->get()], 200);\n }\n }", "public function getByHashedId($id)\n {\n $id = $this->model->decodeId($id);\n $basket = $this->model->with([\n 'user',\n 'order',\n 'discounts.rewards',\n 'lines.basket',\n 'lines.variant',\n 'lines.variant.tax',\n 'lines.variant.tiers',\n 'lines.variant.image.transforms',\n 'lines.variant.product',\n 'lines.variant.product.assets',\n 'lines.variant.product.assets.transforms',\n 'lines.variant.product.routes',\n 'lines.variant.customerPricing',\n ])->findOrFail($id);\n\n return $this->factory->init($basket)->get();\n }", "public function getItemFromShop(int $id) : Item{\n\t\tif(isset($this->shops[$id])){\n\t\t\t$data = $this->shops[$id];\n\t\t\treturn Item::get($data[0], $data[1], $data[2])->setNamedTag(unserialize($data[3]));\n\t\t}\n\t\treturn Item::get(Item::AIR, 0, 0);\n\t}", "function get_inventory_item($id) {\n\t\tglobal $db;\n\t\t$id = $db->real_escape_string($id);\n\n\t\t$r = $db->query(\"SELECT * FROM `inventory` WHERE `id` = '$id'\");\n\t\tif (!$r || $r->num_rows == 0) return assoc();\n\t\treturn $r->fetch_assoc();\n\t}", "public function getItem( $id ) {\n\t\tJSpaceLog::add('Geting item id=' . $id, JLog::DEBUG, JSpaceLog::CAT_REPOSITORY);\n\t\t$this->flushErrors();\n\t\t\n\t\tif( !isset( $this->_items[ $id ] ) ) { \n\t\t\ttry {\n\t\t\t\t$this->_items[ $id ] = $this->_getItem( $id );\n\t\t\t}\n\t\t\tcatch( Exception $e ) {\n\t\t\t\tthrow JSpaceRepositoryError::raiseError( $this, $e );\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->_items[ $id ];\n\t}", "public function find($id) {\n return $this->bookingItems->find($id);\n }", "public function get($stockItemId);", "public function getItemById($id) {\r\n $items = Item::find($id);\r\n return $items;\r\n }", "function get_item_by_id($itemID)\n {\n $sql = \"SELECT * FROM `items` WHERE `itemID` = ? LIMIT 1\";\n $query = $this->db->query($sql, array($itemID));\n\n if($query->num_rows == 1)\n return $query->row_array();\n else\n return null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store a newly created resource in storage. POST /accommodation
public function store() { // $input = \Input::json(); $accommodation = new Accommodation; $accommodation->name = $input->get('name'); $accommodation->description = $input->get('description'); $accommodation->location_id = $input->get('location_id'); $accommodation->save(); return response($accommodation, 201); }
[ "public function store(Request $request)\n {\n // first perform validation\n $request->validate(\n [\n 'product_name' => 'required',\n 'quantity' => 'required|numeric',\n 'price_per_item' => 'required',\n ]\n );\n\n // fetch existing json file if it exists\n $inventoryData = Storage::disk('local')->exists('inventory.json') ? json_decode(Storage::disk('local')->get('inventory.json')) : [];\n\n // store validated form data as JSON or XML\n $id = !empty($inventoryData) && is_array($inventoryData) ? end($inventoryData)->id + 1 : 1;\n $formData = [\n 'id' => $id,\n 'product_name' => $request->get('product_name'),\n 'quantity' => $request->get('quantity'),\n 'price_per_item' => $request->get('price_per_item'),\n 'created_at' => date('Y-m-d H:i:s')\n ];\n\n array_push($inventoryData, $formData);\n\n Storage::disk('local')->put('inventory.json', json_encode($inventoryData));\n\n return Redirect::to('create');\n }", "public function store()\n\t{\n\t\t$carrier = new $this->repo;\n\n\t\tif ($carrier->save()) {\n\t\t\treturn $this->rest->response(201, $carrier);\n\t\t}\n\n\t\treturn $this->response->errorBadRequest($carrier->errors());\n\t}", "public function store()\n {\n /* Check if logged user is authorized to create resources */\n $this->authorize('create', [$this->model]);\n\n $this->request->validate($this->storeValidations());\n\n DB::transaction(function () {\n\n /** Create a new resource */\n $resource = Model::create([\n 'user' => Input::get('user'),\n 'name' => Input::get('name'),\n 'email' => Input::get('email'),\n 'status' => Input::get('status'),\n 'password' => bcrypt(config('user.default_password', 'secret')),\n ]);\n\n /* Check if permissions are being set */\n if (Input::get('roles') != null) {\n /** Synchronize both tables through pivot table */\n $resource->roles()->sync(Input::get('roles'));\n }\n }, 5);\n\n /* Redirect to resource index page */\n return redirect()\n ->route($this->name . '.index')\n ->with('success', $this->name . '.resource-created');\n }", "public function store(CreateRecommendedDealRequest $request)\n {\n $input = $request->all();\n if($request->hasFile('image')){\n $request->image->store('images');\n $name = $request->image->hashName();\n $input['image'] = 'images/' . $name;\n }\n\n $recommendedDeal = $this->recommendedDealRepository->create($input);\n\n Flash::success('Recommended Deal saved successfully.');\n\n return redirect(route('recommendedDeals.index'));\n }", "public function store()\n {\n $params = request()->validate([\n 'access_document_delivery.person_id' => 'required|integer',\n 'access_document_delivery.year' => 'required|integer'\n ]);\n $p = $params['access_document_delivery'];\n $personId = $p['person_id'];\n $year = $p['year'];\n\n $this->authorize('create', [AccessDocumentDelivery::class, $personId]);\n\n $add = AccessDocumentDelivery::findOrNewForPersonYear($personId, $year);\n $this->fromRest($add);\n\n if ($add->save()) {\n return $this->success($add);\n }\n\n return $this->restError($add);\n }", "public function store(CreateAssistanceRequest $request)\n {\n $input = $request->all();\n\n $assistance = $this->assistanceRepository->create($input);\n\n Flash::success('Assistance saved successfully.');\n\n return redirect(route('assistances.index'));\n }", "public function store(StoreAccesosRequest $request)\n {\n if (! Gate::allows('acceso_create')) {\n return abort(401);\n }\n\n $in_accesos= DB::connection('odbc')->insert(\"INSERT INTO accesos (nombre_acceso, id_ubicacion, created_at) VALUES ('\".$request->nombre_acceso.\"', \".$request->id_ubicacion.\", getdate() )\");\n \n\n\n return redirect()->route('admin.accesos.index');\n }", "public function store()\n\t{\n\t\t$id = Input::get('id');\n\t\t\n\t\tAuth::user()->storages_id = $id;\n\t\tAuth::user()->save();\n\t}", "public function store(Request $request)\r\n {\r\n $this->validateStore($request);\r\n\r\n $occupation = Occupation::create($request->all());\r\n\r\n return $this->success(\"The occupation with with id {$occupation->id} has been created\", 201);\r\n }", "public function store()\n\t{\n\t\t$data = Input::all();\n\n\t\t$validator = Validator::make($data, Apuesta::$rules);\n\n\t\t$validacionHora = $this->validarHora($data);\n\t\t$validacionRepetido = $this->validarRepetido($data);\n\n\t\tif ($validator->fails() || !$validacionHora || $validacionRepetido)\n\t\t{\n\t\t\treturn Redirect::back();\n\t\t}\n\n\t\t$a = Apuesta::create($data);\n\t\t\n\t\t$id_fase = Crypt::encrypt(Partido::find($a->idpartido)->idfase);\n\n\t\treturn Redirect::to(\"apuestas/create/\".$id_fase.\"/\");\n\t}", "public function storeResource(Request $request)\n {\n \n $resource = new Resource;\n $resource->type = $request->type;\n $resource->subtype = $request->subtype;\n $resource->description = $request->description;\n $resource->save();\n\n $message = \"Resource added\"; \n return view('message', compact('message'));\n \n }", "public function store(CreateMissionRequest $request)\n\t{\n\n\t\tMission::create($request->all());\n\n\t\treturn redirect()->route(config('quickadmin.route').'.mission.index');\n\t}", "public function store()\n\t{\n\t\t$input = Input::except(array_keys($this->relationships)); // Less safe, more convenient\n\t\t//$input = Input::only(array_keys($this->resource->getFillableLabels())); //More safe, less convenient\n\t\t$this->resource = $this->resource->fill($input);\n\n\t\treturn $this->persist(__FUNCTION__);\n\t}", "public function store()\n\t{\n\t\t$input = array_add(Input::get(), 'userId', Auth::id());\n\t\t$input = array_add($input, 'condoId', json_decode(Session::get('app.condo')[0])->id);\n\t\t$input = array_add($input, 'batchId', Str::random(20));\n\t\t$this->ticketRegistrationValidation->validate( Input::all() );\n\t\t$lastTicketId = $this->execute(TicketRegisterCommand::class, $input);\n\t\tApp::make('HelperController')->uploadFileFinalize($lastTicketId);\n\t\treturn $this->sendJsonMessage('success',200);\n\t}", "public function store()\n {\n\n// $data = request()->all();\n// FLYAirlines::create($data);\n\n return redirect(route('app.airlines.index'));\n\n\n }", "public function store() {\n //TODO validation for create company\n $driver = $this->driver;\n $input = input()->all();\n $redirect = url('vehicles');\n if ($driver) {\n $input['iCompanyId'] = $driver['iCompanyId'];\n $input['iDriverId'] = $driver['iDriverId'];\n $redirect = url('driver.vehicles');\n }\n Vehicle::create($input);\n return redirect($redirect);\n }", "public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Manufacture::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tManufacture::create($data);\n\n\t\treturn Redirect::route('manufactures.index');\n\t}", "public function store(CreateAp1aulac1m1Request $request)\n { \n\n }", "public function store(StoreFuelCostsRequest $request)\n {\n if (! Gate::allows('fuel_cost_create')) {\n return abort(401);\n }\n $fuel_cost = FuelCost::create($request->all());\n\n\n\n return redirect()->route('admin.fuel_costs.index');\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
test for passing methods, a passed by value, b passed by reference array is also passed by reference(by choice), objects always passed by reference
function fun4( $a, &$b, &$array, $obj){ echo("---FUN4--- \n"); $a = $a*$a; $b = $b*$b; array_push($array,"99"); $obj->testVar = 9999; $value = $obj->testVar; echo("a inside: $a "); echo("b inside: $b \n"); echo("object inside: $value \n"); echo("array inside: "); foreach($array as $item){ echo("$item "); } echo("\n"); }
[ "function call_user_method_array ($method_name, &$obj, array $paramarr) {}", "function call_user_method_array ($method_name, &$obj, array $params) {}", "public function isPassedByReference(): bool\n {\n return $this->byRef;\n }", "public function isPassedByReference(): bool\n {\n return $this->passedByReference;\n }", "function func2(&$a,&$b)\n {\n $a=70;\n $b=43;\n }", "public function isPassedByReference()\n {\n $this->scan();\n\n return $this->isPassedByReference;\n }", "public function testSwitchObject()\n\t{\n\t\t$method_name = 'methodName';\n\t\t$a = $this->freshObjectExpectingMethodCall($method_name);\n\t\t$b= $this->freshObjectExpectingMethodCall($method_name);\n\t\t\n\t\t$callback = new OLPBlackbox_Rule_Callback($method_name, array(), $a);\n\t\t$callback->__invoke();\n\t\t\n\t\t// switch objects, the point of our test\n\t\t$callback->setObject($b);\n\t\t\n\t\t$this->assertTrue(\n\t\t\t$b === $callback->object,\n\t\t\t\"Unable to change the object in the callback.\"\n\t\t);\n\t\t$callback->__invoke();\n\t}", "function test_assert_same() {\r\n $x = new stdClass();\r\n $y = &$x;\r\n $this->assertSame($x, $y, 'Should only be used with objects, arguments should reference the same object|%s');\r\n}", "public function isPassedByReference()\n\t{\n\t\treturn $this->passedByReference;\n\t}", "public function testGetMethodsFromReference(): void\n {\n foreach ($this->provideReferenceValues(self::$obj->getMethods(), 'optionalmethods') as $args) {\n list($element, $range) = $args;\n\n $shouldBeThere = $this->checkValuesFromReference(\n $element,\n $range,\n self::$optionalmethods,\n self::$ignoredmethods\n );\n\n if (null === $shouldBeThere) {\n // test $element should be skipped because it was marked as optional or ignored\n continue;\n }\n\n try {\n $method = new ReflectionMethod($element);\n $extensionName = $method->getExtensionName() ?: '';\n if (strcasecmp($extensionName, self::$obj->getName()) != 0) {\n continue;\n }\n\n list(, $methodName) = explode('::', $element);\n if ($method->getName() !== $methodName) {\n // case does not match; probably use case like https://3v4l.org/LL80T\n continue;\n }\n try {\n $method->getPrototype();\n // don't check prototype methods\n continue;\n } catch (ReflectionException $e) {\n // none prototype for this method\n }\n $methodExists = true;\n } catch (ReflectionException $e) {\n // thrown if the given method does not exist.\n $methodExists = false;\n }\n\n if ($shouldBeThere) {\n $this->assertTrue(\n $methodExists,\n \"Class Method '$element', found in Reference, does not exists.\"\n );\n\n if ($method->isStatic()) {\n $this->assertTrue(\n $range['is_static'],\n \"Class Method '$element', found in Reference, should be declared as static.\"\n );\n } else {\n $this->assertFalse(\n $range['is_static'],\n \"Class Method '$element', found in Reference, should not be declared as static.\"\n );\n }\n } else {\n $this->assertFalse(\n $methodExists,\n \"Class Method '$element', found in Reference, exists.\"\n );\n }\n }\n }", "function call_user_method ($method_name, &$obj, $parameter = null) {}", "function passByReference(&$val){\r\n $val = $val + 100;\r\n}", "public function testMethodInvocationWithParameters() {\n\t\terror_reporting(($backup = error_reporting()) & ~E_USER_DEPRECATED);\n\n\t\t$class = 'lithium\\tests\\mocks\\analysis\\MockInspector';\n\n\t\t$this->assertEqual($class::invokeMethod('foo'), []);\n\t\t$this->assertEqual($class::invokeMethod('foo', ['bar']), ['bar']);\n\n\t\t$params = ['one', 'two'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['short', 'parameter', 'list'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['a', 'longer', 'parameter', 'list'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['a', 'much', 'longer', 'parameter', 'list'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['an', 'extremely', 'long', 'list', 'of', 'parameters'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = ['an', 'extremely', 'long', 'list', 'of', 'parameters'];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\t$params = [\n\t\t\t'if', 'you', 'have', 'a', 'parameter', 'list', 'this',\n\t\t\t'long', 'then', 'UR', 'DOIN', 'IT', 'RONG'\n\t\t];\n\t\t$this->assertEqual($class::invokeMethod('foo', $params), $params);\n\n\t\terror_reporting($backup);\n\t}", "abstract public function bindByReference(array &$binding);", "public function isPassedByReference(): bool\n {\n return $this->node->byRef;\n }", "public function canBePassedByValue()\n {\n return !$this->isByRef();\n }", "public function makeByRef() {}", "public function testSetParametersMultipleCalls()\n {\n $link = new Link('http://a.idio.co/r?a=1');\n $link->setParameters(\n array(\n 'b' => 2\n )\n );\n $link->setParameters(\n array(\n 'c' => 3\n )\n );\n $this->assertEquals(\n 'http://a.idio.co/r?a=1&b=2&c=3',\n $link->get(),\n \"Expecting the array parameter to be overwritten\"\n );\n }", "public function isPassedByReference()\n {\n return $this->root->isPassedByReference();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unsets Order Id. The ID of the order associated with the refund.
public function unsetOrderId(): void { $this->orderId = []; }
[ "public function resetOrderId() {\n\t\t$this->expunge( 'order_id' );\n\t\t$this->normalize();\n\t}", "public function clearOrderId()\n {\n $this->orderId = null;\n }", "public function cancelOrderRefundAction($order)\n {\n foreach($order->getItemsCollection() as $item)\n {\n if ($item->getQtyRefunded() > 0)\n {\n $item->setQtyRefunded(0)\n ->setAmountRefunded(0)\n ->setBaseAmountRefunded(0)\n ->setHiddenTaxRefunded(0)\n ->setBaseHiddenTaxRefunded(0)\n ->setTaxRefunded(0)\n ->setBaseTaxRefunded(0)\n ->setDiscountRefunded(0)\n ->setBaseDiscountRefunded(0)\n ->save();\n }\n }\n\n $order\n ->setBaseDiscountRefunded(0)\n ->setBaseShippingRefunded(0)\n ->setBaseSubtotalRefunded(0)\n ->setBaseTaxRefunded(0)\n ->setBaseShippingTaxRefunded(0)\n ->setBaseTotalOnlineRefunded(0)\n ->setBaseTotalOfflineRefunded(0)\n ->setBaseTotalRefunded(0)\n ->setTotalOnlineRefunded(0)\n ->setTotalOfflineRefunded(0)\n ->setDiscountRefunded(0)\n ->setShippingRefunded(0)\n ->setShippingTaxRefunded(0)\n ->setSubtotalRefunded(0)\n ->setTaxRefunded(0)\n ->setTotalRefunded(0)\n ->save();\n\n $invoice = $order->getInvoiceCollection()->getLastItem();\n $invoice->setIsUsedForRefund(0)->save();\n }", "public function refund( $order_id )\n \t{\n \t\tdie('Not allowed');\n \t}", "public function unsetRefundId(): self\n {\n $this->instance->unsetRefundId();\n return $this;\n }", "public function refund($order);", "public function refund( WC_Order $order ) {\n\n\t\t$this->order = $order;\n\n\t\t$request = $this->get_new_request();\n\n\t\t$request->create_refund();\n\n\t\treturn $this->perform_request( $request );\n\t}", "public function unSetQuoteId()\n {\n $this->checkoutSession->setQuoteId(null);\n }", "public function revoke_referral_on_refund( $order_id = 0 ) {\n\n\t\tif( ! affiliate_wp()->settings->get( 'revoke_on_refund' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->reject_referral( $order_id );\n\n\t}", "private function clearOrder()\n {\n $this->order = null;\n }", "protected function _cancelOrderReferenceId()\n {\n if ($this->_orderReferenceId) {\n $this->_getApi()->cancelOrderReference($this->_orderReferenceId);\n $this->_clearOrderReferenceId();\n }\n }", "public function unsetPaymentId(): void\n {\n $this->paymentId = [];\n }", "public function refund(string $transactionId, OrderInterface $order, Price $amount) : RefundResponse;", "public function resetOrder($order)\n {\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n\n $query->delete('#__ketshop_order_prod')\n\t ->where('order_id='.(int)$order->id);\n $db->setQuery($query);\n $db->execute();\n\n $query->clear();\n $query->delete('#__ketshop_order_prule')\n\t ->where('order_id='.(int)$order->id);\n $db->setQuery($query);\n $db->execute();\n\n $query->clear();\n $query->delete('#__ketshop_order_detailed_amount')\n\t ->where('order_id='.(int)$order->id);\n $db->setQuery($query);\n $db->execute();\n\n $this->deleteShipping($order);\n\n $query->clear();\n $fields = array('amount_excl_tax=0', 'amount_incl_tax=0', \n\t\t 'final_amount_excl_tax=0', 'final_amount_incl_tax=0');\n\n $query->update('#__ketshop_order')\n\t ->set($fields)\n\t ->where('id='.(int)$order->id);\n $db->setQuery($query);\n $db->execute();\n }", "public function cancelOrder($orderId) {\n $this->_orderManagement->cancel($orderId);\n }", "public function setCancel(Order $order): void\n {\n $order->setStatusOrder(OrderInterface::STATUS_CANCELED);\n }", "function cancel_order($order_id)\n\t{\n\t\t$this->db->delete('orders', array('id' => $order_id));\n\t}", "public function refund(string $orderId, int $amount): TerminalResponse\n {\n $data = [\n 'Key' => $this->config->getKey(),\n 'Password' => $this->config->getPassword(),\n 'OrderId' => $orderId,\n 'Amount' => $amount,\n ];\n\n return $this->sendRequest(PaytureOperation::REFUND(), $data);\n }", "protected function saveRefund($id_order)\n {\n // Custom event trigger.\n // @link https://support.google.com/tagmanager/answer/6106961?hl=en#CustomEvents\n $refund['event'] = 'orderUpdate';\n $refund['nonInteraction'] = 1;\n // Set data layer.\n // @link https://developers.google.com/tag-manager/enhanced-ecommerce#refunds\n $refund['ecommerce']['refund']['actionField']['id'] = $id_order;\n\n $this->context->cookie->gecommerce = Tools::jsonEncode($refund);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get the sum of how many crimes happened between 2010 and 2011
public function _sumCrimes2010_2011(){ return $this->crimeController->_sumCrimes2010_2011(); }
[ "public function _sumAllCrimesAgainsCitizens() {\n\t\tfor( $i = 2001; $i < 2012; $i ++ ) {\n\t\t\t$sumOfAllCrimesAgainsCitizens [] = $this->categoryDAO->totalCrimeInPerson ( $i );\n\t\t}\n\t\t$returnSumOfAllCrimesAgainsCitizens = array_sum ( $sumOfAllCrimesAgainsCitizens );\n\t\treturn $returnSumOfAllCrimesAgainsCitizens;\n\t}", "public function _sumAllCrimesAgainsCitizens2010_2011() {\n\t\treturn $this->categoryController->_sumCrimesAgainsCitizens2010_2011 ();\n\t}", "public function sumCrimesPerYear($year){\n\t\treturn $this->crimeController->_sumCrimesPerYear($year);\n\t}", "public function _sumInjury2010_2011(){\n\t\treturn $this->crimeController->_sumInjury2010_2011();\n\t}", "public function _sumAllSexualCrimes() {\n\t\t$sumOfAllSexualCrimes;\n\t\tfor( $i = 2001; $i < 2012; $i ++ ) {\n\t\t\t$sumOfAllSexualCrimes [] = $this->_sumAllSexualCrimes ( $i );\n\t\t}\n\t\t$returnSumOfAllSexualCrimes = array_sum ( $sumOfAllSexualCrimes );\n\t\treturn $returnSumOfAllSexualCrimes;\n\t}", "public function sumTotalSexualDignity2010_2011() {\n for ($i = 2010; $i < 2012; $i++) {\n $sumTotalSexualDignity2010_2011[] = $this-> sumTotalSexualDignity($i);\n }\n $returnSumTotalSexualDignity2010_2011 = array_sum($sumTotalSexualDignity2010_2011);\n return $returnSumTotalSexualDignity2010_2011;\n }", "function getNbByYear()\n\t{\n\t\tglobal $conf;\n\t\tglobal $user;\n\n\t\t$sql = \"SELECT date_format(c.date_repair,'%Y') as dm, count(*), sum(c.\".$this->field.\")\";\n\t\t$sql.= \" FROM \".$this->from;\n\t\tif (!$user->rights->societe->client->voir && !$this->socid) $sql .= \", \".MAIN_DB_PREFIX.\"societe_commerciaux as sc\";\n\t\t$sql.= \" WHERE \".$this->where;\n\t\t$sql.= \" GROUP BY dm\";\n $sql.= $this->db->order('dm','DESC');\n\n\t\treturn $this->_getNbByYear($sql);\n\t}", "public function _sumAllTheft2010_2011() {\n\t\treturn $this->categoryController->_sumTheft2010_2011 ();\n\t}", "function countPofAllocatedY($username)\n\t {\n\t $yeardate = date('Y-m-d', strtotime('-364 days'));\n\t $currentdate = date('Y-m-d');\n\t $sql=\"SELECT COUNT(event_id) As cnt FROM events_tt JOIN allocation ON allocation.id=events_tt.alloc_id WHERE (allocation.fad BETWEEN '\".$yeardate.\"' AND '\".$currentdate.\"') AND events_tt.section_id='\".$username.\"' AND events_tt.is_alloc='1'\";\n\t $q=$this->db->query($sql);\n\t $row=$q->row();\n\t return $row->cnt;\n\t }", "protected function calculateCNumber()\n {\n return (int)floor($this->year / 100) + 1;\n }", "static function shYearDayCount($year) {\r\n if ($year % 4 == 3) return 366;\r\n else return 365;\r\n }", "public function _sumAllCopsActions2010_2011() {\n\t\treturn $this->categoryController->_sumCopsActions2010_2011 ();\n\t}", "function Lib_nbNuits($date1, $date2) {\n\t$debut = ($date1 >= $date2) ? $date2 : $date1;\n\t$fin = ($date1 >= $date2) ? $date1 : $date2;\n\t$nb_nuits = 0;\n\n\t// Tout d'abord, on regarde le nombre de secondes entre la date\n\t// de début et la fin du premier jour\n\t$premier_jour = mktime(0, 0, 0, gmdate('n',$debut), gmdate('j', $debut)+1, gmdate('Y', $debut));\n\t$delta_debut = $premier_jour - $debut;\n\tif ($delta_debut) $nb_nuits++;\n\n\t// Ensuitz, on regarde le nombre de secondes entre la date\n\t// de fin et la fin du dernier jour\n\t$dernier_jour = mktime(0, 0, 0, gmdate('n',$fin), gmdate('j', $fin), gmdate('Y', $fin));\n\t$delta_fin = $fin - $denier_jour;\n\tif ($delta_fin && ($dernier_jour != $premier_jour)) $nb_nuits++;\n\n\tif ($dernier_jour != $premier_jour) \n\t\t$nb_nuits += (($dernier_jour - $premier_jour)/86400) - 1;\n\n\treturn $nb_nuits;\n}", "function countdays($date) // declare the function and get the birth date as a parameter\n\t{\n\t\t $olddate = substr($d, 4); // use this line if you have a date in the format YYYY-mm-dd.\n\t\t $newdate = date(\"Y\") .\"\".$olddate; //set the full birth date this year\n\t\t $nextyear = date(\"Y\")+1 .\"\".$olddate; //set the full birth date next year\n\t\t \n\t\t \n\t\t\tif(strtotime($newdate) > strtotime(date(\"Y-m-d\"))) //check if the birthday has passed this year. In order to check use strotime(). if it has not....\n\t\t\t{\n\t\t\t$start_ts = strtotime($newdate); // set a variable equal to the birthday in seconds (Unix timestamp, check php manual for more information)\n\t\t\t$end_ts = strtotime(date(\"Y-m-d\"));// and a variable equal to today in seconds\n\t\t\t$diff = $end_ts - $start_ts; // calculate the difference of today minus birthday\n\t\t\t$n = round($diff / (60*60*24));// divide the diffence with the seconds of one day to get the dates. Use round() to get a round number.\n\t\t\t\t\t\t\t\t\t\t//(60*60*24) represents 60 seconds * 60 minutes * 24 hours = 1 day in seconds. You can also directly write 86400\n\t\t\t$return = substr($n, 1); //you need this to get the right value without -\n\t\t\treturn $return; // return the value\n\t\t\t}\n\t\t\telse // else if the birthday has past this year\n\t\t\t{\n\t\t\t$start_ts = strtotime(date(\"Y-m-d\")); // set a variable equal to the today in seconds\n\t\t\t$end_ts = strtotime($nextyear); // and a variable with the birtday next year\n\t\t\t$diff = $end_ts - $start_ts; // calculate the difference of next birthday minus today\n\t\t\t$n = round($diff / (60*60*24)); // divide the diffence with the seconds of one day to get the dates.\n\t\t\t$return = $n; // assign the dates to return\n\t\t\treturn $return; // return the value\n\t\t\n\t\t\t}\n\t\t\n\t\t}", "function noOfCertsCollectedPerMonth($year){\n return $this->db\n ->query(\"SELECT count(*) as count, MONTHNAME(co.collection_date) as collection_date\n FROM request r\n LEFT JOIN Coa_collection co\n ON co.ref_no = r.request_id\n WHERE YEAR(r.designation_date) = '$year'\n AND r.coa_done_status = 1\n GROUP BY MONTHNAME(co.collection_date)\")\n ->result();\n }", "function avg_years_as_members_jcrew() {\n\t\t//Connect to mysql server\n\t\t$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);\n\t\tif(!$link) {\n\t\t\tdie('Failed to connect to server: ' . mysql_error());\n\t\t}\n\t\n\t\t//Select database\n\t\t$db = mysql_select_db(DB_DATABASE);\n\t\tif(!$db) {\n\t\t\tdie(\"Unable to select database\");\n\t\t}\n\t\n\t\t//Query to get started information about a member\n\t\t$query = \"SELECT started FROM crew WHERE active='true' AND type='junior'\";\n\t\t$result = @mysql_query($query) or die(mysql_error());\n\t\n\t\t//Variable to store sum of all active senior members years as members of the department\n\t\t$avg_year = 0;\n\t\n\t\t//Loop through results from database\n\t\twhile($row = mysql_fetch_array($result)) {\n\t\t\t$avg_year = $avg_year + (date(\"Y\") - $row['started']);\n\t\t}\n\t\n\t\t//Calculate average years\n\t\t$avg_year = $avg_year/get_no_of_active_jmembers();\n\t\n\t\treturn $avg_year;\n\t}", "function get_no_of_rescmen($param) {\n\t\t//Connect to mysql server\n\t\t$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);\n\t\tif(!$link) {\n\t\t\tdie('Failed to connect to server: ' . mysql_error());\n\t\t}\n\t\n\t\t//Select database\n\t\t$db = mysql_select_db(DB_DATABASE);\n\t\tif(!$db) {\n\t\t\tdie(\"Unable to select database\");\n\t\t}\n\t\n\t\tif($param == \"ALL\") { //Get all members that has went through course\n\t\t\t$query = \"SELECT crew_id FROM crew WHERE active='true' AND type='senior' AND rescman NOT LIKE 'not_done'\";\n\t\t} else { //Get all members that has went through the course on year, this year - $param\n\t\t\t$year = date('Y')-$param;\n\t\t\t$query = \"SELECT crew_id FROM crew WHERE active='true' AND type='senior' AND rescman='$year'\";\n\t\t}\n\t\n\t\t$result = @mysql_query($query) or die(mysql_error());\n\t\n\t\treturn mysql_num_rows($result);\n\t}", "public function getIncome($year)\r\n\t{\r\n\t\t$total = 0;\r\n\t\t$page = 1;\r\n\t\twhile($this->getFile(\"invoices.xml?page=$page\")->xpath->evaluate(\"count(//invoice[starts-with(issued-on, '$year')])\")) {\r\n\t\t\t$total += $this->getFile(\"invoices.xml?page=$page\")->xpath->evaluate(\"sum(//invoice[starts-with(issued-on, '$year')]/total)\");\r\n\t\t\t$page++;\r\n\t\t}\r\n\t\treturn $total;\r\n\t}", "abstract public function getSumByYear(int $year): int;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setPersFechaNacimiento() Set the value of [pers_c_estado_civil] column.
public function setPersCEstadoCivil($v) { if ($v !== null) { $v = (int) $v; } if ($this->pers_c_estado_civil !== $v) { $this->pers_c_estado_civil = $v; $this->modifiedColumns[PersonaTableMap::COL_PERS_C_ESTADO_CIVIL] = true; } if ($this->aEstadoCivil !== null && $this->aEstadoCivil->getEsciCodigo() !== $v) { $this->aEstadoCivil = null; } return $this; }
[ "public function setEstado_civil($estado_civil){\n $this->estado_civil = $estado_civil;\n }", "public function setIdestado_civil($idestado_civil){\n $this->idestado_civil = $idestado_civil;\n }", "public function setFechaNacimiento($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->fecha_nacimiento !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->fecha_nacimiento !== null && $tmpDt = new DateTime($this->fecha_nacimiento)) ? $tmpDt->format('Y-m-d') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->fecha_nacimiento = ($dt ? $dt->format('Y-m-d') : null);\n\t\t\t\t$this->modifiedColumns[] = SfGuardUserProfilePeer::FECHA_NACIMIENTO;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}", "public function set_civilite($_civilite)\n {\n $this->_civilite = $_civilite;\n\n return $this;\n }", "public function setNotFecha($valor, $tipo = \"\")\n\t{\n\t\t$this -> not_fecha = $valor;\n\t\t\n\t\tif(!empty($tipo))\n\t\t{\n\t\t\t$this -> not_fecha_tipo = $tipo;\n\t\t}\n\t}", "public function setFecha_insercion_prov($fecha_insercion_prov){\n $this->fecha_insercion_prov = $fecha_insercion_prov;\n }", "public function setFecha_carga($fecha_carga)\r\n\t{\r\n\t\t$this->fecha_carga = $fecha_carga;\r\n\t}", "function set_fechaIngreso( $fechaIngreso ) {\n // sets the value of fechaIngreso\n $this->fechaIngreso = $fechaIngreso;\n }", "public function set_estado_civil(EstadoCivil $object)\n {\n $this->estado_civil = $object;\n $this->estado_civil_id = $object->id;\n }", "public function setEstadoCivil(ChildEstadoCivil $v = null)\n {\n if ($v === null) {\n $this->setPersCEstadoCivil(NULL);\n } else {\n $this->setPersCEstadoCivil($v->getEsciCodigo());\n }\n\n $this->aEstadoCivil = $v;\n\n // Add binding for other direction of this n:n relationship.\n // If this object has already been added to the ChildEstadoCivil object, it will not be re-added.\n if ($v !== null) {\n $v->addPersona($this);\n }\n\n\n return $this;\n }", "public function setFechaNacimientoPersona($fechaNacimientoPersona){\n $this->fechaNacimientoPersona = $fechaNacimientoPersona;\n }", "public function setFechaVencimientoPeriodo( $fechaVencimiento ){\n\t\t$this->fechaVencimiento = $fechaVencimiento;\n\t}", "function setFecha($fecha) {\r\n\t\t$this->fecha = $fecha;\r\n }", "public function setOrdencompraFecha($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->ordencompra_fecha !== null || $dt !== null) {\n $currentDateAsString = ($this->ordencompra_fecha !== null && $tmpDt = new DateTime($this->ordencompra_fecha)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->ordencompra_fecha = $newDateAsString;\n $this->modifiedColumns[] = OrdencompraPeer::ORDENCOMPRA_FECHA;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setValutaDate($valutaDate) {\n\t\t$this->valutaDate = $valutaDate;\n\t\t\n\t\t$this->doUpdate(\"SET valuta_date = '\" . $valutaDate->getDate() . \"'\");\n\t}", "public function setFecha_control($fecha_control)\r\n\t{\r\n\t\t$this->fecha_control = $fecha_control;\r\n\t}", "public function setFecha($fecha){\n \t$this->fecha = $fecha;\n\t}", "public function setEmpleadoFechaentrada($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->empleado_fechaentrada !== null || $dt !== null) {\n $currentDateAsString = ($this->empleado_fechaentrada !== null && $tmpDt = new DateTime($this->empleado_fechaentrada)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->empleado_fechaentrada = $newDateAsString;\n $this->modifiedColumns[] = EmpleadoPeer::EMPLEADO_FECHAENTRADA;\n }\n } // if either are not null\n\n\n return $this;\n }", "public function setMetFechaRegistroSistema($v)\n\t{\n\t\t// we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')\n\t\t// -- which is unexpected, to say the least.\n\t\tif ($v === null || $v === '') {\n\t\t\t$dt = null;\n\t\t} elseif ($v instanceof DateTime) {\n\t\t\t$dt = $v;\n\t\t} else {\n\t\t\t// some string/numeric value passed; we normalize that so that we can\n\t\t\t// validate it.\n\t\t\ttry {\n\t\t\t\tif (is_numeric($v)) { // if it's a unix timestamp\n\t\t\t\t\t$dt = new DateTime('@'.$v, new DateTimeZone('UTC'));\n\t\t\t\t\t// We have to explicitly specify and then change the time zone because of a\n\t\t\t\t\t// DateTime bug: http://bugs.php.net/bug.php?id=43003\n\t\t\t\t\t$dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));\n\t\t\t\t} else {\n\t\t\t\t\t$dt = new DateTime($v);\n\t\t\t\t}\n\t\t\t} catch (Exception $x) {\n\t\t\t\tthrow new PropelException('Error parsing date/time value: ' . var_export($v, true), $x);\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->met_fecha_registro_sistema !== null || $dt !== null ) {\n\t\t\t// (nested ifs are a little easier to read in this case)\n\n\t\t\t$currNorm = ($this->met_fecha_registro_sistema !== null && $tmpDt = new DateTime($this->met_fecha_registro_sistema)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n\t\t\t$newNorm = ($dt !== null) ? $dt->format('Y-m-d H:i:s') : null;\n\n\t\t\tif ( ($currNorm !== $newNorm) // normalized values don't match \n\t\t\t\t\t)\n\t\t\t{\n\t\t\t\t$this->met_fecha_registro_sistema = ($dt ? $dt->format('Y-m-d H:i:s') : null);\n\t\t\t\t$this->modifiedColumns[] = MetodoPeer::MET_FECHA_REGISTRO_SISTEMA;\n\t\t\t}\n\t\t} // if either are not null\n\n\t\treturn $this;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
reject weakest proposal for person
public function rejectWeakest($person) { foreach (array_reverse($this->preferences[$person]) as $preference) { if (!is_null($preference)) { break; } } if ($preference) { $this->reject($person, $preference); return true; } return false; }
[ "function hrb_proposal_no_agreement( $proposal, $user, $decision ) {\n\tdo_action( 'hrb_no_agreement', $proposal, $user, $decision );\n}", "public function skipApproval();", "public function hapusProposalSebelumnya()\n {\n $proposal = Auth::user()->mahasiswa()->proposal();\n\n // Jika pernah mengunggah proposal\n if(!is_null($proposal->direktori_final)) {\n FH::delete($this->dir, $proposal->direktori_final);\n }\n }", "public function reject() {\n\t\treturn $this->setStatus( self::STATUS_REJECTED );\n\t}", "public function removePersonWithLessData(){\n\t\t\t$preferences = $this->preferences;\n\t\t\tforeach($preferences as $person => $data){\n\t\t\t\tif(count($preferences[$person])<$this->minKey){\n\t\t\t\t\tunset($preferences[$person]);\n\t\t\t\t}\n\t }\n\t return $preferences;\n\t\t}", "public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }", "function hrb_agreement_canceled_notify_parties( $proposal, $sender ) {\n\n\t$proposal = hrb_get_proposal( $proposal );\n\n\tif ( $sender->ID == $proposal->project->post_author ) {\n\t\t// employer\n\t\t$recipient = get_user_by( 'id', $proposal->get_user_id() );\n\t} else {\n\t\t// candidate\n\t\t$recipient = get_user_by( 'id', $proposal->project->post_author );\n\t}\n\n\t$project_link = html_link( get_permalink( $proposal->project->ID ), $proposal->project->post_title );\n\n\t### notify recipient\n\n\t$subject_message = sprintf( __( 'User \\'%1$s\\' has canceled negotiations with you for - %2$s -', APP_TD ), $sender->display_name, $project_link );\n\n\t$content = sprintf(\n\t\t__( 'Hello %2$s,%1$s\n\t\tuser \\'%3$s\\' has canceled negotiations with you on %4$s.', APP_TD ),\n\t\t\"\\r\\n\\r\\n\", $recipient->display_name, $sender->display_name, $project_link\n\t);\n\n\t$participant = array(\n\t\t'recipient' => $recipient->ID,\n\t\t'message' => $subject_message,\n\t\t'send_mail' => array(\n\t\t\t'content' => wpautop( $content ),\n\t\t),\n\t\t'meta' => array(\n\t\t\t'subject' => wp_strip_all_tags( $subject_message ),\n\t\t\t'project_id' => $proposal->project->ID,\n\t\t\t'action' => get_the_hrb_proposal_url( $proposal ),\n\t\t),\n\t);\n\n\tappthemes_send_notification( $participant['recipient'], $participant['message'], 'action', $participant['meta'], array( 'send_mail' => $participant['send_mail'] ) );\n\n\t### notify sender\n\n\t$subject_message = sprintf( __( 'You\\'ve canceled negotiations with \\'%1$s\\' on - %2$s -', APP_TD ), $recipient->display_name, $project_link );\n\n\t$content = sprintf(\n\t\t__( 'Hello %2$s,%1$s\n\t\tyou\\'ve canceled negotiations with \\'%3$s\\' on %4$s.', APP_TD ),\n\t\t\"\\r\\n\\r\\n\", $sender->display_name, $recipient->display_name, $project_link\n\t);\n\n\t$participant = array(\n\t\t'recipient' => $sender->ID,\n\t\t'message' => $subject_message,\n\t\t'send_mail' => array(\n\t\t\t'content' => wpautop( $content ),\n\t\t),\n\t\t'meta' => array(\n\t\t\t'subject' => wp_strip_all_tags( $subject_message ),\n\t\t\t'project_id' => $proposal->project->ID,\n\t\t\t'action' => get_the_hrb_proposal_url( $proposal ),\n\t\t),\n\t);\n\n\tappthemes_send_notification( $participant['recipient'], $participant['message'], 'notification', $participant['meta'], array( 'send_mail' => $participant['send_mail'] ) );\n}", "public static function reject() {\n return new Reject(\"Not match PDB idetifier XXX\");\n }", "function hrb_no_agreement_notify_parties( $proposal, $sender, $decision ) {\n\n\t$proposal = hrb_get_proposal( $proposal );\n\n\t$project_link = html_link( get_permalink( $proposal->project->ID ), $proposal->project->post_title );\n\t$terms_link = html_link( esc_url( get_the_hrb_proposal_url( $proposal ) ), __( 'terms', APP_TD ) );\n\n\tif ( $sender->ID == $proposal->project->post_author ) {\n\t\t// employer\n\t\t$recipient = get_user_by( 'id', $proposal->get_user_id() );\n\t} else {\n\t\t// candidate\n\t\t$recipient = get_user_by( 'id', $proposal->project->post_author );\n\t}\n\n\tif ( HRB_TERMS_PROPOSE == $decision ) {\n\t\t$decision = __( 'proposed new', APP_TD );\n\t} else {\n\t\t$decision = strtolower( hrb_get_agreement_decision_verbiage( $decision ) );\n\t}\n\n\t$decision = sprintf( '%1$s %2$s', $decision, $terms_link );\n\n\n\t### notify recipient\n\n\t$subject_message = sprintf( __( 'User %1$s %2$s for \"%3$s\"', APP_TD ), $sender->display_name, $decision, $project_link );\n\n\t$content = sprintf(\n\t\t__( 'Hello %2$s,%1$s\n\t\tuser %3$s %4$s for %5$s.', APP_TD ), \"\\r\\n\\r\\n\", $recipient->display_name, $sender->display_name, $decision, $project_link\n\t);\n\n\t$participant = array(\n\t\t'recipient' => $recipient->ID,\n\t\t'message' => $subject_message,\n\t\t'send_mail' => array(\n\t\t\t'content' => wpautop( $content ),\n\t\t),\n\t\t'meta' => array(\n\t\t\t'subject' => wp_strip_all_tags( $subject_message ),\n\t\t\t'project_id' => $proposal->project->ID,\n\t\t\t'action' => esc_url( get_the_hrb_proposal_url( $proposal ) ),\n\t\t),\n\t);\n\n\tappthemes_send_notification( $participant['recipient'], $participant['message'], 'action', $participant['meta'], array( 'send_mail' => $participant['send_mail'] ) );\n\n\t### notify sender\n\n\t$subject_message = sprintf( __( 'You\\'ve %1$s for \"%2$s\"', APP_TD ), $decision, $project_link );\n\n\t$content = sprintf(\n\t\t__( 'Hello %2$s,%1$s\n\t\tyou\\'ve %3$s for %4$s.', APP_TD ), \"\\r\\n\\r\\n\", $sender->display_name, $decision, $project_link\n\t);\n\n\t$participant = array(\n\t\t'recipient' => $sender->ID,\n\t\t'message' => $subject_message,\n\t\t'send_mail' => array(\n\t\t\t'content' => wpautop( $content ),\n\t\t),\n\t\t'meta' => array(\n\t\t\t'subject' => wp_strip_all_tags( $subject_message ),\n\t\t\t'project_id' => $proposal->project->ID,\n\t\t\t'action' => esc_url( get_the_hrb_proposal_url( $proposal ) ),\n\t\t),\n\t);\n\n\tappthemes_send_notification( $participant['recipient'], $participant['message'], 'notification', $participant['meta'], array( 'send_mail' => $participant['send_mail'] ) );\n}", "public function unignore($medlem)\n\t{\n\t\tglobal $db, $USER;\n\t\t\n\t\t// Only owner of the club can do this\n\t\tif($this->getSkapareId() == $USER->getId()) {\n\t\t\t\n\t\t\t$sql = \"UPDATE \" . self::RELATION_TABLE . \" SET ignorerad = 0 WHERE grupp_id = \" . $this->getId() . \" AND medlem_id = \" . $medlem->getId();\n\t\t\t$db->nonquery($sql);\n\t\t\t\n\t\t\t$this->acceptRequest($medlem);\n\t\t}\n\t\t\n\t}", "public function agreementSpecialistDecline();", "function hrb_agreement_canceled_notify_parties( $proposal, $sender ) {\n\n\t$proposal = hrb_get_proposal( $proposal );\n\n\tif ( $sender->ID == $proposal->project->post_author ) {\n\t\t// employer\n\t\t$recipient = get_user_by( 'id', $proposal->get_user_id() );\n\t} else {\n\t\t// candidate\n\t\t$recipient = get_user_by( 'id', $proposal->project->post_author );\n\t}\n\n\t$project_link = html_link( get_permalink( $proposal->project->ID ), $proposal->project->post_title );\n\n\t### notify recipient\n\n\t$subject_message = sprintf( __( '%1$s has canceled negotiations with you on \"%2$s\"', APP_TD ), $sender->display_name, $project_link );\n\n\t$content = sprintf(\n\t\t__( 'Hello %2$s,%1$s\n\t\t%3$s has canceled negotiations with you on \"%4$s\".', APP_TD ),\n\t\t\"\\r\\n\\r\\n\", $recipient->display_name, $sender->display_name, $project_link\n\t);\n\n\t$participant = array(\n\t\t'recipient' => $recipient->ID,\n\t\t'message' => $subject_message,\n\t\t'send_mail' => array(\n\t\t\t'content' => wpautop( $content ),\n\t\t),\n\t\t'meta' => array(\n\t\t\t'subject' => wp_strip_all_tags( $subject_message ),\n\t\t\t'project_id' => $proposal->project->ID,\n\t\t\t'action' => esc_url( get_the_hrb_proposal_url( $proposal ) ),\n\t\t),\n\t);\n\n\tappthemes_send_notification( $participant['recipient'], $participant['message'], 'action', $participant['meta'], array( 'send_mail' => $participant['send_mail'] ) );\n\n\t### notify sender\n\n\t$subject_message = sprintf( __( 'You\\'ve canceled negotiations with %1$s on \"%2$s\"', APP_TD ), $recipient->display_name, $project_link );\n\n\t$content = sprintf(\n\t\t__( 'Hello %2$s,%1$s\n\t\tyou\\'ve canceled negotiations with %3$s on \"%4$s\".', APP_TD ),\n\t\t\"\\r\\n\\r\\n\", $sender->display_name, $recipient->display_name, $project_link\n\t);\n\n\t$participant = array(\n\t\t'recipient' => $sender->ID,\n\t\t'message' => $subject_message,\n\t\t'send_mail' => array(\n\t\t\t'content' => wpautop( $content ),\n\t\t),\n\t\t'meta' => array(\n\t\t\t'subject' => wp_strip_all_tags( $subject_message ),\n\t\t\t'project_id' => $proposal->project->ID,\n\t\t\t'action' => esc_url( get_the_hrb_proposal_url( $proposal ) ),\n\t\t),\n\t);\n\n\tappthemes_send_notification( $participant['recipient'], $participant['message'], 'notification', $participant['meta'], array( 'send_mail' => $participant['send_mail'] ) );\n}", "public static function reject() {\n return new Reject('Not match atom in []');\n }", "public function reject($reason);", "public static function reject() {\n return new Reject('Not match Atom in []');\n }", "public function unapprove()\n {\n return $this->update(['approved' => false]);\n }", "public function rejectAction()\n {\n $result = array(\n 'status' => self::RESULT_TRUE,\n 'message' => array(),\n 'data' => array(),\n );\n\n $id = Service::getParam($this, 'id', 0);\n $rejectReason = Service::getParam($this, 'memo', '');\n\n if (!$id) {\n return array('message' => __('Not enough parameter.'));\n }\n \n $model = $this->getModel('draft');\n $row = $model->find($id);\n if (!$row->id or $row->status != Draft::FIELD_STATUS_PENDING) {\n return array('message' => __('Invalid draft.'));\n }\n \n $row->status = Draft::FIELD_STATUS_REJECTED;\n $row->reject_reason = $rejectReason;\n $row->save();\n\n $result['status'] = self::RESULT_TRUE;\n $result['data']['redirect'] = $this->url('', array('action'=>'list', 'controller' => 'draft'));\n\n return $result;\n }", "public function rejectNewProvider();", "function RejectAssignment()\n {\n if (!$this->AssignmentId) return $this->mtError(\"Missing AssignmentId\");\n else $this->QueryData['AssignmentId'] = $this->AssignmentId;\n if ($this->RequesterFeedback && strlen($this->RequesterFeedback) > 1024) return $this->mtError(\"RequesterFeedback entry is too long!\");\n elseif ($this->RequesterFeedback) $this->QueryData['RequesterFeedback'] = $this->RequesterFeedback;\n return $this->mtMakeRequest();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the format box.
public function add_format_box() { switch ( get_post_format() ) { case 'gallery': $format_class = 'images'; break; case 'link': $format_class = 'link'; break; case 'image': $format_class = 'image'; break; case 'quote': $format_class = 'quotes-left'; break; case 'video': $format_class = 'film'; break; case 'audio': $format_class = 'headphones'; break; case 'chat': $format_class = 'bubbles'; break; default: $format_class = 'pen'; break; } $inner_content = '<div ' . FusionBuilder::attributes( 'fusion-format-box' ) . '>'; $inner_content .= '<i ' . FusionBuilder::attributes( 'fusion-icon-' . $format_class ) . '></i>'; $inner_content .= '</div>'; echo $inner_content; // phpcs:ignore WordPress.Security.EscapeOutput }
[ "public function addFormat($name, $format);", "function addFormat($version_id,$format,$type,$value) {\n\t\t$insert = $this->vocab_db->insert('vocab_version_formats', \n\t\t\tarray(\n\t\t\t\t'version_id' => $version_id,\n\t\t\t\t'format' => $format,\n\t\t\t\t'type' => $type,\n\t\t\t\t'value' => $value\n\t\t\t)\n\t\t);\n\t\tif ($insert) {\n\t\t\treturn true;\n\t\t} else return false;\n\t}", "private function add_formats($format_options) {\n\n\t\t$grid = array(\n\t\t 'name' => 'grid', \n\t\t 'width' => $format_options['grid_width'], \n\t\t 'height' => $format_options['grid_height'], \n\t\t 'crop' => ($format_options['grid_crop'] == '1' ? 1 : 0), \n\t\t 'quality' => $format_options['grid_quality'], \n\t\t 'sharpening' => ($format_options['grid_sharpen'] == '1' ? 1 : 0)\n\t\t);\n\n\t\t$thumb = array(\n\t\t 'name' => 'thumb', \n\t\t 'width' => $format_options['thumb_width'], \n\t\t 'height' => $format_options['thumb_height'], \n\t\t 'crop' => ($format_options['thumb_crop'] == '1' ? 1 : 0), \n\t\t 'quality' => $format_options['thumb_quality'], \n\t\t 'sharpening' => ($format_options['thumb_sharpen'] == '1' ? 1 : 0)\n\t\t);\n\n\t\t$large = array(\n\t\t 'name' => 'large', \n\t\t 'width' => $format_options['large_width'], \n\t\t 'height' => $format_options['large_height'], \n\t\t 'crop' => ($format_options['large_crop'] == '1' ? 1 : 0), \n\t\t 'quality' => $format_options['large_quality'], \n\t\t 'sharpening' => ($format_options['large_sharpen'] == '1' ? 1 : 0)\n\t\t);\n\n\t\t$this->format->add($grid);\n\t\t$this->format->add($thumb);\n\t\t$this->format->add($large);\n\n\t\t// Make our formats accessible more easily\n\t\t$this->formats['grid'] = $grid;\n\t\t$this->formats['thumb'] = $thumb;\n\t\t$this->formats['large'] = $large;\n\n\n\t}", "function exultic_post_formats($post) {\r\n remove_meta_box(\r\n 'formatdiv',\r\n $post->post_type,\r\n 'side'\r\n );\r\n add_meta_box(\r\n 'exultic_formatdiv ',\r\n _x('Format', 'post format'),\r\n 'exultic_format_meta_box',\r\n $post->post_type,\r\n 'normal',\r\n 'high'\r\n );\r\n}", "protected function setFormats() {\n\n $this->setDisplayFormat();\n $this->setReturnFormat();\n\n }", "public function addFormat(ExcelFormat $format = null)\n\t{\n\t}", "static function enable_format_text() \t\t{ self::format_text(); }", "function fieldFormat($fieldNo, $format){\n\t\t// add the field format to the fieldFormats array\n\t\t$this->fieldFormats[$fieldNo] = $format;\n\t}", "public function addOptionsBox() {\n $this->addStyle($this->styleOptionsBox, Environment::appDir() . '/public/dist/css/options-box.css', false);\n\n $this->addFormSerializer();\n\n $this->addApp();\n }", "public function createFormatter();", "public function formatGraphics() {\n }", "function appendFormat($format) : IString;", "public function addBox(BoxInterface $box);", "private function initFormatters()\n {\n $formatter = $this->getFormatter();\n\n $formatter->setStyle('error', new OutputFormatterStyle('red', null, ['bold']));\n $formatter->setStyle('warning', new OutputFormatterStyle('yellow', null, ['bold']));\n $formatter->setStyle('aside', new OutputFormatterStyle('blue'));\n $formatter->setStyle('strong', new OutputFormatterStyle(null, null, array('bold')));\n $formatter->setStyle('return', new OutputFormatterStyle('cyan'));\n $formatter->setStyle('urgent', new OutputFormatterStyle('red'));\n $formatter->setStyle('hidden', new OutputFormatterStyle('white'));\n\n // Visibility\n $formatter->setStyle('public', new OutputFormatterStyle(null, null, array('bold')));\n $formatter->setStyle('protected', new OutputFormatterStyle('yellow'));\n $formatter->setStyle('private', new OutputFormatterStyle('red'));\n $formatter->setStyle('global', new OutputFormatterStyle('cyan', null, array('bold')));\n $formatter->setStyle('const', new OutputFormatterStyle('cyan'));\n $formatter->setStyle('class', new OutputFormatterStyle('blue', null, array('underscore')));\n $formatter->setStyle('function', new OutputFormatterStyle(null));\n $formatter->setStyle('default', new OutputFormatterStyle(null));\n\n // Types\n $formatter->setStyle('number', new OutputFormatterStyle('magenta'));\n $formatter->setStyle('string', new OutputFormatterStyle('green'));\n $formatter->setStyle('bool', new OutputFormatterStyle('cyan'));\n $formatter->setStyle('keyword', new OutputFormatterStyle('yellow'));\n $formatter->setStyle('comment', new OutputFormatterStyle('blue'));\n $formatter->setStyle('object', new OutputFormatterStyle('blue'));\n $formatter->setStyle('resource', new OutputFormatterStyle('yellow'));\n }", "function meta_boxes_add() {\n\t\tadd_meta_box(\n\t\t\t\t'openbadger-badge-version', // Unique ID\n\t\t\t\tesc_html__('Badge Version', 'rpibadger'), // Title\n\t\t\t\tarray($this, 'meta_box_version'), // Callback function\n\t\t\t\t$this->get_post_type_name(), // Admin page (or post type)\n\t\t\t\t'side', // Context\n\t\t\t\t'low'\t // Priority\n\t\t);\n\t}", "protected function addBox($path,$options=array(),$sequence='maincol'){\n \treturn $this->app->view->addBox($path,$options,$sequence);\n }", "function format($format);", "function processDisplayFormat(){\n\t\tif (!$this->m_displayFormat){\n\t\t\t$this->m_displayFormat = $this->getReturnCode() === 0 ? new EasyAsk_Impl_DisplayFormat($this->m_doc->source->displayFormat) : new EasyAsk_Impl_DisplayFormat($this->m_doc->displayFormat);\n\t\t}\n\t}", "protected function _applyFormat(){ }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
prints the class links in the dropdown navbar menu from the given term
function printClassLinks($term) { $pdo = dbConnect(); // display summer classes $sql = "SELECT id, dept, number FROM Classes where term=\"$term\""; $sql = $pdo->prepare('SELECT id, dept, number FROM Classes where term=:term ORDER BY dept, number'); $term = filter_var($term, FILTER_SANITIZE_STRING); $sql->bindParam(':term', $term, PDO::PARAM_STR); $sql->execute(); while ($row = $sql->fetch(PDO::FETCH_ASSOC)) { $link = "class.php?cid=" . $row['id']; $text = $row['dept'] . ' ' . $row['number']; echo "<a class=\"dropdown-item\" href=\"$link\">$text</a>"; } $pdo = null; $sql = null; }
[ "function printTerm($term) {\n\t\tfor($i = 0; $i < count ( $this->printedClasses ); $i ++) {\n\t\t\tif ($this->printedClasses [$i] [1] == $term) {\n\t\t\t\techo $this->printedClasses [$i] [0] . \" \" . $this->printedClasses [$i] [1] . \" \" . $this->printedClasses [$i] [2] . \" </br>\";\n\t\t\t}\n\t\t}\n\t\tprint_r ( $this->printedClasses );\n\t}", "function wxr_nav_menu_terms() {\n $nav_menus = wp_get_nav_menus();\n if (empty($nav_menus) || !is_array($nav_menus))\n return;\n\n foreach ($nav_menus as $menu) {\n echo \"\\t<wp:term><wp:term_id>{$menu->term_id}</wp:term_id><wp:term_taxonomy>nav_menu</wp:term_taxonomy><wp:term_slug>{$menu->slug}</wp:term_slug>\";\n $this->wxr_term_name($menu);\n echo \"</wp:term>\\n\";\n }\n }", "function _dossiersearch_getTermDropdown($vid) {\r\n $results = db_query('SELECT name FROM vocabulary WHERE vid = %d LIMIT 0,1', $vid);\r\n $vTitle = db_fetch_object($results)->name;\r\n $pre = 'dossiersearch_filter_';\r\n return '<div class=\"'.$pre.'terms\">'.\r\n '<label>nach&nbsp;<span>'.$vTitle.'</span>:'.\r\n '<select id=\"'.$pre.strtolower($vTitle).'_select\">'.\r\n _dossiersearch_getTermOptions($vid).\r\n '</select>'.\r\n '</label>'.\r\n '</div>';\r\n}", "private function wxr_nav_menu_terms() {\r\n $nav_menus = wp_get_nav_menus();\r\n if ( empty( $nav_menus ) || ! is_array( $nav_menus ) )\r\n return;\r\n\r\n foreach ( $nav_menus as $menu ) {\r\n echo \"\\t<wp:term><wp:term_id>{$menu->term_id}</wp:term_id><wp:term_taxonomy>nav_menu</wp:term_taxonomy><wp:term_slug>{$menu->slug}</wp:term_slug>\";\r\n wxr_term_name( $menu );\r\n echo \"</wp:term>\\n\";\r\n }\r\n }", "public function menuTermOptionList();", "function wxr_nav_menu_terms() {\n\t\t\t$nav_menus = wp_get_nav_menus();\n\t\t\tif ( empty( $nav_menus ) || ! is_array( $nav_menus ) )\n\t\t\t\treturn;\n\n\t\t\tforeach ( $nav_menus as $menu ) {\n\t\t\t\techo \"\\t<wp:term><wp:term_id>{$menu->term_id}</wp:term_id><wp:term_taxonomy>nav_menu</wp:term_taxonomy><wp:term_slug>{$menu->slug}</wp:term_slug>\";\n\t\t\t\twxr_term_name( $menu );\n\t\t\t\techo \"</wp:term>\\n\";\n\t\t\t}\n\t\t}", "function orgrightB_dropdown_menu_output($tree) {\n $output = '';\n $items = array();\n\n // Pull out just the menu items we are going to render so that we\n // get an accurate count for the first/last classes.\n foreach ($tree as $data) {\n if (!$data['link']['hidden']) {\n $items[] = $data;\n }\n }\n\n $num_items = count($items);\n\n foreach ($items as $i => $data) {\n $extra_class = array();\n if ($i == 0) {\n $extra_class[] = 'first';\n }\n if ($i == $num_items - 1) {\n $extra_class[] = 'last';\n }\n\n $extra_class = implode(' ', $extra_class);\n $link = theme('menu_item_link', $data['link']);\n\n //Just theme the link, no children even if it has some\n $output .= theme('menu_item', $link, $data['link']['has_children'], '', $data['link']['in_active_trail'], $extra_class);\n }\n return $output ? theme('menu_tree', $output) : '';\n}", "public function tags_dropdown() {\n\n\t\t$tag = isset( $_GET['knowledgebase_tag'] ) ? esc_attr( $_GET['knowledgebase_tag'] ) : '';\n\t\t$terms = get_terms( 'knowledgebase_tag' );\n\n\t\tif ( !empty( $terms ) ) {\n\t\t\techo '<select name=\"knowledgebase_tag\" class=\"postform\">';\n\n\t\t\techo '<option value=\"' . selected( '', $tag, false ) . '\">' . __( 'View all tags', 'knowledgebase' ) . '</option>';\n\n\t\t\tforeach ( $terms as $term )\n\t\t\t\tprintf( '<option value=\"%s\"%s>%s (%s)</option>', esc_attr( $term->slug ), selected( $term->slug, $tag, false ), esc_html( $term->name ), esc_html( $term->count ) );\n\n\t\t\techo '</select>';\n\t\t}\n\t}", "function searchydoo_render_tax_lists($tax_vocabs){\n $tax_vocabs = array('category','book-types','video-type');\n \n foreach($tax_vocabs as $tax_vocab){\n $this_list = searchydoo_get_taxonomy_terms($tax_vocab);\n \n $label = get_taxonomy($tax_vocab);\n \n //echo var_dump($this_list);\n echo '<div id=\"tax-select-'.$tax_vocab.'\" class=\"tax-select\">';\n echo '<label for=\"'.$tax_vocab.'\">'.$label->label.': </label>';\n echo '<select name=\"'.$tax_vocab.'\">';\n echo '<option value=\"\">Search all</option>';\n \n foreach($this_list as $this_obj){ \n $name = $this_obj->name;\n $slug = $this_obj->slug;\n $term_id = $this_obj->term_id; \n echo '<option value=\"'.$slug.'\">'.$name.'</option>'; \n }\n \n echo '</select>';\n echo '</div>';\n }\n \n \n }", "function display_navbar($nav_items, $active_item)\n{\n\tforeach ($nav_items as $key => $val)\n\t{ \n\t\t$li = \"<li\";\n\t\tif ($active_item == $val['text']) \n\t\t{\n\t\t\t$li .= \" class=\\\"active\\\" \";\n\t\t}\n\t\t$li .= \">\";\n\t\t$li .= \"<a href=\\\"\" . $val['url'] . \"\\\" accesskey=\\\"\". $val['accesskey'] . \"\\\" title=\\\"\" . $val['title'] . \"\\\">\";\n\t\t$li .= $val['text'] . \"</a></li>\\n\";\n\t\techo \"\\t\\t\" . $li;\n\t}\n\n\n\n}", "function menu($keyword) {\n\n\tif (strpos(basename($_SERVER['PHP_SELF']), $keyword) !== false) {\n echo \"class=\\\"active\\\"\";\n\t} else {\n\t\techo \"\";\n\t}\n}", "public function getTerms($vocab_name) {\n $vocabulary_name = $vocab_name; //name of your vocabulary\n $query = \\Drupal::entityQuery('taxonomy_term');\n $query->condition('vid', $vocabulary_name);\n $query->sort('weight');\n $tids = $query->execute();\n $terms = Term::loadMultiple($tids);\n $output = '<ul class=\"integration-filters\"><li><a class=\"*\" href=\"\">All Integrations</a></li>';\n foreach($terms as $term) {\n $name = $term->getName();;\n $output .='<li><a class=\"'.str_replace(' ', '', $name).'\" href=\"\">'.$name.'</a></li>';\n }\n $output .= '</ul>';\n print $output;\n }", "function fr_dropdown_comics(){\n\t\t\techo '<div class=\"selector\" onclick=\"toggleMenu(this)\">manga: '.fr_selected_comic();\n\t\t\techo '<div class=\"options\">';\n \tforeach(fr_available_comics() as $key=>$value){\n \t\techo \"<a title='\".$value.\"' href='\".fr_get_href($value).\"'><div class='option'>$value</div></a>\";\n \t}\n \techo '</div></div>';\n\t}", "function print_navbar($navbar)\n{\n global $config;\n\n $id = strgen();\n\n ?>\n\n <div class=\"navbar <?php echo $navbar['class']; ?>\">\n <div class=\"navbar-inner\">\n <div class=\"container\">\n <button type=\"button\" class=\"btn btn-navbar\" data-toggle=\"collapse\" data-target=\"#nav-<?php echo $id; ?>\">\n <span class=\"oicon-bar\"></span>\n </button>\n\n <?php\n\n if (isset($navbar['brand'])) { echo ' <a class=\"brand\">'.$navbar['brand'].'</a>'; }\n echo('<div class=\"nav-collapse\" id=\"nav-'.$id.'\">');\n\n foreach (array('options', 'options_right') as $array_name)\n {\n if ($array_name == \"options_right\") {\n if (!$navbar[$array_name]) { break; }\n echo('<ul class=\"nav pull-right\">');\n } else {\n echo('<ul class=\"nav\">');\n }\n foreach ($navbar[$array_name] as $option => $array)\n {\n if ($array[''] == \"pull-right\") {\n $navbar['options_right'][$option] = $array;\n } else {\n if (!is_array($array['suboptions']))\n {\n echo('<li class=\"'.$array['class'].'\">');\n echo('<a href=\"'.$array['url'].'\">');\n if (isset($array['icon'])) { echo('<i class=\"'.$array['icon'].'\"></i> '); }\n echo($array['text'].'</a>');\n echo('</li>');\n } else {\n echo(' <li class=\"dropdown\">');\n echo(' <a class=\"dropdown-toggle\" data-toggle=\"dropdown\" href=\"'.$array['url'].'\">');\n if (isset($array['icon'])) { echo('<i class=\"'.$array['icon'].'\"></i> '); }\n echo($array['text'].'\n <b class=\"caret\"></b>\n </a>\n <ul class=\"dropdown-menu\">');\n foreach ($array['suboptions'] as $suboption => $subarray)\n {\n echo('<li class=\"'.$subarray['class'].'\">');\n echo('<a href=\"'.$subarray['url'].'\">');\n if (isset($subarray['icon'])) { echo('<i class=\"'.$subarray['icon'].'\"></i> '); }\n echo($subarray['text'].'</a>');\n echo('</li>');\n }\n echo(' </ul>\n </li>');\n }\n }\n }\n echo('</ul>');\n }\n\n ?>\n </div>\n </div>\n </div>\n </div>\n\n <?php\n\n}", "function termSelectBuilder()\n {\n if( !isset($GLOBALS['BannerStudent']) ){\n require_once('BannerStudent.class.php');\n $GLOBALS['BannerStudent'] = new BannerStudent( PSU::db('banner') );\n }\n\n $ugterm = $GLOBALS['BannerStudent']->reslifeCurrentTerm('UG');\n $gterm = $GLOBALS['BannerStudent']->reslifeCurrentTerm('GR');\n\n $label = $this->getSemName($ugterm);\n\n $currentArray[$ugterm.\"/\".$gterm] = 'Current: '.$label;\n\n $past = $this->oldTerms();\n $future = $this->nextTerms();\n return array_merge($currentArray, $future, $past);\n }", "function dropdown_select_term($subIdent, $kwargs=null) {\n // This variable ensures that multiple calls in\n // the same form or file won't interfere\n static $id = 0;\n $id++;\n\n // Default values\n $view_only_alert = false;\n $all_terms = false;\n\n // Read from kwargs if necessary\n if ($kwargs) {\n if (isset($kwargs['view_only_alert'])) {\n $view_only_alert = $kwargs['view_only_alert'];\n }\n if (isset($kwargs['all_terms'])) {\n $all_terms = $kwargs['all_terms'];\n }\n }\n\n // First we gather the terms and convert them to an array\n if ($all_terms) {\n if (!($result = term_retrieve_by_start($kwargs))) {\n return false;\n } else if (!($terms = pg_fetch_all($result))) {\n return false;\n }\n } else {\n if (!($result = term_retrieve_visible_by_start($kwargs))) {\n return false;\n } else if (!($terms = pg_fetch_all($result))) {\n return false;\n }\n }\n\n // Output HTML for the dropdown menu using our gathered terms\n // The caller must provide the form initialization and\n // submission button/object\n echo \"<select class=\\\"form-control\\\" name=\\\"formTerm\" . $id . \"\\\">\\n\";\n echo \"<option value=\\\"\\\">Please select a term...</option>\\n\";\n foreach ($terms as $term) {\n if ($view_only_alert and $term['editable'] == \"f\") {\n echo \"<option value=\" . $term['term_id'] . \">\" . $term['term_name'] . \" -- VIEW ONLY</option>\\n\";\n } else {\n echo \"<option value=\" . $term['term_id'] . \">\" . $term['term_name'] . \"</option>\\n\";\n }\n }\n echo \"</select>\\n\";\n\n // Check to see if the user has selected a term, and then\n // return the array holding the data\n if (isset($_POST[$subIdent])) {\n $selected = $_POST['formTerm' . $id];\n\n if (!empty($selected)) {\n $query = \"SELECT * FROM term\n WHERE term_id=$1\n LIMIT 1\";\n if (!($result = pg_query_params($GLOBALS['CONNECTION'], $query, array($selected)))) {\n return false;\n }\n $term = pg_fetch_array($result);\n return $term;\n }\n }\n}", "function mtm_terms_from_taxonomy_links( $tax = '' ){\n\n $terms = get_terms( $tax );\n\n if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {\n $count = count( $terms );\n $i = 0;\n $term_list = '<ul class=\"mtm-component--term-list\">';\n foreach ( $terms as $term ) {\n $i++;\n $term_list .= '<li><a href=\"' . get_term_link( $term ) . '\" title=\"' . sprintf( __( 'View all filed under %s', 'my_localization_domain' ), $term->name ) . '\" data-id=\"' . $term->term_id . '\">' . $term->name . '</a></li>';\n if ( $count != $i ) {\n $term_list .= ' ';\n }\n else {\n $term_list .= '</ul>';\n }\n }\n echo $term_list;\n }\n}", "function sd_edd_downloads_shortcode_display_terms() {\n\t\n\t// use \"download_category\" for categories and \"download_tag\" for tags\n the_terms( $post->ID, 'download_category', '<span class=\"download-terms-label\">Categories:</span> ', ', ', '' );\n}", "function taxonomy_term_page($term){\n if($term->vid == 28){\n $query = db_select(\"field_data_field_bool\" , \"field_bool\");\n $query->fields(\"field_bool\" , array(\"field_bool_value\"));\n $query->condition(\"field_bool.entity_type\" , \"taxonomy_term\");\n $query->condition(\"field_bool.bundle\" , \"expert\");\n $query->condition(\"field_bool.entity_id\" , $term->tid);\n $bool = $query->execute()->fetch();\n global $user;\n if((empty($bool) || $bool->field_bool_value == 0) && !in_array(\"administrator\" , $user->roles)){\n drupal_access_denied();\n module_invoke_all('exit');\n drupal_exit();\n }\n }\n // If there is a menu link to this term, the link becomes the last part of\n // the active trail, and the link name becomes the page title. Thus, we must\n // explicitly set the page title to be the term title.\n drupal_set_title($term->name);\n // Build breadcrumb based on the hierarchy of the term.\n $current = (object) array(\n 'tid' => $term->tid,\n );\n // @todo This overrides any other possible breadcrumb and is a pure hard-coded\n // presumption. Make this behavior configurable per vocabulary or term.\n $breadcrumb = array();\n while ($parents = taxonomy_get_parents($current->tid)) {\n $current = array_shift($parents);\n $breadcrumb[] = l($current->name, 'taxonomy/term/' . $current->tid);\n }\n $breadcrumb[] = l(t('Home'), NULL);\n $breadcrumb = array_reverse($breadcrumb);\n drupal_set_breadcrumb($breadcrumb);\n drupal_add_feed('taxonomy/term/' . $term->tid . '/feed', 'RSS - ' . $term->name);\n // Set the term path as the canonical URL to prevent duplicate content.\n $uri = entity_uri('taxonomy_term', $term);\n drupal_add_html_head_link(array('rel' => 'canonical', 'href' => url($uri['path'], $uri['options'])), TRUE);\n // Set the non-aliased path as a default shortlink.\n drupal_add_html_head_link(array('rel' => 'shortlink', 'href' => url($uri['path'], array_merge($uri['options'], array('alias' => TRUE)))), TRUE);\n\n // Normally we would call taxonomy_term_show() here, but for backwards\n // compatibility in Drupal 7 we do not want to do that (it produces different\n // data structures and HTML markup than what Drupal 7 released with). Calling\n // taxonomy_term_view() directly provides essentially the same thing, but\n // allows us to wrap the rendered term in our desired array structure.\n $build['term_heading'] = array(\n '#prefix' => '<div class=\"term-listing-heading\">',\n '#suffix' => '</div>',\n 'term' => taxonomy_term_view($term, 'full'),\n );\n\n if($term->vid == 28) {//tags vocabulary\n $query = db_select(\"taxonomy_index\", \"t_index\");\n $query->join(\"node\", \"node\", \"node.nid = t_index.nid\");\n $query->fields(\"node\", array(\"nid\", \"type\"));\n $query->condition(\"t_index.tid\", $term->tid);\n $query->condition(\"node.status\" , 1);\n $contents = $query->execute()->fetchAll();\n if (!empty($contents)) {\n $nodes = array();\n foreach ($contents as $content) {\n if (!isset($nodes[$content->type])) $nodes[$content->type] = array();\n array_push($nodes[$content->type], $content->nid);\n }\n $sort = array(\"gallerynew\" , \"film\" , \"designteam\" , \"article\" , \"podcast\" , \"publication\" , \"blog\" , \"education\" , \"college\" , \"product\" , \"questions\");\n $sorted = array();\n foreach ($sort as $type) {\n if(!empty($nodes[$type]))\n $sorted[$type] = $nodes[$type];\n }\n foreach ($sorted as $type => $nids) {\n $name = db_select(\"node_type\")->fields(\"node_type\", array(\"name\"))->condition(\"type\", $type)->execute()->fetch()->name;\n $view_mode = \"question\";\n if (\n strcmp($type, \"gallerynew\") == 0 ||\n strcmp($type, \"film\") == 0 ||\n strcmp($type, \"questions\") == 0 ||\n strcmp($type, \"product\") == 0\n ) {\n $view_mode = \"teaser\";\n }\n $nodes = node_load_multiple($nids);\n if (!isset($build[$type])) $build[$type] = array();\n $build[$type][\"#prefix\"] = '<div id=\"' . $type . '\" class=\"node-type-relative\"><h2 class=\"field-label\">' . $name . '</h2><div class=\"field-items\">';\n $build[$type][\"#suffix\"] = ($type == \"questions\") ? '</div><div> <a href=\"/question/list\" class=\"btn blue-btn qa-btn has-wave\" target=\"_blank\">ورود به بخش پرسش و پاسخ</a> </div></div>' : '</div></div>';\n $build[$type][\"term\"] = node_view_multiple($nodes, $view_mode);\n }\n\n }\n else {\n $build['no_content'] = array(\n '#prefix' => '<p>',\n '#markup' => t('There is currently no content classified with this term.'),\n '#suffix' => '</p>',\n );\n }\n\n //add users of taxonomy term which isn't provided by default\n\t $build[\"experts\"] = array(\n\t\t \"#prefix\" => '<div id=\"advisors\" class=\"node-type-relative\"><h2 class=\"field-label\">مشاوران این تخصص</h2><div class=\"field-items\">',\n\t\t \"#suffix\" => views_embed_view('user_experts', 'pedia_experts_advisors', $term->tid) .'</div></div>',\n\t\t \"term\" => ''\n\t );\n\t $build[\"users\"] = array(\n\t\t \"#prefix\" => '<div id=\"users\" class=\"node-type-relative\"><h2 class=\"field-label\">کاربران</h2><div class=\"field-items\">',\n\t\t \"#suffix\" => views_embed_view('user_experts', 'pedia_experts_users', $term->tid) .'</div></div>',\n\t\t \"term\" => '',\n\t );\n }else{ //default taxonomy terms page output\n if ($nids = taxonomy_select_nodes($term->tid, TRUE, variable_get('default_nodes_main', 10))) {\n $nodes = node_load_multiple($nids);\n $build += node_view_multiple($nodes);\n $build['pager'] = array(\n '#theme' => 'pager',\n '#weight' => 5,\n );\n }\n else {\n $build['no_content'] = array(\n '#prefix' => '<p>',\n '#markup' => t('There is currently no content classified with this term.'),\n '#suffix' => '</p>',\n );\n }\n }\n return $build;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the id_cms_news property
public function getIdCmsNews() { return $this->id_cms_news; }
[ "public function getId_news()\n {\n return $this->id_news;\n }", "public function getIdNews()\n {\n return $this->id_news;\n }", "public function getIdNews()\n\t{\n\t\treturn $this->id_news;\n\t}", "public function getNewsIdnews()\n {\n return $this->news_idNews;\n }", "private function getNewsId()\n {\n $news = explode('_', $this->item->find(' .views ')->attr('id'));\n $this->id = $news[5];\n \n return $this->id;\n }", "public function getNewsIdParameter()\n {\n return $this->news_id_parameter;\n }", "public function getIdNewsType()\n\t{\n\t\treturn $this->id_news_type;\n\t}", "public function setId_news($id_news)\n {\n $this->id_news = $id_news;\n \n return $this;\n }", "public function getNews() {\n\t\treturn $this->news;\n\t}", "public function setId_news($id_news)\n {\n $this->id_news = $id_news;\n\n return $this;\n }", "public function setIdNews($id_news)\n\t{\n\t\t$this->id_news = $id_news;\n\t\treturn $this;\n\t}", "function setNewsId($iNewsId) {\n \n if (is_int($iNewsId)) {\n \n $this->_iNewsId = $iNewsId;\n }\n }", "public function getIsnews()\n {\n return $this->isnews;\n }", "public function getNewsItemById($id) {\r\n return $this->em->getRepository('entities\\News')->findOneById((int)$id);\r\n }", "public function setIdnews($idNews)\n {\n $this->idNews = $idNews;\n\n return $this;\n }", "public function getNewsletterId()\n {\n return isset($this->NewsletterId) ? $this->NewsletterId : null;\n }", "public static function getNewsIdFromNewsUrl($link)\n\t{\n\t\t$id = substr($link, -9, 8);\n\t\treturn $id;\n\t}", "public function getIdArticle()\n {\n return $this->idArticle;\n }", "public function getId_article()\n {\n return $this->id_article;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setter for the file's download URL
public function setDownloadUrl($value) { $this->downloadUrl = $value; }
[ "public function setDownloadUrl(string $url);", "public function setDownloadUrl($url);", "public function getDownloadUrl()\n {\n return $this->downloadUrl;\n }", "public function getDownloadUrl()\n {\n return $this->DownloadUrl;\n }", "public function getDownloadUrl()\n {\n return $this->download_url;\n }", "static public function get_download_url() {\r\n\t\t\treturn self::$url_download;\r\n\t\t}", "public function getDownloadUri() {\n return $this->attributes['download_uri'];\n }", "public function getDownloadUrl(): string\n {\n return $this->download_url;\n }", "public function setDownloadUrl(string $downloadUrl)\n\t{\n\t\t$this->downloadUrl=$downloadUrl; \n\t\t$this->keyModified['download_Url'] = 1; \n\n\t}", "public function setDownloadUrl(string $downloadUrl)\n\t{\n\t\t$this->downloadUrl=$downloadUrl; \n\t\t$this->keyModified['download_url'] = 1; \n\n\t}", "public function getDownloadLink()\n {\n return $this->download_link;\n }", "public function getDownloadLinkAttribute()\n {\n if ($this->url) {\n return $this->url;\n } else if ($this->file) {\n return $this->file_link;\n }\n\n return '';\n }", "public function setDownload($v)\n\t{\n\n\t\tif ($this->download !== $v || $v === false) {\n\t\t\t$this->download = $v;\n\t\t\t$this->modifiedColumns[] = FilePeer::DOWNLOAD;\n\t\t}\n\n\t}", "public function setDownloadUrl(?string $downloadUrl)\n {\n $this->downloadUrl = $downloadUrl;\n }", "public function set_download($value)\r\n\t{\r\n\t\treturn $this->set_attr('download', $value);\r\n\t}", "public function getCustomDownloadUrl()\n {\n return $this->_customOptionDownloadUrl;\n }", "public function getDownloadsUrl()\n {\n return $this->downloadsUrl;\n }", "function setDownload($value)\n {\n $this->setAttribute(\"download\", $value);\n return $this;\n }", "public function getDownloadLink();" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Filters the list of nodes with an XPath expression.
public function filterXPath($xpath): static { return parent::filterXPath($xpath); }
[ "protected function _filterNode($nodeList, $filter) {}", "public function filter($selector)\n {\n if (is_string($selector)) {\n $selector = new Selector($selector);\n }\n\n $list = new NodeList($this->_node);\n\n foreach ($this as $node) {\n if ($node->matches($selector)) {\n $list->add($node);\n }\n }\n return $list;\n }", "public static function selectNodes($pNode, $xPath) // <- Retorna N&#65533;!\r\n\t{\r\n\t\tif (substr($xPath, 0, 1) == \"/\")\r\n\t\t{\r\n\t\t\t$xPath = substr($xPath, 1);\r\n\t\t}\r\n\r\n\t\t$owner = XmlUtilKernel::getOwnerDocument($pNode);\r\n\t\t$domXPath = new DOMXPath($owner);\r\n\t\t$rNodeList = $domXPath->query($xPath, $pNode);\r\n\r\n\t\treturn $rNodeList;\r\n\t}", "function filterFiles($files, $xpath, $value) {\n $search = explode('+', $value);\n $keep_files = array();\n foreach ($files as $file) {\n $xml_file = file_get_contents($file['path']);\n $xmlDoc = new SimpleXMLElement($xml_file);\n $namespaces = $xmlDoc->getDocNamespaces(true);\n foreach ($namespaces as $key=>$value) {\n $xmlDoc->registerXPathNamespace($key, $value);\n }\n $elts = $xmlDoc->xpath($xpath);\n $count = 0;\n foreach ($search as $s) {\n $match = false;\n foreach ($elts as $elt) { \n // echo trim(_removeAccents($elt)) . ' - ' . trim(_removeAccents($s));\n if (stripos(trim(_removeAccents($elt)), trim(_removeAccents($s))) !== false) {\n $match = true;\n }\n }\n if ($match) {\n $count++;\n }\n }\n if ($count == count($search)) {\n $keep_files[] = $file;\n }\n }\n return $keep_files;\n}", "public function removeNodesMatchingXPath($path)\r\n {\r\n $nodesToRemove = $this->simpleXMLElement->xpath($path);\r\n\r\n foreach ($nodesToRemove as $nodeToRemove) {\r\n unset($nodeToRemove[0]);\r\n }\r\n }", "function getChildsByXPath($xpath){\n\t\t\n\t\t// xPath object\n\t\t$xpathObj = new DOMXPath($this->doc);\n\t\t$xpathMatches = @$xpathObj->query(\"$xpath\");\n\t\t\n\t\t$allMatchs= array();\n\t\t\n\t\tif($xpathMatches == false) return $allMatchs;\n\t\t\n\t\tforeach ($xpathMatches as $element) {\n\t\t\t\n\t\t\t\n\t\t\t$matchHtml = array(); // single match html\n \t\t\t\t\n\t\t\t\t$nodes = $element->childNodes;\n\t\t\t\t\n\t\t\t\tforeach ($nodes as $node) {\n\t\t\t\t\t\n\t\t\t\t\t$matchHtml[] = $this->doc->saveHTML($node) ;\n\t\t\t\t}\n\t\t\t \n\t\t\t$allMatchs[] = $matchHtml;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $allMatchs;\n\t\t\n\t}", "protected function getNodes($xpathExpression)\n {\n $document = new DOMDocument();\n $document->load($this->file);\n $xpath = new DOMXpath($document);\n\n return $xpath->query($xpathExpression);\n }", "public function getFilteredTextNodes(): array\n {\n if (null === $this->filteredTextNodes) {\n $this->analyse();\n }\n return $this->filteredTextNodes;\n }", "public function getNodes() {\n $selector = $this->getSelector();\n\n $this->getCrawler()->clear();\n $this->getCrawler()->addContent($this->getContent());\n\n $elements = $this->eqFilterWrapper($this->getCrawler(), $selector);\n\n if (0 === $elements->count()) {\n return null;\n }\n\n return $elements;\n }", "public function xpath ($path) {}", "protected function checkXPathExpressions(DOMElement $template): void\n\t{\n\t\tforeach ($this->getXPathExpressions($template) as $expr)\n\t\t{\n\t\t\t$this->checkXPathExpression($expr);\n\t\t}\n\t}", "function filterChildren($callback);", "abstract public function filtered(): AbstractElement;", "public function testQueryReturnsNodelist() {\n $list = $this->node->query('//node');\n $this->assertInstanceOf('DOMNodelist', $list);\n $this->assertEquals(2, $list->length);\n }", "function xpath($path) {\n\t\treturn $this->_modulexml->xpath($path);\n\t}", "public function toXPath()\n {\n $xpath = [];\n\n foreach ($this->filters as $filter) {\n\n if (isset($filter['builder'])) {\n $xpath[] = $this->compileNested($filter);\n\n } elseif ($this->isFunction($filter['operator'])) {\n $xpath[] = $this->compileFunction($filter);\n\n } else {\n $xpath[] = $this->compileFilter($filter);\n }\n }\n\n return $this->stripLeadingBoolean(implode(' ', $xpath));\n }", "public function find($nodes, callable $filter) : array {\n if (!is_array($nodes)) {\n $nodes = [$nodes];\n }\n\n $visitor = new FindingVisitor($filter);\n\n $traverser = new NodeTraverser;\n $traverser->addVisitor($visitor);\n $traverser->traverse($nodes);\n\n return $visitor->getFoundNodes();\n }", "public function testExposedFilter() {\n $node_type = $this->drupalCreateContentType(['type' => 'page']);\n\n // Create the tag field itself.\n $field_name = 'taxonomy_tags';\n $this->createEntityReferenceField('node', $node_type->id(), $field_name, NULL, 'taxonomy_term');\n\n // Create 4 nodes: 1 without a term, 2 with the same term, and 1 with a\n // different term.\n $node1 = $this->drupalCreateNode();\n $node2 = $this->drupalCreateNode([\n $field_name => [['target_id' => $this->terms[1][0]->id()]],\n ]);\n $node3 = $this->drupalCreateNode([\n $field_name => [['target_id' => $this->terms[1][0]->id()]],\n ]);\n $node4 = $this->drupalCreateNode([\n $field_name => [['target_id' => $this->terms[2][0]->id()]],\n ]);\n\n // Only the nodes with the selected term should be shown.\n $this->drupalGet('test-filter-taxonomy-index-tid');\n $this->assertSession()->pageTextNotContains($node1->getTitle());\n $this->assertSession()->linkByHrefNotExists($node1->toUrl()->toString());\n $xpath_node2_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node2->toUrl()->toString(),\n ':label' => $node2->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node2_link, 1);\n $xpath_node3_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node3->toUrl()->toString(),\n ':label' => $node3->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node3_link, 1);\n $this->assertSession()->pageTextNotContains($node4->getTitle());\n $this->assertSession()->linkByHrefNotExists($node4->toUrl()->toString());\n\n // Expose the filter.\n $this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid');\n $this->submitForm([], 'Expose filter');\n // Set the operator to 'empty' and remove the default term ID.\n $this->submitForm([\n 'options[operator]' => 'empty',\n 'options[value][]' => [],\n ], 'Apply');\n // Save the view.\n $this->submitForm([], 'Save');\n\n // After switching to 'empty' operator, the node without a term should be\n // shown.\n $this->drupalGet('test-filter-taxonomy-index-tid');\n $xpath_node1_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node1->toUrl()->toString(),\n ':label' => $node1->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node1_link, 1);\n $this->assertSession()->pageTextNotContains($node2->getTitle());\n $this->assertSession()->linkByHrefNotExists($node2->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node3->getTitle());\n $this->assertSession()->linkByHrefNotExists($node3->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node4->getTitle());\n $this->assertSession()->linkByHrefNotExists($node4->toUrl()->toString());\n\n // Set the operator to 'not empty'.\n $this->drupalGet('admin/structure/views/nojs/handler/test_filter_taxonomy_index_tid/default/filter/tid');\n $this->submitForm(['options[operator]' => 'not empty'], 'Apply');\n // Save the view.\n $this->submitForm([], 'Save');\n\n // After switching to 'not empty' operator, all nodes with terms should be\n // shown.\n $this->drupalGet('test-filter-taxonomy-index-tid');\n $this->assertSession()->pageTextNotContains($node1->getTitle());\n $this->assertSession()->linkByHrefNotExists($node1->toUrl()->toString());\n $xpath_node2_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node2->toUrl()->toString(),\n ':label' => $node2->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node2_link, 1);\n $xpath_node3_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node3->toUrl()->toString(),\n ':label' => $node3->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node3_link, 1);\n $xpath_node4_link = $this->assertSession()->buildXPathQuery('//div[@class=\"views-row\"]//a[@href=:url and text()=:label]', [\n ':url' => $node4->toUrl()->toString(),\n ':label' => $node4->label(),\n ]);\n $this->assertSession()->elementsCount('xpath', $xpath_node4_link, 1);\n\n // Select 'Term ID' as the field to be displayed.\n $edit = ['name[taxonomy_term_field_data.tid]' => TRUE];\n $this->drupalGet('admin/structure/views/nojs/add-handler/test_taxonomy_term_name/default/field');\n $this->submitForm($edit, 'Add and configure fields');\n // Select 'Term' and 'Vocabulary' as filters.\n $edit = [\n 'name[taxonomy_term_field_data.tid]' => TRUE,\n 'name[taxonomy_term_field_data.vid]' => TRUE,\n ];\n $this->drupalGet('admin/structure/views/nojs/add-handler/test_taxonomy_term_name/default/filter');\n $this->submitForm($edit, 'Add and configure filter criteria');\n // Select 'Empty Vocabulary' and 'Autocomplete' from the list of options.\n $this->drupalGet('admin/structure/views/nojs/handler-extra/test_taxonomy_term_name/default/filter/tid');\n $this->submitForm([], 'Apply and continue');\n // Expose the filter.\n $edit = ['options[expose_button][checkbox][checkbox]' => TRUE];\n $this->drupalGet('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/tid');\n $this->submitForm($edit, 'Expose filter');\n $this->drupalGet('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/tid');\n $this->submitForm($edit, 'Apply');\n // Filter 'Taxonomy terms' belonging to 'Empty Vocabulary'.\n $edit = ['options[value][empty_vocabulary]' => TRUE];\n $this->drupalGet('admin/structure/views/nojs/handler/test_taxonomy_term_name/default/filter/vid');\n $this->submitForm($edit, 'Apply');\n $this->drupalGet('admin/structure/views/view/test_taxonomy_term_name/edit/default');\n $this->submitForm([], 'Save');\n $this->submitForm([], 'Update preview');\n $this->assertSession()->pageTextNotContains($node1->getTitle());\n $this->assertSession()->linkByHrefNotExists($node1->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node2->getTitle());\n $this->assertSession()->linkByHrefNotExists($node2->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node3->getTitle());\n $this->assertSession()->linkByHrefNotExists($node3->toUrl()->toString());\n $this->assertSession()->pageTextNotContains($node4->getTitle());\n $this->assertSession()->linkByHrefNotExists($node4->toUrl()->toString());\n $this->assertSession()->elementNotExists('xpath', \"//div[@class='views-row']\");\n }", "function theme_sirtaqui_content_listing_nodes_filter($element) {\n\n $output = \"\";\n \n $rows = array();\n\n $tnids = $element['tnids'];\n unset($element['tnids']);\n \n if($tnids['#num_selected'] > 0) {\n $output .= \"<div><strong>\" . format_plural($tnids['#num_selected'], '1 node selected', '@count nodes selected') . \n \" \" . t(\"on @count\", array('@count' => count(element_children($tnids)))) . \"</strong></div>\";\n }\n\n foreach(element_children($element) as $nid) {\n $row = array();\n\n $node = $element[$nid];\n\n $row[] = drupal_render($tnids[$node['#tnid']]);\n $row[] = drupal_render($node['title']);\n $row[] = drupal_render($node['fnid']);\n $row[] = drupal_render($node['type']);\n $row[] = drupal_render($node['status']);\n\n $rows[] = array('data' => $row, 'class' => ($node['#outline'] ? 'ok' : ''));\n }\n\n $headers = array(theme('table_select_header_cell'), t(\"Title\"), \"#ID\", t(\"Type\"), t(\"Status\"));\n\n $output .= theme('table', $headers, $rows, array('class' => 'system-status-report'));\n \n return $output;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Runs a SQL query for the next bulk cycle and populates properties
private static function get_delivery_info_next() { // If the query has been run, no need to run it again if (self::$next_query_complete) { return; } global $connection; // Set up for pulling only order cycles appropriate to the current customer_type permissions // Allow "bulk_admin" direct access to all order cycles $customer_type_query = (CurrentMember::auth_type('bulk_admin') ? '1' : '0'); if (CurrentMember::auth_type('member')) $customer_type_query .= ' OR customer_type LIKE "%member%"'; if (CurrentMember::auth_type('institution')) $customer_type_query .= ' OR customer_type LIKE "%institution%"'; debug_print('INFO: In bulk get_next_delivery_info; running query.', array()); $query = ' SELECT delivery_id, delivery_date, date_open, date_closed, order_fill_deadline, retail_markup / 100 AS retail_markup FROM '.TABLE_ORDER_CYCLES.' WHERE is_bulk = 1 AND date_open >= "'.date('Y-m-d H:i:s', time()).'" AND date_closed >= date_open ORDER BY date_open DESC LIMIT 1'; $result = @mysql_query($query, $connection) or die(debug_print ("ERROR: 863024 ", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__)); if ($row = mysql_fetch_object ($result)) { self::$delivery_id_next = $row->delivery_id; self::$delivery_date_next = $row->delivery_date; self::$date_open_next = $row->date_open; self::$date_closed_next = $row->date_closed; self::$order_fill_deadline_next = $row->order_fill_deadline; self::$retail_markup_next = $row->retail_markup; } else { self::$delivery_id_next = 0; self::$delivery_date_next = self::$date_open_next = self::$date_closed_next = self::$order_fill_deadline_next = ''; self::$retail_markup_next = 0; } self::$next_query_complete = true; }
[ "public function rebuildPropertyInfo() {\n\t\t$dbw = $this->propertyInfoTable->getWriteConnection();\n\n\t\t$rowId = $this->fromId - 1;\n\n\t\t$total = 0;\n\n\t\t$join = array();\n\t\t$tables = array( 'wb_entity_per_page' );\n\n\t\tif ( !$this->shouldUpdateAllEntities ) {\n\t\t\t// Find properties in wb_entity_per_page with no corresponding\n\t\t\t// entry in wb_property_info.\n\n\t\t\t$piTable = $this->propertyInfoTable->getTableName();\n\n\t\t\t$tables[] = $piTable;\n\t\t\t$join[$piTable] = array( 'LEFT JOIN',\n\t\t\t\tarray(\n\t\t\t\t\t'pi_property_id = epp_entity_id',\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\twhile ( true ) {\n\t\t\t// Make sure we are not running too far ahead of the slaves,\n\t\t\t// as that would cause the site to be rendered read only.\n\t\t\twfWaitForSlaves();\n\n\t\t\tif ( $this->useTransactions ) {\n\t\t\t\t$dbw->begin();\n\t\t\t}\n\n\t\t\t//FIXME: use an EntityIdPager from EntityPerPage\n\t\t\t$props = $dbw->select(\n\t\t\t\t$tables,\n\t\t\t\tarray(\n\t\t\t\t\t'epp_entity_id',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'epp_entity_type = ' . $dbw->addQuotes( Property::ENTITY_TYPE ),\n\t\t\t\t\t'epp_entity_id > ' . (int) $rowId,\n\t\t\t\t\t'epp_redirect_target IS NULL',\n\t\t\t\t\t$this->shouldUpdateAllEntities ? '1' : 'pi_property_id IS NULL', // if not $all, only add missing entries\n\t\t\t\t),\n\t\t\t\t__METHOD__,\n\t\t\t\tarray(\n\t\t\t\t\t'LIMIT' => $this->batchSize,\n\t\t\t\t\t// XXX: We currently have a unique key defined as `wb_epp_entity` (`epp_entity_id`,`epp_entity_type`).\n\t\t\t\t\t// This SHOULD be the other way around: `wb_epp_entity` (`epp_entity_type`, `epp_entity_id`).\n\t\t\t\t\t// Once this is fixed, the below should probable be changed to:\n\t\t\t\t\t// 'ORDER BY' => 'epp_entity_type ASC, epp_entity_id ASC'\n\t\t\t\t\t'ORDER BY' => 'epp_entity_id ASC',\n\t\t\t\t\t'FOR UPDATE'\n\t\t\t\t),\n\t\t\t\t$join\n\t\t\t);\n\n\t\t\t$c = 0;\n\n\t\t\tforeach ( $props as $row ) {\n\t\t\t\t$id = PropertyId::newFromNumber( (int)$row->epp_entity_id );\n\t\t\t\t$this->updatePropertyInfo( $id );\n\n\t\t\t\t$rowId = $row->epp_entity_id;\n\t\t\t\t$c++;\n\t\t\t}\n\n\t\t\tif ( $this->useTransactions ) {\n\t\t\t\t$dbw->commit();\n\t\t\t}\n\n\t\t\t$this->reportMessage( \"Updated $c properties, up to ID $rowId.\" );\n\t\t\t$total += $c;\n\n\t\t\tif ( $c < $this->batchSize ) {\n\t\t\t\t// we are done.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $total;\n\t}", "public function fetch() {\r\n\t $class = $this->table;\r\n\t $data = \\Idk\\Database::getInstance()->orm->queryWriter->selectAllByCritWithSQL($class, $this->column, $this->entity->id, $this->orderBy . $this->order . $this->limit);\r\n\t $returnValues = array();\r\n\t\tforeach($data as $item) {\r\n\t\t\t$refClass = new ReflectionClass($class);\r\n\t\t\t\r\n\t\t\t$object = new $class();\r\n\t\t\t$object->id = $item['id'];\r\n\t\t\t$properties = $refClass->getProperties();\r\n\t\t\tIDKModel::initiateValues($object, $properties, $item);\r\n\t\t\t$returnValues[] = $object;\r\n\t\t}\r\n\t\t$this->_elements = $returnValues;\r\n \t$this->state = 1;\r\n\t}", "protected function _query() {\n $this->query = db_query($this->stm_0, [\n ':start' => $this->start,\n ':stop' => $this->stop,\n ], [\n 'fetch' => \\PDO::FETCH_NAMED,\n ]\n );\n }", "private function bulkUpdate()\n {\n foreach ($this->fetchRecords() as $record) {\n $this->rowsAffected += $this->resourceConnection\n ->getConnection()\n ->update(\n $this->resourceConnection->getTableName($this->tableName),\n $this->getUpdateBindings($record[$this->getBindKey()]),\n $this->getUpdateWhereClause($record[$this->getWhereKey()])\n );\n }\n }", "public function do_populate() {\n $diff1Day = new DateInterval('P1D');\n\n // We need to have aggregated data starting from Jan 1, 2014\n $chunk_datetime_start = new DateTime('2014-01-01 00:00:00');\n\n // We need to aggregate data up to yesterday\n $current_datetime = new DateTime('NOW');\n $current_datetime->sub($diff1Day);\n\n // Entire aggregation process should be done inside a transation so that we do not have half baked statistics\n if(!$this->run_db_query('START TRANSACTION'))\n return false;\n\n // Setup the table that stores the statistics cron run time\n if(!$this->init_cron_runtime_table($current_datetime->format('Y-m-d H:i:s')))\n return false;\n\n // Keep running aggregation until we have not aggregated\n // all the data up to yesterday\n while (true) {\n $chunk_datetime_end = new DateTime($chunk_datetime_start->format('Y-m-d H:i:s'));\n $chunk_datetime_end->add($diff1Day);\n\n if ($chunk_datetime_end >= $current_datetime)\n break;\n\n // generate and execute aggregation queries\n foreach ($this->metric_index as $key => $value) {\n $chunk_datetime_start_str = $chunk_datetime_start->format('Y-m-d H:i:s');\n $chunk_datetime_end_str = $chunk_datetime_end->format('Y-m-d H:i:s');\n\n if (!$this->run_minutely_aggregation_query($key, $chunk_datetime_start_str, $chunk_datetime_end_str))\n return $this->rollback_trx();\n\n if (!$this->run_hourly_aggregation_query($key, $chunk_datetime_start_str, $chunk_datetime_end_str))\n return $this->rollback_trx();\n\n if (!$this->run_daily_aggregation_query($key, $chunk_datetime_start_str, $chunk_datetime_end_str))\n return $this->rollback_trx();\n\n if (!$this->run_monthly_aggregation_query($key, $chunk_datetime_start_str, $chunk_datetime_end_str))\n return $this->rollback_trx();\n }\n\n // We reset start datetime to the end datetime\n // so that we can process the next chunk of data\n $chunk_datetime_start = $chunk_datetime_end;\n }\n\n // Update the table that stores the statistics cron run time\n if(!$this->update_cron_runtime_table($current_datetime->format('Y-m-d H:i:s')))\n return false;\n\n if(!$this->run_db_query(\"COMMIT\"))\n return false;\n\n return true;\n }", "public function run()\n\t{\n\t\tLogger::debug('PDO Query', $this -> query );\n\t\tLogger::debug('PDO Data', print_r($this -> query_data,true) );\n\n\t\t$statement = $this -> database -> connection() -> prepare($this -> query);\n\t\t$statement -> execute($this -> query_data);\n\n\t\t$this -> clearQuery();\n\n\t\tLogger::error('PDO Errors', print_r($statement -> errorInfo(), true) );\n\n\t\tif( isset( $this -> counter['insert'] ) )\n\t\t\t$this -> last_insert_id = $this -> database -> connection() -> lastInsertId();\n\t\telse\n\t\t\t$this -> rowcount = $statement -> rowCount();\n\n\t\t$results = $statement -> fetchall( PDO::FETCH_ASSOC );\n\n\t\treturn $results;\n\t}", "public function batchExecute() {\n\n }", "public function batch()\n {\n if (empty($this->_callbacks)) {\n return;\n }\n /**\n * @var ActiveRecord $class\n */\n $class = $this->modelClass;\n $models = $class::find()->where($this->keys);\n foreach ($models->each($this->batchSize) as $model) {\n $this->updateModel($model);\n }\n }", "function execute()\r\n\t{\r\n\t\t$prototype = new $this->class;\r\n\t\t$prototype->filter = $this->filter;\r\n\t\r\n\t\t$order_by_idx = strpos(strtoupper($this->constraints), \"ORDER BY\");\r\n\t\t$orderBy = \"\";\t\r\n\t\t\r\n\t\tif ($order_by_idx !== false)\r\n\t\t{\r\n\t\t\t$orderBy = substr($this->constraints, $order_by_idx);\r\n\t\t\t\r\n\t\t\t$this->constraints = substr($this->constraints, 0, $order_by_idx);\r\n\t\t} \r\n\t\t\r\n\t\tif ($this->constraints == \"\") $this->constraints = \"WHERE 1=1\"; //TODO - tidy this up some day\r\n\t\t$this->constraints .= \" \".$prototype->getIdentityConstraint();\r\n\t\t\r\n\t\t$query = \"SELECT \".$prototype->getFieldList().\" FROM {$prototype->table} {$this->tableAlias} {$this->constraints} $orderBy\";\r\n\t\r\n\t\ttrace(\"$query\", 3);\r\n\t\ttrace(\"Page: $this->page Size: $this->size\", 3);\r\n\t\t$items = array();\r\n\t\t\r\n\t\t$size = $this->size;\r\n\t\t\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$db = ConnectionManager::getConnection();\r\n\t\t\t\r\n\t\t\t$result = $db->prepare($query);\r\n\t\t\t$result->execute($this->params);\r\n\t\t\t\r\n\t\t\tif ($this->page > 0)\r\n\t\t\t{\r\n\t\t\t\t$count = ($this->page - 1) * $this->size;\r\n\t\t\t\twhile($count--)\r\n\t\t\t\t{\r\n\t\t\t\t\t$result->fetch();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\twhile($line = $result->fetch())\r\n\t\t\t{\r\n\t\t\t\t$item = new $this->class;\r\n\t\t\t\t$item->filter = $this->filter;\r\n\t\t\t\t$item->populate($line);\r\n\t\t\t\t$items[] = $item;\r\n\t\t\t\t\r\n\t\t\t\t--$size;\r\n\t\t\t\tif ($size == 0) break;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tunset($result);\r\n\t\t}\r\n\t\tcatch(PDOException $e)\r\n\t\t{\r\n\t\t\t$err = \"query() failed - \" . $e->getMessage();\r\n\t\t\ttrace($err, 2);\r\n\t\t\tthrow new DataItemException($err);\r\n\t\t}\r\n\t\t\r\n\t\ttrace(count($items).\" items found\", 3);\r\n\t\treturn $items;\r\n\t}", "public function refresh()\n {\n $where = $this->_getWhereQuery();\n\n $that = $this->_table->fetchRow($where);\n\n foreach($that as $key => $value)\n {\n if(substr($key, 0, 1) == '_')\n {\n continue;\n }\n $this->$key = $value;\n }\n\n $this->_isInsert = false;\n }", "protected function fetchData() {\n\t\t$criteria=clone $this->getCriteria();\n /* x2modstart */ \n $criteria->with = array();\n /* x2modend */ \n\n\t\tif(($pagination=$this->getPagination())!==false) {\n\t\t\t$pagination->setItemCount($this->getTotalItemCount());\n\t\t\t$pagination->applyLimit($criteria);\n\t\t}\n\n // prevent side effects to model's criteria by cloning criteria and then restoring\n\t\t$baseCriteria=$this->model->getDbCriteria(false);\n\n\t\tif(($sort=$this->getSort())!==false) {\n\t\t\t// set model criteria so that CSort can use its table alias setting\n\t\t\tif($baseCriteria!==null) {\n\t\t\t\t$c=clone $baseCriteria;\n\t\t\t\t$c->mergeWith($criteria);\n\t\t\t\t$this->model->setDbCriteria($c);\n\t\t\t} else\n\t\t\t\t$this->model->setDbCriteria($criteria);\n\t\t\t$sort->applyOrder($criteria);\n\t\t}\n\n /* x2modstart */ \n\t\t$orderBy = $criteria->order;\n\t\tif(!preg_match('/\\bid\\b/',$orderBy)) {\n\t\t\tif(!empty($orderBy))\n\t\t\t\t$orderBy .= ',';\n\t\t\t$orderBy .= 't.id DESC';\n\t\t\t$criteria->order = $orderBy;\n\t\t}\n /* x2modend */ \n\n\t\t$this->model->setDbCriteria($baseCriteria!==null ? clone $baseCriteria : null);\n\t\t$data=$this->model->findAll($criteria);\n\t\t$this->model->setDbCriteria($baseCriteria); // restore original criteria\n\n /* x2modstart */ \n // using the same criteria, calculate and save the checksum of the ids \n\t\t$this->model->setDbCriteria($baseCriteria!==null ? clone $baseCriteria : null);\n if ($this->calculateChecksum) {\n ini_set ('memory_limit', -1);\n $critClone = clone $criteria;\n $critClone->limit = -1;\n $critClone->offset = -1;\n $critClone->select = array ('t.id');\n $command = $this->model->findAll ($critClone, array (), true);\n if (!$command) {\n throw new CException ('could not generate checksum, invalid command');\n }\n $ids = $command->queryColumn ();\n\n // attempt to verify ids array\n \n if (count ($ids) !== intval ($this->totalItemCount)) {\n throw new CException ('could not generate checksum');\n }\n $this->_idChecksum = $this->calculateChecksumFromIds ($ids);\n $this->_recordIds = $ids;\n }\n\t\t$this->model->setDbCriteria($baseCriteria); // restore original criteria\n /* x2modend */ \n\n\t\treturn $data;\n\t}", "public function startBulkIndex()\n {\n $this->buffered = true;\n }", "public function populate()\n {\n\t\tif( $this->getExternalSegmentation() && $this->getExternalSorting() )\n\t\t{\n\t\t\t$this->determineOffsetAndOrder();\n\t\t}\n\t\telseif( !$this->getExternalSegmentation() && $this->getExternalSorting() )\n\t\t{\n\t\t\t$this->determineOffsetAndOrder(true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new ilException('invalid table configuration: extSort=false / extSegm=true');\n\t\t}\n\t\t\n\t\t/* Configure query execution */\n\t\t$params = array();\n\t\tif( $this->getExternalSegmentation() )\n\t\t{\n\t\t\t$params['limit'] = $this->getLimit();\n\t\t\t$params['offset'] = $this->getOffset();\n\t\t}\n\t\tif( $this->getExternalSorting() )\n\t\t{\n\t\t\t$params['order_field'] = $this->getOrderField();\n\t\t\t$params['order_direction'] = $this->getOrderDirection();\n\t\t}\n\n\t\t$overview = $this->getParentObject()->object;\n\t\t$filters = array(\"overview_id\" => $overview->getId()) + $this->filter;\n\n\t\t/* Execute query. */\n $data = $this->getMapper()\n\t\t\t\t ->getList($params, $filters);\n\n if( !count($data['items']) && $this->getOffset() > 0) {\n\t\t\t/* Query again, offset was incorrect. */\n $this->resetOffset();\n\t $data = $this->getMapper()\n\t\t\t\t\t ->getList($params, $filters);\n }\n\n\t\t/* Post-query logic. Implement custom sorting or display\n\t\t in formatData overload. */\n\t\t$data = $this->formatData($data);\n\n\t\t$this->setData( $this->buildTableRowsArray($data['items']) );\n\t\t\n \t\tif( $this->getExternalSegmentation() )\n\t\t{\n\t\t\t$this->setMaxCount($data['cnt']);\n\t\t}\n\t\t\n return $this;\n }", "public function reload() {\n\t\t$this->_countTotal = null;\n\t\t$this->_sqlIterator->reset();\n\t\t$this->_sqlIterator->query();\n\t}", "protected function bulkIndex()\n {\n $responses = $this->client->bulk($this->dataArrayPreparedForIndexing);\n// echo \"Responses: \\n\"; print_r ($responses); // DEBUG\n unset($responses);\n\n// echo \"dataArrayPreparedForIndexing: \\n\"; print_r ($this->dataArrayPreparedForIndexing); // DEBUG\n unset($this->dataArrayPreparedForIndexing);\n $this->dataArrayPreparedForIndexing = Array();\n\n $this->benchmark['bulkIndexing'] += microtime(TRUE) - $this->startTime; // benchmark\n }", "public function bulk()\n\t{\n $promises = $insert = [];\n $cn=$i=0;\n //make promises of 10 chuncks of 500 urls.\n foreach(array_chunk($this->request->urls, 500) as $chunk) {\n\n $promises[$i][] = $this->client->postAsync($this->api_url.$this->request->method, [\n 'query' => ['apikey' => $this->api_key],\n 'body' => implode(PHP_EOL, $chunk)\n ]);\n if(++$cn == 10) $i++;\n }\n\n foreach($promises as $promise) {\n $results = \\GuzzleHttp\\Promise\\settle($promise)->wait();\n foreach($results as $r) {\n if(isset($r['state']) && $r['state'] == 'rejected') { // @todo at the moment if engaged count rejects our bulk request we delete it, but we should examine why this is happening.\n continue;\n }//\n if(!isset($r['value'])) continue;\n $insert[] = [\n 'campaign_id' => $this->request->campaign_id,\n 'date' => Carbon::now(),\n 'bulk_id' => json_decode($r['value']->getBody()->getContents())->bulk_id,\n 'processed' => 0\n ];\n }\n }\n\n EngagedcountApiCalls::insert($insert);\n\n\t}", "function bulkOperation()\n {\n }", "private function prepareRelationData()\n {\n foreach ($this->rows as $row) {\n $this->prepareBatchesToSave($row);\n $this->prepareCardTypesToSave($row);\n $this->prepareMerchantToSave($row);\n $this->prepareTransactionTypesToSave($row);\n }\n }", "public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Elimina un objeto Tipo_equipo en la base de datos.
public function delete($tipo_equipo);
[ "function deleteEquip($equipID){\n \t\t$strQuery=\"delete from equipment where equipID=$equipID\";\n \t\treturn $this->query($strQuery);\n \t}", "public function eliminar()\n\t{\n\t\t$descripcion=array(); //array para almacenar la informacion de la entidad\n\t\t//Concateno el where para eliminar los registros de la entidad\n\t\t$sql=\"DELETE FROM noticia WHERE not_id = \".$this -> getNotId();\n\n\t\tif(isset($this -> auditoria_tabla) and $this -> auditoria_tabla)\n\t\t{\n\t\t\t//Consulto la informacion que se registro luego de la actualizacion\n\t\t\t$noticia = $this -> consultarId($this -> getNotId());\n\t\t\t\t\t$descripcion[]=\"not_id = \".$noticia -> getNotId();\n\t\t\t\t\t$descripcion[]=\"not_fecha = \".$noticia -> getNotFecha();\n\t\t\t\t\t$descripcion[]=\"not_titulo = \".$noticia -> getNotTitulo();\n\t\t\t\t\t$descripcion[]=\"not_lead = \".$noticia -> getNotLead();\n\t\t\t\t\t$descripcion[]=\"not_texto = \".$noticia -> getNotTexto();\n\t\t\t\t\t$descripcion[]=\"not_activo = \".$noticia -> getNotActivo();\n\t\t\t\t\t$descripcion[]=\"not_nts_id = \".$noticia -> getNotNtsId();\n\t\t\t\t\t$descripcion[]=\"not_usu_id = \".$noticia -> getNotUsuId();\n\t\t\t$descripcion_antigua = implode(\", \", $descripcion);\n\t\t}\n\t\t\n\t\t//Si la ejecucion es exitosa entonces devuelvo el numero de registros borrados\n\t\tif($this -> getConexion() -> Execute($sql))\n\t\t{\n\t\t\t$registros_eliminados=$this -> getConexion() -> Affected_Rows();\n\t\t\t\n\t\t\t//Si se pudo eliminar el registro entonces registro la auditoria sobre la tabla\n\t\t\tif(isset($this -> auditoria_tabla) and $this -> auditoria_tabla and $registros_eliminados)\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * instanciacion de la clase auditoria_tabla para la eliminacion de un registro\n\t\t\t\t */\n\t\t\t\t$objAuditoriaTabla = new AuditoriaTabla();\n\t\t\t\t$objAuditoriaTabla->crearBD(\"sisgot_adodb\");\n\t\t\t\t$objAuditoriaTabla->setAutTabla(\"noticia\");\n\t\t\t\t$objAuditoriaTabla->setAutTablaId($this -> getNotId());\n\t\t\t\t$objAuditoriaTabla->setAutUsuId($objAuditoriaTabla -> obtenerUsuarioActual());\n\t\t\t\t$objAuditoriaTabla->setAutFecha(\"NOW()\", \"sql\");\n\t\t\t\t$objAuditoriaTabla->setAutDescripcionAntigua($descripcion_antigua);\n\t\t\t\t$objAuditoriaTabla->setAutDescripcionNueva(\"\");\n\t\t\t\t$objAuditoriaTabla->setAutTransaccion(\"ELIMINAR\");\n\t\t\t\t$aut_id=$objAuditoriaTabla->insertar();\n\t\t\t\t\n\t\t\t\tif(!$aut_id)\n\t\t\t\t{\n\t\t\t\t\techo \"<b>Error al almacenar informacion en la tabla de auditoria_tabla</b><br/>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn $registros_eliminados;\n\t\t}\n\t\t//Sino imprimo el mensaje de error\n\t\telse\n\t\t\techo $this -> getConexion() -> ErrorMsg().\" <strong>SQL: \".$sql.\"<br/>En la linea \".__LINE__.\"<br/></strong>\";\n\n\t\treturn 0;\n\t}", "public function eliminarTipoProducto() {\n //Comprueba $_GET este definida y tenga un valor\n if (isset($_GET['id'])) {\n //Si la condicion se cumple permite acceder a la funcion eliminarTipoProducto del modelo TipoProducto\n $id = $_GET['id'];\n $tipo = new TipoProducto();\n $tipo->setIdTipoProducto($id);\n $borrar = $tipo->eliminarTipoProducto();\n \n if ($borrar) {\n //Si $borrrar es true la eliminacion si ejecuto correctamente\n $_SESSION['borrar'] = 'completo';\n } else {\n //Si $borrar es false la eliminacion fue fallida\n $_SESSION['borrar'] = 'fallido';\n }\n } else {\n $_SESSION['borrar'] = 'fallido';\n }\n echo \"<script> window.location=' \"\n . urlBase . \"TipoProducto/gestionarTiposProductos'; </script>\";\n }", "function eliminar(){\n\t\tif($this->idTuit != null){\n\t\t\t$sql = \"DELETE FROM tuits WHERE idTuit=$this->idTuit\";\n\t\t\tmysql_query($sql) or die(\"tuit->eliminar(): error en consulta\".mysql_error().\"SQL: \".$sql);\n\t\t}\n\t}", "public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM miembro_ageia WHERE ID_MIEMBRO = '$this->id'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar el miembro\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Miembro eliminado\";\n\t\t}", "function eliminaTipoEjercicio($id){\n \tDB::beginTransaction ();\n \ttry {\n \t\t$tipoEjercicio = $this->getTipoEjercicio($id);\n \t\t$tipoEjercicioA = clone $tipoEjercicio;\n \t\t$tipoEjercicio->activo = 0;\n \t\t$tipoEjercicio->update();\n \t\t//Bitacora\n \t\t$this->insertaBitacora(Constantes::ACCION_ELIMINAR, $tipoEjercicioA->getAttributes(), $tipoEjercicio->getAttributes(), $tipoEjercicio->idtipoEjercicio,$this->controller,$this->moduloId,Session::get('idUser'),array(),$this->campoBase); \t\t \n \t\tDB::commit ();\n \t} catch ( \\Exception $e ) {\n \t\tDB::rollback ();\n \t\tthrow new \\Exception('Error al actualizar TipoEjercicio: ' . $e);\n \t} \t\t\n }", "public function deletar($objeto) {\n \n $sql = \"\n DELETE FROM\n equipamentos\n WHERE\n idEquipamento = '$objeto->idEquipamento'\n \";\n\n $query = $this->query->setQuery($sql);\n return $query;\n }", "public function eliminarProducto($codigo){\r\n //Preparamos la conexion a la bdd:\r\n $pdo=Database::connect();\r\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n $sql=\"delete from producto where codigo=?\";\r\n $consulta=$pdo->prepare($sql);\r\n //Ejecutamos la sentencia incluyendo a los parametros:\r\n $consulta->execute(array($codigo));\r\n Database::disconnect();\r\n }", "public static function eliminarTarifa($tipo){\r\n try{\r\n $conexion = connectDB::connectBD();\r\n $actualizar = \"DELETE FROM `Tarifa` WHERE `Tarifa`.`TipoEntrada` = '$tipo';\";\r\n $conexion->exec($actualizar);\r\n }catch(PDOException $error){\r\n echo $error->getMessage();\r\n }\r\n }", "private function esEliminable(Tipovehiculo $tipovehiculo){\n $em=$this->getDoctrine()->getManager();\n return null==$em->getRepository('App:Vehiculo')->findOneByTipovehiculo($tipovehiculo);\n }", "public function borrarEquipo($nombre_e){\n # Creamos la consulta.\n $sql=\"DELETE FROM equipos Where Nombre='$nombre_e'\";\n # Almacenamos los resultados de la función.\n $resultado = $this->consultas($sql);\n return $resultado;\n }", "public function deletarPorId($id){\n $qDeletar = \"DELETE from equipamentos WHERE id_equipamento=:id\"; \n $equipamento = $this->buscarPorId($id);\n $pdo = PDOFactory::getConexao();\n $comando = $pdo->prepare($qDeletar);\n $comando->bindParam(\":id\",$id);\n $comando->execute();\n return $equipamento;\n }", "final protected function eliminar(){\n\t\tif($this -> empresa != null){\n\t\t\tthrow new Exception('Empresa sin datos');\n\t\t}\n\t\tDataAccess::delete($this -> empresa);\t\n\t}", "public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }", "function eliminaProyecto(){\n \t$this->buffer=0;\n \tif(count($this->data) > 0){\n \t\t$this->buffer = $this->eliminaProyectoCompleto($this->data,$this->session);\n \t}\n }", "function eliminar() {\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\tif ($mdb2->only_read) {\n\t\t\tthrow new Exception('Por el momento esta trabajando solo en modo lectura.');\n\t\t}\n\n\t\t$sql = \"SELECT * FROM public.horario_elimina(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->horario_id).\")\";\n\t\t//print($sql.\"<br>\");\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\t\t$log->setChange(\"ELIMINO HORARIO\", $this->toString());\n\t}", "function delete_equipo_jugador($id_jug_equipo)\n {\n return $this->db->delete('equipo_jugador',array('id_jug_equipo'=>$id_jug_equipo));\n }", "function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}", "function eliminarRelacionProceso(){\n $this->objFunc=$this->create('MODObligacionPago');\n $this->res=$this->objFunc->eliminarRelacionProceso($this->objParam);\n $this->res->imprimirRespuesta($this->res->generarJson());\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: sanitize Returns a sanitized string, typically for URLs. Parameters: $string The string to sanitize. $force_lowercase Force the string to lowercase? $anal If set to true, will remove all nonalphanumeric characters.
function sanitize($string, $force_lowercase = true, $anal = false) { $unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', 'Ğ'=>'G', 'İ'=>'I', 'Ş'=>'S', 'ğ'=>'g', 'ı'=>'i', 'ş'=>'s', 'ü'=>'u' ); $string = strtr( $string, $unwanted_array ); $strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]", "}", "\\", "|", ";", ":", "\"", "'", "&#8216;", "&#8217;", "&#8220;", "&#8221;", "&#8211;", "&#8212;", "—", "–", ",", "<", ".", ">", "/", "?"); $clean = trim(str_replace($strip, "", strip_tags($string))); $clean = preg_replace('/\s+/', "-", $clean); $clean = ($anal) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean ; return ($force_lowercase) ? (function_exists('mb_strtolower')) ? mb_strtolower($clean, 'UTF-8') : strtolower($clean) : $clean; }
[ "public function sanitize($string, $force_lowercase = true, $anal = false) {\n\t\t$strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\", \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\", \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n\t\t$clean = trim(str_replace($strip, \"\", strip_tags($string)));\n\t\t$clean = preg_replace('/\\s+/', \"-\", $clean);\n\t\t$clean = ($anal) ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean;\n\t\treturn ($force_lowercase) ? (function_exists('mb_strtolower')) ? mb_strtolower($clean, 'UTF-8') : strtolower($clean) : $clean;\n\t}", "function sanitize($string, $force_lowercase = true, $anal = false)\n {\n $strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\",\n \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n $clean = trim(str_replace($strip, \"\", strip_tags($string)));\n $clean = preg_replace('/\\s+/', \"-\", $clean);\n $clean = ($anal) ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean;\n\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n }", "function sanitize($string, $force_lowercase = true, $anal = true)\n{\n\t$strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n\t\t\"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\",\n\t\t\"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n\t$clean = trim(str_replace($strip, \"\", strip_tags($string)));\n\t$clean = preg_replace('/[\\s-]+/', \"-\", $clean);\n\t$clean = ($anal) ? preg_replace(\"/[^a-zA-Z0-9-]/\", \"\", $clean) : $clean;\n\treturn ($force_lowercase) ?\n\t\t(function_exists('mb_strtolower')) ?\n\t\t\tmb_strtolower($clean, 'UTF-8') :\n\t\t\tstrtolower($clean) :\n\t\t$clean;\n}", "function sanitize($string, $force_lowercase = true, $anal = false) {\n $strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\",\n \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n $clean = trim(str_replace($strip, \"\", strip_tags($string)));\n $clean = preg_replace('/\\s+/', \"-\", $clean);\n $clean = ($anal) ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean ;\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n }", "function sanitize($string, $force_lowercase = true, $anal = false) {\n $strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\",\n \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n $clean = trim(str_replace($strip, \"\", strip_tags($string)));\n $clean = preg_replace('/\\s+/', \"-\", $clean);\n $clean = ($anal) ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean ;\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n }", "function sanitize($string, $force_lowercase = true, $anal = false, $trunc = 100) {\n\t$strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"=\", \"+\", \"{\",\n\t\t\t\t \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\",\n\t\t\t\t \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n\t$clean = trim(str_replace($strip, \"\", strip_tags($string)));\n\t$clean = preg_replace('/\\s+/', \"-\", $clean);\n\t$clean = ($anal ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean);\n\t$clean = ($trunc ? substr($clean, 0, $trunc) : $clean);\n\treturn ($force_lowercase) ?\n\t\t(function_exists('mb_strtolower')) ?\n\t\t\tmb_strtolower($clean, 'UTF-8') :\n\t\t\tstrtolower($clean) :\n\t\t$clean;\n}", "function sanitize($string, $force_lowercase = true, $anal = false, $trunc = 100) {\n $strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\",\n \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n $clean = trim(str_replace($strip, \"\", strip_tags($string)));\n // $clean = preg_replace('/\\s+/', \"-\", $clean);\n $clean = ($anal ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean);\n $clean = ($trunc ? substr($clean, 0, $trunc) : $clean);\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n}", "function Sanitize($string, $force_lowercase = true, $remove_nonalpha = false) {\n $strip = array(\"~\", \"`\", \"!\", \"@\", \"#\", \"$\", \"%\", \"^\", \"&\", \"*\", \"(\", \")\", \"_\", \"=\", \"+\", \"[\", \"{\", \"]\",\n \"}\", \"\\\\\", \"|\", \";\", \":\", \"\\\"\", \"'\", \"&#8216;\", \"&#8217;\", \"&#8220;\", \"&#8221;\", \"&#8211;\", \"&#8212;\",\n \"—\", \"–\", \",\", \"<\", \".\", \">\", \"/\", \"?\");\n $clean = trim(str_replace($strip, \"\", strip_tags($string)));\n $clean = preg_replace('/\\s+/', \"-\", $clean);\n $clean = ($remove_nonalpha) ? preg_replace(\"/[^a-zA-Z0-9]/\", \"\", $clean) : $clean ;\n return ($force_lowercase) ?\n (function_exists('mb_strtolower')) ?\n mb_strtolower($clean, 'UTF-8') :\n strtolower($clean) :\n $clean;\n}", "function normalizeString($string) { \n\t\t\t// Strip whitespace\n\t\t\t$string = trim($string);\n\t\t\t// Remove punctuation from $string\n\t\t\t$string = preg_replace(\"#[[:punct:]]#\", \" \", $string);\n\t\t\t// Make the $string lowercase\n\t\t\t$string = mb_strtolower($string, 'UTF-8');\n\t\t\t// Remove accented UTF-8 characters from $string\n\t\t\t$search = explode(\",\",\"ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u\");\n\t\t\t$replace = explode(\",\",\"c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u\");\n\t\t\t$string = str_replace($search, $replace, $string);\n\t\t\treturn $string;\n \t\t}", "function convertUrlToFileName($string, $force_lowercase = true, $anal = false)\n {\n $strip = [\n \"~\",\n \"`\",\n \"!\",\n \"@\",\n \"#\",\n \"$\",\n \"%\",\n \"^\",\n \"&\",\n \"*\",\n \"(\",\n \")\",\n \"_\",\n \"=\",\n \"+\",\n \"[\",\n \"{\",\n \"]\",\n \"}\",\n \"\\\\\",\n \"|\",\n \";\",\n \":\",\n \"\\\"\",\n \"'\",\n \"&#8216;\",\n \"&#8217;\",\n \"&#8220;\",\n \"&#8221;\",\n \"&#8211;\",\n \"&#8212;\",\n \"—\",\n \"–\",\n \",\",\n \"<\",\n \".\",\n \">\",\n \"/\",\n \"?\"\n ];\n $clean = trim(str_replace($strip, \"_\", strip_tags($string)));\n $clean = preg_replace('/\\s+/', \"-\", $clean);\n\n // $clean = ($anal) ? preg_replace(\"/[^a-zA-Z0-9\\.\\-]/\", \"\", $clean) : $clean;\n\n return ($force_lowercase)\n ?\n (function_exists('mb_strtolower'))\n ?\n mb_strtolower($clean, 'UTF-8')\n :\n strtolower($clean)\n :\n $clean;\n }", "function sanitizeString() {\n\treturn filterVar( FILTER_SANITIZE_STRING );\n}", "function clean_string(string $input_string) {\n $sanitised_string = filter_var($input_string, FILTER_SANITIZE_STRING);\n trim($sanitised_string);\n return $sanitised_string;\n}", "function sanitiseString($dirty){\n $dirty = filter_var($dirty, FILTER_SANITIZE_FULL_SPECIAL_CHARS);\n $clean = filter_var($dirty, FILTER_SANITIZE_STRING);\n return $clean;\n }", "public static function sanitizeUsername($username) {\n\t\t$username = str_replace('ä', 'ae', $username);\n $username = str_replace('ö', 'oe', $username);\n $username = str_replace('ü', 'ue', $username);\n $username = str_replace('ß', 'ss', $username);\n $username = str_replace('Ä', 'Ae', $username);\n $username = str_replace('Ö', 'Oe', $username);\n $username = str_replace('Ü', 'Ue', $username);\n $username = str_replace(' ', '-', $username);\n \n $username = preg_replace('/[^\\w\\s.-]/', null, $username);\n return $username;\n\t}", "public abstract function sanitize( $input );", "function SanitizeUserInput($input)\r\n {\r\n // Dangerous words not allowed\r\n $wordsNotAllowed = array(\"/delete/i\", \"/update/i\",\"/union/i\",\"/insert/i\",\"/drop/i\",\"/evil/i\",\"/--/i\");\r\n // Remove dangerous words from first name\r\n $input = preg_replace($wordsNotAllowed , \"\", $input);\r\n\t\t// Unfortunately escapeshellarg adds quotes around the first and last names.\r\n\t\t// $input = escapeshellarg($input);\r\n // strip tags\r\n $input = filter_var($input, FILTER_SANITIZE_STRING,FILTER_FLAG_ENCODE_AMP);\r\n // strip slashes\r\n $input = stripslashes($input);\r\n return $input;\r\n }", "function sanitize_search_string($string) {\n\tstatic $drop_char_match = array('^', '$', '<', '>', '`', '\\'', '\"', '|', ',', '?', '~', '+', '[', ']', '{', '}', '#', ';', '!', '=');\n\tstatic $drop_char_replace = array(' ', ' ', ' ', ' ', '', '', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');\n\n\t/* Replace line endings by a space */\n\t$string = preg_replace('/[\\n\\r]/is', ' ', $string);\n\t/* HTML entities like &nbsp; */\n\t$string = preg_replace('/\\b&[a-z]+;\\b/', ' ', $string);\n\t/* Remove URL's */\n\t$string = preg_replace('/\\b[a-z0-9]+:\\/\\/[a-z0-9\\.\\-]+(\\/[a-z0-9\\?\\.%_\\-\\+=&\\/]+)?/', ' ', $string);\n\n\t/* Filter out strange characters like ^, $, &, change \"it's\" to \"its\" */\n\tfor($i = 0; $i < count($drop_char_match); $i++) {\n\t\t$string = str_replace($drop_char_match[$i], $drop_char_replace[$i], $string);\n\t}\n\n\t$string = str_replace('*', ' ', $string);\n\n\treturn $string;\n}", "function sanitiseInput($input){\n\t\t$input = trim($input); // get rid of leading/trailing whitespaces\n\t\t$input = stripslashes($input); // get rid of slashses\n\t\t$input = htmlspecialchars($input); // get ride of special characters\n\t\treturn $input;\n\t}", "function fixAllCaps($str) {\n\tif (strlen($str) > 3 && !preg_match('/[a-z]/', $str)) return ucwords(strtolower($str));\n\treturn $str;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates an ID used as the unique identifier at the Solr server. This has to consist of both index and item ID. Optionally, the site hash is also included.
protected function createId($index_id, $item_id) { $site_hash = !empty($this->configuration['site_hash']) ? elasticsearch_site_hash() . '-' : ''; return "$site_hash$index_id-$item_id"; }
[ "protected function createId($index_id, $item_id) {\n return SearchApiSolrUtility::getSiteHash() . \"-$index_id-$item_id\";\n }", "function getUniqueSiteId() {\n\t\treturn $this->getSetting(0, 'uniqueSiteId');\n\t}", "public function get_site_id() {}", "public function siteid()\n\t{\n\t\treturn $this->siteItem->getId();\n\t}", "public static function getSiteHash() {\n // Copied from apachesolr_site_hash().\n if (!($hash = \\Drupal::state()->get('search_api_solr.site_hash', FALSE))) {\n global $base_url;\n $hash = substr(base_convert(hash('sha256', uniqid($base_url, TRUE)), 16, 36), 0, 6);\n \\Drupal::state()->set('search_api_solr.site_hash', $hash);\n }\n return $hash;\n }", "public static function getSiteUniqueID()\n {\n return self::$siteUniqueID;\n }", "public function get_site_id()\n {\n }", "public function siteId()\n\t{\n\t\treturn $this->site['id'];\n\t}", "function _generateNextId()\n\t{\n\t\treturn $this->db->nextId(\"Site\", true);\n\t}", "static function makeID() {\n return uniqid();\n }", "function make_id(){\r\n\t\t// creer un hash\r\n\t\t$hash = $this->champ . $this->table . $this->sql;\r\n\t\t$this->_id = substr(md5($hash),0,6);\r\n\t}", "private function buildUniqueId(FeedItemBase $feedItem)\n\t{\n\t\t$id = $this->identifier->getIdentifyingData($feedItem);\n\n\t\t// Check if \n\t\tif ($id == NULL)\n\t\t{\n\t\t\t$className = get_class($this->identifier);\n\t\t\t$msg = sprintf('The feed does not support the \\'%s\\' class.', $className);\n\t\t\t$msg .= 'Use another identifier class.';\n\n\t\t\tthrow new \\RuntimeException($msg);\n\t\t}\n\n\t\treturn sha1($id);\n\t}", "private function generateHashedID()\n {\n $this->propHashedId = hash_id($this->propId, $this->propOptions->toArray());\n }", "public function getEnterpriseSiteId();", "public function getSiteId()\n {\n return $this->_getHelper()->getSiteId();\n }", "public function generate_multi_id() {\n\t\treturn uniqid( 'hubspot_', true );\n\t}", "public static function get_site_id() {\n\t\t$is_wpcom = ( defined( 'IS_WPCOM' ) && IS_WPCOM );\n\t\t$site_id = $is_wpcom ? get_current_blog_id() : Jetpack_Options::get_option( 'id' );\n\t\tif ( ! $site_id ) {\n\t\t\treturn new WP_Error(\n\t\t\t\t'unavailable_site_id',\n\t\t\t\t__( 'Sorry, something is wrong with your Jetpack connection.', 'jetpack' ),\n\t\t\t\t403\n\t\t\t);\n\t\t}\n\t\treturn (int) $site_id;\n\t}", "public function getInstallationId()\n\t{\n\t\t// Parameters used in the installation ID\n\t\t$parameters = array(\n\t\t\t// host name is unique for one machine, even the machine have multiple IPs\n\t\t\tgethostname(),\n\t\t\t// the installation path can only hold ONE installation ;-)\n\t\t\tTL_ROOT,\n\t\t\t// add more uniqueness, the encryption key should be differ in each installation\n\t\t\t$GLOBALS['TL_CONFIG']['encryptionKey']\n\t\t);\n\n\t\t// return an ID hash\n\t\treturn hash('sha512', implode(PHP_EOL, $parameters));\n\t}", "protected function getLandingSiteId(): int\n\t{\n\t\tif (is_callable(['LandingPubComponent', 'getMainInstance']))\n\t\t{\n\t\t\t$instance = LandingPubComponent::getMainInstance();\n\t\t\treturn $instance['SITE_ID'];\n\t\t}\n\t\treturn 0;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds and displays a feuil entity.
public function showAction(Feuil $feuil) { $deleteForm = $this->createDeleteForm($feuil); return $this->render('feuil/show.html.twig', array( 'feuil' => $feuil, 'delete_form' => $deleteForm->createView(), )); }
[ "public function getCodeFeuille() {\n return $this->codeFeuille;\n }", "public function FinancialStatement() {\n $Sunrise = new Sunrise;\n $FeeDisplay = $Sunrise->Mini('form-areas/custom/FamilyFees', '..', []);\n echo ($FeeDisplay);\n }", "public function find_lf($id_lf) {\n $connexion = get_connexion();\n $sql = \"SELECT * FROM lignefrais WHERE id_lf =:id_lf\";\n\n try {\n $sth = $connexion->prepare($sql);\n $sth->execute(array(\":id_lf\" => $id_lf));\n $row = $sth->fetch(PDO::FETCH_ASSOC);\n } \n catch (PDOException $e) {\n die( \"<p>Erreur lors de la requête SQL : \" . $e->getMessage() . \"</p>\");\n }\n\n $lf_object = new LigneDeFrais($row);\n\n return $lf_object;\n\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SrpvProtocolizacionBundle:FuenteFinanciamiento')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find FuenteFinanciamiento entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SrpvAdminBundle:FuenteFinanciamiento:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "protected function fetchFee() : float\n {\n\n // return a direct match if one is found\n if (array_key_exists((int) $this->application->getAmount(), $this->fees)) {\n return $this->fees[$this->application->getAmount()];\n }\n\n // otherwise interpolate the figure\n return $this->interpolateFee();\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('SCGeneralBundle:Femme')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Femme entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('SCGeneralBundle:Femme:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function getFIK() {\n\t\tif ($this->report) {\n\t\t\treturn $this->report->fik;\n\t\t}\n\t\treturn \"\";\n\t}", "public function getVlFrete()\n {\n return $this->vl_frete;\n }", "public function showAction($id,$uid)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ProductionBundle:AffectationEtapeUtilisateur')->find($id);\n\n /*var_dump(count($entity));\n die('here');\n */\n\n $entities = $em->getRepository('ProductionBundle:AffectationEtapeUtilisateur')->findBy(array('idLigneBc' => $uid),array('idEtape' => 'DESC'));\n\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find AffectationEtapeUtilisateur entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('ProductionBundle:AffectationEtapeUtilisateur:show.html.twig', array(\n 'entity' => $entity,\n 'entities' => $entities,\n 'idbc' =>$uid,\n 'id'=>$id,\n\n ));\n }", "public function fournisseur()\n {\n $data[\"fournisseur\"]=$this->fournisseur->list();\n $this->template_admin->displayad('fourni_list' , $data);\n }", "public function renderField($entity);", "function fetch_provider_escrow_fee($amount = 0)\n{\n global $ilance, $myapi, $ilconfig;\n \n $fee = 0;\n if ($ilconfig['escrowsystem_escrowcommissionfees'])\n {\n if ($ilconfig['escrowsystem_providerfixedprice'] > 0)\n {\n $fee = $ilconfig['escrowsystem_providerfixedprice'];\n }\n else\n {\n if ($ilconfig['escrowsystem_providerpercentrate'] > 0)\n {\n $fee = ($amount*$ilconfig['escrowsystem_providerpercentrate']/100);\n }\n } \n }\n return sprintf(\"%01.2f\", $fee);\n}", "public function printFee()\n {\n $decimals = log10(1 / Converter::getDenomination($this->currency));\n echo number_format($this->getFee(), $decimals, '.', '') . \"\\n\";\n }", "public function AfficheFactureAction()\n {\n $fac = $this ->getDoctrine()->getRepository(Panier::class)->findAll();\n\n return $this->render('@Vente/Panier/facture.html.twig', array(\n 'fac' => $fac,\n\n ));\n }", "public function getDisplayInfuseAmt();", "private static function render_fees( \\WP_Query $query ) { ?>\n <?php $fees = self::get_meta( 'fees' ); ?>\n <?php if( ! empty( $fees )) : ?>\n <Fees>\n <?php foreach( $fees as $fee ) : ?>\n <Fee>\n <FeeType><?php echo esc_html( $fee[ 'fee-type' ] ); ?></FeeType>\n <FeeAmount><?php echo esc_html( $fee[ 'fee-amount' ] ); ?></FeeAmount>\n <FeePeriod><?php echo esc_html( $fee[ 'fee-period' ] ); ?></FeePeriod>\n </Fee>\n <?php endforeach; ?>\n </Fees>\n <?php endif; ?>\n <?php }", "function convert_cm_to_feet($cm_value)\n{\n\t//TODO: Convert cm to feet eg. 5'7\n\treturn $cm_value;\n}", "public function getDisplayValue();", "function testFindDisplayField() {\n\t\t$fields = array('id' => array(), 'tagname' => array(), 'body' => array(),\n\t\t\t'created' => array(), 'modified' => array());\n\n\t\t$this->Task->setReturnValue('in', 'n');\n\t\t$this->Task->setReturnValueAt(0, 'in', 'n');\n\t\t$result = $this->Task->findDisplayField($fields);\n\t\t$this->assertFalse($result);\n\n\t\t$this->Task->setReturnValueAt(1, 'in', 'y');\n\t\t$this->Task->setReturnValueAt(2, 'in', 2);\n\t\t$result = $this->Task->findDisplayField($fields);\n\t\t$this->assertEqual($result, 'tagname');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verify that we get subtags of a given tag
public function testSubTags() { $t2t = SemanticScuttle_Service_Factory::get('Tag2Tag'); $t2t->deleteAll(); $menu2Tag = reset($GLOBALS['menu2Tags']); //we have a subtag now $this->addBookmark( $this->getAdminUser(), null, 0, $menu2Tag . '>adminsubtag' ); $res = $this->getRequest('?tag=' . $menu2Tag)->send(); $this->assertResponseJson200($res); $data = json_decode($res->getBody()); $this->assertInternalType('array', $data); //only one subtag $this->assertEquals(1, count($data)); $this->assertEquals('adminsubtag', $data[0]->data->title); }
[ "private function fetchSubTags($tags) {\n if (isset($tags) && is_array($tags) && !empty($tags)) {\n foreach ($tags as &$item) {\n if (isset($item) && is_array($item) && !empty($item)) {\n foreach ($item as &$tag) {\n if (isset($tag['SubParams']) && !empty($tag['SubParams'])) {\n $matches = [];\n preg_match_all($this->subParam['regexp'], $tag['SubParams'], $matches);\n if (isset($matches[0]) && !empty($matches[0])) {\n $tag['SubParams'] = [];\n for ($i = 0, $c = count($matches[0]); $i < $c; $i++) {\n foreach ($this->subParam['properties'] as $property) {\n $tag['SubParams'][$i][$property] = $matches[$property][$i];\n }\n }\n }\n }\n }\n }\n }\n }\n\n return $tags;\n }", "public function testTags() {\n\t\t$this->assertTrue($this->get($this->testhost.'tagslist/0/'));\n\t\t$this->assertTitle('BicBucStriim :: Tags');\n\t}", "public function tag_in_test()\n\t{\n\t\treturn $this->terms_test( 'post_tag', TRUE, FALSE );\n\t}", "public function test_get_plugin_tags() {\n\t\t$plugin = $this->plugin;\n\n\t\t$this->assertInternalType(\n\t\t\t'array',\n\t\t\t$plugin->get( 'tags', 'extensions-for-grifus' )\n\t\t);\n\t}", "public function testTagRead()\n {\n }", "public function testGetItemSubCategoryTags()\n {\n }", "public function hasAnyTag();", "public function testGetSubFormElements()\n {\n $html = '%subForm rootElementUri=\"form:type1\" rootElementPropertyUri=\"form:t1-p2\" subElementTypeUri=\"form:type2\" %';\n\n $res = $this->fixture->getSubFormElements($html);\n\n $this->assertEquals(\n array('form:type1', 'form:t1-p2', 'form:type2'),\n $res\n );\n }", "public function isValidTag($tag);", "function recursiveFind($subtags, &$tagdocs, &$portal) {\n\n foreach($subtags as $st) {\n \t $x = $portal->getChildTags($st['id']);\n\n \t foreach($x as $childTag) {\n \t $addDocs = $portal->getTagDocs($childTag['id']);\n \t foreach($addDocs as $d) {\n \t \t if(empty($tagdocs[$d['doc_id']])) {\n \t \t \t $tagdocs[$d['doc_id']] = $d;\n \t \t }\n \t }\n\n \t recursiveFind(array($childTag), $tagdocs, $portal);\n \t }\n }\n}", "public function test_getSubstitutionTags() {\n\n }", "public function hasTag($tag);", "public function testListTags()\n {\n }", "public function testGetTags()\n {\n $objects = $this->loadTestFixtures(['@AppBundle/DataFixtures/ORM/Test/Tag/CrudData.yml']);\n\n // Test scope\n $this->restScopeTestCase('/api/tags', [\n 'list' => $this->getScopeConfig('tag/list.yml')\n ], true);\n\n // Test filters\n $listFilterCaseHandler = new ListFilterCaseHandler([\n 'tag-1' => $objects['tag-1']\n ]);\n \n $listFilterCaseHandler->addCase('name', '=Some name', 'tag-1', true);\n\n $this->restListFilterTestCase('/api/tags', $listFilterCaseHandler->getCases());\n }", "public function testPosTaggerTagVerbs()\n {\n }", "public function testDisallowSub() {\n list($d, $a) = $this->disallowAllow(array_merge(self::$blockTags, ['sub', 'sup', 'img']));\n $this->check($d, $a, 'sub', ['<sub>', '</sub>']);\n }", "public function checkTag($tag)\n {\n $tagToCheck = $tag;\n $dbTags = SubTag::get();\n $tagArray = array();\n foreach ($dbTags as $t){\n array_push($tagArray, $t->Title);\n }\n\n if (in_array($tagToCheck, $tagArray)){\n echo ('Tag is already in db');\n $data = new ArrayData(array(\n 'check' => true,\n 'SubTag' => $tagToCheck\n ));\n } else {\n echo ('we must add the tag');\n echo($tagToCheck);\n $data = new ArrayData(array(\n 'check' => false,\n 'SubTag' => $tagToCheck\n ));\n }\n return $data;\n\n }", "public function testGetTags()\n {\n $result = $this->api->get_tags();\n $this->assertIsArray($result);\n\n // Convert to array to check for keys, as assertObjectHasAttribute() will be deprecated in PHPUnit 10.\n $tag = get_object_vars($result[0]);\n $this->assertArrayHasKey('id', $tag);\n $this->assertArrayHasKey('name', $tag);\n $this->assertArrayHasKey('created_at', $tag);\n }", "public function testListTagsForNode()\n {\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Appointment to string (Default)
public function __toString() { return 'Appointment(' . $this->id . ')'; }
[ "public function toIso8601String()\n {\n return $this->toAtomString();\n }", "public function __toString()\n {\n return 'ATTENDEE;ROLE=REQ-PARTICIPANT;'\n .'PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=\"'\n . $this->dname\n . '\":MAILTO:' . $this->email;\n }", "public function createCalendar() : string\n {\n return Formatter::format( $this );\n }", "public function toIso8601String()\r\n {\r\n return $this->format(static::ISO8601);\r\n }", "public function getAppointment() {\n return $this->appointment;\n }", "public function toIso8601String()\n {\n $parts = [];\n\n if ($this->recurrences !== null) {\n $parts[] = 'R'.$this->recurrences;\n }\n\n $parts[] = $this->startDate->toIso8601String();\n\n $parts[] = $this->dateInterval->spec();\n\n if ($this->endDate !== null) {\n $parts[] = $this->endDate->toIso8601String();\n }\n\n return implode('/', $parts);\n }", "public function toAtomString()\n {\n return $this->format(\\DateTime::ATOM);\n }", "public function toString () {\n\t\treturn date(\"Y-m-d H:i:s\", (int)($this->__t));\n\t}", "public function toAtomString();", "function recure2string($event)\n\t{\n\t\tif (!is_array($event)) return false;\n\t\treturn (string)calendar_rrule::event2rrule($event);\n\t}", "public function __toString() {\n\t\treturn $this->_date->toString();\n\t}", "public function toISO8601(): Str\n {\n return $this->toFormatInternal(\\Datetime::ISO8601);\n }", "function getAppointmentStatus($option){\n\t\t$name = '';\n\t\tswitch($option){\n\t\t\tcase 'sol':\t$name = 'Solicitada';\tbreak;\n\t\t\tcase 'con':\t$name = 'Confirmada';\tbreak;\n\t\t\tcase 'cum':\t$name = 'Cumplida';\t\tbreak;\n\t\t\tcase 'inc':\t$name = 'Incumplida';\tbreak;\n\t\t\tcase 'can':\t$name = 'Cancelada';\tbreak;\n\t\t}\n\t\treturn $name;\n\t}", "public function toIso8601(): string\n {\n return $this->dateTime->format('c');\n }", "public function __toString()\n {\n return \"Delivery [date_\". $this->reservationDate . \"]\";\n }", "public function toATOMString()\n {\n return $this->format(DateTime::ATOM);\n }", "public function __toString() : string {\n if ($this->id) {\n return 'AU #' . $this->id;\n }\n\n return 'new AU';\n }", "function dt_sc_book_appointment($attrs, $content = null) {\n\t\t$content = DTCoreShortcodesDefination::dtShortcodeHelper ( $content );\n\t\treturn '<div class=\"dt-sc-appointment\">'.$content.'</div>';\n\t}", "public function toShortDayName() {\n\t\treturn $this->formatLocalized('%a');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
renders the logout button form
public function renderLogoutButton() {}
[ "public function logout_form_api()\n {\n $this->view->setTemplate('user_logout');\n $this->view->render();\n }", "public function renderLogoutFormular() {\n echo \n \"<div class='logoutFormular'>\n <form method='GET'>\n <input class='logoutButton' type='submit' name='logout' value='Ausloggen'>\n </form>\n </div>\n </div><!--END div class 'header'-->\"; // 2nd \"</div>\" --> end class \"header\" \n }", "private function generateLogoutButtonHTML() {\n\t\treturn '\n\t\t\t<form method=\"post\" >\n\t\t\t\t<p id=\"' . self::$messageId . '\">' . $this->logInMessage .'</p>\n\t\t\t\t<input type=\"submit\" name=\"' . self::$logout . '\" value=\"logout\"/>\n\t\t\t</form>\n\t\t';\n\t}", "private function generateLogoutButtonHTML() {\n\t\treturn '\n\t\t\t<form method=\"post\" >\n\t\t\t\t<p id=\"' . self::$messageId . '\">' . $this->session->getSessionUserMessage() .'</p>\n\t\t\t\t<input type=\"submit\" name=\"' . self::$logout . '\" value=\"logout\"/>\n\t\t\t</form>\n\t\t';\n\t}", "private function generateLogoutButtonHTML() {\n\t\treturn '\n\t\t\t<form method=\"post\" >\n\t\t\t\t<p id=\"' . self::$messageId . '\">' . $this->message .'</p>\n\t\t\t\t<input type=\"submit\" name=\"' . self::$logout . '\" value=\"logout\"/>\n\t\t\t</form>\n\t\t';\n\t}", "private function generateLogoutButtonHTML() \n\t{\n\t\treturn '\n\t\t\t<form method=\"post\" >\n\t\t\t\t<p id=\"' . self::$messageId . '\">' . $_SESSION['Message'] .'</p>\n\t\t\t\t<input type=\"submit\" name=\"' . self::$logout . '\" value=\"logout\"/>\n\t\t\t</form>\n\t\t';\n\t}", "private function generateLogoutButtonHTML()\n {\n\t\treturn '\n\t\t\t<form method=\"post\" >\n\t\t\t\t<p id=\"' . self::$messageId . '\">' . $_SESSION['Message'] .'</p>\n\t\t\t\t<input type=\"submit\" name=\"' . self::$logout . '\" value=\"logout\"/>\n\t\t\t</form>\n\t\t';\n\t}", "private function generateLogoutButtonFormHTML() : string {\n\t\treturn '\n\t\t\t<form method=\"post\" >\n\t\t\t\t<p id=\"' . self::$messageId . '\">' . $this->session->getMessage() .'</p>\n\t\t\t\t<input type=\"submit\" name=\"' . self::$logout . '\" value=\"logout\"/>\n\t\t\t</form>\n\t\t';\n\t}", "final public static function showLogout()\n {\n ; ?>\n <form method=\"post\" action=\"<?php echo str_replace('index.php', '', $_SERVER['PHP_SELF']); ?>\">\n <input type=\"hidden\" name=\"logout\">\n <input type=\"submit\" value=\"Log uit\">\n </div> <!-- End Box -->\n </form>\n <?php\n }", "public function generateLogoutForm()\n {\n $form = \"Du är inte inloggad.\";\n if ($this->isAuthenticated()) {\n $form = <<<EOD\n <form method=\"post\" action=\"\">\n <p class=\"submit\"><input type=\"submit\" name=\"logout\" value=\"Logga ut\"></p>\n </form>\nEOD;\n return $form;\n }\n return $form;\n }", "public function login_logout_button()\n\t{\n\t\treturn $this->login();\n\t}", "public function renderForm() {\n $redirectToPrior = $this->getProperty('redirectToPrior',false,'isset');\n $tpl = $this->isAuthenticated ? $this->getProperty('logoutTpl') : $this->getProperty('loginTpl');\n $actionMsg = $this->isAuthenticated\n ? $this->getProperty('logoutMsg',$this->modx->lexicon('login.logout'))\n : $this->getProperty('loginMsg',$this->modx->lexicon('login'));\n\n $this->modx->setPlaceholder('actionMsg', $actionMsg);\n $phs = $this->isAuthenticated ? $this->getProperties() : array_merge($this->getProperties(), $_POST);\n \n /* make sure to strip out logout GET parameter to prevent ghost logout */\n $logoutKey = $this->getProperty('logoutKey','logout');\n if (!$redirectToPrior) {\n $phs['request_uri'] = str_replace(array('?service='.$logoutKey,'&service='.$logoutKey,'&amp;service='.$logoutKey),'',$_SERVER['REQUEST_URI']);\n } else {\n $phs['request_uri'] = str_replace(array('?service='.$logoutKey,'&service='.$logoutKey,'&amp;service='.$logoutKey),'',$_SERVER['HTTP_REFERER']);\n }\n\n $phs = $this->escapePlaceholders($phs);\n\n /* properly build logout url */\n if ($this->isAuthenticated) {\n $phs['logoutUrl'] = $phs['request_uri'];\n $phs['logoutUrl'] .= strpos($phs['logoutUrl'],'?') ? ($this->modx->getOption('xhtml_urls',null,false) ? '&amp;' : '&') : '?';\n $phs['logoutUrl'] .= $phs['actionKey'].'='.$phs['logoutKey'];\n $phs['logoutUrl'] = str_replace(array('?=', '&=', '&amp;='), '', $phs['logoutUrl']);\n }\n\n $this->loadReCaptcha();\n\n if ($this->isAuthenticated && $this->getProperty('loggedinResourceId') && $this->modx->resource->get('id') != $this->getProperty('loggedinResourceId')) {\n $url = $this->modx->makeUrl($this->getProperty('loggedinResourceId'), '', '', 'full');\n $this->modx->sendRedirect($url);\n }\n if (!$this->isAuthenticated && $this->getProperty('loggedoutResourceId') && $this->modx->resource->get('id') != $this->getProperty('loggedoutResourceId')) {\n $url = $this->modx->makeUrl($this->getProperty('loggedoutResourceId'), '', '', 'full');\n $this->modx->sendRedirect($url);\n }\n\n return $this->login->getChunk($tpl,$phs,$this->getProperty('tplType','modChunk'));\n }", "public function logOutHTML(){\n if(($this->loginModel->getLoginDetails()->getIsUserAuthenticated() == true) && ($this->loginModel->getLoginDetails()->getSaveLogin() == true)) { // Kolla så att användaren är autentiserad och om användaren ville spara användaruppgifterna\n $this->setCookies(); // så skapas cookies\n }\n\n $loader = new \\Twig_Loader_Filesystem('./src/view/templates');\n $twig = new \\Twig_Environment($loader, array('cache' => './tmp/cache',));\n $arr = array();\n echo $twig->render('login.twig', $arr);\n }", "public function logout_form($UserClass) {\n if ($_SESSION[\"user_id\"] == $_SESSION[\"loggedin_as\"]) {\n $val = \"Logout\";\n } else {\n $val = sprintf(\"Logout (logged in as %s)\", $_SESSION[\"username\"]);\n }\n ?>\n <form method=\"POST\">\n <input type=\"hidden\" value=\"logout\" name=\"logout\" />\n <input class=\"btn btn-info\" type=\"submit\" value=\"<?php print($val); ?>\" name=\"submit\" /><br />\n </form>\n <?php\n }", "public function logoutAction()\n {\n // Get layout name\n $split_url = explode(\"/\", $_SERVER['REQUEST_URI']);\n $layout_name = $split_url[1];\n // Set layout\n $this->view->setLayout($layout_name);\n $this->view->render('Log Out from Admin Panel!');\n }", "static function logoutLink() {\n return ( \"<td>\" . self::genericLink(\"reg=deact\",l(\"Log out\")).\"</td>\" );\n }", "protected function logoutAction() {\n\t\t$oView = new accountView($this);\n\t\t$oView->showLogoutPage();\n\t}", "public function logoutAction() {\n\t\t$this->get('security.context')->setToken(null);\n\t\t$this->get('request')->getSession()->invalidate();\n\n\t\t// ####################################\n\t\t// catch any login errors (will be made in a function)\n\t\t$request = $this->getRequest();\n\t\t$session = $request->getSession();\n\t\t\n\t\tif ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {\n\n\t\t\t$error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);\n\n\t\t} else {\n\n\t\t\t$error = $session->get(SecurityContext::AUTHENTICATION_ERROR); // should have nothing but we need the variable anyway\n\t\t\t$session->remove(SecurityContext::AUTHENTICATION_ERROR);\n\t\t}\n\n\t\treturn $this->render('IpzenAppBundle:Security:login.html.twig', array('last_username' => $session->get(SecurityContext::LAST_USERNAME),'error' => $error));\n\n\t}", "function showLogoutButton() {\n if ($_SESSION && (!isset($_SESSION['token']) || sizeof($_SESSION) >= 3)) {\n echo \"<div id='headerLogoutButton' class='form-inline float-xs-right'>\";\n echo \"<a class='btn btn-outline-success' href='?type=logout'>Logout</a>\";\n echo \"</div>\";\n }\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Description This function will execute a SQL query, and if it finds any user_id fields, they will be appended to a list and returned. Info status: beta Arguments ciniki: strsql: The SQL string to query the database with. module: The name of the module for the transaction, which should include the package in dot notation. Example: ciniki.artcatalog container_name: The container name to attach the data when only one row returned. row_name: The row name to attached each row to. no_row_error: The error code and msg to return when no rows were returned from the query.
function ciniki_core_dbRspQueryPlusUserIDs(&$ciniki, $strsql, $module, $container_name, $row_name, $no_row_error) { // // Check connection to database, and open if necessary // $rc = ciniki_core_dbConnect($ciniki, $module); if( $rc['stat'] != 'ok' ) { return $rc; } $dh = $rc['dh']; // // Prepare and Execute Query // $result = mysqli_query($dh, $strsql); if( $result == false ) { return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.core.76', 'msg'=>'Database Error', 'pmsg'=>mysqli_error($dh))); } // // Check if any rows returned from the query // if( mysqli_num_rows($result) <= 0 ) { return $no_row_error; } // // FIXME: If hash, then return all rows together as a hash // $rsp = array('stat'=>'ok'); $rsp['num_rows'] = 0; // // Build array of rows // $rsp[$container_name] = array(); $rsp['user_ids'] = array(); ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbParseAge'); while( $row = mysqli_fetch_assoc($result) ) { $rsp[$container_name][$rsp['num_rows']] = array($row_name=>$row); if( $row['user_id'] > 0 ) { array_push($rsp['user_ids'], $row['user_id']); } if( isset($row['age']) ) { $rsp[$container_name][$rsp['num_rows']][$row_name]['age'] = ciniki_core_dbParseAge($ciniki, $row['age']); } $rsp['num_rows']++; } mysqli_free_result($result); return $rsp; }
[ "function qruqsp_core_dbQuery(&$q, $strsql, $module) {\n //\n // Open a connection to the database if one doesn't exist. The\n // dbConnect function will return an open connection if one \n // exists, otherwise open a new one\n //\n $rc = qruqsp_core_dbConnect($q, $module);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n $dh = $rc['dh'];\n\n //\n // Prepare and Execute Query\n //\n $result = mysqli_query($dh, $strsql);\n if( $result == false ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'qruqsp.core.88', 'msg'=>'Database Error', 'pmsg'=>mysqli_error($dh)));\n }\n\n return array('stat'=>'ok', 'handle'=>$result);\n}", "function query ($sql, $params=array(), $param_list=array(), $transaction=false, $strip_tags=false, \r\n $database=\"pgsql\") {\r\n $managerDB = new managerDB();\r\n $connection = $managerDB->conectar($database);\r\n if ($connection!=null) {\r\n $response=array('success'=>true);\r\n try {\r\n $query=$connection->prepare($sql);\r\n foreach ($param_list as $param) {\r\n if ($param=='start' or $param=='limit') {\r\n @$query->bindParam(':'.$param, intval($params[$param]), PDO::PARAM_INT);\r\n } else {\r\n if ($strip_tags) $params[$param]=strip_tags($params[$param]);\r\n @$query->bindParam(':'.$param, $params[$param]);\r\n }\r\n }\r\n if ($transaction) $connection->beginTransaction();\r\n if (count($param_list)>0) {\r\n $query->execute();\r\n } else {\r\n $query->execute($params);\r\n }\r\n if ($transaction) {\r\n $response['insertId']=$query->fetchColumn();\r\n $connection->commit();\r\n }\r\n $response['items']=$query->fetchAll(PDO::FETCH_ASSOC);\r\n $response['total']=$query->rowCount();\r\n } catch(PDOException $error) { \r\n if ($transaction) $connection->rollback();\r\n $response= array('success'=>false, 'error'=>$error->getMessage());\r\n }\r\n } else {\r\n $response= array('success'=>false, 'error'=>'No está conectado al servidor de bases de datos.');\r\n }\r\n return $response;\r\n unset($connection);\r\n unset($query);\r\n }", "private function _query () {\n\t\t$query = \"SELECT id_notebook, name FROM notebooks WHERE\n\t\towner=\".$this->_uid;\n\n\t\tif ( isset( $this->_where[ 'id_notebook' ] ) ) {\n\t\t\t$query .= ' AND id_notebook='.$this->_where[ 'id_notebook' ];\n\t\t} elseif ( isset( $this->_where[ 'name' ] ) ) {\n\t\t\t$query .= \" AND name LIKE '%\".$this->_where[ 'name' ].\"%'\";\n\t\t}\n\n\t\ttry {\n\t\t\t$this->_setResult( 'notebooks', Database::query( $query ) );\n\t\t\t$this->_setSuccess();\n\t\t} catch ( Exception $e ) {\n\t\t\t$this->_setError();\n\t\t}\n\t}", "function getUserSql() {\r\n\t\r\n\t\tglobal $CONN, $CONFIG;\r\n\t\t\r\n\t\t$concat = $CONN->Concat(\"{$CONFIG['DB_PREFIX']}users.last_name\",'\\', \\'',\"{$CONFIG['DB_PREFIX']}users.first_name\");\r\n\t\tif ($this->_journal_settings['members']=='all'){\r\n\t\t\tif ($this->_space_key==$CONFIG['DEFAULT_SPACE_KEY']){ \r\n\t\t\t\t$user_sql = \"SELECT $concat, {$CONFIG['DB_PREFIX']}users.user_key FROM {$CONFIG['DB_PREFIX']}users WHERE {$CONFIG['DB_PREFIX']}users.account_status='1'\";\r\n\t\t\t} else if ($this->_group_key=='0') {\r\n\t\t\t\t$user_sql = \"SELECT $concat, {$CONFIG['DB_PREFIX']}space_user_links.user_key FROM {$CONFIG['DB_PREFIX']}users, {$CONFIG['DB_PREFIX']}space_user_links WHERE {$CONFIG['DB_PREFIX']}space_user_links.user_key={$CONFIG['DB_PREFIX']}users.user_key AND space_key='$this->_space_key' AND {$CONFIG['DB_PREFIX']}space_user_links.access_level_key!='3'\";\r\n\t\t\t} else { \r\n\t\t \t$user_sql = \"SELECT $concat, {$CONFIG['DB_PREFIX']}group_user_links.user_key FROM {$CONFIG['DB_PREFIX']}users, {$CONFIG['DB_PREFIX']}group_user_links WHERE {$CONFIG['DB_PREFIX']}group_user_links.user_key={$CONFIG['DB_PREFIX']}users.user_key AND {$CONFIG['DB_PREFIX']}group_user_links.group_key='$this->_group_key'\";\r\n\t\t\t} \r\n\t\t} else {\r\n\t\t\t$user_sql = \"SELECT $concat, {$CONFIG['DB_PREFIX']}journal_user_links.user_key FROM {$CONFIG['DB_PREFIX']}users, {$CONFIG['DB_PREFIX']}journal_user_links WHERE {$CONFIG['DB_PREFIX']}journal_user_links.user_key={$CONFIG['DB_PREFIX']}users.user_key AND {$CONFIG['DB_PREFIX']}journal_user_links.module_key='$this->_module_key' \";\r\n\t\t} \r\n\t\t\r\n\t\treturn $user_sql;\r\n\t\r\n\t}", "function getListQuery($module, $where = '') {\n\tglobal $log, $current_user;\n\t$log->debug('> getListQuery ' . $module . ',' . $where);\n\t$mod = CRMEntity::getInstance($module);\n\t$crmTable = $mod->crmentityTable;\n\tswitch ($module) {\n\t\tcase 'Accounts':\n\t\t\t$query = 'SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_account.*, vtiger_accountbillads.bill_city, vtiger_accountscf.*\n\t\t\t\tFROM vtiger_account\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_account.accountid\n\t\t\t\tINNER JOIN vtiger_accountbillads ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid\n\t\t\t\tINNER JOIN vtiger_accountshipads ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid\n\t\t\t\tINNER JOIN vtiger_accountscf ON vtiger_account.accountid = vtiger_accountscf.accountid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_account vtiger_account2 ON vtiger_account.parentid = vtiger_account2.accountid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Potentials':\n\t\t\t$query = 'SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_account.accountname, vtiger_potential.related_to, vtiger_potential.potentialname,\n\t\t\t\t\tvtiger_potential.sales_stage, vtiger_potential.amount, vtiger_potential.currency, vtiger_potential.closingdate, vtiger_potential.typeofrevenue,\n\t\t\t\t\tvtiger_potential.email, vtiger_potentialscf.*\n\t\t\t\tFROM vtiger_potential\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_potential.potentialid\n\t\t\t\tINNER JOIN vtiger_potentialscf ON vtiger_potentialscf.potentialid = vtiger_potential.potentialid\n\t\t\t\tLEFT JOIN vtiger_account ON vtiger_potential.related_to = vtiger_account.accountid\n\t\t\t\tLEFT JOIN vtiger_contactdetails ON vtiger_potential.related_to = vtiger_contactdetails.contactid\n\t\t\t\tLEFT JOIN vtiger_campaign ON vtiger_campaign.campaignid = vtiger_potential.campaignid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Leads':\n\t\t\t$val_conv = ((isset($_COOKIE['LeadConv']) && $_COOKIE['LeadConv'] == 'true') ? 1 : 0);\n\t\t\t$query = 'SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_leaddetails.firstname, vtiger_leaddetails.lastname,\n\t\t\t\t\tvtiger_leaddetails.company, vtiger_leadaddress.phone, vtiger_leadsubdetails.website, vtiger_leaddetails.email, vtiger_leadscf.*\n\t\t\t\tFROM vtiger_leaddetails\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_leaddetails.leadid\n\t\t\t\tINNER JOIN vtiger_leadsubdetails ON vtiger_leadsubdetails.leadsubscriptionid = vtiger_leaddetails.leadid\n\t\t\t\tINNER JOIN vtiger_leadaddress ON vtiger_leadaddress.leadaddressid = vtiger_leadsubdetails.leadsubscriptionid\n\t\t\t\tINNER JOIN vtiger_leadscf ON vtiger_leaddetails.leadid = vtiger_leadscf.leadid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 AND vtiger_leaddetails.converted = ' . $val_conv . ' ' . $where;\n\t\t\tbreak;\n\t\tcase 'Products':\n\t\t\t$query = 'SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.description, vtiger_products.*, vtiger_productcf.*\n\t\t\t\tFROM vtiger_products\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_products.productid\n\t\t\t\tINNER JOIN vtiger_productcf ON vtiger_products.productid = vtiger_productcf.productid\n\t\t\t\tLEFT JOIN vtiger_vendor ON vtiger_vendor.vendorid = vtiger_products.vendor_id\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid';\n\t\t\tif ((isset($_REQUEST['from_dashboard']) && $_REQUEST['from_dashboard']) && (isset($_REQUEST['type']) && $_REQUEST['type'] == 'dbrd')) {\n\t\t\t\t$query .= ' INNER JOIN vtiger_inventoryproductrel on vtiger_inventoryproductrel.productid = vtiger_products.productid';\n\t\t\t}\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= ' WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Documents':\n\t\t\t$query = \"SELECT case when (vtiger_users.user_name not like '') then vtiger_users.ename else vtiger_groups.groupname end as user_name,vtiger_crmentity.crmid,\n\t\t\t\t\tvtiger_crmentity.modifiedtime,vtiger_crmentity.smownerid,vtiger_attachmentsfolder.*,vtiger_notes.*\n\t\t\t\tFROM vtiger_notes\n\t\t\t\tINNER JOIN $crmTable as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_notes.notesid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_attachmentsfolder ON vtiger_notes.folderid = vtiger_attachmentsfolder.folderid\";\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$Apache_Tika_URL = GlobalVariable::getVariable('Apache_Tika_URL', '', 'Documents');\n\t\t\tif (!empty($Apache_Tika_URL)) {\n\t\t\t\t$query .= ' LEFT JOIN vtiger_documentsearchinfo ON vtiger_documentsearchinfo.documentid=vtiger_notes.notesid ';\n\t\t\t}\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Contacts':\n\t\t\t$query = 'SELECT vtiger_contactdetails.*, vtiger_contactaddress.*, vtiger_contactsubdetails.*, vtiger_contactscf.*, vtiger_customerdetails.*,\n\t\t\t\t\tvtiger_crmentity.smownerid, vtiger_crmentity.crmid\n\t\t\t\tFROM vtiger_contactdetails\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid\n\t\t\t\tINNER JOIN vtiger_contactaddress ON vtiger_contactaddress.contactaddressid = vtiger_contactdetails.contactid\n\t\t\t\tINNER JOIN vtiger_contactsubdetails ON vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid\n\t\t\t\tINNER JOIN vtiger_contactscf ON vtiger_contactscf.contactid = vtiger_contactdetails.contactid\n\t\t\t\tLEFT JOIN vtiger_account ON vtiger_account.accountid = vtiger_contactdetails.accountid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_contactdetails vtiger_contactdetails2 ON vtiger_contactdetails.reportsto = vtiger_contactdetails2.contactid\n\t\t\t\tLEFT JOIN vtiger_customerdetails ON vtiger_customerdetails.customerid = vtiger_contactdetails.contactid';\n\t\t\tif ((isset($_REQUEST['from_dashboard']) && $_REQUEST['from_dashboard']) && (isset($_REQUEST['type']) && $_REQUEST['type'] == 'dbrd')) {\n\t\t\t\t$query .= ' INNER JOIN vtiger_campaigncontrel on vtiger_campaigncontrel.contactid = vtiger_contactdetails.contactid';\n\t\t\t}\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Emails':\n\t\t\t$query = 'SELECT DISTINCT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.date_start,\n\t\t\t\t\tvtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid\n\t\t\t\tFROM vtiger_activity\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_seactivityrel ON vtiger_seactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\tLEFT JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_seactivityrel.crmid\n\t\t\t\tLEFT JOIN vtiger_cntactivityrel ON vtiger_cntactivityrel.activityid = vtiger_activity.activityid AND vtiger_cntactivityrel.contactid = vtiger_cntactivityrel.contactid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_salesmanactivityrel ON vtiger_salesmanactivityrel.activityid = vtiger_activity.activityid\n\t\t\t\tLEFT JOIN vtiger_emaildetails ON vtiger_emaildetails.emailid = vtiger_activity.activityid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= \"WHERE vtiger_activity.activitytype = 'Emails' AND vtiger_crmentity.deleted = 0 \" . $where;\n\t\t\tbreak;\n\t\tcase 'Faq':\n\t\t\t$query = 'SELECT vtiger_crmentity.crmid, vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime, vtiger_faq.*\n\t\t\t\tFROM vtiger_faq\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_faq.id\n\t\t\t\tLEFT JOIN vtiger_products ON vtiger_faq.product_id = vtiger_products.productid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Vendors':\n\t\t\t$query = 'SELECT vtiger_crmentity.crmid, vtiger_vendor.*\n\t\t\t\tFROM vtiger_vendor\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_vendor.vendorid\n\t\t\t\tINNER JOIN vtiger_vendorcf ON vtiger_vendor.vendorid = vtiger_vendorcf.vendorid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'PriceBooks':\n\t\t\t$query = 'SELECT vtiger_crmentity.crmid, vtiger_pricebook.*, vtiger_currency_info.currency_name\n\t\t\t\tFROM vtiger_pricebook\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_pricebook.pricebookid\n\t\t\t\tINNER JOIN vtiger_pricebookcf ON vtiger_pricebook.pricebookid = vtiger_pricebookcf.pricebookid\n\t\t\t\tLEFT JOIN vtiger_currency_info ON vtiger_pricebook.currency_id = vtiger_currency_info.id\n\t\t\t\tWHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Quotes':\n\t\t\t$query = 'SELECT vtiger_crmentity.*, vtiger_quotes.*, vtiger_quotesbillads.*, vtiger_quotesshipads.*, vtiger_potential.potentialname,\n\t\t\t\t\tvtiger_account.accountname, vtiger_currency_info.currency_name\n\t\t\t\tFROM vtiger_quotes\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_quotes.quoteid\n\t\t\t\tINNER JOIN vtiger_quotesbillads ON vtiger_quotes.quoteid = vtiger_quotesbillads.quotebilladdressid\n\t\t\t\tINNER JOIN vtiger_quotesshipads ON vtiger_quotes.quoteid = vtiger_quotesshipads.quoteshipaddressid\n\t\t\t\tLEFT JOIN vtiger_quotescf ON vtiger_quotes.quoteid = vtiger_quotescf.quoteid\n\t\t\t\tLEFT JOIN vtiger_currency_info ON vtiger_quotes.currency_id = vtiger_currency_info.id\n\t\t\t\tLEFT OUTER JOIN vtiger_account ON vtiger_account.accountid = vtiger_quotes.accountid\n\t\t\t\tLEFT OUTER JOIN vtiger_potential ON vtiger_potential.potentialid = vtiger_quotes.potentialid\n\t\t\t\tLEFT JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_quotes.contactid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users as vtiger_usersQuotes ON vtiger_usersQuotes.id = vtiger_quotes.inventorymanager';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'PurchaseOrder':\n\t\t\t$query = 'SELECT vtiger_crmentity.*, vtiger_purchaseorder.*, vtiger_pobillads.*, vtiger_poshipads.*, vtiger_vendor.vendorname,\n\t\t\t\t\tvtiger_currency_info.currency_name\n\t\t\t\tFROM vtiger_purchaseorder\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_purchaseorder.purchaseorderid\n\t\t\t\tLEFT OUTER JOIN vtiger_vendor ON vtiger_purchaseorder.vendorid = vtiger_vendor.vendorid\n\t\t\t\tLEFT JOIN vtiger_contactdetails ON vtiger_purchaseorder.contactid = vtiger_contactdetails.contactid\n\t\t\t\tINNER JOIN vtiger_pobillads ON vtiger_purchaseorder.purchaseorderid = vtiger_pobillads.pobilladdressid\n\t\t\t\tINNER JOIN vtiger_poshipads ON vtiger_purchaseorder.purchaseorderid = vtiger_poshipads.poshipaddressid\n\t\t\t\tLEFT JOIN vtiger_purchaseordercf ON vtiger_purchaseordercf.purchaseorderid = vtiger_purchaseorder.purchaseorderid\n\t\t\t\tLEFT JOIN vtiger_currency_info ON vtiger_purchaseorder.currency_id = vtiger_currency_info.id\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'SalesOrder':\n\t\t\t$query = 'SELECT vtiger_crmentity.*, vtiger_salesorder.*, vtiger_sobillads.*, vtiger_soshipads.*, vtiger_quotes.subject AS quotename,\n\t\t\t\t\tvtiger_account.accountname, vtiger_currency_info.currency_name\n\t\t\t\tFROM vtiger_salesorder\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid\n\t\t\t\tINNER JOIN vtiger_sobillads ON vtiger_salesorder.salesorderid = vtiger_sobillads.sobilladdressid\n\t\t\t\tINNER JOIN vtiger_soshipads ON vtiger_salesorder.salesorderid = vtiger_soshipads.soshipaddressid\n\t\t\t\tLEFT JOIN vtiger_salesordercf ON vtiger_salesordercf.salesorderid = vtiger_salesorder.salesorderid\n\t\t\t\tLEFT JOIN vtiger_currency_info ON vtiger_salesorder.currency_id = vtiger_currency_info.id\n\t\t\t\tLEFT OUTER JOIN vtiger_quotes ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid\n\t\t\t\tLEFT OUTER JOIN vtiger_account ON vtiger_account.accountid = vtiger_salesorder.accountid\n\t\t\t\tLEFT JOIN vtiger_contactdetails ON vtiger_salesorder.contactid = vtiger_contactdetails.contactid\n\t\t\t\tLEFT JOIN vtiger_potential ON vtiger_potential.potentialid = vtiger_salesorder.potentialid\n\t\t\t\tLEFT JOIN vtiger_invoice_recurring_info ON vtiger_invoice_recurring_info.salesorderid = vtiger_salesorder.salesorderid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Invoice':\n\t\t\t$query = 'SELECT vtiger_crmentity.*, vtiger_invoice.*, vtiger_invoicebillads.*, vtiger_invoiceshipads.*, vtiger_salesorder.subject AS salessubject,\n\t\t\t\t\tvtiger_account.accountname, vtiger_currency_info.currency_name\n\t\t\t\tFROM vtiger_invoice\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid\n\t\t\t\tINNER JOIN vtiger_invoicebillads ON vtiger_invoice.invoiceid = vtiger_invoicebillads.invoicebilladdressid\n\t\t\t\tINNER JOIN vtiger_invoiceshipads ON vtiger_invoice.invoiceid = vtiger_invoiceshipads.invoiceshipaddressid\n\t\t\t\tLEFT JOIN vtiger_currency_info ON vtiger_invoice.currency_id = vtiger_currency_info.id\n\t\t\t\tLEFT OUTER JOIN vtiger_salesorder ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid\n\t\t\t\tLEFT OUTER JOIN vtiger_account ON vtiger_account.accountid = vtiger_invoice.accountid\n\t\t\t\tLEFT JOIN vtiger_contactdetails ON vtiger_contactdetails.contactid = vtiger_invoice.contactid\n\t\t\t\tINNER JOIN vtiger_invoicecf ON vtiger_invoice.invoiceid = vtiger_invoicecf.invoiceid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Campaigns':\n\t\t\t$query = 'SELECT vtiger_crmentity.*, vtiger_campaign.*\n\t\t\t\tFROM vtiger_campaign\n\t\t\t\tINNER JOIN '.$crmTable.' as vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_campaign.campaignid\n\t\t\t\tINNER JOIN vtiger_campaignscf ON vtiger_campaign.campaignid = vtiger_campaignscf.campaignid\n\t\t\t\tLEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid\n\t\t\t\tLEFT JOIN vtiger_products ON vtiger_products.productid = vtiger_campaign.product_id';\n\t\t\t$query .= getNonAdminAccessControlQuery($module, $current_user);\n\t\t\t$query .= 'WHERE vtiger_crmentity.deleted = 0 ' . $where;\n\t\t\tbreak;\n\t\tcase 'Users':\n\t\t\t$query = 'SELECT id,user_name,first_name,last_name,email1,phone_mobile,phone_work,is_admin,status,email2,ename,\n\t\t\t\t\tvtiger_user2role.roleid as roleid,vtiger_role.depth as depth\n\t\t\t\tFROM vtiger_users\n\t\t\t\tINNER JOIN vtiger_user2role ON vtiger_users.id = vtiger_user2role.userid\n\t\t\t\tINNER JOIN vtiger_role ON vtiger_user2role.roleid = vtiger_role.roleid\n\t\t\t\tWHERE deleted=0 ' . $where;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$focus = CRMEntity::getInstance($module);\n\t\t\tif (method_exists($focus, 'getListQuery')) {\n\t\t\t\t$query = $focus->getListQuery($module, $where);\n\t\t\t} else {\n\t\t\t\t$query = \"SELECT * FROM vtiger_crmentity_seq WHERE id='notexist'\"; // return valid empty query\n\t\t\t}\n\t}\n\n\tif ($module != 'Users') {\n\t\t$query = listQueryNonAdminChange($query, $module);\n\t}\n\t$log->debug('< getListQuery');\n\treturn $query;\n}", "function ejecutarConsulta($sql) {\r\n //echo (\"<br>sql:\".$sql);\r\n $result = pg_query($this->link, $sql);\r\n return $result;\r\n }", "private function execute_query($sql) {\n \n // execute the query\n $result = $this->db->Execute($sql);\n // initialise the data array\n $data = array();\n // convert the resultset into a Moodle style object\n if(!empty($result)) {\n while (!$result->EOF) {\n $obj = new stdClass;\n foreach (array_keys($result->fields) as $key) {\n $obj->{$key} = $result->fields[$key];\n }\n $index = reset($result->fields);\n $data[$index] = $obj;\n $result->MoveNext();\n }\n }\n\n // return an array of objects\n return $data;\n \n }", "public abstract function consultar($sql);", "private function executeSql() {\n if (!$this->result = $this->query($this->sql)) {\n $this->setError(\"Failed to execute SQL:\" . $this->sql . \" error (\" . $this->errno - \") \" . $this->error);\n $this->log->error(\"Failed to execute SQL:\" . $this->sql . \" error (\" . $this->errno - \") \" . $this->error);\n }\n return $this->result;\n }", "function ciniki_core_dbSingleCount(&$ciniki, $strsql, $module, $container_name) {\n //\n // Check connection to database, and open if necessary\n //\n $rc = ciniki_core_dbConnect($ciniki, $module);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n $dh = $rc['dh'];\n\n //\n // Prepare and Execute Query\n //\n $result = mysqli_query($dh, $strsql);\n if( $result == false ) {\n error_log(\"SQLERR: [\" . mysqli_errno($dh) . \"] \" . mysqli_error($dh) . \" -- '$strsql'\");\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.core.81', 'msg'=>'Database Error', 'pmsg'=>mysqli_error($dh)));\n }\n\n //\n // FIXME: If hash, then return all rows together as a hash\n //\n $rsp = array('stat'=>'ok');\n $rsp['num_rows'] = 0;\n\n //\n // Build array of rows\n //\n $rsp[$container_name] = 0;\n while( $row = mysqli_fetch_row($result) ) {\n $rsp[$container_name] += $row[0];\n $rsp['num_rows']++;\n }\n\n mysqli_free_result($result);\n\n return $rsp;\n}", "function Query( $q, $user=NULL, $module=NULL )\n{\n if( empty( $user ) ) $user = $this->user;\n if( empty( $module ) ) $module = $this->module;\n \n $act = NULL;\n $q=trim($q);\n //$arr_tmp = str_word_count($q, 1);\n $arr_tmp = explode(\" \",$q);\n //echo '<br>$arr_tmp[0]='.$arr_tmp[0];\n \n if( strstr( strtoupper( $arr_tmp[0] ), strtoupper( 'select' ) ) ) $act = 'select';\n if( strstr( strtoupper( $arr_tmp[0] ), strtoupper( 'update' ) ) ) $act = 'update';\n if( strstr( strtoupper( $arr_tmp[0] ), strtoupper( 'alter' ) ) ) $act = 'update'; \n if( strstr( strtoupper( $arr_tmp[0] ), strtoupper( 'insert' ) ) ) $act = 'insert';\n if( strstr( strtoupper( $arr_tmp[0] ), strtoupper( 'delete' ) ) ) $act = 'delete';\n if( strstr( strtoupper( $arr_tmp[0] ), strtoupper( 'drop' ) ) ) $act = 'delete'; \n if( strstr( strtoupper( $arr_tmp[0] ), strtoupper( 'create') ) ) $act = 'execute'; \n\n switch( $act)\n {\n case 'select': if( $this->IsRead( $user, $module ) )\n {\n $this->db_FreeResult();\n $this->db_Query( $q );\n\n }else\n {\n $this->Msg->show_msg('SYS_RIGHTS_NOT_RIGHTS');\n }\n break;\n case 'update': if( $this->IsUpdate( $user, $module ) )\n {\n $this->db_FreeResult();\n $this->db_Query( $q );\n\n }else\n {\n $this->Msg->show_msg('SYS_RIGHTS_NOT_RIGHTS');\n }\n break;\n case 'insert': if( $this->IsWrite( $user, $module ) )\n {\n $this->db_FreeResult();\n $this->db_Query( $q );\n\n }else\n {\n $this->Msg->show_msg('SYS_RIGHTS_NOT_RIGHTS');\n }\n break;\n case 'delete': if( $this->IsDelete( $user, $module ) )\n {\n $this->db_FreeResult();\n $this->db_Query( $q );\n\n }else\n {\n $this->Msg->show_msg('SYS_RIGHTS_NOT_RIGHTS');\n }\n break;\n case 'execute':if( $this->IsExecute( $user, $module ) )\n {\n $this->db_FreeResult();\n $this->db_Query( $q );\n\n }else\n {\n $this->Msg->show_msg('SYS_RIGHTS_NOT_RIGHTS');\n }\n break;\n default:return false;\n }\n return true;\n}", "public function selectqueryauthid($sql)\n {\n\t\ttry\n {\n\t\t\t$queryid = $this->conn->prepare($sql);\n\t\t\t$queryid->execute(); \n\t\t\t$idarray = $queryid->fetchAll(PDO::FETCH_ASSOC);\n foreach ($idarray as $row)\n {\n $ret = $row['id_users']; \n\t\t\t\t//echo \"ret = \" . $ret; \n }\n\t\t\treturn $ret;\n\t\t}\n\t\tcatch(PDOException $e)\n\t\t{\n\t\t\techo \"Erreur : \" . $e->getMessage();\n\t\t}\n }", "public function execute($sql);", "function execute($sql){\n\n\t\t$result = pg_query($sql) or false;\n\t\treturn $result;\n\t}", "function execute_query($conn, $query, $type, $data)\n{\n $results = array();\n\n $statement = execute($conn, $query, $type, $data);\n\n // fetching results\n // Get metadata for field names\n $meta = $statement->result_metadata();\n\n // checking whether the query returns data\n if (gettype($meta) != 'boolean') {\n // Dynamically creating an array of variables to use to bind the results\n while ($field = $meta->fetch_field()) {\n $var = $field->name;\n $$var = null;\n $fields[$var] = &$$var;\n }\n\n // Bind Results\n call_user_func_array(array($statement, 'bind_result'), $fields);\n\n // filling the array of arrays\n $i = 0;\n $results = array();\n while ($statement->fetch()) {\n $results[$i] = array();\n foreach ($fields as $k => $v)\n $results[$i][$k] = $v;\n $i++;\n }\n }\n\n\n $statement->close();\n\n return $results;\n}", "public function runSqlQuery($sqlQuery);", "public function excecuteStatement() {\n global $language;\n // echo $this->sql. '<br>';\n if ($this->sqlData['function'] === \"delete\" && $this->sqlData['where'] !== 1) {throw new Exception(\"no where clause added in delete statement\", 2);}\n if ($this->sqlData['type'] == \"query\") {\n $stmt;\n try {\n $stmt = $this->conn->prepare($this->sql.';');\n } catch(PDOException $exception) {\n throw new Exception(\"Error in excecuting query statement\" .$exception->getMessage(), 1);\n }\n $this->reset();\n $stmt->execute();\n return $stmt->fetchAll();\n } else if ($this->sqlData['type'] == \"statement\") {\n try {\n $this->conn->exec($this->sql.';');\n } catch(PDOException $exception) {\n throw new Exception(\"Error in excecuting statement\" .$exception->getMessage(), 1);\n }\n return $this->reset();\n } else {\n $language->errors['database'] = ['uknownType', $this->sqlData['type']];\n return $this->reset();\n }\n }", "private function _runSQL($sql)\n {\n \ttry\n \t{\n \t\t$stmt = $this->db->prepare($sql);\n \n \t\t$stmt->execute();\n \t\t$results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n \t\t$stmt->closeCursor();\n \n \t\t//echo var_dump($results);\n \n \t\treturn $results;\n \n \t}\n \tcatch ( Exception $e )\n \t{\n \t\tdie ( $e->getMessage() );\n \t}\n }", "public function rawQueryExecutor($sql){\n //die(var_dump($sql));\n return $this->query($sql)->fetchAll(PDO::FETCH_OBJ);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates test external auth service instance.
protected function createTestAuthExternalService() { return $this->getMock('QsAuthExternalServiceOpenId', array('fake')); }
[ "protected function createTestAuthExternalService() {\n\t\treturn $this->getMock('QsAuthExternalServiceOAuth', array('authenticate'));\n\t}", "public function testAuthenticationServiceAuthenticationCreate()\n {\n }", "private static function create(): AuthenticationService\n {\n return new AuthenticationService(\n UsersRepositoryFactory::get(),\n AccessTokenServiceFactory::get(),\n AuthenticationFactory::get()\n );\n }", "public function getAuthService();", "private function createNewAuth()\n {\n return new Gsa_Sf_Api_Auth;\n }", "public static function buildABTestService() {\n\t\t$abTest = new ABTestService(self::$apiKey, self::$secretKey);\n\t\treturn $abTest;\n\t}", "public function testService()\n {\n $ably = App::make('\\Ably\\Laravel\\AblyService');\n $this->assertInstanceOf(\\Ably\\Laravel\\AblyService::class, $ably);\n\n $this->assertGreaterThan(0, Miscellaneous::systemTime()); // verify that function calls work\n\n $this->assertInstanceOf(\\Ably\\Auth::class, $ably->auth); // verify that accessing members works\n \n $this->assertEquals(self::TEST_KEY, self::retrieveKeyFromAblyAuth($ably->auth)); // check if the instance has the proper auth key\n }", "public function testAuthenticationServiceAuthenticationInformation()\n {\n }", "public function testCreateService()\n {\n $this->serviceLocator->setService('config', [\n 'launch-darkly' => [\n 'api-key' => 'abc',\n 'options' => [\n 'feature_requester_class' => new DummyFeatureRequester(),\n ],\n ],\n ]);\n $this->serviceLocator->setService(\n Application::class,\n $this->getMock(SessionInterface::class)\n );\n\n $service = (new LaunchDarklyFactory())->createService($this->serviceLocator);\n\n static::assertInstanceOf(FeatureFlipInterface::class, $service);\n }", "public function testAuthentication()\n {\n /** @var Client $client */\n $client = $this->getMockBuilder(Client::class)->disableOriginalConstructor()->getMock();\n $api = new Api($client);\n\n static::assertInstanceOf(AuthenticationService::class, $api->authentication());\n }", "public function setUp()\n {\n parent::setUp();\n \n $api = $this->_getInstanceManager();\n $this->service = new D2LWS_User_API($api);\n }", "public function testCreateUserCredentialsTotp()\n {\n }", "public static function factory() {\n\t\treturn new Auth;\n\t}", "public function testCreateService()\n {\n $dummyService = new OcrDummyService();\n $ocrConfig = array('blubb');\n $config = array('ocr' => array('service' => 'test', 'config' => $ocrConfig));\n $serviceLocator = new ServiceManager();\n $serviceLocator->setService('Configuration', $config);\n $serviceLocator->setService('test', $dummyService);\n $service = $this->factory->createService($serviceLocator);\n $this->assertSame($service, $dummyService);\n $this->assertEquals($service->getConfig(), $ocrConfig);\n }", "public static function factory($config = array())\n\t{\n\t\treturn new Simple_Auth($config);\n\t}", "public function testCreateCredential()\n {\n }", "public function __construct(){\n $this->auth = new AuthenticationService();\n }", "public static function factory($config = 'simple_auth')\n\t{\n\t\treturn new Simple_Auth($config);\n\t}", "public static function httpCreate() {\n\t\treturn static::createAndGet(['name' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP_AUTH_PW']]);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set a value of a variable for a module does not update the database and is primarily used for test harnesses.
public function SetValue($varName, $value, $loaded = true) { if ($loaded) { $this->loadedVars = true; } $this->moduleVariables[$varName] = $value; }
[ "public function setModuleVar($moduleVar, $value);", "public function setModuleVar($moduleVar, $value)\n {\n if (!is_null($value)) {\n $this->moduleVars[$moduleVar] = $value;\n }\n }", "abstract function set_var();", "public function setModuleId($value) {\r\n\t\t$this->moduleId = $value;\r\n\t}", "public function setModuleId($value) {\r\n $this->moduleId = $value;\r\n }", "function set_variable($name,$value)\n\t{\n\t\tif ($name == NULL)\n\t\t{\n\t\t\tlog_message(\"error\",\"BackendPro->BeP_Site->set_variable : When transfering a variable a name must be given.\");\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->variables[$name] = $value;\n\t\tlog_message('debug','BackendPro->BeP_Site->set_variable : PHP variable transfer successful: ' . $name);\n\t}", "function setVariableValue($value) {\n $this->variable_value = $value;\n }", "function setModul($value, $modul)\n\t{\n\t\tinclude(\"_mysql.php\");\n\t\t\n\t\tif($databaseConnection->exec(\"UPDATE main_modul SET active='\".$value.\"' WHERE modul='\".$modul.\"'\") === false)\n\t\t{\n\t\t\twriteInLog(2, \"setModul (SQL Error) [Modul: \".$modul.\"]:\".$databaseConnection->errorInfo()[2]);\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t};\n\t}", "public function testUpdateExecutionVariable()\n {\n }", "private function setModule()\n {\n if ( $this->module ) {\n return;\n }\n \n $default = 'index';\n \n\t\tif ( $this->guid == null ) {\n\t\t\t$this->module = $default;\n return;\n\t\t}\n\t\t\n\t\tif ( array_key_exists( $this->guid, $this->modules ) ) {\n\t\t\t$this->module = $this->guid;\n return;\n\t\t}\n\t\t\n\t\t$this->module = 'default';\n }", "public function setVariable($name, $value);", "function setVariable($key, $val);", "public function setVars() {\r\n\t$this->varGlobalContener->save();\r\n}", "public static function set ()\n {\n $var = &self::$variables;\n $arguments = func_get_args ();\n $value = array_pop ( $arguments );\n foreach ( $arguments as $arg )\n {\n $var = &$var [ $arg ];\n }\n $var = $value;\n\n // Assign the variable to global namespace if we're parsing a view\n if ( isset ( self::$variables [ 'framework' ] [ 'in_view' ] ) )\n {\n $var = &$GLOBALS;\n foreach ( $arguments as $arg )\n {\n $var = &$var [ $arg ];\n }\n $var = $value;\n }\n }", "function set_global_var($pVariable, $pValue)\n {\n if (is_numeric($pValue))\n return $this->evaluate(\"Set({$pVariable}={$pValue},g);\");\n else\n return $this->evaluate(\"Set({$pVariable}=\\\"{$pValue}\\\",g);\");\n }", "public function setValue($value) {}", "public function setPersistentVar(string $key, $value);", "public function set($key, $value) {\n\t\t$keyStr = $this->db->quote($key);\n\t\t$valueStr = $this->db->quote($value);\n\t\t$this->db->beginTransaction();\n\t\t$this->db->exec(\"delete from FLX_VARS where sessionID=\\\"$this->sessionID\\\" and varKey=$keyStr\");\n\t \t$this->db->exec(\"insert into FLX_VARS(sessionID, varKey, varValue) values(\\\"$this->sessionID\\\", $keyStr, $valueStr)\");\n\t \t$this->db->commit();\n\n\t}", "function setReqValue(){\n\t\tif (!$this->hasAttribute('i')){\n\t\t $varname=\"tmodule_\" . $this->name;\n\t\t\t$this->_value=$_REQUEST[$varname];\n\t\t}\t\t\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
delete_compensation: AUTHOR (Harsh Chauhan)
public function delete_compensation(Request $request,$enc_id) { $compensation_id = base64_decode($enc_id); $obj_check = $this->PrintingOrderCompensationModel->where('id',$compensation_id)->first(); $order_id = isset($obj_check->order_id) ? ($obj_check->order_id) :''; $obj_delete = $this->PrintingOrderCompensationModel->where('id',$compensation_id)->delete(); if($obj_delete){ Session::flash('success', 'Compensation deleted succeffsully .'); return redirect($this->module_url_path.'/edit_printing_orders/'.base64_encode($order_id)); }else{ Session::flash('error', 'Something went wrong.'); return redirect($this->module_url_path.'/edit_printing_orders/'.base64_encode($order_id)); } }
[ "public function delete_extraproduct(){\n if($this->uri->segment(3) == \"temp\"){\n $id = $this->uri->segment(4);\n $result = MU_Model::deletedRecordById(\"temp_table\",array(\"ID\" => $id));\n }else{\n $id = $this->uri->segment(3);\n $result = MU_Model::deletedRecordById(\"extra_acti\",array(\"extraproduct_id\" => $id));\n }\n if($result) echo 't';\n }", "function m_removeCreditInfo()\n\t{\n\t\t $this->obDb->query =\"DELETE FROM \".CREDITCARDS.\" WHERE iOrderid_FK='\".$this->request['orderid'].\"'\";\n\t\t $this->obDb->updateQuery();\n\t\t $this->libFunc->m_mosRedirect(SITE_URL.\"order/adminindex.php?action=orders.dspDetails&orderid=\".$this->request['invoice']);\t\n\t}", "function delete() {\n if (!in_array('delete', $this->allow)) throw new xException(\"Method not allowed\", 403);\n $t = new xTransaction();\n $t->start();\n // Determines candidat & commission id\n $id_candidat = $this->params['id'];\n $id_commission = xModel::load('candidat', array('id' => $id_candidat))->get(0);\n $id_commission = $id_commission['commission_id'];\n // Soft-deletes foreign 'candidat_formation' entity/ies\n $ids = $this->_get_ids(\n xModel::load('candidat_formation', array('candidat_id'=>$id_candidat))\n );\n foreach ($ids as $id) $t->execute(xModel::load('candidat_formation', array(\n 'id' => $id\n )), 'delete');\n // Nulls foreign 'commission_travail' reference\n $t->execute(xModel::load('commission_travail', array(\n 'id' => $id_commission,\n 'primo_loco' => null,\n 'secondo_loco' => null,\n 'tertio_loco' => null\n )), 'post');\n // Nulls foreign 'commission_travail' reference\n $t->execute(xModel::load('commission_finalisation', array(\n 'id' => $id_commission,\n 'candidat_id' => null\n )), 'post');\n // Soft-deletes actual entity (soft-delete)\n $t->execute(xModel::load('candidat', array(\n 'id' => $id_candidat,\n 'actif' => 0\n )), 'post');\n return $t->end();\n }", "function enrolment_delete() {\n //never actually called\n }", "function eliminarAsignacion()\n {\n\n $id_servidor_software = $this->input->get('id_servidor_software');\n $delete = $this->Mantenedor_model->eliminarAsignacion($id_servidor_software);\n }", "public function delete_higher_secondary() {\n $id = $_POST['edu_id'];\n $certificate = $_POST['certificate'];\n\n $data = array(\n 'edu_certificate_higher_secondary' => ''\n );\n\n $updatedata = $this->common->update_data($data, 'job_add_edu', 'edu_id', $id);\n\n //FOR DELETE IMAGE AND PDF IN FOLDER START\n $path = 'uploads/job_education/main/' . $certificate;\n $path1 = 'uploads/job_education/thumbs/' . $certificate;\n\n unlink($path);\n unlink($path1);\n //FOR DELETE IMAGE AND PDF IN FOLDER END\n echo 1;\n die();\n }", "private function deleteLicense()\n {\n try {\n $sql = \"DELETE FROM s_core_licenses WHERE module = 'SwagCommercial'\";\n $this->container->get('dbal_connection')->query($sql);\n } catch (\\PDOException $e) {\n throw new \\RuntimeException('Could not remove license from database', 0, $e);\n }\n }", "function delCompTran($ctran_id)\n\t{\n\t\t//delete from Employee\n\t\t$delete1 = \"DELETE FROM vendor_transaction WHERE ctran_id = '$ctran_id'\";\n\t\t\n\t\t//execute quary\n\t\t$query1\t= mysql_query($delete1);\n\t\t\n\t}", "public function deleteDebit()\n {\n $table = $this->getTable();\n $where = $table->getAdapter()->quoteInto(\n 'fa_contact_id = ?', $this->_fa_contact_id\n );\n $table->delete($where);\n }", "function removerateAction()\n {\n \t$delete_id = $this->_request->getParam('delete');\n \n \t\n \tif($delete_id != \"\")\n \t{\n \t\t$fitnessworkoutRate = new FitnessWorkoutRates();\n \t\t\n \t\t\n $fitnessworkoutRate->find($delete_id)->current()->delete();\n $this->_redirect('/admin/listworkoutrates');\n \n \n \t}\n }", "public function deleteIrRemout(){\n }", "public function deleted(LeadEscalation $leadEscalation)\n {\n //\n }", "public function delete_addons_rate($addon_rate_id){\r\t\t\t$query=\"delete from `\".$this->table_name_sar.\"` where `id`=$addon_rate_id\";\r\t\t\tmysqli_query($this->conn,$query);\r\t\t}", "public function removeBasedOnContract(){\n\t\tglobal $db;\n\t\t$sql=\"DELETE FROM itemtable WHERE contractPeriod=0\";\n\t\ttry{\n\t\t\t$statement=$db->prepare($sql);\n\t\t\t$statement->execute();\n\t\t\techo 'removed item';\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\techo 'sql error';\n\t\t}\n\n\t}", "function action_delete()\n\t{\n\t\tlog_write(\"debug\", \"cdr_rate_table\", \"Executing action_delete()\");\n\n\n\t\t/*\n\t\t\tStart Transaction\n\t\t*/\n\t\t$sql_obj = New sql_query;\n\t\t$sql_obj->trans_begin();\n\n\n\t\t/*\n\t\t\tdelete rate table\n\t\t*/\n\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"DELETE FROM `cdr_rate_tables` WHERE id='\". $this->id .\"'\";\n\t\t$sql_obj->execute();\n\n\n\t\t/*\n\t\t\tdelete rate table items\n\t\t*/\n\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"DELETE FROM `cdr_rate_tables_values` WHERE id_rate_table='\". $this->id .\"'\";\n\t\t$sql_obj->execute();\n\n\n\n\t\t/*\n\t\t\tCommit\n\t\t*/\n\n\t\tif (error_check())\n\t\t{\n\t\t\t$sql_obj->trans_rollback();\n\n\t\t\tlog_write(\"error\", \"cdr_rate_table\", \"An error occured when deleting the selected rate table, no changes have been made.\");\n\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$sql_obj->trans_commit();\n\n\t\t\tlog_write(\"notification\", \"cdr_rate_table\", \"Rate table details successfully deleted.\");\n\n\t\t\treturn 1;\n\t\t}\n\n\t}", "function delStichRate($rid)\r\n\t{\r\n\t\t\r\n\t\t//delete from product\r\n\t\t$delete1 = \"DELETE FROM stich_rate WHERE rate_id='$rid'\";\r\n\t\t\r\n\t\t//execute quary\r\n\t\t$query1\t= mysql_query($delete1);\r\n\t\t\r\n\t}", "public function delete_compartment()\n {\n $this->request->allowMethod(['post', 'delete']);\n $data = $this->request->data; \n if( $data['vehile_compartment_id'] > 0 ){\n $vehicleCompartment = $this->VehicleCompartments->get($data['vehile_compartment_id']);\n $vehicle_id = $vehicleCompartment->vehicle_id;\n if ($this->VehicleCompartments->delete($vehicleCompartment)) {\n $this->Flash->success(__('The vehicle compartment has been deleted.'));\n } else {\n $this->Flash->error(__('The vehicle compartment could not be deleted. Please, try again.'));\n }\n return $this->redirect(['action' => 'vehicle', $vehicle_id]);\n }else{\n $this->Flash->error(__('The vehicle compartment could not be deleted. Please, try again.'));\n return $this->redirect(['action' => 'index']);\n } \n }", "function delete_donation(){\n\t\t$donorforce_history_id = $_REQUEST['id']; \n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$donor_id = $jinput->get('donor_id', '');\n\t\t$model = $this->getModel();\n\t\t$model->delete_donorforce_history($donorforce_history_id,$donor_id ); \n\t}", "public function deleting(Governorate $governorate)\n {\n //\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the completed camps goals details of the cards for specified project
public static function get_camp_planned_goals($id) { $planned_goals =Project::select(DB::Raw('sum(rb_camps.budget) as budget'),DB::Raw('count(rb_camps.id) as camps'),DB::Raw('sum(rb_camps.no_of_people) as total_villagers'),DB::Raw('sum(rb_camps.order) as orders'),DB::Raw('avg(rb_camps.deliver_time) as deliver_time')); $planned_goals ->join('cards','cards.project_id','=','projects.id'); $planned_goals ->join('camps','camps.card_id','=','cards.id'); $planned_goals->where('projects.id',$id); return $planned_goals->first(); }
[ "public static function get_camp_goals($id)\n {\n $camp_goals =Project::select(DB::Raw('sum(rb_camps.actual_budget) as budget'),DB::Raw('count(rb_camps.id) as camps'),DB::Raw('sum(rb_camps.no_of_people) as total_villagers'),DB::Raw('sum(rb_camps.actual_orders) as orders'),DB::Raw('avg(rb_camps.actual_deliver_time) as deliver_time'));\n $camp_goals ->join('cards','cards.project_id','=','projects.id');\n $camp_goals ->join('camps','camps.card_id','=','cards.id');\n $camp_goals->where('projects.id',$id);\n $camp_goals->whereIn('camps.status',array('1','2'));\n return $camp_goals->first();\n }", "public function getCompletedProjects() {\r\n return json_decode(\r\n $this->client->get(\r\n \"/projects\"\r\n )\r\n );\r\n }", "function getCardioGoals()\n {\n //make array of all cardio goals and index to iterate through\n $cardioGoals = [];\n $index = 0;\n\n //query database to get all cardio distance goals\n $cardioSQL = \"SELECT FITNESS_GOAL_ID,FITNESS_GOAL_DURATION,FITNESS_GOAL_TYPE,FITNESS_GOAL_DISTANCE FROM FITNESS_GOALS WHERE FITNESS_GOAL_OWNER='$this->goalOwner' AND FITNESS_GOAL_TYPE='CARDIO-DISTANCE' AND FITNESS_GOAL_ACTIVE='1'\";\n $cardioQuery = $this->comMod->queryDatabase($cardioSQL);\n\n //add distance goals to array\n while($currGoal = mysqli_fetch_array($cardioQuery))\n {\n //get goal details from database\n $days = $currGoal['FITNESS_GOAL_DURATION'];\n $type = $currGoal['FITNESS_GOAL_TYPE'];\n $milestone = $currGoal['FITNESS_GOAL_DISTANCE'];\n $id = $currGoal['FITNESS_GOAL_ID'];\n\n //create new goal object and add to array\n $goal = new CardioGoal($days, $type, $milestone, $id);\n $cardioGoals[$index] = $goal;\n\n //increase array index\n $index++;\n }//close while\n\n //query database to get all cardio speed goals\n $speedSQL = \"SELECT FITNESS_GOAL_ID,FITNESS_GOAL_DURATION,FITNESS_GOAL_TYPE,FITNESS_GOAL_SPEED FROM FITNESS_GOALS WHERE FITNESS_GOAL_OWNER='$this->goalOwner' AND FITNESS_GOAL_TYPE='CARDIO-SPEED' AND FITNESS_GOAL_ACTIVE='1'\";\n $speedQuery = $this->comMod->queryDatabase($speedSQL);\n\n //add speed goals to array\n while($currGoal = mysqli_fetch_array($speedQuery))\n {\n //get goal details from database\n $days = $currGoal['FITNESS_GOAL_DURATION'];\n $type = $currGoal['FITNESS_GOAL_TYPE'];\n $milestone = $currGoal['FITNESS_GOAL_SPEED'];\n $id = $currGoal['FITNESS_GOAL_ID'];\n\n //create new goal object and add to array\n $goal = new CardioGoal($days, $type, $milestone, $id);\n $cardioGoals[$index] = $goal;\n\n //increase array index\n $index++;\n }//close while\n\n //query database to get all cardio time goals\n $timeSQL = \"SELECT FITNESS_GOAL_ID,FITNESS_GOAL_DURATION,FITNESS_GOAL_TYPE,FITNESS_GOAL_TIME FROM FITNESS_GOALS WHERE FITNESS_GOAL_OWNER='$this->goalOwner' AND FITNESS_GOAL_TYPE='CARDIO-TIME' AND FITNESS_GOAL_ACTIVE='1'\";\n $timeQuery = $this->comMod->queryDatabase($timeSQL);\n\n //add time goals to array\n while($currGoal = mysqli_fetch_array($timeQuery))\n {\n //get goal details from database\n $days = $currGoal['FITNESS_GOAL_DURATION'];\n $type = $currGoal['FITNESS_GOAL_TYPE'];\n $milestone = $currGoal['FITNESS_GOAL_TIME'];\n $id = $currGoal['FITNESS_GOAL_ID'];\n\n //create new goal object and add to array\n $goal = new CardioGoal($days, $type, $milestone, $id);\n $cardioGoals[$index] = $goal;\n\n //increase array index\n $index++;\n }//close while\n\n //return array of all three cardio goal types\n return $cardioGoals;\n }", "public function getExecTeamGoals()\n {\n //load database\n $db = $this->getDb();\n $query = $db->getQuery(true);\n\n //load goals associated with team id\n $query->select(\"g.*,u.first_name,u.last_name,IF(t.name!='',t.name,\" . $query->concatenate(array('u.first_name', $db->quote(' '), 'u.last_name')) . \") AS team_name\")->from(\"#__goals AS g\");\n $db->setQuery($query);\n\n //if we are searching for a specific team\n $query->where(\"g.assigned_type=\" . $db->quote('team'));\n\n //left join managers name\n $query->leftJoin(\"#__teams AS t ON t.team_id = g.assigned_id\");\n $query->leftJoin(\"#__users AS u on u.id = t.leader_id\");\n\n $query->where(\"g.published=\".$this->published);\n\n //load results\n $results = $db->loadAssocList();\n\n //get essential data\n $this->won_stage_ids = DealHelper::getWonStages();\n if ( count($results) > 0 ){ foreach ($results as $key=>$goal) {\n $results[$key]['goal_info'] = $this->goalInfo($goal);\n }\n }\n\n //return goals\n return $results;\n }", "function getCardioGoals()\n {\n return $this->cardioGoals;\n }", "public function getQuests();", "public function getProjectEffort();", "public function checkStatusOfRedcapProjects() {\n\n $projectData = array();\n $today = date(\"Y-m-d\");\n $one_year_ago = date('Y-m-d', strtotime(\"$today - 1 YEAR\"));\n\n // Retrieve the list of current projects in the REDCap project\n $currentProjects = REDCap::getData($this->pid, 'array', null, $this->projFields, $this->event_id);\n if (!empty($currentProjects)) {\n\n // Put into a usable format [{record_id1: {field1:value1, field2:value2, ...}}, {record_id2: {field1:value1, field2:value2, ...}}]\n foreach ($currentProjects as $proj_id => $thisRecord) {\n\n $oneRecord = $thisRecord[$this->event_id];\n $record_id = $oneRecord['project_id'];\n $projectData[$record_id] = $oneRecord;\n }\n }\n\n // if a project is marked to be deleted, date_deleted will be set, otherwise look at status (0=development, 1=production, 2=inactive, 3=archived, 4=deleted)\n // created_by is a number (link with redcap_user_information). If a project is really deleted, there will not be any data in redcap.\n // purpose is 0, 1, 2, 3, 4 (when Research (2), there will be an IRB number and project_pi_alias)\n $sql = \"select project_id as project_id, creation_time as proj_create_date, app_title as proj_title, purpose as proj_purpose, \" .\n \"project_irb_number as proj_irb, project_pi_alias as proj_pi, last_logged_event as proj_last_log_entry, \" .\n \"case when date_deleted is NULL then status else \" . self::MARKED_TO_BE_DELETED . \" end as proj_status \" .\n \" from redcap_projects \" .\n \" order by project_id asc\";\n $q = db_query($sql);\n $updateData = array();\n $dbRecordList = array();\n while ($current_db_row = db_fetch_assoc($q)) {\n\n // These are all the current projects from the database, make sure they match the status of the project in project 47\n // If not update the status or insert the record if it currently does not exist.\n $current_record = array();\n $record_id = $current_db_row['project_id'];\n $dbRecordList[] = $record_id;\n $current_proj_row = $projectData[$record_id];\n\n if (empty($current_proj_row)) {\n $differences = $current_db_row;\n } else {\n $differences = array_diff($current_db_row, $current_proj_row);\n }\n\n if (!empty($differences)) {\n\n // Save the differences and add the date stamp so we know the last time the project info was updated\n $current_record = $differences;\n $current_record['proj_status_update'] = $today;\n $current_record['project_overview_complete'] = 2;\n\n // If this is a new project, find a designated contact\n if (empty($current_proj_row)) {\n $contact = $this->designatedContact($record_id);\n if (!empty($contact)) {\n $current_record = array_merge($current_record, $contact);\n }\n }\n\n // If the last log entry is over a year old and the project is in Dev(0) or Prod(1), move to Inactive or Archived\n if (isset($current_db_row['proj_last_log_entry']) && ($current_db_row['proj_last_log_entry'] < $one_year_ago)\n && (($current_db_row['proj_status'] == self::DEVELOPMENT) || ($current_db_row['proj_status'] == self::PRODUCTION))) {\n\n //$this->config->emLog(\"This is the last log entry for project $record_id: \" . $current_db_row['proj_last_log_entry']);\n $inactiveStatus = $this->moveProjectInactive($record_id, $current_db_row['proj_status']);\n if (!empty($inactiveStatus)) {\n $current_record = array_merge($current_record, $inactiveStatus);\n }\n } else if (isset($current_db_row['proj_last_log_entry']) &&\n (($current_db_row['proj_status'] == self::DEVELOPMENT) || ($current_db_row['proj_status'] == self::PRODUCTION))) {\n\n // If the last long entry is different than last time, retrieve the number of log entries in the last 3 months\n $lastLogCount = $this->lastLogCount($record_id, $current_db_row['proj_last_log_entry']);\n if (!empty($lastLogCount)) {\n $current_record = array_merge($current_record, $lastLogCount);\n }\n }\n }\n\n // If there is data to save, add it to the save list.\n if (!empty($current_record)) {\n if (empty($current_record['project_id'])) {\n $current_record['project_id'] = $record_id;\n }\n $updateData[$record_id] = $current_record;\n }\n }\n\n // Update all project information that was accumlated\n if (!empty($updateData)) {\n $this->config->emDebug(\"Data before saveData: \" . json_encode($updateData));\n $return_status = REDCap::saveData($this->pid, 'json', json_encode($updateData));\n $this->config->emDebug(\"Return status from saveData: \" . json_encode($return_status));\n }\n\n // Now check for missing records and make sure they are marked as permanently deleted in our REDCap project\n $deletedRecords = $this->checkForDeletedProjects($dbRecordList, $projectData, $today);\n if (!empty($deletedRecords)) {\n $this->config->emDebug(\"All records to save for delete: \" . json_encode($deletedRecords));\n $return_status = REDCap::saveData($this->pid, 'json', json_encode($deletedRecords));\n $this->config->emDebug(\"Return status from saveData for delete: \" . json_encode($return_status));\n }\n\n }", "function Get_Award_List_project($project_id)\n\t{\n\t\tglobal $db1;\n\t\t$sql = \"SELECT * FROM \".BID_MASTER\n\t\t\t .\" WHERE project_id = '\".$project_id.\"' AND bid_status = 1 \";\n\t\t$db1->query($sql);\n\t}", "public static function getStoriesInProject()\n {\n $res_des = Auth::user()->designation;\n $res_id = Auth::user()->id;\n $current_team_id = \"\";\n $result_project = \"\";\n $user_stories = \"\";\n\n if ($res_des == 'Developer') {\n\t\t\t// Get Team that current user has been assigned to\n $result_teams = DB::table('dev_team')->where('user_id', '=', $res_id)->get();\n\n foreach ($result_teams as $result_team) {\n $current_team_id = $result_team->team_id;\n }\n\t\t\t\n\t\t\t// Get Project that the Team has been assigned to\n $result_project_ids = DB::table('assign_teams')->where('team_id', '=', $current_team_id)->get();\n\n foreach ($result_project_ids as $result_project_id) {\n $result_project = $result_project_id->ProjectID;\n }\n\n\t\t\t// Get user Stories relevant to the resolved Project\n $user_stories = DB::table('user_stories')->where('project_id', $result_project)->get();\n\n } else if ($res_des == 'Project Manager' || $res_des == 'Account Head') {\n\t\t\t// For Project Managers and Account Head, return all Stories\n $user_stories = DB::table('user_stories')->get();\n }\n\n\n return $user_stories;\n }", "public function getGoals()\r\n {\r\n return $this->goals;\r\n }", "public function getProjectChallenges($project_id)\n {\n $query = \"SELECT * FROM project_challenges where project_id = :projectId\";\n $pdostm = $this->dbcon->prepare($query);\n $pdostm->bindParam(':projectId', $project_id);\n $pdostm->execute();\n\n //fetch result\n $result = $pdostm->fetch(\\PDO::FETCH_OBJ);\n return $result;\n }", "function project_projactivities() {\n return project_projactivities_list();\n}", "function generateProjectCards(array $projects) {\n $result = \"\";\n foreach ($projects as $p) {\n $result .= \"<div class='projectCard anim' style='--delay: .1s'>\";\n $result .= \"<div class='textContainer'>\";\n if (isset($p->hostlink)) {\n $result .= \"<div class='projectCardTitle'><a class='projectCardTitleLink' href='$p->hostlink' target='_blank'>$p->name</a></div>\";\n } else {\n $result .= \"<div class='projectCardTitle'>$p->name</div>\";\n }\n $result .= \"<div class='description-text'>$p->description</div>\";\n $result .= \"<div class='linksContainer'>\";\n if (isset($p->hostlink)) {\n $result .= \"<a href='$p->hostlink' target='_blank'><span class='links fab fa-edge'></span></a>\";\n }\n if (isset($p->githublink)) {\n $result .= \"<a href='$p->githublink' target='_blank'><span class='links fab fa-github-square'></span></a>\";\n }\n $result .= \"</div></div><img class='projectImage' src='$p->imagepath'></div>\";\n }\n return $result;\n }", "function getCommissionWiseProjectSummary($sector_division)\n {\n $current_fiscal_year = getCurrentFiscalYear();\n $fiscal_year_date = getFiscalYearDats($current_fiscal_year);\n \n //dumpVar($fiscal_year_date['end_date']);\n \n $info['table'] = PROJECT_TBL . ' AS PT LEFT JOIN ' . \n MINISTRY_LOOKUP_TBL . ' AS MLT ON (PT.ministry_id = MLT.id) LEFT JOIN ' . \n AGENCY_LOOKUP_TBL . ' AS ALT ON (ALT.id=PT.agency_id) LEFT JOIN ' . \n VIEW_PROJECT_GRAND_TOTAL . ' AS VPGT ON (PT.id = VPGT.pid)';\n $info['debug'] = false;\n $info['where'] = 'PT.status = ' . q('Approved') . \n ' AND PT.sector_division = ' . $sector_division . \n ' AND ' . q($fiscal_year_date['end_date']) . ' <= PT.date_of_completion' .\n ' GROUP BY PT.ministry_id, PT.agency_id';\n $info['fields'] = array('COUNT(PT.id) AS project_count', 'MLT.name AS ministry_name', 'ALT.name AS agency_name', 'PT.date_of_completion', \n 'PT.ministry_id', 'PT.agency_id', 'PT.status', 'SUM(VPGT.total_cost)', 'SUM(VPGT.gob_cost)', 'SUM(VPGT.pa_through_gob_cost)', \n 'SUM(VPGT.pa_spc_acnt_cost)', 'SUM(VPGT.pa_dpa_cost)', 'SUM(VPGT.own_fund_cost)', 'SUM(VPGT.other_cost)');\n \n $result = select($info);\n //dumpvar($result);\n if ($result)\n {\n foreach($result AS $value)\n {\n $retData[$value->ministry_name][$value->agency_name] = $value;\n }\n }\n \n return $retData;\n }", "public function engagementPhaseProjectsAction()\n {\n\t \t$em = $this->getDoctrine()->getManager();\n\t \t \n\t \t$dql = \"SELECT p FROM LittleBigJoeCoreBundle:Project p WHERE p.status = 1\";\n\t \t$query = $em->createQuery($dql);\n\t \t \n\t \t$paginator = $this->get('knp_paginator');\n\t \t$pagination = $paginator->paginate(\n\t \t\t\t$query,\n\t \t\t\t$this->get('request')->query->get('page', 1),\n\t \t\t\t$this->container->getParameter('nb_elements_by_page')\n\t \t);\n\t \t \n\t \treturn array(\n\t \t\t\t'pagination' => $pagination\n\t \t);\n }", "public function getExecIndividualGoals()\n {\n //load database\n $db = $this->getDb();\n $query = $db->getQuery(true);\n\n //load goals associated with an individual\n $member_id = UsersHelper::getUserId();\n $query->select(\"g.*,u.first_name,u.last_name\")->from(\"#__goals AS g\");\n\n //if we are seaching for a specific individual\n $query->where(\"g.assigned_type=\" . $db->quote('member'));\n\n //left join users names\n $query->leftJoin(\"#__users AS u ON u.id = g.assigned_id\");\n\n $query->where(\"g.published=\".$this->published);\n\n //get goals\n $db->setQuery($query);\n $results = $db->loadAssocList();\n\n //get essential data\n $this->won_stage_ids = DealHelper::getWonStages();\n if ( count($results) > 0 ){ foreach ($results as $key=>$goal) {\n $results[$key]['goal_info'] = $this->goalInfo($goal);\n }\n }\n\n //return results\n return $results;\n }", "public function getProjects();", "function get($project_id, $qa_step_id) {\n $q = \"SELECT ps.*, s.*, p.*, doc.*,\";\n $q .= \" usr.fullname AS responsible_fullname, usr.email AS responsible_email\";\n $q .= \" FROM qa_project_step ps\";\n $q .= \" LEFT OUTER JOIN usr ON (usr.user_no=ps.responsible_usr),\";\n $q .= \" qa_step s\";\n $q .= \" LEFT OUTER JOIN qa_document AS doc ON (doc.qa_document_id=s.qa_document_id),\";\n $q .= \" qa_phase p\";\n $q .= \" WHERE ps.project_id=$project_id\";\n $q .= \" AND ps.qa_step_id=$qa_step_id\";\n $q .= \" AND s.qa_step_id=ps.qa_step_id\";\n $q .= \" AND p.qa_phase=s.qa_phase\";\n $q .= \" ORDER BY p.qa_phase_order, s.qa_step_order\";\n $qry = new PgQuery($q);\n if ($qry->Exec(\"qa_project_step::get\") && $qry->rows > 0) {\n $row = $qry->Fetch(true);\n $this->project_id = $row[\"project_id\"];\n $this->request_id = $row[\"request_id\"];\n $this->assign_from_row($row);\n $this->valid = true;\n }\n return $this->valid;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the private 'console.command.cache_warmup' shared service.
protected function getConsole_Command_CacheWarmupService() { include_once \dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php'; include_once \dirname(__DIR__, 4).'/vendor/symfony/framework-bundle/Command/CacheWarmupCommand.php'; $this->privates['console.command.cache_warmup'] = $instance = new \Symfony\Bundle\FrameworkBundle\Command\CacheWarmupCommand(($this->services['cache_warmer'] ?? $this->getCacheWarmerService())); $instance->setName('cache:warmup'); return $instance; }
[ "protected function getSonata_Admin_Route_CacheWarmupService()\n {\n return $this->services['sonata.admin.route.cache_warmup'] = new \\Sonata\\AdminBundle\\Route\\RoutesCacheWarmUp(${($_ = isset($this->services['sonata.admin.route.cache']) ? $this->services['sonata.admin.route.cache'] : $this->get('sonata.admin.route.cache')) && false ?: '_'}, ${($_ = isset($this->services['sonata.admin.pool']) ? $this->services['sonata.admin.pool'] : $this->get('sonata.admin.pool')) && false ?: '_'});\n }", "protected function getConsole_Command_Cache_PurgeService()\n {\n return $this->services['console.command.cache.purge'] = new \\phpbb\\console\\command\\cache\\purge($this->get('user'), $this->get('cache.driver'), $this->get('dbal.conn'), $this->get('auth'), $this->get('log'), $this->get('config'));\n }", "protected function getSonata_Admin_Route_CacheWarmupService()\n {\n return $this->services['sonata.admin.route.cache_warmup'] = new \\Sonata\\AdminBundle\\Route\\RoutesCacheWarmUp($this->get('sonata.admin.route.cache'), $this->get('sonata.admin.pool'));\n }", "protected function getConsole_Command_CachePoolPruneService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Command\\\\CachePoolPruneCommand.php';\n\n $this->privates['console.command.cache_pool_prune'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Command\\CachePoolPruneCommand(new RewindableGenerator(function () {\n yield 'cache.app' => ($this->services['cache.app'] ?? $this->getCache_AppService());\n yield 'cache.system' => ($this->services['cache.system'] ?? $this->getCache_SystemService());\n yield 'cache.validator' => ($this->privates['cache.validator'] ?? $this->getCache_ValidatorService());\n yield 'cache.serializer' => ($this->privates['cache.serializer'] ?? $this->getCache_SerializerService());\n yield 'cache.annotations' => ($this->privates['cache.annotations'] ?? $this->getCache_AnnotationsService());\n yield 'cache.property_info' => ($this->privates['cache.property_info'] ?? $this->getCache_PropertyInfoService());\n yield 'cache.messenger.restart_workers_signal' => ($this->privates['cache.messenger.restart_workers_signal'] ?? $this->getCache_Messenger_RestartWorkersSignalService());\n yield 'cache.security_expression_language' => ($this->privates['cache.security_expression_language'] ?? $this->getCache_SecurityExpressionLanguageService());\n yield 'cache.doctrine.orm.default.metadata' => ($this->privates['cache.doctrine.orm.default.metadata'] ?? $this->getCache_Doctrine_Orm_Default_MetadataService());\n yield 'cache.doctrine.orm.default.result' => ($this->privates['cache.doctrine.orm.default.result'] ?? $this->getCache_Doctrine_Orm_Default_ResultService());\n yield 'cache.doctrine.orm.default.query' => ($this->privates['cache.doctrine.orm.default.query'] ?? $this->getCache_Doctrine_Orm_Default_QueryService());\n yield 'cache.easyadmin' => ($this->privates['cache.easyadmin'] ?? $this->getCache_EasyadminService());\n }, 12));\n\n $instance->setName('cache:pool:prune');\n\n return $instance;\n }", "protected function getConsole_Command_CachePoolPruneService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/framework-bundle/Command/CachePoolPruneCommand.php';\n\n $this->privates['console.command.cache_pool_prune'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Command\\CachePoolPruneCommand(new RewindableGenerator(function () {\n yield 'cache.app' => ($this->services['cache.app'] ?? $this->getCache_AppService());\n yield 'cache.system' => ($this->services['cache.system'] ?? $this->getCache_SystemService());\n yield 'cache.validator' => ($this->privates['cache.validator'] ?? $this->getCache_ValidatorService());\n yield 'cache.serializer' => ($this->privates['cache.serializer'] ?? $this->getCache_SerializerService());\n yield 'cache.annotations' => ($this->privates['cache.annotations'] ?? $this->getCache_AnnotationsService());\n yield 'cache.property_info' => ($this->privates['cache.property_info'] ?? $this->getCache_PropertyInfoService());\n yield 'cache.security_expression_language' => ($this->privates['cache.security_expression_language'] ?? $this->getCache_SecurityExpressionLanguageService());\n yield 'cache.doctrine.orm.default.metadata' => ($this->privates['cache.doctrine.orm.default.metadata'] ?? $this->getCache_Doctrine_Orm_Default_MetadataService());\n yield 'cache.doctrine.orm.default.result' => ($this->privates['cache.doctrine.orm.default.result'] ?? $this->getCache_Doctrine_Orm_Default_ResultService());\n yield 'cache.doctrine.orm.default.query' => ($this->privates['cache.doctrine.orm.default.query'] ?? $this->getCache_Doctrine_Orm_Default_QueryService());\n yield 'api_platform.cache.route_name_resolver' => ($this->privates['api_platform.cache.route_name_resolver'] ?? $this->getApiPlatform_Cache_RouteNameResolverService());\n yield 'api_platform.cache.identifiers_extractor' => ($this->privates['api_platform.cache.identifiers_extractor'] ?? $this->getApiPlatform_Cache_IdentifiersExtractorService());\n yield 'api_platform.cache.subresource_operation_factory' => ($this->privates['api_platform.cache.subresource_operation_factory'] ?? $this->getApiPlatform_Cache_SubresourceOperationFactoryService());\n yield 'api_platform.cache.metadata.resource' => ($this->privates['api_platform.cache.metadata.resource'] ?? $this->getApiPlatform_Cache_Metadata_ResourceService());\n yield 'api_platform.cache.metadata.property' => ($this->privates['api_platform.cache.metadata.property'] ?? $this->getApiPlatform_Cache_Metadata_PropertyService());\n yield 'api_platform.graphql.cache.subscription' => ($this->privates['api_platform.graphql.cache.subscription'] ?? $this->getApiPlatform_Graphql_Cache_SubscriptionService());\n yield 'cache.webpack_encore' => ($this->privates['cache.webpack_encore'] ?? $this->getCache_WebpackEncoreService());\n }, 17));\n\n $instance->setName('cache:pool:prune');\n\n return $instance;\n }", "protected function getCache_AppService()\n {\n return $this->services['cache.app'] = new \\Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter('tVvti075WD', 0, (__DIR__.'/pools'));\n }", "protected function getConsole_Command_CachePoolClearService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\console\\\\Command\\\\Command.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\framework-bundle\\\\Command\\\\CachePoolClearCommand.php';\n\n $this->privates['console.command.cache_pool_clear'] = $instance = new \\Symfony\\Bundle\\FrameworkBundle\\Command\\CachePoolClearCommand(($this->services['cache.global_clearer'] ?? $this->getCache_GlobalClearerService()));\n\n $instance->setName('cache:pool:clear');\n\n return $instance;\n }", "protected function getCache_SystemClearerService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/http-kernel/CacheClearer/CacheClearerInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php';\n\n return $this->services['cache.system_clearer'] = new \\Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer(['cache.system' => ($this->services['cache.system'] ?? $this->getCache_SystemService()), 'cache.validator' => ($this->privates['cache.validator'] ?? $this->getCache_ValidatorService()), 'cache.serializer' => ($this->privates['cache.serializer'] ?? $this->getCache_SerializerService()), 'cache.annotations' => ($this->privates['cache.annotations'] ?? $this->getCache_AnnotationsService()), 'cache.property_info' => ($this->privates['cache.property_info'] ?? $this->getCache_PropertyInfoService()), 'cache.security_expression_language' => ($this->privates['cache.security_expression_language'] ?? $this->getCache_SecurityExpressionLanguageService()), 'api_platform.cache.route_name_resolver' => ($this->privates['api_platform.cache.route_name_resolver'] ?? $this->getApiPlatform_Cache_RouteNameResolverService()), 'api_platform.cache.identifiers_extractor' => ($this->privates['api_platform.cache.identifiers_extractor'] ?? $this->getApiPlatform_Cache_IdentifiersExtractorService()), 'api_platform.cache.subresource_operation_factory' => ($this->privates['api_platform.cache.subresource_operation_factory'] ?? $this->getApiPlatform_Cache_SubresourceOperationFactoryService()), 'api_platform.cache.metadata.resource' => ($this->privates['api_platform.cache.metadata.resource'] ?? $this->getApiPlatform_Cache_Metadata_ResourceService()), 'api_platform.cache.metadata.property' => ($this->privates['api_platform.cache.metadata.property'] ?? $this->getApiPlatform_Cache_Metadata_PropertyService()), 'api_platform.graphql.cache.subscription' => ($this->privates['api_platform.graphql.cache.subscription'] ?? $this->getApiPlatform_Graphql_Cache_SubscriptionService()), 'cache.webpack_encore' => ($this->privates['cache.webpack_encore'] ?? $this->getCache_WebpackEncoreService())]);\n }", "protected function getCache_SystemService()\n {\n return $this->services['cache.system'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('oXunrX9Pzq', 0, 'X2InMxRv5Ka5uqYZwb6InK', (__DIR__.'/pools'), NULL);\n }", "protected function getCacheClearerService()\n {\n trigger_deprecation('symfony/framework-bundle', '5.2', 'Accessing the \"cache_clearer\" service directly from the container is deprecated, use dependency injection instead.');\n\n return $this->get('.container.private.cache_clearer');\n }", "protected function getCache_SystemService()\n {\n return $this->services['cache.system'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('J9fkInild7', 0, 'lZHGqERyaWVGNa8E5pWIp+', (__DIR__.'/pools'), null);\n }", "protected function getCacheService()\n {\n return $this->services['cache'] = new \\phpbb\\cache\\service($this->get('cache.driver'), $this->get('config'), $this->get('dbal.conn'), './../', 'php');\n }", "protected function getCache_SystemService()\n {\n return $this->services['cache.system'] = \\Symfony\\Component\\Cache\\Adapter\\AbstractAdapter::createSystemCache('p1qGJie-K4', 0, $this->getParameter('container.build_id'), ($this->targetDir.''.'/pools'), ($this->privates['monolog.logger.cache'] ?? $this->getMonolog_Logger_CacheService()));\n }", "protected function getCache_AppClearerService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/http-kernel/CacheClearer/CacheClearerInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php';\n\n return $this->services['cache.app_clearer'] = new \\Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer(['cache.app' => ($this->services['cache.app'] ?? $this->getCache_AppService())]);\n }", "protected function getConsole_Command_PublicAlias_DoctrineCache_ContainsCommandService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/console/Command/Command.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-cache-bundle/Command/CacheCommand.php';\n include_once \\dirname(__DIR__, 4).'/vendor/doctrine/doctrine-cache-bundle/Command/ContainsCommand.php';\n\n return $this->services['console.command.public_alias.doctrine_cache.contains_command'] = new \\Doctrine\\Bundle\\DoctrineCacheBundle\\Command\\ContainsCommand();\n }", "protected function getCache_SystemClearerService()\n {\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/http-kernel/CacheClearer/CacheClearerInterface.php';\n include_once \\dirname(__DIR__, 4).'/vendor/symfony/http-kernel/CacheClearer/Psr6CacheClearer.php';\n\n return $this->services['cache.system_clearer'] = new \\Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer(['cache.system' => ($this->services['cache.system'] ?? $this->getCache_SystemService())]);\n }", "protected function getCacheWarmerService()\n {\n return $this->services['cache_warmer'] = new \\Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerAggregate(array(0 => new \\Symfony\\Bundle\\FrameworkBundle\\CacheWarmer\\ClassMapCacheWarmer($this), 1 => new \\Symfony\\Bundle\\FrameworkBundle\\CacheWarmer\\RouterCacheWarmer($this->get('router.real'))));\n }", "protected function getCacheWarmerService()\n {\n return $this->services['cache_warmer'] = new \\Symfony\\Component\\HttpKernel\\CacheWarmer\\CacheWarmerAggregate(array(0 => new \\Symfony\\Bundle\\FrameworkBundle\\CacheWarmer\\RouterCacheWarmer($this->get('router')), 1 => new \\Symfony\\Bridge\\Doctrine\\CacheWarmer\\ProxyCacheWarmer($this->get('doctrine'))));\n }", "protected function getCache_GlobalClearerService()\n {\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\http-kernel\\\\CacheClearer\\\\CacheClearerInterface.php';\n include_once \\dirname(__DIR__, 4).'\\\\vendor\\\\symfony\\\\http-kernel\\\\CacheClearer\\\\Psr6CacheClearer.php';\n\n return $this->services['cache.global_clearer'] = new \\Symfony\\Component\\HttpKernel\\CacheClearer\\Psr6CacheClearer(['cache.app' => ($this->services['cache.app'] ?? $this->getCache_AppService()), 'cache.system' => ($this->services['cache.system'] ?? $this->getCache_SystemService()), 'cache.validator' => ($this->privates['cache.validator'] ?? $this->getCache_ValidatorService()), 'cache.serializer' => ($this->privates['cache.serializer'] ?? $this->getCache_SerializerService()), 'cache.annotations' => ($this->privates['cache.annotations'] ?? $this->getCache_AnnotationsService()), 'cache.property_info' => ($this->privates['cache.property_info'] ?? $this->getCache_PropertyInfoService()), 'cache.messenger.restart_workers_signal' => ($this->privates['cache.messenger.restart_workers_signal'] ?? $this->getCache_Messenger_RestartWorkersSignalService()), 'cache.security_expression_language' => ($this->privates['cache.security_expression_language'] ?? $this->getCache_SecurityExpressionLanguageService()), 'cache.doctrine.orm.default.metadata' => ($this->privates['cache.doctrine.orm.default.metadata'] ?? $this->getCache_Doctrine_Orm_Default_MetadataService()), 'cache.doctrine.orm.default.result' => ($this->privates['cache.doctrine.orm.default.result'] ?? $this->getCache_Doctrine_Orm_Default_ResultService()), 'cache.doctrine.orm.default.query' => ($this->privates['cache.doctrine.orm.default.query'] ?? $this->getCache_Doctrine_Orm_Default_QueryService()), 'cache.easyadmin' => ($this->privates['cache.easyadmin'] ?? $this->getCache_EasyadminService())]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the working set
public function setWorkingSet($ws) { if (htmlspecialchars(trim($ws)) != "") { $this->isAdvanced = true; $this->workingSet = htmlspecialchars(trim($ws)); } $this->isActive = true; }
[ "public function getWorkingSet()\r\n {\r\n return $this->workingSet;\r\n }", "public function defineSets();", "public function setWorkArray(){\n\t\t\n\t\t# Customer Work ID\n\t\tif($this->isPropertySet(\"customerwjid\", \"V\"))\n\t\t\t$_SESSION['customerwjid'] = $this->getProperty(\"customerwjid\");\n\t\t\n\t\t# Work Search Array\n\t\tif($this->isPropertySet(\"workarray\", \"V\"))\n\t\t\t$_SESSION['workarray'] = $this->getProperty(\"workarray\");\n\t\t\n\t}", "function isWorkingPathSet();", "function setWorkingKey($wk)\n\t{ \n\t\t$this->working_key=$wk;\n\t}", "private function setWorkingDir()\n {\n $this->workingDirBackup = getcwd();\n chdir(PATH_SITE);\n }", "private function init_set() {\n\t\t$this->_set = array();\n\t\tfor($i=0; $i < $this->_max-$this->_min + 1; $i++) {\n\t\t\t$this->_set[$i] = $this->_min + $i;\n\t\t}\n\t}", "private function _setWorkingDir()\n {\n Utility\\SessionManage::set('workingDir', str_replace('/Lib', '', __DIR__));\n }", "function batch_set() {\n }", "function assignSet() \n\t{\n\t\t$this->_quizzes_setsofquestionsTable =& JTable::getInstance('quizzes_setsofquestions', 'Table') ;\n\t\t\n\t\t$line['quiz_id'] = $this->_id ;\n\t\t$line['setofquestions_id'] = JRequest::getVar('setId') ;\n\t\t$line['id'] = 0 ;\n\n\t\t// checking whether if the set is empty or not\n\t\t$query = 'SELECT soq.id, customSets.id AS custom_id, count(setsofquestions_questions.id) AS custom_count, \n\t\t\t\t randomSets.id AS random_id, randomSets.nquestions AS random_count' .\n\t\t' FROM #__jquarks_setsofquestions AS soq' .\n\t\t' LEFT JOIN #__jquarks_customsets AS customSets ON soq.id = customSets.set_id' .\n\t\t' LEFT JOIN #__jquarks_randomsets AS randomSets ON soq.id = randomSets.set_id' .\n\t\t' LEFT JOIN #__jquarks_setsofquestions_questions AS setsofquestions_questions ON setsofquestions_questions.setofquestions_id = soq.id' . \n\t\t' WHERE soq.id = ' . $line['setofquestions_id'] .\n\t\t' GROUP BY soq.id' ;\n \n\t\t$this->_db->setQuery($query) ;\n\t\t$set = $this->_db->loadObject() ;\n\n \n\t\tif ($set->random_count != 0 || $set->custom_count != 0) \n\t\t{\n\t\t\tif (!$this->_quizzes_setsofquestionsTable->save($line)) {\n\t\t\t\treturn false ;\n\t\t\t}\n\t\t\t\n\t\t\treturn true ;\n\t\t} \n\t\t\n\t\treturn false;\n\t}", "private function _init_set()\n\t{\n\t\t// --------------------------------------\n\t\t// Get set_id and set details\n\t\t// --------------------------------------\n\n\t\t$set = ee()->TMPL->fetch_param('set');\n\t\t$set = ee()->TMPL->fetch_param('set_name', $set);\n\t\t$set = ee()->TMPL->fetch_param('set_id', $set);\n\n\t\tif ($set)\n\t\t{\n\t\t\t$this->set = $this->_get_set($set);\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Check category param if cat_option = one, default to 0\n\t\t// --------------------------------------\n\n\t\t$this->cat_id\n\t\t\t= (@$this->set['cat_option'] == 'one')\n\t\t\t? $this->_get_cat_id($this->set['cat_groups'])\n\t\t\t: 0;\n\n\t\t// --------------------------------------\n\t\t// Get entry ids for this set/cat\n\t\t// --------------------------------------\n\n\t\tif (isset($this->set[$this->cat_id]))\n\t\t{\n\t\t\t$this->entry_ids = $this->set[$this->cat_id];\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Filter entry ids so we're sure we've got the correct set\n\t\t// --------------------------------------\n\n\t\tif ( ! empty($this->entry_ids))\n\t\t{\n\t\t\t$this->_filter_entry_ids();\n\t\t}\n\t}", "private function _subActionModifySet()\n\t{\n\t\tglobal $context, $txt, $modSettings;\n\n\t\t$fileFunc = FileFunctions::instance();\n\n\t\tif ($context['sub_action'] === 'modifyset')\n\t\t{\n\t\t\t$set = $this->_req->getQuery('set', 'intval', -1);\n\t\t\tif ($set == -1 || !isset($context['smiley_sets'][$set]))\n\t\t\t{\n\t\t\t\t$context['current_set'] = array(\n\t\t\t\t\t'id' => '-1',\n\t\t\t\t\t'path' => '',\n\t\t\t\t\t'name' => '',\n\t\t\t\t\t'selected' => false,\n\t\t\t\t\t'is_new' => true,\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$context['current_set'] = &$context['smiley_sets'][$set];\n\t\t\t\t$context['current_set']['is_new'] = false;\n\n\t\t\t\t// Calculate whether there are any smileys in the directory that can be imported.\n\t\t\t\tif (!empty($modSettings['smiley_enable']) && !empty($modSettings['smileys_dir'])\n\t\t\t\t\t&& $fileFunc->isDir($modSettings['smileys_dir'] . '/' . $context['current_set']['path']))\n\t\t\t\t{\n\t\t\t\t\t$smileys = array();\n\t\t\t\t\t$dir = dir($modSettings['smileys_dir'] . '/' . $context['current_set']['path']);\n\t\t\t\t\twhile (($entry = $dir->read()) !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (in_array(strrchr($entry, '.'), array('.jpg', '.gif', '.jpeg', '.png', '.webp')))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$smileys[strtolower($entry)] = $entry;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$dir->close();\n\n\t\t\t\t\tif (empty($smileys))\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new Exception('smiley_set_dir_not_found', false, array($context['current_set']['name']));\n\t\t\t\t\t}\n\n\t\t\t\t\t// Exclude the smileys that are already in the database.\n\t\t\t\t\t$found = smileyExists($smileys);\n\t\t\t\t\tforeach ($found as $smiley)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (isset($smileys[$smiley]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($smileys[$smiley]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$context['current_set']['can_import'] = count($smileys);\n\n\t\t\t\t\t// Setup this string to look nice.\n\t\t\t\t\t$txt['smiley_set_import_multiple'] = sprintf($txt['smiley_set_import_multiple'], $context['current_set']['can_import']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Retrieve all potential smiley set directories.\n\t\t\t$context['smiley_set_dirs'] = array();\n\t\t\tif (!empty($modSettings['smileys_dir']) && $fileFunc->isDir($modSettings['smileys_dir']))\n\t\t\t{\n\t\t\t\t// Do not include our emoji directories\n\t\t\t\t$disallow = ['.', '..', 'emojitwo', 'twemoji', 'noto-emoji'];\n\n\t\t\t\t$dir = dir($modSettings['smileys_dir']);\n\t\t\t\twhile (($entry = $dir->read()) !== false)\n\t\t\t\t{\n\t\t\t\t\tif (!in_array($entry, $disallow)\n\t\t\t\t\t\t&& $fileFunc->isDir($modSettings['smileys_dir'] . '/' . $entry))\n\t\t\t\t\t{\n\t\t\t\t\t\t$context['smiley_set_dirs'][] = array(\n\t\t\t\t\t\t\t'id' => $entry,\n\t\t\t\t\t\t\t'path' => $modSettings['smileys_dir'] . '/' . $entry,\n\t\t\t\t\t\t\t'selectable' => $entry == $context['current_set']['path'] || !in_array($entry, explode(',', $modSettings['smiley_sets_known'])),\n\t\t\t\t\t\t\t'current' => $entry == $context['current_set']['path'],\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$dir->close();\n\t\t\t}\n\t\t}\n\t}", "public function _save_starter_content_changeset()\n {\n }", "public function testModelSet()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function rewind() {\n $this->_loadSet();\n reset($this->_set);\n }", "protected function _setPageSet()\n {\n $pageSetArray = $this->_selectPageSet();\n \\RightNow\\Libraries\\Hooks::callHook('pre_page_set_selection', $pageSetArray);\n $selected = $pageSetArray['selected'];\n if ($selected !== null)\n {\n $this->pageSetPath = $pageSetArray[$selected]->getValue();\n $this->pageSetID = $pageSetArray[$selected]->getId();\n }\n else\n {\n $this->pageSetPath = null;\n $this->pageSetID = null;\n }\n $this->_setPageSetOffset();\n\n $this->_processForShiftJisTranscoding();\n }", "abstract public function resetQuestionSetRelatedTestSettings();", "public function setWorkingDir($dir) {\n $this->working_directory = $dir;\n }", "public function setDirty()\n {\n $this->cached = [];\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Ici on retire les morts de l'equipe, ensuite on trie l'equipe principal
function virerMortEquipeOne () { $listePersonnageATransferer = array (); foreach ( $this->_equipes[ 0 ]->getPersonnages () as $personnage ) { if ( $personnage->isDead () ) { array_push ( $listePersonnageATransferer, $personnage ); } } foreach ( $listePersonnageATransferer as $personnage ) { $this->transferer ( $personnage ); } }
[ "public function getPersoon1NaamVoluitAchter()\n {\n // waarvan alleen achternaam gegarandeerd bestaat\n //Voorbeelden: Groot, dhr. M. de E achternaam, titel voorletters voorvoegsel\n // Groot-Wijtzes, mevr. A.A. de PE achternaam_partner - voorvoegsel achternaam, titel voorletters voorvoegsel_partner\n // Boer, dhr. A. de E\n // Boer-van der Graaf, mevr. B. de PE achternaam_partner - voorvoegsel achternaam, titel voorletters voorvoegsel_partner\n // Boer, mevr. B. de P achternaam_partner, titel voorletters voorvoegsel_partner\n $naam = '';\n $naamgebruik = $this->naamgebruik;\n switch ($naamgebruik) {\n case \"E\":\n $naam = $this->achternaam;\n if (!is_null($this->titel) || !is_null($this->voorletters) || !is_null($this->voorvoegsel) ) {\n $naam .= ',';\n }\n if (!is_null($this->titel)) {\n $naam .= ' ' . $this->titel;\n }\n if(!is_null($this->voorletters)) {\n $naam .= ' ' . $this->voorletters;\n }\n if (!is_null($this->voorvoegsel)) {\n $naam .= ' ' . $this->voorvoegsel;\n }\n break;\n case \"P\":\n $naam = $this->achternaam_partner;\n if (!is_null($this->titel) || !is_null($this->voorletters) || !is_null($this->voorvoegsel_partner) ) {\n $naam .= ',';\n }\n if (!is_null($this->titel)) {\n $naam .= ' ' . $this->titel;\n }\n if(!is_null($this->voorletters)) {\n $naam .= ' ' . $this->voorletters;\n }\n if (!is_null($this->voorvoegsel_partner)) {\n $naam .= ' ' . $this->voorvoegsel_partner;\n } \n break;\n case \"EP\":\n // Graaf-de Boer, mevr. B. van der EP achternaam - voorvoegsel_partner Achternaam_partner, titel voorletters, voorvoegsel\n $naam = $this->achternaam;\n if (!is_null($this->achternaam_partner) && trim($this->achternaam_partner) != '' ) {\n $naam .= '-';\n }\n \n if(!is_null($this->voorvoegsel_partner)) {\n $naam .= $this->voorvoegsel_partner . ' ';\n }\n $naam .= $this->achternaam_partner;\n if (!is_null($this->titel) || !is_null($this->voorletters) || !is_null($this->voorvoegsel) ) {\n $naam .= ',';\n }\n if (!is_null($this->titel)) {\n $naam .= ' ' . $this->titel;\n }\n if(!is_null($this->voorletters)) {\n $naam .= ' ' . $this->voorletters;\n }\n if (!is_null($this->voorvoegsel)) {\n $naam .= ' ' . $this->voorvoegsel;\n } \n break;\n case \"PE\":\n // Groot-Wijtzes, mevr. A.A. de PE achternaam_partner - voorvoegsel achternaam, titel voorletters voorvoegsel_partner \n $naam = $this->achternaam_partner;\n $naam .= '-';\n if(!is_null($this->voorvoegsel)) {\n $naam .= $this->voorvoegsel . ' ';\n }\n $naam .= $this->achternaam;\n if (!is_null($this->titel) || !is_null($this->voorletters) || !is_null($this->voorvoegsel_partner) ) {\n $naam .= ',';\n }\n if (!is_null($this->titel)) {\n $naam .= ' ' . $this->titel;\n }\n if(!is_null($this->voorletters)) {\n $naam .= ' ' . $this->voorletters;\n }\n if (!is_null($this->voorvoegsel_partner)) {\n $naam .= ' ' . $this->voorvoegsel_partner;\n } \n break;\n } \n return $naam; \n }", "function journees_calcule ($nb_equipe)\r\n{\r\n\t// Si le nombre d'equipes est impair\r\n\t// on passe au nombre pair juste apres\r\n\tif ( ($nb_equipe % 2) == 1 ) $nb_equipe++;\r\n\t// Moitie des equipes\r\n\t$moitie=$nb_equipe/2;\r\n\t// Tableau de sortie a deux dimensions : journee, matchs\r\n\t$tableau=array();\r\n\tfor ($j=1; $j<=$nb_equipe-1; $j++)\r\n\t{\r\n\t\t$tableau[$j]=array();\r\n\t\t$tableau[$j][\"D\"]=array(); // Domicile\r\n\t\t$tableau[$j][\"E\"]=array(); // Exterieur\r\n\t\t// Traitement particulier de la premiere ligne\r\n\t\t$tableau[$j][\"D\"][1]=$j;\r\n\t\t$tableau[$j][\"E\"][1]=$nb_equipe;\r\n\t\tfor ($m=2; $m<=$moitie; $m++)\r\n\t\t{\r\n\t\t\t$dom=$j+$m-1;\r\n\t\t\tif ( $dom >= $nb_equipe ) $dom++;\r\n\t\t\t$ext=$nb_equipe+$j-$m;\r\n\t\t\tif ( $ext >= $nb_equipe ) $ext++;\r\n\t\t\t$tableau[$j][\"D\"][$m]= ( $dom % $nb_equipe );\r\n\t\t\t$tableau[$j][\"E\"][$m]= ( $ext % $nb_equipe );\r\n\t\t}\r\n\t}\r\n\t// On cree journee a partir de tableau\r\n\t// en \"melangeant\" les colonnes (tableau[journee])\r\n\t$journee=array();\r\n\tfor ($j=1; $j<=$nb_equipe-1; $j++)\r\n\t{\r\n\t\t$journee[$j]=array();\r\n\t\t$journee[$j][\"D\"]=array();\r\n\t\t$journee[$j][\"E\"]=array();\r\n\t}\r\n\t// 1ere journee\r\n\t$journee[1]=$tableau[1];\r\n\t$journee[2]=$tableau[$nb_equipe-1];\r\n\t// autres journees\r\n\tfor ($j=2; $j<=$nb_equipe-1; $j++)\r\n\t{\r\n\t\tif ( ($j % 2) == 0)\r\n\t\t{\r\n\t\t\t// Cas $j pair\r\n\t\t\t$indice = ($nb_equipe / 2) - ( ($j -2)/2 );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Cas $j impair\r\n\t\t\t$indice = $nb_equipe - ( ($j-1) / 2 );\r\n\t\t}\r\n\t\t$journee[$j]=$tableau[$indice];\r\n\t}\r\n\t// On balaye les journees paires\r\n\t// pour alterner Domicile-Exterieur pour l'equipe $nb_equipe\r\n\t// donc uniquement pour le 1er match de chaque journee\r\n\tfor ($j=1; $j<=$nb_equipe-1; $j++)\r\n\t{\r\n\t\t// Journee paire\r\n\t\tif ( ($j % 2) == 0 )\r\n\t\t{\r\n\t\t\t// On recupere les valeurs\r\n\t\t\t$dom=$journee[$j][\"D\"][1];\r\n\t\t\t$ext=$journee[$j][\"E\"][1];\r\n\t\t\t// On inverse\r\n\t\t\t$journee[$j][\"D\"][1]=$ext;\r\n\t\t\t$journee[$j][\"E\"][1]=$dom;\r\n\t\t}\r\n\t}\r\n\treturn $journee;\r\n}", "function muestra_10_pisos() {\n\t\t$array_devolver = array();\n\t\t$sql = \"SELECT id_piso, descripcion, calle, numero, piso, letra, cp, idlocalizacion FROM pisos WHERE verificado=true AND libre=1 ORDER BY id_piso DESC LIMIT 10\";\n\t\t$resultado_1 = $this -> db -> query($sql);\n\t\tif ($resultado_1->num_rows()>0) {\n\t\t\t// Hay sugus continuo para sacar la ciudad y tal\n\t\t\tforeach ($resultado_1->result() as $row) {\n\t\t\t\t$sql2 = \"SELECT localizacion FROM localizaciones WHERE idlocalizacion=\".$row ->idlocalizacion;\n\n\t\t\t\t$resultado_2 = $this -> db -> query($sql2);\n\t\t\t\tforeach ($resultado_2->result() as $row2) {\n\t\t\t\t\t$array_devolver[] = array (\"idpiso\" => $row->id_piso, \"descripcion\" =>$row->descripcion, \"direccion\" => $row->calle.\", \".$row->piso.\" (\".$row2->localizacion.\")\");\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $array_devolver;\n\t\t} else {\n\t\t\t// No hay sugus devuelvo falso\n\t\t\treturn false;\n\t\t}\n\t}", "public function getCotasMensais() {\n\n if (count($this->aCotasMensais) > 0) {\n return $this->aCotasMensais;\n }\n\n $oDaoEmpenhoCotaMensal = new cl_empenhocotamensal();\n $sSqlCotasMensais = $oDaoEmpenhoCotaMensal->sql_query_file(null, \"*\", \"e05_mes\", \"e05_numemp = {$this->getNumero()}\");\n $rsCotasMensais = db_query($sSqlCotasMensais);\n\n if (!$rsCotasMensais) {\n throw new BusinessException((_M(\"financeiro.empenho.EmpenhoFinanceiro.erro_retorno_cotas_mensais\")));\n }\n $aCotas = array();\n $iTotalLinhas = pg_num_rows($rsCotasMensais);\n for ($iCota = 0; $iCota < $iTotalLinhas; $iCota++) {\n\n $oDadosCota = db_utils::fieldsMemory($rsCotasMensais, $iCota);\n $oCota = new EmpenhoCotaMensal();\n\n $oCota->setValor($oDadosCota->e05_valor);\n $oCota->setMes($oDadosCota->e05_mes);\n $aCotas[$oDadosCota->e05_mes] = $oCota;\n\n\n }\n /**\n * Adicionamos os meses nao lançados\n */\n for ($iMes = 1; $iMes <= 12; $iMes++) {\n\n if (isset($aCotas[$iMes])) {\n continue;\n }\n $oCota = new EmpenhoCotaMensal();\n $oCota->setMes($iMes);\n $oCota->setValor(0);\n $aCotas[] = $oCota;\n }\n\n uasort($aCotas, function($oMes , $oProximoMes) {\n return ($oProximoMes->getMes() > $oMes->getMes()) ? -1 : 1;\n });\n return $aCotas;\n\n }", "function carrega_vetor_lexicos($id_projeto, $id_lexico_atual, $semAtual) {\n \n //testes if the variable is not null\n assert($id_projeto != NULL);\n assert($id_lexico_atual != NULL);\n assert($semAtual != NULL);\n \n //tests if the variable has the correct type\n assert(is_string($id_projeto));\n assert(is_string($id_lexico_atual));\n assert(is_string($semAtual));\n \n $vetorDeLexicos = array();\n if ($semAtual) {\n $queryLexicos = \"SELECT id_lexico, nome \n\t\t\tFROM lexico \n\t\t\tWHERE id_projeto = '$id_projeto' \n AND id_lexico <> '$id_lexico_atual' \n\t\t\tORDER BY nome DESC\";\n\n $querySinonimos = \"SELECT id_lexico, nome \n\t\t\tFROM sinonimo\n\t\t\tWHERE id_projeto = '$id_projeto' \n AND id_lexico <> '$id_lexico_atual' \n\t\t\tORDER BY nome DESC\";\n } else {\n\n $queryLexicos = \"SELECT id_lexico, nome \n\t\t\tFROM lexico \n\t\t\tWHERE id_projeto = '$id_projeto' \n\t\t\tORDER BY nome DESC\";\n\n $querySinonimos = \"SELECT id_lexico, nome \n\t\t\tFROM sinonimo\n\t\t\tWHERE id_projeto = '$id_projeto' \n ORDER BY nome DESC\";\n }\n\n $resultadoQueryLexicos = mysql_query($queryLexicos) or\n die(\"Erro ao enviar a query de selecao na tabela lexicos !\" . \\mysql_error());\n\n $i = 0;\n while ($linhaLexico = mysql_fetch_object($resultadoQueryLexicos)) {\n $vetorDeLexicos[$i] = $linhaLexico;\n $i++;\n }\n\n $resultadoQuerySinonimos = mysql_query($querySinonimos) or\n die(\"Erro ao enviar a query de selecao na tabela sinonimos !\" . mysql_error());\n while ($linhaSinonimo = mysql_fetch_object($resultadoQuerySinonimos)) {\n $vetorDeLexicos[$i] = $linhaSinonimo;\n $i++;\n }\n return $vetorDeLexicos;\n}", "function getNumNacionalesLocales($cont_cod, $pais_cod, $dpto_cod,$muni_cod)\n{\n\t$rad = & new Radicado($this->cursor);\n\t$num = count($this->vecRads);\n\treset($this->vecRads);\n\t$i = 0;\n\t$local=0;\n\t$nacional=0;\n\t$grupo1=0;\n\t$grupo2=0;\n\t// Recorre el vector del grupo de radicados\t\n\twhile ($i < $num)\n\t{\t\n\t\t$rad->radicado_codigo($this->vecRads[$i]);\n\t\t//Si el radicado no ha sido retirado\n\t\tif (!$this->radicadoRetirado($this->vecRads[0],$this->vecRads[$i]))\n\t\t{\n\t\t\t$datosRad = $rad->getDatosRemitente();\n\t\t\t//Hacemos los calculos de internacional grupo 1/2 y envios local/nacional\n\t\t\tif ($datosRad[\"contCodi\"] == $cont_cod)\t//Si va para el mismo continente\n\t\t\t{\n\t\t\t\tif ($datosRad[\"paisCodi\"] == $pais_cod)\t//Si va para el mismo pais\n\t\t\t\t{\t//Hacemos la validacion de si es local, aca hay un codigo metido a machetazo el cual\n\t\t\t\t\t//valida unos municipios que actuan como precio local en algunos dptos, hay que \n\t\t\t\t\t//cambiar esta validacion para que tome los datos de homologacion de precios capturados\n\t\t\t\t\t//en el administrador de municipios.\n\t\t\t\t\tif ( (($datosRad[\"deptoCodi\"] == $dpto_cod) && ($datosRad[\"muniCodi\"] == $muni_cod)) ||\n\t\t\t\t\t\t ($pais_cod==170 && $dpto_cod==68 && \n\t\t\t\t\t\t \t($datosRad[\"muniCodi\"]==547||$datosRad[\"muniCodi\"]==276||$datosRad[\"muniCodi\"]==307))\n\t\t\t\t\t\t) //Si va para la misma ciudad\n\t\t\t\t\t{\n\t\t\t\t\t\t$local++;\n\t\t\t\t\t\tif\t($local==1)\t$this->radPrimLocal=$this->vecRads[$i];\n\t\t\t\t\t}\n\t\t\t\t\telse \n\t\t\t\t\t{\n\t\t\t\t\t\t$nacional++;\n\t\t\t\t\t\tif\t($nacional==1)\t$this->radPrimNacional=$this->vecRads[$i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$grupo1++;\n\t\t\t\t\tif\t($grupo1==1)\t$this->radPrimG1=$this->vecRads[$i];\n\t\t\t\t}\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$grupo2++;\n\t\t\t\tif\t($grupo2==1)\t$this->radPrimG2=$this->vecRads[$i];\n\t\t\t}\n\t\t}\t\n\t\t$i++; \n\t}\n\t$resultado[\"local\"] = $local;\n\t$resultado[\"nacional\"] = $nacional;\n\t$resultado[\"grupo1\"] = $grupo1;\n\t$resultado[\"grupo2\"] = $grupo2;\n\treturn ($resultado);\n}", "function getRelacionMunicipioOrdenPago($condicion = \"1\") {\r\n $relacionesMunicipioOrdenPago = null;\r\n $sql = \"SELECT mop.idValorOrdenMunicipio, mop.valor, \"\r\n . \"d.descripcionDestinacionRecursos, m.mun_nombre,\"\r\n . \"ROUND(((mop.valor*100)/(o.valor_total*o.Tasa_Orden)), 3) as porcentaje \"\r\n . \"FROM municipio_orden_pago mop \"\r\n . \"INNER JOIN destinacion_recursos d ON d.idDestinacionRecursos = mop.idDestinacionRecursos \"\r\n . \"INNER JOIN municipio m ON m.mun_id = mop.idMunicipio \"\r\n . \"INNER JOIN ordenesdepago o ON o.Id_Orden_Pago = mop.idOrdenPago \"\r\n . \"WHERE $condicion\";\r\n $r = $this->db->ejecutarConsulta($sql);\r\n if ($r) {\r\n $cont = 0;\r\n while ($w = mysql_fetch_array($r)) {\r\n $relacionesMunicipioOrdenPago[$cont]['idValorOrdenMunicipio'] = $w['idValorOrdenMunicipio'];\r\n $relacionesMunicipioOrdenPago[$cont]['valor'] = $w['valor'];\r\n $relacionesMunicipioOrdenPago[$cont]['porcentaje'] = $w['porcentaje'];\r\n $relacionesMunicipioOrdenPago[$cont]['descripcionDestinacionRecursos'] = $w['descripcionDestinacionRecursos'];\r\n $relacionesMunicipioOrdenPago[$cont]['mun_nombre'] = $w['mun_nombre'];\r\n $cont++;\r\n }\r\n }\r\n return $relacionesMunicipioOrdenPago;\r\n }", "public function buscarUltimo() {\n }", "public function total_du(){\n\n $compromis = $this;\n\n $total_ht = 0 ;\n $total_tva = 0 ;\n\n if($compromis->getHonoPorteur() != null){\n $total_ht += $compromis->getHonoPorteur()->montant_ht;\n $total_tva += $compromis->getHonoPorteur()->montant_ttc > 0 ? $compromis->getHonoPorteur()->montant_ht * Tva::tva() : 0 ;\n\n }else{\n $total_ht += $compromis->getFactureHonoProvi()['montant_ht'];\n $total_tva += $compromis->getFactureHonoProvi()['montant_tva'];\n }\n\n if($compromis->getHonoPartage() != null){\n $total_ht += $compromis->getHonoPartage()->montant_ht;\n $total_tva += $compromis->getHonoPartage()->montant_ttc > 0 ? $compromis->getHonoPartage()->montant_ht * Tva::tva() : 0 ;\n }else{\n $total_ht += $compromis->getFactureHonoPartageProvi()['montant_ht'];\n $total_tva += $compromis->getFactureHonoPartageProvi()['montant_tva'];\n }\n\n if($compromis->getFactureParrainPorteur() != null){\n\n $total_ht += $compromis->getFactureParrainPorteur()->montant_ht;\n $total_tva += $compromis->getFactureParrainPorteur()->montant_ttc > 0 ? $compromis->getFactureParrainPorteur()->montant_ht * Tva::tva() : 0 ;\n }else{\n $total_ht += $compromis->getFactureParrainPorteurProvi()['montant_ht'];\n $total_tva += $compromis->getFactureParrainPorteurProvi()['montant_tva'];\n }\n\n if($compromis->getFactureParrainPartage() != null){\n $total_ht += $compromis->getFactureParrainPartage()->montant_ht;\n $total_tva += $compromis->getFactureParrainPartage()->montant_ttc > 0 ? $compromis->getFactureParrainPartage()->montant_ht * Tva::tva() : 0 ;\n }else{\n $total_ht += $compromis->getFactureParrainPartageProvi()['montant_ht'];\n $total_tva += $compromis->getFactureParrainPartageProvi()['montant_tva'];\n }\n\n\n return array(\"total_ht\"=> $total_ht, \"total_tva\"=> $total_tva) ;\n}", "function calcularSemestreEspacioMasAtrasado() {\r\n if (is_array($this->espaciosPlan))\r\n {\r\n if(is_array($this->espaciosAprobados)){\r\n foreach ($this->espaciosPlan as $key => $espaciosPlan) {\r\n foreach ($this->espaciosAprobados as $key2 => $espaciosAprobados) {\r\n if ($espaciosPlan==$espaciosAprobados)\r\n unset ($this->espaciosPlan[$key]);\r\n }\r\n }\r\n }\r\n }else{\r\n $this->mensaje[$this->datosEstudiante['CODIGO']][]=\"No existen espacios registrados en el plan de estudios del estudiante\";\r\n\r\n }\r\n return $this->espaciosPlan[0]['SEMESTRE'];\r\n }", "function getPatientsManuels ( ) {\r\n // On cherche dans la table des présents tous les patients entrés manuellement.\r\n $param['table'] = PPRESENTS ;\r\n $param['cw'] = \"WHERE manuel='1' ORDER BY nom\" ;\r\n $req = new clResultQuery ;\r\n $res = $req -> Execute ( \"Fichier\", \"getPatients\", $param, \"ResultQuery\" ) ;\r\n // On parcourt les patients trouvés.\r\n for ( $i = 0 ; isset ( $res['idpatient'][$i] ) ; $i++ ) {\r\n // Ajout du patient au tableau.\r\n $identifiant=$res['idpatient'][$i].\"|Presents\\\" \".clPatient::genInfoBulle ( $res, $i ) ;\r\n if ( $res['sexe'][$i] != \"M\" ) $e = \"e\" ; else $e = '' ;\r\n $tab[$identifiant] = \"(\".$res['sexe'][$i].\") \".ucfirst(strtolower($res['prenom'][$i])).\" \".strtoupper($res['nom'][$i]).\" (Présent$e)\" ;\r\n }\r\n\r\n // On cherche dans la table des sortis tous les patients entrés manuellement.\r\n $param['table'] = PSORTIS ;\r\n $param['cw'] = \"WHERE manuel='1' ORDER BY nom\" ;\r\n $req = new clResultQuery ;\r\n $res = $req -> Execute ( \"Fichier\", \"getPatients\", $param, \"ResultQuery\" ) ;\r\n // On parcourt les patients trouvés.\r\n for ( $i = 0 ; isset ( $res['idpatient'][$i] ) ; $i++ ) {\r\n // Ajout du patient au tableau.\r\n $identifiant=$res['idpatient'][$i].\"|Sortis\\\" \".clPatient::genInfoBulle ( $res, $i ) ;\r\n if ( $res['sexe'][$i] != \"M\" ) $e = \"e\" ; else $e = '' ;\r\n $tab[$identifiant] = \"(\".$res['sexe'][$i].\") \".ucfirst(strtolower($res['prenom'][$i])).\" \".strtoupper($res['nom'][$i]).\" (Sorti$e)\" ;\r\n }\r\n\r\n // On fait en sorte de retourner un tableau.\r\n if ( is_array ( $tab ) )\r\n return $tab ;\r\n else return array ( ) ;\r\n }", "public function determinarLugares() {\n // esto se debe recibir por parametros\n $filtros = [];\n array_push($filtros, 2);\n array_push($filtros, 10);\n array_push($filtros, 20);\n array_push($filtros, 40);\n //conecta con la base de datos y ejecuta una consulta\n $connection = new Connection();\n $conn = $connection->getConnection();\n $query = \"SELECT * FROM lugaresturisticos;\";\n $result = mysqli_query($conn, $query);\n\n //variable donde se guarda y se envia los lugarea para mostrar en las rutas\n $lugaresParaMostrar = [];\n $valoresDeEntrada = [];\n //en este arrayList se guardan los valores de las columnas obtenidos desde la base de datos\n\n $cont = 0;\n $valorMasBajo = 0;\n $id = 0;\n\n while ($row = $result->fetch_assoc()) {\n\n if (strcmp($row['precio'], \"0 a 25000\") == 0) {\n array_push($valoresDeEntrada, 1);\n } else if (strcmp($row['precio'], \"26000 a 50000\") == 0) {\n array_push($valoresDeEntrada, 2);\n } else if (strcmp($row['precio'], \"51000 a 100000\") == 0) {\n array_push($valoresDeEntrada, 3);\n } else if (strcmp($row['precio'], \"Mas de 100000\") == 0) {\n array_push($valoresDeEntrada, 4);\n }\n\n if (strcmp($row['tipoTurista'], \"Aventurero\") == 0) {\n array_push($valoresDeEntrada, 10);\n } else if (strcmp($row['tipoTurista'], \"Cultural\") == 0) {\n array_push($valoresDeEntrada, 20);\n } else if (strcmp($row['tipoTurista'], \"Gastronomico\") == 0) {\n array_push($valoresDeEntrada, 30);\n } else if (strcmp($row['tipoTurista'], \"Familiar\") == 0) {\n array_push($valoresDeEntrada, 40);\n }\n\n if (strcmp($row['tipoActividad'], \"Alimentacion\") == 0) {\n array_push($valoresDeEntrada, 10);\n } else if (strcmp($row['tipoActividad'], \"AireLibre\") == 0) {\n array_push($valoresDeEntrada, 20);\n } else if (strcmp($row['tipoActividad'], \"PMNacional\") == 0) {\n array_push($valoresDeEntrada, 30);\n } else if (strcmp($row['tipoActividad'], \"Alojamiento\") == 0) {\n array_push($valoresDeEntrada, 40);\n }\n\n if (strcmp($row['tipoAtractivo'], \"Restaurantes\") == 0) {\n array_push($valoresDeEntrada, 10);\n } else if (strcmp($row['tipoAtractivo'], \"Monumentos\") == 0) {\n array_push($valoresDeEntrada, 20);\n } else if (strcmp($row['tipoAtractivo'], \"Miradores\") == 0) {\n array_push($valoresDeEntrada, 30);\n } else if (strcmp($row['tipoAtractivo'], \"Hoteles\") == 0) {\n array_push($valoresDeEntrada, 40);\n }\n\n $suma = 0;\n\n //inicia la ejecucion del algoritmo de distancia de euclides\n //el ciclo se mueve desde cero y hasta el tamaño del array mas pequeño\n //va sumando el resultado de la resta entre los contenidos de cada array en la posicion i, elevada a la 2, es decir, (X-Y)^2\n for ($i = 0; $i < min(count($filtros), count($valoresDeEntrada)); $i++) {\n $suma += pow((int) $valoresDeEntrada[$i] - (int) $filtros[$i], 2);\n }\n //se obtiene la raiz cuadrada de la suma\n //este es el resultado final del algoritmo\n $resultado = sqrt($suma);\n\n //pregunta si es la primera vez que se ejecuta el ciclo\n if ($cont == 0) {\n $valorMasBajo = $resultado;\n }\n //si el resultado final del algoritmo es menor al valor mas bajo actual entonces el valor mas bajo pasa\n //a vale lo mismo que el resultado\n //y se guarda el estilo actual\n else if ($resultado <= $valorMasBajo + 10) {\n $valorMasBajo = $resultado;\n $id = $row['id'];\n\n if (count($lugaresParaMostrar) < 12) {\n array_push($lugaresParaMostrar, $row);\n }\n }\n\n $valoresDeEntrada = [];\n $cont++;\n }\n\n $Op1 = [];\n $Op2 = [];\n $Op3 = [];\n if (count($lugaresParaMostrar) == 6) {\n for ($i = 0; $i <= count($lugaresParaMostrar); $i++) {\n if ($i < 2) {\n array_push($Op1, $lugaresParaMostrar[$i]);\n } else if ($i < 4) {\n array_push($Op2, $lugaresParaMostrar[$i]);\n } else {\n array_push($Op3, $lugaresParaMostrar[$i]);\n }\n }\n } else if (count($lugaresParaMostrar) > 6) {\n if (count($lugaresParaMostrar) == 7) {\n for ($i = 0; $i <= count($lugaresParaMostrar); $i++) {\n if ($i < 3) {\n array_push($Op1, $lugaresParaMostrar[$i]);\n } else if ($i < 5) {\n array_push($Op2, $lugaresParaMostrar[$i]);\n } else {\n array_push($Op3, $lugaresParaMostrar[$i]);\n }\n }\n } else if (count($lugaresParaMostrar) == 8 || count($lugaresParaMostrar) == 9) {\n for ($i = 0; $i <= count($lugaresParaMostrar); $i++) {\n if ($i < 3) {\n array_push($Op1, $lugaresParaMostrar[$i]);\n } else if ($i < 6) {\n array_push($Op2, $lugaresParaMostrar[$i]);\n } else {\n array_push($Op3, $lugaresParaMostrar[$i]);\n }\n }\n } else {\n for ($i = 0; $i <= count($lugaresParaMostrar); $i++) {\n if ($i < 4) {\n array_push($Op1, $lugaresParaMostrar[$i]);\n } else if ($i < 8) {\n array_push($Op2, $lugaresParaMostrar[$i]);\n } else {\n array_push($Op3, $lugaresParaMostrar[$i]);\n }\n }\n }\n }\n\n $lugaresParaMostrar = [];\n array_push($lugaresParaMostrar, $Op1);\n array_push($lugaresParaMostrar, $Op2);\n array_push($lugaresParaMostrar, $Op3);\n \n return $lugaresParaMostrar;\n }", "function apparitionMonstre($PERSO) {\r\n\t global $db;\r\n\t $SQLtypeMonstre=\"select am.*, monstre.nom from \".NOM_TABLE_APPARITION_MONSTRE.\" am, \". NOM_TABLE_REGISTRE .\" monstre where am.id_perso = monstre.id_perso and am.nb_max_apparition>0 and monstre.pnj=2 and am.chance_apparition>0 and am.id_typelieu = \". $PERSO->Lieu->type_lieu_apparition;\r\n\t $resulttypeMonstre = $db->sql_query($SQLtypeMonstre);\r\n\t while($rowtypeMonstre = $db->sql_fetchrow($resulttypeMonstre)) {\r\n\t logdate('rowtypeMonstre ' .$rowtypeMonstre['nom']);\r\n\t $nbMaxApparitions = $rowtypeMonstre['nb_max_apparition'];\r\n if ($rowtypeMonstre['nb_max_lieu']!=-1) {\r\n $SQLquantiteDejaPresente = \"select count(id_perso) as c from \". NOM_TABLE_REGISTRE .\" where pnj=3 and nom like '\".$rowtypeMonstre['nom'].\"%' and id_lieu = \".$PERSO->Lieu->ID;\r\n $resultquantiteDejaPresente = $db->sql_query($SQLquantiteDejaPresente);\r\n $rowquantiteDejaPresente = $db->sql_fetchrow($resultquantiteDejaPresente);\r\n if ( $rowquantiteDejaPresente['c'] >= $rowtypeMonstre['nb_max_lieu'])\r\n $nbMaxApparitions = 0;\r\n else $nbMaxApparitions = min ($nbMaxApparitions,$rowtypeMonstre['nb_max_lieu'] - $rowquantiteDejaPresente['c']); \r\n } \r\n if ($nbMaxApparitions>0) {\r\n $nbApparitions = calculApparitionMonstre($rowtypeMonstre['chance_apparition'], $nbMaxApparitions, $PERSO->Lieu, $PERSO);\r\n if ($nbApparitions>=0) {\r\n $i=0;\r\n while ($i< $nbApparitions) {\r\n creationMonstre( $rowtypeMonstre['id_perso'], $PERSO->Lieu->ID, \"PJ\");\r\n //action_surprise($PERSO);\r\n $i++;\r\n } \r\n } \r\n } \r\n\t } \r\n\t}", "function calcul_serials() {\n\t\t//Dans l'ordre :\n\t\t//on applique les calculs unitaires\n\t\t//puis on applique les calculs dates\n\t\t//Temps que l'on trouve des algos unitaires on les appliques\n\t\t$liste_algo_tempo = array ();\n\t\t$liste_algo_restant = array ();\n\t\t$flag = true;\n\t\tforeach ( $this->algorythme as $nom_algo => $algo ) {\n\t\t\tif (! is_array ( $algo ))\n\t\t\t\tcontinue;\n\t\t\tif ($flag && ($algo [\"type\"] == \"unitaire\" || $algo [\"type\"] == \"date\"))\n\t\t\t\t$liste_algo_tempo [$nom_algo] = $algo;\n\t\t\telse {\n\t\t\t\t$flag = false;\n\t\t\t\t$liste_algo_restant [$nom_algo] = $algo;\n\t\t\t}\n\t\t}\n\t\tif (count ( $liste_algo_tempo ) > 0) {\n\t\t\t$this->setAlgorythme ( $liste_algo_tempo );\n\t\t\t$this->calcul_dates ();\n\t\t}\n\t\t//On concatene le tableau de donnees et le tableau de resultat pour continuer\n\t\tforeach ( $this->tableau_resultat as $serial => $liste_dates ) {\n\t\t\tif (isset ( $this->tableau_resultat [$serial] [\"algo_date\"] ) && is_array ( $this->tableau_resultat [$serial] [\"algo_date\"] ) && count ( $this->tableau_resultat [$serial] [\"algo_date\"] ) > 0) {\n\t\t\t\t$this->donnees [$serial] = array ();\n\t\t\t\t$this->donnees [$serial] [\"algo_date\"] = $this->tableau_resultat [$serial] [\"algo_date\"];\n\t\t\t} else\n\t\t\t\tforeach ( $liste_dates as $date => $donnees_local )\n\t\t\t\t\t$this->donnees [$serial] [$date] = $this->concatene_tableau ( $this->donnees [$serial] [$date], $this->tableau_resultat [$serial] [$date] );\n\t\t}\n\t\t\n\t\t//Donnees resultantes :\t\t\n\t\t//[serial]\n\t\t//\t[algo_date]\n\t\t//\t\t[algoX]\n\t\t//ou\n\t\t//[serial]\n\t\t//\t[date]\n\t\t//\t\t[algoX]\n\t\t\n\n\t\t$this->setAlgorythme ( $liste_algo_restant );\n\t\t$this->donnees_calcul = $this->donnees;\n\t\t$this->tableau_resultat = array ();\n\t\t\n\t\t$liste_dates_hash = array ();\n\t\t//Pour chaque serial, on creer les donnees de \"donnees_calcul\" et \n\t\tforeach ( $this->donnees as $serial => $liste_dates ) {\n\t\t\t//Si on a un algo_date alors on bosse dessus, sinon on bosse sur chaque date\n\t\t\tforeach ( $liste_dates as $date => $donnees )\n\t\t\t\t$liste_dates_hash [$date] = 1;\n\t\t}\n\t\t\n\t\t//Pour chaque algorithme,\n\t\t//on applique les algos dans l'ordre d'apparition des algos\n\t\tforeach ( $this->algorythme as $nom_algo => $algo ) {\n\t\t\t//on applique les algos en fonction de leur type\n\t\t\tif ($algo [\"type\"] != \"serial\")\n\t\t\t\t$liste_algo_restant_apres_date [$nom_algo] = $algo;\n\t\t\telse {\n\t\t\t\tforeach ( $liste_dates_hash as $date => $valeur ) {\n\t\t\t\t\t//on passe la liste de serial et on ajoute les champs communs par date ou algo_date\n\t\t\t\t\t$this->calcul_plusieurs_serials ( $nom_algo, $algo, $date );\n\t\t\t\t\t//le resultat est stocke dans [algo_serials]\n\t\t\t\t\t$this->tableau_resultat [\"algo_serial\"] [$date] [$nom_algo] = $this->resultat [$nom_algo];\n\t\t\t\t\t//On ajoute le resultat dans les donnees de calcul si elle sont re-utiliser\n\t\t\t\t\t$this->donnees_calcul [\"algo_serial\"] [$date] [$nom_algo] = $this->resultat [$nom_algo];\n\t\t\t\t\t//On re-initialise les variables\n\t\t\t\t\t$this->resultat = array ();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Si il reste des algos unitaires, on les traites en derniers\n\t\tif (count ( $liste_algo_restant_apres_date ) > 0) {\n\t\t\t$this->setAlgorythme ( $liste_algo_restant_apres_date );\n\t\t\t$this->donnees = array ();\n\t\t\t$this->donnees [\"algo_serial\"] = $this->tableau_resultat [\"algo_serial\"];\n\t\t\t$this->calcul_unitaire ();\n\t\t\tforeach ( $this->tableau_resultat [\"algo_serial\"] as $date => $resultat ) {\n\t\t\t\t$this->tableau_resultat [\"algo_serial\"] [$date] = $this->concatene_tableau ( $this->tableau_resultat [\"algo_serial\"] [$date], $this->donnees [\"algo_serial\"] [$date] );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//enfin on applique les sommes sur les serials\n\t\treturn true;\n\t}", "function GetPeticionesAbiertas()\r\n{\r\n$maquinas = array();\r\n//recibimos las peticiones pendientes de finalizar\r\n$peticiones = GetPeticionesPendientes();\r\n\tforeach($peticiones as $v_peticion)\r\n\t{\r\n\t //comprobamos que realmente esta abierta realizando un peticion a la api\r\n\t if( comprobarPeticion($v_peticion[0]) != \"terminated\" and comprobarPeticion($v_peticion[0]) != \"shutting-down\" ){\r\n\t $maquinas[] = $v_peticion[0];\r\n\t }\r\n\t}\r\n return $maquinas;\r\n}", "public function estudiantesPrimaria(){\r\n try {\r\n if($this->verificarSession()){\r\n $this->vista->set('titulo', 'estudiantes Primaria');\r\n $limI='1';\r\n $limS='5';\r\n $salones = new Salon();\r\n $primaria = $salones->leerSalonesJornada($limI,$limS);\r\n $this->vista->set('primaria', $primaria);\r\n return $this->vista->imprimir();\r\n }\r\n } catch (Exception $exc) {\r\n echo 'Error de aplicacion: ' . $exc->getMessage();\r\n }\r\n }", "public function esSabadoNoche();", "function courtjus_objets_in_rubrique($id_rubrique) {\n\t// On va compter le nombre d'objet présent dans la rubrique\n\t$tables = courtjus_trouver_objet_rubrique();\n\n\t// on va compter le nombre d'objet qu'il y a dans la rubrique.\n\t$objets_in_rubrique = array();\n\n\t// On boucle sur tout les table qui pourrait être ratacher à une rubrique\n\tforeach ($tables as $table) {\n\t\t// Simplification des variables. On a besoin du titre pour trouver le num titre\n\t\tlist($table, $titre) = $table;\n\t\t// L'objet\n\t\t$objet = table_objet($table);\n\t\t// l'identifiant de l'objet\n\t\t$champs_id = id_table_objet($table);\n\t\t// Le champ qui contient la date\n\t\t$champ_date = objet_info($objet, 'date');\n\n\t\t// Les champs qui seront utilisé pour la requête.\n\t\t$champs = array(\n\t\t\t$champs_id,\n\t\t\t$titre,\n\t\t\t// Convertir la date de l'objet en timestamp, cela permettra une comparaison rapide\n\t\t\t'UNIX_TIMESTAMP('.$champ_date.') AS '.$champ_date\n\t\t);\n\n\t\t// Le where\n\t\t$where = array(\n\t\t\t'id_rubrique='.intval($id_rubrique),\n\t\t\t'statut='.sql_quote('publie')\n\t\t);\n\n\t\t// Est-ce qu'il faut prendre en compte la langue ?\n\t\tinclude_spip('formulaires/configurer_multilinguisme');\n\t\tif (table_supporte_trad($table)) {\n\t\t\t$where[] = 'lang='.sql_quote($GLOBALS['spip_lang']);\n\t\t}\n\n\t\t// On récupère les objets de la rubrique.\n\t\t$objets_rubrique = sql_allfetsel($champs, $table, $where);\n\n\t\t// On boucle sur les objets à l'intérique de la rubrique.\n\t\tforeach ($objets_rubrique as $objet_rubrique) {\n\n\t\t\t$num_titre = recuperer_numero($objet_rubrique['titre']);\n\n\t\t\t// On créer le tableau contenant les données de l'objet\n\t\t\t$objets_in_rubrique[] = array(\n\t\t\t\t'id_objet' => $objet_rubrique[$champs_id],\n\t\t\t\t'objet' => $objet,\n\t\t\t\t'num_titre' => $num_titre,\n\t\t\t\t'date' => $objet_rubrique[$champ_date]\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $objets_in_rubrique;\n}", "function palabraRelevanteGrupo($vect){\n $k=0;\n //Buscar palabras con mayor peso\n for($i=0;$i<count($vect);$i++){\n $query = \"SELECT termino FROM vectCarac WHERE id_noticia = \".$vect[$i].\" AND peso_termino > 0.9\";\n $tabla = mysql_query($query);\n \n while($datos = mysql_fetch_assoc($tabla)){\n if($datos['termino'] != \" \" && $datos['termino'] != ' ' && $datos['termino'] != \"Â\"){\n $arrayPal[$k] = $datos['termino']; \n }\n $k++; \n }\n }\n //$arrayPalAux = array_unique($arrayPal); //Arreglo con palabras sin repetir\n $arrayCuenta = array_count_values($arrayPal); //Arreglo con cantidad de apareciones de palabras\n arsort($arrayCuenta);\n $array = array_keys($arrayCuenta);\n /*$k = 0;\n //Eliminando espacios en blanco de arreglo de palabras\n for($i=0;$i<count($arrayPal);$i++){\n if($arrayPalAux[$i] != \"\"){\n $nuevoArray[$k] = $arrayPalAux[$i];\n $k++;\n }\n }\n //Determinando la palabra con mayor numero de apariciones\n $mayor = -999;\n for($i=0;$i<count($nuevoArray);$i++){\n if($mayor < $arrayCuenta[$nuevoArray[$i]]){\n $mayor = $arrayCuenta[$nuevoArray[$i]];\n $pos = $i;\n }\n }*/\n //echo \"el mayor esta en la pos: \".$pos.\" y es el termino: \".$nuevoArray[$pos];\n \n return current($array).\" \".next($array).\" \". next($array);/*implode(\" \", $arrayPal);*/ \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Required. The ID of the entity. Generated from protobuf field string entity_id = 1 [(.google.api.field_behavior) = REQUIRED];
public function setEntityId($var) { GPBUtil::checkString($var, True); $this->entity_id = $var; return $this; }
[ "public function getEntityId()\n {\n return $this->entity_id;\n }", "public function setEntityId($entity_id);", "public function getEntityIdField()\n {\n return 'entity_id';\n }", "public function getIdEntity()\n {\n return $this->idEntity;\n }", "public function getEntityId()\n {\n return $this->entity->getId();\n }", "public function setEntityID($var)\n {\n GPBUtil::checkUint64($var);\n $this->entityID = $var;\n\n return $this;\n }", "public function getIdentifier($entity)\n {\n return $entity->id;\n }", "public function getEntityId(){\n return $this->_getData(self::ENTITY_ID);\n }", "public function get_entity_id()\n {\n return $this->get_default_property(self::PROPERTY_ENTITY_ID);\n }", "public function getEntityIdentifier($entity)\n {\n return $this->entityIdentifiers[spl_object_hash($entity)];\n }", "protected function getIdFromEntity($entity)\n {\n $params = [\n 'entity' => $entity,\n ];\n\n $callback = function ($r) {\n return (null !== $r && false !== $r);\n };\n\n $results = $this->getEventManager()->trigger(\n __FUNCTION__,\n $this,\n $params,\n $callback\n );\n\n if ($results->stopped()) {\n return $results->last();\n }\n\n return false;\n }", "public function setEntity($var)\n {\n GPBUtil::checkString($var, True);\n $this->entity = $var;\n\n return $this;\n }", "final public function getId()\n {\n return $this->entity->getId();\n }", "public function getEntityIdField()\n {\n return $this->entity_id_field;\n }", "public function getAnnotatedEntityId();", "public function setEntity($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\VideoIntelligence\\V1\\Entity::class);\n $this->entity = $var;\n\n return $this;\n }", "public function setEntity($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Analytics\\Data\\V1alpha\\Entity::class);\n $this->entity = $var;\n\n return $this;\n }", "public function addEntityId($entity_type, $entity_id, $field_name, $webform_id);", "public function getEntityId() {\n if (null !== $this->jobEntity) {\n return $this->jobEntity->getId();\n } else {\n return null;\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Update the file that the user uploads.
public function updateFile($user) { $folder = '/assets/admin/images/profiles/'; if (Input::hasfile('thumbnail')) { File::delete(public_path() . $user->profile->thumbnail); $thumbnail = $this->inputFile($folder); $user->profile->update($thumbnail); }; }
[ "function update_file()\n {\n $parameter_array = $this->get_parameter_array();\n \n parent::update($this->id, 'sissidsssssssssddisii', $parameter_array);\n }", "public function updateFiles();", "public function updated(File $file)\n {\n }", "public function updatePicture(){\n if($_FILES[\"myFile\"][\"type\"] == \"image/jpg\" || $_FILES[\"myFile\"][\"type\"] == \"image/jpeg\"){\n if(move_uploaded_file($_FILES[\"myFile\"][\"tmp_name\"], \"./assets/myImage.jpg\")){\n header(\"location:/profile\");\n }\n\n else{\n echo \"problem uploading\";\n }\n }\n\n else{\n header(\"location:/profile?msg=Not Allowed\");\n }\n }", "public function uploads()\n\t{\n\t\t$id = get_loggedin_user_id();\n\t\t$data = $this->input->post();\n\n\t\tif ($_FILES['profile_image']['name'] != NULL)\n\t\t{\n\t\t\t$result = upload_logo('assets/uploads/users/', 'profile_image');\n\n\t\t\tif (!$result)\n\t\t\t{\n\t\t\t\tset_alert('warning', _l('_updation_fail_please_try_again', _l('profile')));\n\t\t\t\tredirect('profile/edit');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['profile_image'] = $result;\n\n\t\t\t\t$update = $this->users->update($id, $data);\n\t\t\t\tif ($update)\n\t\t\t\t{\n\t\t\t\t\tset_alert('success', _l('_updated_successfully', _l('profile')));\n\t\t\t\t\tredirect('profile/edit');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function update_file(){\r\n\t\tif($fp = fopen($this->file, \"w\")){\r\n\t\t\tfwrite($fp, stripslashes($this->data));\r\n\t\t\tfclose($fp);\r\n\t\t}\r\n\t\telse {\r\n\t\t\texit (\"Error!!! the file {$this->file} can not be write, check permissions.\");\r\n\t\t}\r\n\t}", "public function uploadFile()\n {\n if ($this->getFile() === null) {\n return;\n }\n\n $date = date('Y-m-d');\n\n $this->getFile()->move($this->getUploadRootDir().\"/{$date}\", $this->path);\n\n $this->file = null;\n }", "private function updateFile()\n\t{\n\t\tif (is_null($this->file_path)) throw new StorageException('Invalid file path');\n\n\t\tfile_put_contents($this->file_path, serialize([\n\t\t\t'tokens' => $this->tokens,\n\t\t\t'states' => $this->states\n\t\t]));\n\t}", "public function updated(File $model)\n {\n //\n }", "public function update_image()\n {\n $image = $this->pluploadlib_new->process_upload();\n $out = array(\n 'url' => config_item('upload_url') . '/' . $image,\n 'image_name' => $image\n );\n\n $data = new stdClass();\n\n $img_link = X_TEACHER_UPLOAD_PATH . DIRECTORY_SEPARATOR. trim($image);\n $fp = fopen($img_link,'r');\n\n $data->avatar = base64_encode(fread($fp,filesize($img_link)));\n $this->teacher_model->save($data, TeacherHelper::getUserId());\n\n fclose($fp);\n\n $this->output->set_output($image);\n\n }", "public function updateFileAccess() {\n\t\t// change access on files in this folder\n\t\t$files = elgg_get_entities([\n\t\t\t'type' => 'object',\n\t\t\t'subtype' => 'file',\n\t\t\t'container_guid' => $this->getContainerGUID(),\n\t\t\t'limit' => false,\n\t\t\t'relationship' => FileToolsFolder::RELATIONSHIP,\n\t\t\t'relationship_guid' => $this->guid,\n\t\t\t'batch' => true,\n\t\t]);\n\t\t\n\t\t// need to unregister an event listener\n\t\telgg_unregister_event_handler('update', 'object', '\\ColdTrick\\FileTools\\ElggFile::setFolderGUID');\n\t\t\n\t\t/* @var $file ElggFile */\n\t\tforeach ($files as $file) {\n\t\t\t$file->access_id = $this->access_id;\n\t\t\t$file->save();\n\t\t}\n\t}", "public function updating()\n {\n // Check if image field is changed and if callback is defined\n if ($this->model->isDirty($this->attribute)) {\n // Delete old file\n $this->deleteImages();\n\n // Callback to save file on model updating\n if (is_callable($this->storeImagesCallback)) {\n ($this->storeImagesCallback)();\n }\n }\n }", "function upload_file() {\n\t \t$this->wireframe->print_button = false;\n\t \t\n\t \tif(!Document::canAdd($this->logged_user)) {\n\t\t \t$this->httpError(HTTP_ERR_FORBIDDEN);\n\t\t } // if\n\t \t\n\t \t$file = $_FILES['file'];\n\t \t$file_data = $this->request->post('file');\n\t \t\n\t \tif(!is_array($file_data)) {\n\t \t\t$file_data = array('category_id' => $this->active_document_category->getId());\n\t \t} // if\n\t \t\n\t \trequire_once SMARTY_PATH . '/plugins/modifier.filesize.php';\n\t \t\n\t \t$this->smarty->assign(array(\n\t \t\t'file_data' => $file_data,\n\t \t\t'max_upload_size' => smarty_modifier_filesize(get_max_upload_size()),\n\t \t));\n\t \t\n\t \tif($this->request->isSubmitted()) {\n\t \t\tdb_begin_work();\n\t \t\t$this->active_document->setAttributes($file_data);\n\t \t\t\n\t \t\tif(is_array($file)) {\n\t $destination_file = get_available_uploads_filename();\n\t if(move_uploaded_file($file['tmp_name'], $destination_file)) {\n\t $this->active_document->setName($file['name']);\n\t $this->active_document->setBody(basename($destination_file));\n\t $this->active_document->setMimeType($file['type']);\n\t } // if\n\t\t \t} // if\n\t \t\t$this->active_document->setCreatedBy($this->logged_user);\n\t \t\t$this->active_document->setType('file');\n\t\t\t\t$save = $this->active_document->save();\n\t\t\t\t\n\t\t\t\tif ($save && !is_error($save)) {\n\t\t\t\t\t$notify_user_ids = $this->request->post('notify_users');\n\t\t\t\t\tif(is_foreachable($notify_user_ids)) {\n\t\t\t\t\t\t$notify_users = Users::findByIds($notify_user_ids);\n\t\t\t\t\t\t$owner_company = get_owner_company();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(is_foreachable($notify_users)) {\n\t\t\t\t\t\t\t\tApplicationMailer::send($notify_users, 'documents/new_upload_file_document', array(\n\t\t\t\t\t\t\t\t\t'document_name' => $this->active_document->getName(),\n\t\t\t\t\t\t\t\t\t'created_by_name' => $this->active_document->getCreatedByName(),\n\t\t\t\t\t\t\t\t\t'created_by_url' => $this->logged_user->getViewUrl(),\n\t\t\t\t\t\t\t\t\t'document_url' => $this->active_document->getViewUrl(),\n\t\t\t\t\t\t\t\t\t'owner_company_name' => $owner_company->getName()\n\t\t\t\t\t\t\t\t), $this->active_document);\n\t\t\t\t\t\t} // if\n\t\t\t\t\t} // if\n\t\t\t\t\t\n\t\t\t\t\tdb_commit();\n\t\t\t\t\tflash_success('Document \":document_name\" has been uploaded', array('document_name' => $this->active_document->getName()));\n\t\t\t\t\t$this->redirectTo('documents');\n\t\t\t\t} else {\n\t\t\t\t\tdb_rollback();\n\t\t\t\t\t$this->smarty->assign('errors', $save);\n\t\t\t\t} // if\n\t \t} // if\n }", "public function updateFromUploadedFile(UploadedFile $file)\n {\n $this->name = $file->name;\n $this->mime_type = $file->type;\n $this->contents = file_get_contents($file->tempName);\n }", "private function updateFiles()\n {\n foreach ($this->files as $File) {\n $this->success[] = file_put_contents('../'.$this->getRealDirectory($File), file_get_contents($File));\n }\n }", "public function block_file(){\r\n\t\t$this->autoRender = false;\r\n\t\t$id = $_POST['file_id'];\r\n\t\t$userId = $_POST['user_id'];\r\n\t\t\r\n\t\t$file = $this->Upload->findById($id);\r\n\t\t$file['Upload']['locked'] = 1;\r\n\t\t$file['Upload']['locked_until'] = date('Y-m-d H:i:s', (time()+(60*60*2)));\r\n\t\t$file['Upload']['last_user_id'] = $userId;\r\n\t\t$file['Upload']['token'] = md5(uniqid(mt_rand(), true));\r\n\r\n\t\tif($this->Upload->saveChange($file)){\r\n\t\t\t\r\n\t\t\treturn 'Ok';\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\treturn 'error';\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function updateFotoUser_post()\n\t{\n\t\t$id = $this->post('id');\n\t\t// $checkout = md5(uniqid($id));\n\t\t$name = base64_decode($this->post('foto'));\n\t\t$config = array(\n\t\t\t'upload_path' => \"asset/img/fotouser\",\n\t\t\t'allowed_types' => \"jpg|png|jpeg|gif\",\n\t\t\t'max_size' => '100',\n\t\t\t'file_name' => $name\n\t\t);\n\t\t$this->load->library('upload', $config);\n\n\t\tif ($this->upload->do_upload('foto')) {\n\t\t\t$data = array('upload_data' => $this->upload->data());\n\t\t\t$path = \"http://192.168.43.83/Apotek/\" . $config['upload_path'] . '/' . $data['upload_data']['file_name'];\n\t\t\t$this->db->where('id', $id);\n\t\t\t$this->db->update('user', ['foto' => $path]);\n\t\t\t// $this->Pesan->updatePesan($id,$path);\n\t\t\t$returndata = array('error' => false, 'message' => ' upload successfully');\n\t\t\t$this->set_response($returndata, 200);\n\t\t} else {\n\t\t\t$error = array('error' => $this->upload->display_errors());\n\t\t\t$returndata = array('error' => true, 'message' => $error);\n\t\t\t$this->set_response($returndata, 200);\n\n\t\t\t}\n\t}", "public function testUpdateFile()\n\t{\n\t\tprint 'Run test for #updateFile...';\n\t\t$api = new DefaultApi();\n\t\t$response = $this->provideApiKeyAndFileId($api, function ($api, $apiKey, $fileId) {\n\t\t\treturn $api->updateFile(\n\t\t\t\t(new UpdateFileRequest())\n\t\t\t\t\t->setApiKey($apiKey)\n\t\t\t\t\t->setId($fileId)\n\t\t\t\t\t->setFName('f')\n\t\t\t\t\t->setLName('l')\n\t\t\t\t\t->setNotes('n')\n\t\t\t\t\t->setEmail('e@mail.ru')\n\t\t\t\t\t->setPhone('+16463742122')\n\t\t\t\t\t->setTags('t')\n\t\t\t\t\t->setFolderId(0)\n\t\t\t\t\t->setName('n')\n\t\t\t\t\t->setRemindDays('10')\n\t\t\t\t\t->setRemindDate('2019-09-03T21:11:51.824121+03:00')\n\t\t\t);\n\t\t});\n\t\tprint($response);\n\t\t$this->assertEquals('ok', $response->getStatus());\n\t\t$this->assertStringMatchesFormat('%Ssuccess%S', strtolower($response->getMsg()));\n\t\tprint('');\n\t}", "private function _api_upload_file()\n\t{\n\t\t$this->_api_upload_image();\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the IP address filter settings from a device
public function get_ip_address_filter() { return $this->client->GetIPAddressFilter(); }
[ "function getOutputFilterSettings() {\n\t\tglobal $database, $admin;\n\t// set default values\n\t\t$settings = array(\n\t\t\t'sys_rel' => 0,\n\t\t\t'email_filter' => 0,\n\t\t\t'mailto_filter' => 0,\n\t\t\t'at_replacement' => '(at)',\n\t\t\t'dot_replacement' => '(dot)'\n\t\t);\n\t// be sure field 'sys_rel' is in table\n\t\t$database->field_add( TABLE_PREFIX.'mod_output_filter', 'sys_rel', 'INT NOT NULL DEFAULT \\'0\\' FIRST');\n\t// request settings from database\n\t\t$sql = 'SELECT * FROM `'.TABLE_PREFIX.'mod_output_filter';\n\t\tif(($res = $database->query($sql))) {\n\t\t\tif(($rec = $res->fetchRow())) {\n\t\t\t\t$settings = $rec;\n\t\t\t\t$settings['at_replacement'] = $admin->strip_slashes($settings['at_replacement']);\n\t\t\t\t$settings['dot_replacement'] = $admin->strip_slashes($settings['dot_replacement']);\n\t\t\t}\n\t\t}\n\t// return array with filter settings\n\t\treturn $settings;\n\t}", "public function getGeoFilterSettings() {\n $geofilter_settings = new IPViking\\Settings_GeoFilter($this->getConfig());\n return $geofilter_settings->getCurrentSettings();\n }", "public function getDevicesFilter()\n {\n return $this->devicesFilter;\n }", "public function ip_address_get(){\n\t\treturn $this->fb->exec('lan.ip_address_get');\n\t}", "protected function get_ip_data()\n\t{\n\t\t$fields = array (\n\t\t\t'HTTP_X_FORWARDED_FOR',\n\t\t\t'REMOTE_ADDR',\n\t\t\t'HTTP_CLIENT_IP'\n\t\t);\n\t\t$fields = apply_filters( 't5_404_ip_fields', $fields );\n\t\t$url = apply_filters(\n\t\t\t't5_404_ip_check_url',\n\t\t\t'http://ip.toscho.de/?ip=%s'\n\t\t);\n\n\t\t$out = array ();\n\t\tforeach ( $fields as $field )\n\t\t{\n\t\t\tisset ( $_SERVER[ $field ] )\n\t\t\t\tand $out[ $field ] = sprintf( $url, $_SERVER[ $field ] );\n\t\t}\n\n\t\treturn $out;\n\t}", "public function getContextFilterSettings()\n {\n return $this->context_filter_settings;\n }", "function filterContactSettings() {\n\treturn array(\n\t\t'id'\t\t\t\t=> 'contacts.id',\n\t\t'organization'\t\t=> 'organizations.name',\n\t\t'library'\t\t\t=> 'libraries.name',\n\t\t'city'\t\t\t\t=> filterContactByCity(Input::get('city', false)),\n\t\t'library-type'\t\t=> 'libraries.library_type',\n\t\t'contact-type'\t\t=> filterContactByContactType(Input::get('contact-type', false), Input::get('contact-type-bool', 'any')),\n\t\t'library_id'\t\t=> 'libraries.id',\n\t\t'organization_id'\t=> 'organizations.id',\n\t\t'zipcode'\t\t\t=> 'contacts.zip',\n\t\t'keyword'\t\t\t=> filterContactByKeyword(Input::get('keyword', false)),\n\t\t'orderby'\t\t\t=> filterContactByDefaultSort(\n\t\t\tInput::get('orderby', false), \n\t\t\tInput::get('order', 'asc')\n\t\t)\n\t);\t\n}", "public function getFilterSettings($domain)\n\t{\n\t\treturn $this->apiRequest('get-filter-settings', array(\n\t\t\t'domain' => $domain\n\t\t));\n\t}", "public function evaluateConditionCommonDevIpMaskDataProvider()\n {\n return [\n // [0] $GLOBALS['TYPO3_CONF_VARS']['SYS']['devIPmask']\n // [1] Actual IP\n // [2] Expected condition result\n 'IP matches' => [\n '127.0.0.1',\n '127.0.0.1',\n true,\n ],\n 'ipv4 wildcard subnet' => [\n '127.0.0.1/24',\n '127.0.0.2',\n true,\n ],\n 'ipv6 wildcard subnet' => [\n '0:0::1/128',\n '::1',\n true,\n ],\n 'List of addresses matches' => [\n '1.2.3.4, 5.6.7.8',\n '5.6.7.8',\n true,\n ],\n 'IP does not match' => [\n '127.0.0.1',\n '127.0.0.2',\n false,\n ],\n 'ipv4 subnet does not match' => [\n '127.0.0.1/8',\n '126.0.0.1',\n false,\n ],\n 'ipv6 subnet does not match' => [\n '::1/127',\n '::2',\n false\n ],\n 'List of addresses does not match' => [\n '127.0.0.1, ::1',\n '::2',\n false,\n ],\n ];\n }", "public function get_devices(){\n $settingsObj = DPSFolioAuthor_Settings::getInstance();\n\t\t $settings = $settingsObj->get_settings();\n return isset($settings[\"devices\"]) ? $settings[\"devices\"] : $this->initial_devices();\n\t\t}", "function wi_readHostSettings() {\n\t\tif (!$sRead = $this->_wiget(\"/server_basic_settings.html\")) return false;\n\t\t$pattern = '/<input.*?name=\"([a-zA-Z0-9_]+)\".*?value=\"(.*?)\".*?>/im';\n\t\t$pattern2 = '/<option value=\"(.*?)\" selected>/im';\n\t\tif (!preg_match_all($pattern, $sRead[1], $matches)) return false;\n\t\t$data = array();\n\t\tforeach ($matches[1] as $key => $val) {\n\t\t\tif (strstr($matches[0][$key], 'type=\"checkbox\"')) {\n\t\t\t\t$data[$val] = (strstr($matches[0][$key], \"checked\")) ? 1 : 0;\n\t\t\t} else {\n\t\t\t\t$data[$val] = $matches[2][$key];\n\t\t\t}\n\t\t}\n\t\tif (preg_match($pattern2, $sRead[1], $matches))\n\t\t\t$data[\"basic_country\"] = $matches[1];\n\t\treturn $data;\n\t}", "public function getFilterConfig()\n {\n return $this->filterConfig;\n }", "public function getConfigOfFilters();", "private function getFloodConfig() {\n return $this->configFactory->get('user.flood');\n }", "function filtered_device_list() {\n\t\treturn array(\n\t\t\t'custom-device' => array(\n\t\t\t\t'label' => __( 'Enter custom-device preview mode' ),\n\t\t\t\t'default' => true,\n\t\t\t),\n\t\t);\n\t}", "public function getNetworkSettings()\n {\n return $this->network_settings;\n }", "public function getLogIPAddress(){\n\t\t$result = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::getIndpEnv('REMOTE_ADDR');\n\t\tif ($this->pObj->config['config']['stat_IP_anonymize']) {\n\t\t\tif (strpos($result, ':')) {\n\t\t\t\t$result = $this->stripIPv6($result);\n\t\t\t} else {\n\t\t\t\t$result = $this->stripIPv4($result);\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public function whitelist()\n {\n return ['whitelisted_ips' => $this->whitelist];\n }", "public function read_config () {\n return $this->DHCP_server->config;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the queue manager instance.
public function setManager(QueueManager $manager) { $this->manager = $manager; }
[ "public function setQueue(QueueManager $queue)\n {\n $this->queue = $queue;\n\n return $this;\n }", "public function setMessageQueueManager( \\Aimeos\\MW\\MQueue\\Manager\\Iface $mqManager );", "public function setQueue(QueueManager $queue = null)\n {\n $this->queue = $queue;\n\n return $this;\n }", "public function getQueueManager()\n {\n return $this->manager->getQueueManager();\n }", "public static function setQueue($queue) {\n \n }", "protected function registerManager()\n {\n $this->app->singleton('queue', function ($app) {\n // Once we have an instance of the queue manager, we will register the various\n // resolvers for the queue connectors. These connectors are responsible for\n // creating the classes that accept queue configs and instantiate queues.\n return tap(new QueueManager($app), function ($manager) {\n $this->registerConnectors($manager);\n });\n });\n }", "public function setQueue(QueueInterface $queue);", "public static function setManager(Manager $manager)\n {\n self::$managers[get_called_class()] = $manager;\n }", "public function setMessageManager() {\n\t\t$this->messageManager = new MessageManager($this, $this->getSettingsProperty(\"messages\", []));\n\t}", "protected function registerManager()\n {\n $this->app->singleton('httpQueue', function($app) {\n return tap(new HttpQueueManager($app), function($manager) {\n $this->registerParsers($manager);\n });\n });\n\n // Register the manager alias as the class name.\n $this->app->alias('httpQueue', HttpQueueManager::class);\n }", "public function setQueue(QueueInterface $queue)\n {\n $this->queue = $queue;\n }", "public function setManager(IDeliveryManager $manager);", "protected function makeQueueManager()\n {\n $cli = $this->climate();\n\n $data = [\n 'logger' => $this->logger,\n 'queue_item_factory' => $this->queueItemFactory,\n 'chunkSize' => 100,\n ];\n\n $rate = $cli->arguments->get('rate');\n if ($rate !== null) {\n $data['rate'] = $rate;\n }\n\n $limit = $cli->arguments->get('limit');\n if ($limit !== null) {\n $data['limit'] = $limit;\n }\n\n $chunkSize = $cli->arguments->get('chunk-size');\n if ($chunkSize !== null) {\n $data['chunkSize'] = $chunkSize;\n }\n\n $class = $this->getQueueManagerClass();\n $queueManager = new $class($data);\n $queueManager->setProcessedCallback($this->getProcessedQueueCallback());\n\n $queueId = $cli->arguments->get('queue-id');\n if ($queueId !== null) {\n $data['queue_id'] = $queueId;\n }\n\n return $queueManager;\n }", "public function setQueues($queues)\n {\n $this->_queues = $queues;\n }", "public function setQueue($queue = null)\n {\n // validation for constraint: string\n if (!is_null($queue) && !is_string($queue)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($queue)), __LINE__);\n }\n if (is_null($queue) || (is_array($queue) && empty($queue))) {\n unset($this->Queue);\n } else {\n $this->Queue = $queue;\n }\n return $this;\n }", "public function setManager(\\Shopware\\Components\\Model\\ModelManager $manager)\n {\n $this->manager = $manager;\n }", "public function connect()\n {\n $this->queueManager = new Manager();\n\n //Some drivers need it\n $this->queueManager->getContainer()->bind('encrypter', function() {\n return new Encrypter('rc5lgpue80sr17nx');\n });\n\n //One more bind for closure functions\n $this->queueManager->getContainer()->bind('Illuminate\\Contracts\\Encryption\\Encrypter', 'encrypter');\n\n //Connector to successful jobs\n $this->queueManager->addConnector('mongoQueue', function () {\n return new MongoConnector(Yii::$app->mongodb, 'YiiJobs');\n });\n\n //Add connection for manager\n $this->queueManager->addConnection([\n 'driver' => 'mongoQueue',\n 'table' => 'YiiJobs',\n 'queue' => 'default',\n 'expire' => 60,\n ], 'default');\n\n //Set as global to access\n $this->queueManager->setAsGlobal();\n\n return $this->queueManager;\n }", "public static function setTransactionManager($manager)\n { //Method inherited from \\Illuminate\\Database\\Connection \n /** @var \\Illuminate\\Database\\MySqlConnection $instance */\n return $instance->setTransactionManager($manager);\n }", "public function setTopicManager(ObjectManagerInterface $manager)\n {\n $this->manager = $manager;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the Log Instance
public static function getInstance ( ) { return Zend_Registry::get('Log'); }
[ "static public function get_instance( )\n\t{\n\t\tif (is_null(self::$_instance)) {\n\t\t\tself::$_instance = new Log( );\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "public static function instance() {\n\t\tif (Log::$_instance === null) {\n\t\t\t// Create a new instance\n\t\t\tLog::$_instance = new Log;\n\n\t\t\t// Write the logs at shutdown\n \t\t\tregister_shutdown_function(array(Log::$_instance, 'write'));\n\t\t}\n\n\t\treturn Log::$_instance;\n\t}", "public static function getLog()\n {\n if (is_null(static::$log)) {\n static::$log = new Log('');\n }\n return static::$log;\n }", "public function log() {\n return new Log($this);\n }", "public function getLog()\n\t{\n\t\treturn $this->get(self::LOG);\n\t}", "public function get()\n {\n return $this->log;\n }", "public static function getInstance()\n {\n if (!self::$instance)\n {\n self::$instance = new logger;\n }\n return self::$instance;\n }", "public static function getInstance()\n {\n if (!self::$instance) {\n self::$instance = new logger;\n }\n return self::$instance;\n }", "public static function instance()\n\t{\n\t\t// make sure we have an instance\n\t\tstatic::$monolog or static::_init();\n\n\t\t// return the created instance\n\t\treturn static::$monolog;\n\t}", "public function getLog()\n\t{\n\t\tif (!$this->_logModel) {\n\t\t\t$this->_logModel = Mage::getModel('logging/log');\n\t\t}\n\t\treturn $this->_logModel;\n\t}", "public function log()\n {\n // get log for given log type\n if (func_num_args() === 1) {\n $arg = func_get_arg(0);\n\n if (is_string($arg)) {\n $arg = array(\n 'type' => $arg,\n );\n }\n\n $result = $this->curl('POST', '/log', $arg);\n\n return $result['value'];\n }\n\n // chaining\n return new Log($this->url . '/log');\n }", "public function getLog()\n {\n return Controllers\\LogController::getInstance();\n }", "protected function getLogViewerInstance()\n {\n return $this->app->make(\\Arcanedev\\LogViewer\\Contracts\\LogViewer::class);\n }", "public static function getLog() {\n return Log::instance( 'framework' );\n }", "static function getInstance() {\n\n //Construction d'un Singleton, l'objet DebugLogs sera toujours unique.\n if(empty(self::$Myinstance))\n {\n self::$Myinstance=new DebugLogs;\n }\n return self::$Myinstance;\n }", "public static function getInstance() {\n if (!isset(self::$instance)) {\n self::$instance = new Logger();\n }\n return self::$instance;\n }", "public static function instance() {\n\t\treturn new Logger();\n\t}", "public static function sharedInstance()\n\t{\n\t\tif( self::$sharedInstance === null ) self::$sharedInstance = new RSLog();\n\t\treturn self::$sharedInstance;\n\t}", "protected function getCurrentInstance()\n {\n $instance = $this->getSession()->instance;\n \n if($instance) {\n // Update of instance to have last logs created\n $instance = $this->getManager()->find($instance->getId());\n }\n return $instance;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function deletes shipping data
public function delete() { unset(ShipTo::$rawShipTos[$this->idShipTo]); }
[ "function delete()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $res[] = $db->query( \"DELETE FROM eZTrade_ShippingValue WHERE ShippingGroupID='$this->ID'\" );\r\n $res[] = $db->query( \"DELETE FROM eZTrade_ShippingGroup WHERE ID='$this->ID'\" );\r\n\r\n eZDB::finish( $res, $db );\r\n }", "public function removeShippingInfo()\n {\n $this->shipping_id = 0;\n $this->shipping = 0;\n $this->total = ($this->amount * $this->quantity) + $this->shipping;\n $this->save();\n\n foreach ($this->addresses() as $address) {\n $address->address = '';\n $address->address2 = '';\n $address->city = '';\n $address->state = '';\n $address->zip = '';\n $address->country = '';\n $address->shipping_id = 0;\n $address->shipping = 0;\n $address->save();\n }\n }", "abstract protected function delete_pickup_data();", "public function delete() {\r\n\t\tunset(ShipTo::$rawShipTo[$this->idShipTo]);\r\n\t}", "public static function DeleteShippingPromoCodes() {\n\n\t\tPromoCode::model()->deleteAll(\"lscodes LIKE 'shipping:,%'\");\n\t}", "public function deleteById($customshippingId);", "public function forceDeleted(Shipping $shipping)\n {\n //\n }", "public function delete_shipment($id)\n {\n }", "public function delete_booking_data()\n\t{\n\t\t$data_ids = $_REQUEST['data_ids'];\n\t\t$this->home->delbooking($data_ids);\n\t}", "public function delete() { \n\t\tif (isset($this->request->get['shipping_method_id'])) $this->request->post['selected'] = array($this->request->get['shipping_method_id']);\n\t\t\n\t\tif (isset($this->request->post['selected']) && $this->validateDelete()) {\n\t\t\tforeach ($this->request->post['selected'] as $shipping_method_id) {\n\t\t\t\t$this->MsLoader->MsShippingMethod->deleteShippingMethod($shipping_method_id);\n\t\t\t}\n\t\t\t\n\t\t\t$this->session->data['success'] = $this->language->get('ms_success');\n\t\t\t\n\t\t\t$url = '';\n\t\t\t\n\t\t\t$url .= isset($this->request->get['sort']) ? '&sort=' . $this->request->get['sort'] : '';\n\t\t\t$url .= isset($this->request->get['order']) ? '&order=' . $this->request->get['order'] : '';\n\t\t\t$url .= isset($this->request->get['page']) ? '&page=' . $this->request->get['page'] : '';\n\t\t\t\n\t\t\t$this->response->redirect($this->url->link('multiseller/shipping-method', 'token=' . $this->session->data['token'] . $url, 'SSL'));\n\t\t}\n\t\t\n\t\t$this->index();\n\t}", "function remove_shipping_methods_on_shipping_zone_delete( $id ) {\n $dbh = new Database_Handler();\n $dbh->deleteShippingRulesByZoneId($id);\n}", "static function delete_shipment()\n {\n if (empty($_GET['delete_shipment_id'])) return null;\n return self::_delete_shipment(intval($_GET['delete_shipment_id']));\n }", "public function clearOrderShippingOptionss()\n\t{\n\t\t$this->collOrderShippingOptionss = null; // important to set this to NULL since that means it is uninitialized\n\t}", "function bbloomer_unset_shipping_when_free_is_available_in_zone( $rates, $package ) {\nif ( isset( $rates['free_shipping:3'] ) ) {\n unset( $rates['flat_rate:4'] );\n} \n \nreturn $rates;\n \n}", "public function clearShippingOptionss()\n\t{\n\t\t$this->collShippingOptionss = null; // important to set this to NULL since that means it is uninitialized\n\t}", "public function DeleteStewardshipBatch() {\n\t\t\t$this->objStewardshipBatch->Delete();\n\t\t}", "public function testDeleteShippingAddress()\n {\n }", "public function unset_sess_cart_shipping_address()\n {\n if (!empty($this->session->userdata('mds_cart_shipping_address'))) {\n $this->session->unset_userdata('mds_cart_shipping_address');\n }\n }", "public function clearOrderShippings()\n\t{\n\t\t$this->collOrderShippings = null; // important to set this to NULL since that means it is uninitialized\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Insertar un version requisito
public function InsertVersionReq(){ $array = array(); $ds = new versionRequisitosDB(); $this->_reqVersId = $ds->InsertVersionReqDB($this->getParams(false)); }
[ "public function asignarVersion($datos){\n if(!$this->db->insert('versions_plans',$datos)){\n return false;\n }\n }", "function add_new_version( $version ) {\n\t$sql = \"INSERT INTO movie_versions (version_name) VALUES (\".\n\t\t\tformat_sql( $version ) . \n\t\t\t\")\";\n\t//echo $sql;\n\t$res = mysql_query( $sql );\n\tif ( $res ) {\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n}", "function insertVersion() {\n\t\t$model = &$this->getDefaultModel();\n\t\tif (!$model) return false;\n\t\t$pk = $model->primaryKey();\n\t\tif (!isset($model->$pk) || empty($model->$pk)) return false;\n\t\t$version_model = &$this->loadModel('cms_nterchange_versions');\n\t\tif (!$version_model) {\n\t\t\t// raise error: no versioning model available\n\t\t\treturn false;\n\t\t}\n\t\tif (!$this->_versionDiff($model)) {\n\t\t\t$this->debug('Version not changed for ' . $model->tableName() . ': ' . $model->$pk, 'VERSION');\n\t\t\treturn false;\n\t\t}\n\t\t$this->debug($model->tableName() . ' ' . $model->$pk, 'VERSION insert');\n\t\t// load the current info from the db (this happens before the update)\n\t\t$old_model = &NModel::factory($this->name);\n\t\t$old_model->get($model->$pk);\n\t\t// convert to client time to auto-convert back to server on update\n\t\t$this->convertDateTimesToClient($old_model);\n\t\t// insert the current info into the version\n\t\t$version_model->asset = $this->name;\n\t\t$version_model->asset_id = $old_model->$pk;\n\t\t$version_model->version = serialize($old_model->toArray());\n\t\t$version_model->cms_created = $old_model->cms_created;\n\t\t$version_model->cms_modified = $old_model->cms_modified;\n\t\t$version_model->cms_modified_by_user = isset($this->_auth) && is_object($this->_auth)?$this->_auth->currentUserID():0;\n\t\t$ret = $version_model->insert();\n\t\tunset($version_model);\n\t\tunset($old_model);\n\t\treturn $ret;\n\t}", "public function saveUpdatedVersion() \n\t{\n\t\t$data = array(\n\t\t\t'value' => $this->updatedToVersion->major.\".\".$this->updatedToVersion->minor.\".\".$this->updatedToVersion->point\n\t\t);\n\t\t \n\t\t$this->db->update($this->tableName, $data, \"name='schema_version'\");\n\t}", "function insertVersion(&$version, $isPlugin = false) {\n\t\t$isNewVersion = true;\n\n\t\tif ($version->getCurrent()) {\n\t\t\t// Find out whether the last installed version is the same as the\n\t\t\t// one to be inserted.\n\t\t\t$versionHistory =& $this->getVersionHistory($version->getProductType(), $version->getProduct());\n\t\t\t$oldVersion =& array_shift($versionHistory);\n\t\t\tif ($oldVersion) {\n\t\t\t\tif ($version->compare($oldVersion) == 0) {\n\t\t\t\t\t// The old and the new current versions are the same so we need\n\t\t\t\t\t// to update the existing version entry.\n\t\t\t\t\t$isNewVersion = false;\n\t\t\t\t} elseif ($version->compare($oldVersion) == 1) {\n\t\t\t\t\t// Version to insert is newer than the existing version entry.\n\t\t\t\t\t// We reset existing entry.\n\t\t\t\t\t$this->update('UPDATE versions SET current = 0 WHERE current = 1 AND product = ?', $version->getProduct());\n\t\t\t\t} else {\n\t\t\t\t\t// We do not support downgrades.\n\t\t\t\t\tfatalError('You are trying to downgrade the product \"'.$version->getProduct().'\" from version ['.$oldVersion->getVersionString().'] to version ['.$version->getVersionString().']. Downgrades are not supported.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($isNewVersion) {\n\t\t\t// We only change the install date when we insert new\n\t\t\t// version entries.\n\t\t\tif ($version->getDateInstalled() == null) {\n\t\t\t\t$version->setDateInstalled(Core::getCurrentDate());\n\t\t\t}\n\n\t\t\t// Insert new version entry\n\t\t\treturn $this->update(\n\t\t\t\tsprintf('INSERT INTO versions\n\t\t\t\t\t(major, minor, revision, build, date_installed, current, product_type, product, product_class_name, lazy_load, sitewide)\n\t\t\t\t\tVALUES\n\t\t\t\t\t(?, ?, ?, ?, %s, ?, ?, ?, ?, ?, ?)',\n\t\t\t\t\t$this->datetimeToDB($version->getDateInstalled())),\n\t\t\t\tarray(\n\t\t\t\t\t(int) $version->getMajor(),\n\t\t\t\t\t(int) $version->getMinor(),\n\t\t\t\t\t(int) $version->getRevision(),\n\t\t\t\t\t(int) $version->getBuild(),\n\t\t\t\t\t(int) $version->getCurrent(),\n\t\t\t\t\t$version->getProductType(),\n\t\t\t\t\t$version->getProduct(),\n\t\t\t\t\t$version->getProductClassName(),\n\t\t\t\t\t($version->getLazyLoad()?1:0),\n\t\t\t\t\t($version->getSitewide()?1:0)\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\t// Update existing version entry\n\t\t\treturn $this->update(\n\t\t\t\t'UPDATE versions SET current = ?, product_class_name = ?, lazy_load = ?, sitewide = ?\n\t\t\t\t\tWHERE product_type = ? AND product = ? AND major = ? AND minor = ? AND revision = ? AND build = ?',\n\t\t\t\tarray(\n\t\t\t\t\t(int) $version->getCurrent(),\n\t\t\t\t\t$version->getProductClassName(),\n\t\t\t\t\t($version->getLazyLoad()?1:0),\n\t\t\t\t\t($version->getSitewide()?1:0),\n\t\t\t\t\t$version->getProductType(),\n\t\t\t\t\t$version->getProduct(),\n\t\t\t\t\t(int) $version->getMajor(),\n\t\t\t\t\t(int) $version->getMinor(),\n\t\t\t\t\t(int) $version->getRevision(),\n\t\t\t\t\t(int) $version->getBuild()\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "function createNewVersion() {\n\t\t$this->obj->setVersion($this->obj->getVersion() + 1);\n\t\tilHistory::_createEntry($this->obj->getId(), \"replace\",\n\t\t\t$this->obj->getFileName().\",\".$this->obj->getVersion());\n\t}", "private function updateDBVersionFile() \n {\n \n if ($this->migrationUtils->tableExists(\"database_version\",$this->pdo)) {\n $sql = $this->pdo->prepare(\"INSERT INTO database_version (current_version,update_status,update_type, version_description,development_number) VALUES (?, ?, ?, ?, ?)\"); \n $sql->execute(array($this->dbVersionNumber, $this->updateStatus,$this->updateType,$this->versionDescription,$this->developmentNumber)); \n } \n }", "public function insertQuoteVersion($quote_id)\n {\n $insertVersionQuery=\"INSERT INTO QuotesVersions\n SELECT NULL,q.*\n FROM Quotes q\n WHERE q.identifier ='\".$quote_id.\"'\";\n //echo $insertVersionQuery;exit; \n\n $this->execQuery($insertVersionQuery,'insert');\n }", "public function addVersionProducto($producto,$version){\r\n\t\t\ttry{\r\n\t\t\t\t\t\t\r\n\t\t\t\t$id_prod= $this->_getIdProducto($producto);\r\n\t\t\t\r\n\t\t\t\t$consulta = ' \tselect id\t\t\t\t'.\r\n\t\t\t\t\t\t\t'\tfrom version_prod\t\t'.\r\n\t\t\t\t\t\t\t'\twhere producto = ?\t\t'.\r\n\t\t\t\t\t\t\t'\t\t and version = ? \t';\r\n\t\t\t\t$row = $this->basedatos->ExecuteQuery($consulta, array($id_prod, $version));\r\n\t\t\t\t\r\n\t\t\t\tif (isset($row[0]->id)){\r\n\t\t\t\t\treturn $row[0]->id;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t//my $id_version_prod=$self->_getNextNumerador(\"version_prod\");\r\n\t\t\t\r\n\t\t\t\t$consulta = ' insert into version_prod (id, producto, version) values (?,?,?) ';\r\n\t\t\t\t$id_version_prod = $this->basedatos->ExecuteNonQuery($consulta, array($id_version_prod, $id_prod, $version), true);\r\n\t\t\t\t\r\n\t\t\t\treturn $id_version_prod;\r\n\t\t\t}\r\n\t\t\tcatch(Exception $e){\r\n\t\t\t\t$this->error = 1;\r\n\t\t\t\tthrow new Exception( $e->getMessage( ) , (int)$e->getCode( ) );\r\n\t\t\t}\r\n\t\t}", "function create_software_entry(string $name, string $version, string $registration_no, int $status) // -> integer\n{\n $inserted_id = null;\n $conn = meta_open_db();\n if ($stmt = $conn->prepare(\"INSERT INTO `SoftwareEquipment`(`Name`, `Version`, `RegistrationNumber`, `Supported`) VALUES (?,?,?,?)\"))\n {\n $stmt->bind_param(\"sssi\", $name, $version, $registration_no, $status);\n if (!$stmt->execute()) return null;\n $inserted_id = $conn->insert_id;\n $stmt->close();\n }\n $conn->close();\n return (2 * $inserted_id + 1);\n}", "function insertVersion($journalId, &$version) {\n\t\t$this->update(\n\t\t\t'INSERT INTO rt_versions\n\t\t\t(journal_id, version_key, locale, title, description)\n\t\t\tVALUES\n\t\t\t(?, ?, ?, ?, ?)',\n\t\t\tarray((int) $journalId, $version->key, $version->locale, $version->title, $version->description)\n\t\t);\n\n\t\t$version->versionId = $this->getInsertId('rt_versions', 'version_id');\n\n\t\tforeach ($version->contexts as $context) {\n\t\t\t$context->versionId = $version->versionId;\n\t\t\t$this->insertContext($context);\n\t\t}\n\n\t\treturn $version->versionId;\n\t}", "function add_revision($params)\n {\n $this->db->insert('revisiones',$params);\n //return $this->db->insert_id();\n }", "public function shouldCreateNewVersion();", "public function created(Version $version)\n {\n \n $queryMaster = Documentation::where('version_id','1')->get()\n ->map(\n function($item){\n return $item->Toarray();\n });\n //dd($queryMaster);\n \n $lastIdVersion = $version->id; //last version id \n //dd($queryMaster);\n \n foreach($queryMaster as $key){\n //THE MODEL HAS TO BE INSTALLED IN THE CYCLE OR IT WILL JUST SAVE THE LAST DATA.\n $documentation = new Documentation();\n $documentation->title = $key['title']; //title\n $documentation->information = $key['information']; //information\n /*the last version id will be entered*/\n $documentation->version_id = $lastIdVersion; //version_id FK las id version insert\n //EL FOREACH FUNCIONA pero el \"save()\" solo guarda el ultimo\n $documentation->save();\n \n }\n \n \n\n\n }", "public function createVersion($newname) {\n\n DB_DAO::connectDatabase();\n $handler = DB_DAO::getDB()->prepare(\"INSERT INTO version (version) VALUES (:v)\");\n $handler->bindValue(\":v\", Util::purifyHTML($newname));\n\n if (!$handler->execute()) {\n DB_DAO::throwDbError($handler->errorInfo());\n }\n Mediator::emit(\"versionCreated\", DB_DAO::getDB()->lastInsertId());\n\n return true;\n }", "public function asignarVersion($plan,$version){\n if ($this->Plan->consultarVersioPlan($plan,$version)){ //verifica si la version ya fu asignada al plan\n $this->output->set_status_header(402); //envia el error en caso de existir\n }else{\n $data= array(\n 'VRPL_FK_versions' => $version, //crea el vector con los datos\n 'VRPL_FK_plans' => $plan,\n );\n if ($this->Plan->asignarVersion($data)){ //envia y valida la insercion de la nueva version del plan\n return true;\n }\n return false; \n }\n }", "public function set_plugin_version($version) { \n\n\t\t$name \t\t= Dba::escape('Plugin_' . $this->_plugin->name);\n\t\t$version\t= Dba::escape($version);\n\n\t\t$sql = \"INSERT INTO `update_info` SET `key`='$name', `value`='$version'\";\n\t\t$db_results = Dba::query($sql); \n\n\t\treturn true; \n\n\t}", "abstract public function sqlInsertar();", "function etbx_registry_table_insert($entity_type, $module, $version = 0, $status = 0) {\n $query = db_insert(ENTITY_TOOLBOX_DB__REGISTRY)\n ->fields(array(\n 'entity_type' => $entity_type,\n 'module' => $module,\n 'version' => $version,\n 'status' => $status\n ))\n ->execute();\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
determine path to large profile picture
function getLargePicturePath() { $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); $path = $baseUrl.'/uploads/default/default_large_male.jpg'; if($this->isFemale()){ $path = $baseUrl.'/uploads/default/default_large_female.jpg'; } if($this->hasProfileImage()){ $path = $baseUrl.'/uploads/clients/client_'.$this->getID().'/avatar/large_'.$this->getProfilePhoto(); } # debugMessage($path); return $path; }
[ "function getLargePicturePath() {\n\t\t$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\n\t\t$path = $baseUrl.'/uploads/default/default_large_male.jpg';\n\t\tif($this->isFemale()){\n\t\t\t$path = $baseUrl.'/uploads/default/default_large_female.jpg'; \n\t\t}\n\t\tif($this->hasProfileImage()){\n\t\t\t$path = $baseUrl.'/uploads/users/user_'.$this->getID().'/avatar/large_'.$this->getProfilePhoto();\n\t\t}\n\t\t# debugMessage($path);\n\t\treturn $path;\n\t}", "function getLargePicturePath($id, $gender, $photoname) {\n\t$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\n\t$path= \"\";\n\tif(isMale($gender)){\n\t\t$path = $baseUrl.'/uploads/users/user_0/avatar/default_large_male.jpg';\n\t} \n\tif(isFemale($gender)){\n\t\t$path = $baseUrl.'/uploads/users/user_0/avatar/default_large_female.jpg'; \n\t}\n\tif(hasProfileImage($id, $photoname)){\n\t\t$path = $baseUrl.'/uploads/users/user_'.$id.'/avatar/large_'.$photoname;\n\t}\n\t// debugMessage($path);\n\treturn $path;\n}", "function getSmallPicturePath() {\n\t\t$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\n\t\t$path = $baseUrl.'/uploads/default/default_small_male.jpg';\n\t\tif($this->isFemale()){\n\t\t\t$path = $baseUrl.'/uploads/default/default_small_female.jpg'; \n\t\t}\n\t\tif($this->hasProfileImage()){\n\t\t\t$path = $baseUrl.'/uploads/users/user_'.$this->getID().'/avatar/small_'.$this->getProfilePhoto();\n\t\t}\n\t\treturn $path;\n\t}", "function getSmallPicturePath() {\r\n\t\t$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\r\n\t\t$path = $baseUrl.'/uploads/default/default_small_male.jpg';\r\n\t\tif($this->isFemale()){\r\n\t\t\t$path = $baseUrl.'/uploads/default/default_small_female.jpg';\r\n\t\t}\r\n\t\tif($this->hasProfileImage()){\r\n\t\t\t$path = $baseUrl.'/uploads/clients/client_'.$this->getID().'/avatar/small_'.$this->getProfilePhoto();\r\n\t\t}\r\n\t\treturn $path;\r\n\t}", "public function getProfilePicture()\n {\n $baseUrl = 'img/clients/' . $this->id;\n return file_exists($baseUrl . self::JPG) ? '/' . $baseUrl . self::JPG : (\n file_exists($baseUrl . self::PNG) ? '/' . $baseUrl . self::PNG : '/img/default_avatar.jpg'\n );\n }", "public function getProfilePictureAbsolutePath()\n {\n return null === $this->immagine\n ? null\n : $this->getUploadRootDir().'/'.$this->immagine;\n }", "function getThumbnailPicturePath($id, $gender, $photoname) {\n\t$baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\n\t$path= \"\";\n\tif(isMale($gender)){\n\t\t$path = $baseUrl.'/uploads/user_0/avatar/default_thumbnail_male.jpg';\n\t} \n\tif(isFemale($gender)){\n\t\t$path = $baseUrl.'/uploads/user_0/avatar/default_thumbnail_female.jpg'; \n\t}\n\tif(hasProfileImage($id, $photoname)){\n\t\t$path = $baseUrl.'/uploads/user_'.$id.'/avatar/thumbnail_'.$photoname;\n\t}\n\treturn $path;\n}", "function getPhotoPath()\n\t{\n\t\treturn file_exists(\"img/portrait/user$this->id.jpg\") ? \"/img/portrait/user$this->id.jpg\" : \"/img/unavailable.jpg\";\n\t}", "public function profilePicture()\n {\n if ($this->picture) {\n return \"/storage/{$this->picture}\";\n }\n\n return 'http://i.pravatar.cc/200';\n }", "public function getProfilePictureAbsolutePath() {\r\n return null === $this->profilePicturePath ? null : $this->getUploadRootDir() . '/' . $this->profilePicturePath;\r\n }", "public function getProfilePictureAbsolutePath()\n {\n return $this->profilePicturePath === null\n ? null\n : $this->getUploadRootDir().'/'.$this->profilePicturePath;\n }", "public function getProfilePictureAbsolutePath()\n {\n return null === $this->profilePicturePath\n ? null\n : $this->getUploadRootDir() . '/' . $this->profilePicturePath;\n }", "public function profileImage()\n {\n return ($this->image) ? '/storage/' . $this->image : \"/images/profile_pic.png\";\n }", "public function get_picture() \n\t{\n\t\t// ACTUALIZO EL DATO DE LA INSTANCIA\n\t\t$this->select('foto');\n\t\t// PATH DONDE SE GUARDA LA MINNIATURA\n\t\t$thumb = \"/img/perfil/thumb/{$this->foto}\";\n\t\t// SI EL ARCHIVO NO EXISTE RETORNA LA IMAGEN POR DEFAULT\n\t\treturn file_exists(getcwd() . $thumb) ? URL_ROOT . $thumb : USER_IMG;\n\t}", "function getProfilePicture()\r\n\t\t{\r\n\t\t\treturn APP_IMG_URL.$this->profilePictureImg;\r\n\t\t\t\r\n\t\t}", "public function profileImage()\n {\n $defaultImgPath = ($this->image) ? $this->image : 'profile/evZqUmPVZBUek5BULZHS5b53PnsRL8onZLQs1gOe.png';\n return '/storage/' . $defaultImgPath;\n }", "public function getProfilePictureAbsolutePath() {\n return null === $this->profilePicturePath\n ? null\n : $this->getUploadRootDir().'/'.$this->profilePicturePath;\n }", "private function getProfilePicturesPath() \n {\n return $this->get('kernel')->getProjectDir() . '/public/profile_pictures/admins';\n }", "public function getPicturePath()\n \t{\n \t\tif (!isset($this->jug_foto) || $this->jug_foto = '')\n \t\t\treturn null;\n\n \t\treturn public_path( $this->jug_foto );\n \t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns true, if version is higher than threshold
public function isHigher() { return $this->isValid() && VERSION_IS_HIGHER === version_compare($this->version, self::THRESHOLD); }
[ "public function greaterThan($version) {\n\t\t\treturn $this->compare($version) === 1;\n\t\t}", "public function gt($version) {\n return static::compare_versions($this, $version) < 0;\n }", "function qa_qa_version_below($version)\n{\n\t$minqa = qa_version_to_float($version);\n\t$thisqa = qa_version_to_float(QA_VERSION);\n\n\treturn $minqa && $thisqa && $thisqa < $minqa;\n}", "public function aboveMinVersion()\n {\n $config = $this->getConstant('MODULE_CONFIG');\n /** @noinspection PhpUndefinedFieldInspection */\n $version = Mage::getConfig()->getModuleConfig($config)->version;\n $result = version_compare($version, self::MIN_SUPPORTED_VER, '>=');\n if (!$result) {\n ShopgateLogger::getInstance()->log('magestore version: ' . $version, ShopgateLogger::LOGTYPE_DEBUG);\n }\n\n return $result;\n }", "private function versionIsBelow($test)\n {\n $version = $this->findVersion();\n if (!$version) {\n return false;\n }\n return \\version_compare($version, $test, '<');\n }", "public static function isVersionLess($version, $threshold)\n {\n $versionParts = explode('.', $version);\n $thresholdParts = explode('.', $threshold);\n\n // Compare major version numbers\n if ($versionParts[0] < $thresholdParts[0]) {\n return true;\n } elseif ($versionParts[0] > $thresholdParts[0]) {\n return false;\n }\n\n // Compare minor version numbers\n if ($versionParts[1] < $thresholdParts[1]) {\n return true;\n } elseif ($versionParts[1] > $thresholdParts[1]) {\n return false;\n }\n\n // Compare patch version numbers - default to zero if someone forgot to specify\n if (!isset($versionParts[2])) {\n $versionParts[2] = 0;\n }\n if (!isset($thresholdParts[2])) {\n $thresholdParts[2] = 0;\n }\n if ($versionParts[2] < $thresholdParts[2]) {\n return true;\n } elseif ($versionParts[2] > $thresholdParts[2]) {\n return false;\n }\n\n // Versions are equal or threshold is invalid\n return false;\n }", "private function _greaterThan14()\n {\n if ($this->_isEnterprise()) {\n return true;\n }\n $version = Mage::getVersionInfo();\n return $version['major'] >= '1' && $version['minor'] > '4';\n }", "function plugin_version_check( $p_version, $p_required, $p_maximum = false ) {\n\tif( $p_maximum ) {\n\t\t$t_operator = '<';\n\t} else {\n\t\t$t_operator = '>=';\n\t}\n\t$t_result = version_compare( $p_version, $p_required, $t_operator );\n\treturn $t_result ? 1 : -1;\n}", "public function isGreaterThanOrEqualTo($version)\n {\n return $this->versionCompare($version, '>=');\n }", "function isGe($version) {\n\t\t\treturn $this->compare( $version, '>=' );\n\t\t}", "public function isVersionEqualorGreater210()\n {\n return $this->helper->isMagentoVersionEqualOrGreaterThan(\"2.1.0\");\n }", "function thb_is_wordpress_version_before( $version ) {\n\t\treturn floatval(get_bloginfo('version')) < floatval($version);\n\t}", "private static function isPHPVersionHigher($version)\n {\n return version_compare(PHP_VERSION, $version) >= 0;\n }", "public static function is_wc_version_gt( $version ) {\n\t\tif ( ! isset( self::$is_wc_version_gt[ $version ] ) ) {\n\t\t\tself::$is_wc_version_gt[ $version ] = self::get_wc_version() && version_compare( self::get_wc_version(), $version, '>' );\n\t\t}\n\t\treturn self::$is_wc_version_gt[ $version ];\n\t}", "public function lessThanEqualTo($version) {\n\t\t\t$ret = $this->compare($version);\n\n\t\t\treturn ($ret === -1 || $ret === 0);\n\t\t}", "public function is_later_version($new_version) {\n\treturn ($new_version > $this->get_installed_version());\n}", "private function check_core($version){\n\t\treturn version_compare($version,COGEAR,'<=');\n\t}", "function versionCheck($template) {\n\tglobal $communitySettings;\n\n\tif ( $template['MinVer'] && ( version_compare($template['MinVer'],$communitySettings['unRaidVersion']) > 0 ) ) return false;\n\tif ( $template['MaxVer'] && ( version_compare($template['MaxVer'],$communitySettings['unRaidVersion']) < 0 ) ) return false;\n\treturn true;\n}", "function min_version($min_version) {\r\n $api_version = txtdbapi_version();\r\n \r\n $api_chunks = split(\".\", $api_version);\r\n $min_chunks = split(\".\", $min_version);\r\n \r\n if ($api_chunks[0] >= $min_chunks[0] AND $api_chunks[1] >= $min_chunks[1] AND $api_chunks[2] >= $min_chunks[2])\r\n return true;\r\n \r\n return false; \r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Scan the specified $path using callback user function for each file found. The $func accept two parameters: $dir and $file. The return type of $func must be Array or String. If $recursive is true, then will scan recursively the $path.
function fs_scan_($path, &$func, $recursive=false) { static $out = null; static $count = 0; $count++; $entries = scandir($path); foreach( $entries as $entry ) { if ( in_array($entry, Array('.', '..')) ) { continue; } $_path = $path.'/'.$entry; $o = $func($path, $entry); if ( is_array($o) ) { if ( key($o) == '0' and count($o) == 1) { $o = current($o); } if ($out===null) { $out=Array(); } $out[] = $o; } else { $out .= $o; } if ( $recursive and is_dir($_path)) { fs_scan_($_path, $func, $recursive); } } $count--; if ( $count == 0 ) { // detect end of recursion $buffer = $out; $out = null; return $buffer; } return $out; }
[ "function x_scan_dir(\n string $dir,\n Closure $handler, //function($path){}\n bool $recurse=true,\n bool $include_files=true,\n bool $include_dirs=false,\n string $file_pattern=null,\n $break_on=false,\n int $scandir_sort=SCANDIR_SORT_ASCENDING, //SCANDIR_SORT_DESCENDING, SCANDIR_SORT_NONE\n bool $file_pattern_dir=false\n) {\n //validate directory\n if (!is_dir($dir)) {\n throw new Exception(sprintf('Argument $dir is not a directory! (%s)', $dir));\n }\n\n //validate closure\n if (!is_a($handler, 'Closure')) {\n throw new Exception('Argument $handler is not a Closure!');\n }\n\n //closure result\n $result = null;\n\n //scan directory\n $file_pattern = is_string($file_pattern) && strlen($file_pattern = trim($file_pattern)) ? $file_pattern : null;\n foreach (scandir($dir, $scandir_sort) as $basename) {\n //ignore (./..) basename\n if (in_array($basename, ['.', '..'])) {\n continue;\n }\n\n //get path\n $path = $dir . '/' . $basename;\n\n //if path is folder\n if (is_dir($path)) {\n\n //file_pattern_dir: ignore file pattern test fail\n if ($file_pattern_dir && $file_pattern && !preg_match($file_pattern, $path)) {\n continue;\n }\n\n //check inclusion\n if ($include_dirs) {\n //call $handler($path) (store result)\n $result = $handler($path);\n\n //break if $result matches $break_on\n if ($result === $break_on) {\n break;\n }\n }\n\n //if $recurse is enabled\n if ($recurse) {\n //recurse folder (store last closure result)\n $result = x_scan_dir(\n $path,\n $handler,\n $recurse,\n $include_files,\n $include_dirs,\n $file_pattern,\n $break_on,\n $scandir_sort\n );\n\n //break if $result matches $break_on\n if ($result === $break_on) {\n break;\n }\n }\n }\n\n //if path is file\n elseif (is_file($path)) {\n\n //ignore file pattern test fail\n if ($file_pattern && !preg_match($file_pattern, $path)) {\n continue;\n }\n\n //check inclusion\n if ($include_files) {\n\n //call $handler($path) (store result)\n $result = $handler($path);\n\n //break if $result matches $break_on\n if ($result === $break_on) {\n break;\n }\n }\n }\n }\n\n //result - last $handler result\n return $result;\n}", "function get_files($path, $wildcard = \"*\", $recursive = true, $callback = '') {\r\n $files = array();\r\n if (is_dir($path)) {\r\n if ($contents = opendir($path)) {\r\n while (($node = readdir($contents)) !== false) {\r\n if ($node != \".\" && $node != \"..\") {\r\n $node = $path . DIRECTORY_SEPARATOR . $node;\r\n $directory = is_dir($node);\r\n if ($recursive && $directory) {\r\n $files = array_merge($files, get_files($node, $wildcard, $recursive, $callback));\r\n } else if (!$directory && fnmatch($wildcard, basename($node))) {\r\n $files[] = $node;\r\n if ($callback) {\r\n $callback($node);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return $files;\r\n}", "function require_all_files($dir, $pattern = \"*.php\", $recursive = false, $callback = null) {\n foreach (glob(\"$dir/$pattern\") as $file) {\n if (!is_dir($file))\n require $file;\n elseif ($recursive)\n require_all_files($file, $pattern, $recursive, $callback);\n\n if (!empty($callback))\n call_user_func($callback, $file);\n }\n}", "function scanFiles($dir)\r\n{\r\n $files = array();\r\n // Is there actually such a folder/file?\r\n if(file_exists($dir)){\r\n foreach(scandir($dir) as $f) {\r\n if(!$f || $f[0] == '.') {\r\n continue; // Ignore hidden files\r\n }\r\n if(is_dir($dir . '/' . $f)) {\r\n // The path is a folder\r\n $files[] = array(\r\n \"id\" => str_replace('//','/', $dir . '/' . $f),\r\n //\"text\" => str_replace('/','',$f),\r\n \"text\" => $f,\r\n \"type\" => \"folder\",\r\n //\"path\" => $dir . '/' . $f,\r\n \"children\" => scanFiles($dir . '/' . $f) // Recursively get the contents of the folder\r\n );\r\n } else {\r\n // It is a file\r\n //$id = 'fileadmin' . array_pop(explode('fileadmin', str_replace('//','/',$dir . $f)));\r\n $ext = strpos($f, '.') !== FALSE ? substr($f, strrpos($f, '.') + 1) : '';\r\n $files[] = array(\r\n //\"id\" => str_replace('/','',$f),\r\n \"id\" => $f,\r\n //\"text\" => str_replace('/','',$f),\r\n \"text\" => $f,\r\n \"type\" => 'file',\r\n 'icon' => 'file file-'.substr($f, strrpos($f,'.') + 1),\r\n //\"path\" => $dir . '/' . $f,\r\n //\"size\" => filesize($dir . '/' . $f) // Gets the size of this file\r\n );\r\n }\r\n }\r\n }\r\n return $files;\r\n}", "function recursiveScan($path = \"\") {\r\n\tglobal $txt, $album, $photo, $album_dir;\r\n\tglobal $coremod;\r\n\r\n\t// Load album_dir if nothing else was passed in\r\n\tif (!$path) {\r\n\t\t$path = $album_dir;\r\n\t}\r\n\r\n\t$results['files'] = array ();\r\n\t$results['dirs'] = array ();\r\n\t$stack[] = $path;\r\n\r\n\twhile ($stack) {\r\n\t\t$current_dir = array_pop($stack);\r\n\t\tif ($dh = opendir($current_dir)) {\r\n\t\t\twhile (($file = readdir($dh)) !== false) {\r\n\t\t\t\tif ($file !== '.' AND $file !== '..') {\r\n\t\t\t\t\t$current_file = \"{$current_dir}/{$file}\";\r\n\t\t\t\t\tif (is_file($current_file)) {\r\n\t\t\t\t\t\tarray_push($results['files'], \"{$current_dir}/{$file}\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif (is_dir($current_file)) {\r\n\t\t\t\t\t\t$stack[] = $current_file;\r\n\t\t\t\t\t\tarray_push($results['dirs'], $current_file);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\terror(\"fatal\", $txt['error.open'].\" \".$txt['error.config1'].\" $configfile\", __LINE__, $coremod, __FUNCTION__);\r\n\t\t}\r\n\t}\r\n\r\n\tsort($results['dirs']);\r\n\tsort($results['files']);\r\n\r\n\treturn ($results);\r\n}", "function globbetyglob($globber, $userfunc)\n{\n foreach (glob(\"$globber/*\") as $file) {\n if (is_dir($file)) {\n globbetyglob($file, $userfunc);\n }\n else {\n call_user_func($userfunc, $file);\n }\n }\n}", "function advagg_validator_file_scan_directory($dir, $mask, $options = array(), $depth = 0) {\n // Merge in defaults.\n $options += array(\n 'nomask' => '/(\\.\\.?|CVS)$/',\n 'nodirmask' => '/(\\.git)/',\n 'callback' => 0,\n 'recurse' => TRUE,\n 'key' => 'uri',\n 'min_depth' => 0,\n );\n\n $options['key'] = in_array($options['key'], array('uri', 'filename', 'name')) ? $options['key'] : 'uri';\n $files = array();\n // @ignore druplart_andor_assignment\n if (is_dir($dir) && $handle = opendir($dir)) {\n while (FALSE !== ($filename = readdir($handle))) {\n if (!preg_match($options['nomask'], $filename) && $filename[0] != '.') {\n $uri = \"$dir/$filename\";\n $uri = file_stream_wrapper_uri_normalize($uri);\n if (is_dir($uri) && $options['recurse'] && !preg_match($options['nodirmask'], $uri)) {\n // Give priority to files in this folder by merging them in after any\n // subdirectory files.\n $files = array_merge(advagg_validator_file_scan_directory($uri, $mask, $options, $depth + 1), $files);\n }\n elseif ($depth >= $options['min_depth'] && preg_match($mask, $filename)) {\n // Always use this match over anything already set in $files with the\n // same $$options['key'].\n $file = new stdClass();\n $file->uri = $uri;\n $file->filename = $filename;\n $file->name = pathinfo($filename, PATHINFO_FILENAME);\n $key = $options['key'];\n $files[$file->$key] = $file;\n if ($options['callback']) {\n $options['callback']($uri);\n }\n }\n }\n }\n\n closedir($handle);\n }\n\n return $files;\n}", "function m_walk_dir( $root, $callback, $recursive = true, $level = 0 ) {\r\n $dh = @opendir( $root );\r\n if( false === $dh ) {\r\n return false;\r\n }\r\n while( $file = readdir( $dh )) {\r\n if( \".\" == $file || \"..\" == $file ){\r\n continue;\r\n }\r\n //echo \"## DEBUG:$level - $file<br/>\"; \r\n\r\n //echo \"Level: $level\";\r\n call_user_func( $callback,$level, \"{$root}/{$file}\", $file );\r\n if( false !== $recursive && is_dir( \"{$root}/{$file}\" )) {\r\n m_walk_dir( \"{$root}/{$file}\", $callback, $recursive, $level+1 );\r\n }\r\n }\r\n closedir( $dh );\r\n return true;\r\n}", "protected function recursiveScan( $path, $match = '' )\n {\n /**\n * Return an array with all matched files from root folder.\n *\n * @brief get all matched files\n * @note Internal recursive use only\n *\n * @param string $path Folder root\n * @param string $match Optional. Regex to apply on file name. For example use '/^.*\\.(php)$/i' to get only php file\n * @param array &$result Optional. Result array. Empty form first call\n *\n * @return array\n */\n function _rglob( $path, $match = '', &$result = [] )\n {\n $files = glob( trailingslashit( $path ) . '*', GLOB_MARK );\n if ( false !== $files ) {\n foreach ( $files as $file ) {\n if ( is_dir( $file ) ) {\n $continue = true; //apply_filters( 'wpdk_rglob_find_dir', true, $file );\n if ( $continue ) {\n _rglob( $file, $match, $result );\n }\n }\n elseif ( ! empty( $match ) ) {\n $continue = true; //apply_filters( 'wpdk_rglob_find_file', true, $file );\n if ( false == $continue ) {\n break;\n }\n $regexp_result = [];\n $error = preg_match( $match, $file, $regexp_result );\n if ( 0 !== $error || false !== $error ) {\n $regexp_result = true; //apply_filters( 'wpdk_rglob_matched', $regexp_result, $file, $match );\n if ( ! empty( $regexp_result ) ) {\n $result[] = $regexp_result[ 0 ];\n }\n }\n }\n else {\n $result[] = $file;\n }\n }\n\n return $result;\n }\n }\n\n $result = [];\n\n return _rglob( $path, $match, $result );\n }", "private function for_every_file ($dir, $callback) {\n $dir_scan = scandir($dir);\n foreach($dir_scan as $value) {\n if($value !== '.' && $value !== '..') {\n if(!$this->should_ignore($value)) {\n $abs_path = realpath($dir.'/'.$value);\n if(is_dir($abs_path)) {\n $this->for_every_file($abs_path, $callback);\n } else if (is_file($abs_path)) {\n $callback($abs_path);\n }\n }\n }\n }\n }", "public function enumerateFiles($callback) {\n // Is the Filesytem Initialized?\n if (!$this->isInitialized()) { // NO: Initialize before use...\n throw new \\Exception('File System has not been initialize');\n }\n\n if (!isset($callback) || !is_callable($callback)) {\n throw new \\Exception('Missing or Invalid Callback Function');\n }\n\n // Create an Iterator for the Input Path\n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->inputPath), \\RecursiveIteratorIterator::SELF_FIRST\n );\n\n // Iterate Files in Directory\n $break = false;\n $inputPathLength = strlen($this->inputPath) + 1;\n foreach ($iterator as $name => $element) {\n if ($element->isFile() && $element->isReadable()) {\n // Return Relative Path Only\n $name = substr($name, $inputPathLength);\n $break = !$callback($name);\n if ($break) {\n break;\n }\n }\n }\n }", "function file_scan_directory($dir, $mask, $nomask = array('.', '..', 'CVS'), $callback = 0) {\n $files = array();\n if (is_dir($dir) && $handle = opendir($dir)) {\n while ($file = readdir($handle)) {\n if (!in_array($file, $nomask)) {\n if (is_dir(\"$dir/$file\")) {\n $files = array_merge($files, file_scan_directory(\"$dir/$file\", $mask, $nomask, $callback));\n }\n elseif (ereg($mask, $file)) {\n $name = basename($file);\n $files[\"$dir/$file\"]->filename = \"$dir/$file\";\n $files[\"$dir/$file\"]->name = substr($name, 0, strrpos($name, '.'));\n if ($callback) {\n $callback(\"$dir/$file\");\n }\n }\n }\n }\n closedir($handle);\n }\n return $files;\n}", "public static function recursiveDirectoryCallback($callback, $path, $data)\n\t{\n\t\tif(is_dir($path))\n\t\t{\n\t\t\t/* @var SplFileInfo $file */\n\t\t\tforeach(self::getRecursiveDirectoryIterator($path) as $file)\n\t\t\t{\n\t\t\t\t$callback($file->getPathname(), $data);\n\t\t\t}\n\t\t}\n\t\telse if(file_exists($path))\n\t\t{\n\t\t\t$callback($path, $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function recursive_directory_walk( $dir, $regex = null, callable $function = null, array &$files = null ) {\n //remove trailing slash\n $dir = preg_replace('/\\/$/','',$dir);\n // Open the given dir and iterate\n if ( $handle = opendir( $dir ) ) {\n while ( false !== ( $entry = readdir( $handle ) ) ) {\n if ( $entry != \".\" && $entry != \"..\" ) {\n // If the given entry is a dir then make a recursive function call\n if ( is_dir( \"{$dir}/{$entry}\" ) ) {\n $this->recursive_directory_walk( \"{$dir}/{$entry}\", $regex, $function, $files );\n } else {\n // The current entry is a file, if there is a callback then execute it\n if ( $function !== null ) {\n $function( \"{$dir}/{$entry}\" );\n } elseif ( $regex !== null ) {\n /*\n * There is no callback, check for a regex match,\n * if successful then add it to array which will contain\n * all of the matches for the given regular expression\n */\n if ( preg_match( $regex, \"{$dir}/{$entry}\" ) ) {\n $files[] = \"{$dir}/{$entry}\";\n }\n }\n }\n }\n }\n }\n return $files;\n }", "function scan_dir_2($dir = '.', $include_pattern = NULL, $exclude_pattern = NULL, $recurs = 1)\n{\n\n if (!isset($result) && !is_array($result)) $result=array();\n\n\tif (!is_dir($dir)) {\n\t\ttrigger_error(\"'$dir' is not a directory\", WARNING);\n\t\treturn false;\n\t}\n\n\tif (!$dh = opendir($dir)) {\n\t\ttrigger_error(\"Unable to open '$dir'\", WARNING);\n\t\treturn false;\n\t}\n\n\twhile (false !== ($filename = readdir($dh))) {\n\t\tunset($match);\n\n // Skipping . and .. to avoid a nice loop\n if (preg_match('/^\\.{1,2}$/', $filename)) continue;\n\n\t\t// Skipping directories and files contained in $exclude_pattern\n if (isset($exclude_pattern) && preg_match($exclude_pattern, $filename)) {\n continue;\n }\n\n\t\t// Normalizing the path\n\t\t$fullpath=str_replace(\"//\",\"/\",$dir.\"/\".$filename);\n\n if (is_readable($fullpath) && is_dir($fullpath) && $recurs) {\n\n if ($temp_array=scan_dir_2($dir.\"/\".$filename,$include_pattern,$exclude_pattern))\n $result = array_merge($result,$temp_array);\n\n\t\t} else {\n \tif (isset($include_pattern)) {\n if (preg_match($include_pattern, $filename)) $match=1;\n } else $match=1;\n\n\t\t\tif (isset($match)) $result[]=$fullpath;\n\t\t}\n\n }\n\n if ($result) return $result; else return;\n\n}", "public function scanPathsRecursive(\n string|Stringable|Dir $path,\n callable $filter = null\n ): Generator {\n return $this->dir($path)->scanPathsRecursive($filter);\n }", "function scan($dir)\n{\n $files = array();\n $_dir = $dir;\n $dir = FM_ROOT_PATH.'/'.$dir;\n // Is there actually such a folder/file?\n if(file_exists($dir)) {\n foreach (scandir($dir) as $f) {\n if(!$f || $f[0] == '.') {\n continue; // Ignore hidden files\n }\n\n if(is_dir($dir.'/'.$f)) {\n // The path is a folder\n $files[] = array(\n \"name\" => $f,\n \"type\" => \"folder\",\n \"path\" => $_dir.'/'.$f,\n \"items\" => scan($dir.'/'.$f), // Recursively get the contents of the folder\n );\n } else {\n // It is a file\n $files[] = array(\n \"name\" => $f,\n \"type\" => \"file\",\n \"path\" => $_dir,\n \"size\" => filesize($dir.'/'.$f) // Gets the size of this file\n );\n }\n }\n }\n return $files;\n}", "function browse_recursive($dir, $cbEach = null, $cbAfter = null, $ignorePaths = array()) {\n\t$files = scandir($dir);\n\tif( !$files ){\n\t\treturn FALSE;\n\t}\n\tforeach( $files as $file ) {\n\t\tif( $file === '.' || $file === '..' || in_array($file, $ignorePaths) ){\n\t\t\tcontinue;\n\t\t}\n\t\tif( is_dir($dir.'/'.$file) ){\n\t\t\tbrowse_recursive($dir.'/'.$file, $cbEach, $cbAfter);\n\t\t}\n\t\telseif ($cbEach) {\n\t\t\tcall_user_func($cbEach, $dir.'/'.$file);\n\t\t}\n\t}\n\tif( $cbAfter ){\n\t\tcall_user_func($cbAfter, $dir);\n\t}\n\treturn TRUE;\n}", "function testing_find_files($folder, $recursively = false)\n{\n\t$files = array();\n\t$dp = opendir($folder);\n\twhile ($f = readdir($dp))\n\t{\n\t\tif ($f[0] != '.')\n\t\t{\n\t\t\tif (is_dir($folder . DIRECTORY_SEPARATOR . $f)\n\t\t\t\t&& ($f == 'test' || $recursively))\n\t\t\t{\n\t\t\t\t$files = array_merge($files, testing_find_files($folder . DIRECTORY_SEPARATOR . $f, $recursively));\n\t\t\t}\n\t\t\telseif (preg_match('#\\.test\\.php$#i', $f) && is_file($folder . DIRECTORY_SEPARATOR . $f))\n\t\t\t{\n\t\t\t\t$files[] = $folder . DIRECTORY_SEPARATOR . $f;\n\t\t\t}\n\t\t}\n\t}\n\tclosedir($dp);\n\treturn $files;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns description for the current test.
public function test_description() { return $this->context_description() . " should $this->current_description"; }
[ "public function get_description()\r\n {\r\n \t$data = $this->get_exercise_data();\r\n \treturn $data['description'];\r\n }", "public function getDescription() {\n return (isset(self::$description)) ? self::$description : $this->caption . ' tool';\n }", "public function testGetDescription()\n {\n $this->assertEquals(\n self::$testDescription,\n $this->researchGroup->getDescription()\n );\n }", "public function getDescription(): string\n {\n return self::$task['description'];\n }", "public function get_description()\n\t{\n\t\t$data = $this->get_learnpath_data();\n\t\treturn $data['description'];\n\t}", "public function testGetDescription()\n {\n $this->assertEquals(\n self::$testDescription,\n $this->dataRepository->getDescription()\n );\n }", "public static function getDescription()\n {\n return '';\n }", "public function getTestInfo()\n {\n return $this->testInfo;\n }", "public function getDescription() {\n\t\treturn wfMessage( \"bs-flexiskin-api-desc\" )->plain();\n\t}", "public function getDescription()\n {\n return $this->getProperty(self::DESCRIPTION);\n }", "public function testShowDescription()\n {\n $value = rand();\n $this->fixture->setDescription($value);\n\n $actual = $this->fixture->getDescription();\n $this->assertSame((string) $value, $actual, 'Problem getting or setting the Show Description as a string.');\n }", "public final function getDescription() : string {\n return $this->serviceDesc;\n }", "function getDescription() {\n\t\treturn $this->_Description;\n\t}", "public function getReportDescription(): string { return(\"GraphArtisanTest REPORT DESCRIPTION\"); }", "public function getDescription()\n {\n return $this->getResponse()->description;\n }", "public function getDescription() {\n if (isset($this->description)) {\n return $this->description;\n }\n return dt(\"Run the @short action.\", array('@short' => $this->short));\n }", "public function getDescription() : String\n {\n return $this->getRequest()->getAttribute(\"appDescription\", \"This is a Basicis framework App!\");\n }", "public function getContextDescription(): string\n {\n return $this->contextDescription;\n }", "public function getDescription() {\n\t\t\treturn $this->MODULE_DESCRIPTION;\t\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns MongoClient object, or a mock
private function _getMongoClient() { if (null == $this->_dbclass) { $db = new \MongoClient(); $this->_dbclass = $db; } return $this->_dbclass; }
[ "public function getMongoClient()\n {\n if (empty($this->mongoClient)) {\n $this->mongoClient = new \\MongoClient($this->config['db.host'], $this->config['db.options']);\n }\n return $this->mongoClient;\n }", "public function getClient()\n\t{\n\t\t// *** rewrite to return a MongoClient instance\n\t\tif (!$this->client) {\n\t\t\ttry {\n\t\t\t\t$this->client = NULL;\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t}\n\t\treturn $this->client;\n\t}", "protected function createMongoDBMock()\n {\n return m::mock(\\MongoDB\\Database::class);\n }", "public function getMongo()\n {\n $currentPid = getmypid();\n if ($this->mongo === null || $this->pid !== $currentPid) {\n $config = $this->getPackageConfig();\n MPCMF_LL_DEBUG && self::log()->addDebug(\"Connecting to {$config['uri']}\", [__METHOD__]);\n $this->mongo = new \\MongoClient($config['uri'], $config['options']);\n $this->pid = $currentPid;\n }\n\n return $this->mongo;\n }", "function mongodbConnection() {\n require 'application/third_party/vendor/autoload.php'; // include Composer's autoloader\n\n return $client = new MongoDB\\Client(\"mongodb://localhost:27017\");\n }", "protected function connect()\n\t{\n\t\treturn new \\Mongo($this->config('connection', 'mongodb://127.0.0.1'));\n\t}", "function conectar_db()\n{\n $db = new MongoClient();\n $db = $db->fuzzy;\n return $db;\n}", "public function mongoDb(): MongoDb\n {\n return new MongoDb(new \\MongoDB\\Client(getenv('MONGODB_CONNECTION')), ['indexes' => 'true', 'db' => 'phone_verification']);\n }", "function mongoDbInstance() {\n $mongoUrl = \"mongodb://localhost:27017\";\n require APPPATH . '..\\mongodb\\vendor\\autoload.php'; // include Composer's autoloader\n $client = new MongoDB\\Client($mongoUrl);\n return $client->assetsupporthub;\n}", "protected function getMongo() {\n if ($this->mongo === null) {\n try {\n $this->mongo = new Mongo($this->params['server'], $this->params['options']);\n } catch (MongoException $e) {\n throw new StorageException('Could not connect to database', 500, $e);\n }\n }\n\n return $this->mongo;\n }", "protected function setMongo()\n {\n $mongo = new Client();\n $this->mongo = $mongo;\n }", "public function getConnection()\r\n\t{\r\n\t\tif(empty($this->_mongo)){\r\n\t\t\t$this->connect();\r\n\t\t}\r\n\t\treturn $this->_mongo;\r\n\t}", "public static function getInstance()\n {\n if (is_null(self::$_mongo) === true) {\n self::$_mongo = new self;\n }\n\n return self::$_mongo;\n }", "public static function get_connection () {\n\t\t$conf = conf ('Mongo');\n\n\t\tif (! self::$conn) {\n\t\t\tif (isset ($conf['user'])) {\n\t\t\t\t$connstr = 'mongodb://' . $conf['user'] . ':' . $conf['pass'] . '@' . $conf['host'];\n\t\t\t} else {\n\t\t\t\t$connstr = 'mongodb://' . $conf['host'];\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tif (isset ($conf['set_name'])) {\n\t\t\t\t\tself::$conn = new MongoClient ($connstr, array ('replicaSet' => $conf['set_name']));\n\t\t\t\t} else {\n\t\t\t\t\tself::$conn = new MongoClient ($connstr);\n\t\t\t\t}\n\t\t\t} catch (Exception $e) {\n\t\t\t\tself::$error = $e->getMessage ();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn self::$conn;\n\t}", "protected function createObject()\n {\n $uri = \"mongodb://192.168.110.200:27017\";\n $client = new \\MongoDB\\Driver\\Manager($uri);\n return $client;\n }", "public function testCreateMongoDb(): void\n {\n $options = [\n 'uri' => 'mongodb://localhost:27017',\n 'uriOptions' => [],\n 'driverOptions' => [],\n ];\n\n $this->assertInstanceOf(Client::class, (new StorageFactory('mongodb', $options))->get());\n }", "public function testGetMongoDb() {\n\t\t$obj = $this->mongodb->getMongoDb();\n\t\t$this->assertTrue(is_object($obj));\n\t\t$objName = get_class($obj);\n\t\t$this->assertEqual('MongoDB', $objName);\n\t}", "public function getMongoDB()\n {\n return $this->mongoDB;\n }", "public function getConnectionDB() {\n require 'vendor/autoload.php'; # include Composer's autoloader\n $conClient = new MongoDB\\Client(\"mongodb://localhost:27017\"); # instanciate class client \n return $conClient;# return connection client which will be used to communicate with mongodb database\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Implements hook_civicrm_alterAPIPermissions(). Allow anyone to run Popemployer.get API so long as they provide an email.
function popemployer_civicrm_alterAPIPermissions($entity, $action, &$params, &$permissions) { if ($entity == 'popemployer' && $action == 'get' && $params['email']) { $permissions['popemployer']['get'] = array(); } }
[ "public function setAPIUserEmail($email)\n {\n $this->APIUserEmail=$email;\n }", "public function set_permission(){\n if ( ! current_user_can( 'edit_users' ) ) {\n return new WP_Error( 'rest_forbidden', esc_html__( 'You do not have permissions to perform this action.', 'my-text-domain' ), array( 'status' => 401 ) );\n }\n \n // This approach blocks the endpoint operation. You could alternatively do this by an un-blocking approach, by returning false here and changing the permissions check.\n return true;\n }", "public static function set_permission(){\n if ( ! current_user_can( 'edit_users' ) ) {\n return new WP_Error( 'rest_forbidden', esc_html__( 'You do not have permissions to perform this action.', 'my-text-domain' ), array( 'status' => 401 ) );\n }\n \n // This approach blocks the endpoint operation. You could alternatively do this by an un-blocking approach, by returning false here and changing the permissions check.\n return true;\n }", "public function getAPIUserEmail()\n {\n return $this->APIUserEmail;\n }", "function activate_employer(){\n\t\t$email = ee()->TMPL->fetch_param('email');\n\n\t\t$results = ee()->db->query(\"SELECT member_id FROM exp_members WHERE email = '$email'\");\n\t\t\n\t\tforeach($results->result_array() as $row){\n\t $member_id = $row['member_id'];\n\t }\n\t\t\n\t\t$query = ee()->db->query(\"UPDATE exp_members SET group_id = '7' WHERE email = '$email'\");\n\t\t$query = ee()->db->query(\"UPDATE exp_channel_titles SET status = 'Employers-id7' WHERE author_id = '$member_id'\");\n\t\tif($query){\n\t\t\theader(\"Location: /account/add-user/added/act\");\n\t\t\texit;\n\t\t}\n\t}", "public function access() {\n $config = \\Drupal::config('elastic_email.settings');\n $site_mail = \\Drupal::config('system.site')->get('mail');\n $username = $config->get('username');\n $api_key = $config->get('api_key');\n\n if (empty($site_mail)) {\n return AccessResult::forbidden();\n }\n if (empty($username)) {\n return AccessResult::forbidden();\n }\n if (empty($api_key)) {\n return AccessResult::forbidden();\n }\n return AccessResult::allowed();\n }", "function uservalidationbyemail_allow_new_user_can_edit($hook, $type, $value, $params) {\n\t// $params['user'] is the user to check permissions for.\n\t// we want the entity to check, which is a user.\n\t$user = elgg_extract('entity', $params);\n\n\tif (!($user instanceof ElggUser)) {\n\t\treturn;\n\t}\n\n\t$context = elgg_get_context();\n\tif ($context == 'uservalidationbyemail_new_user' || $context == 'uservalidationbyemail_validate_user') {\n\t\treturn TRUE;\n\t}\n\n\treturn;\n}", "function local_tcapi_set_role_permission_overrides() {\n\tglobal $CFG,$DB;\n\t$role = $DB->get_record('role', array('archetype'=>'user'), 'id', MUST_EXIST);\n\tif (isset($role->id)) {\n\t\trequire_once $CFG->dirroot.'/lib/accesslib.php';\n\t\trole_change_permission($role->id, context_system::instance(), 'moodle/webservice:createtoken', CAP_ALLOW);\n\t\trole_change_permission($role->id, context_system::instance(), 'webservice/rest:use', CAP_ALLOW);\n\t\trole_change_permission($role->id, context_system::instance(), 'local/tcapi:use', CAP_ALLOW);\n\t}\n}", "public function setAdminEmail($email);", "public function updateCompanyEmail()\n\t{\n\t\t//-- get params\n\t\t$compId = isset($this->requestData->compId)?$this->requestData->compId:\"\";\n\t\t$setData['set_email'] = isset($this->requestData->email)?$this->requestData->email:\"\";\n\t\t$setData['set_bcc'] = isset($this->requestData->bcc)?$this->requestData->bcc:\"\";\n\t\ttry\n\t\t{\n\t\t\t//-- call model function updateCompanySetting\n\t\t\t$trueMsg = \"Company email updated successfully.\";\n\t\t\t$falseMsg = \"Company email not update, please try again.\";\n\t\t\t$arrayResponse = $this->CompanyModel->updateCompanySetting($compId,$setData,$trueMsg,$falseMsg);\n\t\t\tif(empty($arrayResponse))\n\t\t\t\tthrow new Exception('Response not get, please try again.');\n\t\t} \n\t\tcatch (Exception $e)\n\t\t{\n\t\t\techo $this->CommonModel->getJsonData(array('success'=> false, 'message' => $e->getMessage(), 'data' => []));\n\t\t\texit();\n\t\t}\n\t\t//-- convert arrayResponse to json\n\t\techo $this->CommonModel->getJsonData($arrayResponse);\t\n\t}", "public function getAssigneeEmail();", "public function getForceUsageParentCompanyNamePermission();", "function _empowersbc_valid_user($current_user_id, $webform_user_id ){\n //Get civicrm contact id from current drupal user\n $contact = _empowersbc_get_civicrm_contactid($current_user_id);\n if (! $contact) {\n return false;\n }\n // check relationship between employee and contractor employer\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'contact_id_a' => $contact,\n 'contact_id_b' => $webform_user_id,\n 'relationship_type_id' => 4,\n 'is_active' => 1,\n );\n\n $resultRelationshipAB = civicrm_api('Relationship', 'get', $params);\n\n //if its empty either relation is not preset or $webform_user_id is not organization contact.\n // check Relationship with employer\n if ( $resultRelationshipAB['is_error'] == 0 && ! empty( $resultRelationshipAB['values']) ) {\n return true;\n }\n else if ( $resultRelationshipAB['is_error'] == 0 && empty( $resultRelationshipAB['values']) ) {\n // Get employer data for logged in user\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'contact_id_a' => $contact,\n 'relationship_type_id' => 4,\n 'is_active' => 1,\n );\n\n $resultEmployerDetails = civicrm_api('Relationship', 'get', $params);\n\n if ( $resultEmployerDetails['is_error'] == 0 && !empty( $resultEmployerDetails['values']) ) {\n $employerId = $resultEmployerDetails['values'][0]['contact_id_b'];\n // check relationship between employer and homeowner\n $params = array(\n 'version' => 3,\n 'sequential' => 1,\n 'contact_id_a' => $employerId,\n 'contact_id_b' => $webform_user_id,\n 'is_active' => 1,\n );\n\n $resultRelationshipHomeOwner = civicrm_api('Relationship', 'get', $params);\n\n if ( $resultRelationshipHomeOwner['is_error'] == 0 && ! empty( $resultRelationshipHomeOwner['values']) ) {\n return true;\n }\n }\n }\n return false;\n}", "function hook_apigee_edge_teams_developer_permissions_by_team_alter(array &$permissions, \\Drupal\\apigee_edge_teams\\Entity\\TeamInterface $team, \\Drupal\\Core\\Session\\AccountInterface $account) {\n // @see apigee_edge_teams_test_apigee_edge_teams_developer_permissions_by_team_alter()\n}", "public function grantAccessP($userid=0,$email=\"\",$productname=\"\",$productid=0){\n //give access for user to change info on a product\n if($userid==0){\n //user id is not placed\n if($email!=\"\"){\n $login = new Login();\n $userid = $login->existingEmail($email)->userid;\n }else{\n return \"Userid eller Email må være med\";\n }\n }else{\n //userid is placed all good\n }\n if($productid==0){\n if($productname!=\"\"){\n $product = new Product();\n $productid = $product->productExists($productname)->id;\n \n }else{\n return \"Produktnavn eller Produkt id må være med\";\n }\n }\n if($productid!=0 && $userid!=0){\n $companyid =0;\n $company_user = new Company_User();\n if(!$company_user->exist($userid, $companyid, $productid)){\n $company_user->user_id = $userid;\n $company_user->product_id = $productid;\n $company_user->company_id = 0;\n $company_user->save();\n }else{\n return \"Brukeren har allerede tilgang\";\n }\n \n }\n \n }", "public function izap_grant_edit() {\n if(get_class($this)=='IzapQuiz') {\n register_plugin_hook('permissions_check', 'object', 'izap_quiz_edit_grant');\n }\n }", "public function inviteOrGrant($project, $email)\n {\n $existingPerson = null;\n foreach($this->people() as $person){\n if($person->email_address == auth()->user()->email) {\n $existingPerson = $person;\n break;\n }\n }\n\n if($existingPerson)\n return $this->projectGrant($project, $existingPerson);\n else\n return $this->invitePeople($project, $email);\n }", "public function bySupervisorEmail($email);", "public function notifyUserOfApprovedKey(\n \\YiiMailer $mailer = null,\n array $appParams = null\n ) {\n // If not given the Yii app params, retrieve them.\n if ($appParams === null) {\n $appParams = \\Yii::app()->params->toArray();\n }\n \n // If we are in an environment where we should NOT send email\n // notifications, then don't.\n if ($appParams['mail'] === false) {\n return;\n }\n \n if ($this->user && $this->user->email) {\n\n // Try to send them a notification email.\n if ($mailer === null) {\n $mailer = \\Utils::getMailer();\n }\n $mailer->setView('key-approved');\n $mailer->setTo($this->user->email);\n $mailer->setSubject(sprintf(\n 'Key approved for %s API',\n $this->api->display_name\n ));\n if (isset($appParams['mail']['bcc'])) {\n $mailer->setBcc($appParams['mail']['bcc']);\n }\n $mailer->setData(array(\n 'key' => $this,\n 'api' => $this->api,\n 'user' => $this->user,\n ));\n \n /**\n * @todo Figure out whether we want to Cc: the API Owner on this\n * email. I think not, to avoid exposing their email address\n * to people without their consent.\n */\n //$cc = array();\n //if ($this->api->owner && $this->api->owner->email) {\n // $cc[] = $this->api->owner->email;\n //}\n //$mailer->setCc($cc);\n\n // If unable to send the email, allow the process to\n // continue but communicate the email failure somehow.\n if ( ! $mailer->send()) {\n \\Yii::log(\n 'Unable to send key-approved notification email to user: '\n . $mailer->ErrorInfo,\n \\CLogger::LEVEL_WARNING\n );\n }\n }\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Domain Zone Dns 01 attribute value
public function getDns01() : string { return $this->getValue('nb_domain_zone_dns_01'); }
[ "public function getDns04()\n {\n return $this->getValue('nb_domain_zone_dns_04');\n }", "public function getRecord(): DnsRecord;", "public function getDnsInfo()\n {\n return $this->get(self::DNSINFO);\n }", "public function getDns() : string\n {\n return $this->dns;\n }", "public function getCustomDns()\n {\n return $this->readOneof(1);\n }", "public function getDnsOrigin()\n {\n return $this->getValue('nb_domain_zone_dns_origin');\n }", "function getCellDns()\n {\n \t$readfile = file($this->wandns_file,FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\t//read the file\n \tdebug('(cell_controller.inc|getCellDns()) reading dns file at: '.$this->wandns_file); \t\t\t//DEBUG\n \tdebug('(cell_controller.inc|getCellDns()) contents of dns file', $readfile); \t\t\t\t\t//DEBUG\n \n if($readfile)\n {\n \t$dns_result = '';\n $dns_str = implode(',', $readfile);\n preg_match_all(\"/(([0-9]+\\.?)+)/\", $dns_str, $dns_result); //regex to match for the ip addresses\n debug('(cell_controller.inc|getCellDns()) successfully read and parsed dns file contents.'); \t//DEBUG\n return $dns_result[0];\n }\n else\n {\n \tdebug('(cell_controller.inc|getCellDns()) failed to read dns file contents.'); \t\t\t\t\t//DEBUG\n \treturn false;\n }\n }", "public function getVmDnsSetting()\n {\n return isset($this->vm_dns_setting) ? $this->vm_dns_setting : '';\n }", "public function getDnsName()\n {\n return isset($this->dns_name) ? $this->dns_name : '';\n }", "public function getLdapDomainColumn();", "public function getDnsRecord()\n {\n\n $record = dns_get_record($this->getHost());\n\n if (count($record) === 0) {\n throw new InvalidUrl('No dns record for given domain.');\n }\n\n return $record;\n }", "public function getFullyQualifiedDomainName();", "public function getDNID();", "function get_host_by_name( $domain ) {\n\t# curl -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=' . $domain . '&type=A'\n\t$dns = json_decode( wp_remote_retrieve_body( wp_remote_get( \n\t\t'https://cloudflare-dns.com/dns-query?name=' . $domain . '&type=A'\n\t) ) );\n\n\t$ip\t= explode( ';', $dns['Answer']['data'] );\n\n\tforeach ($ip as $value) {\n\t\tif ( filter_var( $value, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {\n\t\t\treturn $value;\n\t\t}\n\t}\n\n\treturn gethostbyname( $domain );\n}", "public function getClusterDns();", "private function dns_get_record($address)\n {\n $output = $dns = array();\n $retval = false;\n if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')\n {\n @exec('nslookup -type A '.$address, $output, $retval);\n if (!$retval and array_key_exists(1, $output))\n {\n $output[0] = $output[1];\n }\n }\n else\n {\n @exec('host '.$address, $output, $retval);\n }\n\n if (!$retval and array_key_exists(0, $output))\n {\n $explode = explode(' ', $output[0]);\n $result = $explode[count($explode)-1];\n if (filter_var($result, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4))\n {\n $dns[0]['ip'] = $result;\n }\n unset($explode, $result);\n }\n \n return $dns;\n }", "public function getDDNSInfo()\n {\n $result = $this->client->GetDDNSInfo();\n if ($this->errorHandling($result, 'Could not get DynDNS info from FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function reverseDNS(): string\n {\n return $this->d . '.' . $this->c . '.' . $this->b . '.' . $this->a .\n '.in-addr.arpa.';\n }", "function getDNS($host,$ns)\n{\n\t$string = '';\n\texec(\"dig @$ns +short $host 2>&1\", $output, $retval);\n\tif ($retval != 0)\n\t{\n\t\treturn \"ERROR_NO_RESULT\";\n\t}\n\telse\n\t{\n\t\t$x=0;\n\t\twhile ($x < (sizeof($output)))\n\t\t{\n\t\t\t$string.= $output[$x];\n\t\t\t$x++;\n\t\t}\n\t}\n\n\tif (empty($string))\n\t{\n\t\treturn \"ERROR_NO_RESULT\";\n\t}\n\telse if($string[strlen($string)-1] == '.')\n\t{\n\t\t$string = substr($string, 0, -1);\n\t}\n\n\treturn $string;\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
file: ccontent.drv.php desc: defines the relationship of ccontent and cwidgetinstances //////////////// functions //////////////// //////////////////////////// cwidgethooks //////////////////////////// name: CWidgetHook_CContent_doInit() desc: initializes a cwidget's ccontent instances when the theme's site loads
function CWidgetHook_CContent_doInit($cwidgetinstance) { //alert("init: " . $cwidgetinstance->getWidgetID()); }
[ "public function initContent()\n {\n }", "function ccontent_content ( $cwidgetinstance ){\n\tprintbr(\"hello world from ccontent_content\");\n}", "public function cpl_widget_init() {\n\t\t// TODO\n\t}", "protected function _init()\n\t{\n\t\t// Set up blogFunctions:\n\t\tif ( ! $this->registry->isClassLoaded( 'blogFunctions' ) )\n\t\t{\n\t\t\t$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'blog' ) . '/sources/classes/blogFunctions.php', 'blogFunctions', 'blog' );\n\t\t\t$this->registry->setClass('blogFunctions', new $classToLoad($this->registry));\n\t\t}\n\t\t\n\t\t// Set up contentBlocks:\n\t\tif ( ! $this->registry->isClassLoaded( 'cblocks' ) )\n\t\t{\n\t\t\t$classToLoad = IPSLib::loadLibrary( IPSLib::getAppDir( 'blog' ) . '/sources/classes/contentblocks/blocks.php', 'contentBlocks', 'blog' );\n\t\t\t$this->registry->setClass('cblocks', new $classToLoad($this->registry));\n\t\t}\n\t}", "function CWidgetHook_CContent_doBody($cwidgetinstance) {\n}", "function pmxc_InitContent()\n\t{\n\t\tglobal $context, $scripturl, $boardurl, $modSetting, $pmxCacheFunc;\n\n\t\tif(empty($context['pmx']['settings']['manager']['promote']) || empty($context['pmx']['promotes']))\n\t\t\t$this->visible = false;\n\n\t\t// if visible init the content\n\t\tif($this->visible)\n\t\t{\n\t\t\t// paging key\n\t\t\t$this->postKey = 'pmxpost_'. $this->cfg['blocktype'] . $this->cfg['id'];\n\n\t\t\t// posts can select by posts or boards .. defaut posts\n\t\t\tif(empty($this->cfg['config']['settings']['selectby']))\n\t\t\t\t$this->cfg['config']['settings']['selectby'] = 'posts';\n\n\t\t\t// cache enabled ?\n\t\t\tif($this->cfg['cache'] > 0)\n\t\t\t{\n\t\t\t\t// cache valid?\n\t\t\t\tif(($cachedata = $pmxCacheFunc['get']($this->cache_key, $this->cache_mode)) !== null)\n\t\t\t\t\tlist($this->posts, $this->attachments, $this->footNote, $this->imgName, $this->noLB) = $cachedata;\n\n\t\t\t\t// not cached .. get all data and store in cache\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$cachedata = $this->fetch_data();\n\t\t\t\t\t$pmxCacheFunc['put']($this->cache_key, $cachedata, $this->cache_time, $this->cache_mode);\n\t\t\t\t}\n\t\t\t\tunset($cachedata);\n\t\t\t}\n\t\t\t// fetch if cache disable\n\t\t\telse\n\t\t\t\t$this->fetch_data();\n\n\t\t\t// no posts .. disable the block\n\t\t\tif(empty($this->posts))\n\t\t\t\t$this->visible = false;\n\n\t\t\t// create page index if set ..\n\t\t\telseif(!empty($this->cfg['config']['settings']['onpage']))\n\t\t\t{\n\t\t\t\tif(!empty($this->cfg['config']['settings']['onpage']) && count($this->posts) > $this->cfg['config']['settings']['onpage'])\n\t\t\t\t{\n\t\t\t\t\t$this->postarray = array('pg' => 0);\n\n\t\t\t\t\tif(isset($_POST[$this->postKey]))\n\t\t\t\t\t{\n\t\t\t\t\t\tpmx_GetPostKey($this->postKey, $this->postarray);\n\t\t\t\t\t\t$_SESSION['PortaMx'][$this->postKey] = $this->postarray;\n\t\t\t\t\t\t$this->startpage = $this->postarray['pg'];\n\t\t\t\t\t}\n\t\t\t\t\telseif(isset($_SESSION['PortaMx'][$this->postKey]))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(intval($_SESSION['PortaMx'][$this->postKey]['pg'] * $this->cfg['config']['settings']['onpage']) > count($this->posts))\n\t\t\t\t\t\t\t$this->startpage = 0;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$this->startpage = $_SESSION['PortaMx'][$this->postKey]['pg'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$this->startpage = 0;\n\n\t\t\t\t\t$baseurl = !empty($modSettings['sef_enabled']) ? $boardurl .'/' : $scripturl .'?';\n\t\t\t\t\t$this->pmxc_constructPageIndex(count($this->posts), $this->cfg['config']['settings']['onpage'], false, $this->startpage);\n\t\t\t\t\t$this->pageindex = str_replace('<a', '<a onclick=\"pmx_StaticBlockSub(\\''. $this->postKey .'\\', this, \\'/'. rtrim($baseurl, '?/') .'/\\', \\''. $this->cfg['uniID'] .'\\')\"', $this->pageindex);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// image rescale..\n\t\t\tif(!empty($this->imgName))\n\t\t\t{\n\t\t\t\tif(empty($this->cfg['config']['settings']['rescale']) && !is_numeric($this->cfg['config']['settings']['rescale']))\n\t\t\t\t\taddInlineCss('\n\t.'. $this->imgName .'{}');\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$vals = explode(',', $this->cfg['config']['settings']['rescale']);\n\t\t\t\t\taddInlineCss('\n\t.'. $this->imgName .'{'. (empty($vals[0]) ? '' : 'max-width:'. (strpos($vals[0], '%') === false ? $vals[0] .'px' : $vals[0])) .';'. (empty($vals[1]) ? '' : 'max-height:'. (strpos($vals[1], '%') === false ? $vals[1] .'px' : $vals[1])) .';}');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// return the visibility\n\t\treturn $this->visible;\n\t}", "function crmpress_content_structure_start() {\n\necho '<div id=\"main-content\">';\n\techo '<div class=\"wrap\">';\n\t\n\t\tdo_action( 'crmpress_before_content_sidebar_wrapper' );\n\t\n\t\techo '<div class=\"content-sidebar-wrapper\">';\n\t\t\n\t\tdo_action( 'crmpress_before_content' ); // This hook fires right before the content div\n\t\t\n\t\techo '<div id=\"content\">';\n\n}", "function CContent_doScripts() {\n wp_enqueue_script( 'ccontent', relname( __FILE__ ) . '/ccontent.drv.js', array('jquery') );\n}", "public function initWidget()\n {\n }", "function init() { /* {{{ */\n\t\t$GLOBALS['SEEDDMS_HOOKS']['initDMS'][] = new SeedDMS_EditDocx_InitDMS;\n\t\t$GLOBALS['SEEDDMS_HOOKS']['view']['viewDocument'][] = new SeedDMS_EditDocx_ViewDocument;\n\t}", "function action_init()\n\t{\n\t\t$this->add_template('admin_cctypes', dirname(__FILE__) . '/cctypes.php');\n\t\t$this->add_template('admin_cctype_publish', dirname(__FILE__) . '/cctype_publish.php');\n\t}", "public function init(){\n\t\t// table of contents meta box options\n\t\tadd_meta_box(\n\t\t\t'idocs-table-of-contents',\n\t\t\t__('Table of contents', 'idocs'),\n\t\t\tarray( $this, 'meta_box_table_of_contents' ),\n\t\t\t$this->main->get_post_type(),\n\t\t\t'side',\n\t\t\t'core'\n\t\t);\n\n\t\tadd_meta_box(\n\t\t\t'idocs-post-shortcode-link',\n\t\t\t__('Shortcode link', 'idocs'),\n\t\t\tarray( $this, 'meta_box_shortcode_link' ),\n\t\t\t$this->main->get_post_type(),\n\t\t\t'side',\n\t\t\t'core'\n\t\t);\n\n\t\tadd_meta_box(\n\t\t\t'idocs-related-posts',\n\t\t\t__('Related posts', 'idocs'),\n\t\t\tarray( $this, 'meta_box_related' ),\n\t\t\t$this->main->get_post_type(),\n\t\t\t'normal',\n\t\t\t'core'\n\t\t);\n\t}", "function BPPWidgetInit() {\n register_widget('BlogWorthyMostViewedPosts');\n }", "public static function init() {\r\n register_widget(__CLASS__);\r\n }", "function ht_widgets_init() {\n\t\n\tglobal $tweet_widget_number;\n\t$tweet_widget_number = 0;\n\tregister_widget('HT_Recent_Posts');\n\tregister_widget('HT_Ad_Widget');\n\tregister_widget('HT_Popular_Posts');\n\tregister_widget('HT_Recent_Tweets');\n\tregister_widget('HT_Sub_Navigatioin');\n\tregister_widget('HT_Flickr');\n\tregister_widget('HT_Contact_Details');\n register_widget('HT_Logos_list');\n register_widget('HT_Google_Map');\n\n\t\n}", "function wsWidgetInit() {\n\t\t\n\t register_sidebar( array (\n\t\t\t 'name' => 'Primary Menu Block',\n\t\t\t 'id' => 'wsprimarymenublock',\n\t\t\t 'before_widget' => '<li id=\"%1$s\" class=\"list-unstyled %2$s\">',\n\t\t\t 'after_widget' => \"</li>\",\n\t\t\t 'before_title' => '<h4>',\n\t\t\t 'after_title' => '</h4>',\n\t ) );\n\t \n\t register_sidebar( array (\n\t\t 'name' => 'Secondary Menu Block',\n\t\t 'id' => 'wssecondaryblock',\n\t\t 'before_widget' => '<li id=\"%1$s\" class=\"list-unstyled %2$s\">',\n\t\t 'after_widget' => \"</li>\",\n\t\t 'before_title' => '<h4>',\n\t\t 'after_title' => '</h4>',\n\t ) );\n\t \r\n\t\tregister_sidebar( array(\r\n \t\t\t'name' => 'Homepage Right Menu',\r\n \t\t\t'id' => 'wsmenuright',\n\t\t\t 'before_widget' => '<li id=\"%1$s\" class=\"list-unstyled %2$s\">',\n\t\t\t 'after_widget' => \"</li>\",\n\t\t\t\t'before_title' => '<h4>',\n\t\t\t\t'after_title' => '</h4>',\r\n \t) );\n\t\t\r\n\t\tregister_sidebar( array(\r\n\t\t\t\t'name' => 'Main Footer Menu',\r\n\t\t\t\t'id' => 'wsfootermenu',\r\n\t\t\t\t'before_widget' => '<div class=\"wsFooterMenu\">',\r\n\t\t\t\t'after_widget' => '</div>',\r\n\t\t\t\t'before_title' => '<h4>',\r\n\t\t\t\t'after_title' => '</h4>',\r\n\t\t) );\n\t\t\n\t}", "function register_content_widget() {\r\r\n register_widget( 'custom_content_box_Widget' );\r\r\n}", "function example_load_widgets()\n{\n\tregister_widget('GuildNews_Widget');\n}", "public static function init(){\n \n add_action('wp_enqueue_scripts', array(get_class(), 'registerScript'));\n add_shortcode(self::defaultShortcodeName, array(get_class(), 'shortcode'));\n add_action('widgets_init', array(get_class(), 'registerWidget'));\n \n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is League data available ?
public function isLeagueLevelAvailable() { if(!$this->isDeleted()) { if(!isset($this->leagueLevelAvailable) || $this->leagueLevelAvailable === null) { $this->leagueLevelAvailable = $this->getXml()->getElementsByTagName('LeagueLevelUnit')->item(0)->hasChildNodes(); } return $this->leagueLevelAvailable; } return null; }
[ "private function _getLeagueData()\n\t{\n\t // Reference global application object\n $app = JFactory::getApplication();\n // JInput object\n $jinput = $app->input;\n $option = $jinput->getCmd('option');\n $db\t= $this->getDbo();\n $query = $db->getQuery(true);\n \n $query->select('*');\n $query->from('#__sportsmanagement_league');\n $query->where('id = ' . $this->_project[0]['league_id'] );\n \n\t\t//$query = \"SELECT * FROM #__sportsmanagement_league WHERE id=\".$this->_project[0]['league_id'];\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\tif ($db->getNumRows() > 0)\n\t\t{\n\t\t\t$result = $db->loadAssocList();\n\t\t\t$result[0]['object'] = 'League';\n\n\t\t\treturn $result;\n\t\t}\n\t\treturn false;\n\t}", "public function hasGameData()\n {\n return $this->game_data !== null;\n }", "function isTypeLeague() {\r\n\t\treturn $this->record['type'] == 1;\r\n\t}", "public function hasActivePlayer()\n {\n $this->read(array('type'=>'key', 'filter'=>'state=3'));\n return $this->hasData();\n }", "public function hasTeams()\n {\n return count($this->teams) > 0;\n }", "public function hasDataProvider(): bool;", "public function hasData();", "public function hasLobby()\n {\n return $this->lobbies()->exists();\n }", "public function hasDatas();", "public function is_data_loaded() {\n return ( empty( $this->schoolID ) ) ? FALSE : TRUE;\n }", "public function forTeams() : bool\n {\n return ($this->players_per_team > 1);\n }", "static function hasLecture()\n {\n return isset ($_SESSION[self::SDB_LECTURE_DATA]);\n }", "function isInTheTeam() {\n\n if (isset($this->team['User']) && count($this->team['User'])) {\n foreach ($this->team['User'] as $data) {\n if ($data['items_id'] == Session::getLoginUserID()) {\n return true;\n }\n }\n }\n\n if (isset($_SESSION['glpigroups']) && count($_SESSION['glpigroups'])\n && isset($this->team['Group']) && count($this->team['Group'])) {\n foreach ($_SESSION['glpigroups'] as $groups_id) {\n foreach ($this->team['Group'] as $data) {\n if ($data['items_id'] == $groups_id) {\n return true;\n }\n }\n }\n }\n return false;\n }", "function isOnMyTeam($UID)\n{\n return !empty(getSharedTeams($UID));\n}", "public function getStats(): bool {}", "public function hasTeam()\n {\n return $this->getTeam() !== null;\n }", "public static function hasTeamFeatures()\n {\n return static::enabled(static::teams());\n }", "public function hasChatRoomData()\n {\n return $this->get(self::CHATROOMDATA) !== null;\n }", "public function hasTeam()\n {\n return $this->team !== null;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
atualizar ver na home
function atualizarVerHome ($id) { $this->sql = "UPDATE cliente SET verhome = 'SIM' WHERE id = $id"; $this->superdao->resetResponse(); if(!mysqli_query($this->con, $this->sql)) { $this->superdao->setMsg( resolve( mysqli_errno( $this->con ), mysqli_error( $this->con ), get_class( $obj ), 'Atualizar' ) ); }else{ $this->superdao->setSuccess( true ); $this->superdao->setData( true ); } return $this->superdao->getResponse(); }
[ "public function veriCode() {}", "public function zahtev_ver()\n\t{\n\t\t$zahtevVerModel = new ModelZahtevVer();\n\t\t$korisnik = $this->session->get(\"korisnik\");\n\t\t//Provera da li postoji neobradjen zahtev trenutnog korisnika\n\t\tif ($zahtevVerModel->proveraZahtevPodnet($korisnik->IdK)) {\n\t\t\treturn $this->pozovi('zahtev_ver/slanje_zahteva_podnet');\n\t\t} else {\n\t\t\t$data['zahtevNeuspesan'] = '';\n\t\t\treturn $this->pozovi('zahtev_ver/slanje_zahteva', $data);\n\t\t}\n\t}", "public function estaVencido()\n {\n }", "public function atualizar()\n {\n }", "public function verNota(){\n\t\tif(self::logeado()){\n\t\t\t$this->view->setVariable(\"nota\",$this->NotaMapper->getNoteByID($_GET[\"idNota\"]));\n\t\t\t$this->view->setVariable(\"alias\",$_SESSION[\"currentuser\"]);\n\t\t\t$this->view->render(\"notes\", \"verNota\");\n\t\t}\n\t}", "function SurveyHomeChange() {\n global $_CORELANG, $_ARRAYLANG, $objDatabase;\n\n $id = contrexx_input2raw($_GET['id']);\n $activeStatus = $objDatabase->Execute('SELECT `isActive` FROM '.DBPREFIX.'module_survey_surveygroup WHERE id = '.$id);\n $status = $activeStatus->fields['isActive'];\n if($status == 1) {\n // Updating all the records to isHomeBox = 0\n $query = 'UPDATE '.DBPREFIX.'module_survey_surveygroup SET isHomeBox=0';\n $objDatabase->Execute($query);\n //Updaing the particular survey to home survey\n $query1 = \"UPDATE \".DBPREFIX.\"module_survey_surveygroup SET isHomeBox=1 WHERE id=$id\";\n $objDatabase->Execute($query1);\n\n $this->_strOkMessage = $_ARRAYLANG['TXT_SURVEY_HOME_SUCC_TXT'];\n }else {\n $this->_strErrMessage = $_ARRAYLANG['TXT_SURVEY_HOME_ERR_TXT'];\n }\n // calling the surveyOverview() function\n $this->surveyOverview();\n }", "public function testCheckHomePageContent() \n {\n $this->visit('/')\n ->see('SEARCH THE UNIVERSITY OF FLORIDA DIRECTORY')\n ->see('Site Updated')\n ->see('Searches within the UF directory can be done in the following methods');\n }", "public function verificarAcessoHome(){\r\n $logicaUsuario = new LogicaUsuario();\r\n $logicaUsuario->verificarUsuario();\r\n }", "function asu_scholar_inject_home() {\n $path = drupal_get_normal_path('<front>');\n $menu_item = array(\n 'link_path' => $path,\n 'link_title' => 'Home',\n 'menu_name' => 'primary-menu',\n 'weight' => '-10',\n 'language' => 'en',\n );\n vsite_menu_menu_link_save($menu_item);\n}", "public function setHomepage() {\n //$home_Body= $this->fetch('HomeBody.tpl');\n $home_Body=\"qua ci va il body della home... manca ancora il tpl e va cambiato il commento su VHome.php in modo da fare la fetch\";\n $this->setBody($home_Body);\n \n }", "function historia()\n {\n\t\t$pagina=$this->load_template('History of Bolivia');\t\t\t\t\n\t\t$html = $this->load_page('app/views/default/modules/m.historia.php');\n\t\t$pagina = $this->replace_content('/\\#CONTENIDO\\#/ms' ,$html , $pagina);\n\t\t$this->view_page($pagina);\n }", "function verUniversidads()\n {\n //se llama al modelo que contiene los datos de la tabala Universidads\n $query = $this->model_uni->get();\n\n include_once('vistas/header.php');\n include_once('vistas/universidads.php');\n include_once('vistas/footer.php');\n }", "public function esSabadoNoche();", "function informe_anual()\n{\n\techo \"No se ha creado el informe anual del presente a&ntilde;o\";\n}", "public function test_if_mark_home_page_return_correct_value()\n {\n $this->engine->markHomePage();\n\n $this->assertEquals($this->engine->generateTags(), '<div id=\"retargeting-recommeng-home-page\"></div>');\n }", "public function prihvati(){\n if(!isset($_GET['korisnik']) || !isset($_GET['termin']))\n header(\"Location: ?controller=korisnik&action=index\");\n require_once 'models/zahtev.php';\n require_once 'models/termin.php';\n Zahtev::prihvati($_GET['korisnik'], $_GET['termin']);\n Termin::uvecajBrojIgraca($_GET['termin']);\n header(\"Location: ?controller=korisnik&action=obavestenja\");\n exit();\n }", "function StatenetAgreement() {\n\t\t\t\n\t\t\t$_PAGE = $this->oPagesModel->getPageContent(23);\n\t\t\t$this->oPagesView->showPage($_PAGE[0]);\n\t\t}", "public function hotaru_version($h)\r\n\t{\r\n\t\t$query_vals = array(\r\n\t\t 'api_key' => '',\r\n\t\t 'format' => 'json',\r\n\t\t 'method' => 'hotaru.version.get'\r\n\t\t);\r\n\r\n\t\t$info = $this->sendApiRequest($h, $query_vals, 'http://hotaruplugins.com/index.php?page=api');\r\n\r\n\t\t// save the updated version number to the local db so we can display it on the admin panel until it gets updated.\r\n\t\tif (isset($info['version'])) {\r\n\t\t $sql = \"SELECT miscdata_id FROM \" . TABLE_MISCDATA .\" WHERE miscdata_key = %s\";\r\n\t\t $query = $h->db->get_row($h->db->prepare($sql, 'hotaru_latest_version'));\r\n\t\t \r\n\t\t if ($query) {\r\n\t\t\t// update existing db record\r\n\t\t\t$sql = \"UPDATE \" . TABLE_MISCDATA . \" SET miscdata_value = %s WHERE miscdata_key = %s\";\r\n\t\t\t$h->db->query($h->db->prepare($sql, $info['version'], 'hotaru_latest_version'));\r\n\t\t } else {\t\t\t\r\n\t\t\t$sql = \"INSERT INTO \" . TABLE_MISCDATA . \" (miscdata_value, miscdata_key) VALUES (%s, %s)\";\r\n\t\t\t$h->db->query($h->db->prepare($sql, $info['version'], 'hotaru_latest_version'));\t\r\n\t\t }\t\r\n\t\t return $info['version'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t\t\r\n\t}", "public function volar() {\r\n \r\n echo \"Estoy volando mirame lo alto que estoy: \" . $this->altura ;\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checks to see if screenwriters are filled out, inserts them into table
function insertScreenwriters($link, $movieId, $post) { for ($i = 0; $i < 3; $i++) { $pVar = "screen".$i; if ($post[$pVar] != "") { $queryString = "INSERT INTO SCREENWRITER VALUES (" .$movieId.", '".$post[$pVar]."');"; $link->query($queryString); } } }
[ "private function addStoryToDatabase() {\n // if all input fields have been filled out with something, then we will add the story to database\n if(isset($_REQUEST['writeIdentifier']) && strcmp($_REQUEST['writeIdentifier'], '') !== 0\n && (!isset($_REQUEST['writeTitle']) || strcmp($_REQUEST['writeTitle'], '') !== 0)\n && (!isset($_REQUEST['writeAuthor']) || strcmp($_REQUEST['writeAuthor'], '') !== 0)\n && (!isset($_REQUEST['writeGenres']) || count($_REQUEST['writeGenres']) > 0)\n && (!isset($_REQUEST['writeStory']) || strcmp($_REQUEST['writeStory'], '') !== 0)) {\n // first, the $_REQUEST['writeGenres'] must be converted back to genre IDs instead of genre names\n // so that we can add to the StoryGenres relation\n $genreModel = new GenreModel();\n $result = $genreModel->getGenreIDs($_REQUEST['writeGenres']);\n if($result === false) {\n return false;\n }\n $genreIDs = []; // this array will hold all the genre IDs of the genre titles specified in $_REQUEST['writeGenres']\n foreach($result as $row) {\n array_push($genreIDs, $row['gID']); // push genre IDs in $result to $genreIDs array\n }\n // remove any carriage returns that might be in story content before saving and convert back to newlines instead of %0A\n $_REQUEST['writeStory'] = str_replace(\"\\r\", \"\", $_REQUEST['writeStory']);\n //$writeStory = str_replace(\"%0A\", \"\\n\", $writeStory);\n $writeStoryModel = new WriteStoryModel(urldecode($_REQUEST['writeIdentifier']), urldecode($_REQUEST['writeTitle']),\n urldecode($_REQUEST['writeAuthor']), urldecode($_REQUEST['writeStory']), $genreIDs);\n $writeStoryModel->addStory();\n return true;\n }\n else {\n // to avoid breaking the header, these lines have been commented out\n // if data is not persisted in database even when information is filled out,\n // then uncomment these lines to debug\n //echo(\"Data is not filled out to be submitted to database.\");\n //print_r($_REQUEST);\n return false;\n }\n }", "public function checkForInputs()\n {\n $name = $this->getNameInput();\n $vendor = $this->getVendorInput();\n $dir = $this->getDirectoryInput();\n $author = $this->getAuthorInput();\n $mail = $this->getMailInput();\n $copyright = $this->getCopyrightInput();\n\n $this->table(\n ['Name', 'Vendor', 'Directory', 'Author', 'E-mail', 'Copyright'],\n [\n [$name, $vendor, $dir, $author, $mail, $copyright]\n ]\n );\n }", "function iss_student_insert($sdata) {\n\ttry {\n\t\tif (! isset ( $sdata ['ParentID'] ) || empty ( $sdata ['ParentID'] ) || ($sdata ['ParentID'] == 'new') || ! isset ( $sdata ['RegistrationYear'] ) || empty ( $sdata ['RegistrationYear'] ) || ! isset ( $sdata ['StudentLastName'] ) || empty ( $sdata ['StudentLastName'] ) || ! isset ( $sdata ['StudentFirstName'] ) || empty ( $sdata ['StudentFirstName'] )) {\n\t\t\tiss_write_log ( \"Cannot insert student due to minimum required fields\" );\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tiss_write_log ( \"iss_student_insert\" );\n\t\t$table = iss_get_table_name ( \"student\" );\n\t\tglobal $wpdb;\n\t\t\n\t\tif (! isset ( $sdata ['StudentID'] ) || empty ( $sdata ['StudentID'] ) || ($sdata ['StudentID'] == 'new')) {\n\t\t\t$sdata ['StudentID'] = iss_get_new_studentid ();\n\t\t}\n\t\t$sdata ['StudentStatus'] = 'active';\n\t\t\n\t\t$dsarray = array ();\n\t\t$typearray = array ();\n\t\t$changelog = array ();\n\t\tforeach ( iss_student_table_fields () as $field ) {\n\t\t\tif (isset ( $sdata [$field] )) {\n\t\t\t\t$dsarray [$field] = $sdata [$field];\n\t\t\t\t$typearray [] = iss_field_type ( $field );\n\t\t\t\t$changelog [] = iss_create_changelog ( $sdata ['ParentID'], $sdata ['StudentID'], $field, $sdata [$field] );\n\t\t\t}\n\t\t}\n\t\t$dsarray ['created'] = current_time ( 'mysql' ); // date('d-m-Y H:i:s');\n\t\t$typearray [] = iss_field_type ( 'created' );\n\t\t\n\t\tiss_write_log ( $dsarray );\n\t\t\n\t\t// check again\n\t\t$query = \"SELECT * FROM {$table} WHERE StudentID = {$sdata['StudentID']} LIMIT 1\";\n\t\t$row = $wpdb->get_row ( $query, ARRAY_A );\n\t\tif ($row != NULL) {\n\t\t\tiss_write_log ( 'iss_student_insert skipped' );\n\t\t\tif (iss_registration_insert ( $sdata ) === 1)\n\t\t\t\treturn $sdata ['StudentID'];\n\t\t}\n\t\t\n\t\t$result = $wpdb->insert ( $table, $dsarray, $typearray );\n\t\tif ($result == 1) {\n\t\t\tiss_changelog_insert ( $table, $changelog );\n\t\t\tif (iss_registration_insert ( $sdata ) === 1)\n\t\t\t\treturn $sdata ['StudentID'];\n\t\t}\n\t} catch ( Exception $ex ) {\n\t\tiss_write_log ( \"Error\" . $ex . getMessage () );\n\t}\n\treturn 0;\n}", "public function writerListAction()\n {\n $stats_params = $this->_request->getParams();\n $crtparticipate_obj = new Ep_Participation_CorrectorParticipation();\n $user_obj = new Ep_User_User();\n $writersarray = $crtparticipate_obj->getCrtParticipantWtitersLIst($stats_params);\n if ($writersarray != 'NO') {\n foreach ($writersarray AS $key => $value) {\n $result[] = $user_obj->getAllUsersDetails($writersarray[$key]['user_id']);\n }\n $this->_view->writers = $result;\n } else\n $this->_view->writers = \"NO\";\n $this->_view->writerlistblock = \"yes\";\n $this->_view->render(\"user_userhistory\");\n }", "Function setup_SprintsTable()\n\t{\n\t return query_DB(\"CREATE TABLE `Sprints` (\n\t\t\t\t\t\t\t`ID` INT NOT NULL AUTO_INCREMENT COMMENT 'Sprint ID', \n\t\t\t\t\t\t\t`Name` TEXT NOT NULL COMMENT 'Sprint Name',\n\t\t\t\t\t\t\t`Goal` TEXT NOT NULL COMMENT 'Description of the sprint goal',\n\t\t\t\t\t\t\t`Rules` TEXT NOT NULL COMMENT 'Rules of the sprint',\n\t\t\t\t\t\t\t`Start` date NOT NULL COMMENT 'Sprint Start',\n\t\t\t\t\t\t\t`End` date NOT NULL COMMENT 'Sprint End',\n\t\t\t\t\t\t\t`Code` TEXT NOT NULL COMMENT 'Invitation Code (expires with the Sprint)',\n\t\t\t\t\t\t\tPRIMARY KEY (`ID`)\n\t\t)\n\t\tENGINE = InnoDB\n\t\tCHARSET = utf8\n\t\tCOLLATE utf8_general_ci\n\t\tCOMMENT = 'Contains all accounts'\");\n\t}", "function insert($conn, $table)\n{\n $advisor = sanitizeMySQL($conn, get_post($conn, 'Advisor'));\n $student = sanitizeMySQL($conn, get_post($conn, 'Student'));\n $studentID = sanitizeMySQL($conn, get_post($conn, 'StudentID'));\n $classCode = sanitizeMySQL($conn, get_post($conn, 'ClassCode'));\n if ($advisor == '' || $student == '' || $studentID == '' || $classCode == '') // If any are empty\n echo \"Failed to insert!<br>Blank Fields!\";\n else { // We don't want empty rows in table and we don't want to sanitize empty data\n $stmt = $conn->prepare(\"INSERT INTO {$table} VALUES(?,?,?,?)\");\n $stmt->bind_param('ssss', $advisor, $student, $studentID, $classCode);\n $stmt->execute();\n if ($stmt->affected_rows == 1)\n echo \"Record successfully added!\";\n else\n echo \"Failed to insert!\";\n $stmt->close();\n }\n}", "public function write()\n {\n if ($this->_libWriteboardId === null) {\n // Creating new writeboard\n require_once 'App/Db/Table/Writeboard.php';\n $table = new App_Db_Table_Writeboard();\n $insertId = $table->insert(array(\n 'owner_description' => $this->_ownerDescription\n ));\n $this->setLibWriteboardId($insertId);\n } else if ($this->_changed) {\n // Update writeboard\n require_once 'App/Db/Table/Writeboard.php';\n $table = new App_Db_Table_Writeboard();\n $table->update(array('owner_description' => $this->_ownerDescription),\n $table->getAdapter()->quoteInto('lib_writeboard_id = ?', $this->_libWriteboardId));\n }\n }", "public static function createTableIfNotExistsSubmissions()\n {\n $db = JFactory::getDBO();\n $db->setQuery(\"CREATE TABLE IF NOT EXISTS `#__jsn_uniform_submissions` (\n\t\t\t\t\t `submission_id` INT UNSIGNED NOT NULL AUTO_INCREMENT ,\n\t\t\t\t\t `form_id` INT UNSIGNED NOT NULL ,\n\t\t\t\t\t `user_id` INT UNSIGNED NULL ,\n\t\t\t\t\t `submission_ip` VARCHAR(40) NOT NULL ,\n\t\t\t\t\t `submission_country` VARCHAR(45) NOT NULL ,\n\t\t\t\t\t `submission_country_code` VARCHAR(4) NOT NULL ,\n\t\t\t\t\t `submission_browser` VARCHAR(45) NOT NULL ,\n\t\t\t\t\t `submission_browser_version` VARCHAR(20) NOT NULL ,\n\t\t\t\t\t `submission_browser_agent` VARCHAR(255) NOT NULL ,\n\t\t\t\t\t `submission_os` VARCHAR(45) NOT NULL ,\n\t\t\t\t\t `submission_created_by` INT UNSIGNED NOT NULL COMMENT '0 = Guest' ,\n\t\t\t\t\t `submission_created_at` DATETIME NOT NULL ,\n\t\t\t\t\t `submission_state` TINYINT(1) UNSIGNED NOT NULL COMMENT '-1 = Trashed; 0 = Unpublish; 1 = Published' ,\n\t\t\t\t\t PRIMARY KEY (`submission_id`) ) DEFAULT CHARSET=utf8;\"\n );\n $db->execute();\n }", "function sf_build_memberships_table()\n{\n\tglobal $wpdb;\n\n\t$users = $wpdb->get_results(\"SELECT user_id, usergroups FROM \".SFMEMBERS);\n\tif ($users)\n\t{\n\t\tforeach ($users as $user)\n\t\t{\n\t\t\t$memberships = maybe_unserialize($user->usergroups);\n\t\t\tif ($memberships)\n\t\t\t{\n\t\t\t\tfor ($x=0; $x<count($memberships); $x++)\n\t\t\t\t{\n\t\t\t\t\t$sql =\"INSERT INTO \".SFMEMBERSHIPS.\" (user_id, usergroup_id) \";\n\t\t\t\t\t$sql.=\"VALUES ('\".$user->user_id.\"', '\".$memberships[$x].\"');\";\n\t\t\t\t\t$wpdb->query($sql);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function InsertUsersTable($ApplicantName, $email, $recipient, $cc, $SSN, $Street,\n\t$PropertyCity, $PropertyState, $PropertyZipcode)\n{\n\tglobal $ApplicantFirstName;\n\tglobal $ApplicantLastName;\n\n\t$Host=\"localhost\";\n\t$User=\"lightnin_Tony\";\n\t$Password=\"ipowerwe\";\n\t$DBname=\"lightnin_LoanApps\";\n\t$TableName=\"Users\";\n\n\t/*\tFirst connect to the MySQL DBMS on this server */\n\n\t$Link=mysql_connect ($Host, $User, $Password) or die ('I cannot connect to the DBMS because: '.mysql_error());\n\t$Query = \"SELECT * from $TableName where (Password=$SSN)\"; // see if this SSN already exists in database\n\n\t//\tReturns a positive MySQL result resource to the query result, or FALSE on error.\n\n\t$Found = mysql_db_query ($DBname, $Query, $Link); // execute the actual DBMS query\n\t//echo mysql_errno() . \": \" . mysql_error() . $Found . \"\\n\";\n\n\tif (mysql_errno() > 0)\t// pass error information\n\t{\n\t\twhile($Row = mysql_fetch_array($Found))\n\t\t{\n\t\t\tprint (\"Found SSN=$Row[SSN]<br>\\n\");\n\t\t}\n\n\t\tmysql_close($Link);\n\t\tprint (\"Error in InsertUsersTable() at line at line \".__LINE__.\"<br>\");\n\t\tprint (\"ApplicantName $ApplicantName<br>\");\n\t\tprint (\"Duplicate SSN ($SSN) was found<br>\");\n\t\tprint (\"Sending e-mail about error<br>\");\n\n\t\t//MailUsersTableError(mysql_errno(), mysql_error(), $ApplicantName, $email, $recipient, $cc, $SSN);\t// pass error information\n\t\treturn(0);\n\t}\n\telse\n\t{ \t//Now do the inserts\n\n\t\t$ReportDate= date (\"y/m/d\");\n\n\t\t$User = substr($ApplicantFirstName, 0, 1).$ApplicantLastName; //User is 1st initial + last name\n\t\t$Query = \"INSERT into $TableName values ('$ApplicantName', '$User', '$SSN', 'User')\";\n\n\t\t//\tprint(\"Query is: $Query<br>\\n\");\n\n\t\tmysql_db_query($DBname, $Query, $Link); // execute the actual DBMS insert request\n\n\t\t/* mysql_query() returns TRUE on success and FALSE on failure */\n\n\t\t//\tNote: When using UPDATE, MySQL will not update columns where the new\n\t\t//\tvalue is the same as the old value. This creates the possiblity that\n\t\t//\tclass=function>mysql_affected_rows() may not actually equal the number of\n\t\t//\trows matched, only the number of rows that were literally affected by the query.\n\n\t\t//\tprintf (\"Insert to WorkingStatusInfoTable affected %d rows<br>\\n\", mysql_affected_rows());\n\n\t\tif (mysql_affected_rows() < 1)\n\t\t{\n\t\t\t//MailUsersTableError(mysql_errno(), mysql_error(), $ApplicantName, $email, $recipient, $cc, $SSN);\t// pass error information\n\t\t\treturn(0);\n\t\t}\n\n\t\tmysql_close($Link);\n\t\t// die(\"<br>At line \".__LINE__.\" Stopping for this test<br>\\n\");\n\t\treturn(1);\n\t}\n}", "function FillDraftTable($leagueName, $leagueYear, $numberofTeams, $rosterSize)\n{\n $retval = true;\n\n $tableName = CreateTableName(DRAFT_TABLE_NAME, $leagueName, $leagueYear);\n $number = 1;\n for ($round = 1; $round < ($rosterSize + 1); $round++)\n {\n for($teamNumber = 1; $teamNumber < ($numberofTeams + 1); $teamNumber++)\n {\n $query = \"INSERT INTO $tableName (Round, PickNumber, FantasyTeamNumber) VALUES ('$round', '$number', '$teamNumber')\";\n mysql_query($query);\n $number++;\n }\n }\n\n return $retval;\n}", "function inspiry_prepare_save_search_table() {\n\n\t\tglobal $wpdb;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\n\t\t// sql query to create database table.\n\t\t$table_name = $wpdb->prefix . 'realhomes_saved_searches';\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t$sql_query = \"CREATE TABLE $table_name (\n\t\t\t\t\t\t\tid mediumint(9) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t\t\tuser_id mediumint(9) NOT NULL,\n\t\t\t\t\t\t\tsearch_wp_query_args longtext NOT NULL,\n\t\t\t\t\t\t\tsearch_query_str longtext DEFAULT '' NOT NULL,\n\t\t\t\t\t\t\ttime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,\n\t\t\t\t\t\t\tUNIQUE KEY id (id)\n\t\t\t\t\t\t) $charset_collate;\";\n\n\t\trequire_once ABSPATH . 'wp-admin/includes/upgrade.php';\n\t\tdbDelta( $sql_query );\n\t}", "function addWishlistMentor($username) {\n\t\tglobal $_USER;\n\t\t$dbQueryWishlist = sprintf(\"INSERT INTO Wishlist (mentee, mentor) VALUES ('%s', '%s')\", $_USER['uid'], $username);\n\t\t$result = getDBRegInserted($dbQueryWishlist);\n\t\techo \"added\";\n\t}", "protected function checkTweets() {\n foreach($this->tweets as $tweet) {\n $return = $this->checkTID($tweet['tid']);\n \n if(empty($return)) {\n $this->insert($tweet);\n }\n } \n }", "private function copyTables(){\n $errorText = \"\";\n $arrayList = array(\"metadata\",\"forms\",\"rooms\",\"teachers\",\"timetables\",\"subjects\",\n \"schoolyear\",\"ttforms\",\"ttteachers\",\"ttsubjects\",\"ttrooms\");\n for($i = 0;$i<count($arrayList);$i++){\n $tableName = $arrayList[$i];\n if(!$this->isEmptyTable($tableName,$this->dbTMP)){\n if($this->truncateTable($this->db,$tableName)){\n $sql = \"INSERT INTO \".$tableName.\" SELECT * FROM webschedulertmp.\".$tableName;\n $result = $this->db->query($sql);\n }else{\n $errorText = $errorText.\"\\nDB-Error: truncate in DB failed (\".$arrayList[$i].\")\";\n }\n }else{\n $errorText = $errorText.\"\\nDB-Error: empty table in DB (\".$arrayList[$i].\")\";\n }\n }\n\n //truncate tmpDatabase\n if(!$this->truncateTable($this->dbTMP)){\n array_push($this->error,\"0004\");\n }\n\t}", "function insertContributor($workId, $role, $name, $optionalContributor) {\n global $roleProcessed;\n $insertContributorString = f00(\"INSERT INTO workContributors (work, optionalContributor, role, name, lastModificationDate, lastModifiedBy) \"\n . \"VALUES (\" . $workId . \", \" . $optionalContributor . \", \" . quote($role) . \", \" . quote($name) . \", NOW(), \" . $_SESSION['submitterId'] . \")\");\ndebugLogLineQuery($insertContributorString);\n $result = mysql_query($insertContributorString); \ndebugLogLine(\"Insert Query Finished -- result = \" . $result); \ndebugLogQuery($result, $insertContributorString);\n if ($result) $roleProcessed[$row['role']] = true;\n }", "public function save_user_grid()\n {\n //get the fas for that qual\n //save the values. \n $studentsQuals = get_role_quals($this->studentID, 'student', '', AlevelQualification::FAMILYID);\n if($studentsQuals)\n {\n foreach($studentsQuals AS $qual)\n {\n $qualification = Qualification::get_qualification_class_id($qual->id);\n //load up the students projects\n $projects = $qualification->get_projects();\n if($projects)\n {\n foreach($projects AS $project)\n {\n $project->set_student($this->studentID);\n $project->save_student($qual->id);\n }\n }\n }\n }\n }", "private function validateInsert() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "function site_header()\n{\n\tlist($dbc,$error) = connect_to_database();\n\t$success = false;\n\t$Sitename=$_POST[\"title\"];\n\t$Subtitle=$_POST[\"subtitle\"];\n\t$Subtitle_users=$_POST[\"subtitle_users\"];\n\tif ($dbc)\n\t{\n\t\t$query = \"INSERT into site_header (Sitename,Subtitle,Subtitle_users) values('$Sitename','$Subtitle','$Subtitle_users')\";\n\t\t$result= mysqli_query($dbc,$query);\n\t\tif (!$result) {\n die('Data couldnt be inserted ' . mysql_error());\n }\n\t\telse\n\t\techo \"Data has been inserted successfully\";\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
For a given booking ID, get it's linked order customer ID if set.
public static function get_booking_customer_id( $booking_id ) { return absint( get_post_meta( $booking_id, '_booking_customer_id', true ) ); }
[ "public function getBookingId() {\n return $this->bookingId;\n }", "public function getBookingId() {\n return $this->get(self::BOOKINGID);\n }", "public static function get_booking_order_item_id( $booking_id ) {\n\t\treturn absint( get_post_meta( $booking_id, '_booking_order_item_id', true ) );\n\t}", "public function getCustomerReference()\n {\n if (isset($this->data['object']) && 'customer' === $this->data['object']) {\n return $this->data['id'];\n }\n\n if (isset($this->data['object']) && ('payment_method' === $this->data['object'] || 'payment_intent' === $this->data['object'])) {\n if (!empty($this->data['customer'])) {\n return $this->data['customer'];\n }\n }\n\n return null;\n }", "function getCustomerIDfromOrder($orderID)\n {\n $customerID = null;\n try\n {\n $stmt = $this->db->prepare(\"SELECT CustomerID\n FROM OrderTable\n WHERE OrderID=:orderID\");\n $stmt->bindParam(':orderID', $orderID);\n $stmt->execute();\n $id = $stmt->fetch(PDO::FETCH_ASSOC);\n if ($stmt->rowCount() > 0)\n {\n $customerID = $id['CustomerID'];\n return $customerID;\n }\n else\n {\n return false;\n }\n }\n\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }", "public function getCustomerReference()\r\n {\r\n return $this->data->customer->id;\r\n }", "private function GetBlueCardIDs($officeID, $custdata)\n\t{\n\t\t//Get CustomerID\n\t\tif(isset($custdata->Customer->qbid) && empty($custdata->Customer->cust_id))\n\t\t{\n\t\t\t//If the record exists AND cust_id had not been assigned then assign the retrieved cust_id\n\t\t\tif ($data = self::GetCustomerIDwithQBID($officeID, $custdata->Customer->qbid))\n\t\t\t{\n\t\t\t\t//when records are recieved from QBs they will not include the cust_id so assign it\n\t\t\t\t$custdata->Customer->cust_id = $data; \n\t\t\t}\n\t\t\tunset($data);\n\t\t}\n\t\t\n\t\t//Get AddressID\n\t\t//AddressID has to be searched for seperate from CustomerID because it is possible for QBs to send a new customer with and existing address\n\t\t//currently this should only return one record but if we start saving billing address in the address table then it could be two\n\t\t//At most we can recieve 1 unique billing and 1 unique shipping address, \n\t\t//If only a billing address is given it is copied into the shipping address by MayQBtoBC() function\n\t\t//Their should be no ServiceQuotes associated with billing address objects; We need to write code to make sure we keep that from happening\n\t\tforeach($custdata->AddressList as $addrs)\n\t\t{ \n\t\t\tif(isset($custdata->Customer->cust_id))\n\t\t\t{ \n\t\t\t\t//If their is no address record yet created in BC then this \"if\" statement will fail \n\t\t\t\tif ($data = self::GetAddressIDwithBCID($custdata->Customer->cust_id))\n\t\t\t\t{\t\n\t\t\t\t\t//when records are recieved from QBs they will not include the address_id so assign it\n\t\t\t\t\t$addrs->address_id = $data; \n\t\t\t\t}\n\t\t\t} elseif(isset($addrs->adrqbid))//Sometimes an existing address will be sent with a new customer\n\t\t\t{\t\n\t\t\t\t//If their is no address record yet created in BC then this \"if\" statment will fail\n\t\t\t\tif ($data = self::GetAddressIDwithQBID($officeID, $addrs->adrqbid))\n\t\t\t\t{\n\t\t\t\t\t//when records are recieved from QBs they will not include the address_id so assign it\n\t\t\t\t\t$addrs->address_id = $data; \n\t\t\t\t} \t\n\t\t\t}\n\t\t\tunset($data);\n\t\t\n\t\t//REMOVE THIS CODE IS EVERYTHING IS WORKING PROPERLY\n\t\t\tif(isset($addrs->adrqbid))\n\t\t\t{\t\n\t\t\t\t//If their is no address record yet created in BC then this \"if\" statment will fail\n\t\t\t\tif ($data = self::GetAddressIDwithQBID($officeID, $addrs->adrqbid))\n\t\t\t\t{\n\t\t\t\t\t//At most we can recieve 1 unique billing and 1 unique shipping address, \n\t\t\t\t\t//If only a billing address is given it is copied into the shipping address by MayQBtoBC() function\n\t\t\t\t\t//Their should be no ServiceQuotes associated with billing address objects; We need to write code to make sure we keep that from happening\n\t\t\t\t\t\n\t\t\t\t\t//when records are recieved from QBs they will not include the address_id so assign it\n\t\t\t\t\t$addrs->address_id = $data; \n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t//This Else is to handle a scenario in which an adrqbid exists but there is no matching address record in BC; this will occur when\n\t\t\t\t//an UPDATE is made to use the Billing addressID as the Shipping addressID i.e. when the QBs user checks the \"Same As Billing\" box for shipping in QBs\n\t\t\t\t//after the record has already been initally created. \n\t\t\t\t\n\t\t\t\t//Since an Appointment record already exists linking the Customer and Address data then we are going to Update the existing\n\t\t\t\t//address record information, including adrqbid, and keep the already existing address_ID.\n\t\t\t\t\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//create a new record in Address table with $custdata billing address information\n\t\t\t\t\tAddress::insert($addrs->toArray());\n\t\t\t\t\t//assign the newly created BC addressID to the $addrs object \n\t\t\t\t\t$addrs->address_id = self::GetAddressIDwithQBID($officeID, $addrs->adrqbid);\n\t\t\t\t\t\n\t\t\t\t\t//NOTE: Test to make sure Appointment has the newly created Address ID from billing\n\t\t\t\t\t//Also, what happens when they switch back to a seperate shipping address\n\t\t\t\t}\t\n\t\t\t\tunset($data);\n\t\t\t\t\n\t\t\t} elseif(isset($custdata->Customer->cust_id)) \n\t\t\t{ \n\t\t\t\t//We can't just use this else statment irregardless of the if part because sometimes an existing address will be sent with a new customer\n\t\t\t //If their is no address record yet created in BC then this \"if\" statment will fail\n\t\t\t\tif ($data = self::GetAddressIDwithBCID($custdata->Customer->cust_id))\n\t\t\t\t{\t\n\t\t\t\t\t//when records are recieved from QBs they will not include the address_id so assign it\n\t\t\t\t\t$addrs->address_id = $data; \n\t\t\t\t}\n\t\t\t\tunset($data);\n\t\t\t}\n\t\t\t\n\t\t\t//Do Not match Billing addressID with the customerID for purposes of updating the ServiceQuote\n\t\t\tif(($addrs->adrisbilling == 0) && isset($addrs->address_id)) \n\t\t\t{\n\t\t\t\t//If the addressID did not exist and the address should be created in BC when custdata->Sync is called below\n\t\t\t\t$addrID = $addrs->address_id;\n\t\t\t} \n\t\t}\t\n\t\t\n\t\t//Get AppoitmentID\n\t\t//BlueCard can have multiple appointments for any cust_id and address_id combination\n\t\t//However, QuickBooks will only have one appointment associated with any cust_id and address_id combination: aptQbSync = 1\n\t\t\n\t\t//NOTE: Only one aptqbsync and srvqbsync field in the database record can be set to \"1\" for any given customer and address combo\n\t\t//If I'm syncing from BlueCare to QuickBooks, I will know which set of notes from various ServiceQuotes to sync into QuickBooks because: srvQbSync = 1\n\t\t\n\t\t//Pull the appointment_id that is allowed to sync in order to get the associated ServiceQuote that is allowed to sync\n\t\t//If the customer record exists in BlueCard then an address and appoitment record must also exist and at least one aptQbSync will be set to \"1\"\n\t\tif (isset($custdata->Customer->cust_id) && isset($addrID))//this would be set in the code above\n\t\t{ \n\t\t\t//This datbase call returns appointment_id based on cust_id, address_id, and aptqbsync = 1\n\t\t\tif ($data = self::GetAppointmentIDwithCustIDAddrID($custdata->Customer->cust_id,$addrID))\n\t\t\t{\t\n\t\t\t\tforeach($custdata->AppointmentList as $appt)\n\t\t\t\t{\n\t\t\t\t\t//If there are multiple appointments only pull the one that is allowed to be synced with QBs\n\t\t\t\t\t//If the record exists AND appointment_id had not been assigned \n\t\t\t\t\tif($appt->aptqbsync == 1 && empty($appt->appointment_id))\n\t\t\t\t\t{ \t\t\t\t\t\t\n\t\t\t\t\t\t//when records are recieved from QBs they will not include the appointment_id so assign it \n\t\t\t\t\t\t$appt->appointment_id = $data; \n\t\t\t\t\t\t$apptID = $appt->appointment_id;\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\tunset($data);\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Get ServiceQuoteID\n\t\t//Pull the servicequote_id that is allowed to sync in order to update the record\n\t\t//If the customer record exists in BlueCard then an address and appointment record must also exist and at least one aptQbSync will be set to \"1\"\n\t\t//A ServiceQuote record will exist even if no notes are created in QBs because the validation method in MapQBtoBC will initiate it\n\t\tif (isset($apptID)) { //this would be set in the code above\n\t\t\t//This datbase call returns servicequote_id based on appointment_id and qteqbsync = 1\n\t\t\t\n\t\t\tif ($data = self::GetServiceQuoteIDwithApptID($apptID))\n\t\t\t{ \n\t\t\t\tforeach($custdata->ServiceQuoteList as $srvqte)\n\t\t\t\t{\n\t\t\t\t\t//If there are multiple appointments only pull the one that is allowed to be synced with QBs\n\t\t\t\t\t//If the record exists AND servicequote_id had not been assigned \n\t\t\t\t\tif($srvqte->qteqbsync == 1 && empty($srvqte->servicequote_id))\n\t\t\t\t\t{\n\t\t\t\t\t\t//when records are recieved from QBs they will not include the servicequote_id so assign it \n\t\t\t\t\t\t$srvqte->servicequote_id = $data;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tunset($data);\n\t\t\t}\n\t\t}\n\t\t\n\t\tunset($addrID, $apptID);//this ensures that no Appointment or ServiceQuote are created using an old AddressID or AppointmentID\n\n\t\treturn $custdata;\n\t}", "public function getBookingCommenter()\n {\n if ($this->getBooking()\n && $this->getBooking()->getCustomers()->first()\n ) {\n return $this->getBooking()->getCustomers()->first()->getName();\n }\n }", "function getLastBookingIdByCustomerId($custId) {\n $query = \"SELECT `BookingId` FROM bookings WHERE CustomerId='$custId' ORDER BY BookingId DESC LIMIT 1\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }", "public function getCustomerId()\n {\n return $this->customer_id;\n }", "public static function getBooking($booking_id)\n {\n $bookings = Booking::where('booking_id',$booking_id)->get();\n return $bookings[0];\n }", "public function getBookingReferenceID()\n {\n return $this->bookingReferenceID;\n }", "public function getCustomerId();", "public function getCustomerId(): string\n {\n return $this->customerId;\n }", "private function getCustomerId()\n\t{\n\t\treturn (int)$this->context->cookie->id_customer;\n\t}", "function get_order_influencer( $order_id ) {\n\n\t$order = wc_get_order( $order_id );\n\n\t$data = $order->get_data();\n\n\t$influencer_id = $data['customer_id'];\n\n\treturn $influencer_id;\n}", "public function get_single_booking($booking_id) {\n $this->db->select('*');\n $this->db->from('booking');\n $this->db->where('booking_id', $booking_id);\n $query = $this->db->get();\n return $query->row();\n }", "function getResourceBookingId()\n {\n return is_null($this->_iResourceBookingId) ? NULL : (int) $this->_iResourceBookingId;\n }", "function get_car_rental_booking_id($booking_id,$year){ global $app_version;\n $year = ($year == '') ? $app_version : $year; return 'CR/'.$year.'/'.$booking_id; }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get controller insurance url
public function getControllerUrl() { return Mage::helper('adminhtml')->getUrl('route'); }
[ "abstract public function getControllerUrl();", "public function GetControllerUrl(){\n return $this->BaseUrl . $this->Controllername .'/';\n }", "public function get_url()\n\t{\n\t\treturn $this->get_host().\"/\".$this->get_control().\"/\".$this->get_action();\n\t}", "public function getControllerPath();", "function payment_controller_url()\r\n{\r\n global $app, $payment_controller, $order_status;\r\n if ($payment_controller == 'renew')\r\n return $app->url('/renew.php', array('step' => param('step'), 'id' => param('region_id'), 'email' => @$_REQUEST['email'], 'digest' => @$_REQUEST['digest']));\r\n return $app->url('/get_pixels.php', array('step' => $order_status['step']));\r\n}", "public function getUrl() {\n $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl(); \n $host = $_SERVER['SERVER_NAME'];\n $url = \"http://$host\".\"$baseUrl/accommodation/show/id/{$this->acc_id}\";\n return $url; \n }", "public function get_assessment_current_url();", "public function getProviderRequestUrl();", "public function getControllerAction(): string\n {\n\n $urlParts = $this->getUriParts();\n if (array_key_exists(1, $urlParts) && !empty($urlParts[1])) {\n return $urlParts[1];\n }\n\n return 'index';\n }", "public function urlToController($url);", "public function get_assessment_back_url();", "public function getAjaxControllerUrl(){\n\n return $this->getConfig()->getAjaxControllerUrl();\n\n }", "public function getRedirectUrl();", "public function getRedirectUrl() {\n }", "public function external_url()\n\t{\n\t\tif ($this->_is_internal_redirect())\n\t\t\treturn substr($this->_internal_redirect_location(), 1);\n\t\treturn $this->env['requested_uri'];\n\t}", "public static function get_controller_path() {\n return self::get_configuration_path(\"controllers\");\n }", "public static function stableURL() {\n if (strpos($_SERVER['REQUEST_URI'], 'ontology')) {\n return self::makeURL('ontology', null, null, null, false, -1, false, null);\n } else {\n return self::makeURL(self::get('controller'), self::get('id'), null, null, true, -1, true);\n }\n }", "public function getRedirectUrl() {\n return $this->helper->getTransactionURL($this->getConfigData('environment'));\n }", "public function getIntakesUrl(){\r\n\t\treturn Mage::getUrl('enrollments/intake/index');\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Finds and displays a Transport entity.
public function showAction($id) { $em = $this->getDoctrine()->getManager(); $entity = $em->getRepository('SruCoreBundle:Transport')->find($id); if (!$entity) { throw $this->createNotFoundException('Unable to find Transport entity.'); } $deleteForm = $this->createDeleteForm($id); return $this->render('SruCoreBundle:BackOffice/Transport:show.html.twig', array( 'entity' => $entity, 'delete_form' => $deleteForm->createView(), )); }
[ "public function showAction(Transport $transport)\n {\n $deleteForm = $this->createDeleteForm($transport);\n $user = $this->getUser()->getId();\n return $this->render('transport/show.html.twig', array(\n 'transport' => $transport,\n 'delete_form' => $deleteForm->createView(),\n 'user' => $user,\n ));\n }", "public function show_transport()\n\t{\t\n\t\t$classes = Classes::orderBy('created_at','desc')->paginate(5);\n\t\t$transports = Transport::orderBy('created_at','desc')->paginate(5);\n\t\t$auth = Auth::user();\n\t\t$settings = Settings::find(1);\n\t\treturn view('admin.transports.list')->with(compact(['transports','settings','classes','auth']));\n\t}", "function action_show_entity_detail() {\n $rc = rcmail::get_instance();\n\n /** @var rcmail_output_html $output */\n $output = $rc->output;\n\n $type = $this->getInput(self::INPUT_ENTITY_TYPE, rcube_utils::INPUT_GET);\n\n switch ($type) {\n case self::ENTITY_FILTER:\n $title = $this->gettext('rubik_filter.title_filter_form');\n break;\n case self::ENTITY_VACATION:\n $title = $this->gettext('rubik_filter.title_vacation_form');\n break;\n case self::ENTITY_REPLY:\n $title = $this->gettext('rubik_filter.title_reply_form');\n break;\n default:\n $title = '';\n break;\n }\n\n $output->set_env('rubik_details_title', $title);\n\n $output->send('rubik_filter.rubik_entity_details');\n }", "public function indexAction()\n {\n $entityManager = $this->getDoctrine()->getManager();\n $transports = $entityManager->getRepository(Transport::class)->findAll();\n\n return $this->render('admin/transport/index.html.twig', ['transports' => $transports]);\n }", "public function admin_edit_transport(){\n\t\t\n\t\tif($this->request->isPost()){\n\t\t\t$id = $this->data['id'];\n\t\t\t$name = $this->Transport->findById($id);\n\t\t\t$this->set('transport_name',$name['Transport']['transport_name']);\n\t\t\t$this->set('id',$id);\n\t\t}\n\t}", "public function displayEntityBrowser();", "public function showAction($id)\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $entity = $em->getRepository('InventarioFrontBundle:Terceros')->find($id);\r\n\r\n if (!$entity) {\r\n throw $this->createNotFoundException('Unable to find Terceros entity.');\r\n }\r\n\r\n $deleteForm = $this->createDeleteForm($id);\r\n\r\n return $this->render('InventarioFrontBundle:Terceros:show.html.twig', array(\r\n 'entity' => $entity,\r\n 'delete_form' => $deleteForm->createView(), ));\r\n }", "function simple_entity_view($simple_entity) {\n drupal_set_title(entity_label('simple_entity', $simple_entity));\n return entity_view('simple_entity', array(entity_id('simple_entity', $simple_entity) => $simple_entity), 'full');\n}", "public function showAction(Transfert $transfert)\n {\n $deleteForm = $this->createDeleteForm($transfert);\n\n return $this->render('transfert/show.html.twig', array(\n 'transfert' => $transfert,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MyAppCovoiturageBundle:Trajet')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Trajet entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n \n return $this->render('MyAppCovoiturageBundle:Trajet:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),));\n \n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CorresponsaliaBundle:Estadofondo')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Estadofondo entity.');\n }\n\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CorresponsaliaBundle:Estadofondo:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(), ));\n }", "public function getTenderById()\n {\n $params = fixer::input('request')->get();\n $pager = $this->tenderService->getTenderById($params);\n $this->view->data = $pager;\n $this->display();\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AppBundle:Estudiante')->find($id);\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Estudiante entity.');\n }\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('AppBundle:Estudiante:show.html.twig', array(\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function showAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('BackendBundle:Tour')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el tour solicitado.');\n }\n\n return $this->render('BackendBundle:Tour:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "public function showAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $tournois = $em->getRepository('EntityBundle:Tournoi')->findAll();\n return $this->render('tournoi/show.html.twig', array(\n 'tournois' => $tournois,\n\n ));\n }", "public function showAction($id, $venue = null) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('ArcoVoltaicoImportBundle:Import')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Import entity.');\n }\n\n\n $form = $this->createForm(new ImportType, $entity);\n\n return $this->render('@crud/show.html.twig', array(\n 'entity' => $entity,\n 'title' => 'import',\n 'headtitle' => 'details',\n 'venue' => $venue,\n 'newlink' => true, //false if the entity is dependent of other (ex:offer depends from product)\n 'form' => $form->createView()));\n }", "public function admin_transportList() \r\n\t{\t\r\n\t\t\r\n\t\t$cond=array();\r\n\t\t$this->admin_check_login();\r\n\t\t$this->loadModel('Transport');\r\n\t\t\r\n\t\tif ($this->Access->checkPermission(array(READ_PERMISSION_ID))) \r\n\t\t{\t\r\n\t\t\tif(isset($this->request->data['Transport']))\r\n\t\t\t{\t\t\t\t\t\r\n\t\t\t\t$this->Session->write('TransportSearch',$this->request->data['Transport']);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\t\r\n\t\t\t\t$this->request->data['Transport']=$this->Session->read('TransportSearch');\t\t\r\n\t\t\t}\r\n\t\t\tif(isset($this->request->data['Transport']))\t\t\t\t\r\n\t\t\t{\t\t\t\r\n\t\t\t\tif(isset($this->request->data['Transport']['name']) and !empty($this->request->data['Transport']['name']))\t\t\t\t\r\n\t\t\t\t{\r\n\t\t\t\t\t$cond['Transport.name LIKE']=\"%\".$this->request->data['Transport']['name'].\"%\";\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$conditions = array(\r\n\t\t\t'Transport.id !=' => BOOL_FALSE,\r\n\t\t\t'Transport.is_deleted' => BOOL_FALSE,\r\n\t\t\t'Transport.is_active' => BOOL_TRUE\r\n\t\t);\r\n\t\t\r\n\t\t$conditions=array_merge($conditions,$cond);\r\n\t\t\r\n\t\t$this->Paginator->settings = array(\r\n\t\t\t'Transport' => array(\r\n\t\t\t\t'conditions' => $conditions,\r\n\t\t\t\t'order' => array('Transport.id' => 'DESC'),\r\n\t\t\t\t'limit' => PAGINATION_LIMIT,\r\n\t\t\t\t'recursive' => -1\r\n\t\t));\r\n\t\t$transports = $this->Paginator->paginate('Transport');\r\n\t\t$this->set(compact('transports'));\t\t\r\n\t\t\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->Session->setFlash(\"Unauthorized access\", 'error');\r\n $this->redirect($this->referer());\r\n\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\r\n\t\t\r\n }", "public function entity_viewer()\n\t{\n\t\t$this->load->view('chartex/entity_viewer');\n\t}", "public function actionIndex()\n {\n $searchModel = new TransportSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->pagination->pageSize=200;\n\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The dirty table collector being temporary, ensure that all tables are clean when starting the suite
public function cleanAllTables(): void { if ($this->isInTempMode()) { $this->markAllTablesAsDirty(); } }
[ "public function dropDirtyTableCollector()\n {\n $dirtyTable = self::DIRTY_TABLE_COLLECTOR;\n $this->getConnection()->execute(\"DROP TABLE IF EXISTS {$dirtyTable}\");\n }", "private function setupAndCleanTempTable()\n {\n // Ensure the table exists\n $this->em->getConnection()->exec('CREATE TABLE IF NOT EXISTS mtotaccttmp LIKE mtotacct');\n\n // Truncate the table\n $this->em->getConnection()->exec('TRUNCATE mtotaccttmp');\n }", "public function createDirtyTableCollector(): void\n {\n $temporary = $this->isInTempMode() ? 'TEMPORARY' : '';\n $dirtyTable = self::DIRTY_TABLE_COLLECTOR;\n\n $this->getConnection()->execute(\"\n CREATE {$temporary} TABLE IF NOT EXISTS {$dirtyTable} (\n table_name VARCHAR(128) PRIMARY KEY\n );\n \");\n }", "private function purgePreparedTables()\n {\n $connection = $this->getConnectionPool()\n ->getConnectionByName(ConnectionPool::DEFAULT_CONNECTION_NAME);\n\n foreach ($this->tables as $table) {\n $diff = new TableDiff(\n $table,\n [],\n [],\n [\n 'is_dummy_record' => new Column('is_dummy_record', Type::getType(Type::SMALLINT))\n ]\n );\n $connection->getSchemaManager()->alterTable($diff);\n }\n }", "public function collectDirtyTables(): void\n {\n foreach ($this->getFixtureManager()->getActiveConnections() as $connectionName) {\n $this->dirtyTables[$connectionName] = SnifferRegistry::get($connectionName)->getDirtyTables();\n }\n }", "abstract public function truncateDirtyTables(): void;", "protected static function preClearTables()\n {\n }", "private function cleanCoreTables() {\n\n $core_tables = [\n 'glpi_datacenters',\n 'glpi_dcrooms',\n 'glpi_items_racks',\n 'glpi_pdus',\n 'glpi_racks',\n 'glpi_rackmodels',\n 'glpi_racktypes',\n 'glpi_passivedcequipments',\n 'glpi_passivedcequipmenttypes',\n 'glpi_passivedcequipmentmodels',\n ];\n\n foreach ($core_tables as $table) {\n $result = $this->db->query('TRUNCATE ' . DB::quoteName($table));\n\n if (!$result) {\n throw new RuntimeException(\n sprintf('Unable to truncate table \"%s\"', $table)\n );\n }\n }\n }", "function cleanImportTables(){\n\t\t\n\t\t$tables = $this->getImportTables();\n\t\t$app =& Dataface_Application::getInstance();\n\t\t$garbageLifetime = $app->_conf['garbage_collector_threshold'];\n\t\tforeach ($tables as $table){\n\t\t\t$matches =array();\n\t\t\tif ( preg_match('/^'.$this->tablename.'__import_(\\d+)_(\\d)$/', $table, $matches) ){\n\t\t\t\tif ( time() - intval($matches[1]) > intval($garbageLifetime) ){\n\t\t\t\t\t$res = mysql_query(\"DROP TABLE `$table`\", $this->db);\n\t\t\t\t\tif ( !$res ){\n\t\t\t\t\t\ttrigger_error(\"Problem occurred attemtping to clean up old import table '$table'. MySQL returned an error: \".mysql_error($this->db).\"\\n\".Dataface_Error::printStackTrace(), E_USER_ERROR);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public final function tearDown() {\n\t\t$this->expungeTables();\n\t}", "public function cleanDatabase()\n {\n foreach ($this->getTemplates() as $template) {\n $template->cleanDatabase();\n }\n }", "public function deleteTemporaryTable() {\r\n $this->FEid = $this->Band = $this->dataSetGroup = 0;\r\n $qdel = \"DROP TEMPORARY TABLE IF EXISTS TEMP_IFSpectrum;\";\r\n $this->run_query($qdel);\r\n }", "function reset_data() {\n global $ft;\n $tables = array('dupeids', 'summary', 'stats', 'killers', 'killitems', 'favorites', 'killcache');\n foreach ($tables as $t) {\n $ft->dbh->_do_query(\"DELETE FROM tbl:$t\");\n }\n }", "public function evictTables()\n {\n $this->tables = array();\n $this->exported = array();\n }", "public function clean(): void\n {\n $this->truncateJournalTable();\n $this->output(\"<success>Table {$this->internalTable} truncated</success>\");\n }", "protected function _cleanupDataAfterTestBasketCalculationWithSpecUseCaseDescribedAbove()\n {\n $this->cleanUpTable( 'oxselectlist' );\n $this->cleanUpTable( 'oxobject2selectlist' );\n $this->cleanUpTable( 'oxdiscount' );\n $this->cleanUpTable( 'oxobject2discount' );\n $this->cleanUpTable( 'oxobject2category' );\n }", "public function clean_tables()\n\t{\n\t\t$this->db->query('SET FOREIGN_KEY_CHECKS = 0;');\n\t\t$this->db->query('truncate table cm_users_courses');\n\t\t$this->db->query('truncate table cm_users_departments');\n\t\t$this->db->query('truncate table cm_users_majors');\n\t\t$this->db->query('truncate table cm_users_collect_courschemas');\n\t\t$this->db->query('truncate table cm_courschemas');\n\t\t$this->db->query('truncate table cm_majors');\n\t\t$this->db->query('truncate table cm_prerequisites');\n\t\t$this->db->query('truncate table cm_courses');\n\t\t$this->db->query('truncate table cm_departments');\n\t\t$this->db->query('SET FOREIGN_KEY_CHECKS = 1;');\n\t}", "public function cleanOldProfilingData()\n {\n $this->init();\n // reset the profile level\n $this->db->setProfilingLevel(0);\n // clear the system.profile capped collection\n $this->collection->drop();\n error_log(\"Cleared historic data in \" . self::DB . \":\" . self::SYSTEM);\n }", "abstract public function markAllTablesAsDirty(): void;" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get data mapper Lazy loads Directory_Model_DirectoryCategoryMapper instance if no mapper registered.
public function getMapper() { if (null === $this->_mapper) { $this->setMapper(new Application_Model_CategoryMapper()); } return $this->_mapper; }
[ "private function getCategoryMapper()\n {\n if(null === $this->categoryMapper) {\n $this->categoryMapper = new Model_Mapper_Category();\n }\n return $this->categoryMapper;\n }", "private function getFilmCategoryMapper()\r\n {\r\n if (NULL === $this->filmCategoryMapper) {\r\n $this->filmCategoryMapper = new Model_Mapper_FilmCategory;\r\n }\r\n return $this->filmCategoryMapper;\r\n }", "public function getMapper() {\n if (null === $this->_mapper) {\n $this->setMapper(new Application_Model_DoctorMapper());\n }\n return $this->_mapper;\n }", "public function getMapper(){ \n $mapper = new Ca_Model_Cidade_Mapper();\n return $mapper;\n }", "function GetMapper()\r\n\t\t{\r\n\t\t\tif (empty($this->mapper))\r\n\t\t\t{\r\n\t\t\t\t$object_name = $this->GetPlural(get_class($this));\r\n\t\t\t\t$object_name = ucwords($object_name);\r\n\t\t\t\t\r\n\t\t\t\t$this->mapper = new $object_name();\r\n\t\t\t}\r\n\t\t\treturn $this->mapper;\r\n\t\t}", "public function getMapper ()\n {\n if (null === $this->_mapper) {\n if ('development' == APPLICATION_ENV)\n $this->setMapper(new Default_Model_Mapper_CommentDbMapper());\n else\n $this->setMapper(new Default_Model_Mapper_CommentRestMapper());\n }\n return $this->_mapper;\n }", "private function _getContactMapper()\n {\n if (is_null($this->_mapper)) {\n $this->_mapper = new ContactsMapper($this->db());\n }\n\n return $this->_mapper;\n }", "protected function getMapper()\n {\n if (!$this->mapper) {\n $api = $this->getApi();\n if (!$api)\n return false;\n\n $this->mapper = new ProductionsMapper($api);\n }\n\n return $this->mapper;\n }", "public function getMapper()\n \t{ \n \t if (null === $this->_mapper) {\n \t \tif (isset($this->_mapperClass)) {\n \t \t\t$mapper_class = $this->_mapperClass;\n \t \t} else {\n\t \t\t\t\t$mapper_class = get_class($this).\"Mapper\";\n \t }\n \t $this->setMapper(new $mapper_class());\n \t }\n \t return $this->_mapper;\n \t}", "private function _getMapper()\n {\n if (is_null($this->_mapper)) {\n $this->_mapper = new TagsMapper($this->db());\n }\n\n return $this->_mapper;\n }", "public function getMapper()\n {\n if (null === $this->_mapper) {\n $this->setMapper(new Admin_Model_EmailCampaignMapper());\n }\n return $this->_mapper;\n }", "public function getMapper(){ \n $mapper = new Financeiro_Model_Banco_Mapper();\n return $mapper;\n }", "private function _getMapper()\n {\n if (is_null($this->_mapper)) {\n $this->_mapper = new ContentMapper(\n $this->db(),\n $this->app()->getTmpDir().DS.\"cms\"\n );\n }\n\n return $this->_mapper;\n }", "public function getMapper()\n\t{\n\t\treturn parent::getMapper('Basico_Model_CategoriaAssocChaveEstrangeiraMapper');\n\t}", "public function categoryMappingData() {\n\n\t\t//GET PROFILEMAPS TABLE NAME\n $tableProfilemapsName = Engine_Api::_()->getDbtable('profilemaps', 'document')->info('name');\n\n\t\t//GET CATEGORY TABLE NAME\n $tableCategoryName = $this->info('name');\n\n\t\t//GET FIELD OPTION TABLE NAME\n\t\t$tableFieldOptionsName = Engine_Api::_()->getDbtable('options', 'document')->info('name');\n\n\t\t//MAKE QUERY\n $select = $this->select()\n ->setIntegrityCheck(false)\n ->from($tableCategoryName, array('category_id', 'category_name'))\n ->joinLeft($tableProfilemapsName, \"$tableCategoryName.category_id = $tableProfilemapsName.category_id\", array('profile_type', 'profilemap_id'))\n ->joinLeft($tableFieldOptionsName, \"$tableFieldOptionsName.option_id = $tableProfilemapsName.profile_type\", array('label'))\n ->where($tableCategoryName . \".cat_dependency = ?\", 0);\n\n\t\t//RETURN DATA\n return Zend_Paginator::factory($select);\n\t}", "public function getMapper(): Mapper\n {\n return Manager::getMapper($this->class);\n }", "private static function mapper() {\n static $mapper = null;\n if (!$mapper) {\n $mapper = new MongoMapper(APP_DATABASE, 'election');\n }\n return $mapper;\n }", "public function getCompanyMapper() \n\t{\n\t\tif(!$this->_companyMapper)\n\t\t\t$this->_companyMapper = GTW_Model_Company_Mapper::getInstance();\n\n\t\treturn $this->_companyMapper;\n\t}", "public function getMapper(){ \n $mapper = new Wf_Model_WfProcesso_Mapper();\n return $mapper;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: checkAdvSort Check the advSortString
function checkAdvSort($sortBy, $sortDir = 'asc') { $advSort = array('pub_date', 'unpub_date', "editedon", "deletedon", "publishedon"); $type = $this->getDocVarType($sortBy); switch ($type) { case 'tv:prefix': $sortBy = substr($sortBy, 2); $this->advSort = true; break; case 'tv': $this->advSort = true; break; case 'db': if (in_array($sortBy, $advSort)) { $this->advSort = true; $this->customReset[] = $sortBy; } else { $this->sqlOrderBy[] = 'sc.' . $sortBy . ' ' . $sortDir; } break; } return $sortBy; }
[ "private function isValidOrderBy($arr)\n\t{\n\t\tif(!is_array($arr)) return false;\n\t\t\n\t\tif(empty($arr) || count($arr) <>2) return false;\t\n\t\t\t\n\t\t$allowedSortings = array('asc','desc');\t\n\t\t\t\n\t\tif(!is_string($arr[0])) return false;\n\t\t\n\t\tif(!in_array(strtolower($arr[1]),$allowedSortings)) return false;\n\t\t\n\t\treturn true;\n\t}", "function ft_is_sort($tab)\n{\n\t$i = 0;\n\twhile ($tab[$i] && $tab[$i + 1])\n\t{\n\t\tif (strcmp($tab[$i], $tab[$i + 1]) > 0)\n\t\t\treturn (false);\n\t\t$i++;\n\t}\n\treturn (true);\n}", "protected function validateSorts(): void\n {\n $sorts = $this->getArrayValue($this->joryArray, ['srt', 'sorts']);\n\n // No sorts set, that's ok. return.\n if (! $sorts) {\n return;\n }\n\n // It's a string, that's ok because it will be converted to an single-item-array by the parser later.\n if (is_string($sorts)) {\n return;\n }\n\n if (! is_array($sorts)) {\n throw new JoryException('The sorts parameter should be an array or string. (Location: '.$this->address.'sorts)');\n }\n\n foreach ($sorts as $sort) {\n if (! is_string($sort)) {\n throw new JoryException('A sort item must be a string. (Location: '.$this->address.'sorts)');\n }\n }\n }", "public function hasSortData();", "public function sortArraysByKeyCheckIfSortingIsCorrectDataProvider() {}", "function isStringSorted($str) {\n \tfor ($i = 0; $i < strlen($str) - 1; $i = $i + 1) {\n \t\tif ($str[$i] > $str[$i+1]) {\n \t\t\treturn false;\n \t\t}\n \t}\n \treturn true;\n}", "function wc_ascii_uasort_comparison($a, $b)\n {\n }", "public function compare()\n {\n $first = null;\n foreach (func_get_args() as $str)\n {\n if (empty($first))\n $first = $this->sortCharacters($str);\n elseif ($this->sortCharacters($str) != $first)\n return false;\n }\n return true;\n }", "public function natcasesort() { }", "public function sort_dir() {\n\t\t$s = urldecode($this->get('sort'));\n\t\t$s = str_replace('%7C', '|', $s);\n\n\t\tif( !$s ) {\n\t\t\treturn false;\n\t\t}\n\t\tif( strpos($s, '|') === false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$s = explode('|', $s);\n\t\tif( $s[1] == 'asc' || $s[1] == 'desc' ) {\n\t\t\treturn $s[1];\n\t\t}\n\n\t\treturn false;\n\t}", "function almostSorted($arr) {\n $descIndexes = getDescIndexes($arr);\n if(empty($descIndexes))\n {\n return \"yes\\n\";\n }\n $swap = checkSwap($descIndexes, $arr);\n if($swap)\n {\n return \"yes\\nswap \".($swap[0] + 1).\" \".($swap[1] + 1).\"\\n\";\n }\n\n $reverse = checkReverse($descIndexes, $arr);\n if($reverse)\n {\n return \"yes\\nreverse \".($reverse[0] + 1).\" \".($reverse[1] + 1).\"\\n\";\n }\n\n return \"no\\n\";\n}", "function convert_sort($autn_param_sort) {\n\t$dnsa_sort = \"\";\n\tif ($autn_param_sort==\"date\") {\n\t\t$dnsa_sort = \"date-desc\";\n\t} elseif ($autn_param_sort==\"dociddecreasing\") {\n\t\t$dnsa_sort = \"date-desc\";\n\t} elseif ($autn_param_sort==\"relevance\") {\n\t\t$dnsa_sort = \"relevance\";\n\t} else {\n\t\t$dnsa_sort = \"relevance\";\n\t}\n\treturn $dnsa_sort;\n}", "public function natcasesort () {}", "public function natcasesort() {}", "function isStringSorted($str)\n{\n for ($i = 0; $i < strlen($str) - 1; $i ++) {\n if (strcmp($str{$i}, $str{$i + 1}) > 0)\n return false;\n }\n return true; // bogus return\n}", "private function verify_input()\r\n\t{\r\n\t\t$inputted_order_by = $this->f_order_by;\r\n\t\t$this->f_order_by = $this->m_order_by_options[self::$DEFAULT_ORDER_BY_OPTION_INX][1];\r\n\t\tforeach($this->m_order_by_options as $cur_order_by_option)\r\n\t\t{\r\n\t\t\tif($inputted_order_by == $cur_order_by_option[1])\r\n\t\t\t{\r\n\t\t\t\t$this->f_order_by = $cur_order_by_option[1];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//verify/force the asc/desc is the asc or desc keyword, not a command like \"drop table;\"\r\n\t\t$inputted_asc_or_desc = strtolower($this->f_asc_or_desc);\r\n\t\tif($inputted_asc_or_desc != 'asc' && $inputted_asc_or_desc != 'desc') $this->f_asc_or_desc = self::$DEFAULT_ASC_OR_DESC;\r\n\t}", "public function sort()\n {\n $oStr = getStr();\n uksort($this->_aTags, array($oStr, 'strrcmp'));\n }", "function phraseSort($a, $b)\n{\n if (($a == $b) || (strlen($a[phrase]) == strlen($b[phrase])))\n {\n return 0;\n }\n return (strlen($a[phrase]) > strlen($b[phrase])) ? -1 : 1;\n}", "public function validateSortType($sort_type)\n {\n $sort_type = strtolower($sort_type);\n if (in_array($sort_type, array('asc', 'desc')))\n {\n return $sort_type;\n }\n return 'desc';\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets as costGroupFlat If returned, this is the shipping service group to which the shipping service belongs. Valid values are found in CostGroupFlatCodeType.
public function getCostGroupFlat() { return $this->costGroupFlat; }
[ "public function getGroup1MaxFlatShippingCost()\n {\n return $this->group1MaxFlatShippingCost;\n }", "public function getShippingProfileCategoryGroup()\n {\n return $this->shippingProfileCategoryGroup;\n }", "public function getGroup3MaxFlatShippingCost()\n {\n return $this->group3MaxFlatShippingCost;\n }", "public function getFlatShippingPreferences()\n {\n return $this->flatShippingPreferences;\n }", "protected function getSylius_Form_Type_ChannelBasedShippingCalculator_FlatRateService()\n {\n return $this->services['sylius.form.type.channel_based_shipping_calculator.flat_rate'] = new \\Sylius\\Bundle\\CoreBundle\\Form\\Type\\Shipping\\Calculator\\ChannelBasedFlatRateConfigurationType();\n }", "public function getFlatShippingDiscount()\n {\n return $this->flatShippingDiscount;\n }", "public function getShippingPackage()\n {\n return $this->shippingPackage;\n }", "public function get_shipping_class()\n {\n }", "public function setGroup2MaxFlatShippingCost(\\Nogrod\\eBaySDK\\MerchantData\\AmountType $group2MaxFlatShippingCost)\n {\n $this->group2MaxFlatShippingCost = $group2MaxFlatShippingCost;\n return $this;\n }", "function &shippingGroup( )\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $ret = false;\r\n if ( is_numeric( $this->ShippingGroupID ) and ( $this->ShippingGroupID > 0 ) )\r\n {\r\n $ret = new eZShippingGroup( $this->ShippingGroupID );\r\n }\r\n\r\n return $ret;\r\n }", "protected function getSylius_Form_Type_ShippingCalculator_FlatRateConfigurationService()\n {\n return $this->services['sylius.form.type.shipping_calculator.flat_rate_configuration'] = new \\Sylius\\Bundle\\ShippingBundle\\Form\\Type\\Calculator\\FlatRateConfigurationType(array(0 => 'sylius'));\n }", "public function getCustomerGroup();", "public function getShipping()\n {\n $shipping = $this->shipping->getShipping($this->orderWeight);\n\n return $shipping;\n }", "public function getShippingServiceCost()\n {\n return $this->shippingServiceCost;\n }", "public function getShippingService()\n {\n return $this->shippingService;\n }", "public function getGroupStyle()\n {\n return $this->_groupStyle;\n }", "public function getFreeShipping()\n {\n return $this->freeShipping;\n }", "public function get_class_calculate_shipping() {\r\n\r\n\t\t\treturn $this->calcClass;\r\n\t\t}", "public function getPackingGroup(){\n\t\t\treturn $this->packingGroup;\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get the is agent returning from notification flag
protected function getIsAgentReturningFromNotification($applicationUuId) { if (!isset($_SESSION[self::buildAgentReturningFromNotificationNamespace($applicationUuId)])) { return false; } return $_SESSION[self::buildAgentReturningFromNotificationNamespace($applicationUuId)]; }
[ "public function getGenerateNotification(): bool;", "protected function getSendNotificationFlag()\n {\n return (bool) \\XLite\\Core\\Request::getInstance()->sendNotification;\n }", "public function getInviteStatus();", "public function isNotification() {\n\t\treturn $this->getNotification();\n\t}", "public function isSpecific()\n {\n return (bool) $this->notification;\n }", "public function isAgent()\n {\n return $this->panichd_agent;\n }", "public function is_returned() {\n return $this->returned;\n }", "public function getWaiverreceived()\n\t{\n\t\treturn $this->waiverreceived;\n\t}", "abstract public function getNotificationStatus(Notification $notification);", "public function getIsClaimAddedByAgent()\n {\n return isset($this->IsClaimAddedByAgent) ? $this->IsClaimAddedByAgent : null;\n }", "public function getStatus()\n {\n return $this->_notification->getData('status');\n }", "function result($reply)\n\t{\n\t\treturn ($reply->success == \"true\");\n\t}", "public function getEnableOnEmailConfirmation() {\n\t\t$this->checkDisposed();\n\t\t\t\n\t\tif ($this->_status === null)\n\t\t\t$this->load();\n\t\treturn $this->_status == 'waitForEmail';\t\n\t}", "public function getEnAttenteReponse(): ?bool {\n return $this->enAttenteReponse;\n }", "public function canNotifyAgent() {\n\t\tglobal $wgEchoNotifications;\n\t\t$allowedInConfig = $wgEchoNotifications[$this->getType()]['canNotifyAgent'] ?? false;\n\t\t$allowedInExtra = $this->getExtraParam( 'notifyAgent', false );\n\t\treturn $allowedInConfig || $allowedInExtra;\n\t}", "public function isReturned()\n {\n return ($this->Value(\"returned\") === true);\n }", "function isNotification()\r\n\t{\r\n\t\treturn $this->_is_notification;\r\n\t}", "public function getNotification();", "public function getTriggeredForStatus()\n {\n return $this->triggeredForStatus;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return user ID based on screen
private function getUserIdFromScreen($screen) { if ($screen->base == 'user-edit' && isset($_GET['user_id'])) { return (int) $_GET['user_id']; } if ($screen->base == 'users' && isset($_GET['user'])) { return (int) $_GET['user']; } return 0; }
[ "public function get_user_id();", "protected function determine_user_id()\n {\n }", "private function get_user_id() {\n if (!$this->userinfo) $this->userinfo = wp_get_current_user();\n\n return $this->userinfo && isset($this->userinfo->ID) && $this->userinfo->ID > 0 ?\n $this->userinfo->ID :\n $_SERVER[\"REMOTE_ADDR\"];\n }", "protected function determine_user_id() {\n\t\t$user_id = $this->context->site_user_id;\n\n\t\t/**\n\t\t * Filter: 'wpseo_schema_person_user_id' - Allows filtering of user ID used for person output.\n\t\t *\n\t\t * @api int|bool $user_id The user ID currently determined.\n\t\t */\n\t\treturn apply_filters( 'wpseo_schema_person_user_id', $user_id );\n\t}", "function getUserIDFromScreenName($sn)\n{\n\topenDatabase();\n\t\n\t$result = mysql_query(\"SELECT USERID FROM USERS WHERE SCREENNAME = \\\"$sn\\\"\") or die(mysql_error());\n\t$userRow = mysql_fetch_row($result);\n\t\n\tif(!$userRow) die(\"Failed to get UserID. \" . mysql_error());\n\telse return $userRow[0];\n}", "private function getUserId() {\n $request = $this->getRequest();\n return empty($request['uid']) ? $this->getAccount()->uid : $request['uid'];\n }", "function getUserIdentifier()\n\t{\n\t\tif ($this->serverType == \"activedirectory\") {\n\t\t\treturn $this->attr_sambalogin;\n\t\t} else {\n\t\t\treturn $this->attr_login;\n\t\t}\n\t}", "function user_id(){\n\t\treturn $_SESSION['user']['id'];\n\t}", "private static function getAuthTokenUserId() {\n global $_iform_warehouse_override;\n if ($_iform_warehouse_override || !function_exists('hostsite_get_user_field')) {\n // If linking to a different warehouse, don't do user authentication as\n // it causes an infinite loop.\n return '';\n }\n else {\n $indiciaUserId = hostsite_get_user_field('indicia_user_id');\n // Include user ID if logged in.\n return $indiciaUserId ? \":$indiciaUserId\" : '';\n }\n }", "public function getUserIdentifier()\n {\n return $this->getUser()->getId();\n }", "function get_id_user($login)\n{\n return (get_user_id($login));\n}", "public function getUserUniqueIdentifier()\n\t{\n\t\t$info = $this->getUserInfo();\n\t\t//return (int) $info['id'];\n\t\treturn $info['id'];\n\t}", "function get_current_user_id()\n{\n}", "private function getUserId() {\n\t\t// Do we have a user id?\n\t\tif (!empty($this->server->post['ext_d2l_username'])) {\n\t\t\treturn strip_tags($this->server->post['ext_d2l_username']);\n\t\t}\n\n\t\treturn null;\n\t}", "public function getUserID() {\n if (!$this->isLoggedin()) {\n return -1;\n }\n return $this->user->getId();\n }", "public function getUserId()\n {\n return Mage::getStoreConfig('alliance_fivehundredfriends/access_credentials/user_id');\n }", "public function getIdentifier()\n {\n return $this->getUserID();\n }", "protected function get_current_user_id()\n {\n }", "function get_user_id(){\n\t\tif($this->is_user_loggedin())\n\t\t\treturn $this->session->userdata('sb_auth')['user_id'];\n\t\t\n\t\treturn 0;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
END class Register Google Analytics Stat Widget.
function GoogleStatsWidget_init() { register_widget('GoogleStatsWidget'); }
[ "function add_googleanalytics() { ?>\n<script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-121067678-1\"></script>\n<script>\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', 'UA-121067678-1');\n</script>\n\n\n <?php }", "function add_google_analytics() {\n\t\techo '<script src=\"http://www.google-analytics.com/ga.js\" type=\"text/javascript\"></script>';\n\t\techo '<script type=\"text/javascript\">';\n\t\techo 'var pageTracker = _gat._getTracker(\"UA-XXXXX-X\");';\n\t\techo 'pageTracker._trackPageview();';\n\t\techo '</script>';\n\t}", "function register_zappy_Google_Plus_Widget() {\n register_widget('zappy_Google_Plus_Widget');\n}", "public function register_widget() {\n\t\twp_add_dashboard_widget( 'yotpo_dashboard_widget', 'Yotpo Reviews', array( $this, 'get_metrics' ) );\n\t}", "protected function registerGoogleAnalytics()\n {\n try {\n $gaKey = Settings::group('seo-and-analytics', [\n 'title' => 'Seo and Analytics',\n 'icon' => 'fa-bar-chart'\n ])->get('google-analytics-key');\n// \\Yii::$app->view->on(View::EVENT)\n \\Yii::$app->view->registerJs(<<<JS\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n ga('create', '{$gaKey->getTranslation(null, $this->settingsCacheKey . '-google-analytics-key')->value}', 'auto');\n ga('send', 'pageview');\nJS\n , View::POS_HEAD);\n } catch (\\Exception $e) {\n\n }\n }", "function add_blog_google_analytics() {\n $GAID = get_option(SHORT_NAME . '_gaID');\n if ($GAID and $GAID != ''):\n echo <<<HTML\n<meta name=\"google-analytics\" content=\"{$GAID}\" />\n<!-- Global site tag (gtag.js) - Google Analytics -->\n<script async src=\"https://www.googletagmanager.com/gtag/js?id={$GAID}\"></script>\n<script>\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', '{$GAID}');\n</script>\nHTML;\n endif;\n}", "function add_blog_google_analytics() {\n $GAID = get_option(SHORT_NAME . '_gaID');\n if ($GAID and $GAID != ''):\n echo <<<HTML\n<script type=\"text/javascript\">\n\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '$GAID']);\n _gaq.push(['_trackPageview']);\n \n (function() {\n var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n })();\n\n</script>\nHTML;\n endif;\n}", "public function osp_google_analytics (){\n \n $key = \" <!-- Global site tag (gtag.js) - Google Analytics --><script async src=\\\"https://www.googletagmanager.com/gtag/js?id=UA-169940218-1\\\"> </script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-169940218-1'); </script>\";\n echo $key;\n }", "function carbon_twitter_register_widget() {\n\trequire_once __DIR__ . '/Carbon_Twitter_Feed_Widget.php';\n\n\tregister_widget( 'Carbon_Twitter_Feed_Widget' );\n}", "private function set_google_code() {\n\t\t$this->js[] = \"(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\";\n\t}", "public static function googleAnalytics() {\n $db = new Db();\n $analytics = stripslashes($db->selectRow(\"Settings\", \"value\",\"settingfield='googleAnalytics'\"));\n if($analytics) {\n $file = BASE_PATH. \"/project/js/analytics.js\";\n file_put_contents($file,\"$analytics\");\n PageContext::addScript('analytics.js');\n }\n }", "function gvf_add_gtag() { ?>\n\n <!-- Global site tag (gtag.js) - Google Analytics -->\n <script async src=\"https://www.googletagmanager.com/gtag/js?id=UA-111453149-3\"></script>\n <script>\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n\n gtag('config', 'UA-111453149-3');\n </script>\n<?php }", "public function insert_google_analytics() {\n\t\t$current_domain = parse_url( home_url(), PHP_URL_HOST );\n\t\t$analytics_code = <<<EOD\n\t\t<!-- Google Analytics -->\n\t\t<script>\n\t\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t\t})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n\t\tga('create', 'UA-831873-38', 'auto');\n\t\tga('send', 'pageview');\n\t\t</script>\n\t\t<!-- End Google Analytics -->\n\tEOD;\n\n\t\tif ( 'www.cncf.io' == $current_domain && ! is_user_logged_in() ) {\n\t\t\t// this is a live site so output the analytics code.\n\t\t\techo $analytics_code; //phpcs:ignore\n\t\t}\n\t}", "function sailthru_register_scout_widget() {\n\tregister_widget( 'Sailthru_Scout_Widget' );\n}", "function ucfwp_add_classic_analytics( $ga_account ) {\n?>\n\t<script>\n\t\t(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n\t\t(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n\t\tm=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n\t\t})(window,document,'script','//www.google-analytics.com/analytics.js','ga');\n\n\t\tga('create', '<?php echo $ga_account; ?>', 'auto');\n\t\tga('send', 'pageview');\n\t</script>\n<?php\n}", "function add_ga() {\n?>\n<script>\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n\n ga('create', 'UA-98413958-1', 'auto');\n ga('send', 'pageview');\n\n</script>\n<?php\n}", "function zthemename_register_google_map_widget() {\n\tregister_widget( 'Zthemename_Google_Map_Widget' );\n}", "public function post_widget() {\n\t\t// Make sure the user has capability (Only for subsite/single site).\n\t\t$capable = Permission::user_can( 'analytics' );\n\n\t\tif ( Helper::instance()->can_get_stats() && $capable ) {\n\t\t\t// Register metabox.\n\t\t\tadd_meta_box(\n\t\t\t\t'beehive_analytics_stats',\n\t\t\t\t__( 'Statistics for last 30 days', 'ga_trans' ),\n\t\t\t\t[ Stats::instance(), 'post_widget' ],\n\t\t\t\tHelper::instance()->post_types(),\n\t\t\t\t'normal'\n\t\t\t);\n\t\t}\n\t}", "public function registerTracking()\n\t{\n\t\tif (!isset($this->accountId))\n\t\t\treturn;\n\n\t\t$headScript = <<<EOD\nvar _gaq = _gaq || [];\n_gaq.push(['_setAccount', '{$this->accountId}']);\nEOD;\n\n\t\tif(isset($this->cookieDomain))\n\t\t\t$headScript .= \"\\n_gaq.push(['_setDomainName', '{$this->cookieDomain}']);\";\n\t\t\t\n\t\t$headScript .= \"\\n_gaq.push(['_trackPageview']);\";\n\t\t$bodyEndScript = $this->getTransactionsJS();\n\t\t$bodyEndScript .= <<<EOD\n\n(function() {\n\tvar ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\n\tga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n\tvar s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n})();\nEOD;\n\n\t\tYii::app()->clientScript->registerScript(__CLASS__.'#tracking-head', $headScript, \\CClientScript::POS_HEAD);\n\t\tYii::app()->clientScript->registerScript(__CLASS__.'#tracking-body', $bodyEndScript, \\CClientScript::POS_END);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
/ add a new weighted tag for a venue
function _addWeightedTag( $stemmedTag, $venueId, $weight = 0 ) { if ( !$venueId ) return false; $tagId = $this->TagsVenue->Tag->updateTag($stemmedTag); if ( $tagId != false ) { // and update the TagsVenue table $this->TagsVenue->updateTagsVenue( $venueId, $tagId, $weight // default weight ); } }
[ "function updateTagsVenue( $venueId, $tagId, $weight) {\r\n\r\n $result = $this->find('first', array( 'conditions' =>\r\n array( 'TagsVenue.tag_id' => $tagId,\r\n 'TagsVenue.venue_id' => $venueId )\r\n ) );\r\n\r\n if ($result) {\r\n $result['TagsVenue']['weight'] = $weight;\r\n $this->save($result);\r\n return($result['TagsVenue']['id']);\r\n } else {\r\n $this->create();\r\n $data = array('TagsVenue' =>\r\n array( 'tag_id' => $tagId, 'venue_id' => $venueId,\r\n 'weight' => $weight) );\r\n $this->save($data);\r\n return($this->id);\r\n\r\n }\r\n\r\n\r\n\r\n }", "public function writeTagCloudItem($name, $weight, $count);", "public function addTag();", "public function venue_add_new_extra_fields( $tag ) {\n $args = array(\n 'orderby' => 'id',\n 'order' => 'DESC',\n 'hide_empty' => false\n );\n // Get latitude and longitude from the last added venue\n $terms = get_terms( 'wpcm_venue', $args );\n\n if ( $terms ) {\n $term = reset( $terms );\n $t_id = $term->term_id;\n //$term_meta = get_option( \"taxonomy_term_$t_id\" );\n $term_meta = get_term_meta( $t_id );\n $address = $term_meta['wpcm_address'][0];\n $capacity = $term_meta['wpcm_capacity'][0];\n $latitude = $term_meta['wpcm_latitude'][0];\n $longitude = $term_meta['wpcm_longitude'][0];\n $place_id = $term_meta['place_id'][0];\n $wr_id = $term_meta['wr_id'][0];\n $wr_name = $term_meta['wr_name'][0];\n } else {\n $address = __( 'USA Rugby, 2655 Crescent Dr, Unit A, Lafayette, CO 80026, USA', 'wp-club-manager' );\n $capacity = 0;\n $latitude = '';\n $longitude = '';\n $place_id = '';\n $wr_id = '';\n $wr_name = '';\n }\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[wr_id]\"><?php _e( 'World Rugby ID', 'usa-rugby-database' ); ?></label>\n <input type=\"text\" class=\"wr-id\" name=\"term_meta[wr_id]\" id=\"term_meta[wr_id]\" value=\"<?php echo esc_attr( $wr_id ); ?>\" />\n </div>\n <div class=\"form-field\">\n <label for=\"term_meta[wr_name]\"><?php _e( 'Historical Name', 'usa-rugby-database' ); ?></label>\n <input type=\"text\" class=\"wr-name\" name=\"term_meta[wr_name]\" id=\"term_meta[wr_name]\" value=\"<?php echo esc_attr( $wr_name ); ?>\" />\n </div>\n <div class=\"form-field\">\n <label for=\"term_meta[wpcm_address]\"><?php _e( 'Venue Address', 'wp-club-manager' ); ?></label>\n <input type=\"text\" class=\"wpcm-address\" name=\"term_meta[wpcm_address]\" id=\"term_meta[wpcm_address]\" value=\"<?php echo esc_attr( $address ); ?>\" />\n <p><div class=\"wpcm-location-picker\"></div></p>\n <p class=\"description\"><?php _e( \"Drag the marker to the venue's location.\", 'wp-club-manager' ); ?></p>\n </div>\n <div class=\"form-field\">\n <label for=\"term_meta[wpcm_latitude]\"><?php _e( 'Latitude', 'wp-club-manager' ); ?></label>\n <input type=\"text\" class=\"wpcm-latitude\" name=\"term_meta[wpcm_latitude]\" id=\"term_meta[wpcm_latitude]\" value=\"<?php echo esc_attr( $latitude ); ?>\" />\n </div>\n <div class=\"form-field\">\n <label for=\"term_meta[wpcm_longitude]\"><?php _e( 'Longitude', 'wp-club-manager' ); ?></label>\n <input type=\"text\" class=\"wpcm-longitude\" name=\"term_meta[wpcm_longitude]\" id=\"term_meta[wpcm_longitude]\" value=\"<?php echo esc_attr( $longitude ); ?>\" />\n </div>\n <div class=\"form-field\">\n <label for=\"term_meta[place_id]\"><?php _e( 'Place ID', 'wp-club-manager' ); ?></label>\n <input class=\"place-id\" name=\"term_meta[place_id]\" id=\"term_meta[place_id]\" type=\"text\" value=\"<?php echo esc_attr( $place_id ); ?>\" size=\"8\" />\n </div>\n <div class=\"form-field\">\n <label for=\"term_meta[wpcm_capacity]\"><?php _e( 'Venue Capacity', 'wp-club-manager' ); ?></label>\n <input class=\"wpcm-capacity\" name=\"term_meta[wpcm_capacity]\" id=\"term_meta[wpcm_capacity]\" type=\"text\" value=\"<?php echo esc_attr( $capacity ); ?>\" size=\"8\" />\n </div>\n <?php\n }", "public function addTag($tag);", "public function add(Tag $Tag);", "function set_ingredients_tag($tag){\n $this->ingredients->tag->tagType = $tag;\n }", "function add_tag($tagname, $articleid){\n\t$tagname = ucfirst(strtolower($tagname));\n\t\n\t$tagid = tag_exists($tagname);\n\t\n\tif(check_article_tag_relation($articleid, $tagid)) return T_TAG_EXISTS;\n\t\n\t$conn = open_db();\n\t$tagname = mysqli_real_escape_string($conn, $tagname);\n\t\n\t// if tagid = 0, create the new tag\n\tif($tagid == 0){\n\t\t$query = \"INSERT INTO tags (name) VALUES ('$tagname')\";\n\t\t$result = mysqli_query($conn, $query);\n\t\t$tagid = mysqli_insert_id($conn);\n\t}\n\t$query = \"INSERT INTO article_tag1 (articleid, tagid) VALUES ($articleid, $tagid)\";\n\t$result = mysqli_query($conn, $query);\n\tclose_db($conn);\n\treturn T_TAG_ADDED;\n}", "public function addVolumeAndWeight($vol,$weight){\n\t\t$this->weight+=$weight;\n $this->volume+=$vol;\n\t}", "public function addTag($tagName, $tagValue)\n {\n if (!isset($this->tags)) {\n $this->tags = [];\n }\n\n // The same tag cannot be added 2 times\n if (array_key_exists($tagName, $this->tags)) {\n throw new PushwooshException(\n 'The tag \\'' . $tagName .\n '\\' has already been added, use the \\'setTag\\' method if you want to overwrite its value !'\n );\n }\n\n $this->tags[$tagName] = $tagValue;\n }", "function addTag($tag)\n {\n reaktorCache::deleteSimilar(\"artwork_tag_list_\".$this->getId());\n $this->_artwork->addTag($tag);\n }", "public function add($node, $weight = null);", "function add_tag($ContactId, $TagId) {\r\n }", "protected function addTag($tag)\n\t{\n\t\tif (isset($this->returnedTags[$tag])) {\n\t\t\t$this->returnedTags[$tag][\"count\"]++;\n\t\t} else {\n\t\t\t$this->returnedTags[$tag] = array(\n\t\t\t\t\"name\" => $tag,\n\t\t\t\t\"count\" => 1\n\t\t\t);\n\t\t}\n\t}", "function addTag($tags) {\n if(preg_match('/[^\\s]+/', $this->tags)) {\n $array = explode(' | ', $this->tags);\n } else {\n $array = array();\n }\n\n if (!is_array($tags)) {\n $tag = $tags;\n $tags = array($tag);\n }\n foreach ($tags as $tag) {\n $array[] = $tag;\n if ($this->updateTagCounts) {\n if (is_a($this->db, 'idb')) {\n $res = $this->db->query(\"insert into tagCounts set `tag` = '$tag', `total` = 1 on duplicate key update `total` = `total` + 1;\");\n }\n }\n }\n $this->tags = implode(' | ', array_unique($array));\n }", "public function addTag(Tag $tag)\n {\n $this->tags[] = $tag;\n $tag->addGame($this);\n }", "public function addTag($tag, $value = true);", "public function sAddTag(){\n\t\t$oDB = self::oDB(self::$sDBName);\n\t\ttry{\n\t\t\t\n\t\t\t$oDB->vBegin();\n\t\t\t//insert puppet attr\n\t\t\t$sDate = date(\"Y-m-d H:i:s\");\n\t\t\t$aValues = array(\t\n\t\t\t\t\t\t'tag_name'=>$this->sTagName,\n\t\t\t\t\t\t'parent_tag_no'=>$this->iParentTagNo,\n\t\t\t\t\t\t'status'=>$this->bStatus,\n\t\t\t\t\t\t'createtime'=>$sDate,\n\t\t\t\t\t\t\t);\n\t\t\t$oDB->sInsert(\"galaxy_tag\",array_keys($aValues),array_values($aValues));\n\t\t\t$this->iTagNo = $oDB->iGetInsertId();\n\t\n\n\t\t\t$this->oLastUser()->vAddUserLog(\"galaxy_tag\",$this->iTagNo,$_GET['func'],$_GET['action']);\n\n\t\t\t$oDB->vCommit();\n\n\n\n\t\t\treturn $this->iTagNo;\n\t\t}catch (Exception $e){\n\t\t\t$oDB->vRollback();\t\n\t\t\tthrow new Exception('oCTag->sAddTag: '.$e->getMessage());\n\t\t}\n\t}", "public function addTag2($tag)\n {\n $this->tags['tag2'][] = $tag;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Operation auEssLookupSuburbs Search Suburbs
public function auEssLookupSuburbs($term, $employee_id, $page_num = 1, $page_size = 20, $country_id = null, string $contentType = self::contentTypes['auEssLookupSuburbs'][0]) { list($response) = $this->auEssLookupSuburbsWithHttpInfo($term, $employee_id, $page_num, $page_size, $country_id, $contentType); return $response; }
[ "public function suggestsuburb ($request)\n {\n $term = $request->getVar('term');\n $result = array();\n \n if (strlen($term) < 3) {\n $this->httpError(404, 'You must specify a search term.');\n }\n \n $suburbs = DataObject::get('Suburb', \n sprintf(\n '\"Postcode\" LIKE \\'%%%1$s%%\\' OR \"Name\" LIKE \\'%%%1$s%%\\'', \n Convert::raw2sql($term)));\n \n if ($suburbs)\n foreach ($suburbs as $suburb) {\n $result[] = array(\n 'value' => $suburb->ID,\n 'label' => \"$suburb->Name $suburb->State $suburb->Postcode\"\n );\n }\n \n return Convert::array2json($result);\n }", "public function auEssLookupSuburb($suburb, $state, $post_code, $employee_id, $country_id = null, string $contentType = self::contentTypes['auEssLookupSuburb'][0])\n {\n list($response) = $this->auEssLookupSuburbWithHttpInfo($suburb, $state, $post_code, $employee_id, $country_id, $contentType);\n return $response;\n }", "public function postDoSearchSuburb(Request $request)\n\t{\n\t\t$user = (new AuthUserRetriever())->retrieveUser();\n\t\t$name = null;\n\t\t$box_code = null;\n\t\t$street_code = null;\n\t\t$area_id = null;\n\t\t$query_parameters = array();\n\t\t\n\t\tif (Util::isValidRequestVariable($request->name))\n\t\t{\n\t\t\t$name = $request->name;\n\t\t\t$name_query_parameter = ['name', 'like', Util::convertToLikeQueryParameter($name)];\n\t\t\tarray_push($query_parameters, $name_query_parameter);\n\t\t}\n\t\tif (Util::isValidRequestVariable($request->box_code))\n\t\t{\n\t\t\t$box_code = $request->box_code;\n\t\t\t$box_code_query_parameter = ['box_code', 'like', $box_code];\n\t\t\tarray_push($query_parameters, $box_code_query_parameter);\n\t\t}\n\t\tif (Util::isValidRequestVariable($request->street_code))\n\t\t{\n\t\t\t$street_code = $request->street_code;\n\t\t\t$street_code_query_parameter = ['street_code', 'like', $street_code];\n\t\t\tarray_push($query_parameters, $street_code_query_parameter);\n\t\t}\n\t\tif (Util::isValidRequestVariable($request->area_id) && $request->area_id > -1)\n\t\t{\n\t\t\t$area_id = $request->area_id;\n\t\t\t$area_id_query_parameter = ['area_id', '=', $area_id];\n\t\t\tarray_push($query_parameters, $area_id_query_parameter);\n\t\t}\n\t\t$suburbs = Suburb::where($query_parameters)->paginate($user->pagination_size);\n\t\t$areas = (new AreaLookupRetriever())->execute();\n\t\treturn view('suburb.search-suburb', [\n\t\t\t'suburbs' => $suburbs,\n\t\t\t'name' => $name,\n\t\t\t'box_code' => $box_code,\n\t\t\t'street_code' => $street_code,\n\t\t\t'area_id' => $area_id,\n\t\t\t'areas' => $areas\n\t\t]);\n\t}", "public function getSuburbAction()\n {\n $postcode = $this->getRequest()->getParam('postcode');\n $result = array ();\n $url = Mage::getStoreConfig(\"starshipit/address_search_api/genoname_api_url\");\n $username = Mage::getStoreConfig(\"starshipit/address_search_api/geoname_username\");\n\n if (isset($url) && isset($postcode) && isset($username)) {\n $url .= '&postalcode='.$postcode.'&'.'username='.$username;\n } else\n $result['error'] = 'Something went wrong! Please contact our support.';\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, \"Content-Type: application/json\");\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_TIMEOUT, 60);\n $response = curl_exec($ch);\n curl_close($ch);\n\n $response = json_decode($response, true);\n if (!empty($response['postalcodes'])) {\n $result['success'] = true;\n foreach ($response['postalcodes'] as $key => $value)\n $result['suburb'][] = $value['placeName'];\n } else\n $result['error'] = 'Postal code is invalid. Please try again with valid post code!';\n\n return $this->getResponse()->setBody(json_encode($result));\n }", "public function auEssLookupSuburbRequest($suburb, $state, $post_code, $employee_id, $country_id = null, string $contentType = self::contentTypes['auEssLookupSuburb'][0])\n {\n\n // verify the required parameter 'suburb' is set\n if ($suburb === null || (is_array($suburb) && count($suburb) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $suburb when calling auEssLookupSuburb'\n );\n }\n\n // verify the required parameter 'state' is set\n if ($state === null || (is_array($state) && count($state) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $state when calling auEssLookupSuburb'\n );\n }\n\n // verify the required parameter 'post_code' is set\n if ($post_code === null || (is_array($post_code) && count($post_code) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $post_code when calling auEssLookupSuburb'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling auEssLookupSuburb'\n );\n }\n\n\n\n $resourcePath = '/api/v2/ess/{employeeId}/lookup/suburb';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $suburb,\n 'suburb', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n true // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $state,\n 'state', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n true // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $post_code,\n 'postCode', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n true // required\n ) ?? []);\n // query params\n $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(\n $country_id,\n 'countryId', // param base name\n 'string', // openApiType\n '', // style\n false, // explode\n false // required\n ) ?? []);\n\n\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', ],\n $contentType,\n $multipart\n );\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'GET',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function get_all_in_suburb($postcode) {\n\n\tglobal $mysqli;\n\n\tif($stmt = $mysqli->prepare(\"SELECT id, Site_street, Site_suburb, Allotment_Area FROM vba WHERE Site_pcode = ? AND Allotment_Area != 0\")) {\n\n\t $stmt->bind_param('i', $postcode);\n\t $stmt->execute();\n\t $stmt->bind_result($id, $street, $suburb, $allotment);\n\n\t $results = array();\n\n\t while ($stmt->fetch()) {\n\n\t $address = $allotment . \" \" . $street . \" \" . $suburb . \" \" . $postcode;\n\t\t\t$next = array( \"address\" => $address, \"id\" => $id);\n\t array_push($results, $next);\n\n\t }\n\n\t\treturn $results;\n\n\t}\n\n\treturn NULL;\n\n}", "public function lstSuburb(){\r\n\t\t$Sql = \"SELECT\r\n\t\t\t\t\tsuburb_id,\r\n\t\t\t\t\tsuburb_title_postcode,\r\n\t\t\t\t\tsuburb_title,\r\n\t\t\t\t\tsuburb_postcode\r\n\t\t\t\tFROM\r\n\t\t\t\t\trs_tbl_suburb\r\n\t\t\t\tWHERE\r\n\t\t\t\t\t1=1\";\r\n\t\tif($this->isPropertySet(\"suburb_id\", \"V\"))\r\n\t\t\t$Sql .= \" AND suburb_id=\" . $this->getProperty(\"suburb_id\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"suburb_title_postcode\", \"V\"))\r\n\t\t\t$Sql .= \" AND suburb_title_postcode='\" . $this->getProperty(\"suburb_title_postcode\") . \"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"suburb_title_postcode_search\", \"V\"))\r\n\t\t\t$Sql .= \" AND suburb_title_postcode LIKE '%\" . $this->getProperty(\"suburb_title_postcode_search\") . \"%'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"suburb_title\", \"V\"))\r\n\t\t\t$Sql .= \" AND suburb_title='\" . $this->getProperty(\"suburb_title\") . \"'\";\r\n\t\t\r\n\t\tif($this->isPropertySet(\"suburb_postcode\", \"V\"))\r\n\t\t\t$Sql .= \" AND suburb_postcode='\" . $this->getProperty(\"suburb_postcode\") . \"'\";\r\n\t\t\t\t\r\n\t\tif($this->isPropertySet(\"ORDERBY\", \"V\"))\r\n\t\t\t$Sql .= \" ORDER BY \" . $this->getProperty(\"ORDERBY\");\r\n\t\t\r\n\t\tif($this->isPropertySet(\"limit\", \"V\"))\r\n\t\t\t$Sql .= $this->appendLimit($this->getProperty(\"limit\"));\r\n\r\n\t\treturn $this->dbQuery($Sql);\r\n\t}", "public function testSearchSuburb()\n\t{\n\t\t$this->visit('/')\n\t\t\t->visit('/login')\n\t\t\t->type('jaco.wk@gmail.com', 'email')\n\t\t\t->type('password', 'password')\n\t\t\t->press('Login')\n\t\t\t->visit('/search-suburb')\n\t\t\t->see('Search Suburbs');\n\t}", "function getSuburbs(){\r\n\t\trequire 'sqlconnect.php';\r\n\t\t$suburbs = [];\r\n\t\t$sql = 'SELECT Suburb FROM items';\r\n\t\t\r\n\t\t$counter = 0;\r\n\t\tforeach ($pdo->query($sql) as $row){\r\n\t\t\t//Remove pesky postcodes and commas...\r\n\t\t\t$row[0] = preg_replace('/, [0-9]+/', '', $row[0]);\r\n\t\t\t$suburbs[$counter] = $row[0];\r\n\t\t\t$counter++;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $suburbs;\t\r\n\t\t\r\n\t}", "function _loadSuburb()\n\t{\n\n\t\t$params = JComponentHelper::getParams ('com_ezrealty');\n\n\t\tif (empty($this->_suburb))\n\t\t{\n\n\t\t\t// current suburb info\n\t\t\t$query = 'SELECT c.*, ' .\n\t\t\t\t' CASE WHEN CHAR_LENGTH(c.alias) THEN CONCAT_WS(\\':\\', c.id, c.alias) ELSE c.id END as slug '.\n\t\t\t\t' FROM #__ezrealty_locality AS c' .\n\t\t\t\t' WHERE c.id = '. (int) $this->_id ;\n\t\t\t$this->_db->setQuery($query, 0, 1);\n\t\t\t$this->_suburb = $this->_db->loadObject();\n\n\t\t}\n\t\treturn true;\n\t}", "function getBySuburb($suburb, $status){\n $serviceStatusQry = \"SELECT no.ID, no.OptusNetworkRef, no.State, no.Areas, no.CustomService,\" .\n \" no.CustomSummary, no.Type, no.StartTime, no.EndTime, no.FixingStatus\" .\n \" FROM CO.NetworkOutage no WHERE no.ProcessStatus = 3\";\n\n if (empty($suburb)) {\n $nos = RNCPHP\\ROQL::query($serviceStatusQry . \" ORDER BY no.StartTime DESC LIMIT \" .\n $this->rowLimit)->next();\n } else {\n $nos = RNCPHP\\ROQL::query($serviceStatusQry . \" AND no.Areas like '%\" . $suburb . \"%'\" .\n \" ORDER BY no.StartTime DESC LIMIT \" . $this->rowLimit)->next();\n }\n\n return $nos;\n }", "public function getSuburb();", "function schoolFinder($suburbName){\n\t\t\t\n\t\t\t$con\t=\tmysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);\n\t\t\t\n\t\t\tif (mysqli_connect_errno()){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$searchQuery\t=\t\"\n\t\t\t\t\t\t\t\tSELECT sa_public_h_school.`Zoned school`\n\t\t\t\t\t\t\t\tFROM sa_public_h_school\n\t\t\t\t\t\t\t\tWHERE sa_public_h_school.`Suburb name` = '\".$suburbName.\"'\";\n\t\t\t\n\t\t\t//echo $searchQuery;\n\t\t\t\n\t\t\t$result\t\t\t=\tmysqli_query($con, $searchQuery);\n\t\t\t\n\t\t\t$i\t\t\t\t=\t0;\n\t\t\twhile($row = mysqli_fetch_array($result)){\n\t\t\t\t$schoolName[$i]\t=\t$row['Zoned school'];\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\tmysqli_close($con);\n\t\t\t\n\t\t\treturn $schoolName;\n\t\t\t\n\t\t}", "function lookup_address($address, $city, $state) {\nglobal $con;\nconnect();\n$results = mysql_query(\"select * from `city_data` where `street` like '%$address%'\", $con)\nor $err = \"Unable to connect to database\";\nif ($err) return $err;\n// Initialize array for results\n$res = \"\";\n$count = mysql_num_rows($results);\nif ($count == 0) return \"No results\";\n// Initialize and populate array of matching locations\n$res = \"\";\n$count = 0;\nwhile($item = mysql_fetch_assoc($results)) {\nforeach($item as $k => $v) {\n$res[$count][$k] = $v;\n}\n$count++;\n}\nreturn $res;\n\n}", "public function getKaiGaribSubs($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT s.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM suburbs s\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON s.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '184'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$suburbs = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t\t$suburb->setMunicipality($municipality);\n\t\t\t\t\t\t$suburb->setSuburbCode($row['suburb_code']);\n\t\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t\t$suburb->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$suburb->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$suburb->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray_push($suburbs, $suburb);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $suburbs;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "function listSuburbs($strState)\n{\n\t$objAdminMsg = &$GLOBALS['objAdminMsg'];\n\n\t$objResponse = new xajaxResponse();\n\t$objResponse->assign('suburbfarme', 'innerHTML', $objAdminMsg->getSuburbsHTML($strState));\n\n\treturn $objResponse;\n}", "public function getAllsuburbsByPostcode($postcode_id) {\n $stmt = $this->conn->prepare(\"SELECT s.*,p.postcode_id,p.postcode_name,st.state_id,st.state_name,c.country_id,c.country_name FROM suburbs s INNER JOIN postcodes p ON p.postcode_id=s.postcode_id INNER JOIN states st ON p.state_id=st.state_id INNER JOIN countries c ON c.country_id = st.country_id WHERE p.postcode_id = ? OR p.postcode_name = ?\");\n\t\t$stmt->bind_param(\"is\", $postcode_id, $postcode_id);\n $stmt->execute();\n $tasks = $stmt->get_result();\n $stmt->close();\n return $tasks;\n }", "public function getSaldanhaBaySubs($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT s.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM suburbs s\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON s.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '119'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$suburbs = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t\t$suburb->setMunicipality($municipality);\n\t\t\t\t\t\t$suburb->setSuburbCode($row['suburb_code']);\n\t\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t\t$suburb->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$suburb->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$suburb->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray_push($suburbs, $suburb);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $suburbs;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}", "public function getLekwaSubs($municipality_id){\n\t\t\ttry{\n\t\t\t\t$query = \"SELECT s.*, m.municipality_name, m.municipality_code, \n\t\t\t\t\t\t m.municipality_id FROM suburbs s\n\t\t\t\t\t\t LEFT JOIN municipalities m\n\t\t\t\t\t\t ON s.municipality_id = m.municipality_id\n\t\t\t\t\t\t WHERE m.municipality_id = '$municipality_id'\n\t\t\t\t\t\t AND m.municipality_id = '151'\";\n\t\t\t\t$result = $this->conn->query($query);\n\t\t\t\t$suburbs = array();\n\t\t\t\t\tforeach($result as $row){\n\t\t\t\t\t\t//create municipality object\n\t\t\t\t\t\t$municipality = new Municipality();\n\t\t\t\t\t\t$municipality->setMunicipalityID($row['municipality_id']);\n\t\t\t\t\t\t$municipality->setMunicipalityCode($row['municipality_code']);\n\t\t\t\t\t\t$municipality->setMunicipalityName($row['municipality_name']);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//create city object\n\t\t\t\t\t\t$suburb = new Suburb();\n\t\t\t\t\t\t$suburb->setSuburbID($row['suburb_id']);\n\t\t\t\t\t\t$suburb->setMunicipality($municipality);\n\t\t\t\t\t\t$suburb->setSuburbCode($row['suburb_code']);\n\t\t\t\t\t\t$suburb->setSuburbName($row['suburb_name']);\n\t\t\t\t\t\t$suburb->setTotalPropertyForSale($row['total_property_forsale']);\n\t\t\t\t\t\t$suburb->setTotalPropertyToRent($row['total_property_torent']);\n\t\t\t\t\t\t$suburb->setTotalPropertyOnShow($row['total_property_onshow']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray_push($suburbs, $suburb);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\treturn $suburbs;\n\t\t\t\t\n\t\t\t}catch(PDOException $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets the default line ending mode for all writers.
static function setDefaultLineEndingModeCrlf($default_line_ending_crlf) { self::$defaultLineEndingModeCrlf = $default_line_ending_crlf; }
[ "function setLineEndingModeCrlf($line_ending_mode);", "protected static function setLineEndings() {\n\t\tif (!self::$lineEndingsSet) {\n\t\t\tini_set(\"auto_detect_line_endings\", true);\n\t\t\tself::$lineEndingsSet = true;\n\t\t}\n\t}", "function setLineEndingModeCrlf($line_ending_mode)\n {\n $this->lineEndingModeCrlf = $line_ending_mode;\n }", "public static function setAutoDetectLineEndings($value = 1)\n {\n ini_set('auto_detect_line_endings', $value);\n }", "private function set_newlines()\n\t\t{\n\t\t\tif (strtoupper(substr(PHP_OS, 0, 3) == 'WIN'))\n\t\t\t\t{\n\t\t\t\t\t$this->eol=\"\\r\\n\";\n\t\t\t\t\t$this->sol=\"\\n\";\n\t\t\t\t}\n\t\t\telseif(strtoupper(substr(PHP_OS, 0, 3) == 'MAC'))\n\t\t\t{\n\t\t\t\t$this->eol=\"\\r\";\n\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->eol=\"\\n\";\n\t\t\t\t}\n\t\t\tif (! isset($this->sol))\n\t\t\t\t{\n\t\t\t\t\t$this->sol = $this->eol;\n\t\t\t\t}\n\t\t}", "private function setNewLine() {\n $extension = pathinfo($this->path, PATHINFO_EXTENSION);\n if ($extension === Lexer::LINUX_FILE_EXTENSION) {\n $this->newLine = \"\\n\";\n } else {\n $this->newLine = \"\\r\\n\";\n }\n }", "function _setEOL($eol)\n\t{\n\t\t$this->_eol = $eol;\n\t\tif (!defined('MAIL_MIME_CRLF')) {\n\t\t\tdefine('MAIL_MIME_CRLF', $this->_eol, true);\n\t\t}\n\t}", "public function setLineEnding($line_ending)\n\t{\n\t\t$this->setReadingLineEnding($line_ending);\n\t\t$this->setWritingLineEnding($line_ending);\n\t}", "public function getDefaultLineEnding()\n {\n return (new Config())->getLineEnding();\n }", "protected function determineLineEnding()\n {\n if (isset($this->content[0]) && strpos($this->content[0], \"\\r\\n\") !== false) {\n $this->lineEnding = \"\\r\\n\";\n }\n\n return $this;\n }", "public function setLF($style='windows') {\r\n $this->CRLF = ($style === 'windows') ? \"\\r\\n\" :\r\n (($style === 'unix') ? \"\\n\" : $style);\r\n return $this;\r\n }", "private function updateNewLine()\n {\n if ((Newline::NEWLINE_LF !== $this->newline) && (0 === fseek($this->handle, -1, SEEK_CUR))) {\n fwrite($this->handle, $this->newline);\n $this->logger->debug(sprintf('Update newline character %s', addslashes($this->newline)));\n }\n }", "public function setReadingLineEnding($line_ending)\n\t{\n\t\t$this->reading_buffer = new LineStringBuffer($line_ending);\n\t}", "public function setEolSymbol($eolSymbol): TextWriter\n {\n $oClass = new ReflectionClass(__CLASS__);\n $validEols = [];\n foreach ($oClass->getConstants() as $name => $value) {\n if (substr($name, 0, 4) === \"EOL_\") {\n $validEols[] = $value;\n }\n }\n\n if (!in_array($eolSymbol, $validEols)) {\n throw new InvalidArgumentException('Invalid EOL symbol. Use EOL_* constants.');\n }\n\n $this->eolSymbol = $eolSymbol;\n\n return $this;\n }", "public function setEOL(string $eol=PHP_EOL) {\n $this->params[self::EOL] = $eol;\n }", "public function __construct($lineEnding = NewLineAfter::UNIX)\n {\n $this->setLineEnding($lineEnding);\n }", "function setLineSeparator($ls)\n {\n $this->ls = $ls;\n }", "private function writeNewLineBecauseOfComma()\n {\n $this->newline = true;\n\n if ($this->clauseLimit === true) {\n $this->newline = false;\n $this->clauseLimit = false;\n }\n }", "public function useLineCommentDecorations()\n {\n $this->setDecorations(static::DECORATIONS__LINE_COMMENT);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return a JSON resource delete (DELETE) response.
protected function getDeleteResponse() { return \Response::make('', HttpStatusCodes::HTTP_NO_CONTENT); }
[ "public function delete()\n {\n return $this->make_http_request('DELETE');\n }", "public function handleDeletion(): Response\n {\n $this->delete();\n return new Response('Success', 'text/plain', 200);\n }", "public function delete()\n {\n return $this->setMethod(static::DELETE)->send();\n }", "public function doDelete()\n {\n return $this->doRequest('DELETE');\n }", "public function httpDelete()\n {\n return $this->method(\"DELETE\");\n }", "public function delete($resource) {\r\n\t\t\t\r\n\t\t$url = $this->_path . '/api/v2' . $resource;\r\n\t\t\r\n\t\t$curl = curl_init();\r\n\t\tcurl_setopt($curl, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $this->_headers);\r\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($curl, CURLOPT_VERBOSE, 1);\r\n\t\tcurl_setopt($curl, CURLOPT_HEADER, 1);\r\n\t\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\r\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\r\n\t\t$response = curl_exec($curl);\r\n\t\t$http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);\r\n\t\t$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);\r\n\t\t$headers = substr($response, 0, $header_size);\r\n\t\t$body = substr($response, $header_size);\r\n\t\tself::http_parse_headers($headers);\t \r\n\t\tcurl_close ($curl);\r\n\t\tif ($http_status == 204) {\r\n\t \treturn $http_status . ' DELETED';\r\n\t\t } else {\r\n\t\t \t$this->error($body, $url, null, 'DELETE');\r\n\t\t }\r\n\t}", "public static function delete($encode = true) {\n return self::_curl('delete', $encode); \n }", "public function delete_withBody()\n {\n $authentication = Authentication::createClientCredentials('not under test', 'not under test');\n $client = new Client(new DeleteAdapter(), $authentication, 'baseUrl/v1');\n\n $response = $client->delete('resource name', 'the id', ['the key' => 'the value']);\n\n $this->assertSame(204, $response->getHttpCode());\n $this->assertSame([], $response->getResponse());\n $this->assertSame(['Content-Type' => ['application/json']], $response->getResponseHeaders());\n }", "public function delete()\n {\n return $this->method('DELETE');\n }", "function sendDELETE(){\n //builds the string with the parameters to send\n $content = '';\n foreach($this->params as $k=>$val)\n $content .= '&'.$k.'='.rawurlencode($val);\n $content .= '&src=sdk-php-1.0';\n $content = substr($content, 1, strlen($content));//removes the first &\n $context = stream_context_create(array('http'=>array('method' =>'DELETE', 'ignore_errors' => 1)));\n $r = @file_get_contents($this->url.'?'.$content, false, $context);\n if($r !== false)\n $response = array('http-response' => $http_response_header, 'api-response' => $r);\n else $response = array('http-response' => $http_response_header);\n return $response;\n }", "public function delete()\n {\n $this->_query_type = 'delete';\n return $this->createResult();\n }", "public function sendDelete ()\n {\n curl_setopt($this->cURL, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n\n return $this->handleQuery();\n }", "function object_delete()\n{\n http_response_code(200);\n}", "public function actionDelete()\n {\n Yii::$app->response->format = 'json';\n\n $this->forcePostRequest();\n\n $model = Yii::$app->request->get('model');\n\n //Due to backward compatibility we use the old delte mechanism in case a model parameter is provided\n $id = (int) ($model != null) ? Yii::$app->request->get('id') : Yii::$app->request->post('id');\n\n $contentObj = ($model != null) ? Content::Get($model, $id) : Content::findOne($id);\n\n if (!$contentObj->canDelete()) {\n throw new HttpException(400, Yii::t('ContentModule.controllers_ContentController', 'Could not delete content: Access denied!'));\n }\n\n if ($contentObj !== null && $contentObj->delete()) {\n $json = [\n 'success' => true,\n 'uniqueId' => $contentObj->getUniqueId(),\n 'model' => $model,\n 'pk' => $id\n ];\n } else {\n throw new HttpException(500, Yii::t('ContentModule.controllers_ContentController', 'Could not delete content!'));\n }\n\n return $json;\n }", "public function deleteAction()\n\t{\n\n\n\t\t$this->view->id = $id;\n\t\t$this->view->message = sprintf('Resource #%s Deleted', $id);\n\t\t$this->_response->ok();\n\t}", "public function delete_delete(){\n $response = $this->PersonM->delete_person(\n $this->delete('id')\n );\n $this->response($response);\n }", "protected function handleDELETE(): ResponseInterface\n {\n if (!$this->backend->exists($this->file)) {\n return $this->response->withStatus(404);\n }\n $this->backend->delete($this->file);\n\n if ($this->backend->containerExists($this->file)) {\n $this->backend->containerDelete($this->file);\n }\n\n return $this->response->withStatus(204);\n }", "private function deleteJob()\n {\n $uri = $this->getUri();\n $job = $this->get($uri);\n\n if (empty($job)) {\n \\App::abort(400, \"The given uri, $uri, could not be resolved as a resource that can be deleted.\");\n }\n\n $job->delete();\n\n $response = \\Response::make(null, 200);\n\n return $response;\n }", "public function testReqDeleteResourceRender()\n\t{\n\t\t$expected_result = '{\"success\":\"true\",\"message\":\"Record Deleted\",\"data\":{\"totalCount\":\"1\",\"post\":{\"id\":\"1\",\"title\":\"title1\",\"content\":\"content1\",\"create_time\":\"2013-08-07 10:09:41\",\"author_id\":\"1\"}}}';\n\t\t\n\t\t$event_result = $this->captureOB($this, function() {\n\t\t\t$this->event->emit(ERestEvent::REQ_DELETE_RESOURCE_RENDER, [\n\t\t\t\tPost::model()->findByPk(1)\n\t\t\t]);\n\t\t});\n\t\t$this->assertJsonStringEqualsJsonString($expected_result, $event_result);\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this function is used to update the work space details to database
function update() { if(!isset($_SESSION['userName']) || $_SESSION['userName'] =='') { $_SESSION['errorMsg'] = $this->lang->line('msg_session_expire'); $this->load->model('dal/identity_db_manager'); $objIdentity = $this->identity_db_manager; $arrDetails['workPlaceDetails'] = $objIdentity->getWorkPlaces(); $this->load->view('login', $arrDetails); } else { $this->load->model('dal/identity_db_manager'); $this->load->model('dal/timeline_db_manager'); $objIdentity = $this->identity_db_manager; $this->load->model('identity/teeme_managers'); $objTeemeManagers = $this->teeme_managers; $this->load->model('dal/time_manager'); $objTime = $this->time_manager; $this->load->model('dal/tag_db_manager'); $this->load->model('identity/work_space'); $objWorkSpace = $this->work_space; $this->load->model('identity/work_space_members'); $this->load->model('dal/notification_db_manager'); $objWorkSpaceMembers = $this->work_space_members; $workSpaceId = $this->input->post('workSpaceId'); /*Dashrath: transaction start here*/ //$this->db->trans_begin(); $this->db->trans_start(); //Added by Dashrath- Get workspace details for event data table $workSpaceDetails = $this->identity_db_manager->getWorkSpaceDetailsByWorkSpaceId($workSpaceId); //Dashrath- code end $oldMemberIds = array(); $newMemberIds = array(); $arrOldWorkSpaceMembers = array(); $arrNewWorkSpaceMembers = array(); $membersToAdd = array(); $membersToRemove = array(); $arrOldWorkSpaceMembers = $this->identity_db_manager->getWorkSpaceMembersByWorkSpaceId($workSpaceId); foreach($arrOldWorkSpaceMembers as $membersData){ $oldMemberIds[] = $membersData['userId']; } $arrNewWorkSpaceMembers = explode(',',$this->input->post('memberslist')); foreach($arrNewWorkSpaceMembers as $workSpaceMemberId) { $newMemberIds[] = $workSpaceMemberId; } //echo "<pre>Old Members ids= "; print_r($oldMemberIds); //echo "<pre>New Members ids= "; print_r($newMemberIds); //exit; // Find newly added members foreach($newMemberIds as $member){ if (!in_array($member,$oldMemberIds)){ //echo "<li>Added= ".$member; $membersToAdd[] = $member; } } // Find removed members foreach($oldMemberIds as $member){ if (!in_array($member,$newMemberIds)){ //echo "<li>Removed= ".$member; $membersToRemove[] = $member; } } //echo "<pre>Members to remove= "; print_r($membersToRemove); //exit; if(count($membersToAdd)>0){ $this->timeline_db_manager->add_remove_post_participant(2,$workSpaceId,$membersToAdd,1); } if(count($membersToRemove)>0){ $this->timeline_db_manager->add_remove_post_participant(2,$workSpaceId,$membersToRemove,0); } $objWorkSpace->setWorkSpaceName( $this->input->post('workSpaceName') ); $objWorkSpace->setTreeAccessValue( $this->input->post('treeAccess') ); $objWorkSpace->setWorkSpaceId( $workSpaceId ); //$objWorkSpace->setWorkSpaceShowContentValue( $this->input->post('showTreeContent') ); if($objIdentity->updateRecord( $objWorkSpace, 'work_space')) { //$arrWorkSpaceMembers = $this->input->post('workSpaceMembers',true); $arrWorkSpaceMembers = explode(',',$this->input->post('memberslist')); if($arrWorkSpaceMembers!='') { if(isset($arrWorkSpaceMembers)) { $objIdentity->deleteWorkSpaceMembersByWorkSpaceId($workSpaceId); foreach($arrWorkSpaceMembers as $workSpaceMemberId) { $objWorkSpaceMembers->setWorkSpaceId( $workSpaceId ); $objWorkSpaceMembers->setWorkSpaceUserId( $workSpaceMemberId ); $objWorkSpaceMembers->setWorkSpaceUserAccess( 0 ); $objIdentity->insertRecord( $objWorkSpaceMembers, 'work_space_members'); } } } else{ $objIdentity->deleteWorkSpaceMembersByWorkSpaceId($workSpaceId); } //$arrWorkSpaceManagers = $this->input->post('workSpaceManagers'); $arrWorkSpaceManagers = explode(',',$this->input->post('managerslist')); if(isset($arrWorkSpaceManagers)) { $objIdentity->deleteTeemeManagersByPlaceId($workSpaceId,3); foreach($arrWorkSpaceManagers as $workSpaceManagerId) { $objTeemeManagers->setPlaceId( $workSpaceId ); $objTeemeManagers->setManagerId( $workSpaceManagerId ); $objTeemeManagers->setPlaceType( 3 ); $objIdentity->insertRecord( $objTeemeManagers, 'teeme_managers'); if (!in_array($workSpaceManagerId,$arrWorkSpaceMembers)) { $objWorkSpaceMembers->setWorkSpaceId( $workSpaceId ); $objWorkSpaceMembers->setWorkSpaceUserId( $workSpaceManagerId ); $objWorkSpaceMembers->setWorkSpaceUserAccess( 0 ); $objIdentity->insertRecord( $objWorkSpaceMembers, 'work_space_members'); } } } //Space tree config start $arrWorkSpaceTreeType = explode(',',$this->input->post('treeTypeList')); $objIdentity->delete_space_tree_config($workSpaceId,1); if(!empty($arrWorkSpaceTreeType)) { foreach($arrWorkSpaceTreeType as $workSpaceTreeTypeId) { $spaceTreeData =array(); $spaceTreeData['workSpaceId'] = $workSpaceId; $spaceTreeData['workSpaceType'] = '1'; $spaceTreeData['treeTypeId'] = $workSpaceTreeTypeId; $objIdentity->space_tree_config($spaceTreeData); } } //Space tree config end $objIdentity->updateSpaceMembersMemCache($workSpaceId,'1'); $_SESSION['successMsg'] = $this->lang->line('msg_workspace_update_success'); //log application message start $var1 = array("{spacename}", "{username}", "{placename}"); $var2 = array($this->input->post('workSpaceName'), $_SESSION['userTagName'], $_SESSION['contName']); $logMsg = str_replace($var1,$var2,$this->lang->line('txt_space_update_log')); log_message('MY_PLACE', $logMsg); //log application message end //Manoj: Insert space edit notification start $notificationDetails=array(); $notification_url=''; $notificationDetails['created_date']=$objTime->getGMTTime(); $notificationDetails['object_id']='10'; $notificationDetails['action_id']='2'; //Added by dashrath $notificationDetails['parent_object_id']='10'; //$notification_url='edit_workspace/index/'.$workSpaceId.'/1'; //edit_workspace/index/61/1 $notificationDetails['url'] = ''; /*if($notificationDetails['url']!='') {*/ /*Added by Dashrath- Add data in events data table*/ $notificationDispatchDetails['data']=$workSpaceDetails['workSpaceName']; //Set notification data $notification_data_id=$this->notification_db_manager->set_notification_data($notificationDispatchDetails); if($notification_data_id!='') { $notificationDetails['notification_data_id']= $notification_data_id; } /*Dashrath- code end*/ $notificationDetails['workSpaceId']= $workSpaceId; $notificationDetails['workSpaceType']= '1'; $notificationDetails['object_instance_id']=$workSpaceId; $notificationDetails['user_id']=$_SESSION['userId']; $notification_id = $this->notification_db_manager->set_notification($notificationDetails); if($notification_id!='') { //Set notification dispatch data start $work_space_managers = $this->input->post('workSpaceManagers'); if(count($work_space_managers)!=0) { foreach($work_space_managers as $user_id) { if($user_id!=$_SESSION['userId']) { //get user object action preference //$userObjectActionPreference=$this->notification_db_manager->get_notification_user_preference($user_id); /*foreach($userObjectActionPreference as $keyVal=>$userPreferenceData) { if($userPreferenceData['notification_type_id']==$notificationDetails['object_id'] && $userPreferenceData['notification_action_type_id']==$notificationDetails['action_id'] && $userPreferenceData['preference']==1) {*/ //get user language preference $userLanguagePreference=$this->identity_db_manager->getUserDetailsByUserId($user_id); if(count($userLanguagePreference)>0 && $userLanguagePreference['notification_language_id']!=0) { $getLanguageName=$this->notification_db_manager->get_notification_language_name($userLanguagePreference['notification_language_id']); $this->lang->load($getLanguageName.'_lang', $getLanguageName); $this->lang->is_loaded = array(); $notification_language_id=$userLanguagePreference['notification_language_id']; //$this->lang->language = array(); } else { $languageName='english'; $this->lang->load($languageName.'_lang', $languageName); $this->lang->is_loaded = array(); $notification_language_id='1'; } //get notification template using object and action id $getNotificationTemplate=$this->notification_db_manager->get_notification_template($notificationDetails['object_id'], $notificationDetails['action_id']); $getNotificationTemplate=trim($getNotificationTemplate); $getUserName = $this->identity_db_manager->getUserDetailsByUserId($_SESSION['userId']); $recepientUserName = $getUserName['firstName'].' '.$getUserName['lastName']; //$notifyUrl = '<a class="notificatonUrl" href='.base_url().''.$notificationDetails['url'].'>'.base_url().''.$notificationDetails['url'].'</a>'; $work_space_name = $this->input->post('workSpaceName'); $user_template = array("{username}", "{spacename}"); $user_translate_template = array($recepientUserName, $work_space_name); //$translatedTemplate = '<a class="notificatonUrl" href='.base_url().''.$notificationDetails['url'].'>'.str_replace($user_template, $user_translate_template,$this->lang->line($getNotificationTemplate)).'</a>'; //Serialize notification data $notificationContent=array(); $notificationContent['data']=str_replace($user_template, $user_translate_template,$this->lang->line($getNotificationTemplate)); $notificationContent['url']=''; $translatedTemplate = serialize($notificationContent); $notificationDispatchDetails=array(); $notificationDispatchDetails['data']=$notificationContent['data']; $notificationDispatchDetails['url']=$notificationContent['url']; $notificationDispatchDetails['notification_id']=$notification_id; $notificationDispatchDetails['notification_template']=$translatedTemplate; $notificationDispatchDetails['notification_language_id']=$notification_language_id; //Set notification data /*$notification_data_id=$this->notification_db_manager->set_notification_data($notificationDispatchDetails);*/ $notificationDispatchDetails['recepient_id']=$user_id; $notificationDispatchDetails['create_time']=$objTime->getGMTTime(); $notificationDispatchDetails['notification_mode_id']='1'; /*$notificationDispatchDetails['notification_data_id']=$notification_data_id;*/ //get user mode preference $userModePreference=$this->notification_db_manager->get_notification_email_preference($user_id); $userPersonalizeModePreference=$this->notification_db_manager->get_notification_email_preference($user_id,'6'); $userAllModePreference=$this->notification_db_manager->get_notification_email_preference($user_id,'5'); //echo $notificationDispatchDetails['notification_template']; //Insert application mode notification here if($userPersonalizeModePreference==1) { //no personalization } else { $setAppNotificationDispatch=$this->notification_db_manager->set_notification_dispatch($notificationDispatchDetails); $notificationDispatchDetails['notification_dispatch_id'] = $setAppNotificationDispatch; $this->notification_db_manager->set_notification_event_and_dispatch_id($notificationDispatchDetails); } //Insert application mode notification end here foreach($userModePreference as $emailPreferenceData) { if($emailPreferenceData['notification_type_id']==1) { if($emailPreferenceData['notification_priority_id']==3 && $emailPreferenceData['preference']==1) { //Email notification every hour $notificationDispatchDetails['notification_mode_id']='3'; $setNotificationDispatch=$this->notification_db_manager->set_notification_dispatch($notificationDispatchDetails); $notificationDispatchDetails['notification_dispatch_id'] = $setNotificationDispatch; $this->notification_db_manager->set_notification_event_and_dispatch_id($notificationDispatchDetails); } if($emailPreferenceData['notification_priority_id']==4 && $emailPreferenceData['preference']==1) { //Email notification every 24 hours $notificationDispatchDetails['notification_mode_id']='4'; $setNotificationDispatch=$this->notification_db_manager->set_notification_dispatch($notificationDispatchDetails); $notificationDispatchDetails['notification_dispatch_id'] = $setNotificationDispatch; $this->notification_db_manager->set_notification_event_and_dispatch_id($notificationDispatchDetails); } } } /*} }*/ } } } //Set notification dispatch data end } /*}*/ //Manoj: Insert space edit notification end $placePanel = $this->input->post('placePanel'); /*Added by Dashrath- add create folder code*/ //create new folder in worspace $newFolderName = str_replace(' ','_', $this->input->post('workSpaceName')); $oldFolderName = str_replace(' ','_', $workSpaceDetails['workSpaceName']); $workSpaceType = 1; $workPlaceName = $_SESSION['contName']; if($newFolderName!=$oldFolderName) { $resData = "false"; $folderUpdateRes = "false"; //check folder name already exists in db $folderId = $objIdentity->checkFolderNameById($newFolderName, $workSpaceId, $workSpaceType, $_SESSION['userId']); if($folderId==0) { //update record in data base $folderUpdateRes = $objIdentity->updateFolder($oldFolderName, $newFolderName, $workSpaceId, $workSpaceType); if($folderUpdateRes=="true") { //folder rename $resData = $objIdentity->folderRename($oldFolderName, $newFolderName, $workSpaceId, $workSpaceType, $workPlaceName); } } } else { $resData = "true"; $folderUpdateRes = "true"; } //Dashrath: Checking transaction status here if($this->db->trans_status()=== FALSE || $resData == "false" || $folderUpdateRes == "false") { $this->db->trans_rollback(); $_SESSION['successMsg'] = ''; if($placePanel!=1) { $_SESSION['errorMsg'] = $this->lang->line('error_db_insertion'); redirect('edit_workspace/index/'.$workSpaceId, 'location'); } else { $_SESSION['errorMsg'] = $this->lang->line('error_db_insertion'); redirect('edit_workspace/place/'.$workSpaceId, 'location'); } } else { // $this->db->trans_commit(); $this->db->trans_complete(); } /*Dashrath- code end*/ if(isset($_SESSION['workPlacePanel'])) { redirect('manage_workplace','location'); } else { if($placePanel!=1) { redirect('edit_workspace/index/'.$workSpaceId, 'location'); } else { redirect('edit_workspace/place/'.$workSpaceId, 'location'); } } } else { if($placePanel!=1) { $_SESSION['errorMsg'] = $this->lang->line('error_db_insertion'); redirect('edit_workspace/'.$workSpaceId, 'location'); } else { $_SESSION['errorMsg'] = $this->lang->line('error_db_insertion'); redirect('edit_workspace/place'.$workSpaceId, 'location'); } } } }
[ "function update()\r\n\t{\t\t\t\t\r\n\t\tif(!isset($_SESSION['workPlaceManagerName']) || $_SESSION['workPlaceManagerName'] =='')\r\n\t\t{\r\n\t\t\t$_SESSION['errorMsg']\t= \t$this->lang->line('msg_session_expire'); \r\n\t\t\t$this->load->model('dal/identity_db_manager');\t\t\t\t\t\t\r\n\t\t\t$objIdentity\t= $this->identity_db_manager;\t\r\n\t\t\t$arrDetails['workPlaceDetails'] \t= $objIdentity->getWorkPlaces();\t\r\n\t\t\t$this->load->view('login', $arrDetails);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t$this->load->model('dal/identity_db_manager');\r\n\t\t\t$objIdentity\t= $this->identity_db_manager;\t\t\t\t\r\n\t\t\t$this->load->model('identity/teeme_managers');\r\n\t\t\t$objTeemeManagers\t= $this->teeme_managers;\r\n\t\t\t$this->load->model('dal/time_manager');\t\t\r\n\t\t\t$this->load->model('identity/work_space');\r\n\t\t\t$objWorkSpace\t= $this->work_space;\r\n\t\t\t$this->load->model('identity/work_space_members');\r\n\t\t\t$objWorkSpaceMembers\t= $this->work_space_members;\t\t\r\n\t\t\t$workSpaceId = $this->input->post('workSpaceId');\r\n\t\t\t$objIdentity->deleteWorkSpaceMembersByWorkSpaceId($workSpaceId);\r\n\t\t\t$objIdentity->deleteTeemeManagersByPlaceId($workSpaceId,3);\t\r\n\t\t\t$objWorkSpace->setWorkSpaceName( $this->input->post('workSpaceName') );\r\n\t\t\t$objWorkSpace->setWorkSpaceId( $workSpaceId );\r\n\t\t\tif($objIdentity->updateRecord( $objWorkSpace, 'work_space'))\r\n\t\t\t{\r\n\t\t\t\t$arrWorkSpaceMembers = $this->input->post('workSpaceMembers');\t\t\t\t\r\n\t\t\t\tif(!empty($arrWorkSpaceMembers))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($arrWorkSpaceMembers as $workSpaceMemberId)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$objWorkSpaceMembers->setWorkSpaceId( $workSpaceId );\t\r\n\t\t\t\t\t\t$objWorkSpaceMembers->setWorkSpaceUserId( $workSpaceMemberId );\t\r\n\t\t\t\t\t\t$objWorkSpaceMembers->setWorkSpaceUserAccess( 0 );\t\r\n\t\t\t\t\t\t$objIdentity->insertRecord( $objWorkSpaceMembers, 'work_space_members');\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$arrWorkSpaceManagers = $this->input->post('workSpaceManagers');\r\n\t\t\t\t\r\n\t\t\t\tif(!empty($arrWorkSpaceManagers))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($arrWorkSpaceManagers as $workSpaceManagerId)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$objTeemeManagers->setPlaceId( $workSpaceId );\t\r\n\t\t\t\t\t\t$objTeemeManagers->setManagerId( $workSpaceManagerId );\t\r\n\t\t\t\t\t\t$objTeemeManagers->setPlaceType( 3 );\t\r\n\t\t\t\t\t\t$objIdentity->insertRecord( $objTeemeManagers, 'teeme_managers');\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$_SESSION['successMsg'] = $this->lang->line('work_space_updated_successfully');\r\n\t\t\t\tredirect('admin/view_work_spaces','location');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$_SESSION['errorMsg'] = $this->lang->line('Error_database_insertion');\r\n\t\t\t\tredirect('admin/edit_work_space/'.$workSpaceId, 'location');\r\n\t\t\t}\t\t\t\t\t\r\n\t\t}\r\n\t}", "function update()\r\n\t{\t\t\t\t\r\n\t\tif(!isset($_SESSION['workPlaceManagerName']) || $_SESSION['workPlaceManagerName'] =='')\r\n\t\t{\r\n\t\t\t$_SESSION['errorMsg']\t= \t$this->lang->line('msg_session_expire'); \r\n\t\t\t$this->load->model('dal/identity_db_manager');\t\t\t\t\t\t\r\n\t\t\t$objIdentity\t= $this->identity_db_manager;\t\r\n\t\t\t$arrDetails['workPlaceDetails'] \t= $objIdentity->getWorkPlaces();\t\r\n\t\t\t$this->load->view('login', $arrDetails);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t$this->load->model('dal/identity_db_manager');\r\n\t\t\t$objIdentity\t= $this->identity_db_manager;\t\t\t\t\r\n\t\t\t$this->load->model('identity/teeme_managers');\r\n\t\t\t$objTeemeManagers\t= $this->teeme_managers;\t\t\r\n\t\t\t$this->load->model('identity/sub_work_space');\r\n\t\t\t$objSubWorkSpace\t= $this->sub_work_space;\r\n\t\t\t$this->load->model('identity/sub_work_space_members');\r\n\t\t\t$objSubWorkSpaceMembers\t= $this->sub_work_space_members;\r\n\t\t\t$this->load->model('dal/time_manager');\t\t\t\t\r\n\t\t\t$subWorkSpaceId = $this->input->post('subWorkSpaceId');\t\r\n\t\t\t$workSpaceId = $this->input->post('workSpaceId');\r\n\t\t\t$objIdentity->deleteSubWorkSpaceMembersBySubWorkSpaceId($subWorkSpaceId);\r\n\t\t\t$objIdentity->deleteTeemeManagersByPlaceId($subWorkSpaceId,4);\t\r\n\t\t\t$objSubWorkSpace->setSubWorkSpaceName( $this->input->post('workSpaceName') );\r\n\t\t\t$objSubWorkSpace->setSubWorkSpaceId( $subWorkSpaceId );\r\n\t\t\r\n\t\t\tif($objIdentity->updateRecord( $objSubWorkSpace, 'sub_work_space'))\r\n\t\t\t{\r\n\t\t\t\t$arrWorkSpaceMembers = $this->input->post('workSpaceMembers');\r\n\t\t\t\t\r\n\t\t\t\tif(!empty($arrWorkSpaceMembers))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($arrWorkSpaceMembers as $workSpaceMemberId)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$objSubWorkSpaceMembers->setSubWorkSpaceId( $subWorkSpaceId );\t\r\n\t\t\t\t\t\t$objSubWorkSpaceMembers->setSubWorkSpaceUserId( $workSpaceMemberId );\t\r\n\t\t\t\t\t\t$objSubWorkSpaceMembers->setSubWorkSpaceUserAccess( 0 );\t\r\n\t\t\t\t\t\t$objIdentity->insertRecord( $objSubWorkSpaceMembers, 'sub_work_space_members');\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$arrWorkSpaceManagers = $this->input->post('workSpaceManagers');\r\n\t\t\t\tif(!empty($arrWorkSpaceManagers))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($arrWorkSpaceManagers as $workSpaceManagerId)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$objTeemeManagers->setPlaceId( $subWorkSpaceId );\t\r\n\t\t\t\t\t\t$objTeemeManagers->setManagerId( $workSpaceManagerId );\t\r\n\t\t\t\t\t\t$objTeemeManagers->setPlaceType( 4 );\t\r\n\t\t\t\t\t\t$objIdentity->insertRecord( $objTeemeManagers, 'teeme_managers');\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$_SESSION['successMsg'] = $this->lang->line('subspace_edited_successfully');\r\n\t\t\t\tredirect('admin/view_sub_work_spaces/index/'.$workSpaceId, 'location');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$_SESSION['errorMsg'] = $this->lang->line('Error_database_insertion');\r\n\t\t\t\tredirect('admin/create_work_space', 'location');\r\n\t\t\t}\t\t\t\t\t\r\n\t\t}\r\n\t}", "function update()\r\n\t{\t\t\t\t\r\n\t\tif(!isset($_SESSION['userName']) || $_SESSION['userName'] =='')\r\n\t\t{\r\n\t\t\t$_SESSION['errorMsg']\t= \t$this->lang->line('msg_session_expire'); \r\n\t\t\t$this->load->model('dal/identity_db_manager');\t\t\t\t\t\t\r\n\t\t\t$objIdentity\t= $this->identity_db_manager;\t\r\n\t\t\t$arrDetails['workPlaceDetails'] \t= $objIdentity->getWorkPlaces();\t\r\n\t\t\t$this->load->view('login', $arrDetails);\r\n\t\t}\r\n\t\telse\r\n\t\t{\t\r\n\t\t\t$this->load->model('dal/identity_db_manager');\r\n\t\t\t$objIdentity\t= $this->identity_db_manager;\t\t\t\t\r\n\t\t\t$this->load->model('identity/teeme_managers');\r\n\t\t\t$objTeemeManagers\t= $this->teeme_managers;\t\t\r\n\t\t\t$this->load->model('identity/sub_work_space');\r\n\t\t\t$objSubWorkSpace\t= $this->sub_work_space;\r\n\t\t\t$this->load->model('identity/sub_work_space_members');\r\n\t\t\t$objSubWorkSpaceMembers\t= $this->sub_work_space_members;\r\n\t\t\t$this->load->model('dal/time_manager');\t\r\n\t\t\t$objTime\t\t= $this->time_manager;\t\t\t\t\t\r\n\t\t\t$this->load->model('dal/notification_db_manager');\t\r\n\t\t\t$subWorkSpaceId = $this->input->post('subWorkSpaceId');\t\r\n\t\t\t$workSpaceId = $this->input->post('workSpaceId');\r\n\t\t\t$workSpaceType = $this->input->post('workSpaceType');\r\n\r\n\t\t\t/*Dashrath: transaction start here*/\r\n\t\t\t//$this->db->trans_begin();\r\n\t\t\t$this->db->trans_start();\r\n\r\n\t\t\t/*Added by Dashrath- Get subworkspace details for event data table*/\r\n\t\t\t$subWorkSpaceDetails\t= $this->identity_db_manager->getSubWorkSpaceDetailsBySubWorkSpaceId($subWorkSpaceId);\r\n\t\t\t/*Dashrath- code end*/\r\n\r\n\t\t\t$objIdentity->deleteSubWorkSpaceMembersBySubWorkSpaceId($subWorkSpaceId);\r\n\t\t\t$objIdentity->deleteTeemeManagersByPlaceId($subWorkSpaceId,4);\t\r\n\t\t\t$objSubWorkSpace->setSubWorkSpaceName( $this->input->post('workSpaceName') );\r\n\t\t\t$objSubWorkSpace->setSubWorkSpaceId( $subWorkSpaceId );\r\n\t\t\t\r\n\t\t\tif($objIdentity->updateRecord( $objSubWorkSpace, 'sub_work_space'))\r\n\t\t\t{\r\n\t\t\t\t//$arrWorkSpaceMembers = $this->input->post('workSpaceMembers');\r\n\t\t\t\t$arrWorkSpaceMembers = explode(',',$this->input->post('memberslist'));\r\n\t\t\t\t\r\n\t\t\t\tif(!empty($arrWorkSpaceMembers))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($arrWorkSpaceMembers as $workSpaceMemberId)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$objSubWorkSpaceMembers->setSubWorkSpaceId( $subWorkSpaceId );\t\r\n\t\t\t\t\t\t$objSubWorkSpaceMembers->setSubWorkSpaceUserId( $workSpaceMemberId );\t\r\n\t\t\t\t\t\t$objSubWorkSpaceMembers->setSubWorkSpaceUserAccess( 0 );\t\r\n\t\t\t\t\t\t$objIdentity->insertRecord( $objSubWorkSpaceMembers, 'sub_work_space_members');\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$arrWorkSpaceManagers = $this->input->post('workSpaceManagers');\r\n\t\t\t\tif(!empty($arrWorkSpaceManagers))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($arrWorkSpaceManagers as $workSpaceManagerId)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$objTeemeManagers->setPlaceId( $subWorkSpaceId );\t\r\n\t\t\t\t\t\t$objTeemeManagers->setManagerId( $workSpaceManagerId );\t\r\n\t\t\t\t\t\t$objTeemeManagers->setPlaceType( 4 );\t\r\n\t\t\t\t\t\t$objIdentity->insertRecord( $objTeemeManagers, 'teeme_managers');\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Space tree config start \r\n\t\t\t\t\r\n\t\t\t\t$arrWorkSubSpaceTreeType = explode(',',$this->input->post('treeTypeList'));\r\n\t\t\t\t$objIdentity->delete_space_tree_config($subWorkSpaceId,2);\r\n\t\t\t\tif(!empty($arrWorkSubSpaceTreeType))\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($arrWorkSubSpaceTreeType as $workSpaceTreeTypeId)\r\n\t\t\t\t\t{\t\t\t\t\t\t\r\n\t\t\t\t\t\t$spaceTreeData =array(); \r\n\t\t\t\t\t\t$spaceTreeData['workSpaceId'] = $subWorkSpaceId;\r\n\t\t\t\t\t\t$spaceTreeData['workSpaceType'] = '2';\t\t\r\n\t\t\t\t\t\t$spaceTreeData['treeTypeId'] = $workSpaceTreeTypeId;\t\r\n\t\t\t\t\t\t$objIdentity->space_tree_config($spaceTreeData);\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//Space tree config end\r\n\t\t\t\t\r\n\t\t\t\t$objIdentity->updateSpaceMembersMemCache($subWorkSpaceId,'2');\r\n\t\t\t\t\r\n\t\t\t\t$_SESSION['successMsg'] = $this->lang->line('subspace_edited_successfully');\r\n\t\t\t\t\r\n\t\t\t\t//log application message start\r\n\t\t\t\t$var1 = array(\"{subspacename}\", \"{username}\", \"{placename}\");\r\n\t\t\t\t$var2 = array($this->input->post('workSpaceName'), $_SESSION['userTagName'], $_SESSION['contName']);\r\n\t\t\t\t$logMsg = str_replace($var1,$var2,$this->lang->line('txt_subspace_update_log'));\r\n\t\t\t\tlog_message('MY_PLACE', $logMsg);\r\n\t\t\t\t//log application message end\r\n\t\t\t\t\r\n\t\t\t\t//Manoj: Insert subspace edit notification start\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$notificationDetails=array();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$notification_url='';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$notificationDetails['created_date']=$objTime->getGMTTime();\r\n\t\t\t\t\t\t\t\t$notificationDetails['object_id']='11';\r\n\t\t\t\t\t\t\t\t$notificationDetails['action_id']='2';\r\n\r\n\t\t\t\t\t\t\t\t//Added by dashrath\r\n\t\t\t\t\t\t\t\t$notificationDetails['parent_object_id']='11';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t//$notification_url='edit_sub_work_space/index/'.$workSpaceId.'/'.$subWorkSpaceId;\r\n\t\t\t\t\t\t\t\t//edit_workspace/index/61/1\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$notificationDetails['url'] = '';\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t/*if($notificationDetails['url']!='')\t\r\n\t\t\t\t\t\t\t\t{*/\t\r\n\r\n\t\t\t\t\t\t\t\t\t/*Added by Dashrath- Add data in events data table*/\r\n\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['data']=$subWorkSpaceDetails['subWorkSpaceName'];\r\n\t\t\t\t\t\t\t\t\t//Set notification data \r\n\t\t\t\t\t\t\t\t\t$notification_data_id=$this->notification_db_manager->set_notification_data($notificationDispatchDetails); \r\n\r\n\t\t\t\t\t\t\t\t\tif($notification_data_id!='')\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t$notificationDetails['notification_data_id']= $notification_data_id;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t/*Dashrath- code end*/\r\n\r\n\t\t\t\t\t\t\t\t\t$notificationDetails['workSpaceId']= $subWorkSpaceId;\r\n\t\t\t\t\t\t\t\t\t$notificationDetails['workSpaceType']= '2';\r\n\t\t\t\t\t\t\t\t\t$notificationDetails['object_instance_id']=$subWorkSpaceId;\r\n\t\t\t\t\t\t\t\t\t$notificationDetails['user_id']=$_SESSION['userId'];\r\n\t\t\t\t\t\t\t\t\t$notification_id = $this->notification_db_manager->set_notification($notificationDetails); \r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tif($notification_id!='')\r\n\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t//Set notification dispatch data start\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t//$work_space_managers\t= $this->input->post('workSpaceManagers');\r\n\t\t\t\t\t\t\t\t\t\t$work_space_managers\t= $this->identity_db_manager->getWorkSpaceManagersByWorkSpaceId($workSpaceId,'3');\t\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tif(count($work_space_managers)!=0)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\tforeach($work_space_managers as $user_id)\r\n\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\tif($user_id!=$_SESSION['userId'])\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//get user object action preference\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t//$userObjectActionPreference=$this->notification_db_manager->get_notification_user_preference($user_id);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/*foreach($userObjectActionPreference as $keyVal=>$userPreferenceData)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($userPreferenceData['notification_type_id']==$notificationDetails['object_id'] && $userPreferenceData['notification_action_type_id']==$notificationDetails['action_id'] && $userPreferenceData['preference']==1)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{*/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//get user language preference\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$userLanguagePreference=$this->identity_db_manager->getUserDetailsByUserId($user_id);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(count($userLanguagePreference)>0 && $userLanguagePreference['notification_language_id']!=0)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$getLanguageName=$this->notification_db_manager->get_notification_language_name($userLanguagePreference['notification_language_id']);\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->lang->load($getLanguageName.'_lang', $getLanguageName);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->lang->is_loaded = array();\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notification_language_id=$userLanguagePreference['notification_language_id'];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$this->lang->language = array();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$languageName='english';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->lang->load($languageName.'_lang', $languageName);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->lang->is_loaded = array();\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notification_language_id='1';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//get notification template using object and action id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$getNotificationTemplate=$this->notification_db_manager->get_notification_template($notificationDetails['object_id'], $notificationDetails['action_id']);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$getNotificationTemplate=trim($getNotificationTemplate);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$getUserName = $this->identity_db_manager->getUserDetailsByUserId($_SESSION['userId']);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$recepientUserName = $getUserName['firstName'].' '.$getUserName['lastName'];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$notifyUrl = '<a class=\"notificatonUrl\" href='.base_url().''.$notificationDetails['url'].'>'.base_url().''.$notificationDetails['url'].'</a>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$work_space_name = $this->input->post('workSpaceName');\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$user_template = array(\"{username}\", \"{subspacename}\");\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$user_translate_template = array($recepientUserName, $work_space_name);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//$translatedTemplate = '<a class=\"notificatonUrl\" href='.base_url().''.$notificationDetails['url'].'>'.str_replace($user_template, $user_translate_template,$this->lang->line($getNotificationTemplate)).'</a>';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Serialize notification data\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationContent=array();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationContent['data']=str_replace($user_template, $user_translate_template,$this->lang->line($getNotificationTemplate));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationContent['url']='';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$translatedTemplate = serialize($notificationContent);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails=array();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['data']=$notificationContent['data'];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['url']=$notificationContent['url'];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_id']=$notification_id;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_template']=$translatedTemplate;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_language_id']=$notification_language_id;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Set notification data \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*$notification_data_id=$this->notification_db_manager->set_notification_data($notificationDispatchDetails);*/ \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['recepient_id']=$user_id;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['create_time']=$objTime->getGMTTime();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_mode_id']='1';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*$notificationDispatchDetails['notification_data_id']=$notification_data_id;*/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//get user mode preference\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$userModePreference=$this->notification_db_manager->get_notification_email_preference($user_id);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$userPersonalizeModePreference=$this->notification_db_manager->get_notification_email_preference($user_id,'6');\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$userAllModePreference=$this->notification_db_manager->get_notification_email_preference($user_id,'5');\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//echo $notificationDispatchDetails['notification_template']; \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Insert application mode notification here\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($userPersonalizeModePreference==1)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//no personalization\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$setAppNotificationDispatch=$this->notification_db_manager->set_notification_dispatch($notificationDispatchDetails);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_dispatch_id'] = $setAppNotificationDispatch;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->notification_db_manager->set_notification_event_and_dispatch_id($notificationDispatchDetails);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Insert application mode notification end here \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tforeach($userModePreference as $emailPreferenceData)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($emailPreferenceData['notification_type_id']==1)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($emailPreferenceData['notification_priority_id']==3 && $emailPreferenceData['preference']==1)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Email notification every hour\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_mode_id']='3';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$setNotificationDispatch=$this->notification_db_manager->set_notification_dispatch($notificationDispatchDetails); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_dispatch_id'] = $setNotificationDispatch;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->notification_db_manager->set_notification_event_and_dispatch_id($notificationDispatchDetails);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($emailPreferenceData['notification_priority_id']==4 && $emailPreferenceData['preference']==1)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Email notification every 24 hours\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_mode_id']='4';\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$setNotificationDispatch=$this->notification_db_manager->set_notification_dispatch($notificationDispatchDetails); \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$notificationDispatchDetails['notification_dispatch_id'] = $setNotificationDispatch;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->notification_db_manager->set_notification_event_and_dispatch_id($notificationDispatchDetails);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/*}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}*/\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t//Set notification dispatch data end\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t/*}*/\t\r\n\t\t\t\t\t\t\t\t//Manoj: Insert subspace edit notification end\r\n\t\t\t\t\r\n\t\t\t\t/*Added by Dashrath- add create folder code*/\r\n\t\t\t //create new folder in worspace\r\n\t\t\t $newFolderName = str_replace(' ','_', $this->input->post('workSpaceName'));\r\n\t\t\t $oldFolderName = str_replace(' ','_', $subWorkSpaceDetails['subWorkSpaceName']);\r\n\t\t\t $workSpaceType1 = 2;\r\n\t\t\t $workPlaceName = $_SESSION['contName'];\r\n\t\t\t\t\r\n\t\t\t\tif($newFolderName!=$oldFolderName)\r\n\t\t\t\t{\r\n\t\t\t\t\t$resData = \"false\";\r\n\t\t\t\t\t$folderUpdateRes = \"false\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t//check folder name already exists in db\r\n\t\t\t\t\t$folderId = $objIdentity->checkFolderNameById($newFolderName, $subWorkSpaceId, $workSpaceType1, $_SESSION['userId']);\r\n\r\n\t\t\t\t\tif($folderId==0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//update record in data base\r\n\t\t\t\t\t\t$folderUpdateRes = $objIdentity->updateFolder($oldFolderName, $newFolderName, $subWorkSpaceId, $workSpaceType1);\r\n\t\t\t\t\t\tif($folderUpdateRes==\"true\")\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t//folder rename\r\n\t\t\t\t\t\t\t$resData = $objIdentity->folderRename($oldFolderName, $newFolderName, $subWorkSpaceId, $workSpaceType1, $workPlaceName);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t$resData = \"true\";\r\n\t\t\t\t\t$folderUpdateRes = \"true\";\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t//Dashrath: Checking transaction status here\r\n\t\t\t\tif($this->db->trans_status()=== FALSE || $resData == \"false\" || $folderUpdateRes == \"false\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->db->trans_rollback();\r\n\r\n\t\t\t\t\t$_SESSION['successMsg'] = '';\r\n\r\n\t\t\t\t\t$_SESSION['errorMsg'] = $this->lang->line('Error_database_insertion');\r\n\t\t\t\t\tredirect('edit_sub_work_space/index/'.$workSpaceId.'/'.$subWorkSpaceId, 'location');\t\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t// $this->db->trans_commit();\r\n\t\t\t\t\t$this->db->trans_complete();\r\n\t\t\t\t}\t\t\r\n\t\t\t\t/*Dashrath- code end*/\r\n\r\n\t\t\t\tif($this->identity_db_manager->getManagerStatus($_SESSION['userId'], $workSpaceId, 3))\r\n\t\t\t\t{\t\r\n\t\t\t\t\tredirect('view_sub_work_spaces/index/'.$workSpaceId.'/'.$workSpaceType, 'location');\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tredirect('edit_sub_work_space/index/'.$workSpaceId.'/'.$subWorkSpaceId, 'location');\t\r\n\t\t\t\t}\t\t\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$_SESSION['errorMsg'] = $this->lang->line('Error_database_insertion');\r\n\t\t\t\tredirect('create_work_space', 'location');\r\n\t\t\t}\t\t\t\t\t\r\n\t\t}\r\n\t}", "public function updateDb()\n {\n $form = \"Term = '%s', Number = '%s', NumAdmins = %d, NumLecturers = %d, NumRecitators = %d,\".\n \" NumFullRecTas = %d, NumHalfRecTas = %d, NumFullUtilTas = %d, NumHalfUtilTas = %d,\".\n \" NumPartUtilTas = %d\";\n $vals = sprintf($form,\n $this->term,$this->number,\n $this->numAdmins,$this->numLecturers,$this->numRecitators,\n $this->numFullRecTas,$this->numHalfRecTas,\n $this->numFullUtilTas,$this->numHalfUtilTas,\n $this->numPartUtilTas);\n $sql = \" update CourseResources set $vals where\".\n \" Term = '$this->term' and Number = '$this->number';\";\n Dbc::getReader()->Exec($sql);\n }", "function update_work_shift()\n\t{\n\t\t// load master model -\n\t\t$this->load->model('mastermodel');\n\n\t\t// get staff id and work shift -\n\t\t$pk \t\t\t= $this->session->userdata(\"userid\");\n\t\t$work_shift \t= trim($_POST['work_shift']);\n\n\t\tif($work_shift == 'M')\n\t\t{\n\t\t\t$data['s_work_shift'] = 'E';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data['s_work_shift'] = 'M';\n\t\t}\n\n\t\t// WHERE condition -\n\t\t$where = array('pk' => $pk);\t// give name for edit record id field on form as 'edit_pk'\n\n\t\t$res = $this->mastermodel->update_data('staff_details', $where, $data);\n\n\t\tif($res)\n\t\t{\n\t\t\techo $pk;\t// send staff id as response\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo 0;\n\t\t}\n\t}", "public function testUpdateSystem()\n {\n }", "public function updateToDb()\n\t{\n\t\t$saved_db = DbUtil::switchToLabConfigRevamp();\n\t\t$query_string =\n\t\t\t\"UPDATE measure SET name='$this->name', range='$this->range', unit='$this->unit' \".\n\t\t\t\"WHERE measure_id=$this->measureId\";\n\t\tquery_blind($query_string);\n\t\tDbUtil::switchRestore($saved_db);\n\t}", "public function testUpdateWorkActivity()\n {\n }", "public function UpdateEmp_WORK(){\n if(isset($_POST['empid']) && !empty($_POST['empid'])){\n $empwrk = Empwork::find_by_id($_POST['instid']);\n \n \n $empwrk->emp_id = $_POST['empid'];\n $empwrk->staff_id = $_POST['staffid']; \n //$empwrk->empl_name = $_POST[''];\n\t\t\t$empwrk->comp_name = $_POST['company'];\n\t\t\t$empwrk->comp_address = $_POST['compaddress'];\n\t\t\t$empwrk->start_year = $_POST['empdatefro'];\n\t\t\t$empwrk->end_year = $_POST['empdateto'];\n\n\t\t\t$empwrk->p_post = $_POST['jobtitle'];\n\t\t\t\n \n if($empwrk->update()){\n \n return true;\n }else{\n return false;\n }\n \n }\n }", "function editWork($student_id,$department_id,$work){\n\t$result = mysql_query(\"select * from `workdata` where `department_id` = '$department_id' \") or die(mysql_error());\n\twhile($row=mysql_fetch_assoc($result)):\n\t\t$value =pcase(sanitize($work[$row['name']])) ;\n\t\t$workdata_id = $row['workdata_id'];\n\t\t$check = mysql_query(\"SELECT * from `work` where `student_id`='$student_id' and `workdata_id`='$workdata_id'\") or die(mysql_error());\n\t\tif(mysql_num_rows($check)):\n\t\t$update = mysql_query(\"UPDATE `work` set `value`='$value' where `student_id`='$student_id' and `workdata_id`='$workdata_id' limit 1\") or die(mysql_error());\n\t\telse:\n\t\t$insert = mysql_query(\"INSERT into `work` values(NULL,'$student_id','$workdata_id','$value') \") or die(mysql_error());\n\t\tendif;\n\tendwhile;\n\tif($update || $insert):\n\t\treturn true;\n\tendif;\n\t// foreach($work as $k=>$v):\n\t// \tif($k=='email'):\n\t// \t\tcontinue;\n\t// \tendif;\n\t// \t$work[$k]=pcase($v);\n\t// endforeach;\n\t// extract($work);\n\t\n\t// $sql=\"update `work` set `company`='$company',`address`='$address',`head`='$head', `contact`='$contact',`email`='$email',`start`='$start',`end`='$end' where `student_id`='$student_id'\";\n\t// $result = mysql_query($sql) or die(mysql_error());\n\t// if($result):\n\t// return mysql_affected_rows();\n\t// endif;\n}", "function mpUpdateWOStat( $qKey )\n {\n global $link;\n global $mp_script;\n global $errors;\n #\n # update mp_work_order status\n #\n $wos = 103;\n $Qquery = \"UPDATE mp_work_order SET wos_id = '$wos' WHERE worder_id = '$qKey'\";\n $Qresult=mysqli_query($link, $Qquery);\n if(!$Qresult)\n {\n $errors[] = \"Work Package: \" . $qkey . \"\";\n $errors[] = \"Errno: \" . mysqli_errno($link);\n\t$errors[] = \"Error: \" . mysqli_error($link);\n $errors[] = $mp_script . \"mpUpdateWOStat : cannot update status to quoted for \" .$qkey. \"\";\n } //end:if\n #\n # return\n #\n return $Qresult;\n }", "public function testUpdateProductionLot()\n {\n }", "function update(){\n \n // Checks which type of shift is being updated\n if($this->shiftType == \"subtask\"){\n // Adds values for relationship table subtask to be used in SQL-statement\n $idName = $this->relationship[0]->idColumnName;\n $relationshipTable = $this->relationship[0]->relTableName;\n $relationship_Id = $this->relationship[0]->id;\n $deleteTable = $this->relationship[1]->relTableName;\n }\n\n if($this->shiftType == \"assignment\"){\n // Adds values for relationship table assignment to be used in SQL-statement\n $idName = $this->relationship[1]->idColumnName;\n $relationshipTable = $this->relationship[1]->relTableName;\n $relationship_Id = $this->relationship[1]->id;\n $deleteTable = $this->relationship[0]->relTableName;\n }\n\n // Check if shift type has changed from previous state\n // Different SQL statements are needed depending on value \n if($this->shiftTypeChanged == true){\n\n // If type has changed remove old relationship and add new and update shift\n $query = \"START TRANSACTION;\n UPDATE {$this->tableName} s\n SET s.StartTime = :startTime, s.EndTime = :endTime\n WHERE s.id = :shift_Id;\n \n DELETE FROM {$deleteTable}\n WHERE Shift_Id = :shift_Id;\n \n INSERT INTO {$relationshipTable}(Shift_Id, {$idName})\n VALUES (:shift_Id, :relation_Id);\n COMMIT;\";\n }else{\n // If type has not changed update current shift\n $query = \"UPDATE {$this->tableName} s, {$relationshipTable} rt\n SET s.StartTime = :startTime, s.EndTime = :endTime, rt.{$idName} = :relation_Id\n WHERE s.Id = :shift_Id\n AND rt.Shift_Id = :shift_Id;\";\n }\n \n // Prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // Santize and bind properties\n $this->startTime = parent::sanitize($this->startTime);\n $this->endTime = parent::sanitize($this->endTime);\n $relationship_Id = parent::sanitize($relationship_Id);\n $stmt->bindParam(\":startTime\", $this->startTime);\n $stmt->bindParam(\":endTime\", $this->endTime);\n $stmt->bindParam(\":shift_Id\", $this->id);\n $stmt->bindParam(\":relation_Id\", $relationship_Id);\n \n // Execute query\n if($stmt->execute()){\n return true;\n }\n \n return false;\n }", "function updateHardWareOrderInfo($saleOrderInfo=array()){ \n\t\ttry{\n\t\t\t$status\t= 'No';\n\t\t\t$msg\t= 'Error';\n\t\t\t$CI\t\t\t= & get_instance();\n\t\t\t$login_user\t= $CI->session->userdata('frontendUserName');\n\t\t\tif(!empty($login_user) && !empty($saleOrderInfo)){\n\t\t\t\t$salesOrderNum\t\t= !empty($saleOrderInfo['hardware_sales_order_num']) ? $saleOrderInfo['hardware_sales_order_num'] : '';\n\t\t\t\t$salesOrderLinekey\t= !empty($saleOrderInfo['hardware_linekey']) ? $saleOrderInfo['hardware_linekey'] : '';\n\t\t\t\t$salesOrderWtStep\t= !empty($saleOrderInfo['hardware_wtstep']) ? $saleOrderInfo['hardware_wtstep'] : '';\n\t\t\t\t$update_qty\t= !empty($saleOrderInfo['update_qty']) ? $saleOrderInfo['update_qty'] : 0;\n\t\t\t\t$update_time= !empty($saleOrderInfo['update_tmn']) ? $saleOrderInfo['update_tmn'] : 0.0;\n\t\t\t\t$update_item= !empty($saleOrderInfo['update_itm']) ? $saleOrderInfo['update_itm'] : '';\n\t\t\t\t\n\t\t\t\t$item_data=array();\n\t\t\t\tif(!empty($update_item)){\n\t\t\t\t\tfor($i=0;$i<count($update_item);$i++){\n\t\t\t\t\t\t$item_data[$update_item[$i]]=array('quantity'=>$update_qty[$i],'timetaken'=>$update_time[$i]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$item_data=json_encode($item_data);\n\t\t\t\t\t\t\t\t\n\t\t\t\t/*$strMsg = \"updateHardWareOrderInfo()\";\n\t\t\t\tvar_dump($salesOrderNum);\n\t\t\t\tvar_dump($salesOrderLinekey);\n\t\t\t\tvar_dump($salesOrderWtStep);\n\t\t\t\tvar_dump($item_data);\n\t\t\t\techo $strMsg; die; */\n\t\t\t\t\n\t\t\t\t$sql\t\t= \"select * from qw.save_salesorder_hardwaredetails('$salesOrderNum','$salesOrderLinekey','$salesOrderWtStep','$item_data','$login_user')\";\n\t\t\t\t$results\t= $this->db->query($sql);\n\t\t\t\t$results\t= $results->row();\n\t\t\t\tif(!empty($results)){\n\t\t\t\t\t$results= !empty($results->save_salesorder_details) ? $results->save_salesorder_details : '';\n\t\t\t\t\tif(!empty($results)){\n\t\t\t\t\t\t$msg\t= ucfirst($results);\n\t\t\t\t\t\t$status\t= 'Yes';\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$msg\t= 'Error';\n\t\t\t\t\t\t$status\t= 'No';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$msg\t= 'Error';\n\t\t\t\t\t$status\t= 'No';\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$msg\t= 'Error';\n\t\t\t\t$status\t= 'No';\n\t\t\t}\n\t\t\techo json_encode(array('status'=>$status,'msg'=>$msg));die;\n\t\t}catch(Exception\t$ex){\n\t\t\tlog_message('error','Unable to update Sales Orders based on salesorder number '.$ex->getMessage());\n\t\t}\n\t}", "function updateObjectDB () {\n\t\t$this->prepareValues();\n\t\t$database = mamboDatabase::getInstance();\n\t\t$database->doSQL($this->updateSQL());\n\t}", "private function updateBuilding(){\n buildingModel::insertBuilding($this,\"Update\");\n }", "function update_homework($id, $courseid, $name, $starttime, $endtime, $detail)\n\t{\n\t\t//UPDATE homeworks SET courseid = $courseid, name = $name, starttime = $starttime, endtime = $endtime, detail = $detail WHERE id = $id\n\t\t$query = $this->resource->where(\"id\", $id)->update( \"homeworks\", \n\t\t\tarray(\t\"courseid\"=>$courseid, \n\t\t\t\t\t\"name\" => $name, \n\t\t\t\t\t\"starttime\" => $starttime, \n\t\t\t\t\t\"endtime\" => $endtime, \n\t\t\t\t\t\"detail\" => $detail));\n\t\t//return \n\t\treturn true;\n\t}", "public function update($data)\n {\n if (empty($data['work_date']))\n {\n $data['work_date'] = NULL;\n }\n \n if (empty($data['description']))\n {\n $data['description'] = NULL;\n }\n \n if (empty($data['work_done_hours']))\n {\n $data['work_done_hours'] = NULL;\n }\n \n if (empty($data['work_remaining_hours']))\n {\n $data['work_remaining_hours'] = NULL;\n }\n \n $this->db->where('id', $data['id']);\n $query = $this->db->update('sprint_work', $data) ;\n }", "public function updateWorkshopLocation()\n\t{\n\t\t\n\t\t$core = Core::dbOpen();\n\t\t\n\t\t// get workshopLocationID if exists\n\t\t$sql = \"SELECT workshopLocationID, locationID FROM workshop_location \n\t\t\t\t\t\tWHERE programID\t= :programID AND name\t= :name AND address = :address\";\n\t\t$stmt = $core->dbh->prepare($sql);\n\t\t$stmt->bindParam(':programID', $this->programID);\n\t\t$stmt->bindParam(':name', $this->name);\n\t\t$stmt->bindParam(':address', $this->address);\n\t\t\n\t\ttry {\n\t\t\tif ( $stmt->execute() && $stmt->RowCount() > 0 ) // location exists\n\t\t\t{\n\t\t\t\t$row = $stmt->fetch();\n\t\t\t\t$this->workshopLocationID = $row[\"workshopLocationID\"];\n\t\t\t\t\n\t\t\t\t// if the current location ID differs than what is in the location, update it\n\t\t\t\tif( $this->locationID != $row[\"locationID\"] ) {\t\t\t\t\n\t\t\t\t\t\t$sql = \"UPDATE workshop_location SET locationID = :locationID WHERE workshopLocationID = :id\";\n\t\t\t\t\t\t$stmt = $core->dbh->prepare($sql);\n\t\t\t\t\t\t$stmt->bindParam(':locationID', $this->locationID);\n\t\t\t\t\t\t$stmt->bindParam(':id', $this->workshopLocationID);\n\t\t\t\t\t\t$stmt->execute();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse // add it\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO workshop_location (programID,name,address,locationID)\n\t\t \t \t VALUES (:programID, :name, :address, :locationID)\";\n\t\t\t\t$stmt = $core->dbh->prepare($sql);\n\t\t\t\t$stmt->bindParam(':programID', $this->programID);\n\t\t\t\t$stmt->bindParam(':locationID', $this->locationID);\n\t\t\t\t$stmt->bindParam(':name', $this->name);\n\t\t\t\t$stmt->bindParam(':address', $this->address);\n\t\t\t\tCore::dbClose();\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tif ( $stmt->execute() )\n\t\t\t\t\t\t$this->workshopLocationID = $core->dbh->lastInsertId(); \t\t\n\t\t\t\t\treturn true;\t\t\t\t\n\t\t\t\t} catch ( PDOException $e ) {\n\t\t\t\t\techo \"Add Workshop Location Failed\";\n\t\t\t\t}\n\t\t\t}\n\t\t} catch ( PDOException $e ) {\n\t\t\techo \"Get Workshop Location ID Failed\";\n\t\t}\n\t\treturn false;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add a new field to a cpt setting section of a settings page
public function add_cpt_field() { global $cpt_helper; add_settings_section( 'cpt_setting_section', // ID __('General Settings', 'cpt-generator'), // Title array($this, 'general_section_info'), // Callback 'cpt-generator' // Page ); add_settings_field( 'cpt_post_type', __('Post Type', 'cpt-generator'), array($this, 'cpt_post_type_name'), 'cpt-generator', 'cpt_setting_section' ); add_settings_field( 'cpt_labels_name', __('Label Name', 'cpt-generator'), array($cpt_helper, 'display_textbox_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_labels_name", "editval" => $this->editval) ); add_settings_field( 'cpt_labels_singular_name', __('Singular Name', 'cpt-generator'), array($cpt_helper, 'display_textbox_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_labels_singular_name", "editval" => $this->editval) ); add_settings_field( 'cpt_description', __('Description', 'cpt-generator'), array($this, 'cpt_description_callback'), 'cpt-generator', 'cpt_setting_section' ); add_settings_field( 'cpt_public', __('Public', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_public", "editval" => $this->editval) ); add_settings_field( 'cpt_exclude_from_search', __('Exclude From Search', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_exclude_from_search", "editval" => $this->editval) ); add_settings_field( 'cpt_publicly_queryable', __('Publically Queryable', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_publicly_queryable", "editval" => $this->editval) ); add_settings_field( 'cpt_show_ui', __('Show UI', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_show_ui", "editval" => $this->editval) ); add_settings_field( 'cpt_show_in_nav_menus', __('Show In Nav Menu', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_show_in_nav_menus", "editval" => $this->editval) ); add_settings_field( 'cpt_show_in_menu', __('Show In Menu', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_show_in_menu", "editval" => $this->editval) ); add_settings_field( 'cpt_show_in_admin_bar', __('Show In Admin Bar', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_show_in_admin_bar", "editval" => $this->editval) ); add_settings_field( 'cpt_menu_position', __('Menu Position', 'cpt-generator'), array($this, 'cpt_menu_position_callback'), 'cpt-generator', 'cpt_setting_section' ); add_settings_field( 'cpt_hierarchical', __('Hierarchical', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_hierarchical", "editval" => $this->editval) ); $taxonomies = array( array("field_value" => "category", "field_label" => "Category", "field_checked" => ""), array("field_value" => "post_tag", "field_label" => "Tag", "field_checked" => ""), ); add_settings_field( 'cpt_taxonomies', __('Built in Taxonomies', 'cpt-generator'), array($cpt_helper, 'display_checkbox_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_taxonomies", "field_values" => $taxonomies, "editval" => $this->editval) ); add_settings_field( 'cpt_has_archive', __('Has Archive', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_has_archive", "editval" => $this->editval) ); $supports = array( array("field_value" => "title", "field_label" => "Title", "field_checked" => "checked"), array("field_value" => "editor", "field_label" => "Editor", "field_checked" => "checked"), array("field_value" => "author", "field_label" => "Author", "field_checked" => "checked"), array("field_value" => "thumbnail", "field_label" => "Thumbnail", "field_checked" => ""), array("field_value" => "excerpt", "field_label" => "Excerpt", "field_checked" => ""), array("field_value" => "trackbacks", "field_label" => "Trackbacks", "field_checked" => ""), array("field_value" => "custom-fields", "field_label" => "Custom Fields", "field_checked" => ""), array("field_value" => "comments", "field_label" => "Comments", "field_checked" => ""), array("field_value" => "revisions", "field_label" => "Revisions", "field_checked" => ""), array("field_value" => "page-attributes", "field_label" => "Page Attributes", "field_checked" => ""), array("field_value" => "post-formats", "field_label" => "Post Formats", "field_checked" => ""), ); add_settings_field( 'cpt_supports', __('Supports Type', 'cpt-generator'), array($cpt_helper, 'display_checkbox_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_supports", "field_values" => $supports, "editval" => $this->editval) ); add_settings_field( 'cpt_menu_icon', __('Menu Icon', 'cpt-generator'), array($this, 'cpt_menu_icon_callback'), 'cpt-generator', 'cpt_setting_section' ); add_settings_field( 'cpt_query_var', __('Query Var', 'cpt-generator'), array($cpt_helper, 'display_switch_option'), 'cpt-generator', 'cpt_setting_section', array("field_name" => "cpt_query_var", "editval" => $this->editval) ); }
[ "private function addSettingsField() {\n\n\t\tadd_settings_field(\n\t\t\t$this->config->option_name,\n\t\t\t__('Your MediaLab URL', $this->config->getPluginName()) . ':',\n\t\t\tfunction() {\n\t\t\t\t$field = 'https://'\n\t\t\t\t\t. '<input type=\"text\" class=\"regular-text\" '\n\t\t\t\t\t. 'name=\"' .$this->config->option_name .'\" '\n\t\t\t\t\t. 'id=\"' .$this->config->option_name .'\" '\n\t\t\t\t\t. 'value=\"' . get_option($this->config->option_name) . '\" '\n\t\t\t\t. '/>';\n\n\t\t\t\techo $field;\n\t\t\t},\n\t\t\t$this->config->page_slug,\n\t\t\t$this->config->section_name\n\t\t);\n\t}", "public function settings_field(){\r\n\t\tglobal $simple_history_extender;\r\n\r\n\t\tadd_settings_field( \r\n\t\t\t$simple_history_extender->modules_name .'['. $this->id .']', \r\n\t\t\t$this->title, \r\n\t\t\tarray( $this, 'module_field' ), \r\n\t\t\t$simple_history_extender->page, \r\n\t\t\t$simple_history_extender->modules_section \r\n\t\t\t);\r\n\t}", "function add_settings_field($id, $title, $callback, $page, $section = 'default', $args = array()) {\n\tglobal $wp_settings_fields;\n\n\tif ( 'misc' == $page ) {\n\t\t_deprecated_argument( __FUNCTION__, '3.0', __( 'The miscellaneous options group has been removed. Use another settings group.' ) );\n\t\t$page = 'general';\n\t}\n\n\tif ( !isset($wp_settings_fields) )\n\t\t$wp_settings_fields = array();\n\tif ( !isset($wp_settings_fields[$page]) )\n\t\t$wp_settings_fields[$page] = array();\n\tif ( !isset($wp_settings_fields[$page][$section]) )\n\t\t$wp_settings_fields[$page][$section] = array();\n\n\t$wp_settings_fields[$page][$section][$id] = array('id' => $id, 'title' => $title, 'callback' => $callback, 'args' => $args);\n}", "function addFieldsToFieldSettingsforAD()\n\t{\n\t\t$arrSetVals = array();\n\t\t$arrSetVals['strName'] = 'displayname';\n\t\t$arrSetVals['EditFormat'] = 'Text Field';\n\t\t$arrSetVals['validation']['validationArr'][] = 'IsRequired';\n\t\t$this->jsSettings['tableSettings'][$this->tName]['fieldSettings']['displayname'][$this->pageType] = $arrSetVals;\n\t\t\n\t\t$arrSetVals = array();\n\t\t$arrSetVals['strName'] = 'name';\n\t\t$arrSetVals['EditFormat'] = 'Text Field';\n\t\t$arrSetVals['validation']['validationArr'][] = 'IsRequired';\n\t\t$this->jsSettings['tableSettings'][$this->tName]['fieldSettings']['name'][$this->pageType] = $arrSetVals;\n\t\t\n\t\t$arrSetVals = array();\n\t\t$arrSetVals['strName'] = 'category';\n\t\t$arrSetVals['EditFormat'] = 'Text Field';\n\t\t$arrSetVals['validation']['validationArr'][] = 'IsRequired';\n\t\t$this->jsSettings['tableSettings'][$this->tName]['fieldSettings']['category'][$this->pageType] = $arrSetVals;\n\t}", "public function addSettingsfields()\n {\n\n // get the options\n $options = get_option($this->option_name);\n\n\n // show the googleDrive api key input\n $googleDrive_api_key = isset($options['googleDrive_api_key']) ? $options['googleDrive_api_key'] : null;\n $developerKey = isset($options['developerKey']) ? $options['developerKey'] : null;\n $appId = isset($options['appId']) ? $options['appId'] : null;\n\n add_settings_field(\n 'googleDrive_api_key', 'GoogleDrive API Key',\n [\n $this,\n '_inputSetting'\n ],\n $this->settings_group, 'wprf_googleDrive_settings_main',\n [\n 'id' => 'googleDrive_api_key',\n 'value' => $googleDrive_api_key\n ]\n );\n\n add_settings_field(\n 'developerKey', 'DeveloperKey',\n [\n $this,\n '_inputSetting'\n ],\n $this->settings_group, 'wprf_googleDrive_settings_main',\n [\n 'id' => 'developerKey',\n 'value' => $developerKey\n ]\n );\n\n add_settings_field(\n 'appId', 'AppId',\n [\n $this,\n '_inputSetting'\n ],\n $this->settings_group, 'wprf_googleDrive_settings_main',\n [\n 'id' => 'appId',\n 'value' => $appId\n ]\n );\n }", "public function add_settings(){\n woocommerce_admin_fields( self::get_settings() );\n }", "function addSettingsField($section_name, $setting_name, $setting_title, $callback, $args = array()) {\r\n\t\tif (!is_array($args)) $args = array();\r\n\t\t$args['name'] = $setting_name;\r\n\t\tadd_settings_field($setting_name, $setting_title, $callback, $section_name, $section_name, $args);\r\n\t}", "function acf_append_setting( $name, $value ) {\n}", "function lanorg_add_setting_field($type, $id, $title, $description, $sanitizer=NULL) {\n\tif ($type == 'checkbox') {\n\t\t$sanitizer = 'lanorg_sanitize_checkbox';\n\t}\n\n\tadd_settings_field($id,\n\t\t$title,\n\t\t'eg_setting_callback_function',\n\t\t'lanorg_settings',\n\t\t'lanorg_settings_main',\n\t\tarray(\n\t\t\t'id' => $id,\n\t\t\t'desc' => $description,\n\t\t\t'type' => $type,\n\t\t)\n\t);\n\tregister_setting('lanorg', $id, $sanitizer);\n}", "protected function addSettingsFields(): void\n {\n $this->addField('sameAddress')\n ->setFieldLabel('Shipping address is the same as my billing address');\n\n $this->addField('saveInfo')\n ->setFieldLabel('Save this information for next time');\n }", "public function registerField()\n {\n add_settings_field(\n $this->option_name,\n $this->field_title,\n ( $this->field_input_type == 'textarea' ) ? array( $this, 'textareaFieldCallback' ) : array( $this, 'textFieldCallback' ),\n $this->field_page,\n $this->field_section,\n $this->field_args\n );\n }", "public function register_fields()\n {\n // Add Settings Page Section.\n add_settings_section(\n 'plugin_name_main_settings', // Section ID.\n __('Plugin Config', Plugin_Name::PLUGIN_ID), // Section Title.\n [$this, 'markup_section_headers'], // Section Callback.\n static::SETTINGS_PAGE_SLUG // Page URL.\n );\n add_settings_section(\n 'plugin_name_other_settings', // Section ID.\n __('Plugin Name Other settings', Plugin_Name::PLUGIN_ID), // Section Title.\n [$this, 'markup_section_headers'], // Section Callback.\n static::SETTINGS_PAGE_SLUG // Page URL.\n );\n }", "function rbc_update_settings() \n {\n // Other fields ... \n // register_setting( 'rbc-plugin-settings', 'rbc_field_test_2' );\n }", "public function add_fields() {\n $yit_options = $this->get_main_array_options();\n $current_tab = $this->get_current_tab();\n\n if ( ! $current_tab ) {\n return;\n }\n foreach ( $yit_options[$current_tab] as $section => $data ) {\n add_settings_section( \"yit_settings_{$current_tab}_{$section}\", $this->get_section_title( $section ), $this->get_section_description( $section ), 'yit' );\n foreach ( $data as $option ) {\n if ( isset( $option['id'] ) && isset( $option['type'] ) && isset( $option['name'] ) ) {\n add_settings_field( \"yit_setting_\" . $option['id'], $option['name'], array( $this, 'render_field' ), 'yit', \"yit_settings_{$current_tab}_{$section}\", array( 'option' => $option, 'label_for' => $this->get_id_field( $option['id'] ) ) );\n }\n }\n }\n }", "function addCaptchaToFieldSettings()\n\t{\n\t\t$arrSetVals = array();\n\t\t$arrSetVals['strName'] = 'captcha';\n\t\t$arrSetVals['EditFormat'] = 'Text Field';\n\t\t$arrSetVals['validation']['validationArr'][] = 'IsRequired';\n\t\t$this->jsSettings['tableSettings'][$this->tName]['fieldSettings']['captcha'] = $arrSetVals;\n\t}", "function add_settings_field() {\r\n\t\tif( $this->is_plugin_active_for_network( plugin_basename( __FILE__ ) ) )\r\n\t\t\treturn;\r\n\r\n\t\tadd_settings_section( 'login_redirect_setting_section', __( 'Login Redirect', 'login_redirect' ), '__return_false', 'general' );\r\n\r\n\t\tadd_settings_field( 'login_redirect_url', __( 'Redirect to', 'login_redirect' ), array( &$this, 'site_option' ), 'general', 'login_redirect_setting_section' );\r\n\r\n\t\tregister_setting( 'general', 'login_redirect_url' );\r\n\t}", "public static function register_fields() {\n\n\t\tadd_settings_section( 'chp-settings-general', '', '__return_false', 'chp-settings' );\n\n\t\tself::register_setting( self::CHP_URL, 'CHP URL' );\n\t\tself::register_setting( self::CHP_TOKEN, 'CHP TOKEN' );\n\t\tself::register_setting( self::CHP_USERS, 'CHP users', 'IDs Comma separated used to detect CHP images.' );\n\t\tself::register_setting( self::CHP_XML_TEMPLATE, 'CHP XML TEMPLATE', '', 'field_textarea' );\n\t\tself::register_setting( self::ENABLED_POST_TYPES, 'Enable Post Types', '', 'field_checkbox' );\n\t\tself::register_setting( self::FE_SITE_URL, 'SITE URL', 'Replace the default WordPress URL with a different one on URL sent to CHP.' );\n\t\tself::register_setting( self::SLACK_APP_URL, 'SLACK APP URL' );\n\t\tself::register_setting( self::SLACK_CHANNEL, 'SLACK CHANNEL' );\n\t\tself::register_setting( 'ip_address', 'IP address', '', 'display_the_ip' );\n\n\t}", "private function addFieldsOnWebform() {\n $this->drupalLogin($this->rootUser);\n $this->drupalGet(Url::fromRoute('entity.webform.civicrm', [\n 'webform' => $this->webform->id(),\n ]));\n $this->enableCivicrmOnWebform();\n\n $this->getSession()->getPage()->clickLink('Activities');\n $this->getSession()->getPage()->selectFieldOption('activity_number_of_activity', 1);\n $this->assertSession()->assertWaitOnAjaxRequest();\n $this->htmlOutput();\n $this->getSession()->getPage()->selectFieldOption('Activity Type', '- User Select -');\n $this->assertSession()->assertWaitOnAjaxRequest();\n\n $this->saveCiviCRMSettings();\n $this->assertSession()->pageTextContains('Added 4 fields to the form');\n $this->assertSession()->pageTextContains('Saved CiviCRM settings');\n }", "function cp_v2_section_settings_field( $name, $settings, $value ) {\r\n\t$input_name = $name;\r\n\t$title = isset( $settings['title'] ) ? $settings['title'] : '';\r\n\t$output = '<div class=\"section-title\">';\r\n\t$output .= $title;\r\n\t$output .= '</div>';\r\n\treturn $output;\r\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add vertical lines to an image.
function AddVertLines($im_image,$i_width,$i_height,$s_x_func,$i_color, $a_text_area,$i_char_width,$i_spacing) { global $bCleanText; $i_text_left = $a_text_area[0]; $i_text_top = $a_text_area[1]; $i_text_right = $a_text_area[2]; $i_text_bot = $a_text_area[3]; $ii=0; for (eval('$ii = '.$s_x_func.';') ; $ii < $i_width ; eval('$ii += '.$s_x_func.';')) { // // allow vertical lines to go through spaces // $b_split = FALSE; $i_start = mt_rand(0,$i_height/2); $i_end = $i_height - mt_rand(1,$i_height/2); if ($bCleanText && $ii >= $i_text_left && $ii < $i_text_right) { $i_char_pos = $ii - $i_text_left; if (((int) ($i_char_pos / $i_char_width)) % $i_spacing == 0) $b_split = TRUE; else { // // if we're going thru a space, ensure it's long enough // not to look like the tail on an h or similar // $i_start = mt_rand(0,$i_text_top); $i_end = mt_rand($i_text_bot,$i_height-1); } } if ($b_split) { // // split the line // imageline($im_image,$ii,min($i_text_top-2,$i_start),$ii,$i_text_top,$i_color); imageline($im_image,$ii,$i_text_bot+2,$ii,max($i_text_bot+2,$i_end),$i_color); } else imageline($im_image,$ii,$i_start,$ii,$i_end,$i_color); } }
[ "function drawLines()\r\n {\r\n $linecolor = imagecolorallocate($this->im, hexdec(substr($this->line_color, 1, 2)), hexdec(substr($this->line_color, 3, 2)), hexdec(substr($this->line_color, 5, 2)));\r\n imagesetthickness($this->im, $this->line_thickness);\r\n\r\n //vertical lines\r\n for($x = 1; $x < $this->image_width; $x += $this->line_distance) {\r\n imageline($this->im, $x, 0, $x, $this->image_height, $linecolor);\r\n }\r\n\r\n //horizontal lines\r\n for($y = 11; $y < $this->image_height; $y += $this->line_distance) {\r\n imageline($this->im, 0, $y, $this->image_width, $y, $linecolor);\r\n }\r\n\r\n if ($this->draw_angled_lines == true) {\r\n for ($x = -($this->image_height); $x < $this->image_width; $x += $this->line_distance) {\r\n imageline($this->im, $x, 0, $x + $this->image_height, $this->image_height, $linecolor);\r\n }\r\n\r\n for ($x = $this->image_width + $this->image_height; $x > 0; $x -= $this->line_distance) {\r\n imageline($this->im, $x, 0, $x - $this->image_height, $this->image_height, $linecolor);\r\n }\r\n }\r\n }", "private function addLines()\n {\n if(isset($this->lines))\n {\n foreach($this->lines as $line)\n {\n $lineColor = $this->makeColor($line->getColor(), $this->captchaImage);\n\n // Adding line\n imageline($this->captchaImage, $line->getXStart(), $line->getYStart(), $line->getXEnd(), $line->getYEnd(), $lineColor);\n }\n }\n }", "function AddVertLines($im_image,$i_width,$i_height,$s_x_func,$i_color,\n\t\t\t\t\t\t$a_text_area,$i_char_width,$i_spacing)\n{\n\tglobal\t$bCleanText;\n\n\t$i_text_left = $a_text_area[0];\n\t$i_text_top = $a_text_area[1];\n\t$i_text_right = $a_text_area[2];\n\t$i_text_bot = $a_text_area[3];\n\tfor (eval('$ii = '.$s_x_func.';') ; $ii < $i_width ; eval('$ii += '.$s_x_func.';'))\n\t{\n\t\t\t//\n\t\t\t// allow vertical lines to go through spaces\n\t\t\t//\n\t\t$b_split = FALSE;\n\t\t$i_start = mt_rand(0,$i_height/2);\n\t\t$i_end = $i_height - mt_rand(1,$i_height/2);\n\t\tif ($bCleanText && $ii >= $i_text_left && $ii < $i_text_right)\n\t\t{\n\t\t\t$i_char_pos = $ii - $i_text_left;\n\t\t\tif (((int) ($i_char_pos / $i_char_width)) % $i_spacing == 0)\n\t\t\t\t$b_split = TRUE;\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t//\n\t\t\t\t\t// if we're going thru a space, ensure it's long enough\n\t\t\t\t\t// not to look like the tail on an h or similar\n\t\t\t\t\t//\n\t\t\t\t$i_start = mt_rand(0,$i_text_top);\n\t\t\t\t$i_end = mt_rand($i_text_bot,$i_height-1);\n\t\t\t}\n\t\t}\n\t\tif ($b_split)\n\t\t{\n\t\t\t\t//\n\t\t\t\t// split the line\n\t\t\t\t//\n\t\t\timageline($im_image,$ii,min($i_text_top-2,$i_start),$ii,$i_text_top,$i_color);\n\t\t\timageline($im_image,$ii,$i_text_bot+2,$ii,max($i_text_bot+2,$i_end),$i_color);\n\t\t}\n\t\telse\n\t\t\timageline($im_image,$ii,$i_start,$ii,$i_end,$i_color);\n\t}\n}", "private function drawlines()\n {\n $color1 = rand(150, 185);\n $color2 = rand(185, 225);\n $nextline = 4;\n $w1 = 0;\n $w2 = 0;\n\n for ($x = 0; $x < $this->width; $x += (int) $nextline) {\n if ($x < $this->width) {\n imageline($this->img, $x + $w1, 0, $x + $w2, $this->height - 1, rand($color1, $color2));\n }\n if ($x < $this->height) {\n imageline($this->img, 0, $x - $w2, $this->width - 1, $x - $w1, rand($color1, $color2));\n }\n if (function_exists('imagettftext') && (count($this->fonts) > 0)) {\n $nextline += rand(-5, 7);\n if ($nextline < 1) {\n $nextline = 2;\n }\n } else {\n $nextline += rand(1, 7);\n }\n $w1 += rand(-4, 4);\n $w2 += rand(-4, 4);\n }\n\n return $this->img;\n }", "public function polyline()\n {\n if ( empty($this->attributes['stroke-width']) ) {\n $this->attributes['stroke-width'] = 1;\n }\n\n imagesetthickness($this->image, $this->attributes['stroke-width']);\n $color = $this->color->allocate($this->attributes['stroke'], $this->image, $this->getOpacity('stroke'));\n \n $points = explode(' ', $this->attributes['points']);\n foreach ( $points AS $key => $once ) {\n if ( empty($points[$key + 1]) ) {\n break;\n }\n \n list($x1, $y1) = explode(',', $once, 2);\n list($x2, $y2) = explode(',', $points[$key + 1], 2);\n \n imageline($this->image, $x1, $y1, $x2, $y2, $color);\n }\n }", "protected function drawLines()\n\t{\n\t\tfor ($line = 0; $line < $this->num_lines; ++ $line)\n\t\t{\n\t\t\t$x = $this->image_width * (1 + $line) / ($this->num_lines + 1);\n\t\t\t$x += (0.5 - $this->frand()) * $this->image_width / $this->num_lines;\n\t\t\t$y = rand($this->image_height * 0.1, $this->image_height * 0.9);\n\t\t\t\n\t\t\t$theta = ($this->frand() - 0.5) * M_PI * 0.7;\n\t\t\t$w = $this->image_width;\n\t\t\t$len = rand($w * 0.4, $w * 0.7);\n\t\t\t$lwid = rand(0, 1);\n\t\t\t\n\t\t\t$k = $this->frand() * 0.6 + 0.2;\n\t\t\t$k = $k * $k * 0.5;\n\t\t\t$phi = $this->frand() * 6.28;\n\t\t\t$step = 0.5;\n\t\t\t$dx = $step * cos($theta);\n\t\t\t$dy = $step * sin($theta);\n\t\t\t$n = $len / $step;\n\t\t\t$amp = 1.5 * $this->frand() / ($k + 5.0 / $len);\n\t\t\t$x0 = $x - 0.5 * $len * cos($theta);\n\t\t\t$y0 = $y - 0.5 * $len * sin($theta);\n\t\t\t\n\t\t\t$ldx = round(- $dy * $lwid);\n\t\t\t$ldy = round($dx * $lwid);\n\t\t\t\n\t\t\tfor ($i = 0; $i < $n; ++ $i)\n\t\t\t{\n\t\t\t\t$x = $x0 + $i * $dx + $amp * $dy * sin($k * $i * $step + $phi);\n\t\t\t\t$y = $y0 + $i * $dy - $amp * $dx * sin($k * $i * $step + $phi);\n\t\t\t\timagefilledrectangle($this->im, $x, $y, $x + $lwid, $y + $lwid, $this->gdlinecolor);\n\t\t\t}\n\t\t}\n\t}", "function drawLines()\n\t{\n\t\tfor ($line = 0; $line < $this->num_lines; ++$line) {\n\t\t\t$x = $this->image_width * (1 + $line) / ($this->num_lines + 1);\n\t\t\t$x += (0.5 - $this->frand()) * $this->image_width / $this->num_lines;\n\t\t\t$y = rand($this->image_height * 0.1, $this->image_height * 0.9);\n\t\t\t \n\t\t\t$theta = ($this->frand()-0.5) * M_PI * 0.7;\n\t\t\t$w = $this->image_width;\n\t\t\t$len = rand($w * 0.4, $w * 0.7);\n\t\t\t$lwid = rand(0, 2);\n\t\t\t \n\t\t\t$k = $this->frand() * 0.6 + 0.2;\n\t\t\t$k = $k * $k * 0.5;\n\t\t\t$phi = $this->frand() * 6.28;\n\t\t\t$step = 0.5;\n\t\t\t$dx = $step * cos($theta);\n\t\t\t$dy = $step * sin($theta);\n\t\t\t$n = $len / $step;\n\t\t\t$amp = 1.5 * $this->frand() / ($k + 5.0 / $len);\n\t\t\t$x0 = $x - 0.5 * $len * cos($theta);\n\t\t\t$y0 = $y - 0.5 * $len * sin($theta);\n\t\t\t \n\t\t\t$ldx = round(-$dy * $lwid);\n\t\t\t$ldy = round($dx * $lwid);\n\t\t\t \n\t\t\tfor ($i = 0; $i < $n; ++$i) {\n\t\t\t\t$x = $x0 + $i * $dx + $amp * $dy * sin($k * $i * $step + $phi);\n\t\t\t\t$y = $y0 + $i * $dy - $amp * $dx * sin($k * $i * $step + $phi);\n\t\t\t\timagefilledrectangle($this->im, $x, $y, $x + $lwid, $y + $lwid, $this->gdlinecolor);\n\t\t\t}\n\t\t}\n\t}", "protected function _drawLines()\n {\n \tfor ($line = 0; $line < $this->num_lines; ++ $line) {\n \t\t$x = $this->image_width * (1 + $line) / ($this->num_lines + 1);\n \t\t$x += (0.5 - $this->_frand()) * $this->image_width / $this->num_lines;\n \t\t$y = mt_rand($this->image_height * 0.1, $this->image_height * 0.9);\n \n \t\t$theta = ($this->_frand() - 0.5) * M_PI * 0.7;\n \t\t$w = $this->image_width;\n \t\t$len = mt_rand($w * 0.4, $w * 0.7);\n \t\t$lwid = mt_rand(0, 2);\n \n \t\t$k = $this->_frand() * 0.6 + 0.2;\n \t\t$k = $k * $k * 0.5;\n \t\t$phi = $this->_frand() * 6.28;\n \t\t$step = 0.5;\n \t\t$dx = $step * cos($theta);\n \t\t$dy = $step * sin($theta);\n \t\t$n = $len / $step;\n \t\t$amp = 1.5 * $this->_frand() / ($k + 5.0 / $len);\n \t\t$x0 = $x - 0.5 * $len * cos($theta);\n \t\t$y0 = $y - 0.5 * $len * sin($theta);\n \n \t\t$ldx = round(- $dy * $lwid);\n \t\t$ldy = round($dx * $lwid);\n \n \t\tfor ($i = 0; $i < $n; ++ $i) {\n \t\t\t$x = $x0 + $i * $dx + $amp * $dy * sin($k * $i * $step + $phi);\n \t\t\t$y = $y0 + $i * $dy - $amp * $dx * sin($k * $i * $step + $phi);\n \t\t\timagefilledrectangle($this->im, $x, $y, $x + $lwid, $y + $lwid, $this->gdlinecolor);\n \t\t}\n \t}\n }", "private static function _generateLines() {\n\t\tfor($i = 0; $i < self::$_cfg[\"lines\"]; $i++) {\n\t\t\t$x1 = mt_rand(0, self::$_img[\"width\"]);\n\t\t\t$y1 = mt_rand(0, self::$_img[\"height\"]);\n\t\t\t$x2 = mt_rand(0, self::$_img[\"width\"]);\n\t\t\t$y2 = mt_rand(0, self::$_img[\"height\"]);\n\n\t\t\timageline(self::$_image, $x1, $y1, $x2, $y2, self::$_color[\"noise\"]);\n\t\t}\n\t}", "private function createBorder()\r\n\t{\r\n\t\t$x = $this->width;\r\n\t\t$y = $this->height;\r\n\r\n\t\t$color = $this->generateColor('white');\r\n\t\timageline($this->img, 1, 1, $x, 1, $color);\r\n\t\timageline($this->img, 0, $y-2, $x, $y-2, $color);\r\n\t\timageline($this->img, 1, 1, 1, $y-2, $color);\r\n\t\timageline($this->img, $x-2, 0, $x-2, $y-2, $color);\r\n\r\n\t\t$color = $this->generateColor('grey');\r\n\t\timageline($this->img, 0, 0, $x, 0, $color);\r\n\t\timageline($this->img, 0, $y-1, $x, $y-1, $color);\r\n\t\timageline($this->img, 0, 0, 0, $y-1, $color);\r\n\t\timageline($this->img, $x-1, 0, $x-1, $y-1, $color);\r\n\t}", "function ImageDrawLine(\\raylib\\Image &$dst, int $startPosX, int $startPosY, int $endPosX, int $endPosY, \\raylib\\Color $color): void { }", "private function createLine() {\n // Lines\n for ($i=0;$i<6;$i++) {\n $color = imagecolorallocate($this->img,mt_rand(0,156),mt_rand(0,156),mt_rand(0,156));\n imageline($this->img,mt_rand(0,$this->width),mt_rand(0,$this->height),mt_rand(0,$this->width),mt_rand(0,$this->height),$color);\n }\n // Snowflakes\n for ($i=0;$i<100;$i++) {\n $color = imagecolorallocate($this->img,mt_rand(200,255),mt_rand(200,255),mt_rand(200,255));\n imagestring($this->img,mt_rand(1,5),mt_rand(0,$this->width),mt_rand(0,$this->height),'*',$color);\n }\n }", "public function addVertical($data)\n {\n }", "public function renderAsLines();", "private function newLine() {\n $lastElementType = -1;\n carriageReturn();\n if ($lines != NULL && count($lines) > 0) {\n array_push($lines, $line);\n $currentHeight += $line->height();\n }\n $line = new PdfLine(indentLeft(), indentRight(), $alignment, $leading);\n }", "function gd_dashed_line ($image, $x1, $y1, $x2, $y2, $color)\n{\n return imagedashedline($image, $x1, $y1, $x2, $y2, $color);\n}", "protected function processLines() {\n $cursorY = $this->settings['padding-top'];\n foreach ($this->Lines as $line) {\n $cursorX = $this->settings['padding-left'];\n foreach ($line->Chunks as $chunk) {\n $chunk->originX = $cursorX;\n $cursorX += $chunk->width;\n $line->finalOriginY = max($line->finalOriginY, $chunk->originY);\n $line->finalWidth += $chunk->width;\n $line->finalHeight = max($line->finalHeight, $chunk->height);\n }\n $leading = $line->finalHeight * $this->settings['line-height'] - $line->finalHeight;\n $line->finalOriginY += $cursorY + ($leading/2);\n $line->finalHeight += $leading;\n $cursorY += $line->finalHeight;\n $this->maxLineWidth = max($this->maxLineWidth, $line->finalWidth);\n $this->totalLineHeight += $line->finalHeight;\n }\n $this->maxLineWidth += $this->settings['padding-left'] + $this->settings['padding-right'];\n $this->totalLineHeight += $this->settings['padding-top'] + $this->settings['padding-bottom'];\n }", "function verticalLine ($x, $y, $length, $color=\"#000000\")\n\t{\n\t\t$resultString = '<div ';\n\t\t$resultString .= 'style=\"position:absolute;';\n\t\t$resultString .= 'background-color:'.$color.'; ';\n\t\t$resultString .= 'top:'.$x.';';\n\t\t$resultString .= 'left:'.$y.';';\n\t\t$resultString .= 'height:'.$length.';';\n\t\t$resultString .= 'width:1;';\n\t\t$resultString .= 'z-index:3 ';\n\t\t$resultString .= '></div>\n\t\t';\n\t\treturn $resultString;\n\t}", "public function drawBrokenLine()\r\n {\r\n\t\t\r\n\t\tif( count($this->data) > 0 ) {\r\n\t\t\t$_color_axis = imagecolorallocate($this->image, $this->axis_color[0], $this->axis_color[2], $this->axis_color[2]);\r\n\t\t\t$_color_str = imagecolorallocate($this->image, $this->str_color[0], $this->str_color[1], $this->str_color[2]);\r\n\t\t\t$_color_dot = imagecolorallocate($this->image, $this->dot_color[0], $this->dot_color[1], $this->dot_color[2]);\r\n\t\t\t$_font = $this->font_dir.self::$_FONT[$this->str_font];\r\n\r\n\t\t\t// 绘制Y坐标轴\r\n\t\t\timageline($this->image, $this->margin_left, $this->axisY_top, $this->margin_left, $this->bg_size[0], $_color_axis);\r\n\t\t\t// 绘制箭头\r\n\t\t\timageline($this->image,\r\n $this->margin_left - $this->arrow_size[0],\r\n $this->axisY_top + $this->arrow_size[1],\r\n $this->margin_left, $this->axisY_top, $_color_axis);\r\n\t\t\timageline($this->image,\r\n $this->margin_left + $this->arrow_size[0],\r\n $this->axisY_top + $this->arrow_size[1],\r\n $this->margin_left, $this->axisY_top, $_color_axis);\r\n\t\t\t\r\n\t\t\t// 绘制单位\r\n\t\t\timagettftext($this->image,\r\n $this->str_fsize, 0,\r\n $this->margin_left + $this->arrow_size[0],\r\n $this->axisY_top, $_color_axis,\r\n $_font, '单位:'.$this->unit);\r\n\t\t\t\r\n\t\t\t// 绘制X坐标轴\r\n\t\t\t$_x_width = $this->bg_size[0] - $this->margin_right;\r\n\t\t\timageline($this->image, 0,\r\n $this->bg_size[1] - $this->margin_bottom,\r\n $_x_width, $this->bg_size[1] - $this->margin_bottom, $_color_axis);\r\n\t\t\t// 绘制箭头\r\n\t\t\timageline($this->image,\r\n $_x_width - $this->arrow_size[0],\r\n ($this->bg_size[1] - $this->margin_bottom - $this->arrow_size[1]),\r\n $_x_width,\r\n $this->bg_size[1] - $this->margin_bottom,\r\n $_color_axis);\r\n\t\t\timageline($this->image,\r\n $_x_width - $this->arrow_size[0],\r\n ($this->bg_size[1] - $this->margin_bottom + $this->arrow_size[1]),\r\n $_x_width,\r\n $this->bg_size[1] - $this->margin_bottom,\r\n $_color_axis);\r\n\t\t\t\r\n\t\t\t//确定坐标原点\r\n\t\t\t$_x_0 = $this->margin_left;\r\n\t\t\t$_y_0 = $this->bg_size[1] - $this->margin_bottom;\r\n\t\t\t$_space = 10; \r\n\t\t\t\r\n\t\t\t$_step_x = intval( ($_x_width-$_x_0 - $this->arrow_size[0]) /count($this->data) );\r\n\t\t\t$_step_y = intval( ($_y_0 -$this->axisY_top - $this->arrow_size[1] ) /$this->axisy[1] );\t\t//坐标步长\r\n\t\t\t$_axis_h = $_step_y * $this->axisy[1];\t\t\t//Y坐标轴的高度\r\n\t\t\t$_axis_max = $this->axisy[0] * $this->axisy[1];\t\t//Y轴的最大值\r\n\r\n\t\t\t//给Y轴标点\r\n\t\t\tfor ( $j = 1; $j <= $this->axisy[1]; ++$j ) {\r\n\t\t\t\timageline($this->image, $_x_0, $_y_0 - $_step_y * $j, $_x_0 - $this->staff_width, $_y_0 - $_step_y * $j, $_color_axis);\r\n\t\t\t\t//绘制数值\r\n\t\t\t\timagestring ( $this->image , $this->en_fsize , $_x_0+$_space , $_y_0 - $_step_y * $j - imagefontheight($this->en_fsize)/2 , $this->axisy[0]*$j , $_color_str );\r\n\t\t\t}\r\n\r\n\t\t\t$_point = array();\t\t//存储折线点\r\n\r\n\t\t\t$i = 1;\r\n\t\t\tforeach ( $this->data as $_key => $_val ) {\r\n\t\t\t\t//给X轴标点\r\n\t\t\t\timageline($this->image, $_x_0 + $_step_x * $i, $_y_0 - $this->staff_width, $_x_0 + $_step_x*$i, $_y_0, $_color_axis);\r\n\t\t\r\n\t\t\t\t//绘制横坐标标度\r\n\t\t\t\t$_ttf_box = imagettfbbox($this->str_fsize, 0, $_font, $_key);\r\n\t\t\t\t$_x = $_x_0 + $_step_x * $i - ($_ttf_box[2] - $_ttf_box[0])/2;\r\n\t\t\t\t$_y = $_y_0 + abs($_ttf_box[7]) + $_space;\r\n\t\t\t\timagettftext($this->image, $this->str_fsize, 0, $_x, $_y, $_color_str, $_font, $_key);\r\n\r\n\t\t\t\t//绘制折线\r\n\t\t\t\t$x1 = $_x_0 + $_step_x * $i;\r\n\t\t\t\t$y1 = $_y_0 - $_val/$_axis_max * $_axis_h;\r\n\t\t\t\t$_point[$i] = array($x1, $y1);\t\t//存储所有的数据点\r\n\t\t\t\tif ( $i > 1 ) {\r\n\t\t\t\t\timageline($this->image, $_point[$i-1][0], $_point[$i-1][1], $_point[$i][0], $_point[$i][1], $_color_dot);\r\n\t\t\t\t}\r\n\t\t\t\t//绘制数据点\r\n\t\t\t\timagefilledellipse ( $this->image , $x1 , $y1 , $this->dot_r , $this->dot_r , $_color_dot );\r\n\t\t\t\t//绘制数据值\r\n\t\t\t\timagestring($this->image, $this->str_fsize, $x1-($_ttf_box[2]-$_ttf_box[0])/2, $y1-abs($_ttf_box[7])-$this->dot_r, $_val, $_color_str);\r\n\t\t\t\t++$i;\r\n\t\t\t}\r\n\t\t\tunset($_point);\r\n\t\t\t\r\n\t\t}\r\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
adds female first name file
public function femalefirstname() { $direct = getcwd(); $directfirstfemalename = $direct."/static/femalefirstnames.txt"; $female_first_filename = file($directfirstfemalename); $trimmed_array=array_map('trim',$female_first_filename); $random_female_first_name=array_rand($female_first_filename); $female_first_filenamestring = trim(preg_replace('/\s+/', ' ' , $female_first_filename[$random_female_first_name])); $female_first_filenamestring = preg_replace('/\s+/', '', $female_first_filenamestring); return $female_first_filenamestring; }
[ "public function malefirstname()\r\n {\r\n $direct = getcwd();\r\n $directfirstmalename = $direct.\"/static/malefirstnames.txt\";\r\n $male_first_filename = file($directfirstmalename);\r\n $trimmed_array=array_map('trim',$male_first_filename);\r\n $random_male_first_name=array_rand($male_first_filename);\r\n $male_first_filenamestring = trim(preg_replace('/\\s+/', ' ' , $male_first_filename[$random_male_first_name]));\r\n $male_first_filenamestring = preg_replace('/\\s+/', '', $male_first_filenamestring);\r\n return $male_first_filenamestring;\r\n }", "function addProfile($name,$gender,$age,$type,$os,$minimumAge,$maxAge,$seekingGender){\n\t\t\t\t$outputFile = fopen(\"singles2.txt\",\"a\") or die(\"Unable to open file!\");\n\t\t\t\techo fread($outputFile, filesize(\"singles2.txt\"));\n\t\t\t\t$textToAdd = \"$name,$gender,$age,$type,$os,$minimumAge,$maxAge,$seekingGender\\n\";\n\t\t\t\tfwrite($outputFile,$textToAdd);\n\t\t\t\tfclose($outputFile);\n\t\t\t}", "public static function addNewSex() {\n\t\tswitch (Filter::post('SEX', '[MF]', 'U')) {\n\t\t\tcase 'M':\n\t\t\t\treturn \"\\n1 SEX M\";\n\t\t\tcase 'F':\n\t\t\t\treturn \"\\n1 SEX F\";\n\t\t\tdefault:\n\t\t\t\treturn \"\\n1 SEX U\";\n\t\t}\n\t}", "private function changeFirstStringFile($file_name) { \n //check exit title if file\n $file = file($file_name);\n //Arr::_print(strpos($file[0], 'Member'));\n if(strpos($file[0], 'Member')) return true;\n //add title if file;\n $first_str = \"Note;Job;Owner;Member;Item;Revision;Version;Sheet;Sheets;Size;Assembly;File;Norme;Drawing;Weight;Quantity;Total;MU;Dim Unit;Costruction;Title;Title(other);\\r\\n\";\n file_put_contents($file_name, $first_str.file_get_contents($file_name));\n }", "public function add_person_to_file() {\n\t\t$file = fopen(\"personinfo.txt\", \"a\")\n\t\tor die(\"ERROR: Fail creating or opening the file\");\n\t\tif ($file) {\n\t\t\t$string = $this->fname.\";\";\n\t\t\t$string .= $this->lname.\";\";\n\t\t\t$string .= $this->id.\";\";\n\t\t\t$string .= $this->age.\";\";\n\t\t\t$string .= $this->gender.\";\";\n\t\t\t$string .= $this->phone.\";\";\n\t\t\t$string .= $this->email.\";\";\n\t\t\t$string .= \"\\n\";\n\t\t\tfwrite($file, $string);\n\t\t\tfclose($file);\n\t\t}\n\t}", "public function generateFemaleFirstName() {\n\t\t$command = $this->getDb()->createCommand(\"SELECT name FROM femalenames ORDER BY RANDOM() LIMIT 1\");\n\t\treturn $command->queryScalar();\n\t}", "public static function lastNameFemale()\n {\n return static::randomElement(static::$lastNameFemale);\n }", "private function setNewFileName()\n {\n $fname=date('YmdHis').rand(100,999);\n $this->newFileName=$fname.'.'.$this->fileType;\n }", "protected function getFemaleName()\n {\n return $this->femaleNames[rand(0, count($this->femaleNames) -1)];\n }", "function familyName($fname, $year) {\n\t\t\t\t\techo \"$fname Refsnes. Born in $year <br>\";\n\t\t\t\t}", "public function testSpecialFirstNameAndLastName()\n {\n $this->vcard->addName(\n $this->lastName2,\n $this->firstName2\n );\n\n $this->assertEquals('ali-ozsut', $this->vcard->getFilename());\n }", "public function addName()\n {\n if (!isset($this->filePond['name'])) {\n $this->filePond['name'] = 'File[file]';\n }\n }", "function setFileName($fname)\n {\n // set cutoff values for left and right of the filename to be \n // used in the corresponding .txt filename\n // (shortens to [title] [first] [last])\n $LCutoff = 33;\n $RCutoff = 5;\n \n // file name for the .txt file that will be written to\n return substr($fname, $LCutoff, (strlen($fname) - $RCutoff - $LCutoff)) . \".txt\";\n }", "public function testFullBlownName()\n {\n $this->vcard->addName(\n $this->lastName,\n $this->firstName,\n $this->additional,\n $this->prefix,\n $this->suffix\n );\n\n $this->assertEquals('mister-jeroen-desloovere-junior', $this->vcard->getFilename());\n }", "public function add($person, $file_key){\n //var_dump($person);\n \t$specials = explode(',',$person->special); \t\n\n \t$data = array(\n \t\t'案件流水號' => $file_key,\n \t\t'稱謂' => $person->title,\n \t\t'姓名' => $person->name,\n \t\t'身分證字號' =>$person->code,\n \t\t'出生日期' => $person->birthday,\n \t\t'戶籍地址' => $person->address,\n \t\t'職業' => $person->job,\n \t\t'特殊身分類別' => $specials[0],\n \t\t'特殊身分代號' => $specials[1],\n \t\t'配偶' => $person->marriage,\n \t\t'前配偶' => $person->marriage_ex,\n \t\t'area' => $person->area,\n \t\t'area_key' => $person->area_key,\n \t\t'個人描述' => $person->comm\n \t);\n\n \t$this->db->insert('family_members', $data);\n\t\t$member_key = $this->db->insert_id();\n\t\tlog_message('debug', 'family_members insert_id = '. $member_key);\n\t\t\n\t\treturn $member_key;\n\t}", "function setFName($p, $fn, $ex, $i){ \n\t\t if(RENAME_F ==1 && file_exists($p .$fn .$ex)){ \n\t\t return setFName($p, F_NAME .'_'. ($i +1), $ex, ($i +1)); \n\t\t }else{ \n\t\t return $fn .$ex; \n\t\t } \n\t\t}", "public function getFname()\n {\n return $this->fname;\n }", "function salutation($gender) {\n\t\n\t\t\t}", "public function setFirstLetterLastname($a_fll)\n\t{\n\t\t$this->first_letter = $a_fll;\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Store the new token for the credential and the persistent token. Create a new storage entry, if the combination of credential and persistent token does not exist.
public function storeTriplet($credential, $token, $persistentToken, $expire, array $user_data = []);
[ "private function storeToken($token) {\n $db_token = new GoogleTokenStorage();\n $db_token->setToken($token);\n $db_token->setScope($token['scope']);\n $this->manager->persist($db_token);\n $this->manager->flush();\n }", "public function storeToken($token);", "public function store(RememberToken $token): void;", "protected function storeNewToken(){\r\n $newToken = $this->Facebook->getToken();\r\n $this->params->set('auth_token', $newToken);\r\n StileroAFBPluginparamshelper::storeParams($this->params, 'autofbook');\r\n }", "abstract function storeTokenToCache(Token $token);", "public function saveToken(Token $token);", "protected function saveToken()\n {\n if (isset($this->token) && $this->token) {\n return;\n }\n\n if ($this->token = $this->getCookie($this->getCookieName())) {\n return;\n }\n\n // If cookie token doesn't exist, we need to create it with unique token...\n $this->token = base_convert(md5(uniqid(rand(), true)), 16, 36);\n setcookie($this->getCookieName(), $this->token, time() + 60 * 60 * 12, '/');\n\n // ... and attach it to broker session in SSO server.\n $this->attach();\n }", "private function persistTokens(): void\n {\n $this->client->getCurrencyApi()->all();\n $em = $this->doctrineHelper->getEntityManager($this->akeneoSettings);\n $em->getUnitOfWork()->removeFromIdentityMap($this->akeneoSettings);\n $em->refresh($this->akeneoSettings);\n\n $this->akeneoSettings->setToken($this->client->getToken());\n $this->akeneoSettings->setRefreshToken($this->client->getRefreshToken());\n $this->akeneoSettings->setTokenExpiryDateTime(new \\DateTime('now +3500 seconds'));\n\n $em->flush($this->akeneoSettings);\n $em->getUnitOfWork()->markReadOnly($this->akeneoSettings);\n }", "private function saveToken()\n\t{\n\t\t$fd = fopen($this->cacheFolder.\"/token.txt\", 'w');\n\t\tfwrite($fd, $this->token);\n\t\tfclose($fd);\n\t}", "private function saveCredentials($credentials)\n {\n $ttl = (int) $credentials->expires_in - 120;\n\n $this->engine->cache->put(static::AC_TOKEN, $credentials->access_token, $ttl);\n }", "public function save_entry() {\n\n if( !$this->perishable_token ) {\n $this->perishable_token = sha1(uniqid());\n }\n\n if( !$this->single_access_token ) {\n $this->single_access_token = sha1(uniqid());\n }\n\n if( !$this->persistence_token ) {\n $this->persistence_token = sha1(uniqid());\n }\n\n if( !$this->public_access_token ) {\n $this->public_access_token = sha1(uniqid());\n }\n\n\t\tparent::save_entry();\n\n\t\treturn $this;\n\t}", "function oauth_save_access_token($tokEnt, $token) {\n\n // clear out old data\n $tokEnt->clearMetaData('requestToken');\n $tokEnt->clearMetaData('secret');\n \n // reuse this token object for the access token\n $tokEnt->accessToken = $token->key;\n $tokEnt->secret = $token->secret;\n\n $tokEnt->save();\n\n return $tokEnt;\n\n}", "abstract public function persistSessionToken() ;", "protected function saveToken($token) {\n if ($this->connector_id === 0) {\n Civi::settings()->set('xero_access_token', $token->jsonSerialize());\n }\n else {\n civicrm_api3('Connector', 'create', ['id' => $this->connector_id, 'field4' => serialize($token->jsonSerialize())]);\n }\n }", "abstract protected function _save($token);", "private function RefreshAndStoreAndUseNewCredentials()\n {\n $gaTokenParameters = array(\n 'refresh_token' => $this->gaRefreshToken,\n 'client_id' => $this->gaClientId,\n 'client_secret' => $this->gaClientSecret,\n 'grant_type' => 'refresh_token'\n );\n\n $httpClient = new HttpClient();\n $responseJson = $httpClient->POST($this->gaTokenURLBase,$gaTokenParameters);\n $responseArray = json_decode($responseJson, TRUE); \n\n $this->gaAccessToken = $responseArray['access_token'];\n $this->gaTokenExpiryDate = date('d-m-Y H:i:s', strtotime('+'.$responseArray['expires_in'].' seconds'));\n\n $this->SaveCredentials();\n unset($httpClient);\n }", "function saveToken($tokenData);", "public function updateExistingToken(PersistentTokenInterface $token, #[\\SensitiveParameter] string $tokenValue, \\DateTimeInterface $lastUsed): void\n {\n // still accept it as valid in verifyToken\n $item = $this->cache->getItem($this->getCacheKey($token));\n $item->set($token->getTokenValue());\n $item->expiresAfter($this->outdatedTokenTtl);\n $this->cache->save($item);\n }", "protected function storeClientCredentialsToken(AccessToken $token): void\n {\n $this->getClientCredentialsCacheRepository()->set(\n config('twitch-api.oauth_client_credentials.cache_key'),\n $token->toArray()\n );\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add "Table" button and separator to the TinyMCE toolbar
public function add_tinymce_button( array $buttons ) { $buttons[] = 'iggogrid_insert_table'; return $buttons; }
[ "public function add_editor_buttons() {\n\t\tif ( ! current_user_can( 'iggogrid_list_tables' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->init_i18n_support();\n\t\tadd_thickbox(); // usually already loaded by media upload functions\n\t\t$admin_page = IggoGrid::load_class( 'IggoGrid_Admin_Page', 'class-admin-page-helper.php', 'classes' );\n\t\t$admin_page->enqueue_script( 'quicktags-button', array( 'quicktags', 'media-upload' ), array(\n\t\t\t'editor_button' => array(\n\t\t\t\t'caption' => __( 'Table', 'iggogrid' ),\n\t\t\t\t'title' => __( 'Insert a Table from IggoGrid', 'iggogrid' ),\n\t\t\t\t'thickbox_title' => __( 'Insert a Table from IggoGrid', 'iggogrid' ),\n\t\t\t\t'thickbox_url' => IggoGrid::url( array( 'action' => 'editor_button_thickbox' ), true, 'admin-post.php' ),\n\t\t\t),\n\t\t) );\n\n\t\t// TinyMCE integration\n\t\tif ( user_can_richedit() ) {\n\t\t\tadd_filter( 'mce_external_plugins', array( $this, 'add_tinymce_plugin' ) );\n\t\t\tadd_filter( 'mce_buttons', array( $this, 'add_tinymce_button' ) );\n\t\t\tadd_action( 'admin_print_styles', array( $this, 'add_iggogrid_hidpi_css' ), 21 );\n\t\t}\n\t}", "function add_tinymce_toolbar_button( $buttons ) {\n\t\t\t\t\tarray_push( $buttons, 'insertsection', 'insertreporttoken' );\n\t\t\t\t\treturn $buttons;\n\t\t\t\t}", "function get_tiny_toolbars() {\n\treturn array(\n 'toolbar1' => 'bold, italic, underline, strikethrough, |, bullist, numlist, |, forecolor, |, emoticons, |, link, unlink, |, undo, redo',\n 'toolbar2' => ''\n );\n}", "function add_tinymce_toolbar_button( $buttons ) {\n\n array_push( $buttons, 'hide_answer' );\n return $buttons;\n\n }", "function visual_editor_toolbar($toolbar){\n $toolbar['block_formats'] = \"Title=h3; Subtitle=h4; Paragraph=p; Small=small\";\n $toolbar['toolbar1'] = 'formatselect,bold,italic,small,bullist,numlist,blockquote,hr,alignleft,link,unlink,spellchecker,pastetext,removeformat,plyr,wp_fullscreen';\n $toolbar['toolbar2'] = '';\n\n return $toolbar;\n }", "function add_mce_buttons_row_4( $mce_buttons ) {\n\n\t$mce_buttons[] = 'cut';\n\t$mce_buttons[] = 'copy';\n\t$mce_buttons[] = 'paste';\n\n\t$mce_buttons[] = 'hr';\n\n\t$mce_buttons[] = 'subscript';\n\t$mce_buttons[] = 'superscript';\n\t$mce_buttons[] = 'media';\n\n\treturn $mce_buttons;\n}", "public function tinymce_button() {\n\t\t\t// filters\n\t\t\tadd_filter('mce_external_plugins', array(&$this, 'tinymce_external_plugins'));\n\t\t}", "function my_mce_buttons_2( $buttons ) {\t\n\t$buttons[] = 'superscript';\n\t$buttons[] = 'subscript';\n\n\treturn $buttons;\n}", "function tableau_quicktag() {\n?>\n\t<script type=\"text/javascript\" charset=\"utf-8\">\n\t\tQTags.addButton( 'tableau-plugin', 'tableau', '\\n[tableau server=\"\" workbook=\"\" view=\"\" tabs=\"\" toolbar=\"\" revert=\"\" refresh=\"\" linktarget=\"\" width=\"800px\" height=\"600px\"]', '[/tableau]\\n' );\n\t</script>\n<?php\n}", "function shiftr_mce() {\n add_filter( 'mce_external_plugins', 'shiftr_editor' );\n add_filter( 'mce_buttons', 'shiftr_editor_register_buttons' );\n}", "public function add_tables() {\n\n\t\tinclude wp_style_guide_get_template( 'tables' );\n\n\t }", "function attraxion15_make_mce_awesome($in) {\n $in['block_formats'] = 'h2=h2';\n $in['theme_advanced_styles'] = '.lead=lead';\n $in['toolbar1']='formatselect,|,bold,italic,|,bullist,numlist,blockquote,|,link,unlink,|,pastetext,undo,redo,|,cleanup';\n //$in['toolbar1']='bold,italic,|,bullist,numlist,blockquote,|,link,unlink,|,pastetext,undo,redo';\n $in['toolbar2']='';\n $in['toolbar3']='';\n $in['toolbar4']='';\n return $in;\n}", "function add_tinymce_button( $buttons ) {\n\n \t\tarray_push( $buttons, '|', 'wpmodal');\n \t\treturn $buttons;\n\n \t}", "function bb_table($id)\n\t{\n\t\t$data = \"[table][tr][td]Cell 1[/td][td]Cell 2[/td][/tr][/table]\";\n\t\t$event = $this->getEvent('addtext',$data,'Insert a table',1);\n\t\t$text = \"<a {$event} class='e-bb' id='{$id}' data-function='insert' href='#{$this->var['tagid']}' data-bbcode='{$data}'>\";\n\t\t$text .= \"<img class='bbcode_buttons e-pointer' src='\".e_IMAGE_ABS.\"bbcode/table.png' alt='' title='Insert a table' /></a>\";\n\t\treturn $text;\n\t}", "function wp_super_edit_wordpress_button_defaults() {\n\tglobal $wp_super_edit;\n\n\tif ( !$wp_super_edit->is_installed ) return;\n\t\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'bold', \n\t\t'nicename' => __( 'Bold', 'wp-super-edit' ), \n\t\t'description' => __( 'Bold content with strong HTML tag. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'italic', \n\t\t'nicename' => __( 'Italic', 'wp-super-edit' ), \n\t\t'description' => __( 'Italicize content with em HTML tag. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'strikethrough', \n\t\t'nicename' => __( 'Strikethrough', 'wp-super-edit' ), \n\t\t'description' => __( 'Strike out content with strike HTML tag. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'bullist', \n\t\t'nicename' => __( 'Bulleted List', 'wp-super-edit' ), \n\t\t'description' => __( 'An unordered list. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'numlist', \n\t\t'nicename' => __( 'Numbered List', 'wp-super-edit' ), \n\t\t'description' => __( 'An ordered list. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'blockquote', \n\t\t'nicename' => __( 'Block Quote', 'wp-super-edit' ), \n\t\t'description' => __( 'Blockquotes are used when quoting other content. Usually this content is displayed as indented.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'justifyleft', \n\t\t'nicename' => __( 'Left Justification', 'wp-super-edit' ), \n\t\t'description' => __( 'Set the alignment to left justification. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'justifycenter', \n\t\t'nicename' => __( 'Center Justification', 'wp-super-edit' ), \n\t\t'description' => __( 'Set the alignment to center justification. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'justifyright', \n\t\t'nicename' => __( 'Right Justification', 'wp-super-edit' ), \n\t\t'description' => __( 'Set the alignment to right justification. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'link', \n\t\t'nicename' => __( 'Create Link', 'wp-super-edit' ), \n\t\t'description' => __( 'Create a link. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'unlink', \n\t\t'nicename' => __( 'Remove Link', 'wp-super-edit' ), \n\t\t'description' => __( 'Remove a link. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_more', \n\t\t'nicename' => __( 'Wordpress More Tag', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert Wordpress MORE tag to divide content to multiple views. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'spellchecker', \n\t\t'nicename' => __( 'Spell Check', 'wp-super-edit' ), \n\t\t'description' => __( 'Wordpress spell check. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_adv', \n\t\t'nicename' => __( 'Show/Hide Advanced toolbar', 'wp-super-edit' ), \n\t\t'description' => __( 'Built in Wordpress button <strong>normally hidden</strong>. When pressed it will show extra rows of buttons (or press Ctrl-Alt-V on FF, Alt-V on IE).', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'formatselect', \n\t\t'nicename' => __( 'Paragraphs and Headings', 'wp-super-edit' ), \n\t\t'description' => __( 'Set Paragraph or Headings for content.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'underline', \n\t\t'nicename' => __( 'Underline Text', 'wp-super-edit' ), \n\t\t'description' => __( 'Built in Wordpress button to underline selected text.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'justifyfull', \n\t\t'nicename' => __( 'Full Justification', 'wp-super-edit' ), \n\t\t'description' => __( 'Set the alignment to full justification. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'forecolor', \n\t\t'nicename' => __( 'Foreground color', 'wp-super-edit' ), \n\t\t'description' => __( 'Set foreground or text color. May produce evil font tags. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'pastetext', \n\t\t'nicename' => __( 'Paste as Text', 'wp-super-edit' ), \n\t\t'description' => __( 'Paste clipboard text and remove formatting. Useful for pasting text from applications that produce substandard HTML. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'pasteword', \n\t\t'nicename' => __( 'Paste from Microsoft Word', 'wp-super-edit' ), \n\t\t'description' => __( 'Attempts to clean up HTML produced by Microsoft Word during cut and paste. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'removeformat', \n\t\t'nicename' => __( 'Remove HTML Formatting', 'wp-super-edit' ), \n\t\t'description' => __( 'Removes HTML formatting from selected item. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'media', \n\t\t'nicename' => __( 'Media', 'wp-super-edit' ), \n\t\t'description' => __( 'Add or edit embedded media like Flash, Quicktime, or Windows Media. Different from WordPress Media tools.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'charmap', \n\t\t'nicename' => __( 'Special Characters', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert special characters or entities using a visual interface. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'outdent', \n\t\t'nicename' => __( 'Decrease Indentation', 'wp-super-edit' ), \n\t\t'description' => __( 'This will decrease the level of indentation based on content position. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'indent', \n\t\t'nicename' => __( 'Increase Indentation', 'wp-super-edit' ), \n\t\t'description' => __( 'This will increase the level of indentation based on content position. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'undo', \n\t\t'nicename' => __( 'Undo option', 'wp-super-edit' ), \n\t\t'description' => __( 'Undo previous formatting changes. Not useful once you save. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'redo', \n\t\t'nicename' => __( 'Redo option', 'wp-super-edit' ), \n\t\t'description' => __( 'Redo previous formatting changes. Not useful once you save. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_help', \n\t\t'nicename' => __( 'Wordpress Help', 'wp-super-edit' ), \n\t\t'description' => __( 'Built in Wordpress help documentation. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\n\t// End WordPress Defaults\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'cleanup', \n\t\t'nicename' => __( 'Clean up HTML', 'wp-super-edit' ), \n\t\t'description' => __( 'Attempts to clean up bad HTML in the editor. Built in Wordpress button.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'image', \n\t\t'nicename' => __( 'Image Link', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert linked image. Wordpress default editor option for first row.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\t\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'anchor', \n\t\t'nicename' => __( 'Anchors', 'wp-super-edit' ), \n\t\t'description' => __( 'Create named anchors.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'sub', \n\t\t'nicename' => __( 'Subscript', 'wp-super-edit' ), \n\t\t'description' => __( 'Format text as Subscript.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'sup', \n\t\t'nicename' => __( 'Superscript', 'wp-super-edit' ), \n\t\t'description' => __( 'Format text as Superscript.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'backcolor', \n\t\t'nicename' => __( 'Background color', 'wp-super-edit' ), \n\t\t'description' => __( 'Set background color for selected tag or text. ', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'code', \n\t\t'nicename' => __( 'HTML Source', 'wp-super-edit' ), \n\t\t'description' => __( 'View and edit the HTML source code.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_page', \n\t\t'nicename' => __( 'Wordpress Next Page Tag', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert Wordpress Next Page tag to divide page content into multiple views.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_help', \n\t\t'nicename' => __( 'Wordpress Editor Help', 'wp-super-edit' ), \n\t\t'description' => __( 'Shows some visual editor documentation and shortcut information', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\t\n\t\n\t// Start Included Plugin Defaults\n\n\t// fullscreen\n\t// Someday we deal with wp_fullscreen\n\t\n\t// WP Super Edit options for this plugin\n\t\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'fullscreen', \n\t\t'nicename' => __( 'Full Screen', 'wp-super-edit' ), \n\t\t'description' => __( 'Toggle Full Screen editor mode.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'wp_fullscreen', \n\t\t'nicename' => __( 'WordPress Distraction Free Writing', 'wp-super-edit' ), \n\t\t'description' => __( 'Toggle WordPress Full Screen editor mode for distraction free writing.', 'wp-super-edit' ), \n\t\t'provider' => 'wordpress', \n\t\t'plugin' => '', \n\t\t'status' => 'yes'\n\t));\t\n\t\n\t// advhr\n\t\n\t// WP Super Edit options for this plugin\n\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'advhr', \n\t\t'nicename' => __( 'Advanced Horizontal Rule Lines', 'wp-super-edit' ), \n\t\t'description' => __( 'Advanced rule lines with options for &lt;hr&gt; HTML tag.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'advhr', \n\t\t'nicename' => __( 'Horizontal Rule Lines', 'wp-super-edit' ), \n\t\t'description' => __( 'Options for using the &lt;hr&gt; HTML tag', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'advhr', \n\t\t'status' => 'no'\n\t));\n\t\n\t// advimage\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'advimage', \n\t\t'nicename' => __( 'Advanced Image Link', 'wp-super-edit' ), \n\t\t'description' => __( 'A more advanded dialog for the Image Link button.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// advlink\n\t\n\t// WP Super Edit options for this plugin\n\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'advlink', \n\t\t'nicename' => __( 'Advanced Link', 'wp-super-edit' ), \n\t\t'description' => __( 'A more advanded dialog for the Create Link button.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// contextmenu\n\t\n\t// WP Super Edit options for this plugin\n\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'contextmenu', \n\t\t'nicename' => __( 'Context Menu', 'wp-super-edit' ), \n\t\t'description' => __( 'TinyMCE context menu is used by some plugins. The context menu is activated by right mouse click or crtl click on Mac in the editor area.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// fonttools\n\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'fonttools', \n\t\t'nicename' => __( 'Font Tools', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds the Font Family and Font Size buttons to the editor.', 'wp-super-edit' ), \n\t\t'provider' => 'tinymce', \n\t\t'status' => 'no', \n\t\t'url' => 'none',\t\t\n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'fontselect', \n\t\t'nicename' => __( 'Font Select', 'wp-super-edit' ), \n\t\t'description' => __( 'Shows a drop down list of Font Typefaces.', 'wp-super-edit' ), \n\t\t'provider' => 'tinymce', \n\t\t'plugin' => 'fonttools',\n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'fontsizeselect', \n\t\t'nicename' => __( 'Font Size Select', 'wp-super-edit' ), \n\t\t'description' => __( 'Shows a drop down list of Font Sizes.', 'wp-super-edit' ), \n\t\t'provider' => 'tinymce', \n\t\t'plugin' => 'fonttools', \n\t\t'status' => 'no'\n\t));\n\t\n\t// insertdatetime\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'insertdatetime', \n\t\t'nicename' => __( 'Insert Date / Time Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds insert date and time buttons to automatically insert date and time.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'insertdate', \n\t\t'nicename' => __( 'Insert Date', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert current date in editor', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'insertdatetime', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'inserttime', \n\t\t'nicename' => __( 'Insert Time', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert current time in editor', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'insertdatetime', \n\t\t'status' => 'no'\n\t));\n\t\n\t// layer\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'layer', \n\t\t'nicename' => __( 'Layers (DIV) Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert layers using DIV HTML tag. This plugin will change the editor to allow all DIV tags. Provides the Insert Layer, Move Layer Forward, Move Layer Backward, and Toggle Layer Positioning Buttons.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'insertlayer', \n\t\t'nicename' => __( 'Insert Layer', 'wp-super-edit' ), \n\t\t'description' => __( 'Insert a layer using the DIV HTML tag. Be careful layers are tricky to position.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'layer', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'moveforward', \n\t\t'nicename' => __( 'Move Layer Forward', 'wp-super-edit' ), \n\t\t'description' => __( 'Move selected layer forward in stacked view.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'layer', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'movebackward', \n\t\t'nicename' => __( 'Move Layer Backward', 'wp-super-edit' ), \n\t\t'description' => __( 'Move selected layer backward in stacked view.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'layer', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'absolute', \n\t\t'nicename' => __( 'Toggle Layer Positioning', 'wp-super-edit' ), \n\t\t'description' => __( 'Toggle the layer positioning as absolute or relative. Be careful layers are tricky to position.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'layer', \n\t\t'status' => 'no'\n\t));\n\t\n\t// nonbreaking\n\t\n\t// WP Super Edit options for this plugin\n\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'nonbreaking', \n\t\t'nicename' => __( 'Nonbreaking Spaces', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds button to insert nonbreaking space entity.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'nonbreaking', \n\t\t'nicename' => __( 'Nonbreaking Space', 'wp-super-edit' ), \n\t\t'description' => __( 'Inserts nonbreaking space entities.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'nonbreaking', \n\t\t'status' => 'no'\n\t));\n\t\n\t// print\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'print', \n\t\t'nicename' => __( 'Print Button Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds print button to editor that should print only the edit area contents.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'print', \n\t\t'nicename' => __( 'Print', 'wp-super-edit' ), \n\t\t'description' => __( 'Print editor area contents.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'print', \n\t\t'status' => 'no'\n\t));\n\t\n\t// searchreplace\n\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'searchreplace', \n\t\t'nicename' => __( 'Search and Replace Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Adds search and replace buttons and options to the editor.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'search', \n\t\t'nicename' => __( 'Search', 'wp-super-edit' ), \n\t\t'description' => __( 'Search for text in editor area.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'searchreplace', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'replace', \n\t\t'nicename' => __( 'Replace', 'wp-super-edit' ), \n\t\t'description' => __( 'Replace text in editor area.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'searchreplace', \n\t\t'status' => 'no'\n\t));\n\t\n\t// style\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'style', \n\t\t'nicename' => __( 'Advanced CSS / styles Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Allows access to properties that can be used in a STYLE attribute. Provides the Style Properties Button.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'styleprops', \n\t\t'nicename' => __( 'Style Properties', 'wp-super-edit' ), \n\t\t'description' => __( 'Interface for properties that can be manipulated using the STYLE attribute.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'style', \n\t\t'status' => 'no'\n\t));\n\t\n\t// table\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'table', \n\t\t'nicename' => __( 'Tables Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Allows the creation and manipulation of tables using the TABLE HTML tag. Provides the Tables and Table Controls Buttons.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'table', \n\t\t'nicename' => __( 'Tables', 'wp-super-edit' ), \n\t\t'description' => __( 'Interface to create and change table, row, and cell properties.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'table', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'tablecontrols', \n\t\t'nicename' => __( 'Table controls', 'wp-super-edit' ), \n\t\t'description' => __( 'Interface to manipulate tables and access to cell and row properties.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'table', \n\t\t'status' => 'no'\n\t));\n\t\n\t// xhtmlxtras\n\t\n\t// WP Super Edit options for this plugin\n\t\n\t$wp_super_edit->register_tinymce_plugin( array(\n\t\t'name' => 'xhtmlxtras', \n\t\t'nicename' => __( 'XHTML Extras Plugin', 'wp-super-edit' ), \n\t\t'description' => __( 'Allows access to interfaces for some XHTML tags like CITE, ABBR, ACRONYM, DEL and INS. Also can give access to advanced XHTML properties such as javascript events. Provides the Citation, Abbreviation, Acronym, Deletion, Insertion, and XHTML Attributes Buttons.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'status' => 'no', \n\t\t'callbacks' => ''\n\t));\n\t\n\t// Tiny MCE Buttons provided by this plugin\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'cite', \n\t\t'nicename' => __( 'Citation', 'wp-super-edit' ), \n\t\t'description' => __( 'Indicate a citation using the HTML CITE tag.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'abbr', \n\t\t'nicename' => __( 'Abbreviation', 'wp-super-edit' ), \n\t\t'description' => __( 'Indicate an abbreviation using the HTML ABBR tag.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'acronym', \n\t\t'nicename' => __( 'Acronym', 'wp-super-edit' ), \n\t\t'description' => __( 'Indicate an acronym using the HTML ACRONYM tag.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'del', \n\t\t'nicename' => __( 'Deletion', 'wp-super-edit' ), \n\t\t'description' => __( 'Use the HTML DEL tag to indicate recently deleted content.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'ins', \n\t\t'nicename' => __( 'Insertion', 'wp-super-edit' ), \n\t\t'description' => __( 'Use the HTML INS tag to indicate newly inserted content.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n\t$wp_super_edit->register_tinymce_button( array(\n\t\t'name' => 'attribs', \n\t\t'nicename' => __( 'XHTML Attributes', 'wp-super-edit' ), \n\t\t'description' => __( 'Modify advanced attributes and javascript events.', 'wp-super-edit' ), \n\t\t'provider' => 'wp_super_edit', \n\t\t'plugin' => 'xhtmlxtras', \n\t\t'status' => 'no'\n\t));\n\t\n}", "function hh_register_tinymce_shortcode_buttons( $buttons ) {\n array_push( $buttons, \"|\", \"hh_image\" );\n return $buttons;\n}", "public function EditorToolbar() {\n\t\treturn Object::create('HtmlEditorField_Toolbar', $this, \"EditorToolbar\");\n\t}", "protected function addToolbar()\n\t{\n\t\t$jinput = Factory::getApplication()->input;\n\t\t\t\t$jinput->set('hidemainmenu', true);\n\t\t\t\tparent::addToolbar();\n\tToolbarHelper::apply('smextxmleditor.apply');\n\tToolbarHelper::save('smextxmleditor.save');\n\tToolbarHelper::cancel('smextxmleditor.cancel', 'JTOOLBAR_CANCEL');\n\n\n// // Set toolbar items for the page\n\t$this->title = $this->file_name;\n\t$this->icon = 'xml-edit';\n\n \n }", "public function enableTableTools() {\n $this->_showTableTools = true;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return's the source directory that has to be watched for new files.
protected function getSourceDir() { return $this->getConfiguration()->getSourceDir(); }
[ "public function getSourceDir();", "public static function sourceDirectory(): string\n {\n return static::$sourceDirectory ?? Hyde::getSourceRoot();\n }", "public function getSrcDir()\n {\n return $this->getRootDir() . 'src/';\n }", "public function getSourcePath()\n {\n return $this->getPath().'/src/';\n }", "function sourcePath()\n {\n\t\treturn realpath($this->_sourcePath[$this->_sourceIndex]);\n\t}", "public function getPageSourceDirectory()\n {\n $this->logger->alert('getPageSourceDirectory', []);\n return sprintf(\n '%s/%s',\n $this->reader->getModuleDir(Dir::MODULE_VIEW_DIR, $this->sourceModule),\n 'page_source'\n );\n }", "public function files_dir()\n\t{\n\t return getcwd() . '/' . FILES_DIR;\n\t}", "private function _getSourceFileSystemPath()\n\t{\n\t\treturn rtrim($this->getSettings()->path, '/').'/';\n\t}", "public static function getSRCPath()\n {\n return implode(DIRECTORY_SEPARATOR, array(self::getRootPath(), \"src\")) . DIRECTORY_SEPARATOR;\n }", "protected function getTestSourceBasePath() {\n\t\treturn Yii::getPathOfAlias('application.runtime').DIRECTORY_SEPARATOR.get_class($this).'_source';\n\t}", "private function getSourceRoot()\n {\n return ASSETS_PATH . '/src';\n }", "static function getClientSourceFolder() {\n\t\treturn self::getClientResourcesFolder().system::getDirSeparator().self::FOLDER_CLIENT_SOURCE;\n\t}", "protected function monitoredThemeDirectories() {\n return [\n self::THEME_BASE . '/src',\n ];\n }", "function sixscan_signatures_update_find_plugin_dir( $src_dir ){\n\t$file_list = scandir( $src_dir );\n\n\t\tforeach( $file_list as $current_file ) {\n\t\t\tif( $current_file == \".\" || $current_file == \"..\" ) {\n\t\t\t\t/* skip \"current\" and \"previous\" directory */\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif( is_dir( $src_dir . \"/\" . $current_file ) )\n\t\t\t\treturn $src_dir . \"/\" . $current_file;\n\t\t}\n\t\t\n\t\treturn \"\";\t//Not found :(\n}", "public function getBaseSourcePath()\n {\n return isset($this->sourcePath) ? Yii::getAlias($this->sourcePath) : Config::getCurrentDir($this);\n }", "protected abstract function get_source_files();", "public function getFileBaseDir()\n {\n return Mage::getBaseDir('media').DS.'worksheet'.DS.'file'.DS;\n }", "public function getSourceDirectories() : array\n {\n return $this->sourceDirectories;\n }", "public function get_files_directory() {\n return '../data/files/' . hash_secure($this->name);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set the value of ShippingTax, return this.
public function withShippingTax($value) { $this->setShippingTax($value); return $this; }
[ "public function setShippingTax($value)\n {\n $this->_fields['ShippingTax']['FieldValue'] = $value;\n return $this;\n }", "public function setShippingTax($value) \n {\n $this->_fields['ShippingTax']['FieldValue'] = $value;\n return;\n }", "public function withShippingChargeTax($value)\n {\n $this->setShippingChargeTax($value);\n return $this;\n }", "public function setShippingTaxAmount($amount);", "public function setBaseTax($value)\n {\n $this->_fields['BaseTax']['FieldValue'] = $value;\n return $this;\n }", "public function withTaxAmount($value)\n {\n $this->setTaxAmount($value);\n return $this;\n }", "public function withItemTax($value)\n {\n $this->setItemTax($value);\n return $this;\n }", "public function setAllTax()\n {\n $store = $this->getStore();\n\n $this->setRowTotalInclTax(\n $store->roundPrice($this->getRowTotal() + $this->getTaxAmount())\n );\n $this->setBaseRowTotalInclTax(\n $store->roundPrice($this->getBaseRowTotal() + $this->getTaxAmount())\n );\n\n $this->setPriceInclTax(\n $store->roundPrice($this->getPrice() + $this->getTaxPerItem())\n );\n $this->setBasePriceInclTax(\n $store->roundPrice($this->getBasePrice() + $this->getTaxPerItem())\n );\n\n if ($this->getTaxChangeAmount() > 0) {\n $this->reinvoiceTax();\n } elseif ($this->getTaxChangeAmount() < 0) {\n $this->creditMemoTax();\n }\n\n return $this;\n }", "public function getShippingTax()\n {\n return $this->_fields['ShippingTax']['FieldValue'];\n }", "public function withTaxingRegion($value)\n {\n $this->setTaxingRegion($value);\n return $this;\n }", "public function setShippingInclTax($amount);", "public function setTaxNo($taxno);", "public function getShippingTaxAmount();", "public function setBaseShippingInclTax($amount);", "public function getShippingTaxAmount(){\n return $this->_get(self::SHIPPING_TAX_AMOUNT);\n }", "public function getBaseShippingTaxAmount();", "function setTaxes()\n {\n $this->taxes = round($this->subtotal*TAX_RATE/100, 2);\n }", "public function setShipping()\n {\n $weight = (\\Session::has('noShipping') ? null : $this->orderWeight);\n\n $this->orderShipping = $this->shipping->getShipping($weight);\n\n return $this;\n }", "public function setTaxAmount($taxAmount);" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Establece el valor del atributo iid_zona de ZonaSacd
function setId_zona($iid_zona = '') { $this->iid_zona = $iid_zona; }
[ "function getDatosId_zona()\n {\n $nom_tabla = $this->getNomTabla();\n $oDatosCampo = new core\\DatosCampo(array('nom_tabla' => $nom_tabla, 'nom_camp' => 'id_zona'));\n $oDatosCampo->setEtiqueta(_(\"id_zona\"));\n return $oDatosCampo;\n }", "public function getZona()\n {\n return $this->zona;\n }", "function zona_from_ciudad(lt_form $fo, $ciudad_id, $por_defecto=1)\n{\n\t$zona_id = $por_defecto;\n\t$c = new lt_condicion('ciudad_id', '=', $ciudad_id);\n\tif (($r = lt_registro::crear($fo, 'zonas', 0, FALSE, $c)))\n\t{\n\t\t$zona_id = $r->v->zona_id;\n\t}\n\treturn $zona_id;\n}", "function getNombre_zona()\n {\n if (!isset($this->snombre_zona) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->snombre_zona;\n }", "public function getZohoAddressId();", "public function getZoneId()\n {\n return $this->zone_id;\n }", "public function getIdZone() {\n return intval($this->idZone);\n }", "public function getZoneId(): string\n {\n return $this->zoneId;\n }", "public function editZona($dataForm, $id_zona)\r\n {\r\n // bindeamos campos del formulario, que coinciden con la tabla envio\r\n foreach ($dataForm as $key => $value) {\r\n $binds[\":$key\"] = $value;\r\n }\r\n // id_envio no está como campo de formulario, lo añadimos\r\n $binds[\":id_zona\"] = $id_zona;\r\n \r\n $this->mysqlDB->setBinds($binds);\r\n $this->mysqlDB->where('id_zona')->update($this->table, $dataForm);\r\n }", "function getId_ciudad() {\n return $this->id_ciudad;\n }", "public function getIdAbono()\n {\n return $this->id_abono;\n }", "public function getZohoId();", "public function getZoneId() : string\n {\n return $this->zoneId;\n }", "public function getTimeZoneId(){}", "public function get_zona_p($id)\r\n\t\t{\r\n\r\n\t\t\t$sql=\"SELECT * FROM zonas inner join profesores_has_zonas on zonas.id_zonas = profesores_has_zonas.zonas WHERE Profesores =\".$id;\r\n\t\t\t$this->query($sql);\r\n\r\n\t\t\t$res=$this->execute();\r\n\t\t\tif($res){\r\n\t\t\t\t$result=$this->resultset();\r\n\r\n\t\t\t}else {$result=null;}\r\n\t\t\treturn $result;\r\n\t\t}", "public static function getAirportInfo($icao) {\n $icao = strtoupper(DB::escape($icao));\n\n /*$key = 'get_airport_'.$icao;\n \n $airport_info = CodonCache::read($key);\n if($airport_info === false)\n {*/\n $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'airports \n\t\t\t\tWHERE `icao`=\\'' . $icao . '\\'';\n\n $airport_info = DB::get_row($sql);\n /*\tCodonCache::write($key, $airport_info, 'long');\n }*/\n\n return $airport_info;\n }", "function get_zona($zona_med)\n {\n $zona = $this->db->query(\"\n SELECT\n *\n\n FROM\n `zonas`\n\n WHERE\n `zona_med` = '\".$zona_med.\"'\")->row_array();\n\n return $zona;\n }", "protected function crear_zona()\n\t{\n\t\t$clase = 'toba_zona';\n\t\tif (trim($this->info['basica']['item_zona']??'')!=\"\") {\n\t\t\t//--- Tiene subclase?\n\t\t\tif (isset($this->info['basica']['item_zona_archivo'])) {\n\t\t\t\t$punto = toba::puntos_montaje()->get_por_id($this->info['basica']['zona_punto_montaje']);\n\t\t\t\t$path = $punto->get_path_absoluto().'/'.$this->info['basica']['item_zona_archivo'];\n\t\t\t\trequire_once($path);\n\t\t\t\t$clase = $this->info['basica']['item_zona'];\n\t\t\t}\n\t\t\t//--- Tiene consulta?\n\t\t\t$consulta = array(\n\t\t\t\t\t'archivo' => $this->info['basica']['zona_cons_archivo'],\n\t\t\t\t\t'clase' => $this->info['basica']['zona_cons_clase'],\n\t\t\t\t\t'metodo' => $this->info['basica']['zona_cons_metodo']\n\t\t\t);\n\t\t\t$this->zona = new $clase($this->info['basica']['item_zona'], $consulta);\n\t\t}\n\t}", "public function getId_ciudad()\n {\n return $this->id_ciudad;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fire the 'bp_loaded' action, which fires after BP's core plugin files have been loaded. Attached to 'plugins_loaded'.
function bp_loaded() { do_action( 'bp_loaded' ); }
[ "public function action_plugins_loaded() {\n\t\tdo_action( 'mexp_init' );\n\t}", "public function onPluginsLoaded(){\n\t\t$this->Slim->Event->emit('plugins_loaded');\n\t}", "function bp_ready() {\n\tdo_action( 'bp_ready' );\n}", "public function onLoad()\n {\n $plugins = $this->getPluginHandler();\n $plugins->getPlugin('Message');\n }", "public static function loaded() {\r\n\r\n\t\t/**\r\n\t\t * Fires when Gravity Forms has loaded.\r\n\t\t *\r\n\t\t * When developing Add-Ons, use this hook to initialize any functionality that depends on Gravity Forms functionality.\r\n\t\t */\r\n\t\tdo_action( 'gform_loaded' );\r\n\r\n\t\t//initializing Add-Ons if necessary\r\n\t\tif ( class_exists( 'GFAddOn' ) ) {\r\n\t\t\tGFAddOn::init_addons();\r\n\t\t}\r\n\r\n\t\tif ( defined( 'OSDXP_DASHBOARD_VER' ) ) {\r\n\t\t\t// Integration with osDXP.\r\n\t\t\trequire_once plugin_dir_path( __FILE__ ) . 'includes/class-gf-osdxp.php';\r\n\t\t}\r\n\t}", "public function on_plugins_loaded()\n {\n\n if ($this->is_compatible()) {\n add_action('elementor/init', [$this, 'init']);\n }\n\n }", "public function action_on_load() {\n\t\trequire_once 'related-posts/jetpack-related-posts.php';\n\t\tJetpack_RelatedPosts::init();\n\n\t\tif ( is_admin() ) {\n\t\t\tJetpack::enable_module_configurable( __FILE__ );\n\t\t}\n\n\t\t// Load Customizer controls.\n\t\tif ( class_exists( 'WP_Customize_Manager' ) ) {\n\t\t\trequire_once 'related-posts/class.related-posts-customize.php';\n\t\t}\n\t}", "public function onPluginsLoaded()\n {\n // inject the WordPress identity into the Zend_Auth singleton\n $wordPress = $this->bootstrap('wordPress')\n ->getResource('wordPress');\n if ('Yes' == $wordPress->getCustomOption('bootstrapAuth', 'Yes')) {\n $adapter = new Vulnero_Auth_Adapter_WordPress($wordPress);\n $auth = Zend_Auth::getInstance();\n $result = $auth->authenticate($adapter);\n\n // register an action helper to enforce any Acl requirements\n Zend_Controller_Action_HelperBroker::addHelper(new Vulnero_Controller_Action_Helper_Acl());\n }\n }", "public function onPluginsLoaded(array &$plugins)\n {\n // your code\n }", "function _wp_loaded() {\n\t\tself::callback( $this, 'wp_loaded' );\n\t}", "public function handler_wp_plugins_loaded()\n\t{\n\t\tglobal $enfold_cf7_integration_globals;\n\t\t\n\t\tif( ! class_exists( $enfold_cf7_integration_globals['base_plugin_class'] ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif( version_compare( WPCF7_VERSION, $enfold_cf7_integration_globals['base_plugin_min_version'], '<' ) )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\t\n\t\trequire_once $enfold_cf7_integration_globals['plugin_path'] . 'classes/class-enfold-cf7-integration.php';\n\t\t\n\t\t$this->cf7 = new Enfold_CF7_Integration();\n\t}", "public function wpmdbc_plugins_loaded() {\n\t\tif ( $this->wpmdbc_is_wpmdb_flush_call() ) {\n\t\t\tob_start();\n\t\t}\n\t}", "function loaded() {\n\t\tdo_action( 'bp_docs_loaded' );\n\t}", "public function onPluginsInitialized()\n {\n // Plugin always active.\n $this->active = true;\n return;\n }", "protected function onLoaded()\r\n\t{\r\n\t\t\r\n\t}", "public function after_plugins_loaded() {\n // Initiate background processes\n $processes = get_option( 'dokan_background_processes', [] );\n\n if ( ! empty( $processes ) ) {\n foreach ( $processes as $processor => $file ) {\n if ( file_exists( $file ) ) {\n include_once $file;\n new $processor();\n }\n }\n }\n }", "public function plugins_loaded() {\n // register this as an event area type\n do_action_ref_array( 'qsot-register-event-area-type', array( &$this ) );\n }", "public function loaded() {\n global $tools;\n $files = array_merge($this->loaded_plugins,$this->loaded_files);\n $tools->display($files);\n echo '<b>--------------------------------------------------------------------------------------------------</b><br/>';\n }", "function onLoad() {\n\t\tglobal $app;\n\n\t\t//* Databases\n\t\t$app->plugins->registerEvent('database_insert', $this->plugin_name, 'db_insert');\n\t\t$app->plugins->registerEvent('database_update', $this->plugin_name, 'db_update');\n\t\t$app->plugins->registerEvent('database_delete', $this->plugin_name, 'db_delete');\n\n\t\t//* Database users\n\t\t$app->plugins->registerEvent('database_user_insert', $this->plugin_name, 'db_user_insert');\n\t\t$app->plugins->registerEvent('database_user_update', $this->plugin_name, 'db_user_update');\n\t\t$app->plugins->registerEvent('database_user_delete', $this->plugin_name, 'db_user_delete');\n\t}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns an array containing all the error messages, not indexed by field name
public function getErrorMessages() { $messages = []; foreach ($this->errors as $field => $errors) { $messages = array_merge($messages, $errors); } return $messages; }
[ "public function getErrorMessages()\n {\n $returnValue = array();\n \n foreach ($this->formFields as $formField) {\n $error = $formField->getErrorMessage();\n if ($error) {\n $returnValue[$formField->getFieldName()] = $error;\n }\n }\n \n return $returnValue;\n }", "public static function getFieldError()\n {\n $result = [];\n foreach (self::$errors as $key => $errs) {\n if (isset($errs[0])) {\n $result[$key] = $errs[0];\n }\n }\n\n return $result;\n }", "public function non_field_errors() {\n $errs = $this->errors;\n if(array_key_exists(NON_FIELD_ERRORS,$errs)) {\n return $errs[NON_FIELD_ERRORS];\n } else {\n return array();\n }\n }", "public function errorFields(): array {\n\t\t$ret = [];\n\n\t\tforeach($this->m_errors as $error) {\n\t\t\t$ret = array_merge($ret, $error->fields);\n\t\t}\n\n\t\treturn array_unique($ret);\n\t}", "public function getValidationErrors()\n {\n $fields = $this->getFields();\n if (!$fields) {\n return [];\n }\n\n $result = [];\n foreach ($fields as $field) {\n if ($field instanceof AbstractFormField) {\n if (!$field->isValid()) {\n $result = array_merge($result, $field->getErrorMessages());\n }\n }\n }\n\n return $result;\n }", "protected function getErrorMessages()\n {\n if (!isset($this->errorMessages)) {\n $this->errorMessages = array();\n\n foreach ($this->getFormFields() as $section => $data) {\n $this->validateFields($data, $section);\n }\n }\n\n return $this->errorMessages;\n }", "public function getFieldErrors($field) {\n if (empty($this->errors[$field])) {\n return [];\n } else {\n $result = [];\n foreach ($this->errors[$field] as $error) {\n $result[] = $this->formatError($error);\n }\n return $result;\n }\n }", "public function getValidationErrors($field = null) {\n if ($field === null) {\n return $this->validationErrors;\n }\n\n $messages = array();\n\n if (isset($this->validationErrors[$field])) {\n foreach ($this->validationErrors[$field] as $error) {\n $messages[(string) $error] = $error;\n }\n }\n\n return $messages;\n }", "protected function getErrorMessages()\n\t{\n\t\t$validators=$this->getPage()->getValidators($this->getValidationGroup());\n\t\t$messages = array();\n\t\tforeach($validators as $validator)\n\t\t{\n\t\t\tif(!$validator->getIsValid() && ($msg=$validator->getErrorMessage())!=='')\n\t\t\t\t//$messages[] = $validator->getAnchoredMessage($msg);\n\t\t\t\t$messages[] = $msg;\n\t\t}\n\t\treturn $messages;\n\t}", "abstract public function getErrorMessages();", "public function getValidationErrorsForField(string $field) : array\n {\n return $this->validationMessages[$field] ?? [];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "protected function collectErrors(): array\n {\n $errors = [];\n\n $this->collectErrorsChildren($this->form, $errors, $this->form->getName());\n\n foreach ($this->form->getErrors() as $error) {\n $errors[$this->form->getName()][] = $error->getMessage();\n }\n\n return $errors;\n }", "public function toFieldMessageArray()\n {\n return[\n $this->getFieldName() => $this->getViolationMessage()\n ];\n }", "public function getErrorMessages()\n {\n $translator = Mage::helper('importexport');\n $messages = array();\n\n foreach ($this->_errors as $errorCode => $errorRows) {\n if (isset($this->_messageTemplates[$errorCode])) {\n $errorCode = $translator->__($this->_messageTemplates[$errorCode]);\n }\n foreach ($errorRows as $errorRowData) {\n $key = $errorRowData[1] ? sprintf($errorCode, $errorRowData[1]) : $errorCode;\n $messages[$key][] = $errorRowData[0];\n }\n }\n return $messages;\n }", "public function getErrorMessages(): array\n {\n $errors = [];\n\n foreach ($this->getConstraintViolations() as $violation) {\n $errors[] = $violation->errorMessage;\n }\n\n return $errors;\n }", "public function getMessages()\n {\n $errors = $this->getErrors();\n \n if(empty($errors))\n {\n return array(0 => $this->getMessage());\n }\n \n $result = array();\n \n foreach ($errors as $key => $err)\n {\n $innerErrors = $err->getErrors();\n if(empty($innerErrors))\n {\n $result[$key] = $err->getMessage();\n }\n else\n {\n $result[$key] = $err->getMessages();\n }\n }\n return $result;\n }", "public function getError(): array\n {\n return $this->errorMessages;\n }", "public function getMessages()\n {\n $messages = array();\n foreach ($this as $field => $failures) {\n $messages[$field] = $this->getMessagesForField($field);\n }\n return $messages;\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Construct a PersistentObject instance of a given type.
public function create(string $type, int $buildDepth=BuildDepth::SINGLE): PersistentObject;
[ "public function newObject($type, $name = '');", "function page_create_object($type, $id = NULL) {\n global $CFG;\n\n $data = new stdClass;\n $data->pagetype = $type;\n $data->pageid = $id;\n\n $classname = page_map_class($type);\n\n $object = &new $classname;\n // TODO: subclassing check here\n\n if ($object->get_type() !== $type) {\n // Somehow somewhere someone made a mistake\n debugging('Page object\\'s type ('. $object->get_type() .') does not match requested type ('. $type .')');\n }\n\n $object->init_quick($data);\n return $object;\n}", "public function create($type)\n {\n $obj = $this->createProvider($type);\n\n return $obj;\n }", "function &recordObject_instanciate($type) {\r\n\t\t/* Declare */\r\n\t\t$className = $this->recordObject_getClass($type);\r\n\t\t$res = null;\r\n\t\r\n\t\t/* Begin */\r\n\t\t//** if a valid class is found, build object and init it\r\n\t\tif (trim($className)) {\r\n\t\t\t//* Instanciate object\r\n\t\t\t$res = &$this->pp_makeInstance($className);\r\n\t\t\t\r\n\t\t\t//* Force the type proprety value\r\n\t\t\t$res->type = $type;\r\n\t\t}\r\n\r\n\t\treturn $res;\r\n\t}", "public function createObject(Type $type, $value);", "public function createModelByType($type)\n {\n if ($this->map) {\n $class = Arr::get($this->map ?: [], $type, $type);\n return new $class;\n }\n\n return parent::createModelByType($type);\n }", "public function Create()\n\t{\n\t\t$numArgs = func_num_args();\n\t\t$argList = func_get_args();\n\t\n\t\t$objectData = array();\n\t\t\n\t\t$argsIterator = 0; // iterator for the arguments provided by the user\n\t\tforeach($this->typeStructure as $name => $type)\n\t\t{\n\t\t\tif($argsIterator < $numArgs)\n\t\t\t{\n\t\t\t\tself::IsTypeValid($name, $argList[$argsIterator], $this);\n\t\t\t\t$objectData[$name] = $argList[$argsIterator]; // TODO: Check type safety\n\t\t\t}\n\t\t\telse\n\t\t\t\t$objectData[$name] = NULL;\n\t\t\t\t\n\t\t\t++$argsIterator;\n\t\t}\n\n\t\t$result = new ModelObject($this, $objectData);\n\t\t\n\t\t// TODO: Check the persistance type constant, also have one for immediate creation in storage\n\t\t\n\t\treturn $result;\n\t}", "public function newFromType($type)/* todo throws InstantiationException,\r\n IllegalAccessException*/\r\n {\r\n return(new $type($this->chart));\r\n }", "public function build($type)\n {\n $daoname = \"\\\\{$this->registry->pkg}\\\\Model\\\\DAO\\\\{$type}\";\n return new $daoname($this->registry);\n }", "public static function make($type)\n {\n $field = 'Bdt\\Avetmiss\\Fields\\\\' . ucfirst($type);\n\n return new $field;\n }", "function get_metadata_type_object(){\n $class_name = $this->get_metadata_type();\n\n\t\tif( !class_exists( $class_name ) ){\n\t\t\treturn null;\n }\n \n $object_type = new $class_name();\n $object_type->set_options( $this->get_metadata_type_options() );\n \treturn $object_type;\n }", "public function make(string $classType, AutowireableParameterSet $parameters = null) : object;", "public static function create($type, $data = null);", "public function CreateNewObject($Type)\r\n\t\t{\r\n\t\t\t// Create the object\r\n\t\t\t$NewObject = new $Type();\r\n\t\t\t\r\n\t\t\t// Allocate it an ID\r\n\t\t\t$ID = $this->GetNextSeqID();\r\n\t\t\t$NewObject->SetID($ID);\r\n\t\t\t\r\n\t\t\t// Add it to the master list\r\n\t\t\t$this->Objects[$NewObject->ID] = $NewObject;\r\n\t\t\t\r\n\t\t\t// Tell the requester the ID\r\n\t\t\treturn $NewObject->ID;\t\t\t\r\n\t\t}", "public static function hydrate(\\stdClass $type)\n {\n $hydrated = new TypeEntity();\n\n if (isset($type->id)) {\n $hydrated->setId($type->id);\n }\n\n if (isset($type->description)) {\n $hydrated->setDescription($type->description);\n }\n\n return $hydrated;\n }", "public function getObject($type);", "public function createObjectInstance();", "protected function createObject()\n {\n $object = $this->reflection->newInstanceArgs($this->objectArgs);\n if ($this->objectConfig) {\n $object = Yii::configure($object, $this->objectConfig);\n }\n return $object;\n }", "public static function createObjectByType($type, $uuid = null, Connector $connector = null) {\n if (!in_array($type, self::TYPE_TO_CLASS, true)) {\n throw new UQException(\"Unsupported UQ object type '{$type}'\");\n }\n\n $className = self::TYPE_TO_CLASS[$type];\n\n return new $className($uuid, $connector);\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Adds the function body for the save method
protected function addSaveBody(&$script) { $add = false; $columns = $this->getTable()->getColumns(); // created_at, updated_at columns $added_now = false; $set_now = "\n\t\t\$now = new DateTime('now');"; foreach($columns as $column) { if($column->getPhpName() == 'CreatedAt' && $column->getType() == 'TIMESTAMP') { $add = true; if(!$added_now) { $script .= $set_now; $added_now = true; } $script .= "\n\t\tif(!\$this->getCreatedAt()) \$this->setCreatedAt(clone \$now);"; } elseif($column->getPhpName() == 'UpdatedAt' && $column->getType() == 'TIMESTAMP') { $add = true; if(!$added_now) { $script .= $set_now; $added_now = true; } $script .= "\n\t\t\$this->setUpdatedAt(clone \$now);"; } } // pass it on if($add) $script .= "\n"; parent::addSaveBody($script); }
[ "public function afterSave(){}", "public function setSaveBody()\n {\n $data = $this->getPostData();\n\n /* Add payload here */\n $body = [\n\n 'name' => isset($data['name']) ? $data['name'] : '',\n\n ];\n $this->saveBody = $body;\n }", "public function onSave()\r\n\t{\r\n\t\t\r\n\t}", "public function saveToDB()\n {\n }", "public function setSaveBody()\n {\n $data = $this->getPostData();\n\n $body = [\n\n 'code' => isset($data['name']) ? $data['name'] : '',\n 'is_active' => isset($data['is_active']) ? $data['is_active'] : 'Y',\n 'description' => isset($data['description']) ? $data['description'] : '',\n 'creation_date' => date('Y-m-d H:i:s'),\n 'created_by' => \\Session::get('logged_user')['username'],\n 'updated_date' => date('Y-m-d H:i:s'),\n 'updated_by' => \\Session::get('logged_user')['username']\n\n ];\n // echo \"<pre>\",print_r($body);die();\n $this->saveBody = $body;\n }", "public function saveData();", "public function save() {\n\t\tcall_user_func( $this->onsave, $this );\n\t}", "protected function _writeFileBody() {}", "protected abstract function doSave();", "public function saveDB()\n {\n }", "public function getSaveMethod() {}", "public function saveTransaction()\n {\n }", "public function afterSave()\n\t{\n\t}", "public function saveAll(): void;", "protected function _postSave()\n {}", "public function saveEntity();", "function save_review(){\n\n }", "protected function afterSave() {}", "public function save() {\n parent::save();\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Decrypt the product download key
public function DecryptDownloadKey($Data) { $data = base64_decode($Data); return $data; }
[ "function decrypt_contents($data,$prkey){}", "public function decrypt();", "protected function _decrypt() {}", "public function decrypt($data, Key $key);", "public function decrypt($data);", "public function decrypt() \r\n {\r\n //TODO: Implement decrypt method\r\n }", "function finddocumentDecryptionKey($guid, $docid, $node) //wld 11/22/05 - get document id given a guid\n\t\t{\n\t\t\t$select=\"SELECT encrypted_key FROM document_location WHERE (document_id = '$docid') and (node_node_id ='$node')\";\n\t\t\t$result = $this->dbexec($select,\"No row in table document_location for $guid, $node)\" );\n\n\t\t\t$dobj = mysql_fetch_object($result);\n\t\t\t\n\t\t\tif (dnobj===FALSE) return \"\";\n\t\t\treturn $dobj->encrypted_key;\n\t\t}", "function decryptKey($key,$pass)\n {\n // dummy implementation\n return $key;\n }", "function km200_Decrypt( $decryptData ) \n{ \n $decrypt = openssl_decrypt( \n base64_decode( $decryptData ),\n \"aes-256-ecb\",\n km200_crypt_key_private,\n OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING\n );\n// var_dump($decryptData);\n\n // remove zero padding \n $decrypt = rtrim( $decrypt, \"\\x00\" ); \n // remove PKCS #7 padding \n $decrypt_len = strlen( $decrypt ); \n $decrypt_padchar = ord( $decrypt[ $decrypt_len - 1 ] ); \n for ( $i = 0; $i < $decrypt_padchar ; $i++ ) \n { \n if ( $decrypt_padchar != ord( $decrypt[$decrypt_len - $i - 1] ) ) \n break; \n } \n if ( $i != $decrypt_padchar ) \n return $decrypt; \n else \n return substr( \n $decrypt, \n 0, \n $decrypt_len - $decrypt_padchar \n ); \n}", "public function decrypt($text, $key=null){ }", "function openssl_private_decrypt ($data, &$decrypted, $key, $padding = null) {}", "public function getDecryptionKey($key = null)\n {\n if ($key !== null) {\n return $this->openSslDecrypt($this->decryption_key, $key);\n }\n\n return $this->decryption_key;\n }", "public function finalizeDecryption();", "abstract public function decrypt($data);", "protected function load_decrypt()\n {\n // Load\n $license = get_option( $this->main->config->get( 'license_api.option_name' ), 0 );\n // Decrypt\n if ( is_string( $license ) )\n return Encryption::decode(\n $license,\n $this->main->config->get( 'license_api.store_code' )\n );\n return $license;\n }", "public static function aes256Decrypt($key, $data) {}", "public function decryptionCipher()\n {\n return $this->decryptionCipher;\n }", "static function decrypt($key, $data) {\n \tif (strlen($key) < AESCipher::$CIPHER_KEY_LEN) {\n $key = str_pad(\"$key\", AESCipher::$CIPHER_KEY_LEN, \"0\"); //0 pad to len 16\n } else if (strlen($key) > AESCipher::$CIPHER_KEY_LEN) {\n $key = substr($key, 0, AESCipher::$CIPHER_KEY_LEN); //truncate to 16 bytes\n }\n\n $parts = explode(':', $data); //Separate Encrypted data from iv.\n $decryptedData = openssl_decrypt(base64_decode($parts[0]), AESCipher::$OPENSSL_CIPHER_NAME, $key, OPENSSL_RAW_DATA, base64_decode($parts[1]));\n\n return $decryptedData;\n }", "function decrypt($ciphertext)\r\n {\r\n // we pad with chr(0) since that's what mcrypt_generic does. to quote from http://php.net/function.mcrypt-generic :\r\n // \"The data is padded with \"\\0\" to make sure the length of the data is n * blocksize.\"\r\n $ciphertext = str_pad($ciphertext, (strlen($ciphertext) + 7) & 0xFFFFFFF8, chr(0));\r\n\r\n if ( CRYPT_DES_MODE == CRYPT_DES_MODE_MCRYPT ) {\r\n $td = mcrypt_module_open(MCRYPT_DES, $this->mcrypt[0], $this->mode, $this->mcrypt[1]);\r\n mcrypt_generic_init($td, $this->keys, $this->decryptIV);\r\n\r\n $plaintext = mdecrypt_generic($td, $ciphertext);\r\n\r\n mcrypt_generic_deinit($td);\r\n mcrypt_module_close($td);\r\n\r\n if ($this->continuousBuffer) {\r\n $this->decryptIV = substr($ciphertext, -8);\r\n }\r\n\r\n return $this->_unpad($plaintext);\r\n }\r\n\r\n if (!is_array($this->keys)) {\r\n $this->keys = $this->_prepareKey(\"\\0\\0\\0\\0\\0\\0\\0\\0\");\r\n }\r\n\r\n $plaintext = '';\r\n switch ($this->mode) {\r\n case CRYPT_DES_MODE_ECB:\r\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\r\n $plaintext.= $this->_processBlock(substr($ciphertext, $i, 8), CRYPT_DES_DECRYPT);\r\n }\r\n break;\r\n case CRYPT_DES_MODE_CBC:\r\n $xor = $this->decryptIV;\r\n for ($i = 0; $i < strlen($ciphertext); $i+=8) {\r\n $block = substr($ciphertext, $i, 8);\r\n $plaintext.= $this->_processBlock($block, CRYPT_DES_DECRYPT) ^ $xor;\r\n $xor = $block;\r\n }\r\n if ($this->continuousBuffer) {\r\n $this->decryptIV = $xor;\r\n }\r\n }\r\n\r\n return $this->_unpad($plaintext);\r\n }" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the sql statement to select the shop system product category allocation
public function getProductCategorySelect() { return ' SELECT product_id as productID, category_id as categoryID FROM catalog_category_product ORDER BY position '; }
[ "public function prepareQueryForCategory()\n {\n $sql = new SqlStatement();\n $sql->select(array('p.*'))\n ->from(array('p' => self::RESULTS_TABLE))\n ->innerJoin(array('pp' => 'product'), 'p.product_id = pp.product_id')\n ->innerJoin(array('pd' => 'product_description'), 'p.product_id = pd.product_id')\n ->where('pd.language_id = ?', (int)$this->config->get('config_language_id'))\n ->order($this->sortOrder)\n ->limit($this->productsLimit, $this->productsStart);\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n } \n \n return $sql;\n }", "private function _create_default_category_sql()\r\n\t{\r\n\t\t// \r\n\t\t// Check for the category parameter\r\n\t\t//\r\n\r\n\t\t$category_sql = \"\";\r\n\t\tif ( isset($_GET['c']) AND !is_array($_GET['c']) AND intval($_GET['c']) > 0)\r\n\t\t{\r\n\t\t\t//just one category, so AND has no effect, so just return an empty string\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t\telseif (isset($_GET['c']) AND is_array($_GET['c']))\r\n\t\t{\r\n\t\t\t// Sanitize each of the category ids\r\n\t\t\t$category_ids = array();\r\n\t\t\tforeach ($_GET['c'] as $c_id)\r\n\t\t\t{\r\n\t\t\t\tif (intval($c_id) > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$category_ids[] = intval($c_id);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Check if there are any category ids\r\n\t\t\tif (count($category_ids) > 0)\r\n\t\t\t{\r\n\t\t\t\t$category_ids = implode(\",\", $category_ids);\r\n\t\t\t\r\n\t\t\t\t$category_sql = '(c.id IN ('.$category_ids.') OR c.parent_id IN ('.$category_ids.'))';\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $category_sql;\r\n\t}", "function getCategoriesSQL($category){\n\t\t\n\t $result = $this->findByCategory($category);\n \t$parentId = $result['Category']['parent_id'];\n \t$id = $result['Category']['id'];\n \t\n\t\t\t//super-categories have 0 parentid\n\t\t\t//hence, find the list of sub-categories under the super-category\n \tif($parentId == 0){\n \t\n\t\t\t\t//get of list of subcategories that have this super-category as parent\n \t\t$listId = $this->find('all', array('conditions' => array('Category.parent_id'=> $id), 'fields' => 'id'));\n \t\t$categoryIdList = $this->convertListSQL($listId, 'Category', 'id');\n \t\treturn \"Story.category_id IN $categoryIdList\";\n\n \t}\n \telse{\n\t\n\t\t\t\t//sub-categories have a non-zero parentid as there are already the lowest level category\n \t\treturn \"Story.category_id = $id\";\n \t}\n\t\t\n\t}", "protected function getMaxLevelCategoryIdSql()\n {\n $categoryIds = $this->_categoryIds;\n\n $mainTableAlias = 'main_table';\n $mainTable = $this->getMainTable();\n\n $catProdIndexTableAlias = self::CCPI;\n $catProdIndexTable = $this->getCategoryProductIndexTableName();\n\n $catProdTableAlias = self::CCP;\n $catProdTable = $this->getTable('catalog_category_product');\n\n $catTableAlias = $this->getCategoryFlatTable(true);\n $catTable = $this->getCategoryFlatTable();\n\n $sql = \"UPDATE {$mainTable} AS {$mainTableAlias} \";\n $sql .= \"LEFT JOIN {$catProdIndexTable} AS {$catProdIndexTableAlias} ON {$catProdIndexTableAlias}.product_id = {$mainTableAlias}.product_id AND {$catProdIndexTableAlias}.store_id = {$this->getStoreId()} \";\n $sql .= \"LEFT JOIN {$catProdTable} AS {$catProdTableAlias} ON {$catProdTableAlias}.product_id = {$mainTableAlias}.product_id \";\n $sql .= \"INNER JOIN {$catTable} AS {$catTableAlias} ON ({$catTableAlias}.entity_id = {$catProdIndexTableAlias}.category_id OR {$catTableAlias}.entity_id = {$catProdTableAlias}.category_id )AND {$catTableAlias}.level = {$mainTableAlias}.main_category_max_level \";\n $sql .= \"SET {$mainTableAlias}.main_category_id = {$catTableAlias}.entity_id \";\n $sql .= \"WHERE {$mainTableAlias}.profile_id = {$this->_profileId} \";\n $sql .= \"AND ({$catProdIndexTableAlias}.category_id IN ({$categoryIds}) OR {$catProdTableAlias}.category_id IN ({$categoryIds}))\";\n\n return $sql;\n }", "public function get_category_list_store_credit_product_count()\n\t{ \n\t $con = \" and product_duration != '' \";\n\t if(CITY_SETTING){ \n\t $con .= \"and stores.city_id = '$this->city_id'\";\n\t } \n\t \n\t\t$result = $this->db->query(\"select category_url, category.category_id, category_name , product , count(product.deal_id) as product_count from category join product on product.category_id = category.category_id join stores on stores.store_id=product.shop_id where category_status = 1 AND main_category_id = 0 AND product = 1 AND purchase_count < user_limit_quantity AND deal_status = 1 \".$this->club_condition.\" and store_status = 1 $con group by category.category_id order by category_name ASC\"); \n\t\treturn $result;\n\t}", "function get_category_table_for_update() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_category\n\t\t\t\tLEFT JOIN evs_database.evs_identification\n\t\t\t\tON idf_ctg_id = ctg_id\n\t\t\t\tLEFT JOIN dbmc.position\n\t\t\t\tON Position_ID = idf_pos_id\n\t\t\t\tWHERE ctg_id = ?\n\t\t\t\tORDER BY ctg_id ASC,ctg_category_detail_en ASC\";\n $query = $this->db->query($sql, array($this->ctg_id));\n\t\treturn $query;\n\t}", "function productCategory($conn, $cID) {\r\n\r\n\t\t\t\tglobal $wizGradeProductTB;\r\n\r\n\t\t\t\t$productsData = $conn->query(\"SELECT pID, cat_id, p_price, p_title, p_description, p_date, p_status\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM $wizGradeProductTB\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE cat_ID = $cID\")->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\tarray_unshift($productsData,\"\");\r\n\t\t\t\tunset($productsData[0]);\r\n\r\n\t\t\t\treturn $productsData;\r\n\t\t\t\t\r\n\t\t}", "public function createQuery()\n\t{\n\t\treturn $this->pp->createQuery('modules_bookmarks/category');\n\t}", "public function getCpdCategoryList() {\n $this->db->select('\"cc_category_code CC_CATEGORY_CODE, cc_category_code ||\\' - \\'|| cc_category_desc AS \"CC_CODE_DESC\"');\n $this->db->from(\"ims_hris.cpd_category\");\n\n $q = $this->db->get();\n return $q->result();\n }", "private function getCategoriesDB() {\n\t}", "function getProductionCategory() {\n $data = $this->db\n ->order_by('production_category')\n ->get('production_category')\n ->result_array();\n \n return $data;\n }", "public function category_list($catid=''){\r\n\t\t$where=\"\";\r\n\t\tif($catid) $where=\" WHERE syscat_id='{$catid}'\";\r\n\t\t$query = $this->db->query(\"CALL prc_get_SystemCategory(\\\"$where\\\")\");\r\n\t\treturn $query->result();\r\n\t}", "public static function getCategoriesTCAWhereClause(): string\n {\n return self::getDynamicForeignTableWhere(\n 'categoriesRestriction',\n 'sys_category'\n );\n }", "protected function getSelectStatement()\n {\n return \"SELECT BookID, ISBN10, ISBN13, Title, CopyrightYear, TrimSize, PageCountsEditorialEst\n as PageCount, Description, CoverImage, Status, Subcategories.SubcategoryID, SubcategoryName, Imprints.ImprintID, Imprint, BindingType FROM Books\n JOIN Statuses ON (Books.ProductionStatusID = Statuses.StatusID) JOIN Subcategories ON \n (Books.SubcategoryID = Subcategories.SubcategoryID) JOIN Imprints USING (ImprintID) JOIN BindingTypes USING (BindingTypeID)\";\n }", "protected function getCategoryProductTable()\n {\n return $this->_resource->getTableName(\n $this->_categoryProductTable\n );\n }", "public function createCatMappingTable()\n {\n $this->logs->logInfos('Create Hipay categories mapping table');\n\n $sql = 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.HipayDBQueryAbstract::HIPAY_CAT_MAPPING_TABLE.'`(\n `hp_ps_cat_id` INT(10) UNSIGNED NOT NULL,\n `hp_cat_id` INT(10) UNSIGNED NOT NULL,\n `shop_id` INT(10) UNSIGNED NOT NULL,\n PRIMARY KEY (`hp_ps_cat_id`, `shop_id`)\n ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8';\n\n return Db::getInstance()->execute($sql);\n }", "function get_category_all() {\t\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_category\";\n $query = $this->db->query($sql);\n\t\treturn $query;\n\t}", "public function getStatmentSql()\n {\n $sql = 'SELECT '; \n \n\n if (isset($this->params['select']) && $this->params['select'] && is_array($this->params['select'])) {\n $sql .= $this->getSelectSql($this->params['select']);\n } else {\n $sql .= '*';\n }\n \n $sql .= ' FROM ' . $this->tableName;\n \n\n if (isset($this->params['left join']) && $this->params['left join']) {\n $sql .= $this->getLeftJoinSql($this->params['left join']);\n }\n\n if (isset($this->params['where']) && $this->params['where']) {\n $sql .= $this->getWhereConnditionSql($this->params['where']);\n }\n\n if (isset($this->params['group']) && $this->params['group']) {\n $sql .= $this->getGroupBy($this->params['group']);\n }\n\n if (isset($this->params['order']) && $this->params['order']) {\n $sql .= $this->getOrderSql($this->params['order']);\n }\n\n if (isset($this->params['limit']) && $this->params['limit']){\n $sql .= $this->getLimitSql();\n }\n\n if (isset($this->params['offset']) && $this->params['offset']){\n $sql .= $this->getLimitSql();\n }\n\n return $sql;\n }", "function getRedistributionCategory() {\n\t$conn = connectDB();\n\tif ($conn->connect_error) {\n\t\tdie(\"Connection failed: \" . $conn->connect_error);\n\t}\n\n\t// Find the 'redistribution' category\n\t$sql = \"SELECT categoryID\n\t\t\t\t\tFROM category\n\t\t\t\t\tWHERE name ='Redistribution'\";\n\n\t$redistCategory = queryDB($conn, $sql);\n\tcloseDB($conn);\n\n\t// If we didn't get a match, we need to create the 'Redistribution' category\n\tif ( $redistCategory==null || $redistCategory->num_rows <= 0 ) {\n\t\treturn createRedistributionCategory();\n\t}\n\t// If we found a match, close the database and return the category ID\n\telse {\n\t\t$getID = sqlFetch($redistCategory);\n\t\treturn $getID['categoryID'];\n\t}\n}" ]
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }