query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Set a new Codec instance. | public function setCodec(Codec $codec); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setVideoCodec($val)\n {\n $this->_propDict[\"videoCodec\"] = $val;\n return $this;\n }",
"public function setAudioCodec($val)\n {\n $this->_propDict[\"audioCodec\"] = $val;\n return $this;\n }",
"public function copy(): static\n {\n $this->isCustomCodec = false;\n\n return $this;\n }",
"public function getCodec();",
"public function getCodec();",
"public function setVideoCodec(Codec $codec)\n\t{\n\t\tif ($this->getAvailableVideoCodecs() && ! in_array($codec, $this->getAvailableVideoCodecs(), false))\n\t\t{\n\t\t\tthrow new \\InvalidArgumentException(sprintf('Wrong video codec value for \"%s\", available values are %s',\n\t\t\t\t$codec, implode(', ', $this->getAvailableVideoCodecs())));\n\t\t}\n\t\t\n\t\t$this->videoCodec = $codec;\n\t\t\n\t\treturn $this;\n\t}",
"public function setDecoder( $decoder){\r\n $this->decoder=$decoder;\r\n }",
"public function setEncoder(Swift_Mime_ContentEncoder $encoder)\n {\n if ($encoder !== $this->encoder) {\n $this->clearCache();\n }\n\n $this->encoder = $encoder;\n $this->setEncoding($encoder->getName());\n $this->notifyEncoderChanged($encoder);\n\n return $this;\n }",
"public function type(CodecConfigType $type)\n {\n $this->type = $type;\n\n return $this;\n }",
"public function getVideoCodec() {}",
"public function __construct ($version, $encoding) {}",
"function setCharset($value)\n {\n $this->setAttribute(\"charset\", $value);\n return $this;\n }",
"public function setEncodingFilter(InterfaceEncodingFilter $value)\n {\n $this->encodingFilter = $value;\n\n // initialize the encoder.\n $this->encodingFilter->init($this);\n return $this;\n }",
"public function addEncoder($pattern, Diggin_Http_Response_Charset_Encoder_EncoderInterface $encoder)\n {\n $this->_encoderSet[$pattern] = $encoder;\n\n return $this;\n }",
"public function setEncoding(Encode $encode)\n {\n $this->encode = $encode;\n }",
"public function encoder($encoder = null)\n\t{\n\t\treturn $this->getSet(\"encoder\", $encoder);\n\t}",
"public function encoding(?string $encoding): self\n {\n $new = clone $this;\n $new->encoding = $encoding;\n\n return $new;\n }",
"public function setCode(array $code = []): object\n\t{\n\t\tif ([] !== $this->code) {\n\t\t\t$this->_trackValuesRemoved(count($this->code));\n\t\t\t$this->code = [];\n\t\t}\n\t\tif ([] === $code) {\n\t\t\treturn $this;\n\t\t}\n\t\tforeach ($code as $v) {\n\t\t\tif ($v instanceof FHIRCoding) {\n\t\t\t\t$this->addCode($v);\n\t\t\t} else {\n\t\t\t\t$this->addCode(new FHIRCoding($v));\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}",
"public function setEncoding($spec)\n {\n $this->_encoding = $spec;\n return $this;\n }",
"public function getEncoder()\n {\n if ($encoder = $this->getCodecMatcher()->getEncoder()) {\n return $encoder;\n }\n\n $this->getCodecMatcher()->setEncoder($encoder = $this->encoder());\n\n return $encoder;\n }",
"function __construct($enc)\n {\n $regExp = '/^(.*)(?:&|^)JsHttpRequest=(?:(\\d+)-)?([^&]+)((?:&|$).*)$/s';\n if (preg_match($regExp, @$_SERVER['QUERY_STRING'], $m)) {\n $this->ID = $m[2];\n $this->LOADER = strtolower($m[3]);\n } else {\n $this->ID = 0;\n $this->LOADER = 'unknown';\n }\n if (function_exists('mb_convert_encoding')) {\n $this->_unicodeConvMethod = 'mb';\n } else if (function_exists('iconv')) {\n $this->_unicodeConvMethod = 'iconv';\n } else {\n $this->_unicodeConvMethod = null;\n }\n $this->setEncoding($enc);\n }",
"public function setEncoding(string $encoding): self\n {\n $this->options->ENCODING = $encoding;\n\n return $this;\n }",
"public function new_codec(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|unique:codecs',\n 'ffmpeg_codec' => 'required',\n 'media_type' => 'required',\n 'extension' => 'required'\n ]);\n\n if ($validator->fails()) {\n return back()\n ->withInput()\n ->withErrors($validator);\n }\n\n\n $codec = new Codecs();\n $codec->name = $request->name;\n $codec->ffmpeg_codec = $request->ffmpeg_codec;\n $codec->media_type = $request->media_type;\n $codec->extension = $request->extension;\n $codec->convert = $request->convert;\n //$codec->active = true;\n $codec->save();\n\n return redirect('/admin/codecs')->withInput()->withErrors('codec ' . $codec->name . ' is created', 'success');\n }",
"public static function fromEncoder(Encoder $encoder): self\n {\n return new self($encoder->getMimeType(), $encoder->encode());\n }",
"public function get_codec($id = null)\n {\n try {\n $codec = Codecs::findOrFail($id);\n $title = 'Change Codec';\n $new = false;\n } catch (ModelNotFoundException $e) {\n $codec = new Codecs();\n $title = 'New Codec';\n $new = true;\n }\n\n return View::make('backend.codecs.codec', ['url' => $this->url, 'codec' => $codec, 'title' => $title, 'new' => $new]);\n }",
"public function getVideoCodec()\n\t{\n\t\treturn $this->videoCodec;\n\t}",
"public function decoder($decoder = null)\n\t{\n\t\treturn $this->getSet(\"decoder\", $decoder);\n\t}",
"public function setEncoding($encoding)\n {\n $this->_encoding = $encoding;\n Zend_XmlRpc_Value::setEncoding($encoding);\n return $this;\n }",
"public function filterByCodec($codec = null, $comparison = null)\n {\n if (is_array($codec)) {\n $useMinMax = false;\n if (isset($codec['min'])) {\n $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($codec['max'])) {\n $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec, $comparison);\n }",
"public function setUniDecoder(UniDecoder $decoder)\n {\n $this->uniDecoder = $decoder;\n }"
]
| [
"0.6764379",
"0.621892",
"0.5887907",
"0.5812258",
"0.5812258",
"0.5789779",
"0.5463182",
"0.54379034",
"0.5437253",
"0.50663173",
"0.49901783",
"0.49063995",
"0.48797125",
"0.48438305",
"0.4828979",
"0.48145452",
"0.48068815",
"0.48045623",
"0.47773555",
"0.47528595",
"0.4720386",
"0.4711151",
"0.4697975",
"0.4693715",
"0.4672871",
"0.46647686",
"0.46581948",
"0.46520305",
"0.46499392",
"0.46487904"
]
| 0.7557051 | 0 |
Determine whether the user can update the vip. | public function update(User $user)
{
return in_array('update', $user->permissibles('vip'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }",
"function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}",
"protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }",
"public function isUpdateSecurityRelevant() {}",
"public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }",
"public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }",
"function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}",
"static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }",
"public function authorize()\n {\n return $this->user()->can('update_users');\n }",
"function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}",
"public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }",
"public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }",
"function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}",
"function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}",
"public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }",
"public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }",
"public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }",
"protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }",
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}",
"public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }",
"public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }",
"public function update(User $user)\n {\n if ($user->can('update plans')) {\n return true;\n }\n }",
"public function update(User $user)\n {\n return $user->hasAccess(['update-zones']);\n }",
"public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }",
"private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}",
"protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }",
"public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }",
"public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}",
"public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }"
]
| [
"0.72160465",
"0.7025353",
"0.6918185",
"0.68928015",
"0.6877601",
"0.68297684",
"0.6785628",
"0.6779692",
"0.6771634",
"0.6750269",
"0.67261654",
"0.67211497",
"0.6712063",
"0.6712063",
"0.66922325",
"0.66878825",
"0.66600496",
"0.6655419",
"0.6600401",
"0.65161073",
"0.6495615",
"0.64541173",
"0.64294505",
"0.6420162",
"0.64149725",
"0.63783795",
"0.6366829",
"0.63595325",
"0.6351174",
"0.63389885"
]
| 0.7579372 | 0 |
QTOS = Quality Time on Site | public function getQtos(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function eQTimeElapsed() {\n\t\tif ($GLOBALS['qTimeTotal']) {\n\t\t\treturn number_format($GLOBALS['qTimeTotal']*1000000.0,1);\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}",
"public static function REALTIME()\n {\n return new Vp9Quality(self::REALTIME);\n }",
"function getQueryTime($time_start,$time_end) {\n\t\treturn round($time_end - $time_start,4).'sec';\n\t}",
"function timequery() {\n static $querytime_begin;\n list($usec, $sec) = explode(' ', microtime());\n\n if (!isset($querytime_begin)) {\n $querytime_begin = ((float) $usec + (float) $sec);\n } else {\n $querytime = (((float) $usec + (float) $sec)) - $querytime_begin;\n echo sprintf('<br />La consulta tardó %01.5f segundos.- <br />', $querytime);\n }\n}",
"static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }",
"public function getUseTime() \n \t{\n \t\treturn $this->use_time;\n \t}",
"public function getTimeInQueue($time){\n\t$desvioPadrao = 0.5;\n\t$tempoDePico = 12.5;\n\t$desvioPadrao = 0.5;\n\t$expoente = pow(($time - $tempoDePico), 2);\n\t$expoente /= $desvioPadrao;\n\t$tempoMaximoNaFila = 40;\n\t$tempoNaFila = $tempoMaximoNaFila*pow(M_E, -$expoente);\n\t\treturn $tempoNaFila;\n\t}",
"public function getTimePerQuestion()\n {\n return $this->timePerQuestion;\n }",
"public function getQ()\n {\n return $this->q;\n }",
"public function getAnswerTime();",
"private function calculateTime()\n {\n $slowest = 1000000;\n for($i=1; $i<=12; $i++){\n if($_GET['Tr'.$i] > 0 && $slowest > $this->troopCostsProperties['Tr'.$i][5] ){\n $slowest = $this->troopCostsProperties['Tr'.$i][5];\n }\n }\n $time = $this->distance/($slowest*SERVER_SPEED_RATE);\n return $time;\n }",
"function trader_stochrsi($real, $timePeriod = NULL, $fastK_Period = NULL, $fastD_Period = NULL, $fastD_MAType = NULL)\n{\n}",
"private function getQueryStringDate() {\n\t\tif($this->date) {\n\t\t\treturn $this->date . '['.$this->qType.']';\n\t\t}\n\t\t$startDate = (new DateTime('-14 days'))->format('Ymd');\n\t\t$endDate = (new DateTime('tomorrow'))->format('Ymd');\n\t\t$qDate = '`'.$this->qType.' > '.$startDate.' < '.$endDate;\n\t\treturn $qDate;\n\t}",
"public function getSpeakTime()\n {\n return $this->get(self::_SPEAK_TIME);\n }",
"public function qtype() \n {\n return 'scripted';\n }",
"private function tick() {\r\n\t\treturn ceil( time() / 43200 );\r\n\t}",
"public function getQntd()\n {\n return $this->qntd;\n }",
"function convertToQt ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.00520833;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.015625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 0.03125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 0.25;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 0.5;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 4;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}",
"function ajan_core_print_generation_time() {\n?>\n\n<!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q) -->\n\n\t<?php\n}",
"public function getQueryTime()\n {\n return $this->query_time;\n }",
"function time() {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canViewRelatedItems($this->logged_user)) {\n $this->wireframe->print->enable();\n \n $this->response->assign(array(\n 'time_records' => $this->active_invoice->getTimeRecords(),\n 'expenses' => $this->active_invoice->getExpenses(),\n 'items_can_be_released' => $this->active_invoice->isDraft() || $this->active_invoice->isCanceled()\n ));\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }",
"public function displayTimeQuestion()\n {\n\n }",
"public function pausetimeAction()\n {\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvtime_obj = new Ep_Ftv_FtvPauseTime();\n if($user_params['type'] == 'pause')\n {\n ////for goroup Id in users table////\n $ftvtime_obj->ftvrequest_id=$user_params['requestId'];\n $ftvtime_obj->pause_at=date('Y-m-d H:i:s') ;\n $ftvtime_obj->resume_at=null;\n $ftvtime_obj->insert();\n }\n else\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id= '\".$user_params['requestId'].\"' AND resume_at is null\";\n $ftvtime_obj->updateFtvPauseTime($data,$query);\n }\n }",
"public function getQSelo()\n {\n return $this->qSelo;\n }",
"public function getQtde()\n {\n return $this->qtde;\n }",
"function getTimeProccess(){\n\t\treturn round($this->timeProccess,5);\n\t}",
"function when($parameters) { // $parameters = ['timestamp'], ['numberOfUnits']\n\t$currentTime = time();\n\t\n\tif (preg_match ( '/\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{1,2}:\\d{1,2}/u', $parameters['timestamp'] )) // /d -> 0-9, nt 1978-2-3 5:8:9, u on seotud UTF-8 ga\n\t{\n\t\t$time = strtotime( $parameters['timestamp'] ); //konventeerib sekunditeks\n\t}\n\telse {\n\t\t$time = $parameters['timestamp'];\n\t}\n\n\tif($currentTime > $time){\n\t\t$difference = $currentTime - $time;\n\t} else {\n\t\t$difference = $time - $currentTime;\n\t}\n\n\t$units = array (\n\t\t\t'second',\n\t\t\t'minute',\n\t\t\t'hour',\n\t\t\t'day',\n\t\t\t'week',\n\t\t\t'month',\n\t\t\t'year',\n\t\t\t'decade'\n\t);\n\t\n\t$secondsInSecond = 1;\n\t$secondsInMinute = 60;\n\t$secondsInHour = $secondsInMinute*60;\n\t$secondsInDay = $secondsInHour*24;\n\t$secondsInWeek = $secondsInDay*7;\n\t$secondsInMonth = $secondsInWeek*(4+1/3);\n\t$secondsInYear = $secondsInMonth*12;\n\t$secondsInDecade = $secondsInYear*10;\n\t\n\t$sizes = array (\t\t\t\t//$sizes = array (\n\t\t\t$secondsInSecond, \t\t//1, //sekund\n\t\t\t$secondsInMinute, \t\t//60, //minut\n\t\t\t$secondsInHour, \t\t// 60*60, //tund\n\t\t\t$secondsInDay,\t\t\t//60*60*24, //päev\n\t\t\t$secondsInWeek, \t\t//60*60*24*7, //nädal\n\t\t\t$secondsInMonth,\t\t//60*60*24*7*(4+1/3), //kuu\n\t\t\t$secondsInYear, \t\t//60*60*24*7*(4+1/3)*12, //aasta\n\t\t\t$secondsInDecade \t\t//60*60*24*7*(4+1/3)*12*10 //kümmend\n\t);\n\n\tfor($positionInUnits = sizeof ( $sizes ) - 1; ($positionInUnits >= 0) && \n\t\t(($amountOfTime = $difference / $sizes [$positionInUnits]) <= 1); $positionInUnits --); \n\t\tif ($positionInUnits < 0)\n\t\t\t$positionInUnits = 0;\n\t\t$remainedTime = $currentTime - ($difference % $sizes [$positionInUnits]);\n\t\t$amountOfTime = floor ( $amountOfTime );\n\t\tif ($amountOfTime != 1) \n\t\t\t$units [$positionInUnits] .= 's';\n\t\t$when = sprintf ( \"%d %s \", $amountOfTime, $units [$positionInUnits] );\n\t\tif (($parameters['numberOfUnits'] == 0) && ($positionInUnits >= 1) && (($currentTime - $remainedTime) > 0))\n\t\t$when .= when ( $remainedTime);\n\t\treturn $when;\n}",
"function qualificationServ(): string\n{\n $FtPqr = getFtPqr();\n $FtPqrCalificacion = $FtPqr->getLastCalificacion();\n\n return $FtPqrCalificacion ? $FtPqrCalificacion->getFieldValue('experiencia_servicio') : '-';\n}",
"public function getTermsAndCondition() {\n\t\treturn $this->_getResponse(self::URL_TOS);\n\t}",
"public function time()\n {\n return $this->_requestTime;\n }"
]
| [
"0.57182527",
"0.5611911",
"0.5415562",
"0.53776145",
"0.5280558",
"0.52314895",
"0.51861566",
"0.5180928",
"0.5177119",
"0.51687944",
"0.5162115",
"0.5146016",
"0.51277494",
"0.51193535",
"0.5104396",
"0.509741",
"0.50942254",
"0.509344",
"0.5090969",
"0.50785714",
"0.5069718",
"0.5061073",
"0.50598544",
"0.50594866",
"0.5054239",
"0.50514716",
"0.50497377",
"0.5046487",
"0.5005235",
"0.49869984"
]
| 0.725313 | 0 |
Deletes multiple attachments on a given beacon. This operation is permanent and cannot be undone. You can optionally specify `namespacedType` to choose which attachments should be deleted. If you do not specify `namespacedType`, all your attachments on the given beacon will be deleted. You also may explicitly specify `` to delete all. Authenticate using an [OAuth access token]( from a signedin user with Is owner or Can edit permissions in the Google Developers Console project. (attachments.batchDelete) | public function batchDelete($beaconName, $optParams = array())
{
$params = array('beaconName' => $beaconName);
$params = array_merge($params, $optParams);
return $this->call('batchDelete', array($params), "Google_Service_Proximitybeacon_DeleteAttachmentsResponse");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function entityDeleteMultiple($fids) {\n $files = file_load_multiple($fids);\n foreach ($files as $file) {\n file_delete($file);\n }\n }",
"protected function entityDeleteMultiple($ids) {\n farm_asset_delete_multiple($ids);\n }",
"public function massDelete(Request $request)\n\t{\n\t\t$ids = $request->input('ids', []);\n\t\t\n\t\tif(is_array($ids) && !empty($ids))\n\t\t{\n\t\t\tforeach(Mail::whereIn('id', $ids)->get() as $mail)\n\t\t\t{\n\t\t\t\t$mail->delete();\n\t\t\t}\n\t\t}\n\t\t\n\t\t$result = [\n\t\t\t'success' => 1,\n\t\t];\n\t\t\n\t\treturn $result;\n\t}",
"public function delete_attachments($contextid = 1) {\n $fs = get_file_storage();\n $fs->delete_area_files($contextid, 'mod_documents', 'attachment', $this->id);\n $fs->delete_area_files($contextid, 'mod_documents', 'picture', $this->id);\n\n }",
"public function deleteByFileIds()\n\t{\n\t\tif ( isset( \\IPS\\Request::i()->fileIds ) )\n\t\t{\n\t\t\t$ids = \\IPS\\Request::i()->fileIds;\n\t\t\t\n\t\t\tif ( ! \\is_array( $ids ) )\n\t\t\t{\n\t\t\t\t$try = json_decode( $ids, TRUE );\n\t\t\t\t\n\t\t\t\tif ( ! \\is_array( $try ) )\n\t\t\t\t{\n\t\t\t\t\t$ids = array( $ids );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ids = $try;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( \\count( $ids ) )\n\t\t\t{\n\t\t\t\t\\IPS\\cms\\Media::deleteByFileIds( $ids );\n\t\t\t}\n\t\t}\n\t}",
"protected function entityDeleteMultiple($ids) {\n waywire_video_delete_multiple($ids);\n }",
"public function bulkDelete(Request $request)\n {\n return $this->model->bulkDelete($request->ids);\n }",
"public function actionBatchDelete() {\n if (($ids = Yii::$app->request->post('ids')) !== null) {\n $models = $this->findModelAll($ids);\n foreach ($models as $model) {\n $model->delete();\n }\n return $this->redirect(['index']);\n } else {\n throw new HttpException(400);\n }\n }",
"static public function deleteMultiple($ids) {\n return entity_delete_multiple('nuntius_room', $ids);\n }",
"public function multiDelete()\n {\n if(is_array(request()->item)){\n foreach (request()->item as $id) {\n $tradmark = Tradmark::findOrfail($id);\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n }else{\n $tradmark = Tradmark::findOrfail(request('item'));\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n session()->flash('success', trans('admin.deleted_successfully'));\n return redirect(route('admin.tradmarks.index'));\n }",
"public function deleteImages()\n {\n if ($images = $this->getImages()->all()) {\n foreach ($images as $image) {\n /* @var $image AdImages */\n $image->delete();\n }\n }\n }",
"public function deleteMultipleActivitiesInBulk(\n $ids\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activities';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'ids' => $ids,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::delete($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }",
"public function executeBatchDelete(sfWebRequest $request)\n {\n $q = Doctrine::getTable('Group')->createQuery('g')\n ->andWhereIn('g.id', $request->getParameter('ids'))\n ;\n $ids = array();\n foreach ( $q->execute() as $group )\n $ids[] = $group->id;\n $request->setParameter('ids', $ids);\n \n parent::executeBatchDelete($request);\n }",
"public function batchDeleteAction(Request $request)\n {\n $this->checkCreateBroadcastDisabled();\n\n $ids = $this->getRequest()->get('ids');\n\n if ('string' === gettype($ids)) {\n $ids = json_decode($ids, true);\n }\n\n $factory = $this->get('pumukitschema.factory');\n foreach ($ids as $id) {\n $broadcast = $this->find($id);\n if (0 !== $broadcast->getNumberMultimediaObjects()) {\n continue;\n }\n\n try {\n $factory->deleteResource($broadcast);\n } catch (\\Exception $e) {\n return new Response($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n if ($id === $this->get('session')->get('admin/broadcast/id')) {\n $this->get('session')->remove('admin/broadcast/id');\n }\n }\n\n return $this->redirect($this->generateUrl('pumukitnewadmin_broadcast_list'));\n }",
"function messageDeleteBulk(Collection $messages);",
"public function delete(array $ids);",
"public static function batch_delete($object_array)\n\t{\n \t\tS3Persister::init();\n $client = S3Client::factory(array(\n 'key' => S3Persister::$AWS_KEY,\n 'secret' => S3Persister::$AWS_SECRET_KEY,\n 'region' => S3Persister::REGION));\n $bucket = S3Persister::$BUCKET_NAME;\n\n\t\t$delete_objects = array();\n\t\tforeach($object_array as $object)\n\t\t{\n \t//$object_path = \"{$bucket}/{$object}\";\n\t\t\tarray_push($delete_objects,array(\"Key\" => $object));\t\n\t\t}\n\t\t\n $request = $client->deleteObjects(array('Bucket' => \"$bucket\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Objects'=> $delete_objects));\n\n return TRUE;\t\t\n\t}",
"public function deleteMultipleActivityTypesInBulk(\n $ids\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activityTypes';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'ids' => $ids,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::delete($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }",
"public function do_batch() {\n\t\t$post_ids = array_map( 'intval', $this->get_post_ids() );\n\t\tforeach( $post_ids as $post_to_delete ) {\n\t\t\tadd_filter( Toolset_Association_Cleanup_Post::IS_DELETING_FILTER, '__return_true' );\n\t\t\twp_delete_post( $post_to_delete, true );\n\t\t\tremove_filter( Toolset_Association_Cleanup_Post::IS_DELETING_FILTER, '__return_true' );\n\t\t}\n\n\t\t$this->deleted_posts = count( $post_ids );\n\t}",
"static public function deleteMulti($subject, $keys) {\n\t\tforeach($keys as $oneKey)\n\t\t\tself::delete($subject, $oneKey);\n\t}",
"public function deleteItemBatch($keys)\n {\n $this->batchRequests = [];\n $response = [];\n\n foreach (array_chunk($keys, $this->batchWriteChunkSize) as $keyChunk) {\n $this->batchRequests[] = Write::make()\n ->addMany(\n $this->from,\n array_map(function ($key) {\n return DeleteRequest::make($key);\n }, $keyChunk)\n );\n }\n\n $queries = $this->grammar->compileBatchWriteItem($this);\n\n foreach ($queries as $query) {\n $response[] = $this->connection->getClient()->batchWriteItem($query);\n }\n\n return $this->processor->processBatchWriteItems($response);\n }",
"public function actionBulkDelete() {\n\n if (Yii::$app->request->post('selection')) {\n $where = ['id' => Yii::$app->request->post('selection', []), 'sender_id' => Yii::$app->user->identity->id, 'status_del' => $this->modelClass::STATUS_DEL_TRASH];\n $this->modelClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_DELETE, 'deleted_at' => time()], $where);\n\n $whereVia = ['mailbox_id' => Yii::$app->request->post('selection', []), 'receiver_id' => Yii::$app->user->identity->id, 'status_del' => $this->modelClass::STATUS_DEL_TRASH];\n $this->modelViaClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_DELETE, 'deleted_at' => time()], $whereVia);\n }\n }",
"public function deleteAll($dataItemType, $dataItemID, $criteria = '')\r\n {\r\n /* Get all attachment IDs for the Data Item. */\r\n $sql = sprintf(\r\n \"SELECT\r\n attachment_id AS attachmentID,\r\n directory_name AS directoryName\r\n FROM\r\n attachment\r\n WHERE\r\n data_item_id = %s\r\n AND\r\n data_item_type = %s\r\n AND\r\n site_id = %s\r\n %s\",\r\n $this->_db->makeQueryInteger($dataItemID),\r\n $this->_db->makeQueryInteger($dataItemType),\r\n $this->_siteID,\r\n $criteria\r\n );\r\n $rs = $this->_db->getAllAssoc($sql);\r\n\r\n /* Return if we have no attachments. */\r\n if (empty($rs))\r\n {\r\n return;\r\n }\r\n\r\n foreach ($rs as $rowNumber => $row)\r\n {\r\n /* Sanity check. Don't delete the whole attachments directory. */\r\n $directoryName = trim($row['directoryName']);\r\n if (empty($directoryName) || $directoryName = '.')\r\n {\r\n continue;\r\n }\r\n\r\n $directory = 'attachments/' . $directoryName;\r\n\r\n if (is_dir($directory))\r\n {\r\n FileUtility::recursivelyRemoveDirectory($directory);\r\n }\r\n }\r\n\r\n /* Delete the attachments metadata. */\r\n $sql = sprintf(\r\n \"DELETE FROM\r\n attachment\r\n WHERE\r\n data_item_id = %s\r\n AND\r\n data_item_type = %s\r\n AND\r\n site_id = %s\r\n %s\",\r\n $this->_db->makeQueryInteger($dataItemID),\r\n $this->_db->makeQueryInteger($dataItemType),\r\n $this->_siteID,\r\n $criteria\r\n );\r\n $this->_db->query($sql);\r\n }",
"public function delete($attachment_id) {\r\n\t\t\r\n\t\tif(is_array($attachment_id)) {\r\n\t\t\r\n\t\t\twhile(list($ind, $val) = each($attachment_id)) {\r\n\t\t\t\t\r\n\t\t\t\t$query = \"DELETE FROM $this->att WHERE attachment_id = $val\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$Affected = $this->execute($query);\r\n\t\t\t\t\r\n\t\t\t\tif (PEAR::isError($Affected)) {\r\n\t\t\t\t\tdie($Affected->getMessage());\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t$query = \"DELETE FROM $this->att WHERE attachment_id = $attachment_id\";\r\n\t\t\t\r\n\t\t\t$Affected = $this->execute($query);\r\n\t\t\t\t\r\n\t\t\t\tif (PEAR::isError($Affected)) {\r\n\t\t\t\t\tdie($Affected->getMessage());\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t}",
"public function massDestroy(Request $request)\n {\n if (! Gate::allows('jobtype_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Jobtype::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }",
"public function batch_delete($data)\n {\n $required = array(\n 'ids' => 'IDs not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n foreach ($data['ids'] as $id) {\n $this->delete(array('id' => $id));\n }\n\n return true;\n }",
"function mongo_node_mass_delete($entity_type, $entities) {\n entity_delete_multiple($entity_type, $entities);\n}",
"public function multipleDelete(Request $request)\n {\n $user = \\Auth::user();\n $permission = new Permission();\n if ($user->can('delete', $permission)) {\n try {\n $data_ids = $_REQUEST['data_ids'];\n $data_id_array = explode(\",\", $data_ids);\n \n if ($this->permission->delete($data_id_array)) {\n return \"successfully deleted\";\n } else {\n return \"Permission cannot be deleted.\";\n }\n } catch (Exception $e) {\n return $e;\n }\n } else {\n return view('errors.401');\n }\n }",
"public function massDestroy(Request $request)\n {\n if (! Gate::allows('document_delete')) {\n return abort(401);\n }\n\n if ($request->input('ids')) {\n $entries = Document::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }",
"public function bulk_delete(Request $request){\n $this->isAuthorize();\n\n // Delete the Data\n $userID = $this->request->session()->get('userID');\n $ids = $request->ids;\n DB::table(\"apt_time_slots\")->where('userID','=',$userID)->whereIn('id',explode(\",\",$ids))->delete();\n return response()->json(['success'=>\"Deleted successfully.\"]);\n }"
]
| [
"0.6238352",
"0.6026112",
"0.59627557",
"0.5920845",
"0.5877035",
"0.5796132",
"0.57709795",
"0.5654801",
"0.5618383",
"0.55749494",
"0.5558357",
"0.55516684",
"0.5533098",
"0.5526734",
"0.55125",
"0.5509071",
"0.54763347",
"0.5447636",
"0.5444962",
"0.5437601",
"0.5416639",
"0.5399298",
"0.5398604",
"0.53733855",
"0.53314054",
"0.53232163",
"0.5310142",
"0.53059554",
"0.53018105",
"0.5294"
]
| 0.75982326 | 0 |
Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone. Authenticate using an [OAuth access token]( from a signedin user with Is owner or Can edit permissions in the Google Developers Console project. (attachments.delete) | public function delete($attachmentName, $optParams = array())
{
$params = array('attachmentName' => $attachmentName);
$params = array_merge($params, $optParams);
return $this->call('delete', array($params), "Google_Service_Proximitybeacon_ProximitybeaconEmpty");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function batchDelete($beaconName, $optParams = array())\n {\n $params = array('beaconName' => $beaconName);\n $params = array_merge($params, $optParams);\n return $this->call('batchDelete', array($params), \"Google_Service_Proximitybeacon_DeleteAttachmentsResponse\");\n }",
"function deleteAttachment($attachment) {\n\t\t$fileToDelete = substr($attachment['uri'], strpos($attachment['uri'], \"/\") + 1);\n\n\t\t//Delete the original file.\n\t\t$this->deleteFile(Configure::read(\"S3.bucket\"), $fileToDelete);\n\t}",
"public function delete($attachment_id) {\r\n\t\t\r\n\t\tif(is_array($attachment_id)) {\r\n\t\t\r\n\t\t\twhile(list($ind, $val) = each($attachment_id)) {\r\n\t\t\t\t\r\n\t\t\t\t$query = \"DELETE FROM $this->att WHERE attachment_id = $val\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$Affected = $this->execute($query);\r\n\t\t\t\t\r\n\t\t\t\tif (PEAR::isError($Affected)) {\r\n\t\t\t\t\tdie($Affected->getMessage());\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t$query = \"DELETE FROM $this->att WHERE attachment_id = $attachment_id\";\r\n\t\t\t\r\n\t\t\t$Affected = $this->execute($query);\r\n\t\t\t\t\r\n\t\t\t\tif (PEAR::isError($Affected)) {\r\n\t\t\t\t\tdie($Affected->getMessage());\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t}",
"public function deleteAttachment($attachmentid){\n $header = $this->app->request->headers->all();\n $body = $this->app->request->getBody();\n //getAttachment to get the file of the Attachment\n $URL = $this->lURL.'/DB/attachment/attachment/'.$attachmentid;\n $answer = Request::custom('GET', $URL, $header, \"\");\n $body = json_decode($answer['content'], true);\n\n if (isset($body['file'])) {\n // request to database\n $URL = $this->lURL.'/DB/attachment/attachment/'.$attachmentid;\n $answer = Request::custom('DELETE', $URL, $header, $body);\n $this->app->response->setStatus($answer['status']);\n\n // delete the file\n LFileHandler::delete($this->lURL, $header, $body['file']);\n } else {\n $this->app->response->setStatus(409);\n }\n }",
"public function delete($itemId, $attachmentId, $optParams = array())\n {\n $params = array('itemId' => $itemId, 'attachmentId' => $attachmentId);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params));\n }",
"function wise_chat_action_delete_attachment($attachmentId) {\n\t$wiseChatImagesService = WiseChatContainer::get('services/WiseChatImagesService');\n\t$wiseChatImagesService->removeRelatedImages($attachmentId);\n}",
"public function deleteAttachment() {\n try {\n if (!($this->attachment instanceof Base_Model_ObtorLib_App_Core_Qualification_Entity_Attachment)) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception(\" Attachment Entity not initialized\");\n } else {\n $objAttachment = new Base_Model_ObtorLib_App_Core_Qualification_Dao_Attachment();\n $objAttachment->attachment = $this->attachment;\n return $objAttachment->deleteAttachment();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception($ex);\n }\n }",
"public function DeleteAttachment($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }",
"public function deleteattachmentAction()\r\n {\r\n try {\r\n if ( ($id = $this->getRequest()->getParam('id')) ) {\r\n $attachment = Mage::getModel('link/node_attachment')->load($id);\r\n\r\n $attachment->delete();\r\n }\r\n } catch (Exception $error) { }\r\n }",
"public function deleted(Attachment $attachment)\n {\n \n UnSearchableJob::dispatch($attachment->name);\n \n }",
"public function onAttachmentDelete(Attachment $attachment, Entity $container = null)\n {\n }",
"public function delete_attachment($attachment_id)\n {\n $current_usage = $this->get_current_usage();\n\n $this->debug(\"Updating used size after deletion- old = \".$current_usage[self::OPTION_USAGE_USED].\" MB\");\n\n /* We get current usage on disk */\n $used_infos = EPFLQuota::get_usage_on_disk();\n\n /* Because file hasn't been deleted yet, we have to remove informations from stats */\n $used_infos[self::OPTION_USAGE_NB_FILES] -= 1;\n\n /* If there's no file anymore */\n if($used_infos[self::OPTION_USAGE_NB_FILES] == 0)\n {\n /* We set usage to 0 instead of substracting removed file size, to avoid rounding problems */\n $used_infos[self::OPTION_USAGE_USED] = 0;\n }\n else\n {\n $used_infos[self::OPTION_USAGE_USED] -= filesize(get_attached_file($attachment_id))/1024/1024;\n }\n\n $current_usage[self::OPTION_USAGE_USED] = $used_infos[self::OPTION_USAGE_USED];\n $current_usage[self::OPTION_USAGE_NB_FILES] = $used_infos[self::OPTION_USAGE_NB_FILES];\n $this->debug(\"Updating used size after deletion - new = \".$current_usage[self::OPTION_USAGE_USED].\" MB (calculated from real disk usage)\");\n\n EPFLQuota::set_current_usage($current_usage);\n }",
"public function deleteAttachment($document_id, $attachment_id): string\n {\n return $this->request('documents/'.$document_id.'/attachments/'.$attachment_id, 'DELETE');\n }",
"public function delete_attachments($contextid = 1) {\n $fs = get_file_storage();\n $fs->delete_area_files($contextid, 'mod_documents', 'attachment', $this->id);\n $fs->delete_area_files($contextid, 'mod_documents', 'picture', $this->id);\n\n }",
"public function destroy(Attachment $attachment)\n {\n $attachment->delete();\n return redirect()->route('attachment.index');\n }",
"public function deleteByAttachmentId($attachmentId)\n {\n $attachmentId = (int)$attachmentId;\n $photo = $this->getByAttachmentId($attachmentId);\n\n do_action('gg_delete_photo_attachment_id', $attachmentId);\n\n return $this->deleteBy('attachment_id', $attachmentId);\n }",
"public function deleteAttachment($id)\n\t{\n\t\t$attachment = MailAttachment::find($id);\n\t\t$attachment->delete();\n\t\t\n\t\t$result = [\n\t\t\t'success' => 1\n\t\t];\n\t\t\n\t\treturn response($result);\n\t}",
"public function removeAttachmentById() {\n\n if (!empty($_GET['attachmentId']) && !empty($_GET['attachment'])) {\n $attachmentId = $_GET['attachmentId'];\n $attachment = $_GET['attachment'];\n $unlinkPath = $_SERVER['DOCUMENT_ROOT'].'/fintech/laravel/public/po_image/';\n unlink($unlinkPath.$attachment);\n date_default_timezone_set('Asia/Kolkata'); \n $time = date('d-m-Y h:i:s A');\n $ticketData = [\n 'is_deleted_status' => 'Y',\n 'deleted_at' => $time\n ];\n $deleteResults = DB::table('purchase_order_image')\n ->where('id', $attachmentId)\n ->update($ticketData);\n echo $attachmentId;\n\n }\n }",
"public function delete($id = null)\n {\n $attachment = $this->Attachments->get($id);\n \n if (!@unlink(UPLOADS . $attachment->path)) {\n $this->set('error', 'An unexpected error occured');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n \n if ($this->request->is(['delete', 'post'])) {\n if (!$this->Attachments->delete($attachment)) {\n $this->set('error', 'An unexpected error occured');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n }\n \n $this->set('attachment', $attachment);\n $this->set('_serialize', 'attachment');\n }",
"public function removeAttachment(){\r\n $fid = Input::get('FID');\r\n $file = UploadedFiles::find($fid);\r\n if($file == null)\r\n return -1;\r\n $file->delete();\r\n return $fid;\r\n }",
"public static function action_delete_attachment( $post_id ) {\n\t\t$post = get_post( $post_id );\n\t\tself::purge_post_with_related( $post );\n\t}",
"public function actionDeleteAttachment($id)\n\t{\n\t\tif (Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t// we only allow deletion via POST request\n\t\t\tCmsAttachment::model()->findByPk($id)->delete();\n\t\t\tYii::app()->user->setFlash(Yii::app()->cms->flashes['success'], Yii::t('CmsModule.core', 'Attachment deleted.'));\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif (!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('node'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400, Yii::t('CmsModule.core', 'Invalid request. Please do not repeat this request again.'));\n\t}",
"public function delete(string $attachmentId)\n {\n /** @var Attachment $attachment */\n $attachment = Attachment::query()->findOrFail($attachmentId);\n $this->checkOwnablePermission('attachment-delete', $attachment);\n $this->attachmentService->deleteFile($attachment);\n\n return response()->json(['message' => trans('entities.attachments_deleted')]);\n }",
"public function delete_video( int $attachment_id ): void {\n\t\tdelete_metadata( 'post', 0, self::CROPPED_ID_POST_META_KEY, $attachment_id, true );\n\t}",
"public function deleteAttachment($assignment_id, $id)\n {\n// $submission = Submission::where('id', $submission_id)->first();\n $attachment = AssignmentAttachment::findOrFail($id);\n\n if($attachment != null){\n// foreach ($attachment->media as $delItem) {\n// $this->deleteMedia($delItem);\n// }\n\n // Only delete attachment as the media might be using by student\n $attachment->delete();\n }\n\n return back();\n }",
"public function destroy($id) {\n\n $attachment = Attachment::find($id);\n unlink($attachment->path);\n $attachment->delete();\n }",
"public function delete($objectAttachment) {\n $sql = \"DELETE FROM attachments WHERE id = {$objectAttachment->id}\";\n\n if ($this->conn->query($sql) === TRUE) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"function delete_attachment( $post ) {\n\tif( $_POST['att_ID'] ) {\n\t\t$msg = _e( 'Attachment ID [' . $_POST['att_ID'] . '] has been deleted!' );\n\t\tif( wp_delete_attachment( $_POST['att_ID'], true )) {\n\t\t\techo $msg;\n\t\t}\n\t}\n\tdie();\n}",
"function wp_delete_attachment($post_id, $force_delete = \\false)\n {\n }",
"public function delete()\n {\n if (method_exists(get_class($this), 'attachments'))\n {\n /** @var Attachment $attachment */\n /** @noinspection PhpUndefinedMethodInspection */\n foreach ($this->attachments()->get() as $attachment)\n {\n $attachment->delete();\n }\n }\n return parent::delete();\n }"
]
| [
"0.75928193",
"0.7019951",
"0.6882661",
"0.6874216",
"0.6844878",
"0.6837348",
"0.6559351",
"0.64923155",
"0.639589",
"0.6385387",
"0.63666534",
"0.6289987",
"0.6250941",
"0.62203264",
"0.61278385",
"0.60949725",
"0.608382",
"0.6060837",
"0.59632385",
"0.59626645",
"0.58990407",
"0.58838356",
"0.579686",
"0.5755157",
"0.57371104",
"0.55870247",
"0.5586511",
"0.55563265",
"0.5520093",
"0.5515026"
]
| 0.70749915 | 1 |
Returns the attachments for the specified beacon that match the specified namespacedtype pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use ``, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint. Authenticate using an [OAuth access token]( from a signedin user with viewer, Is owner or Can edit permissions in the Google Developers Console project. (attachments.listBeaconsAttachments) | public function listBeaconsAttachments($beaconName, $optParams = array())
{
$params = array('beaconName' => $beaconName);
$params = array_merge($params, $optParams);
return $this->call('list', array($params), "Google_Service_Proximitybeacon_ListBeaconAttachmentsResponse");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAttachmentsList() {\n return $this->_get(10);\n }",
"public function getAttachmentsList() {\n return $this->_get(20);\n }",
"public function getAttachments();",
"public function getAttachments();",
"public function getAttachmentsList() {\n return $this->_get(14);\n }",
"public function getNoticeAttachments($notice_id, $mdb_control)\n\t{\n\t\t$attachment_list = array();\n\t\t$controller = $mdb_control->getController(\"notice_attachment\");\n\t\t$attachment_list = $controller->getByAttribute(\"notice_id\", $notice_id);\n\t\t\n\t\treturn $attachment_list;\n\t}",
"public function batchDelete($beaconName, $optParams = array())\n {\n $params = array('beaconName' => $beaconName);\n $params = array_merge($params, $optParams);\n return $this->call('batchDelete', array($params), \"Google_Service_Proximitybeacon_DeleteAttachmentsResponse\");\n }",
"public function listAttachmentByBill(AccessToken $token, $id, $requestBodyParameters = [])\n\t{\n\t\treturn $this->executeAndParse(self::METHOD_GET, \"{$this->getBaseApiUrl()}/bills/{$id}/attachments\", $token, $requestBodyParameters);\n\t}",
"protected function _shortcode_get_attachments( $atts ) {\n\t\t$attachments = array();\n\n\t\tif ( ! empty( $atts['include'] ) ) :\n\t\t\t$_attachments = get_posts( array(\n\t\t\t\t'include' => $atts['include'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\t\tforeach ( $_attachments as $key => $val )\n\t\t\t\t$attachments[$val->ID] = $_attachments[$key];\n\n\t\telseif ( ! empty( $atts['exclude'] ) ) :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'exclude' => $atts['exclude'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\telse :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\t\tendif;\n\n\t\treturn $attachments;\n\t}",
"public function getAttachments(): array;",
"abstract protected function _attachmentsList();",
"function attachmentsCreateExample($service, $beaconName, $optParams)\n{\n\ttry\n\t{\n\t\t// Parameter validation.\n\t\tif ($service == null)\n\t\t\tthrow new Exception(\"service is required.\");\n\t\tif ($optParams == null)\n\t\t\tthrow new Exception(\"optParams is required.\");\n\t\tif (beaconName == null)\n\t\t\tthrow new Exception(\"beaconName is required.\");\n\t\t// Make the request and return the results.\n\t\treturn $service->attachments->CreateAttachments($beaconName, $optParams);\n\t}\n\tcatch (Exception $e)\n\t{\n\t\tprint \"An error occurred: \" . $e->getMessage();\n\t}\n}",
"public function getAttachments()\n\t{\n\t\t$app = Factory::getApplication();\n\t\t$data = $app->input->post->get('jform', array(), 'array');\n\t\t$files = $app->input->files->get('jform');\n\t\t$allowed_extensions = ComponentHelper::getParams('com_tkdclub')->get('allowed_extensions', 'pdf');\n\t\t$allowed_extensions_array = explode(',', $allowed_extensions);\n\n\t\t$attachments = array();\n\t\t$paths = array();\n\t\t$filenames = array();\n\n\t\tforeach($files as $file)\n\t\t{\n\t\t\tif($file['name'] != '' && $file['error'] == (int) 0)\n\t\t\t{\t\n\t\t\t\t// Check for right file extension\n\t\t\t\tif(!in_array(File::getExt($file['name']), $allowed_extensions_array))\n\t\t\t\t{\n\t\t\t\t\t$app->enqueueMessage(Text::_('COM_TKDCLUB_EMAIL_ATTACHMENT_NOT_ALLOWED') . $allowed_extensions, 'error');\n\t\t\t\t\t$app->setUserState('com_tkdclub.email.data', $data);\n\t\t\t\t\t\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\n\t\t\t\t$paths[] = $file['tmp_name'];\n\t\t\t\t$filenames[] = $file['name'];\n\t\t\t}\n\t\t}\n\n\t\tif(empty($paths))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$attachments['paths'] = $paths;\n\t\t$attachments['filenames'] = $filenames;\n\n\t\treturn $attachments;\n\t}",
"private function getAttachementFiles(array $attachments = [])\n {\n $files = [];\n if (empty($attachments)) {\n return $files;\n }\n foreach ($attachments as $key => $attachment) {\n if (!ine($attachment, 'type') || !ine($attachment, 'value')) {\n throw new InvalideAttachment(\"Email sending fails. Invalid Attachment.\");\n }\n $files[] = $this->getFile($attachment['type'], $attachment['value']);\n }\n return $files;\n }",
"public function getAttachments(): array\n {\n return $this->attachments;\n }",
"public function getAttachments(): array\n {\n return $this->attachments;\n }",
"public function listAttachmentByPiggyBank(AccessToken $token, $id, $requestBodyParameters = [])\n\t{\n\t\treturn $this->executeAndParse(self::METHOD_GET, \"{$this->getBaseApiUrl()}/piggy_banks/{$id}/attachments\", $token, $requestBodyParameters);\n\t}",
"public function getCustomerNotificationAttachments(): array;",
"private function retrieveAttachmentInformation() : array {\n $quarantineEmailAttachmentsParser = new QuarantineEmailAttachmentsParser();\n return $quarantineEmailAttachmentsParser->parse($this->currentEmail);\n }",
"public function listTimelineAttachments($itemId, $optParams = array())\n {\n $params = array('itemId' => $itemId);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), 'Google\\Service\\Mirror\\AttachmentsListResponse');\n }",
"public function getAttachments()\n {\n $attachments = array();\n\n /** @var MailMessage $attachment */\n foreach ($this as $attachment) {\n $headers = $attachment->headers;\n\n $ct = $headers->get('Content-Type');\n // attempt to extract filename\n // 1. try Content-Type: name parameter\n // 2. try Content-Disposition: filename parameter\n // 3. as last resort use Untitled with extension from mime-type subpart\n /** @var ContentType $ct */\n $filename = $ct->getParameter('name')\n ?: $attachment->getHeaderField('Content-Disposition', 'filename')\n ?: ev_gettext('Untitled.%s', end(explode('/', $ct->getType())));\n\n // get body.\n // have to decode ourselves or use something like Mime\\Message::createFromMessage\n $body = $attachment->getContent();\n /** @var ContentTransferEncoding $cte */\n $cte = $headers->get('Content-Transfer-Encoding');\n switch ($cte->getTransferEncoding()) {\n case 'quoted-printable':\n $body = quoted_printable_decode($body);\n break;\n case 'base64':\n $body = base64_decode($body);\n break;\n case '7bit':\n case '8bit':\n case 'binary':\n // these need no transformation\n break;\n default:\n throw new LogicException(\"Unsupported Content-Transfer-Encoding: '{$cte->getTransferEncoding()}'\");\n }\n\n $attachments[] = array(\n 'filename' => $filename,\n 'cid' => $headers->get('Content-Id')->getFieldValue(),\n 'filetype' => $ct->getType(),\n 'blob' => $body,\n );\n }\n\n return $attachments;\n }",
"public static function getAttachmentsArray()\n {\n return Attachment::$attachmentsArray;\n }",
"public function getAttachments()\n {\n }",
"protected function renderAttachments($content)\r\n\t{\r\n\t\t$matches = array();\r\n\t\tpreg_match_all($this->_patterns['file'], $content, $matches);\r\n\r\n\t\t$pairs = array();\r\n\t\tforeach ($matches[1] as $index => $id)\r\n\t\t{\r\n\t\t\t/** @var CmsAttachment $attachment */\r\n\t\t\t$attachment = CmsAttachment::model()->findByPk($id);\r\n\t\t\tif ($attachment instanceof CmsAttachment)\r\n\t\t\t{\r\n\t\t\t\t// Use custom name if specified. The first letter must be trimmed\r\n\t\t\t\tif (!empty($matches[2][$index]))\r\n\t\t\t\t{\r\n\t\t\t\t\t// TODO: fix 'file' pattern so the colon isn't included\r\n\t\t\t\t\t$name = $matches[2][$index];\r\n\t\t\t\t\t$name = substr($name, 1, strlen($name) - 1);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$name = $attachment->resolveName();\r\n\t\t\t\r\n\t\t\t\t$url = $attachment->getUrl();\r\n\t\t\t\t$pairs[$matches[0][$index]] = CHtml::link($name, $url);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!empty($pairs))\r\n\t\t\t$content = strtr($content, $pairs);\r\n\r\n\t\treturn $content;\r\n\t}",
"public function find_message_attachments($struct, $skip_ids=array(), $attachments=array()) {\n\t\tif (!is_array($struct) || empty($struct)) {\n\t\t\treturn $attachments;\n\t\t}\n\n\t\tforeach ($struct as $id => $vals) {\n\t\t\t//if(!is_array($vals) || in_array($id, $skip_ids))\n\t\t\tif(!is_array($vals))\n\t\t\t\tcontinue;\n//var_dump($vals);\n\t\t\t// Strict must be true as 2.1 == 2.10 if false\n\t\t\tif(isset($vals['type']) && !in_array($id, $skip_ids, true)){\n\t\t\t\t$vals['number'] = $id;\n\n\t\t\t\t//sometimes NIL is returned from Dovecot?!?\n\t\t\t\tif($vals['id']=='NIL')\n\t\t\t\t\t$vals['id']='';\n\n\t\t\t\t$attachments[]=$vals;\n\t\t\t}elseif(isset($vals['subs'])) {\n\t\t\t\t$attachments = $this->find_message_attachments($vals['subs'],$skip_ids,\t$attachments);\n\t\t\t}\n\t\t}\n\t\treturn $attachments;\n\t}",
"public function getAttachments() {\n\t\treturn $this->attachments;\n\t}",
"public function getAttachedFiles()\n\t{\n\t\t$this->loadMailAttachment();\n\n\t\treturn $this->m_attachedFiles;\n\t}",
"public function attachments()\n {\n return $this->morphMany(Attachment::class, 'model')->AttachmentType();\n }",
"public function &getAttachments(): array {\n return $this->attachments;\n }",
"public function getAttachments()\n {\n return $this->attachment;\n }"
]
| [
"0.56232435",
"0.5537076",
"0.5451142",
"0.5451142",
"0.54085815",
"0.5380164",
"0.5332533",
"0.51475906",
"0.50720733",
"0.5044913",
"0.5006742",
"0.4993605",
"0.49494988",
"0.49395376",
"0.4881001",
"0.4881001",
"0.4835176",
"0.4831308",
"0.4797166",
"0.47818804",
"0.4718333",
"0.46705034",
"0.46564192",
"0.45757082",
"0.45662245",
"0.45612326",
"0.45555332",
"0.45466104",
"0.4534007",
"0.45338157"
]
| 0.65270567 | 0 |
Method to check if the window dates have already been set for a semester | public function checkSet($array){
$sql="select * from windows where semester=?";
$data[0]=$array['season'] . ' ' . $array['year'];
$res=$this->db->query($sql,$data);
if ($res->num_rows() >= 1){
return true;
}else{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function CheckDateOverlapping()\n\t{\n\t\t$rid = MicroGrid::GetParameter('rid');\n\t\t$start_date = MicroGrid::GetParameter('start_date', false);\n\t\t$finish_date = MicroGrid::GetParameter('finish_date', false);\n\t\t$hotel_id = MicroGrid::GetParameter('hotel_id', false);\n\n\t\t$sql = 'SELECT * FROM '.TABLE_HOTEL_PERIODS.'\n\t\t\t\tWHERE\n\t\t\t\t\tid != '.(int)$rid.' AND\n\t\t\t\t\thotel_id = '.(int)$hotel_id.' AND\n\t\t\t\t\t(((\\''.$start_date.'\\' >= start_date) AND (\\''.$start_date.'\\' <= finish_date)) OR\n\t\t\t\t\t((\\''.$finish_date.'\\' >= start_date) AND (\\''.$finish_date.'\\' <= finish_date))) ';\t\n\t\t$result = database_query($sql, DATA_AND_ROWS, FIRST_ROW_ONLY);\n\t\tif($result[1] > 0){\n\t\t\t$this->error = _TIME_PERIOD_OVERLAPPING_ALERT;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function checkValidSeason()\n {\n if (!$this->season_helper->isValidSeason($this->selected_season)) {\n $this->selected_season = $this->season_helper->getSeasonId(date('r'));\n $competitions = $this->query_competitions->getCompetitionBySeasonId($this->selected_season,\n ['Scored' => 'Y']);\n /** @var QueryCompetitions $competition */\n $competition = end($competitions);\n $date_object = new \\DateTime($competition->Competition_Date);\n $this->selected_date = $date_object->format(('Y-m-d'));\n }\n }",
"public static function is_reservtion_possible(DateTime $date1, DateTime $date2, Room $room_for_check){\r\n if ($date1>$date2) return false;\r\n \r\n $unavailable_dates = (new self)->all_unavailable_dates($room_for_check);\r\n// var_dump($unavailable_dates); \r\n $unav_dates_between = array();\r\n foreach($unavailable_dates as $the_date){\r\n if (self::is_date_greater($the_date, $date1) && self::is_date_greater($date2, $the_date)){\r\n $unav_dates_between[] = $the_date;\r\n// var_dump($the_date);\r\n break;\r\n \r\n }\r\n }\r\n// var_dump($unav_dates_between);\r\n return empty($unav_dates_between);\r\n}",
"function attendance_session_open_for_students($sess) {\n $sessionopens = empty($sess->studentsearlyopentime) ? $sess->sessdate : $sess->sessdate - $sess->studentsearlyopentime;\n if (time() > $sessionopens) {\n return true;\n } else {\n return false;\n }\n}",
"public function hasDate() {\n return $this->_has(3);\n }",
"function testSummer($testDate) {\n //set as globals so only calculated once\n global $memorialDay, $laborDay;\n\n if ($testDate > $memorialDay && $testDate < $laborDay){\n return true;\n }\n else{\n return false;\n }\n\n}",
"static function checkIfDateSameWeek($startDate,$endDate)\n { \n $startDateCarbon = new Carbon($startDate);\n $endDateCarbon = new Carbon($endDate);\n\n\t\t$diff = $startDateCarbon->diffInDays($endDateCarbon);\n return $startDateCarbon->weekOfYear == $endDateCarbon->weekOfYear \n \t&& $diff <= 7 ;\n }",
"public static function checkSettings() {\r\n \t\r\n \t$currentYear = date('Y');\r\n \tif(date('m') == 1){\r\n\t $record = Doctrine_Query::create ()\r\n\t ->from ( 'InvoicesSettings is' )\r\n\t ->where ( \"is.year = ?\", $currentYear )\r\n\t\t\t\t\t->andWhere('is.isp_id = ?',Shineisp_Registry::get('ISP')->isp_id)\r\n\t ->limit ( 1 )\r\n\t ->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n\t \r\n\t if(empty($record)){\r\n\t\t\t\t$is = new InvoicesSettings();\r\n\t\t\t\t$is['year'] = $currentYear;\r\n\t\t\t\t$is['next_number'] = 1;\r\n\t\t\t\t$is->save();\r\n\t }\r\n \treturn true;\r\n \t}\r\n \treturn false;\r\n }",
"function are_we_timesheeting_today() {\n\t\t$timesheet_regex = str_replace('{{DATE}}',date('Ymd',time()+($this->config['timesheet_lead_time_days'] * 86400)),$this->config['timesheet_file_find_by_date']);\n\n\t\t$dh = opendir($this->config['timesheet_path']);\n\n\t\twhile ($file = readdir($dh)) {\n\t\t\tif (preg_match($timesheet_regex,$file)) { \n\t\t\t\techo \"Today's timesheet has already been generated: $file\\n\";\n\t\t\t\treturn false;\n\t\t\t} \n\t\t}\n\t\n\t\tclosedir($dh);\n\n\t\tforeach ($this->get_calendar_events(time()+($this->config['timesheet_lead_time_days'] * 86400), ((time()+($this->config['timesheet_lead_time_days']+1) * 86400)-86400)) as $event) {\n\n\t\t\tif (preg_match($this->config['calendar_entry'], $event->title->text, $m)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function valid()\n {\n return $this->_current !== null\n && $this->_current->getTimestamp() < $this->_endDate->getTimestamp();\n }",
"function expDateCallback()\n {\n $months = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');\n $years = array('2012','2013','2014','2015','2016','2017','2018');\n \n if (in_array($_POST['exp_mon'], $months) && in_array($_POST['exp_yr'], $years)) {\n return true;\n }\n return false;\n }",
"public function matchWeekOfMonth()\n {\n $weeks = $this->getDataValue('weeks');\n return in_array(Carbon::now($this->automation->customer->getTimezone())->weekOfMonth, $weeks, false);\n }",
"public function session_validate(){\n\t\tif(!empty($this->data['Leave']['leave_from']) && !empty($this->data['Leave']['leave_to'])){\n\t\t\t$leave_from = $this->format_date_save($this->data['Leave']['leave_from']);\n\t\t\t$leave_to = $this->format_date_save($this->data['Leave']['leave_to']);\n\t\t\t$diff = $this->diff_date($leave_from, $leave_to);\t\t\t\n\t\t\tif($diff > 0 && $this->data['Leave']['session'] != 'D'){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}",
"private function check_meet_creation_limit()\n {\n $recent_shackmeet_count = count($this->load_recent_shackmeet_count());\n \n return $recent_shackmeet_count < 2;\n }",
"public function hasStartMonth() {\n return $this->_has(5);\n }",
"public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}",
"function recommends_req_wizard_schools_info_validate($form, &$form_state) {\n\n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n \n $date_due_month = $form_state['values']['schname'][$i]['r_date_due']['month'];\n $date_due_day = $form_state['values']['schname'][$i]['r_date_due']['day'];\n $date_due_year = $form_state['values']['schname'][$i]['r_date_due']['year'];\n \n $d2=mktime(0,0,0,$date_due_month,$date_due_day,$date_due_year);\n $d1=time();\n $days_diff = floor(($d2-$d1)/86400);\n if ($days_diff < 30 ) {\n form_set_error(\"schname][$i][r_date_due\", 'The due date must be at least 30 days from today. Please contact the professor to discuss exceptions.');\n }\n\n }\n}",
"function checkWeeks() {\n\t\tglobal $weeklyhours; \n\t\t\n\t\tforeach ( $this->weeklyAnalysis as &$week ) {\n\t\t\tif ( $week['total'] < $weeklyhours ) {\n\t\t\t\t$week['complete'] = 0; \t\t\t\t\t\t\t// set this week incomplete\n\t\t\t\t$this->complete = 0; \t\t\t\t\t\t\t// set entire analysis to incomplete\n\t\t\t}\n\t\t\telse $week['complete'] = 1;\n\t\t\t\t\n\t\t}\n\t}",
"private function checkDatesValidity(){\n\t\t$valid=true;\n\t\t$today = date(\"Y-m-d\");\n\t\tif($this->validFrom!=\"\" && $this->validFrom!=\"0000-00-00\" && $today<$this->validFrom) $valid=false;\n\t\tif($this->validUntil!=\"\" && $this->validUntil!=\"0000-00-00\" && $today>$this->validUntil) $valid=false;\n\t\treturn $valid;\n\t}",
"public function isNotFillFirstStartDate () {\n return '0000-00-00' == $this->first_start_date;\n }",
"public function isSummerSemester()\n {\n if ($this->semesterNumber > 8) {\n return true;\n }\n\n return false;\n }",
"public function hasStartYear() {\n return $this->_has(14);\n }",
"public function hasDate() : bool;",
"public function isSetEventDate()\n {\n return !is_null($this->_fields['EventDate']['FieldValue']);\n }",
"public function panelist_dwid_availability() {\n\t\t$partner_users = $this->PartnerUser->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'PartnerUser.partner' => 'mbd',\n\t\t\t\t'PartnerUser.created >=' => date(DB_DATETIME, strtotime('-14 days'))\n\t\t\t)\n\t\t));\n\t\t\n\t\t$missing_dwids = $missing_from_stales = array();\n\t\t$this->out('Analyzing '.count($partner_users).' exported panelists to MBD');\n\t\tforeach ($partner_users as $partner_user) {\n\t\t\t$user_id = $partner_user['PartnerUser']['user_id'];\n\t\t\tif (empty($partner_user['PartnerUser']['uid'])) {\n\t\t\t\t$missing_dwids[] = $user_id;\n\n\t\t\t\t// confirm they are missing from stale\n\t\t\t\t$count = $this->MbdStale->find('count', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'MbdStale.user_id' => $partner_user['PartnerUser']['user_id']\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\tif ($count == 0) {\n\t\t\t\t\t$missing_from_stales[] = $user_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$missing_dwid_pct = round(count($missing_dwids) / count($partner_users) * 100, 2); \n\t\t$missing_stale_pct = round(count($missing_from_stales) / count($partner_users) * 100, 2); \n\t\t$diff = array_diff($missing_dwids, $missing_from_stales);\n\t\t\n\t\t$this->out(count($missing_dwids).' missing DWIDs ('.$missing_dwid_pct.'%)');\n\t\t$this->out(count($missing_from_stales).' missing from stales ('.$missing_stale_pct.'%)');\n\t}",
"private function CheckStartFinishDate()\n\t{\n\t\t$start_date = MicroGrid::GetParameter('start_date', false);\n\t\t$finish_date = MicroGrid::GetParameter('finish_date', false);\n\t\t\n\t\tif($start_date > $finish_date){\n\t\t\t$this->error = _START_FINISH_DATE_ERROR;\n\t\t\treturn false;\n\t\t}\t\n\t\treturn true;\t\t\n\t}",
"private function compare_with_date()\n {\n }",
"public function hasStartYear() {\n return $this->_has(4);\n }",
"private function validate_booking(): bool {\n\t $this->errors = array();\n\n // Clear data using test_input function\n foreach ($this->request->post as $key => $value) {\n $this->request->post[$key] = self::test_input($this->request->post[$key]);\n }\n\n // Time\n if(!(preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/\", $this->request->post[\"time\"]))){\n array_push($this->errors,$this->language->get('time_error'));\n }\n\n // Date\n $temp = new DateTime();\n\n // Create date object (without time)\n $date = DateTime::createFromFormat('Y-m-d', $this->request->post[\"date\"]);\n\n // Remove time from datetime string\n $now = DateTime::createFromFormat(\"Y-m-d\", $temp->format(\"Y-m-d\"));\n\n // Extract data\n $year = $date->format(\"Y\");\n $month = $date->format(\"m\");\n $day = $date->format(\"d\");\n\n if($date < $now){\n array_push($this->errors,$this->language->get('date_past_error'));\n }\n else if(!checkdate($month,$day,$year)) {\n //$this->errors[\"date\"] = $this->language->get('date_error');\n array_push($this->errors,$this->language->get('date_value_error'));\n }\n\n //TODO: REMOVE\n return count($this->errors) == 0;\n }",
"public function hasDate() : bool\n {\n return isset($this->date);\n }"
]
| [
"0.6079869",
"0.5817621",
"0.5561663",
"0.5528896",
"0.5523777",
"0.55085075",
"0.5504671",
"0.54375416",
"0.5417533",
"0.53976905",
"0.53973454",
"0.5385209",
"0.5348545",
"0.5316661",
"0.5313944",
"0.5313737",
"0.53029484",
"0.53021604",
"0.53001446",
"0.5274669",
"0.5261718",
"0.5251922",
"0.524827",
"0.5233669",
"0.5225234",
"0.52215403",
"0.52074933",
"0.5193355",
"0.5133145",
"0.512916"
]
| 0.62588704 | 0 |
Method to update window dates in the windows table for a given semester if they have already been set | public function updateDates($array){
$sql="UPDATE windows SET appOpen=?, appClose=?, commentOpen=?, commentClose=? WHERE semester=?";
$data[0]=$array['appfrom'];
$data[1]=$array['appto'];
$data[2]=$array['commentfrom'];
$data[3]=$array['commentto'];
$data[4]=$array['season'] . ' ' . $array['year'];
$bol=$this->db->query($sql,$data);
if($bol)
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_week(){\n\t\t$time = array('id'=>1, 'ending_date' => date('Y-m-d'));\n\t\treturn $this->save($time);\n\t}",
"public function update(Request $request, Semester $semester)\n {\n $validate=$request->validate([\n 'name' => 'required',\n 'year' => 'required',\n 'examDate' => 'required',\n\n ]);\n\n\n if ($request->input('current') == 'on') {\n $current=1;\n }else {\n $current=0;\n }\n\n $updateSemester=Semester::where('id',$semester->id)->update([\n 'name'=>$request->input('name'),\n 'year_id'=>$request->input('year'),\n 'exam_date'=>$request->input('examDate'),\n 'current' =>$current,\n ]);\n\n flash('Semester updated')->success()->important();\n return redirect()->route('semester.index');\n }",
"private function _reloadSemesterSchedule ( $semester ) {\n $request = $this->CacheRequest->find( 'first', array(\n 'conditions' => array( 'CacheRequest.idul' => $this->Session->read( 'User.idul' ), 'CacheRequest.name' => 'schedule-' . $semester )\n ) );\n if ( !empty( $request ) ) {\n $md5Hash = array( $request[ 'CacheRequest' ][ 'name' ] => $request[ 'CacheRequest' ][ 'md5' ] );\n } else {\n $md5Hash = array();\n }\n\n\t\t// Reload schedule from Capsule\n\t\t$this->Capsule->forceReload = true;\n\t\t$result = $this->Capsule->getSchedule( $md5Hash );\n\n\t\t// Similar data have been found in DB (not reloaded)\n if ( !$result ) {\n // Unknown error\n return false;\n } elseif ( $result[ 'status' ] ) {\n // Delete user's schedule saved in DB for the registration semester\n $this->User->ScheduleSemester->deleteAll( array(\n 'ScheduleSemester.idul' \t=> $this->Session->read( 'User.idul' ),\n 'ScheduleSemester.semester'\t=>\t$semester\n ) );\n\n // Save schedule data\n $this->User->ScheduleSemester->saveAll( $result[ 'schedule' ], array( 'deep' => true ) );\n\n // Update last data checkup timestamp\n foreach ( $result[ 'md5Hash' ] as $name => $hash ) {\n $this->CacheRequest->saveRequest( $this->Session->read( 'User.idul' ), $name, $hash );\n }\n\n $this->CacheRequest->saveRequest( $this->Session->read( 'User.idul' ), 'schedule' );\n\n return true;\n }\n\t}",
"public function changeWeek(Request $request,$next_date){\n\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n \n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n \n $period = CarbonPeriod::create($start_date, $end_date);\n \n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n \n }\n \n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $user_id = $id;\n } else {\n $user = Auth::user();\n\n if ($user) {\n $user_id = $user->id;\n } else {\n $user_id = $request->user_id;\n }\n }\n\n $student_detail = SmStudent::where('user_id', $user_id)->first();\n //return $student_detail;\n $class_id = $student_detail->class_id;\n $section_id = $student_detail->section_id;\n\n $sm_weekends = SmWeekend::orderBy('order', 'ASC')->where('active_status', 1)->where('school_id',Auth::user()->school_id)->get();\n\n $class_times = SmClassTime::where('type', 'class')->where('academic_id', getAcademicId())->where('school_id',Auth::user()->school_id)->get();\n\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $data = [];\n $data['student_detail'] = $student_detail->toArray();\n $weekenD = SmWeekend::all();\n foreach ($weekenD as $row) {\n $data[$row->name] = DB::table('sm_class_routine_updates')\n ->select('sm_class_times.period', 'sm_class_times.start_time', 'sm_class_times.end_time', 'sm_subjects.subject_name', 'sm_class_rooms.room_no')\n ->join('sm_classes', 'sm_classes.id', '=', 'sm_class_routine_updates.class_id')\n ->join('sm_sections', 'sm_sections.id', '=', 'sm_class_routine_updates.section_id')\n ->join('sm_class_times', 'sm_class_times.id', '=', 'sm_class_routine_updates.class_period_id')\n ->join('sm_subjects', 'sm_subjects.id', '=', 'sm_class_routine_updates.subject_id')\n ->join('sm_class_rooms', 'sm_class_rooms.id', '=', 'sm_class_routine_updates.room_id')\n\n ->where([\n ['sm_class_routine_updates.class_id', $class_id], ['sm_class_routine_updates.section_id', $section_id], ['sm_class_routine_updates.day', $row->id],\n ])->where('sm_class_routine_updates.academic_id', getAcademicId())->where('sm_classesschool_id',Auth::user()->school_id)->get();\n }\n\n return ApiBaseMethod::sendResponse($data, null);\n }\n\n return view('lesson::student.student_lesson_plan', compact('dates','this_week','class_times', 'class_id', 'section_id', 'sm_weekends'));\n \n }",
"public function update_date_ranges()\r\n\t{\r\n\t\t// So give INSERT and UPDATE their own code blocks, rather than try to combine them in one statement.\r\n\t\t$tbl = 'codes';\r\n\t\t$where = 'WHERE groupID = 7';\r\n\t\t$sql = \"SELECT ID FROM $tbl $where\";\r\n\t\t$r = $this->db->query($sql);\r\n\t\t// Using static keys, to align with quarter numbers. \r\n\t\t$field_vals[1] = $this->input->post('winter_open') . '|' . $this->input->post('winter_closed');\r\n\t\t$field_vals[2] = $this->input->post('spring_open') . '|' . $this->input->post('spring_closed');\r\n\t\t$field_vals[3] = $this->input->post('summer_open') . '|' . $this->input->post('summer_closed');\r\n\t\t$field_vals[4] = $this->input->post('autumn_open') . '|' . $this->input->post('autumn_closed');\r\n\r\n\t\tif (! $r->num_rows()) // Group 7 doesn't exist.\r\n\t\t{\r\n\t\t\tfor ($i = 1; $i < 5; $i++)\r\n\t\t\t{\r\n\t\t\t\t$insert_vals[] = \"(7, $i, '{$field_vals[$i]}')\";\r\n\t\t\t}\r\n\t\t\t$fields = implode(',', $insert_vals);\r\n\t\t\t$sql = \"INSERT INTO codes (groupID, ID, description) VALUES $fields\";\r\n\t\t\t$this->db->query($sql);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sql = \"UPDATE $tbl SET description = ? WHERE groupID = 7 and ID = ?\";\r\n\t\t\tfor ($i = 1; $i < 5; $i++)\r\n\t\t\t{\r\n\t\t\t\t$this->db->query($sql, [$field_vals[$i], $i]); // Array holds values for `description` and `id`.\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function testUpdate_Semesters($link, $semester_id) {\n\t\t$semester = Semester::select($link, $semester_id);\n\t\t\n\t\t// set attributes\n $year \t\t\t= $semester->year;\n $term \t\t\t= $semester->term;\n\t\t\n\t\t// perform update operation\n\t\tswitch($semester_id % 2) {\n\n\t\t\tcase(0):\n\t\t\t\tSemester::update($link, $semester_id, 9999, $term);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase(1):\n\t\t\t\tSemester::update($link, $semester_id, 0000, $term);\n\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\tdefault:\n\t\t\t\techo \"semester id does not exist.\";\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public static function updateSched($sched) {\n //LoginDao::authenticateSchedId($sched->id);\n /*\n $d = dateToString($sched->date);\n $sql = \"UPDATE scheds SET \";\n $sql .= \"date=\" . quote($d);\n $sql .= \", time_start=\" . quote($sched->timeStart);\n $sql .= \", timestamp=\" . quote($d . \" \" . SchedDao::div($sched->timeStart, 100) . \":\" . ($sched->timeStart % 100));\n $sql .= \", duration=\" . quote($sched->duration);\n $sql .= \", status=\" . quote($sched->status);\n $sql .= \", comment=\" . quote($sched->comment, true);\n $sql .= \", type=\" . quote($sched->type);\n $sql .= \" WHERE sched_id=\" . $sched->id;\n query($sql);\n */\n $appt = ApptEdit::from($sched);\n $appt->save();\n if (isset($sched->schedEvent)) {\n $event = SchedEvent::from($sched->schedEvent);\n /*\n $sql = \"UPDATE sched_events SET \";\n $sql .= \"rp_type=\" . quote($sched->schedEvent->type);\n $sql .= \", rp_every=\" . quote($sched->schedEvent->every);\n $sql .= \", rp_until=\" . quoteDate($sched->schedEvent->until);\n $sql .= \", rp_on=\" . quote($sched->schedEvent->on);\n $sql .= \", rp_by=\" . quote($sched->schedEvent->by);\n $sql .= \", comment=\" . quote($sched->schedEvent->comment);\n $sql .= \" WHERE sched_event_id=\" . $sched->schedEvent->id;\n query($sql);\n */\n $event->save();\n }\n if (isSet($sched->schedEvent)) {\n $sched->schedEvent->maxRepeatDate = SchedDao::repeatSched($sched);\n }\n /*\n if ($sched->clientId && $sched->clientId != 0) {\n AuditDao::log($sched->clientId, AuditDao::ENTITY_SCHED, $sched->id, AuditDao::ACTION_UPDATE, null, CommonCombos::getApptTypeDesc($sched->type));\n // SchedDao::saveClientUpdate(new ClientUpdate($sched->clientId, ClientUpdate::TYPE_APPT_UPDATED, $sched->id, CommonCombos::getApptTypeDesc($sched->type)));\n }\n */\n return $sched;\n }",
"function insertGamesToDate() {\n $conn = getConnection();\n $yesterdayDate = date('Y-m-d',strtotime(\"-1 days\"));\n\n $url = \"https://statsapi.web.nhl.com/api\";\n $all_games = \"/v1/schedule?startDate=2018-10-03&endDate=\".$yesterdayDate;\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO Games_ToDate VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // ignore games from all star weekend\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87) {\n continue;\n }\n\n //ignore non NHL team that played this year\n if($home_id == 7202) {\n continue;\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }",
"protected function updateLeagueStandings()\n {\n $conditions = array('needs_standings_update' => true);\n $fields = array('_id');\n $leagues_needing_update = Leagues::all(compact('conditions', 'fields'));\n }",
"public function setDays($regNr, $ssNr) {\n // Selecting the right row from history table bases on the personal number and registration number to update on right place.\n $historyQuery = \"SELECT * FROM history WHERE regNr = :regNr AND ssNr = :ssNr ORDER BY checkOutTime DESC LIMIT 1\";\n $historyStatement = $this->db->prepare($historyQuery);\n $historyParameters = [\"regNr\" => $regNr, \"ssNr\" => $ssNr];\n $historyRows = $historyStatement->execute($historyParameters);\n if (!$historyRows) die(\"Fatal Error\");\n \n // Fetching the checkin and checkout time from row selected above.\n $time = $historyStatement->fetch();\n $checkOut = $time[\"checkOutTime\"];\n $checkIn = $time[\"checkInTime\"];\n \n // Redefining times as Datetime-objects.\n $checkOutTime = new \\DateTime($checkOut);\n $checkInTime = new \\DateTime($checkIn);\n \n // Adding days, hours, minutes and seconds to total amount of minutes car has been rented.\n $difference = $checkOutTime->diff($checkInTime);\n $minutes = $difference->days * 24 * 60;\n $minutes += $difference->h * 60;\n $minutes += $difference->i;\n $minutes += $difference->s / 60;\n \n // Divide minutes with minutes in an hour and then hours in a day to get the amount in days and then rounding it up so we get amount of started days.\n $unroundedDays = $minutes / 60 / 24;\n $days = ceil($unroundedDays);\n \n // Updating history row we selected above with the total amount of days started.\n $historyQuery = \"UPDATE history SET days = :days WHERE regNr = :regNr AND ssNr = :ssNr ORDER BY checkOutTime DESC LIMIT 1\";\n $historyStatement = $this->db->prepare($historyQuery);\n $historyParameters = [\"days\" => $days, \"regNr\" => $regNr, \"ssNr\" => $ssNr];\n $historyStatement->execute($historyParameters);\n if (!$historyStatement) die(\"Fatal Error\");\n \n }",
"function wfCalendarRefresh()\n{\n global $wgRequest, $wgTitle, $wgScriptPath;\n // this is the \"refresh\" code that allows the calendar to switch time periods\n $v = $wgRequest->getValues();\n if (isset($v[\"calendar_info\"]))\n {\n $today = getdate(); // today\n $temp = explode(\"`\", $v[\"calendar_info\"]); // calling calendar info (name, title, etc..)\n\n // set the initial values\n $month = $temp[0];\n $day = $temp[1];\n $year = $temp[2];\n $title = $temp[3];\n $name = $temp[4];\n\n // the yearSelect and monthSelect must be on top... the onChange triggers\n // whenever the other buttons are clicked\n if (isset($v[\"yearSelect\"]))\n $year = $v[\"yearSelect\"];\n if (isset($v[\"monthSelect\"]))\n $month = $v[\"monthSelect\"];\n\n if (isset($v[\"yearBack\"]))\n --$year;\n if (isset($v[\"yearForward\"]))\n ++$year;\n\n if (isset($v[\"today\"]))\n {\n $day = $today['mday'];\n $month = $today['mon'];\n $year = $today['year'];\n }\n\n if (isset($v[\"monthBack\"]))\n {\n $year = ($month == 1 ? --$year : $year);\n $month = ($month == 1 ? 12 : --$month);\n }\n\n if (isset($v[\"monthForward\"]))\n {\n $year = ($month == 12 ? ++$year : $year);\n $month = ($month == 12 ? 1 : ++$month);\n }\n\n if (isset($v[\"weekBack\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day-7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (isset($v[\"weekForward\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day+7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (wfCalendarIsValidMode($v[\"viewSelect\"]))\n $mode = $v[\"viewSelect\"];\n\n $p = \"cal\".crc32(\"$title $name\");\n $v = sprintf(\"%04d-%02d-%02d-%s\", $year, $month, $day, $mode);\n\n // reload the page... clear any purge commands that may be in it from an ical load...\n $url = $wgTitle->getFullUrl(array($p => $v));\n header(\"Location: \" . $url);\n exit;\n }\n}",
"public static function addShift($request)\n {\t\n\t\t$getDate = UserShifts::where('date',$request['date'])->get();\n\t\tif(count($getDate) > 0) {\n\t\t\tforeach($getDate as $gd) {\n\t\t\t\tif($gd->date == $request['date'] && $gd->user_id == $request['user_id']) {\n\t\t\t\t\t$update = DB::table('user_shifts')\n\t\t\t\t\t->where(['user_id' => $request['user_id'], 'date' => $request['date']])\n\t\t\t\t\t->update(array('shift' => $request['shift'],'ps_color' => $request['ps_color'],'ps_desc' => $request['ps_desc']));\n\t\t\t\t\treturn $update;\n\t\t\t\t} else {\n\t\t\t\t$shift = UserShifts::create([\n\t\t\t\t\t'shift' => $request['shift'],\n\t\t\t\t\t'ps_color' => $request['ps_color'],\n\t\t\t\t\t'ps_desc' => $request['ps_desc'],\n\t\t\t\t\t'date' => $request['date'],\n\t\t\t\t\t'user_id' => $request['user_id'],\n\t\t\t\t\t'shift_type_id' => 5,\n\t\t\t\t\t'loc_id'=>0\n\t\t\t\t]);\n\t\t\t\treturn $shift;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t$shift = UserShifts::create([\n 'shift' => $request['shift'],\n\t\t\t'ps_color' => $request['ps_color'],\n\t\t\t'ps_desc' => $request['ps_desc'],\n 'date' => $request['date'],\n 'user_id' => $request['user_id'],\n\t\t\t'shift_type_id' => 5,\n\t\t\t'loc_id'=>0\n ]);\n\t\treturn $shift;\n\t\t}\n }",
"public function changeWeek($next_date)\n{\n try {\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n\n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n\n $period = CarbonPeriod::create($start_date, $end_date);\n\n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n\n }\n\n $login_id = Auth::user()->id;\n $teachers = SmStaff::where('active_status', 1)->where('user_id',$login_id)->where('role_id', 4)->where('school_id', Auth::user()->school_id)->first();\n\n $user = Auth::user();\n $class_times = SmClassTime::where('academic_id', getAcademicId())->where('school_id', Auth::user()->school_id)->orderBy('period', 'ASC')->get();\n $teacher_id =$teachers->id;\n $sm_weekends = SmWeekend::where('school_id', Auth::user()->school_id)->orderBy('order', 'ASC')->where('active_status', 1)->get();\n\n $data = [];\n $data['message'] = 'operation Successful';\n return ApiBaseMethod::sendResponse($data, null);\n\n } catch (Exception $e) {\n return ApiBaseMethod::sendError('operation Failed');\n }\n\n}",
"public function index()\n {\n $is_current_month = !request()->get('next');\n $days_in_month = date('t', strtotime($is_current_month ? 'now' : '+1 month'));\n $month_number = date('n', strtotime($is_current_month ? 'now' : '+1 month'));\n $year_number = date('y', strtotime($is_current_month ? 'now' : '+1 month'));\n\n $shifts = [];\n\n foreach (range(1,$days_in_month) as $day_number) {\n $date = mktime(0, 0, 0, $month_number, $day_number, $year_number);\n\n $shifts[date('j.n.y', $date)] = [\n 'date_without_year' => date('j.n', $date),\n 'date' => date('j.n.y', $date),\n 'day_of_week' => str_replace(['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'], date('l', $date)),\n 'shift1' => [\n 'saturday' => date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n 'shift2' => [\n 'saturday' => date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n 'shift3' => [\n 'saturday' => date('w', $date) == 5 || date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n ];\n }\n\n $registered = Shift::with('user')\n ->where('date_str', 'LIKE', \"%.$month_number.$year_number\")\n ->get();\n\n foreach ($registered as $register) {\n $shifts[$register['date_str']]['shift'.$register['shift_id']]['users'][] = [\n 'user_id' => $register['user_id'],\n 'status' => $register['status'],\n 'name' => array_get($register, 'user.name', 'משתמש נמחק'),\n ];\n }\n\n $is_admin = request()->get('admin') && Auth::user()->is_admin;\n\n return view('home')\n ->with('shifts', array_values($shifts))\n ->with('current_user_id', Auth::user()->id)\n ->with('is_current_month', $is_current_month)\n ->with('can_admin', Auth::user()->is_admin)\n ->with('users', $is_admin ? User::orderBy('name')->get() : [])\n ->with('is_admin', $is_admin);\n }",
"public function updateSchedule()\n\t{\n\t\t// Removing old days if we have any days\n\t\tif (count(self::$schedule) > 0) {\n\t\t\t$currDate = date('Y/m/d');\n\n\t\t\twhile (isset(self::$schedule[0]) && self::$schedule[0]->date != $currDate) {\n\t\t\t\tarray_shift(self::$schedule);\n\t\t\t}\n\t\t}\n\n\t\t// Building out the schedule if we're missing days\n\t\tif (count(self::$schedule) < 7) $this->build();\n\t}",
"function saveGroupWorksheet($worksheetDetails, $grade_boundaries, $userid, $worksheet_inputs, $worksheet_tags) {\n try{\n $gwid = $worksheetDetails[\"gwid\"];\n $staff1 = (!$worksheetDetails[\"staff1\"] || $worksheetDetails[\"staff1\"] == \"0\") ? $userid : $worksheetDetails[\"staff1\"];\n $staff2 = (!$worksheetDetails[\"staff2\"] || $worksheetDetails[\"staff2\"] == \"0\") ? \"null\" : $worksheetDetails[\"staff2\"];\n $staff3 = (!$worksheetDetails[\"staff3\"] || $worksheetDetails[\"staff3\"] == \"0\") ? \"null\" : $worksheetDetails[\"staff3\"];\n $datedue = $worksheetDetails[\"dateDueMain\"];\n $stuNotes = array_key_exists(\"studentNotes\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"studentNotes\"]) : \"\";\n //$staffNotes = array_key_exists(\"staffNotes\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"staffNotes\"]) : \"\";\n $displayName = array_key_exists(\"displayName\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"displayName\"]) : \"\";\n $hidden = $worksheetDetails[\"hide\"] == \"true\" ? \"0\" : \"1\";\n $student_input = $worksheetDetails[\"student\"] == \"true\" ? \"1\" : \"0\";\n $enter_totals = $worksheetDetails[\"enter_totals\"] == \"true\" ? \"1\" : \"0\";\n\n $query = \"UPDATE TGROUPWORKSHEETS SET `Primary Staff ID` = $staff1, `Additional Staff ID` = $staff2, `Additional Staff ID 2` = $staff3, \"\n . \"`Date Due` = STR_TO_DATE('$datedue', '%d/%m/%Y'), `Additional Notes Student` = '$stuNotes', `DisplayName` = '$displayName' \"\n . \",`Hidden` = $hidden, `StudentInput` = $student_input, `Date Last Modified` = NOW() , `EnterTotals` = $enter_totals \"\n . \"WHERE `Group Worksheet ID` = $gwid;\";\n\n db_query_exception($query);\n updateGradeBoundaries($grade_boundaries, $gwid);\n updateWorksheetTags($worksheet_tags, $gwid);\n updateWorksheetInputs($worksheet_inputs, $gwid);\n } catch (Exception $ex) {\n $message = \"There was an error saving the details for the worksheet.\";\n log_error($message . \" Exception: \" . $ex->getMessage(), \"requests/setWorksheetResult.php\", __LINE__);\n $array = array(\n \"result\" => FALSE,\n \"message\" => $message\n );\n echo json_encode($array);\n exit();\n }\n $response = array(\"result\" => TRUE);\n echo json_encode($response);\n exit();\n}",
"function\nsave_monthly_summary_for_timeslot($dbconn, $target_area, $language, $start_time, $target, $season,$start_date,$stop_date,$freeze)\n{\n\t$obs_query = query_for_detail($language, $season, $target_area, $start_time, $start_date, $stop_date, $freeze, 'T');\n\n\t$query = \"INSERT INTO saved_monthly_summaries\"\n\t\t.\" (target_area, language, start_time, target, month, score, freeze_date)\"\n\t\t.\" SELECT '$target_area','$language','$start_time',$target,'$start_date', round(avg(o),1) AS score, '$freeze'\"\n\t\t.\" FROM (SELECT \\\"date\\\", max(o) AS o FROM ($obs_query) AS o GROUP BY \\\"date\\\") AS d\";\n\n\t$result = pg_query($dbconn, $query);\n\tpg_free_result($result);\n\n\t$obs_query = query_for_detail($language, $season, $target_area, $start_time, $start_date, $stop_date, $freeze, 'F');\n\n\t$query = \"UPDATE saved_monthly_summaries SET out_score = o\"\n\t\t.\" FROM (SELECT round(avg(o),1) AS o\"\n\t\t.\" FROM (SELECT \\\"date\\\", max(o) AS o FROM ($obs_query) AS o GROUP BY \\\"date\\\") AS d) AS a\"\n\t\t.\" WHERE \\\"language\\\"='$language'\"\n\t\t.\" AND target_area='$target_area'\"\n\t\t.\" AND start_time = '$start_time'\"\n\t\t.\" AND month = '$start_date'\";\n\n\t$result = pg_query($dbconn, $query);\n\tpg_free_result($result);\n}",
"function insertLastYearGames() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n $all_games = \"/v1/schedule?startDate=2017-10-04&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO LastYear_Games VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // ignore games from all star weekend\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87) {\n continue;\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }",
"public function snapToSemester(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->semester()->startDate(),\n DatePoint::fromDate($this->endDate)->semester()->endDate(),\n $this->bounds\n );\n }",
"public static function updateBulkEmployees($shift,$date,$employees=\"\"){ \r\t\tif(is_gt_zero_num($shift) && isValidDate($date)){\r\t\t\t\t$search_arr = array(EMP_SFT_SHIFT=>$shift,EMP_SFT_DATE=>$date,SES_RESTAURANT=>$_SESSION[SES_RESTAURANT]); \r\t\t\t\t // check employees for updating \r\t\t\t\t if(is_not_empty($employees)){\r\t\t\t\t \t\t// split the employees string to array\r\t\t\t\t\t\t$emp_arr = explode(',',$employees); \r\t\t\t\t\t\t$emp_arr = array_filter($emp_arr);\r\t\t\t\t\t\t\r\t\t\t\t \t\t// get the previous records for the shift & date\r\t\t\t\t \t\t$info = self::readArray($search_arr);\r\t\t\t\t\t\t$new_emp = array();\r\t\t\t\t\t\t// assign each employee to emp arr \r\t\t\t\t\t\tforeach ($emp_arr as $emp){\r\t\t\t\t\t\t\t$new_emp[$emp] = $emp; //mk key and value same\r\t\t\t\t\t\t}\r\t\t\t\t\t\t$del_emp_shift = array();\r\t\t\t\t\t\tforeach($info as $key=>$val){\r\t\t\t\t\t\t\t// chk the employee in the list\r\t\t\t\t\t\t\tif(in_array($val[EMP_SFT_EMPLOYEE],$emp_arr)){\r\t\t\t\t\t\t\t\t //..if found remove from the new list\r\t\t\t\t\t\t\t unset($new_emp[$val[EMP_SFT_EMPLOYEE]]);\r\t\t\t\t\t\t\t}else{\r\t\t\t\t\t\t\t\t //..if not found add shift to delete qry\r\t\t\t\t\t\t\t\t\t$del_emp_shift[] = $key;\r\t\t\t\t\t\t\t}\r\t\t\t\t\t\t} \r\t\t\t\t\t\t//.. Insert New Employees\r\t\t\t\t\t\tif(is_not_empty($new_emp)){\r\t\t\t\t\t\t\t$prm = array();\r\t\t\t\t\t\t\tforeach($new_emp as $emp_id){\r\t\t\t\t\t\t\t\t$prm[]= '('.$emp_id.','.$shift.',\\''.$date.'\\',NOW())';\r\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\tif(is_not_empty($prm)){\r\t\t\t\t\t\t\t\t$ins_qry = 'INSERT INTO '.TBL_EMP_SHIFT_ASSIGNMENT.' ('.RET.''.EMP_SFT_EMPLOYEE.', '.EMP_SFT_SHIFT.', '.EMP_SFT_DATE.', '.EMP_SFT_START_DATE.') VALUES '.implode(',',$prm).';';\r\t\t\t\t\t\t\t\tmysql_query($ins_qry); \r\t\t\t\t\t\t\t} \r\t\t\t\t\t\t} \r\t\t\t\t\t //..delete the shifts \r\t\t\t\t\tif(is_not_empty($del_emp_shift)){\r\t\t\t\t\t\t$lst_to_del = implode(',',$del_emp_shift);\r\t\t\t\t\t\tself::delete(array(EMP_SFT_ID=>$lst_to_del)); \r\t\t\t\t\t}\r\t\t\t\t\t\t\r\t\t\t\t }else{\r\t\t\t\t \t// Now clear all records for shift & date\r\t\t\t\t \t self::delete($search_arr); \r\t\t\t\t }\r\t\t\t\t return OPERATION_SUCCESS;\r\t\t} \r\t\treturn OPERATION_FAIL; \r\t}",
"public function update(SchoolYearRequest $request)\n {\n $id = $request->id;\n $earlyYear = $request->early_year;\n $endYear = $request->end_year;\n $semester = $request->semester;\n $checkDuplicate = SchoolYear::where('early_year', $earlyYear)\n ->where('end_year', $endYear)\n ->where('semester', $semester)\n ->first();\n $checkOddOrEven = ($semester == 1) ? 'Ganjil' : 'Genap';\n\n /* check duplicate data */\n if (!is_null($checkDuplicate)) {\n return response()->json(['status' => 500, 'message' => 'Semester ' . $checkOddOrEven . ' pada tahun ajaran ini sudah ada']);\n }\n\n $update = SchoolYear::where('id', $id)->first()->update([\n 'early_year' => $earlyYear,\n 'end_year' => $endYear,\n 'semester' => $semester\n ]);\n\n if ($update) {\n $json = ['status' => 200, 'message' => 'Data berhasil diubah'];\n } else {\n $json = ['status' => 500, 'message' => 'Data gagal diubah'];\n }\n\n return response()->json($json);\n }",
"public function index($date = null)\n {\n $user = Auth::user();\n $workouts = $user->workouts;\n $currentWeek = $user->currentWeek;\n\n //will be checking against this to fix problem where refreshing takes users to previous or next weeks\n $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';\n\n if($date && !$pageWasRefreshed){ \n switch($date){\n case 'previous':\n $currentWeek--;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'next':\n $currentWeek++;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'current':\n $currentWeek = date('W');\n $user->update(['currentWeek' => $currentWeek]);\n break;\n }\n }\n\n //Use Currentweek to delegate weeks\n //Refactor this\n\n $dto = new DateTime();\n $ret['monday'] = $dto->setISODate(date('Y'), $currentWeek)->format('Y-m-d');\n $ret['sunday'] = $dto->modify('+6 days')->format('Y-m-d'); \n\n $monday = $ret['monday'];\n $sunday = $ret['sunday'];\n $weekof = $monday;\n \n $mondayWorkout = $this->findWorkout('Monday', $monday, $sunday, $workouts);\n $tuesdayWorkout = $this->findWorkout('Tuesday', $monday, $sunday, $workouts);\n $wednesdayWorkout = $this->findWorkout('Wednesday', $monday, $sunday, $workouts);\n $thursdayWorkout = $this->findWorkout('Thursday', $monday, $sunday, $workouts);\n $fridayWorkout = $this->findWorkout('Friday', $monday, $sunday, $workouts);\n // $saturdayWorkout = $this->findWorkout('Saturday', $monday, $sunday, $workouts);\n // $sundayWorkout = $this->findWorkout('Sunday', $monday, $sunday, $workouts);\n\n if($mondayWorkout){\n $mondayExercises = $mondayWorkout->exercises;\n }\n if($tuesdayWorkout){\n $tuesdayExercises = $tuesdayWorkout->exercises;\n }\n if($wednesdayWorkout){\n $wednesdayExercises = $wednesdayWorkout->exercises;\n }\n if($thursdayWorkout){\n $thursdayExercises = $thursdayWorkout->exercises;\n }\n if($fridayWorkout){\n $fridayExercises = $fridayWorkout->exercises;\n }\n // if($saturdayWorkout){\n // $saturdayExercises = $saturdayWorkout->exercises;\n // } \n // if($sundayWorkout){\n // $sundayExercises = $sundayWorkout->exercises;\n // }\n // \n \n //get the exercises of last week and current day for dashboard\n //for comparison week to week\n \n $lastweekDate = date('Y-m-d', strtotime('-1 week'));\n $lastweekWorkout = $workouts->where('week', $lastweekDate)->first();\n \n if($lastweekWorkout){\n $lastweekExercises = $lastweekWorkout->exercises;\n }\n\n return view('home', compact('weekof', \n 'lastweekWorkout', 'lastweekExercises',\n 'mondayExercises', 'mondayWorkout',\n 'tuesdayExercises', 'tuesdayWorkout',\n 'wednesdayExercises', 'wednesdayWorkout',\n 'thursdayExercises', 'thursdayWorkout',\n 'fridayExercises', 'fridayWorkout'//,\n // 'saturdayExercises', 'saturdayWorkout',\n // 'sundayExercises', 'sundayWorkout'\n ));\n }",
"function chunk($chunk_start_date, $chunk_end_date, $j)\n{\n\n global $db;\n $sharedFunctions = new Shared($db);\n\n $query = \"SELECT *\n\t\tFROM ibl_schedule\n\t\tWHERE Date BETWEEN '$chunk_start_date' AND '$chunk_end_date'\n\t\tORDER BY SchedID ASC\";\n $result = $db->sql_query($query);\n $num = $db->sql_numrows($result);\n\n $teamSeasonRecordsQuery = \"SELECT tid, leagueRecord FROM ibl_standings ORDER BY tid ASC;\";\n $teamSeasonRecordsResult = $db->sql_query($teamSeasonRecordsQuery);\n\n $arrayLastSimDates = $sharedFunctions->getLastSimDatesArray();\n $lastSimStartDate = date_create($arrayLastSimDates[\"Start Date\"]);\n $lastSimEndDate = date_create($arrayLastSimDates[\"End Date\"]);\n $projectedNextSimEndDate = date_add($lastSimEndDate, date_interval_create_from_date_string('7 days'));\n\n // override $projectedNextSimEndDate to account for the blank week at end of HEAT\n $currentSeasonEndingYear = $sharedFunctions->getCurrentSeasonEndingYear();\n $currentSeasonBeginningYear = $currentSeasonEndingYear - 1;\n if ($projectedNextSimEndDate >= date_create(\"$currentSeasonBeginningYear-10-23\") and $projectedNextSimEndDate < date_create(\"$currentSeasonBeginningYear-11-01\")) {\n $projectedNextSimEndDate = date_create(\"$currentSeasonBeginningYear-11-08\");\n }\n\n echo \"<table width=\\\"500\\\" cellpadding=\\\"6\\\" cellspacing=\\\"0\\\" border=\\\"1\\\" align=center>\";\n\n $i = 0;\n $z = 0;\n while ($i < $num) {\n $date = $db->sql_result($result, $i, \"Date\");\n $visitor = $db->sql_result($result, $i, \"Visitor\");\n $visitorScore = $db->sql_result($result, $i, \"VScore\");\n $home = $db->sql_result($result, $i, \"Home\");\n $homeScore = $db->sql_result($result, $i, \"HScore\");\n $boxid = $db->sql_result($result, $i, \"BoxID\");\n\n $visitorTeamname = $sharedFunctions->getTeamnameFromTid($visitor);\n $homeTeamname = $sharedFunctions->getTeamnameFromTid($home);\n $visitorRecord = $db->sql_result($teamSeasonRecordsResult, $visitor - 1, \"leagueRecord\");\n $homeRecord = $db->sql_result($teamSeasonRecordsResult, $home - 1, \"leagueRecord\");\n\n if (($i % 2) == 0) {\n $bgcolor = \"FFFFFF\";\n } else {\n $bgcolor = \"DDDDDD\";\n }\n\n if (($z % 2) == 0) {\n $bgcolor2 = \"0070C0\";\n } else {\n $bgcolor2 = \"C00000\";\n }\n\n if ($visitorScore == $homeScore and date_create($date) <= $projectedNextSimEndDate) {\n $bgcolor = \"DDDD00\";\n }\n\n if ($visitorScore > $homeScore) {\n $visitorTeamname = '<b>' . $visitorTeamname . '</b>';\n $visitorRecord = '<b>' . $visitorRecord . '</b>';\n $visitorScore = '<b>' . $visitorScore . '</b>';\n } elseif ($homeScore > $visitorScore) {\n $homeTeamname = '<b>' . $homeTeamname . '</b>';\n $homeRecord = '<b>' . $homeRecord . '</b>';\n $homeScore = '<b>' . $homeScore . '</b>';\n }\n\n if ($date == $datebase) {\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n } else {\n echo \"<tr>\n\t\t\t\t<td></td><td></td><td></td><td></td><td></td><td></td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor2>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Date</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Visitor</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Home</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Box Score</td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n $datebase = $date;\n $z++;\n }\n $i++;\n }\n echo \"</table>\";\n //return array($homewin, $homeloss, $visitorwin, $visitorloss);\n}",
"public function manifest_semesters()\n {\n // get all imported semesters\n $imported_semesters = $this->get_all_imported_type('semester');\n\n // iterate through rows of semester import table\n foreach ($imported_semesters as $sem)\n {\n // arrange semester input data\n list($year, $name) = $this->parse_term_code($sem->term_code);\n\n list($campus, $is_starting) = $this->parse_code_value($sem->code_value);\n\n if ( ! $year || ! $name || ! $campus)\n continue;\n\n // @TODO - difference in dates seems a little funky but follows existing system\n $grades_due_at = $campus == 'LAW' \n ? $this->parse_date($sem->calendar_date) + (46 * 24 * 60 * 60) \n : $this->parse_date($sem->calendar_date) + (21 * 24 * 60 * 60);\n\n // update or create this semester\n $semester = \\enrol_oes\\model\\semester::update_or_create([\n 'code' => $sem->term_code,\n 'year' => $year,\n 'name' => $name,\n 'campus' => $campus,\n 'session_key' => (string) $sem->session,\n 'classes_start_at' => $this->parse_date($sem->calendar_date),\n 'grades_due_at' => $grades_due_at,\n ]);\n\n // construct this semester's unique \n // $semester_cache_key = $sem->term_code . '-' . $sem->session . '-' . $campus;\n\n $semester_cache_key = $this->get_semester_cache_key([\n 'term_code' => $sem->term_code,\n 'session_key' => $sem->session,\n 'campus' => $campus\n ]);\n\n // cache this semester for later\n $this->manifested_semesters[$semester_cache_key] = $semester;\n }\n\n $this->oes_driver->enrol_plugin->trace->output('Semesters manifested.');\n }",
"public function update() {\n $hasduedate = isset($this->mumie->duedate) && $this->mumie->duedate > 0;\n if (!$this->event && $hasduedate) {\n $this->create_calendar_event(\n self::EVENT_TYPE,\n $this->mumie->duedate\n );\n } else if ($this->event && $hasduedate) {\n $update = new \\stdClass();\n $update->name = $this->title;\n $update->timestart = $this->mumie->duedate;\n $this->event->update($update, false);\n } else if ($this->event && !$hasduedate) {\n $this->event->delete();\n }\n }",
"public function update(Request $request, Shift $shift)\n {\n $shift->update(request()->validate([\n 'course_id' => 'required',\n 'day' => 'required',\n 'shift1' => 'required',\n 'shift2' => 'required',\n ]));\n\n return redirect('/shifts')->with('success','Shift updated successfully');\n }",
"function draw_calendar($conn, $month,$year,$alat){\n\n /* draw table */\n $calendar = '<table cellpadding=\"0\" cellspacing=\"0\" class=\"calendar\">';\n\n /* table headings */\n $headings = array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');\n $calendar.= '<tr class=\"calendar-row\"><td class=\"calendar-day-head\">'.implode('</td><td class=\"calendar-day-head\">',$headings).'</td></tr>';\n\n /* days and weeks vars now ... */\n $running_day = date('w',mktime(0,0,0,$month,1,$year));\n $days_in_month = date('t',mktime(0,0,0,$month,1,$year));\n $days_in_this_week = 1;\n $day_counter = 0;\n\n $booked[] = $days_in_month;\n for($i = 0; $i<=$days_in_month; $i++){\n $booked[$i] = '';\n }\n\n $now = $month + $year *12;\n\n //PENGECEKKAN STATUS UNTUK KEPENTINGAN KALENDER\n //booking\n $result = mysqli_query($conn,\"SELECT * FROM booking NATURAL JOIN alat where nama_alat = '$alat' and ((year(tanggal_rencana_peminjaman)*12 + month(tanggal_rencana_peminjaman)) <= '$now') and ((year(tanggal_rencana_pengembalian)*12 + month(tanggal_rencana_pengembalian)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,2);\n }\n mysqli_free_result($result);\n\n //peminjaman\n $result = mysqli_query($conn,\"SELECT * FROM peminjaman NATURAL JOIN alat where nama_alat = '$alat' and tanggal_pengembalian IS NULL and ((year(tanggal_peminjaman)*12 + month(tanggal_peminjaman)) <= '$now') and ((year(tanggal_rencana_pengembalian)*12 + month(tanggal_rencana_pengembalian)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,1);\n }\n mysqli_free_result($result);\n\n //perbaikan\n $result = mysqli_query($conn,\"SELECT * FROM perbaikan NATURAL JOIN alat where nama_alat = '$alat' and tanggal_selesai_perbaikan IS NULL and ((year(tanggal_mulai_perbaikan)*12 + month(tanggal_mulai_perbaikan)) <= '$now') and ((year(estimasi_selesai_perbaikan)*12 + month(estimasi_selesai_perbaikan)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,3);\n }\n mysqli_free_result($result);\n\n //END OF PENGECEKKAN STATUS\n\n /* row for week one */\n $calendar.= '<tr class=\"calendar-row\">';\n\n /* print \"blank\" days until the first of the current week */\n for($x = 0; $x < $running_day; $x++):\n $calendar.= '<td class=\"calendar-day-np\"> </td>';\n $days_in_this_week++;\n endfor;\n\n /* keep going with days.... */\n for($list_day = 1; $list_day <= $days_in_month; $list_day++):\n\n $calendar.= '<td class=\"calendar-day\">';\n\n /* add in the day number */\n $calendar.= '<div class=\"day-number\">'.$list_day.'</div>';\n\n /** QUERY THE DATABASE FOR AN ENTRY FOR THIS DAY !! IF MATCHES FOUND, PRINT THEM !! **/\n $calendar.= $booked[$list_day-1];\n\n $calendar.= '</td>';\n if($running_day == 6):\n $calendar.= '</tr>';\n if(($day_counter+1) != $days_in_month):\n $calendar.= '<tr class=\"calendar-row\">';\n endif;\n $running_day = -1;\n $days_in_this_week = 0;\n endif;\n $days_in_this_week++; $running_day++; $day_counter++;\n\n endfor;\n\n /* finish the rest of the days in the week */\n if($days_in_this_week < 8):\n for($x = 1; $x <= (8 - $days_in_this_week); $x++):\n $calendar.= '<td class=\"calendar-day-np\"> </td>';\n endfor;\n endif;\n\n /* final row */\n $calendar.= '</tr>';\n\n /* end the table */\n $calendar.= '</table>';\n\n\n /* all done, return result */\n return $calendar;\n}",
"public function setWindow($window)\n {\n $this->window = $window;\n }",
"function calendar_week_mod($num)\n {\n }",
"public function save($data)\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\t$filter = JFilterInput::getInstance();\n\t\t\n\t\t$db = JFactory::getDbo();\n\t $query = $db->getQuery(true);\n\t\t\n\t\t$calendarDays = $this->getCalendarDays($data['calendaroflessons']);\n\t\t$checkedDays = $calendarDays['checkedays'];\n\t\t$unCheckedDays = $calendarDays['uncheckedays'];\n\t\t\n\t\t//Save the end date in sql format\n\t\tuksort($checkedDays, array($this, \"date_compare\"));\n\t\t$data['end_date'] = date(\"Y-m-d\",strtotime(key( array_slice( $checkedDays, -1, 1, TRUE ))));\n\t\t\n\t\t//Actual hours for week Convert in seconds\n\t\t$hoursForWeek = strtotime('1970-01-01 '.$data['hours_for_week'].' UTC');\n\t\t//Actual days for week\n\t\t$daysForWeek = $data['days_for_week'];\n\t\t\n\t\t//Total duration we can't change during the course \n\t\t$duration = $data[\"duration_in_hours\"] * 60 * 60;//Convert duration from hours to seconds\n\n\t\t//Re-Calculate hours for week and days for week\n\t\t$totalDaysAndHoursForWeek = $this->getTotalDaysAndHoursForWeek($data[\"weeklyfrequency\"]);\n\t\t//We check this for brief course like one or two days\n\t\tif ($totalDaysAndHoursForWeek['totalHoursForWeek'] > $duration)\n\t\t{\n\t\t\t$this->setError('COM_COOLTOURAMAN_HOURS_GT_TO_DURATION_ERROR');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Save the calculate hours for week\n\t\t$data['hours_for_week'] = $totalDaysAndHoursForWeek['totalHoursForWeek'];\n\t\t//Save the calculate days for week\n\t\t$data['days_for_week'] = implode(',', array_keys($totalDaysAndHoursForWeek['totalDaysForWeek']));\n\t\n\t\t//Rebuild the new calendar array; WARNING: (Itsn't possible when the course started) \t\t\n\t\tif (($data[\"start_date\"] !== $input->get('start_date_beforetosave')) ||\n\t\t\t((int)$data[\"duration_in_hours\"] !== (int)$input->get('duration_in_hours_beforetosave'))\n\t\t )\n\t\t{\n\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t}\n\t\telse if ($hoursForWeek !== $data['hours_for_week'] || $daysForWeek !== $data['days_for_week'])\n\t\t{\n\t\t\t\n\t\t\t$timeZone = new DateTimeZone(JFactory::getConfig()->get('offset'));\n\t\t\t$now = JFactory::getDate('now', $timeZone);\n\t\t\t$currentTime = $now->toUnix();\n\t\t\t$timesStamp = $this->stringToDate(array_keys($checkedDays));\n\t\t\t$firstCourseDay = min($timesStamp);\n\t\t\t$lastCourseDay = max($timesStamp);\n\t\t\t$closestTimestamp = $this->closestNumber($timesStamp, $currentTime); //find closest date\n\t\t\t$closestDate = array_search($closestTimestamp, $timesStamp);\n\t\t\t$spentDuration = 0;\n\t\t\t$calendarToSave = $this->getCalendarPart($data['calendaroflessons'], $closestDate, $spentDuration);\n\t\t\t$remainingTime = 0;\n\t\t\tif ($duration > $spentDuration)\n\t\t\t\t$remainingTime = ($duration - $spentDuration)/60/60;\n\t\t\t\n\t\t\tif ($remainingTime > 0)\n\t\t\t{\t\n\t\t\t\t//Course has yet to start make a new calendar\n\t\t\t\tif ($firstCourseDay > $currentTime)\n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t\t\telse if ($currentTime >= $firstCourseDay && $currentTime <= $lastCourseDay) //merge old calendar part whit new one \n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $remainingTime, $now->format('d-m-Y', true), $calendarToSave);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($firstCourseDay > $currentTime)\n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t\t\telse\n\t\t\t\t\t$data['calendaroflessons'] = $calendarToSave;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($calendarDays['total_checked_duration'] != $duration)\n\t\t\t{\n\t\t\t\t$msg = '';\n\t\t\t\tif ($calendarDays['total_checked_duration'] > $duration)\n\t\t\t\t\t$msg = JText::_('COM_COOLTOURAMAN_DAYS_GT_TO_DURATION_ERROR', true);\n\t\t\t\telseif ($calendarDays['total_checked_duration'] < $duration)\n\t\t\t\t\t$msg = JText::_('COM_COOLTOURAMAN_DAYS_LT_TO_DURATION_ERROR', true);\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->setError($msg);\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Convert hours for week in human readble\n\t\t$data['hours_for_week'] = gmdate(\"H:i\", $data['hours_for_week']); \n\n\t\tif (isset($data['created_by_alias']))\n\t\t{\n\t\t\t$data['created_by_alias'] = $filter->clean($data['created_by_alias'], 'TRIM');\n\t\t}\n\t\t\n\t\tif ($data[\"teacher_id\"] !== $input->get('teacher_id_beforetosave'))\n\t\t{\t\n\t\t\t//Delete actual relate from teacher to the course\n\t\t\t$conditions = array(\n\t\t\t\t$db->quoteName('course_id') . ' = '.$input->getInt('id'), \n\t\t\t\t$db->quoteName('teacher_id') . ' = ' . $input->getInt('teacher_id_beforetosave')\n\t\t\t);\n\t\t\t$query->delete($db->quoteName('#__cooltouraman_course_teacher_relations'));\n\t\t\t$query->where($conditions);\n\t\t\t \n\t\t\techo $query->__toString();\n\t\t\t$db->setQuery($query);\n\t\t\t \n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//Add new relate from teacher to the course\n\t\t\t$columns = array('course_id', 'teacher_id');\n\t\t\t$values = array($input->getInt('id'), (int)$data[\"teacher_id\"]);\n\t\t\t$query\n\t\t\t\t->insert($db->quoteName('#__cooltouraman_course_teacher_relations'))\n\t\t\t\t->columns($db->quoteName($columns))\n\t\t\t\t->values(implode(',', $values));\n\t\t\t\t\n\t\t\t$db->setQuery($query);\n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query->clear();\n\t\t//Join course to the students; First delete all relations;\n\t\t$conditions = array(\n\t\t\t$db->quoteName('course_id') . ' = '.$input->getInt('id')\n\t\t);\n\t\t$query->delete($db->quoteName('#__cooltouraman_course_student_relations'));\n\t\t$query->where($conditions);\n\t\t$db->setQuery($query);\n\t\t\n\t\tif(!$db->execute())\n\t\t{\n\t\t\t$this->setError($db->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t$query->clear();\n\t\t// Second relate each student to the course\n\t\t$values = array();\n\t\tforeach($data['attendanceregister']['students'] as $i => $student)\n\t\t\tif (is_numeric($student['id']))\n\t\t\t\t$values[] = $input->getInt('id').','.(int)$student['id'];\n\t\tif (!empty($values))\n\t\t{\n\t\t\t$columns = array('course_id', 'student_id');\n\t\t\t$query\n\t\t\t\t->insert($db->quoteName('#__cooltouraman_course_student_relations'))\n\t\t\t\t->columns($db->quoteName($columns))\n\t\t\t\t->values($values);\n\t\t\t\t\n\t\t\t$db->setQuery($query);\n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Alter the title for save as copy\n\t\tif ($input->get('task') == 'save2copy')\n\t\t{\n\t\t\t$origTable = clone $this->getTable();\n\t\t\t$origTable->load($input->getInt('id'));\n\n\t\t\tif ($data['title'] == $origTable->title)\n\t\t\t{\n\t\t\t\tlist($title, $alias) = $this->generateNewTitle($data['catid'], 'copy', $data['title']);\n\t\t\t\t$data['title'] = $title;\n\t\t\t}\n\t\t\t\n\t\t\t$data['state'] = 0;\n\n\t\t}\n\t\t\n\t\tif (parent::save($data))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}"
]
| [
"0.54173446",
"0.53403986",
"0.5276634",
"0.52528405",
"0.5057836",
"0.504292",
"0.49953982",
"0.4977624",
"0.49515852",
"0.49476478",
"0.4934838",
"0.48512033",
"0.48436323",
"0.48073518",
"0.47486657",
"0.4690914",
"0.4671974",
"0.4659962",
"0.46387848",
"0.46379924",
"0.46104428",
"0.46083206",
"0.45919278",
"0.45737085",
"0.454121",
"0.45406863",
"0.4540405",
"0.453843",
"0.4536801",
"0.45331722"
]
| 0.55120105 | 0 |
Return an array containing the status of any modified files in the repository. | public static function getStatus($path) {
if (!file_exists($path)) {
throw new Exception(
"Unable to get git status of $path. Path does not exist.");
}
if (!is_dir($path)) {
throw new Exception(
"Unable to get git status of $path. Path is not a directory.");
}
if (!self::isRepo($path)) {
throw new Exception(
"Unable to get git status of $path. Path is not a git repository.");
}
$origCwd = getcwd();
chdir($path);
$output = array();
exec("git status --porcelain", $output);
if (count($output) === 0) {
return $output;
}
$files = array();
foreach ($output AS $status) {
$flag = substr($status, 0, 2);
$file = trim(substr($status, 2));
$idx = null;
$fileInfo = null;
switch ($flag) {
case ' M': // Modified, not updated
$idx = 'changed';
$fileInfo = $file;
break;
case 'A ': // New file
$idx = 'new';
$fileInfo = $file;
break;
case 'D ': // Deleted file
$idx = 'removed';
$fileInfo = $file;
break;
case 'M ': // Modified, updated
$idx = 'modified';
$fileInfo = $file;
break;
case 'R ': // Renamed
$idx = 'moved';
$fileInfo = array_map(function ($a) {
return trim($a);
}, explode('->', $file));
break;
case '??': // Untracked
$idx = 'untracked';
$fileInfo = $file;
break;
default:
assert("false /*Unrecognized git status flag $flag*/");
}
if ($idx !== null) {
if (!isset($files[$idx])) {
$files[$idx] = array();
}
$files[$idx][] = $fileInfo;
}
}
chdir($origCwd);
return $files;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getFiles()\n {\n $process = new Process('git diff --cached --name-status --diff-filter=ACMR');\n $process->run();\n\n if ($process->isSuccessful()) {\n return \\array_filter(\\explode(\"\\n\", $process->getOutput()));\n }\n\n return [];\n }",
"public function analyzeModifications()\n {\n $this->logManager->logMessage(lang('Revision.analyzeModifications'));\n\n foreach ($this->files as $file) {\n // Compare the previous snapshot with the new snapshot from update.\n $oldCopy = $this->workspace . 'oldSnapshot' . \\DIRECTORY_SEPARATOR . $file['destination'];\n $project = $this->config->rootPath . $file['destination'];\n $doCopy = true;\n\n // If hashes are different, this can be new or modified.\n if (! FileManager::areIdenticalFiles($oldCopy, $file['origin'])\n || ($this->config->fallThroughToProject && ! FileManager::areIdenticalFiles($project, $file['origin']))\n ) {\n $newCopy = $this->workspace . 'newSnapshot' . \\DIRECTORY_SEPARATOR . $file['destination'];\n\n try {\n if (! is_file($oldCopy) || ! is_file($project)) {\n $this->fileManager->createdFiles[] = $file['destination']; // @codeCoverageIgnore\n } elseif (is_file($file['origin'])) {\n $this->fileManager->modifiedFiles[] = $file['destination'];\n } else {\n // @codeCoverageIgnoreStart\n $this->fileManager->deletedFiles[] = $file['destination'];\n $doCopy = false;\n // @codeCoverageIgnoreEnd\n }\n\n if ($doCopy) {\n $this->filesystem->copy($file['origin'], $newCopy, true);\n }\n\n // @codeCoverageIgnoreStart\n } catch (IOExceptionInterface $e) {\n $this->logManager->logMessage($e->getMessage(), 'error');\n // @codeCoverageIgnoreEnd\n }\n }\n }\n\n // Log the update results\n $cc = \\count($this->fileManager->createdFiles);\n $mc = \\count($this->fileManager->modifiedFiles);\n $dc = \\count($this->fileManager->deletedFiles);\n\n $cs = 1 === $cc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n $ms = 1 === $mc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n $ds = 1 === $dc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n\n $this->logManager->logMessage([\n lang('Revision.createdFilesAfterUpdate', [$cc, $cs]),\n lang('Revision.modifiedFilesAfterUpdate', [$mc, $ms]),\n lang('Revision.deletedFilesAfterUpdate', [$dc, $ds]),\n ]);\n }",
"protected function getCreatedFilesWorldWritableStatus() {}",
"public function getFiles()\n\t{\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}",
"protected function getFilesToCheck(Repository $repository): array\n {\n return $repository->getIndexOperator()->getStagedFiles();\n }",
"public function getFilesAdded(): array\n {\n return $this->files_added;\n }",
"public function getFiles() {\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->branch->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}",
"public function checkStatus() {\r\n\t\t$tmpArray = [1, 1]; // INIT;\r\n\t\t\r\n\t\t$tmpArray = [ $this->is_updated[0], $this->is_updated[1] ];\r\n\t\treturn $tmpArray;\r\n\t}",
"public function git_working_branch_status()\n\t{\n\t\t$remotes = $this->git_remotes();\n\n\t\t$status = array();\n\n\t\tforeach( $remotes as $remote )\n\t\t{\n\t\t\texec( __DIR__ . \"/git-log {$this->theme_dir} {$remote} '>'\", $ahead );\n\t\t\texec( __DIR__ . \"/git-log {$this->theme_dir} {$remote} '<'\", $behind );\n\n\t\t\t$status[ $remote ]['ahead'] = (int) $ahead[0];\n\t\t\t$status[ $remote ]['behind'] = (int) $behind[0];\n\t\t}//end foreach\n\n\t\treturn $status;\n\t}",
"public function localRepository()\r\n\t{\r\n\t\t$scanned = array_diff(scandir($this->migrationFiles), array('.', '..'));\r\n\t\treturn $scanned;\r\n\t}",
"protected function detectChangedFiles(array $pathAndFilenames)\n {\n $changedFiles = array();\n foreach ($pathAndFilenames as $pathAndFilename) {\n $status = $this->changeDetectionStrategy->getFileStatus($pathAndFilename);\n if ($status !== \\TYPO3\\Flow\\Monitor\\ChangeDetectionStrategy\\ChangeDetectionStrategyInterface::STATUS_UNCHANGED) {\n $changedFiles[$pathAndFilename] = $status;\n }\n }\n return $changedFiles;\n }",
"public function getModified($file);",
"function get_changes($path, $to, $from = null) {\n $changes = [];\n $currentPath = getcwd();\n chdir($path);\n\n if ($from == null) {\n $shellOutput = shell_exec('git log --pretty=oneline ' . $to);\n } else {\n $shellOutput = shell_exec('git log --pretty=oneline ' . $from . '...' . $to);\n }\n\n $lines = preg_split('/\\R/', trim($shellOutput));\n foreach ($lines as $line) {\n if (null != $line) {\n $changes[substr($line, 0, 40)] = trim(substr($line, 40, strlen($line)));\n } else {\n echo 'Could not get changes of repository ' . $path . PHP_EOL;\n }\n }\n\n chdir($currentPath);\n\n return $changes;\n}",
"public function detectChanges()\n {\n return [];\n }",
"public static function getStatuses(): array;",
"public function lastModified(){\n if( $this->modifications ){\n return end( $this->modifications );\n }\n }",
"public function getFiles()\n {\n return isset($this->source['files']) && is_array($this->source['files']) ? $this->source['files'] : [];\n }",
"public function getChangedFiles( $baseDir, $from, $to )\r\n {\r\n $patchFile = 'patch-' . str_random( 8 ) . '.tmp';\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n\r\n $baseDir = str_replace( '/', DIRECTORY_SEPARATOR, trim( $baseDir ) );\r\n\r\n if ( DIRECTORY_SEPARATOR !== $baseDir[ strlen( $baseDir ) - 1 ] )\r\n {\r\n $baseDir .= DIRECTORY_SEPARATOR;\r\n }\r\n\r\n try\r\n {\r\n $result = [ 'added' => [ ], 'modified' => [ ], 'deleted' => [ ] ];\r\n\r\n $cmd = 'git diff --name-status --patch';\r\n\r\n $cmd = $cmd . \" $from $to\";\r\n $cmd = $cmd . ' > ' . $patchFile;\r\n $out = [ ];\r\n $ret = NULL;\r\n\r\n exec( $cmd, $out, $ret );\r\n\r\n $output = file_get_contents( $patchFile );\r\n\r\n $files = explode( \"\\n\", $output );\r\n\r\n foreach ( $files as $file )\r\n {\r\n if ( 0 === strlen( trim( $file ) ) )\r\n {\r\n continue;\r\n }\r\n\r\n list( $type, $path ) = explode( \"\\t\", $file );\r\n\r\n switch ( trim( $type ) )\r\n {\r\n case 'A':\r\n $result[ 'added' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'M':\r\n $result[ 'modified' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'D':\r\n $result[ 'deleted' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'C':\r\n case 'R':\r\n list( $from, $to ) = explode( \"\\t\", $path );\r\n $result[ 'deleted' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $from );\r\n $result[ 'added' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $to );\r\n break;\r\n default:\r\n syslog( LOG_ALERT, 'Unknown Value - Type: ' . $type . ' - Path: ' . $path );\r\n break;\r\n }\r\n }\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n\r\n return $result;\r\n }\r\n catch ( Exception $e )\r\n {\r\n echo $e->getMessage() . PHP_EOL;\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n }\r\n\r\n return NULL;\r\n }",
"public function getFilestatus()\n {\n return $this->filestatus;\n }",
"function listLastupdate() {\n //$fileList = glob(\"../blogs/*.md\");\n $fileList = glob(\"blogs/*.md\");\n array_multisort(\n array_map( 'filemtime', $fileList ),\n SORT_NUMERIC,\n SORT_DESC,\n $fileList\n );\n\n $resultList = array();\n\n foreach ($fileList as $filename) {\n $fp = fopen($filename, \"r\");\n $content = fread($fp, filesize($filename));\n fclose($fp);\n\n $contentSplit = explode('---', $content);\n $headers = Yaml::parse($contentSplit[0]);\n\n if( $headers['published'] == 'true' ) {\n $result = new stdClass;\n $result->title = $headers['title'];\n $result->content = Markdown::defaultTransform($contentSplit[1]);;\n $resultList[$filename] = $result;\n }\n }\n return $resultList;\n}",
"function GetUpdatesFilesList($updates_dir)\n\t{\n\t\t$updates = array(); \n\t\t\n\t\t$d = dir(\"$updates_dir\");\n\t\twhile (false !== ($entry = $d->read())) {\n\t\t\tif (preg_match('/^update-(.+?) (\\d+)(.*?)\\.php/', $entry, $match)) {\n\t\t\t\t$item = array (\n\t\t\t\t\t'filename' => $entry,\n\t\t\t\t\t'type' => strtoupper($match[1]),\n\t\t\t\t\t'rev_num' => (int)$match[2],\n\t\t\t\t\t'desc' => trim($match[3]),\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$updates[$item['rev_num'].'-'.$item['type']] = $item;\n\t\t }\n\t\t}\n\t\t$d->close();\n\t\t\n\t\treturn $updates;\n\t}",
"public function getFiles() : array\n {\n return $this->files;\n }",
"public function getFiles(): array\n {\n return $this->files;\n }",
"function getfileModifiedDates($fileArray){\n $imageDatesArray = [];\n date_default_timezone_set('America/Sao_Paulo');\n foreach($fileArray as $file){\n $imageDatesArray[] = date(\"d/m/Y H:i:s\", strtotime($file[\"modifiedTime\"]));\n }\n return $imageDatesArray;\n}",
"function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}",
"function updatedb_status() {\n $return = array();\n\n $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE);\n foreach ($modules as $module => $schema_version) {\n $updates = drupal_get_schema_versions($module);\n // Skip incompatible module updates completely, otherwise test schema versions.\n if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) {\n // module_invoke returns NULL for nonexisting hooks, so if no updates\n // are removed, it will == 0.\n $last_removed = module_invoke($module, 'update_last_removed');\n if ($schema_version < $last_removed) {\n drush_set_error('PROVISION_DRUPAL_UPDATE_FAILED', dt( $module .' module can not be updated. Its schema version is '. $schema_version .'. Updates up to and including '. $last_removed .' have been removed in this release. In order to update '. $module .' module, you will first <a href=\"http://drupal.org/upgrade\">need to upgrade</a> to the last version in which these updates were available.'));\n continue;\n }\n\n $updates = drupal_map_assoc($updates);\n\n // Record the starting update number for each module.\n foreach (array_keys($updates) as $update) {\n if ($update > $schema_version) {\n $start[$module] = $update;\n break;\n }\n }\n if (isset($start['system'])) {\n // Ensure system module's updates run first.\n $start = array('system' => $start['system']) + $start;\n }\n\n // Record any pending updates. Used for confirmation prompt.\n foreach (array_keys($updates) as $update) {\n if ($update > $schema_version) {\n if (class_exists('ReflectionFunction')) {\n // The description for an update comes from its Doxygen.\n $func = new ReflectionFunction($module. '_update_'. $update);\n $description = trim(str_replace(array(\"\\n\", '*', '/'), '', $func->getDocComment()));\n }\n if (empty($description)) {\n $description = dt('description not available');\n }\n\n $return[] = array('module' => ucfirst($module), 'update_id' => $update, 'description' => $description);\n }\n }\n }\n }\n\n return array($return, $start);\n}",
"public function getContent_statusArray() {\n\t\tif (!$this->_content_statusArray) {\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_PUBLISHED] = _CO_CONTENT_CONTENT_STATUS_PUBLISHED;\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_PENDING] = _CO_CONTENT_CONTENT_STATUS_PENDING;\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_DRAFT] = _CO_CONTENT_CONTENT_STATUS_DRAFT;\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_PRIVATE] = _CO_CONTENT_CONTENT_STATUS_PRIVATE;\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_EXPIRED] = _CO_CONTENT_CONTENT_STATUS_EXPIRED;\n\t\t}\n\t\treturn $this->_content_statusArray;\n\t}",
"public function pendingMigrations()\r\n\t{\r\n\t\t$outstanding = [];\r\n\t\t$this->ensureMigrationBinExist();\r\n\t\tforeach ($this->localRepository() as $file) {\r\n\t\t\t$line = $this->removeDotPhp($file);\r\n\r\n\t\t\t// Once we grab all of the migration files for the path, we will compare them\r\n\t\t\t// against the migrations that have already been run for this package then\r\n\t\t\t// run each of the outstanding migrations against a database connection.\r\n\t\t\t$result = $this->repository->getRan();\r\n\t\t\tif (!in_array($line, $result)) {\r\n\t\t\t\t$outstanding[] = $file;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $outstanding;\r\n\t}",
"public function statuses(): array\n {\n $json = $this->parent->performAPICallWithJsonResponse('get', 'artwork/statuses');\n return DataParser::parseDataArray($json, ArtworkStatus::class);\n }",
"public function updateGitHooks()\n {\n $tasks = [];\n $hooks = ['pre-commit'];\n \n foreach($hooks as $hook) {\n $tasks += $this->getAppendingTasks($hook);\n }\n\n return $this->collectionBuilder()->addTaskList($tasks);\n }"
]
| [
"0.6773189",
"0.64256406",
"0.60155654",
"0.59181017",
"0.5909338",
"0.59080946",
"0.59034914",
"0.5889677",
"0.58518493",
"0.5841763",
"0.5822169",
"0.58087367",
"0.5768888",
"0.57652396",
"0.5688381",
"0.56595325",
"0.5617935",
"0.5617297",
"0.55780476",
"0.5576914",
"0.5528347",
"0.5527328",
"0.55249834",
"0.5489283",
"0.5483906",
"0.5473576",
"0.54612356",
"0.5458083",
"0.5451867",
"0.5449823"
]
| 0.6887717 | 0 |
Initialize the submodules of the repo at the specified path. | public static function initSubmodules($path) {
$oldDir = getcwd();
chdir($path);
passthru(self::INIT_SUBMODULES_CMD);
chdir($oldDir);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function git_init_submodules($path) {\n\tGitUtil::initSubmodules($path);\n}",
"function git_update_submodules($path) {\n\t$status = GitUtil::updateExternals($path);\n}",
"static function loadModules($path) {\n // Prepare the iterator\n $core = new RecursiveDirectoryIterator($_SERVER['DOCUMENT_ROOT'] . $path);\n $iterator = new RecursiveIteratorIterator($core);\n $modules = new RegexIterator($iterator, '/^.+\\.php$/i', RecursiveRegexIterator::GET_MATCH);\n // Load all modules in the directory structure recursively\n foreach ($modules as $component => $filename) {\n require_once $component;\n }\n }",
"public function load_modules() {\n\t\tforeach ( $this->modules as $module_name ) {\n\t\t\t$module = $this->build( $module_name );\n\t\t\tif ( $module !== null ) {\n\t\t\t\t$module->init();\n\t\t\t}\n\t\t}\n\t}",
"public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}",
"function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}",
"function __construct ($path)\n {\n $this->basepath = $path ;\n // pull the module and package names out of the path\n $this->moduleName = basename ( $path, \"/\" ) ; // just in case there are any trailing /\n $this->packageName = basename ( dirname ( dirname ( $path ) ) ) ; // simpler than explode :)\n require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;\n $mb = new ModuleBuilder ( ) ;\n $this->packageKey = $mb->getPackageKey ( $this->packageName ) ;\n \n $this->load () ;\n \n }",
"public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}",
"final function __construct($path)\n\t{\n\t\t$this->path = $path;\n\t\t$this->mods = array();\n\t\t$this->init();\n\t}",
"public function init($path);",
"protected function init()\n {\n $files = $this->fs->findFile('', 'init', 'php', true, true);\n\n if (!$files) {\n return;\n }\n\n $files = array_reverse($files);\n\n $di = $this->getDI();\n\n foreach ($files as $file) {\n include $file;\n }\n\n }",
"public function initExtensions(): void\n {\n $modules = $this->config->__toArray();\n\n if (empty($modules)) {\n return;\n }\n\n $templatesPaths = [];\n $langPaths = [];\n\n $extensionsDir = $this->extensionsConfig['path'];\n\n foreach ($modules as $index => $config) {\n if (!$config['enabled'] || isset($this->loadedExtensions[$index]['init'])) {\n continue;\n }\n\n $path = $extensionsDir . File::fillEndSep($config['dir']);\n\n\n if (!empty($config['paths']['locales'])) {\n $langPaths[] = $path . $config['paths']['locales'] . '/';\n }\n\n if (!empty($config['paths']['templates'])) {\n $templatesPaths[] = $path . $config['paths']['templates'] . '/';\n }\n\n $this->loadedExtensions[$index]['init'] = true;\n }\n\n // Add localization paths\n if (!empty($langPaths)) {\n /**\n * @var StorageInterface $langStorage\n */\n $langStorage = $this->di->get(Lang::class)->getStorage();\n foreach ($langPaths as $path) {\n $langStorage->addPath($path);\n }\n }\n\n // Add Templates paths\n if (!empty($templatesPaths)) {\n $templateStorage = $this->di->get(Storage::class);\n $paths = $templateStorage->getPaths();\n $mainPath = array_shift($paths);\n // main path\n $pathsResult = [];\n $pathsResult[] = $mainPath;\n $pathsResult = array_merge($pathsResult, $templatesPaths, $paths);\n $templateStorage->setPaths($pathsResult);\n }\n }",
"public function init() {\n\t\t$this->getFrontController()->addModuleDirectory(APPLICATION_PATH . '/modules');\n\n\t\t// initialize navigation\n\t\t$this->_initNavigation();\n\t}",
"public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }",
"public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n Yii::import('cms_core.components.CmsModule');\n CmsModule::initCore($this); \n CmsModule::loadModule('cms_content');\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'cms_gallery.models.*',\n\t\t\t'cms_gallery.components.*',\n\t\t));\n\t}",
"function xh_initModules()\r\n\t{\r\n\t}",
"public static function initModuleLoading(){\n\n\t}",
"public function init_modules() {\n\t\t\t$this->dynamic_css = $this->get_core()->init_module( 'cherry-dynamic-css' );\n\n\t\t\tif ( is_admin() ) {\n\t\t\t\t$this->get_core()->init_module( 'cherry5-insert-shortcode', array() );\n\t\t\t}\n\t\t}",
"function module_init () {\n global $core_stylesheets;\n global $core_scripts;\n \n foreach (module_list() as $module) {\n $style_func = $module . '_stylesheets';\n if (function_exists($style_func)) {\n $stylesheets = call_user_func($style_func);\n foreach ($stylesheets as $sheet) {\n $core_stylesheets[] = \"include/$module/$sheet\";\n }\n }\n $style_func = $module . '_scripts';\n if (function_exists($style_func)) {\n $scripts = call_user_func($scripts_func);\n foreach ($scripts as $script) {\n $core_scripts[] = \"include/$module/$script\";\n }\n }\n }\n}",
"public function init()\n {\n $this->gmodule = new Zfmodules_Model_GroupModules();\n $this->module = new Zfmodules_Model_Modules();\n }",
"public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }",
"public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}",
"public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'user.models.*',\n\t\t\t'user.components.*',\n\t\t\t'application.modules.system.models.*',\n\t\t\t'application.modules.system.components.*',\n\t\t\t'application.modules.storage.models.*',\n\t\t\t'application.modules.storage.components.*'\n\t\t));\n\t}",
"function load_modules() {\n $module_folders = scandir(clientele_ROOT . '/modules/');\n foreach ($module_folders as $key => $folder) {\n $module_folders[$key] = clientele_ROOT. '/modules/'. $module_folders[$key] . '/' . $module_folders[$key] . '.class.php'; \n }\n $module_folders = apply_filters('clientele_module_folders', $module_folders);\n foreach ($module_folders as $module_folder) {\n if (file_exists($module_folder)) {\n require($module_folder);\n $file_name = basename($module_folder, '.class.php');\n $this->register_module($file_name);\n }\n }\n do_action('clientele_modules_loaded');\n }",
"static function initialize($path)\n {\n self::register();\n self::addPath($path);\n }",
"function init()\r\n {\r\n //Copy components to comps, so you can alter components properties\r\n //on init() methods\r\n $comps=$this->components->items;\r\n //Calls children's init recursively\r\n reset($comps);\r\n while (list($k,$v)=each($comps))\r\n {\r\n $v->init();\r\n }\r\n }",
"public function init($module_name) {\n $buildmodule = \\Drupal::service('embedded_block_generator.setup_module');\n try {\n $path_name = preg_replace('@[^a-z0-9-]+@', '_', strtolower($module_name));\n $path = DRUPAL_ROOT . '/modules/custom/' . $path_name;\n if (\\Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY)) {\n $buildmodule->buildModuleFiles($module_name, $path);\n }\n $this->output()->writeln('Module ' . $module_name . ' Created successfully');\n }\n catch (Exception $e) {\n $this->output()->writeln($e->getMessage());\n }\n }",
"public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n \n\t\t$this->setImport(array('my.models.*',));\n\t}",
"protected function initGitignore() {\n $dirsWithGitignore = [\n ProjectTools::me()->getProjectDir(),\n ProjectTools::me()->getProjectDir() . '/www/',\n ];\n\n foreach ($dirsWithGitignore as $dir) {\n $this->rename('.gitignore.example', '.gitignore', $dir, TRUE);\n }\n }",
"public function loadModules();"
]
| [
"0.8622318",
"0.63352215",
"0.6253569",
"0.62153804",
"0.61189395",
"0.61161506",
"0.5994897",
"0.58679426",
"0.57577866",
"0.57424986",
"0.5734071",
"0.57059604",
"0.5612512",
"0.5531654",
"0.54932",
"0.54730964",
"0.5472321",
"0.54546887",
"0.54544926",
"0.5442336",
"0.5428891",
"0.5347971",
"0.5298989",
"0.529162",
"0.52904946",
"0.52855444",
"0.52721655",
"0.5259071",
"0.52417713",
"0.5241227"
]
| 0.83416283 | 1 |
Indicates whether or not the given path contains a Git repository. | public static function isRepo($path) {
$dotGitPath = $path . DIRECTORY_SEPARATOR . '.git';
$dotGitExists = file_exists($dotGitPath);
$dotGitIsDir = is_dir($dotGitPath);
return $dotGitExists && $dotGitIsDir;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}",
"private function isGitObject(string $path): bool\n {\n // Non-bare Git repository.\n if (1 === preg_match('/.*\\/\\.git\\/objects\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/objects\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }",
"private function isGitHook(string $path): bool\n {\n if (1 === preg_match('/.*\\/\\.git\\/hooks\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/hooks\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }",
"public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}",
"public static function exists($repo)\n {\n return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true);\n }",
"public static function repoExists($repo)\n\t{\n\t\treturn file_exists(\\Config::get('repoPath').$repo);\n\t}",
"function git_is_clean($path) {\n\t$status = GitUtil::getStatus($path);\n\treturn count($status) === 0;\n}",
"public function exists()\n\t{\n\t\t// If we don't have a configuration file for the repository it doesn't exist.\n\t\treturn file_exists($this->_root . '/.git/config');\n\t}",
"public static function isGitHubRepoUrl(string $url): bool\n {\n return preg_match(self::GH_REGEX, $url);\n }",
"function isGit($resource,$site) {\n\t\n //$error=[];\n //chdir(\"../../zone/\". $resource . \"/\" . $site);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" rev-parse --verify master 2>&1', $output, $error[0]);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" ls-remote -q --refs 2>&1', $output, $error[1]); \n\t$result = checkIsGit($resource,$site);\n\t\n if ($result == \"Y\")\n return TRUE;\n else \n return FALSE; \n}",
"public function hasRepository(string $repository) :bool\n {\n return array_key_exists($repository, $this->repositories);\n }",
"public function hasRepository(string $className): bool;",
"public function existsRepo($repo = null)\n {\n return static::exists($repo ?: $this->getFull_name());\n }",
"public function hasRepository(): bool;",
"private function isRepo($method)\n {\n return substr($method, 4, 10) == 'Repository';\n }",
"abstract function is_org_repo_compliant();",
"public function isFileInGit($filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->execute(['ls-files', '--error-unmatch', $filename]);\n\t\t}\n\t\tcatch (GitException $git_exception)\n\t\t{\n\t\t\tswitch ($git_exception->getCode())\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\t// The `git ls-files --error-unmatch` command didn't find the given file in git and has yelled an error\n\t\t\t\t// number 1. This exception can be considered normal. We can just report that the file is not in git and\n\t\t\t\t// continue the execution normally.\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// An unrecognised error has occurred. Rethrow the exception.\n\t\t\t\tthrow $git_exception;\n\t\t\t}\n\t\t}\n\t\t// As the command didn't give any error code when exiting, it's a sign for us to know that the file _does_ exist in git.\n\t\treturn true;\n\t}",
"public function hasRepository();",
"public function folderExists(string $path): bool;",
"abstract protected function isValid(Repository $repository, string $file): bool;",
"public function validateGitPlatform() : bool\n {\n /** @var string */\n $bitbucketPath = '/bitbucket';\n\n try {\n $response = $this->httpClient->request(\n ExternalLibraryHttpClient::GET,\n $bitbucketPath\n );\n\n if (self::HTTP_OK !== $response->getStatusCode()) {\n $this->logger->warning('Failed to login Bitbucket.');\n\n return false;\n }\n } catch (ClientException $exception) {\n $this->logger->warning(\n sprintf(\n 'Failed to login Bitbucket. %s ',\n $exception->getMessage()\n )\n );\n\n return false;\n }\n\n return true;\n }",
"public function parse_git_url( $git_url ) {\n\n\t\t\t// no git url, no deploy\n\t\t\tif ( empty( $git_url ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$matches = array();\n\n\t\t\t// match regex against url\n\t\t\tpreg_match( self::GIT_URL_PATTERN, $git_url, $matches );\n\n\t\t\t// didn't match, git url is not proper, no deploy\n\t\t\tif ( empty( $matches ) || ! is_array( $matches ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// didn't get the name of repo from url, url is malformed, no deploy\n\t\t\tif ( ! isset( $matches[ 2 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// first matches key has the domain name of remote,\n\t\t\t// useful for picking appropriate schema\n\t\t\t$this->repo[ 'remote_domain' ] = $matches[ 1 ];\n\n\t\t\t// name of the repo, used to create the appropriate directories\n\t\t\t$this->repo[ 'name' ] = $matches[ 2 ];\n\n\t\t\t// everything went well\n\t\t\treturn true;\n\t\t}",
"public function has($path) {\n $return = parent::has($path);\n // Appease file.inc's calls to is_dir()\n return ($return !== FALSE) ? $return : parent::has($path . '/');\n }",
"public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}",
"public function exists(string $path): bool;",
"public function exists(string $path): bool;",
"public function hasRepository($className);",
"public function isDirectory(string $path): bool;",
"public function isDirectory(string $path): bool;",
"public function has(string $path): bool;"
]
| [
"0.82872033",
"0.7625667",
"0.70613265",
"0.67163795",
"0.64855003",
"0.64713067",
"0.64349276",
"0.643219",
"0.6230931",
"0.6193124",
"0.60056543",
"0.58625686",
"0.585077",
"0.58260787",
"0.57926124",
"0.5738129",
"0.5722523",
"0.5540091",
"0.55369014",
"0.5531937",
"0.5523598",
"0.5462151",
"0.5436347",
"0.54031956",
"0.5401062",
"0.5401062",
"0.5378653",
"0.5362548",
"0.5362548",
"0.53519046"
]
| 0.78893626 | 1 |
Updates the given repository by performing a fetch from the specified remote and then a merge with the specified remote branch. | public static function update($path, $remote = 'origin', $branch = 'master') {
if (!file_exists($path)) {
throw new Exception(
"Unable to update git repo $path. Path does not exist.");
}
if (!is_dir($path)) {
throw new Exception(
"Unable to update git repo $path. Path is not a directory.");
}
if (!self::isRepo($path)) {
throw new Exception(
"Unable to update git repo $path. Path is not a git repository.");
}
$origCwd = getcwd();
chdir($path);
$fetchCmd = sprintf(self::FETCH_CMD_TMPL, $remote);
passthru($fetchCmd);
$mergeCmd = sprintf(self::MERGE_CMD_TMPL, $remote, $branch);
passthru($mergeCmd);
chdir($origCwd);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pull( $remote, $branch ) {\n return $this->_exec( \"pull {$remote} {$branch}\" );\n }",
"public function gitPull ()\n {\n\n $this->updates[ ] = Hallmark_Misc::shell ( 'git pull ' . Hallmark_Misc::removeQuotes ( Hallmark_Misc::args () ) );\n\n }",
"public function pull($remote, $branch) {\n\t\t\treturn $this->run(\"pull $remote $branch\");\n\t\t}",
"public function fetch($remote, $branch)\n {\n $this->git('fetch {remote} {branch}', ['remote' => $remote, 'branch' => $branch]);\n return $this;\n }",
"public function pull($remote, $branch)\n {\n $this->git('pull {remote} {branch}', ['remote' => $remote, 'branch' => $branch]);\n return $this;\n }",
"public function pullRepo($branchName = null) {\n\n if(is_null($branchName)){\n // pull all branches\n \\Utils::gitCommand('pull --all');\n exec('git pull --all', $pullop);\n // fetch all brnaches\n \\Utils::gitCommand('fetch --all');\n// exec('git fetch --all', $pullop);\n }else{\n // checkout to the branch which we have to pull.\n// exec('git checkout ' . $branchName, $op);\n \\Utils::gitCommand('checkout ' . $branchName);\n $this->output('Checkout to ' . $branchName);\n // pull all branches\n \\Utils::gitCommand('pull --all');\n// exec('git pull --all', $pullop);\n // fetch all brnaches\n \\Utils::gitCommand('fetch --all');\n// exec('git fetch --all', $pullop);\n // reset all local files and make exact copy of remote\n \\Utils::gitCommand('reset --hard origin/' . $branchName);\n// exec('git reset --hard origin/' . $branchName, $pullop);\n /*\n * Go back to master.\n */\n if ($branchName !== 'master') {\n// exec('git checkout master');\n \\Utils::gitCommand('checkout master');\n }\n }\n }",
"public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }",
"function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}",
"function rupdate() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t$branch = $this->branch ?: 'default';\n\t\t$remoteCmd = 'cd '.$deployPath.' && hg update -r '.$branch;\n\t\t$this->ssh_exec($remoteCmd);\n\t}",
"public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}",
"public function fetch($remote = 'origin')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Ensure that either the remote exists or is a valid URL.\n\t\tif (!filter_var($remote, FILTER_VALIDATE_URL) && !in_array($remote, $this->_getRemotes()))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('No valid remote ' . $remote . ' exists.');\n\t\t}\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git fetch -q ' . escapeshellarg($remote), $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The fetch failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}",
"function rpull() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path, BR;\n\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\ttry {\n\t\t\t\t$exists = $this->rexists($deployPath);\n\t\t\t\tif ($exists) {\n\t\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && hg pull';\n\t\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t\t} else {\n\t\t\t\t\techo TAB, '*** path ', $deployPath, ' does not exist', BR;\n\t\t\t\t}\n\t\t\t} catch (\\SystemCommandException $e) {\n\t\t\t\techo 'Error: '.$e, BR;\n\t\t\t}\n\t\t}\n\t}",
"public function merge($branch = 'origin/master')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git merge ' . escapeshellarg($branch), $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('Unable to merge branch %s with code %d and message %s.', $branch, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}",
"protected function pullRepo()\n {\n assert(valid_num_args());\n\n $pull = new GitHubPullProcess($this->config, $this->env, $this->output);\n $pull->execute();\n }",
"protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }",
"protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }",
"public function repo($dir, $remote);",
"function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}",
"function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}",
"function do_pull($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git reset --hard; git pull' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}",
"public function fetch($from = null, $branch = null) {\n\t\t$this->repository->fetch($from, $branch);\n\t}",
"function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}",
"function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}",
"function updateSourceBranching() {\n if ($this->isModuleInstalled('source')) {\n try {\n $source_commits_table = TABLE_PREFIX . 'source_commits';\n $commit_project_objects_table = TABLE_PREFIX . 'commit_project_objects';\n $source_repositories_table = TABLE_PREFIX . 'source_repositories';\n\n DB::execute(\"ALTER TABLE $source_commits_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER commited_by_email\");\n DB::execute(\"ALTER TABLE $commit_project_objects_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER revision\");\n\n // Add default branch for existing data\n\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'master' WHERE type = 'GitCommit'\");\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'default' WHERE type = 'MercurialCommit'\");\n\n $commit_project_objects = DB::execute(\"\n SELECT $commit_project_objects_table.id, $source_repositories_table.type\n FROM $commit_project_objects_table, $source_repositories_table\n WHERE $commit_project_objects_table.repository_id = $source_repositories_table.id\"\n );\n\n if (is_foreachable($commit_project_objects)) {\n foreach ($commit_project_objects as $commit_project_object) {\n if ($commit_project_object['type'] == 'GitRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'master' WHERE id = ?\", $commit_project_object['id']);\n } //if\n if ($commit_project_object['type'] == 'MercurialRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'default' WHERE id = ?\", $commit_project_object['id']);\n } //if\n } //foreach\n } //if\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('default_source_branch', 'source', 'N;')\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n } //if\n return true;\n }",
"public function performPull($source);",
"function git_update($path) {\n\t$status = GitUtil::update($path);\n}",
"public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }",
"public function update($remoteFile = IniLoader::PHP_INI, $buildFolder = null, $buildNumber = null)\n {\n $this->getLogger()->debug('started fetching remote file');\n\n $converter = new Converter($this->getLogger(), $this->getCache());\n\n if (class_exists('\\Browscap\\Browscap')) {\n $resourceFolder = 'vendor/browscap/browscap/resources/';\n\n if (null === $buildNumber) {\n $buildNumber = (int)file_get_contents('vendor/browscap/browscap/BUILD_NUMBER');\n }\n\n if (null === $buildFolder) {\n $buildFolder = 'resources';\n }\n\n $buildFolder .= '/browscap-ua-test-'.$buildNumber;\n $iniFile = $buildFolder.'/full_php_browscap.ini';\n\n mkdir($buildFolder, 0777, true);\n\n $writerCollectionFactory = new PhpWriterFactory();\n $writerCollection = $writerCollectionFactory->createCollection($this->getLogger(), $buildFolder);\n\n $buildGenerator = new BuildGenerator($resourceFolder, $buildFolder);\n $buildGenerator\n ->setLogger($this->getLogger())\n ->setCollectionCreator(new CollectionCreator())\n ->setWriterCollection($writerCollection)\n ->run($buildNumber, false)\n ;\n\n $converter\n ->setVersion($buildNumber)\n ->storeVersion()\n ->convertFile($iniFile)\n ;\n\n $filesystem = new Filesystem();\n $filesystem->remove($buildFolder);\n } else {\n if (null === ($cachedVersion = $this->checkUpdate($remoteFile))) {\n // no newer version available\n return;\n }\n\n $this->getLoader()\n ->setRemoteFilename($remoteFile)\n ->setOptions($this->options)\n ->setLogger($this->getLogger())\n ;\n\n try {\n $content = $this->getLoader()->load();\n } catch (Helper\\Exception $e) {\n throw new FetcherException('an error occured while loading remote data', 0, $e);\n }\n\n if (false === $content) {\n $internalLoader = $this->getLoader()->getLoader();\n $error = error_get_last();\n\n throw FetcherException::httpError($internalLoader->getUri(), $error['message']);\n }\n\n $this->getLogger()->debug('finished fetching remote file');\n\n $this->storeContent($converter, $content, $cachedVersion);\n }\n }",
"public function merge($branch) {\n\t\t\treturn $this->run(\"merge $branch --no-ff\");\n\t\t}",
"public function fetch($destDir)\n {\n shell_exec('rm -rf ' . $destDir);\n shell_exec('git clone --depth=1 ' . $this->extraArgs . ' ' . $this->url . ' ' . $destDir);\n }"
]
| [
"0.6380509",
"0.6174998",
"0.61604345",
"0.61464447",
"0.5803747",
"0.56516814",
"0.56359136",
"0.5620762",
"0.55611455",
"0.5454606",
"0.5413471",
"0.5393883",
"0.5391349",
"0.52943695",
"0.52776945",
"0.52756375",
"0.5228591",
"0.5217752",
"0.5196512",
"0.51285505",
"0.4971897",
"0.49466223",
"0.49320623",
"0.4909792",
"0.48746166",
"0.48404437",
"0.47700593",
"0.47541666",
"0.47323045",
"0.47136214"
]
| 0.6444031 | 0 |
Clone a git repository. | function git_clone($repo, $path, $initSubModules = false) {
GitUtil::cloneRepo($repo, $path, $initSubModules);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}",
"public function cloneGitRepo($repo, $dir);",
"public function cloneRepo($repo)\n {\n return $this->passthru('git', ['clone', '[email protected]:' . $repo]);\n }",
"public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}",
"public function cloneRepository();",
"public function cloneRepository($url, $directory = NULL, array $params = NULL)\n\t\t{\n\t\t\tif ($directory !== NULL && is_dir(\"$directory/.git\")) {\n\t\t\t\tthrow new GitException(\"Repo already exists in $directory.\");\n\t\t\t}\n\n\t\t\t$cwd = $this->runner->getCwd();\n\n\t\t\tif ($directory === NULL) {\n\t\t\t\t$directory = Helpers::extractRepositoryNameFromUrl($url);\n\t\t\t\t$directory = \"$cwd/$directory\";\n\n\t\t\t} elseif(!Helpers::isAbsolute($directory)) {\n\t\t\t\t$directory = \"$cwd/$directory\";\n\t\t\t}\n\n\t\t\tif ($params === NULL) {\n\t\t\t\t$params = '-q';\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$this->run($cwd, [\n\t\t\t\t\t'clone',\n\t\t\t\t\t$params,\n\t\t\t\t\t'--end-of-options',\n\t\t\t\t\t$url,\n\t\t\t\t\t$directory\n\t\t\t\t]);\n\n\t\t\t} catch (GitException $e) {\n\t\t\t\t$stderr = '';\n\t\t\t\t$result = $e->getRunnerResult();\n\n\t\t\t\tif ($result !== NULL && $result->hasErrorOutput()) {\n\t\t\t\t\t$stderr = implode(PHP_EOL, $result->getErrorOutput());\n\t\t\t\t}\n\n\t\t\t\tthrow new GitException(\"Git clone failed (directory $directory).\" . ($stderr !== '' ? (\"\\n$stderr\") : ''));\n\t\t\t}\n\n\t\t\treturn $this->open($directory);\n\t\t}",
"protected function cloneScmRepository()\n\t{\n\t\t// Get Git credentials\n\t\tif (!$this->rocketeer->hasCredentials() and !$this->rocketeer->usesSsh()) {\n\t\t\t$username = $this->command->ask('What is your SCM username ?');\n\t\t\t$password = $this->command->secret('And your password ?');\n\t\t\t$repository = $this->rocketeer->getRepository($username, $password);\n\t\t} else {\n\t\t\t$repository = $this->rocketeer->getRepository();\n\t\t}\n\n\t\t// Clone release\n\t\t$branch = $this->rocketeer->getRepositoryBranch();\n\t\treturn $this->cloneRepository($repository, $branch);\n\t}",
"public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}",
"function do_clone($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'ssh-add $key; git clone $url $path' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}",
"protected function cloneRepoToTempDirectory(): void {\n\t\t$this->gitRepository->clone(\n\t\t\t$this->settings->getRepoUri(),\n\t\t\t$this->settings->getTempPath(),\n\t\t\t$this->settings->getRepoBranch()\n\t\t)->removeGitConfig( $this->settings->getTempPath() . '/.git' );\n\t}",
"public function cloneRepository($destination = null)\n\t{\n\t\tif (!$destination) {\n\t\t\t$destination = $this->releasesManager->getCurrentReleasePath();\n\t\t}\n\n\t\t// Executing checkout\n\t\t$this->command->info('Cloning repository in \"' .$destination. '\"');\n\t\t$output = $this->scm->execute('checkout', $destination);\n\t\t$this->history[] = $output;\n\n\t\t// Cancel if failed and forget credentials\n\t\t$success = $this->checkStatus('Unable to clone the repository', $output) !== false;\n\t\tif (!$success) {\n\t\t\t$this->server->forgetValue('credentials');\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Deploy submodules\n\t\t$this->command->info('Initializing submodules if any');\n\t\t$this->runForCurrentRelease($this->scm->submodules());\n\n\t\treturn $success;\n\t}",
"protected function freshClone($branch = false, $depth = false)\n {\n $fs = new Filesystem();\n if (is_dir($this->dir)) {\n $fs->remove($this->dir);\n }\n $fs->mkdir(dirname($this->dir));\n\n $branchTerm = $branch ? \"--branch=$branch \" : '';\n $depthTerm = $depth ? \"--depth=$depth \" : '';\n exec(\"git clone '{$this->url()}' $branchTerm$depthTerm'{$this->dir}' 2>/dev/null\", $output, $result);\n\n // Fail if we could not clone.\n if ($result) {\n $project = $this->projectWithOrg();\n throw new \\Exception(\"Could not clone $project: git failed with exit code $result\");\n }\n }",
"public function clone_from($source) {\n\t\t\treturn $this->run(\"clone --local $source \".$this->repo_path);\n\t\t}",
"public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }",
"public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }",
"function rclone() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t$paths = $this->getMain()->getPaths();\n\t\t$default = $paths['default'];\n\t\t$remoteCmd = 'cd '.$versionPath.' && hg clone '.$default .' .';\n\t\t$this->ssh_exec($remoteCmd);\n\t}",
"private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}",
"public function cloneRepository(Server $server, Application $application)\n {\n try {\n $this->getUser();\n\n $server->exec(\n view('scripts.deployments.bitbucket-deployment', [\n 'application' => $application,\n 'access_token' => $this->sourceProvider->access_token\n ])->render()\n ); \n } catch (ClientException $e) {\n if ($e->getResponse()->getStatusCode() === 401) {\n if ($this->retries <= $this->maxRetries) {\n $this->retries = $this->retries + 1;\n $this->refreshToken();\n }\n }\n }\n }",
"public static function &clone_remote($repo_path, $remote, $reference = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $remote, true, $reference);\n\t\t}",
"public function cloneAndConfig()\n {\n if (! is_dir($this->directory)) {\n try {\n $this->git->cloneRepository()->execute($this->repo_url);\n $this->git->remote()->add(\n $this->client_remote,\n $this->client_remote_url\n )->execute();\n\n $this->git->fetch()->execute($this->client_remote);\n\n if (! file_put_contents($this->config_file,\n $this->user_config, FILE_APPEND)) {\n $this->logger->error('Can\\'t write Git config file');\n }\n } catch (GitException $e) {\n $this->logger->error('Failed to clone or config Git repository. '\n . 'Error: ' . $e->getMessage());\n }\n }\n }",
"public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}",
"public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}",
"public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}",
"public static function &create_new($repo_path, $source = null, $remote_source = false, $reference = null) {\n\t\t\tif (is_dir($repo_path) && file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is already a git repository');\n\t\t\t} else {\n\t\t\t\t$repo = new self($repo_path, true, false);\n\t\t\t\tif (is_string($source)) {\n\t\t\t\t\tif ($remote_source) {\n\t\t\t\t\t\tif (!is_dir($reference) || !is_dir($reference.'/.git')) {\n\t\t\t\t\t\t\tthrow new Exception('\"'.$reference.'\" is not a git repository. Cannot use as reference.');\n\t\t\t\t\t\t} else if (strlen($reference)) {\n\t\t\t\t\t\t\t$reference = realpath($reference);\n\t\t\t\t\t\t\t$reference = \"--reference $reference\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$repo->clone_remote($source, $reference);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$repo->clone_from($source);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$repo->run('init');\n\t\t\t\t}\n\t\t\t\treturn $repo;\n\t\t\t}\n\t\t}",
"public function getGitCloneLocation()\n {\n return $this->gitCloneLocation;\n }",
"private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }",
"protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }",
"public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }",
"final private function __clone() {}",
"final private function __clone() {}"
]
| [
"0.8578521",
"0.78792316",
"0.73362905",
"0.69668597",
"0.6939361",
"0.6843659",
"0.66879785",
"0.6475043",
"0.6275234",
"0.6263388",
"0.62075794",
"0.6189465",
"0.61308616",
"0.613023",
"0.60807574",
"0.6034997",
"0.5917917",
"0.5759873",
"0.57526803",
"0.5695389",
"0.5635467",
"0.55655175",
"0.5463669",
"0.54590833",
"0.54404414",
"0.53466606",
"0.53061545",
"0.5305298",
"0.5252801",
"0.5252801"
]
| 0.79512674 | 1 |
Export a git repository. | function git_export($path, $output, $prefix = null, $version = 'HEAD') {
if ($prefix === null) {
$prefix = basename($output);
$output = dirname($output);
}
GitUtil::export($path, $output, $prefix, $version);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drush_cmi_config_export_git() {\n drush_cmi_config_export();\n drush_shell_exec_interactive('git add -p ' . config_get_config_directory('export'));\n}",
"public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}",
"public function cloneGitRepo($repo, $dir);",
"public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }",
"private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}",
"function write_zip($repo) {\n $p = basename($repo);\n $proj = explode(\".\", $p);\n $proj = $proj[0];\n //TODO: clean this up\n exec(\"cd /tmp && git-clone $repo && rm -Rf /tmp/$proj && zip -r $proj.zip $proj && rm -Rf /tmp/$proj\");\n\n $filesize = filesize(\"/tmp/$proj.zip\");\n header(\"Pragma: public\"); // required\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false); // required for certain browsers\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Type: application/x-zip\");\n header(\"Content-Length: \" . $filesize);\n header(\"Content-Disposition: attachment; filename=\\\"$proj.zip\\\";\");\n echo file_get_contents(\"/tmp/$proj.zip\");\n die();\n}",
"function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}",
"protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }",
"public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}",
"public function cloneRepository();",
"function write_plain($repos) {\n $repo = get_repo_path($_GET['p'], $repos);\n $hash = $_GET['h'];\n header(\"Content-Type: text/plain\");\n $str = system(\"GIT_DIR=$repo/.git git cat-file blob $hash\");\n echo $str;\n die();\n}",
"public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}",
"public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }",
"public function export(ExportcandidateRequest $request, candidateRepository $repository) {\n\n return $this->handleExport($request, $repository);\n }",
"public function _archive_repo( $gitlab_path ) {\n\n\t\t[ 'group' => $group, 'name' => $project_name ] = $gitlab_path; // php 7.1 🚀\n\n\t\tif ( ! empty( $project_name ) ) {\n\n\t\t\tarchive_repo_by_id( rawurlencode( $group . '/' . $project_name ) );\n\n\t\t} else {\n\n\t\t\t$projects_data = get_projects( $gitlab_path );\n\n\t\t\tforeach ( $projects_data as $project ) {\n\n\t\t\t\t$this->_display_project_data( $project, 'Archiving' );\n\n\t\t\t\tarchive_repo_by_id( $project['id'] );\n\t\t\t}\n\t\t}\n\t}",
"function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}",
"public function store()\n {\n $validated = request()->validate([\n 'name' => ['required', 'regex:/^[A-Za-z0-9_]*$/']\n ]);\n\n $repository = new Repository();\n $repository->name = $validated['name'];\n\n chdir('D:\\repositories');\n// file_put_contents('conf/gitolite.conf', $lines);// insert gitolite.conf\n// shell_exec('git config user.email tarc@admin');\n// shell_exec('git config user.name TARC_Admin');\n// shell_exec('git add conf/gitolite.conf');\n// shell_exec('git commit -m '.Staff::where('user_id', Auth::user()->id)->first()->staff_id);\n// shell_exec('git pull');\n// shell_exec('git push');\n shell_exec('git clone '. config('gitolite.git_server_url') .':' . $repository->name);\n// $output = shell_exec('rm -rf '.escapeshellarg($repository->name));\n// dd($output);\n return redirect('repositories')->with('success', 'Your '.$repository->name . ' repository has been created.');;\n }",
"public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }",
"public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }",
"protected function svnExport($path) \n {\n $absolute_path = $this->absolutePath($path);\n\n $this->log('svn export: ' \n . shell_exec(\"svn export {$this->ullright_repo_url}/{$path} {$absolute_path}\"));\n }",
"public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }",
"private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }",
"public function repo($dir, $remote);",
"public function pushRepository($dir, $target_project);",
"public function export();",
"public function export();",
"public function export();",
"public function export();",
"public function export();",
"protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }"
]
| [
"0.6487203",
"0.587284",
"0.57490593",
"0.57172847",
"0.5669102",
"0.5661655",
"0.56557685",
"0.56092596",
"0.56021774",
"0.5447175",
"0.5383424",
"0.5302148",
"0.53012496",
"0.529111",
"0.52697265",
"0.5154076",
"0.51367396",
"0.50754076",
"0.50661576",
"0.5041692",
"0.5030542",
"0.50285643",
"0.5023216",
"0.49835745",
"0.49651533",
"0.49651533",
"0.49651533",
"0.49651533",
"0.49651533",
"0.4959942"
]
| 0.6383873 | 1 |
Initialize any submodules for the repo at the given path. | function git_init_submodules($path) {
GitUtil::initSubmodules($path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function initSubmodules($path) {\n\t\t$oldDir = getcwd();\n\t\tchdir($path);\n\t\tpassthru(self::INIT_SUBMODULES_CMD);\n\t\tchdir($oldDir);\n\t}",
"public function load_modules() {\n\t\tforeach ( $this->modules as $module_name ) {\n\t\t\t$module = $this->build( $module_name );\n\t\t\tif ( $module !== null ) {\n\t\t\t\t$module->init();\n\t\t\t}\n\t\t}\n\t}",
"static function loadModules($path) {\n // Prepare the iterator\n $core = new RecursiveDirectoryIterator($_SERVER['DOCUMENT_ROOT'] . $path);\n $iterator = new RecursiveIteratorIterator($core);\n $modules = new RegexIterator($iterator, '/^.+\\.php$/i', RecursiveRegexIterator::GET_MATCH);\n // Load all modules in the directory structure recursively\n foreach ($modules as $component => $filename) {\n require_once $component;\n }\n }",
"function git_update_submodules($path) {\n\t$status = GitUtil::updateExternals($path);\n}",
"protected function init()\n {\n $files = $this->fs->findFile('', 'init', 'php', true, true);\n\n if (!$files) {\n return;\n }\n\n $files = array_reverse($files);\n\n $di = $this->getDI();\n\n foreach ($files as $file) {\n include $file;\n }\n\n }",
"public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}",
"function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}",
"public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}",
"function __construct ($path)\n {\n $this->basepath = $path ;\n // pull the module and package names out of the path\n $this->moduleName = basename ( $path, \"/\" ) ; // just in case there are any trailing /\n $this->packageName = basename ( dirname ( dirname ( $path ) ) ) ; // simpler than explode :)\n require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;\n $mb = new ModuleBuilder ( ) ;\n $this->packageKey = $mb->getPackageKey ( $this->packageName ) ;\n \n $this->load () ;\n \n }",
"final function __construct($path)\n\t{\n\t\t$this->path = $path;\n\t\t$this->mods = array();\n\t\t$this->init();\n\t}",
"public function initExtensions(): void\n {\n $modules = $this->config->__toArray();\n\n if (empty($modules)) {\n return;\n }\n\n $templatesPaths = [];\n $langPaths = [];\n\n $extensionsDir = $this->extensionsConfig['path'];\n\n foreach ($modules as $index => $config) {\n if (!$config['enabled'] || isset($this->loadedExtensions[$index]['init'])) {\n continue;\n }\n\n $path = $extensionsDir . File::fillEndSep($config['dir']);\n\n\n if (!empty($config['paths']['locales'])) {\n $langPaths[] = $path . $config['paths']['locales'] . '/';\n }\n\n if (!empty($config['paths']['templates'])) {\n $templatesPaths[] = $path . $config['paths']['templates'] . '/';\n }\n\n $this->loadedExtensions[$index]['init'] = true;\n }\n\n // Add localization paths\n if (!empty($langPaths)) {\n /**\n * @var StorageInterface $langStorage\n */\n $langStorage = $this->di->get(Lang::class)->getStorage();\n foreach ($langPaths as $path) {\n $langStorage->addPath($path);\n }\n }\n\n // Add Templates paths\n if (!empty($templatesPaths)) {\n $templateStorage = $this->di->get(Storage::class);\n $paths = $templateStorage->getPaths();\n $mainPath = array_shift($paths);\n // main path\n $pathsResult = [];\n $pathsResult[] = $mainPath;\n $pathsResult = array_merge($pathsResult, $templatesPaths, $paths);\n $templateStorage->setPaths($pathsResult);\n }\n }",
"public function init($path);",
"public function init() {\n\t\t$this->getFrontController()->addModuleDirectory(APPLICATION_PATH . '/modules');\n\n\t\t// initialize navigation\n\t\t$this->_initNavigation();\n\t}",
"public static function initModuleLoading(){\n\n\t}",
"function module_init () {\n global $core_stylesheets;\n global $core_scripts;\n \n foreach (module_list() as $module) {\n $style_func = $module . '_stylesheets';\n if (function_exists($style_func)) {\n $stylesheets = call_user_func($style_func);\n foreach ($stylesheets as $sheet) {\n $core_stylesheets[] = \"include/$module/$sheet\";\n }\n }\n $style_func = $module . '_scripts';\n if (function_exists($style_func)) {\n $scripts = call_user_func($scripts_func);\n foreach ($scripts as $script) {\n $core_scripts[] = \"include/$module/$script\";\n }\n }\n }\n}",
"public function init()\n {\n $this->gmodule = new Zfmodules_Model_GroupModules();\n $this->module = new Zfmodules_Model_Modules();\n }",
"function xh_initModules()\r\n\t{\r\n\t}",
"public function init_modules() {\n\t\t\t$this->dynamic_css = $this->get_core()->init_module( 'cherry-dynamic-css' );\n\n\t\t\tif ( is_admin() ) {\n\t\t\t\t$this->get_core()->init_module( 'cherry5-insert-shortcode', array() );\n\t\t\t}\n\t\t}",
"protected function initGitignore() {\n $dirsWithGitignore = [\n ProjectTools::me()->getProjectDir(),\n ProjectTools::me()->getProjectDir() . '/www/',\n ];\n\n foreach ($dirsWithGitignore as $dir) {\n $this->rename('.gitignore.example', '.gitignore', $dir, TRUE);\n }\n }",
"public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }",
"public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }",
"public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n Yii::import('cms_core.components.CmsModule');\n CmsModule::initCore($this); \n CmsModule::loadModule('cms_content');\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'cms_gallery.models.*',\n\t\t\t'cms_gallery.components.*',\n\t\t));\n\t}",
"public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'user.models.*',\n\t\t\t'user.components.*',\n\t\t\t'application.modules.system.models.*',\n\t\t\t'application.modules.system.components.*',\n\t\t\t'application.modules.storage.models.*',\n\t\t\t'application.modules.storage.components.*'\n\t\t));\n\t}",
"private function initRepositories(): void {\n $this->usersRepository = new UsersRepository();\n }",
"function load_modules() {\n $module_folders = scandir(clientele_ROOT . '/modules/');\n foreach ($module_folders as $key => $folder) {\n $module_folders[$key] = clientele_ROOT. '/modules/'. $module_folders[$key] . '/' . $module_folders[$key] . '.class.php'; \n }\n $module_folders = apply_filters('clientele_module_folders', $module_folders);\n foreach ($module_folders as $module_folder) {\n if (file_exists($module_folder)) {\n require($module_folder);\n $file_name = basename($module_folder, '.class.php');\n $this->register_module($file_name);\n }\n }\n do_action('clientele_modules_loaded');\n }",
"public static function init() {\n foreach (static::$dirs as $dir) {\n if($phpFiles = glob($dir . DIRECTORY_SEPARATOR . '*.php')) {\n foreach ($phpFiles as $phpFile) {\n $namespace = basename($phpFile, '.php');\n static::$config[$namespace] = require_once $phpFile;\n }\n }\n }\n }",
"static function initialize($path)\n {\n self::register();\n self::addPath($path);\n }",
"public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}",
"public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n \n\t\t$this->setImport(array('my.models.*',));\n\t}",
"public function loadModules()\n {\n foreach ($this->getListOfModules() as $module) {\n $this->loadViews($module);\n $this->loadRoutes($module);\n $this->loadMigrations($module);\n }\n }"
]
| [
"0.82586163",
"0.6352104",
"0.6333686",
"0.6127718",
"0.597031",
"0.59235466",
"0.59083855",
"0.5901166",
"0.5899059",
"0.5768716",
"0.57487667",
"0.57173336",
"0.5625211",
"0.5557827",
"0.5544795",
"0.5533338",
"0.5514038",
"0.5507386",
"0.549787",
"0.54797065",
"0.54564035",
"0.54308003",
"0.5396318",
"0.53781164",
"0.53777254",
"0.5368455",
"0.5367977",
"0.5348166",
"0.534293",
"0.5338049"
]
| 0.85108614 | 0 |
Determine whether or not a given path is a git repository. | function git_is_repo($path) {
return GitUtil::isRepo($path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function isRepo($path) {\n\t\t$dotGitPath = $path . DIRECTORY_SEPARATOR . '.git';\n\t\t$dotGitExists = file_exists($dotGitPath);\n\t\t$dotGitIsDir = is_dir($dotGitPath);\n\n\t\treturn $dotGitExists && $dotGitIsDir;\n\t}",
"private function isGitObject(string $path): bool\n {\n // Non-bare Git repository.\n if (1 === preg_match('/.*\\/\\.git\\/objects\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/objects\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }",
"public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}",
"private function isGitHook(string $path): bool\n {\n if (1 === preg_match('/.*\\/\\.git\\/hooks\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/hooks\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }",
"function isGit($resource,$site) {\n\t\n //$error=[];\n //chdir(\"../../zone/\". $resource . \"/\" . $site);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" rev-parse --verify master 2>&1', $output, $error[0]);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" ls-remote -q --refs 2>&1', $output, $error[1]); \n\t$result = checkIsGit($resource,$site);\n\t\n if ($result == \"Y\")\n return TRUE;\n else \n return FALSE; \n}",
"public static function isGitHubRepoUrl(string $url): bool\n {\n return preg_match(self::GH_REGEX, $url);\n }",
"function git_is_clean($path) {\n\t$status = GitUtil::getStatus($path);\n\treturn count($status) === 0;\n}",
"public function parse_git_url( $git_url ) {\n\n\t\t\t// no git url, no deploy\n\t\t\tif ( empty( $git_url ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$matches = array();\n\n\t\t\t// match regex against url\n\t\t\tpreg_match( self::GIT_URL_PATTERN, $git_url, $matches );\n\n\t\t\t// didn't match, git url is not proper, no deploy\n\t\t\tif ( empty( $matches ) || ! is_array( $matches ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// didn't get the name of repo from url, url is malformed, no deploy\n\t\t\tif ( ! isset( $matches[ 2 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// first matches key has the domain name of remote,\n\t\t\t// useful for picking appropriate schema\n\t\t\t$this->repo[ 'remote_domain' ] = $matches[ 1 ];\n\n\t\t\t// name of the repo, used to create the appropriate directories\n\t\t\t$this->repo[ 'name' ] = $matches[ 2 ];\n\n\t\t\t// everything went well\n\t\t\treturn true;\n\t\t}",
"abstract function is_org_repo_compliant();",
"private function isRepo($method)\n {\n return substr($method, 4, 10) == 'Repository';\n }",
"public static function exists($repo)\n {\n return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true);\n }",
"public static function repoExists($repo)\n\t{\n\t\treturn file_exists(\\Config::get('repoPath').$repo);\n\t}",
"protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}",
"public function validateGitPlatform() : bool\n {\n /** @var string */\n $bitbucketPath = '/bitbucket';\n\n try {\n $response = $this->httpClient->request(\n ExternalLibraryHttpClient::GET,\n $bitbucketPath\n );\n\n if (self::HTTP_OK !== $response->getStatusCode()) {\n $this->logger->warning('Failed to login Bitbucket.');\n\n return false;\n }\n } catch (ClientException $exception) {\n $this->logger->warning(\n sprintf(\n 'Failed to login Bitbucket. %s ',\n $exception->getMessage()\n )\n );\n\n return false;\n }\n\n return true;\n }",
"public static function determineGit($arg, &$matches)\n {\n $reg0 = '#^\n (?:git|https|http|ssh|rsync|file?)(://|@).*?(/|\\:)\n (?P<package>[a-zA-Z0-9\\-_]+)\n (?:\n (?:\\.git|)\n (?:\\#(?P<reference>.*?)|)\n )?\n $#x';\n\n return self::match([$reg0], $arg, $matches);\n }",
"public function isFileInGit($filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->execute(['ls-files', '--error-unmatch', $filename]);\n\t\t}\n\t\tcatch (GitException $git_exception)\n\t\t{\n\t\t\tswitch ($git_exception->getCode())\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\t// The `git ls-files --error-unmatch` command didn't find the given file in git and has yelled an error\n\t\t\t\t// number 1. This exception can be considered normal. We can just report that the file is not in git and\n\t\t\t\t// continue the execution normally.\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// An unrecognised error has occurred. Rethrow the exception.\n\t\t\t\tthrow $git_exception;\n\t\t\t}\n\t\t}\n\t\t// As the command didn't give any error code when exiting, it's a sign for us to know that the file _does_ exist in git.\n\t\treturn true;\n\t}",
"public function existsRepo($repo = null)\n {\n return static::exists($repo ?: $this->getFull_name());\n }",
"public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}",
"public function exists()\n\t{\n\t\t// If we don't have a configuration file for the repository it doesn't exist.\n\t\treturn file_exists($this->_root . '/.git/config');\n\t}",
"public function hasRepository(string $className): bool;",
"public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}",
"abstract protected function isValid(Repository $repository, string $file): bool;",
"public function hasRepository(): bool;",
"public function test_git() {\n\t\t\t$descriptorspec = array(\n\t\t\t\t1 => array('pipe', 'w'),\n\t\t\t\t2 => array('pipe', 'w'),\n\t\t\t);\n\t\t\t$pipes = [];\n\t\t\t$resource = proc_open(Git::get_bin(), $descriptorspec, $pipes);\n\n\t\t\t$stdout = stream_get_contents($pipes[1]);\n\t\t\t$stderr = stream_get_contents($pipes[2]);\n\t\t\tforeach ($pipes as $pipe) {\n\t\t\t\tfclose($pipe);\n\t\t\t}\n\n\t\t\t$status = trim(proc_close($resource));\n\t\t\treturn ($status != 127);\n\t\t}",
"private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}",
"public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}",
"public function hasRepository(string $repository) :bool\n {\n return array_key_exists($repository, $this->repositories);\n }",
"function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}",
"public function isARepository($class)\n {\n return is_subclass_of($class, 'PostIt\\Repositories\\EntityRepository');\n }",
"public function hasRepository();"
]
| [
"0.78555274",
"0.78191644",
"0.73434734",
"0.7162551",
"0.66075826",
"0.6401121",
"0.62702554",
"0.6078952",
"0.6072967",
"0.60449463",
"0.5931745",
"0.5838702",
"0.56848264",
"0.56798214",
"0.5584139",
"0.55010897",
"0.549318",
"0.54878926",
"0.5483722",
"0.5470934",
"0.53864765",
"0.5371736",
"0.53619915",
"0.5356071",
"0.53011954",
"0.52900016",
"0.5236426",
"0.52283823",
"0.5185107",
"0.51478636"
]
| 0.8648549 | 0 |
Determine whether or not a given git repository is clean. | function git_is_clean($path) {
$status = GitUtil::getStatus($path);
return count($status) === 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function isClean()\n {\n return empty(static::command('git status -s'));\n }",
"function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}",
"public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}",
"abstract function is_org_repo_compliant();",
"function isGit($resource,$site) {\n\t\n //$error=[];\n //chdir(\"../../zone/\". $resource . \"/\" . $site);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" rev-parse --verify master 2>&1', $output, $error[0]);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" ls-remote -q --refs 2>&1', $output, $error[1]); \n\t$result = checkIsGit($resource,$site);\n\t\n if ($result == \"Y\")\n return TRUE;\n else \n return FALSE; \n}",
"private function isGitObject(string $path): bool\n {\n // Non-bare Git repository.\n if (1 === preg_match('/.*\\/\\.git\\/objects\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/objects\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }",
"public static function exists($repo)\n {\n return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true);\n }",
"public static function isRepo($path) {\n\t\t$dotGitPath = $path . DIRECTORY_SEPARATOR . '.git';\n\t\t$dotGitExists = file_exists($dotGitPath);\n\t\t$dotGitIsDir = is_dir($dotGitPath);\n\n\t\treturn $dotGitExists && $dotGitIsDir;\n\t}",
"public function exists()\n\t{\n\t\t// If we don't have a configuration file for the repository it doesn't exist.\n\t\treturn file_exists($this->_root . '/.git/config');\n\t}",
"public function validateGitPlatform() : bool\n {\n /** @var string */\n $bitbucketPath = '/bitbucket';\n\n try {\n $response = $this->httpClient->request(\n ExternalLibraryHttpClient::GET,\n $bitbucketPath\n );\n\n if (self::HTTP_OK !== $response->getStatusCode()) {\n $this->logger->warning('Failed to login Bitbucket.');\n\n return false;\n }\n } catch (ClientException $exception) {\n $this->logger->warning(\n sprintf(\n 'Failed to login Bitbucket. %s ',\n $exception->getMessage()\n )\n );\n\n return false;\n }\n\n return true;\n }",
"public function hasRepository(): bool;",
"public function stageIsDirty() : bool\n {\n $stage = $this\n ->runProcess(new Process('git status --porcelain'))\n ->getOutput()\n ;\n\n return !!trim($stage);\n }",
"protected function isRepositoryDeletable()\n {\n return $this->getRepository() instanceof DeletableInterface;\n }",
"abstract protected function isValid(Repository $repository, string $file): bool;",
"public function isClean();",
"public function stageIsClean() : bool\n {\n return !$this->stageIsDirty();\n }",
"public static function repoExists($repo)\n\t{\n\t\treturn file_exists(\\Config::get('repoPath').$repo);\n\t}",
"public function isFileInGit($filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->execute(['ls-files', '--error-unmatch', $filename]);\n\t\t}\n\t\tcatch (GitException $git_exception)\n\t\t{\n\t\t\tswitch ($git_exception->getCode())\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\t// The `git ls-files --error-unmatch` command didn't find the given file in git and has yelled an error\n\t\t\t\t// number 1. This exception can be considered normal. We can just report that the file is not in git and\n\t\t\t\t// continue the execution normally.\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// An unrecognised error has occurred. Rethrow the exception.\n\t\t\t\tthrow $git_exception;\n\t\t\t}\n\t\t}\n\t\t// As the command didn't give any error code when exiting, it's a sign for us to know that the file _does_ exist in git.\n\t\treturn true;\n\t}",
"public function test_git() {\n\t\t\t$descriptorspec = array(\n\t\t\t\t1 => array('pipe', 'w'),\n\t\t\t\t2 => array('pipe', 'w'),\n\t\t\t);\n\t\t\t$pipes = [];\n\t\t\t$resource = proc_open(Git::get_bin(), $descriptorspec, $pipes);\n\n\t\t\t$stdout = stream_get_contents($pipes[1]);\n\t\t\t$stderr = stream_get_contents($pipes[2]);\n\t\t\tforeach ($pipes as $pipe) {\n\t\t\t\tfclose($pipe);\n\t\t\t}\n\n\t\t\t$status = trim(proc_close($resource));\n\t\t\treturn ($status != 127);\n\t\t}",
"public function clean()\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git clean -fd', $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('Failure cleaning the repository with code %d and message %s.', $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function parse_git_url( $git_url ) {\n\n\t\t\t// no git url, no deploy\n\t\t\tif ( empty( $git_url ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$matches = array();\n\n\t\t\t// match regex against url\n\t\t\tpreg_match( self::GIT_URL_PATTERN, $git_url, $matches );\n\n\t\t\t// didn't match, git url is not proper, no deploy\n\t\t\tif ( empty( $matches ) || ! is_array( $matches ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// didn't get the name of repo from url, url is malformed, no deploy\n\t\t\tif ( ! isset( $matches[ 2 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// first matches key has the domain name of remote,\n\t\t\t// useful for picking appropriate schema\n\t\t\t$this->repo[ 'remote_domain' ] = $matches[ 1 ];\n\n\t\t\t// name of the repo, used to create the appropriate directories\n\t\t\t$this->repo[ 'name' ] = $matches[ 2 ];\n\n\t\t\t// everything went well\n\t\t\treturn true;\n\t\t}",
"private function isRepo($method)\n {\n return substr($method, 4, 10) == 'Repository';\n }",
"private function isGitHook(string $path): bool\n {\n if (1 === preg_match('/.*\\/\\.git\\/hooks\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/hooks\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }",
"public function hasRepository(string $className): bool;",
"public function checkRepoStructure() : void\n {\n\n if (!is_dir($this->backupDir) || !is_writable($this->backupDir)) {\n throw new RuntimeException(\n 'The temporary directory you have configured (' . $this->backupDir . ') is either non existant or not writable'\n );\n }\n\n if (!is_dir($this->backupRepository)) {\n $mr = @mkdir($this->backupRepository, 0755, true);\n if (!$mr) {\n throw new RuntimeException('Cannot create the Repository ' . $this->backupRepository);\n }\n }\n\n if (!is_writable($this->backupRepository)) {\n throw new RuntimeException('Cannot write to Repository ' . $this->backupRepository);\n }\n\n if (is_dir($this->backupDir . '/' . $this->backupFormat)) {\n $this->recursiveRemoveDirectory($this->backupDir . '/' . $this->backupFormat);\n }\n }",
"public function existsRepo($repo = null)\n {\n return static::exists($repo ?: $this->getFull_name());\n }",
"protected function initializeEmptyGitRepository(): string\n {\n try {\n $repoPath = sys_get_temp_dir()\n . '/CaptainHook/tests/repo-'\n . time() . '-' . bin2hex(random_bytes(4));\n } catch (Exception $exception) {\n TestCase::fail($exception->getMessage());\n }\n\n $gitConfigFile = $repoPath . '/.git/config';\n\n $this->filesystem()->mkdir($repoPath);\n\n $this->mustRunInShell(['git', 'init', '--initial-branch=main', $repoPath]);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.name', 'Acceptance Tester']);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.email', '[email protected]']);\n\n return $repoPath;\n }",
"public function hasUncommittedChanges($directory)\n {\n $changes = $this->run($directory, \"git diff-index --name-only HEAD\");\n return !(ctype_space($changes) || $changes = '');\n }",
"public function git_working_branch()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git status', $status );\n\t\t$status = $status[0];\n\n\t\treturn preg_replace( '/# On branch/', '', $status );\n\t}",
"public function hasRepository();"
]
| [
"0.7354931",
"0.64854854",
"0.6077937",
"0.6058576",
"0.6011798",
"0.5966901",
"0.57241297",
"0.5722131",
"0.5706511",
"0.5610204",
"0.55890906",
"0.54955554",
"0.54934967",
"0.5435752",
"0.53806317",
"0.53009695",
"0.5299914",
"0.52395123",
"0.5219888",
"0.521423",
"0.5207466",
"0.5190261",
"0.5160647",
"0.5131007",
"0.5078742",
"0.50631833",
"0.5036101",
"0.50062853",
"0.49844724",
"0.4954342"
]
| 0.7517199 | 0 |
Tag a git repository. | function git_tag($path, $tag, $version = 'HEAD') {
return GitUtil::tag($path, $tag, null, $version);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\n }",
"public function getGitTag()\n {\n return $this->runGitCommand('git describe --tags HEAD');\n }",
"public function create($repository);",
"public function main()\n {\n if (null === $this->getRepository()) {\n throw new BuildException('\"repository\" is required parameter');\n }\n $client = $this->getGitClient(false, $this->getRepository());\n $command = $client->getCommand('tag');\n $command\n ->setOption('-l')\n ->setOption('--sort', '-v:refname');\n $result = $command->execute();\n var_dump($result);\n }",
"function _versioncontrol_git_get_tag_operations($repository, $tags) {\n $tag_ops = array();\n $tag_string = '';\n if (empty($tags)) {\n return array();\n }\n foreach ($tags as $tag) {\n $tag_string .= escapeshellarg(\"refs/tags/$tag\") .' ';\n }\n $format = \"%(objecttype)\\n%(objectname)\\n%(refname)\\n%(taggername) %(taggeremail)\\n%(taggerdate)\\n%(contents)\\nENDOFGITTAGOUTPUTMESAGEHERE\";\n $exec = \"git for-each-ref --format=\\\"$format\\\" $tag_string\";\n $logs_tag_msg = _versioncontrol_git_log_exec($exec);\n $exec = \"git show-ref -d $tag_string\";\n $logs_tag_commits = _versioncontrol_git_log_exec($exec);\n $tag_commits = array();\n foreach ($logs_tag_commits as $line) {\n if (substr($line, -3, 3) == '^{}') {\n $commit = substr($line, 0, 40);\n $tag = substr($line, 41);\n $tag = substr(substr($line, 41, strlen($tag) -3), 10);\n $tag_commits[$tag] = $commit;\n }\n }\n do {\n $ret = _versioncontrol_git_log_parse_tag_info($repository, $logs_tag_msg, $tag_commits);\n if ($ret !== FALSE) {\n $tag_ops[] = $ret;\n }\n }while ($ret !== FALSE);\n return $tag_ops;\n}",
"public function setRepository($repository)\n {\n $this->repository = $repository;\n }",
"function _versioncontrol_git_process_tags($repository, $new_tags) {\n $tag_ops = _versioncontrol_git_get_tag_operations($repository, $new_tags);\n foreach ($tag_ops as $tag_op) {\n $op_items = array();\n versioncontrol_insert_operation($tag_op, $op_items);\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'revisions' => array($tag_op['revision'])\n );\n $tag_commits = versioncontrol_get_operations($constraints);\n foreach ($tag_commits as $vc_op_id => $tag_commit_op) {\n $tag_commit_op['labels'][] = array(\n 'name' => $tag_op['labels'][0]['name'],\n 'action' => VERSIONCONTROL_ACTION_MODIFIED,\n 'type' => VERSIONCONTROL_OPERATION_TAG\n );\n versioncontrol_update_operation_labels($tag_commit_op, $tag_commit_op['labels']);\n }\n }\n}",
"protected function getLatestTagUrl($repository, $default = 'master')\n {\n $file = @json_decode(@file_get_contents(\"https://api.github.com/repos/$repository/tags\", false,\n stream_context_create(['http' => ['header' => \"User-Agent: Vestibulum\\r\\n\"]])\n ));\n return sprintf(\"https://github.com/$repository/archive/%s.zip\", $file ? reset($file)->name : $default);\n }",
"public function __construct(TagRepository $repo)\n {\n $this->repo = $repo;\n }",
"public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }",
"function _versioncontrol_git_log_parse_tag_info($repository, &$logs, $tag_commits) {\n $line = next($logs); // Get op type\n if ($line === FALSE) {\n return FALSE;\n }\n if ($line == 'commit') {\n //let's get the author and the date from the tagged commit, better than nothing.\n $tagged_commit = next($logs); // Get the tagged commit\n $tag_name = substr(strrchr(next($logs), '/'), 1 ); // Get the name of the tag based on %(refname)\n next($logs); // Skip these two lines\n next($logs);\n // Get the tag/commit message\n $message = '';\n $i = 0;\n while (($line = next($logs)) !== FALSE) {\n if ($line == 'ENDOFGITTAGOUTPUTMESAGEHERE') {\n break;\n }\n if ($i == 1) {\n $message .= \"\\n\";\n }\n $message .= $line .\"\\n\";\n $i++;\n }\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'revisions' => array($tagged_commit)\n );\n $op = versioncontrol_get_operations($constraints);\n $op = array_pop($op);\n return array(\n 'type' => VERSIONCONTROL_OPERATION_TAG,\n 'repository' => $repository,\n 'date' => $op['date']+1, // We want to be displayed *after* the tagged commit.\n 'username' => $op['username'],\n 'message' => $message,\n 'revision' => $tagged_commit,\n 'labels' => array(\n 0 => array(\n 'name' => $tag_name,\n 'type' => VERSIONCONTROL_OPERATION_TAG,\n 'action' => VERSIONCONTROL_ACTION_ADDED\n )\n )\n );\n }\n $line = next($logs); // Skip op sha1\n $tag_name = substr(strrchr(next($logs), '/'), 1 ); // Get the name of the tag based on %(refname)\n $tagger = next($logs); // Get tagger\n $date = strtotime(next($logs)); // Get date\n // Get the tag message\n $message = '';\n $i = 0;\n while (($line = next($logs)) !== FALSE) {\n if ($line == 'ENDOFGITTAGOUTPUTMESAGEHERE') {\n break;\n }\n if ($i == 1) {\n $message .= \"\\n\";\n }\n $message .= $line .\"\\n\";\n $i++;\n }\n $tagged_commit = $tag_commits[$tag_name];\n // By now, we're done with the parsing, construct the op array\n return array(\n 'type' => VERSIONCONTROL_OPERATION_TAG,\n 'repository' => $repository,\n 'date' => $date,\n 'username' => $tagger,\n 'message' => $message,\n 'revision' => $tagged_commit,\n 'labels' => array(\n 0 => array(\n 'name' => $tag_name,\n 'type' => VERSIONCONTROL_OPERATION_TAG,\n 'action' => VERSIONCONTROL_ACTION_ADDED\n )\n )\n );\n}",
"public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }",
"public function tagged( $tag );",
"public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }",
"public function setUpRepository($repository) {\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$repository->getPath();\n $this->getDriver()->activateHook('post-update', $path);\n $this->deployPostReceive($path);\n $id = $this->getDao()->save($repository);\n $repository->setId($id);\n $this->setUpMailingHook($repository);\n $this->changeRepositoryAccess($repository);\n $this->setRepositoryPermissions($repository);\n return true;\n }",
"function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}",
"public function undo_tag() {\n\t\t$version = $this->conf['common']['releasever'];\n\t\t$tag = str_replace( '$1', $version, $this->conf['common']['tagname'] );\n\n\t\tforeach ( $this->conf['extensions'] as $ext => $checkout ) {\n\t\t\tchdir( \"{$this->dir}/extensions/$ext\" );\n\t\t\t$cTag = escapeshellarg( $tag );\n\t\t\texec( \"git checkout master\" );\n\t\t\texec( \"git tag -d $cTag\" );\n\t\t\t$cTag = escapeshellarg( \":refs/tags/$tag\" );\n\t\t\texec( \"git push origin $cTag\" );\n\t\t}\n\t}",
"abstract public function translate_short_repo_url($repo, $tag);",
"private function oembed_github_repo ( $owner, $repository ) {\n\t\t$repo = $this->api->get_repo( $owner, $repository );\n\t\t$commits =$this->api->get_repo_commits( $owner, $repository );\n\n\t\t$response = new stdClass();\n\t\t$response->type = 'rich';\n\t\t$response->width = '10';\n\t\t$response->height = '10';\n\t\t$response->version = '1.0';\n\t\t$response->title = $repo->description;\n\n\t\t// @TODO This should all be templated\n\t\t$response->html = '<div class=\"github-embed github-embed-repository\">';\n\t\t$response->html .= '<p><a href=\"' . esc_attr( $repo->html_url ) . '\" target=\"_blank\"><strong>' . esc_html( $repo->description ) . '</strong></a><br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url ) . '\" target=\"_blank\">' . esc_html( $repo->html_url ) . '</a><br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/network' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->forks_count ) ) . '</a> forks.<br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/stargazers' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->stargazers_count ) ) . '</a> stars.<br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/issues' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->open_issues_count ) ) . '</a> open issues.<br/>';\n\n\t\tif ( count( $commits ) ) {\n\t\t\t$cnt = 0;\n\t\t\t$response->html .= 'Recent commits:';\n\t\t\t$response->html .= '<ul class=\"github_commits\">';\n\t\t\tforeach ( $commits as $commit ) {\n\t\t\t\tif ( $cnt > 4 ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$response->html .= '<li class=\"github_commit\">';\n\t\t\t\t$response->html .= '<a href=\"https://github.com/' . $owner . '/' . $repository . '/commit/' . esc_attr( $commit->sha ) . '\" target=\"_blank\">' . esc_html( $commit->commit->message ) . '</a>, ';\n\t\t\t\t$response->html .= esc_html( $commit->commit->committer->name );\n\t\t\t\t$response->html .= '</li>';\n\t\t\t\t$cnt++;\n\t\t\t}\n\t\t\t$response->html .= '</ul>';\n\t\t}\n\t\t$response->html .= '</p>';\n\t\t$response->html .= '</div>';\n\t\theader( 'Content-Type: application/json' );\n\t\techo json_encode( $response );\n\t\tdie();\n\t}",
"public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}",
"public function getName()\n\t{\n\t\treturn 'git';\n\t}",
"public function repoLink(Repository $repo)\n {\n return $this->Html->link($repo->name, 'https://github.com/' . $repo->name);\n }",
"public function createRepo(string $repo = null)\n {\n $end = $this->getVendorType() === 'org'\n ? '/orgs/' . $this->getVendor() . '/repos'\n : '/user/repos';\n $res = $this->request('POST', $end, [\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n ]);\n if (Helper::isResponseOk($res)) {\n echo \"\\ngit remote add origin [email protected]:{$this->getFullName()}.git\\n\";\n echo \"git push -u origin master\\n\";\n }\n\n return $res;\n }",
"protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }",
"public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}",
"private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}",
"function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}",
"public function verify($tag)\n {\n $builder = $this->git->getProcessBuilder()\n ->add('tag')\n ->add('-v');\n\n if (!is_array($tag) && !($tag instanceof \\Traversable)) {\n $tag = [$tag];\n }\n\n foreach ($tag as $value) {\n $builder->add($value);\n }\n\n $this->git->run($builder->getProcess());\n }",
"function git_move_tag($path, $tag, $version = 'HEAD') {\n\tGitUtil::moveTag($path, $tag, $version);\n}",
"public function delete($tag)\n {\n $builder = $this->git->getProcessBuilder()\n ->add('tag')\n ->add('-d');\n\n if (!is_array($tag) && !($tag instanceof \\Traversable)) {\n $tag = [$tag];\n }\n\n foreach ($tag as $value) {\n $builder->add($value);\n }\n\n $this->git->run($builder->getProcess());\n }"
]
| [
"0.60580647",
"0.5574278",
"0.556409",
"0.549926",
"0.5496575",
"0.5474676",
"0.54705894",
"0.5448116",
"0.5447197",
"0.53421164",
"0.5339263",
"0.53236586",
"0.5240002",
"0.52297854",
"0.5228689",
"0.52079755",
"0.52000946",
"0.5195025",
"0.51823694",
"0.51476246",
"0.5138219",
"0.51311636",
"0.5115204",
"0.51146436",
"0.5088652",
"0.5063177",
"0.5058362",
"0.50228274",
"0.5021037",
"0.4996897"
]
| 0.6686038 | 0 |
Update the repo at the given path to the lastest source in remote 'origin' on branch 'master'. | function git_update($path) {
$status = GitUtil::update($path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function update($path, $remote = 'origin', $branch = 'master') {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$fetchCmd = sprintf(self::FETCH_CMD_TMPL, $remote);\n\t\tpassthru($fetchCmd);\n\n\t\t$mergeCmd = sprintf(self::MERGE_CMD_TMPL, $remote, $branch);\n\t\tpassthru($mergeCmd);\n\n\t\tchdir($origCwd);\n\t}",
"function rpull() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path, BR;\n\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\ttry {\n\t\t\t\t$exists = $this->rexists($deployPath);\n\t\t\t\tif ($exists) {\n\t\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && hg pull';\n\t\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t\t} else {\n\t\t\t\t\techo TAB, '*** path ', $deployPath, ' does not exist', BR;\n\t\t\t\t}\n\t\t\t} catch (\\SystemCommandException $e) {\n\t\t\t\techo 'Error: '.$e, BR;\n\t\t\t}\n\t\t}\n\t}",
"function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}",
"function rupdate() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t$branch = $this->branch ?: 'default';\n\t\t$remoteCmd = 'cd '.$deployPath.' && hg update -r '.$branch;\n\t\t$this->ssh_exec($remoteCmd);\n\t}",
"protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }",
"public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }",
"function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}",
"public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}",
"public function gitPull ()\n {\n\n $this->updates[ ] = Hallmark_Misc::shell ( 'git pull ' . Hallmark_Misc::removeQuotes ( Hallmark_Misc::args () ) );\n\n }",
"function updateSourceBranching() {\n if ($this->isModuleInstalled('source')) {\n try {\n $source_commits_table = TABLE_PREFIX . 'source_commits';\n $commit_project_objects_table = TABLE_PREFIX . 'commit_project_objects';\n $source_repositories_table = TABLE_PREFIX . 'source_repositories';\n\n DB::execute(\"ALTER TABLE $source_commits_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER commited_by_email\");\n DB::execute(\"ALTER TABLE $commit_project_objects_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER revision\");\n\n // Add default branch for existing data\n\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'master' WHERE type = 'GitCommit'\");\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'default' WHERE type = 'MercurialCommit'\");\n\n $commit_project_objects = DB::execute(\"\n SELECT $commit_project_objects_table.id, $source_repositories_table.type\n FROM $commit_project_objects_table, $source_repositories_table\n WHERE $commit_project_objects_table.repository_id = $source_repositories_table.id\"\n );\n\n if (is_foreachable($commit_project_objects)) {\n foreach ($commit_project_objects as $commit_project_object) {\n if ($commit_project_object['type'] == 'GitRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'master' WHERE id = ?\", $commit_project_object['id']);\n } //if\n if ($commit_project_object['type'] == 'MercurialRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'default' WHERE id = ?\", $commit_project_object['id']);\n } //if\n } //foreach\n } //if\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('default_source_branch', 'source', 'N;')\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n } //if\n return true;\n }",
"public function update($path = null)\n {\n $this->executeNpm(array('update'), $path);\n }",
"public function repo($dir, $remote);",
"protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }",
"public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }",
"private function githubSyncProcess()\n\t{\n\n\t\t// Delete any existing file.\n\t\tif(file_exists(e_TEMP.\"e107-master.zip\"))\n\t\t{\n\t\t\tunlink(e_TEMP.\"e107-master.zip\");\n\t\t}\n\n\t\t$result = e107::getFile()->getRemoteFile('https://codeload.github.com/e107inc/e107/zip/master', 'e107-master.zip', 'temp');\n\n\t\tif($result == false)\n\t\t{\n\t\t\te107::getMessage()->addError( DBLAN_118 );\n\t\t}\n\n\n\t\t$localfile = 'e107-master.zip';\n\n\t\tchmod(e_TEMP.$localfile, 0755);\n\t\trequire_once(e_HANDLER.\"pclzip.lib.php\");\n\n//\t$base = realpath(dirname(__FILE__));\n\n\n\t\t$newFolders = array(\n\t\t\t'e107-master/e107_admin/' => e_BASE.e107::getFolder('ADMIN'),\n\t\t\t'e107-master/e107_core/' => e_BASE.e107::getFolder('CORE'),\n\t\t\t'e107-master/e107_docs/' => e_BASE.e107::getFolder('DOCS'),\n\t\t\t'e107-master/e107_handlers/' => e_BASE.e107::getFolder('HANDLERS'),\n\t\t\t'e107-master/e107_images/' => e_BASE.e107::getFolder('IMAGES'),\n\t\t\t'e107-master/e107_languages/' => e_BASE.e107::getFolder('LANGUAGES'),\n\t\t\t'e107-master/e107_media/' => e_BASE.e107::getFolder('MEDIA'),\n\t\t\t'e107-master/e107_plugins/' => e_BASE.e107::getFolder('PLUGINS'),\n\t\t\t'e107-master/e107_system/' => e_BASE.e107::getFolder('SYSTEM'),\n\t\t\t'e107-master/e107_themes/' => e_BASE.e107::getFolder('THEMES'),\n\t\t\t'e107-master/e107_web/' => e_BASE.e107::getFolder('WEB'),\n\t\t\t'e107-master/' => e_BASE\n\t\t);\n\n\t\t$srch = array_keys($newFolders);\n\t\t$repl = array_values($newFolders);\n\n\t\t$archive \t= new PclZip(e_TEMP.$localfile);\n\t\t$unarc \t\t= ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.\n\n\t\t$error = array();\n\t\t$success = array();\n\t\t$skipped = array();\n//\tprint_a($unarc);\n\n\n\t\t$excludes = array('e107-master/','e107-master/install.php','e107-master/favicon.ico');\n\n\t\tforeach($unarc as $k=>$v)\n\t\t{\n\t\t\tif(in_array($v['stored_filename'],$excludes))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$oldPath = $v['filename'];\n\t\t\t$newPath = str_replace($srch,$repl, $v['stored_filename']);\n\n\t\t\t$message = e107::getParser()->lanVars(DBLAN_121, array('x'=>$oldPath, 'y'=>$newPath));\n\n\t\t\tif($v['folder'] ==1 && is_dir($newPath))\n\t\t\t{\n\t\t\t\t// $skipped[] = $newPath. \" (already exists)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(!rename($oldPath,$newPath))\n\t\t\t{\n\t\t\t\t$error[] = $message;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$success[] = $message;\n\t\t\t}\n\n\n\t\t\t//\techo $message.\"<br />\";\n\n\t\t}\n\n\t\tif(!empty($success))\n\t\t{\n\t\t\te107::getMessage()->addSuccess(print_a($success,true));\n\t\t}\n\n\t\tif(!empty($skipped))\n\t\t{\n\t\t\te107::getMessage()->setTitle(\"Skipped\",E_MESSAGE_INFO)->addInfo(print_a($skipped,true));\n\t\t}\n\n\t\tif(!empty($error))\n\t\t{\n\t\t\te107::getMessage()->addError(print_a($error,true));\n\t\t}\n\n\n\n\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_112, e107::getMessage()->render());\n\n\t}",
"public function pullRepo($branchName = null) {\n\n if(is_null($branchName)){\n // pull all branches\n \\Utils::gitCommand('pull --all');\n exec('git pull --all', $pullop);\n // fetch all brnaches\n \\Utils::gitCommand('fetch --all');\n// exec('git fetch --all', $pullop);\n }else{\n // checkout to the branch which we have to pull.\n// exec('git checkout ' . $branchName, $op);\n \\Utils::gitCommand('checkout ' . $branchName);\n $this->output('Checkout to ' . $branchName);\n // pull all branches\n \\Utils::gitCommand('pull --all');\n// exec('git pull --all', $pullop);\n // fetch all brnaches\n \\Utils::gitCommand('fetch --all');\n// exec('git fetch --all', $pullop);\n // reset all local files and make exact copy of remote\n \\Utils::gitCommand('reset --hard origin/' . $branchName);\n// exec('git reset --hard origin/' . $branchName, $pullop);\n /*\n * Go back to master.\n */\n if ($branchName !== 'master') {\n// exec('git checkout master');\n \\Utils::gitCommand('checkout master');\n }\n }\n }",
"function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}",
"public function update() {\n\t\t$webhook_secret = $this->config->item ( 'github_webhook_secret' );\n\t\t$client_id = $this->config->item ( 'github_client_id' );\n\t\t$client_secret = $this->config->item ( 'github_client_secret' );\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_HUB_SIGNATURE'] )) {\n\t\t\tthrow new \\Exception ( \"HTTP header 'X-Hub-Signature' is missing.\" );\n\t\t} elseif (! extension_loaded ( 'hash' )) {\n\t\t\tthrow new \\Exception ( \"Missing 'hash' extension to check the secret code validity.\" );\n\t\t}\n\t\t\n\t\tlist ( $algo, $hash ) = explode ( '=', $_SERVER ['HTTP_X_HUB_SIGNATURE'], 2 ) + array (\n\t\t\t\t'',\n\t\t\t\t'' \n\t\t);\n\t\tif (! in_array ( $algo, hash_algos (), TRUE )) {\n\t\t\tthrow new \\Exception ( \"Hash algorithm '$algo' is not supported.\" );\n\t\t}\n\t\t$rawPost = file_get_contents ( 'php://input' );\n\t\tif ($hash !== hash_hmac ( $algo, $rawPost, $webhook_secret )) {\n\t\t\tthrow new \\Exception ( 'Hook secret does not match.' );\n\t\t}\n\t\t\n\t\t$url = \"https://api.github.com/users/UoLCompSoc/repos?per_page=10&client_id=\" . $client_id . \"&client_secret=\" . $client_secret;\n\t\t\n\t\t$decoded = json_decode ( $this->_getContent ( $url ) );\n\t\t\n\t\t$github_data = array ();\n\t\t\n\t\tforeach ( $decoded as $repo ) {\n\t\t\tif ($repo->fork === TRUE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$collaborators = json_decode ( $this->_getContent ( $repo->contributors_url ) );\n\t\t\t$repo->collaborator_count = sizeof ( $collaborators );\n\t\t\t\n\t\t\tarray_push ( $github_data, $repo );\n\t\t}\n\t\t\n\t\t$filepath = APPPATH . 'cache/repocache.json';\n\t\t\n\t\tif (! write_file ( $filepath, json_encode ( $github_data ), 'w' )) {\n\t\t\tlog_message ( 'error', 'Cannot write to github cache file at ' . $filepath );\n\t\t}\n\t\t\n\t\t// $this->load->view ( 'admin' );\n\t}",
"function do_pull($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git reset --hard; git pull' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}",
"function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}",
"public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}",
"public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }",
"public function actionUpdate(): int\n {\n try {\n GithubCache::flush();\n\n $service = GithubService::getInstance();\n $service->saveCache();\n } catch (Exception $e) {\n throw $e;\n }\n\n return ExitCode::OK;\n }",
"function upstreamupdate(array $args, array $assoc_args) {\n\n $path = 'code-upstream-updates';\n $data = array(\n // update database with latest schema\n 'updatedb' => (array_key_exists(\"updatedb\", $assoc_args)?$assoc_args['updatedb']:false),\n // default is to allow updates to parent repo to overwrite local\n 'xoption' => (array_key_exists(\"xoption\")) ? $assoc_args['updatedb'] : 'theirs',\n );\n //TODO: format output\n\n return $this->terminus_request(\"site\", $this->_siteInfo->site_uuid, $path, \"POST\", $data);\n }",
"private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }",
"public function update($path);",
"public function testUpdateRefresh(): void\n {\n $fixturesSet = 'TUFTestFixtureSimple';\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n $updater = $this->getSystemInTest();\n // This refresh should succeed.\n $updater->refresh();\n // Put the server-side repo into an invalid state.\n $this->testRepo->removeRepoFile('timestamp.json');\n // The updater is already refreshed, so this will return early, and\n // there should be no changes to the client-side repo.\n $updater->refresh();\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n // If we force a refresh, the invalid state of the server-side repo will\n // raise an exception.\n $this->expectException(RepoFileNotFound::class);\n $this->expectExceptionMessage('File timestamp.json not found.');\n $updater->refresh(true);\n }",
"function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}",
"protected function pullRepo()\n {\n assert(valid_num_args());\n\n $pull = new GitHubPullProcess($this->config, $this->env, $this->output);\n $pull->execute();\n }",
"public function testBitBucketRemoteRepository(): void\n {\n $repo = new BitBucketRemoteRepository('r/r', './');\n $this->assertEquals('https://bitbucket.org/r/r/src/v2/src/Project.php#Project.php-30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }"
]
| [
"0.603045",
"0.6028529",
"0.5827696",
"0.5796254",
"0.5778401",
"0.5763131",
"0.5744453",
"0.5693124",
"0.5639715",
"0.5480545",
"0.54128385",
"0.53621596",
"0.52215326",
"0.52076477",
"0.5189084",
"0.5146988",
"0.51326084",
"0.5106173",
"0.5095776",
"0.50299835",
"0.49656415",
"0.48911536",
"0.48876703",
"0.48853055",
"0.48565218",
"0.48556492",
"0.4847602",
"0.4829154",
"0.4800721",
"0.47790748"
]
| 0.62043124 | 0 |
Update the specified git repo's submodule's. | function git_update_submodules($path) {
$status = GitUtil::updateExternals($path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}",
"protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }",
"public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }",
"public function update(Request $request, $id)\n {\n $user = $this->check_user->getUserAuthenticated($request->token);\n \n $checkRole = $user->verifyRoleAuthorization($user->id);\n $checkPermission = $user->verifyPermissionAuthorization('submodule_update', ['self', 'all']);\n\n if (!$checkRole || !$checkPermission) {\n return response()->json(['message' => __('messages.no_permission'), 'status' => 'error'], 401);\n }\n\n try {\n\t\t $dataSubmodule = [\n 'name' => $request->name,\n 'description' => $request->description,\n 'id' => $request->module\n ];\n\t\t $validated = $this->validator($dataSubmodule);\n\n\t \tif ($validated->fails()) {\n $errors = $this->parseErrors($validated->errors());\n\t \t\treturn response()->json(['message' => $errors, 'status' => 'error'], 400);\n\t \t}\n\n\t\t\t$input = $dataSubmodule; \n\t \t$submodule = $this->submodules->find($id);\n\n if (!$submodule) {\n\t \t\treturn response()->json(['message' => __('messages.submodule_not_found'), 'status' => 'error'], 404);\n }\n \n $submodule->fill($input); \n \n $module = Module::find($request->module);\n $submodule->module()->dissociate();\n $submodule->module()->associate($module);\n $submodule->save();\n\t\t\tstoreLogActivity('submodule_update', $user->id);\n \treturn response()->json(['message' => __('messages.submodule_update_success'), 'status' => 'success'], 200); \n\n \t} catch (Exception $e) {\n return response()->json(['message' => __('messages.submodule_update_error'), 'status' => 'error']);\n \t}\n }",
"public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}",
"function git_update($path) {\n\t$status = GitUtil::update($path);\n}",
"function git_init_submodules($path) {\n\tGitUtil::initSubmodules($path);\n}",
"private function update_modules()\n\t{\n\t\tee()->db->select('module_name, module_version');\n\t\t$query = ee()->db->get('modules');\n\n\t\tforeach ($query->result() as $row)\n\t\t{\n\t\t\t$module = strtolower($row->module_name);\n\n\t\t\t// Only update first-party modules\n\t\t\tif ( ! in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Send version to update class and let it do any required work\n\t\t\tif (in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\t$path = EE_APPPATH.'/modules/'.$module.'/';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$path = PATH_THIRD.$module.'/';\n\t\t\t}\n\n\t\t\tif (file_exists($path.'upd.'.$module.'.php'))\n\t\t\t{\n\t\t\t\t$this->load->add_package_path($path);\n\n\t\t\t\t$class = ucfirst($module).'_upd';\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\trequire $path.'upd.'.$module.'.php';\n\t\t\t\t}\n\n\t\t\t\t$UPD = new $class;\n\t\t\t\t$UPD->_ee_path = EE_APPPATH;\n\n\t\t\t\tif ($UPD->version > $row->module_version && method_exists($UPD, 'update') && $UPD->update($row->module_version) !== FALSE)\n\t\t\t\t{\n\t\t\t\t\tee()->db->update('modules', array('module_version' => $UPD->version), array('module_name' => ucfirst($module)));\n\t\t\t\t}\n\n\t\t\t\t$this->load->remove_package_path($path);\n\t\t\t}\n\t\t}\n\t}",
"public static function gitUpdate()\n {\n // The commands\n $commands = array(\n 'echo $PWD',\n 'whoami',\n 'git update-index --skip-worktree common/config/options.php',\n 'git reset --hard HEAD',\n 'git pull origin master',\n 'git status',\n 'git submodule sync',\n 'git submodule update',\n 'git submodule status',\n );\n // Run the commands for output\n $output = '';\n foreach ($commands as $command) {\n // Run it\n $tmp = shell_exec($command);\n // Output\n $output .= \"<span style=\\\"color: #6BE234;\\\">\\$</span> <span style=\\\"color: #729FCF;\\\">{$command}\\n</span>\";\n $output .= htmlentities(trim($tmp)) . \"\\n\";\n }\n return $output;\n }",
"function update() {\n\t\t$CLI_url = escapeshellarg($this->URL);\n\n\t\t// Update LatestRev\n\t\tif($this->NeedsLatestRev) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn info --xml $CLI_url &> /dev/stdout\", $output, $retVal);\n\t\t\tif($retVal == 0 && preg_match(\"/\\<\\?xml/\", $output[0])) {\n\t\t\t\ttry {\n\t\t\t\t\t$info = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\tif($info->entry->commit['revision']) {\n\t\t\t\t\t\t$this->LatestRevPacked = (string)$info->entry->commit['revision'];\n\t\t\t\t\t\t$this->LatestDatePacked = (string)$info->entry->commit->date;\n\t\t\t\t\t}\n\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\tuser_error($e, E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t// Update ChildDirs\n\t\tif($this->NeedsChildDirs) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn ls --xml $CLI_url\", $output, $retVal);\n\t\t\tif($retVal == 0) {\n\t\t\t\t$subdirs = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\n\t\t\t\tif($subdirs) {\n\t\t\t\t\t$subdirInfo = array();\n\t\t\t\t\tforeach($subdirs->xpath('//entry') as $entry) {\n\t\t\t\t\t\t$name = (string)$entry->name;\n\t\t\t\t\t\t$date = (string)$entry->commit->date;\n\t\t\t\t\t\t$rev = (string)$entry->commit['revision'];\n\t\t\t\t\t\n\t\t\t\t\t\t$subdirInfo[$name] = array('date' => $date, 'rev' => $rev);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->ChildDirsPacked = serialize($subdirInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t$this->write();\n\t\t\n\t}",
"function testUpdatePackageTree() {\n\t\t$packages = array('cake', 'model', 'datasource', 'dbo');\n\t\t$result = (bool) $this->ApiPackage->updatePackageTree($packages);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->ApiPackage->findAllByParentId(4);\n\t\t$this->assertEqual(count($result), 2);\n\n\t\t$packages = array('cake', 'model', 'datasource', 'dbo');\n\t\t$result = (bool) $this->ApiPackage->updatePackageTree($packages);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->ApiPackage->findAllBySlug('model');\n\t\t$this->assertEqual(count($result), 1, 'Too many model slugs');\n\t}",
"function rupdate() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t$branch = $this->branch ?: 'default';\n\t\t$remoteCmd = 'cd '.$deployPath.' && hg update -r '.$branch;\n\t\t$this->ssh_exec($remoteCmd);\n\t}",
"public function modules($like=array(),$options=array()){\n\t\t$action = array_shift($like);\n\t\tif(isset($options['server'])){\n\t\t\t$server = $options['server'];\n\t\t}else{\n\t\t\t$server = 'nthalk.com';\n\t\t}\n\t\tif($action == 'uninstall'){\n\t\t\t$module = array_shift($like);\n\t\t\t$module_dir = Framework::moduleInstalled($module);\n\t\t\tif(!$module_dir){\n\t\t\t\t$this->write(\"Module does not appear to be installed: $module\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->write(\"Uninstalling: $module\\n\");\n\t\t\t\n\t\t\t$this->write(\"Running uninstall scripts...\\n\");\n\t\t\tif(method_exists($module,'uninstall')){\n\t\t\t\tif(!call_user_func(array($module,'uninstall'))||isset($options['force'])){\n\t\t\t\t\t$this->write(\"Uninstaller failed... Please inspect $module::uninstall() before completely removing or supply --force\\n\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->write(\"Removing submodule from app/.git cache...\\n\");\n\t\t\t$cmd = 'git rm --cached ' . $module_dir;\n\t\t\t//$this->write($cmd . \"\\n\");\n\t\t\t$cmd_p = popen($cmd,'r');\n\t\t\t$this->write(fread($cmd_p,10000). \"\\n\");\n\t\t\t\n\t\t\t$dir = SERVER_APP_DIR;\n\t\t\t$git_submodules_file = $dir .'/.gitmodules';\n\t\t\tif(file_exists($git_submodules_file)){\n\t\t\t\t$git_submodules = file_get_contents($git_submodules_file);\n\t\t\t\t$match = \"/\\[submodule.*$module\\\"\\]\\s+path.*\\s+url.*\\s?/\";\n\t\t\t\tif(preg_match($match,$git_submodules)){\n\t\t\t\t\t$git_submodules_new = preg_replace($match,'',$git_submodules);\n\t\t\t\t\t$git_submodules_new = preg_replace(\"/\\n+/\",\"\\n\",$git_submodules_new );\n\t\t\t\t\t$this->write(\"Removing submodule from submodules...\\n\");\n\t\t\t\t\t//$this->write($git_submodules_new . \"\\n\");\n\t\t\t\t\tfile_put_contents($git_submodules_file,$git_submodules_new);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$git_conf_file = $dir . '/.git/config';\n\t\t\tif(file_exists($git_conf_file)){\n\t\t\t\t$git_conf = file_get_contents($git_conf_file);\n\t\t\t\t$match = \"/\\[submodule.*$module\\\"\\](\\s+path.*|\\s+url.*)+?\\s?/\";\n\t\t\t\tif(preg_match($match,$git_conf)){\n\t\t\t\t\t$git_conf_new = preg_replace($match,'',$git_conf);\n\t\t\t\t\t$git_conf_new = preg_replace(\"/\\n+/\",\"\\n\",$git_conf_new);\n\t\t\t\t\t$this->write(\"Removing submodule from config...\\n\");\n\t\t\t\t\t//$this->write($git_conf_new . \"\\n\");\n\t\t\t\t\tfile_put_contents($git_conf_file,$git_conf_new);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->write(\"Removing submodule from file system...\\n\");\n\t\t\t$cmd = 'rm -rf ' . $module_dir;\n\t\t\t//$this->write($cmd . \"\\n\");\n\t\t\t$cmd_p = popen($cmd,'r');\n\t\t\t$this->write(fread($cmd_p,10000). \"\\n\");\n\t\t\t\n\t\t\t$this->write(\"Done. It is up to you to commit this change into your app repo...\\n\");\n\t\t\t\n\t\t}else if($action == 'list'){\n\t\t\t$this->write(\"Currently installed modules:\\n\\n\");\n\t\t\tforeach(Framework::moduleList(array_shift($like)) as $module){\n\t\t\t\t$this->write(\n\t\t\t\t\t' ' . $module . ' -' .$this->getDocumentation(new ReflectionClass($module))\n\t\t\t\t);\n\t\t\t}\n\t\t\t$this->write(\"\\n\");\n\t\t}else if($action =='list-remote'){\n\t\t\t$content = file_get_contents(\"http://$server/Packages\");\n\t\t\t$packages = json_decode($content);\n\t\t\tif(!is_array($packages)){\n\t\t\t\t$this->write('Error retrieving data from module server: '.$server.\"\\n\");\n\t\t\t}else{\n\t\t\t\tforeach($packages as $package){\n\t\t\t\t\t$this->write($package->name . \" - \" . $package->version . \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}else if($action =='install'){\n\t\t\tif(realpath(getcwd()) !== SERVER_APP_DIR){\n\t\t\t\t$this->write(\"fatal: You must install modules from the root of your app dir ( \".SERVER_APP_DIR.\" )\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$content = file_get_contents(\"http://$server/Packages\");\n\t\t\t$packages = json_decode($content);\n\t\t\tif(!is_array($packages)){\n\t\t\t\t$this->write('Error retrieving data from module server: '.$server.\"\\n\");\n\t\t\t\texit -1;\n\t\t\t}else{\n\t\t\t\t$what = array_shift($like);\n\t\t\t}\n\t\t\tforeach($packages as $package){\n\t\t\t\tif($package->name == $what){\n\t\t\t\t\t// Define the dir\n\t\t\t\t\t$dir = SERVER_EXT_DIR;\n\t\t\t\t\tif(!file_exists($dir)){\n\t\t\t\t\t\t$dir_parts = explode('/',$dir);\n\t\t\t\t\t\t$curr_dir = '';\n\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t$curr_dir .= '/' . array_shift($dir_parts);\n\t\t\t\t\t\t\tif(!file_exists($curr_dir)){\n\t\t\t\t\t\t\t\tmkdir($curr_dir);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}while(!file_exists($dir));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If app is git repo\n\t\t\t\t\t$app_is_git = file_exists(SERVER_APP_DIR.'/.git');\n\t\t\t\t\t// Install directory\n\t\t\t\t\t$dir .= '/modules/';\n\t\t\t\t\tif(!file_exists($dir)){\n\t\t\t\t\t\tmkdir($dir);\n\t\t\t\t\t}\n\t\t\t\t\t$dir .= $package->name;\n\t\t\t\t\t$dir = substr($dir,strlen(SERVER_APP_DIR)+1);\n\t\t\t\t\tif(isset($options['as-git-submodule'])){\n\t\t\t\t\t\tif(!$app_is_git){\n\t\t\t\t\t\t\t$this->write('fatal: app is not a git repo. Please run `git init` within '.SERVER_APP_DIR.\"\\n\");\n\t\t\t\t\t\t\texit -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$cmd = 'git submodule add ' . $package->git_url . ' ' .$dir;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$cmd = 'git clone --depth 0 ' . $package->git_url . ' ' . $dir;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->write(\"Retrieving package $what...\\t\");\n\t\t\t\t\t$this->write(\"\\ncmd: $cmd\\n\");\n\t\t\t\t\t\n\t\t\t\t\tif(shell_exec($cmd)){\n\t\t\t\t\t\tif(!isset($options['as-git-repo'])&&!isset($options['as-git-submodule'])){\n\t\t\t\t\t\t\tif (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {\n\t\t\t\t\t\t exec( \"rd /s $dir/.git\" );\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \tif(!$app_is_git){\n\t\t\t\t\t\t\t\t\t$this->write('warning: app is not a git repo. Installing modules this way may pollute the framework and prevent you from having your application as a standalone repository. Please run `git init` within app to avoid this warning.'.\"\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t exec( \"rm -rf $dir/.git\" );\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->write(\"[Success]\\n\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the module has a configuration function, run that on install\n\t\t\t\t\t\tif(method_exists($what,'setup')){\n\t\t\t\t\t\t\tcall_user_func_array(array($what,'setup'),array($this->out_stream,$this->in_stream));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->write(\"Package installed!\\n\");\n\t\t\t\t\t\texit;\n\t\t\t\t\t}else{\n\t\t\t\t\t\texit -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->write('Package: ' . json_encode($what) . ' not found.' . \"\\n\");\n\t\t}else{\n\t\t\t$this->write(\"Usage: nth action [ARGS] [[--option=setting]]\\n\\n\");\n\t\t\t$this->write($this->getDocumentation(new ReflectionMethod($this,__FUNCTION__),true));\n\t\t}\n\t}",
"public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}",
"public function update() {\n\t\t$webhook_secret = $this->config->item ( 'github_webhook_secret' );\n\t\t$client_id = $this->config->item ( 'github_client_id' );\n\t\t$client_secret = $this->config->item ( 'github_client_secret' );\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_HUB_SIGNATURE'] )) {\n\t\t\tthrow new \\Exception ( \"HTTP header 'X-Hub-Signature' is missing.\" );\n\t\t} elseif (! extension_loaded ( 'hash' )) {\n\t\t\tthrow new \\Exception ( \"Missing 'hash' extension to check the secret code validity.\" );\n\t\t}\n\t\t\n\t\tlist ( $algo, $hash ) = explode ( '=', $_SERVER ['HTTP_X_HUB_SIGNATURE'], 2 ) + array (\n\t\t\t\t'',\n\t\t\t\t'' \n\t\t);\n\t\tif (! in_array ( $algo, hash_algos (), TRUE )) {\n\t\t\tthrow new \\Exception ( \"Hash algorithm '$algo' is not supported.\" );\n\t\t}\n\t\t$rawPost = file_get_contents ( 'php://input' );\n\t\tif ($hash !== hash_hmac ( $algo, $rawPost, $webhook_secret )) {\n\t\t\tthrow new \\Exception ( 'Hook secret does not match.' );\n\t\t}\n\t\t\n\t\t$url = \"https://api.github.com/users/UoLCompSoc/repos?per_page=10&client_id=\" . $client_id . \"&client_secret=\" . $client_secret;\n\t\t\n\t\t$decoded = json_decode ( $this->_getContent ( $url ) );\n\t\t\n\t\t$github_data = array ();\n\t\t\n\t\tforeach ( $decoded as $repo ) {\n\t\t\tif ($repo->fork === TRUE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$collaborators = json_decode ( $this->_getContent ( $repo->contributors_url ) );\n\t\t\t$repo->collaborator_count = sizeof ( $collaborators );\n\t\t\t\n\t\t\tarray_push ( $github_data, $repo );\n\t\t}\n\t\t\n\t\t$filepath = APPPATH . 'cache/repocache.json';\n\t\t\n\t\tif (! write_file ( $filepath, json_encode ( $github_data ), 'w' )) {\n\t\t\tlog_message ( 'error', 'Cannot write to github cache file at ' . $filepath );\n\t\t}\n\t\t\n\t\t// $this->load->view ( 'admin' );\n\t}",
"public function updateCommand() {\n\t\t$this->browser->setRequestEngine($this->browserRequestEngine);\n\t\t$flowPackages = array();\n\n\t\tforeach ($this->repositories as $baseUrl => $repository) {\n\t\t\t$domain = parse_url($repository, PHP_URL_HOST);\n\t\t\t#$baseUrl = dirname($repository) . '/';\n\t\t\t$basePath = FLOW_PATH_DATA . 'Packages/' . $domain;\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/')) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/');\n\t\t\t}\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/' . $domain)) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/' . $domain);\n\t\t\t}\n\n\t\t\t$response = $this->browser->request($repository);\n\t\t\t$packagesFile = $basePath . '/packages.json';\n\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t$packageList = json_decode($response->getContent());\n\n\t\t\tif (isset($packageList->includes)) {\n\t\t\t\t$includes = get_object_vars($packageList->includes);\n\t\t\t\tif (!empty($includes)) {\n\t\t\t\t\tforeach ($includes as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($packageList->providers)) {\n\t\t\t\t$providers = get_object_vars($packageList->providers);\n\t\t\t\tif (!empty($providers)) {\n\t\t\t\t\tforeach ($providers as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$files = \\TYPO3\\Flow\\Utility\\Files::readDirectoryRecursively($basePath, '.json');\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$packagesObject = json_decode(file_get_contents($file));\n\t\t\t\t$flowPackages = array_merge($flowPackages, $this->filterFlowPackages($packagesObject->packages));\n\t\t\t}\n\t\t}\n\t\t$flowPackagesFile = FLOW_PATH_DATA . 'Packages/packages-typo3-flow.json';\n\t\tfile_put_contents($flowPackagesFile, json_encode($flowPackages));\n\t\t$this->checkForNewPackages($flowPackages);\n\t}",
"function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}",
"function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}",
"public function fbc_module_update()\n\t{\n\t\tif ( ! isset($_POST['run_update']) OR $_POST['run_update'] != 'y')\n\t\t{\n\t\t\t$this->add_crumb(lang('update_fbc_module'));\n\t\t\t$this->cached_vars['form_url'] = $this->cached_vars['base_uri'] . '&method=fbc_module_update';\n\t\t\treturn $this->ee_cp_view('update_module.html');\n\t\t}\n\n\t\trequire_once $this->addon_path.'upd.fbc.php';\n\n\t\t$U = new Fbc_upd();\n\n\t\tif ($U->update() !== TRUE)\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_failure');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_successful');\n\t\t}\n\t}",
"public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}",
"function WebhookPullSubrepository(){\n \n $MagicWord=BlowfishEncrypt('Pull Subrepository From Github');\n if(\n isset($_GET[$MagicWord])\n ){\n $Path=dirname(__FILE__);\n $Path=str_replace('/core','',$Path);\n $Subrepository=BlowfishDecrypt($_GET[$MagicWord]);;\n $Path.=trim($Subrepository);\n \n echo '<p>Pulling Subrepository: '.$Path.'</p>';\n \n if(!is_dir($Path)){\n die('Path not found: '.$Path);\n }\n \n $Command = 'cd '.$Path.' && git reset --hard && git pull';\n echo '<p>'.$Command.'</p><pre>';\n echo shell_exec($Command);\n echo '</pre>';\n \n exit;\n }\n}",
"public function gitPull ()\n {\n\n $this->updates[ ] = Hallmark_Misc::shell ( 'git pull ' . Hallmark_Misc::removeQuotes ( Hallmark_Misc::args () ) );\n\n }",
"function pm_update_packages($update_info, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n $print = '';\n $status = array();\n foreach($update_info as $project) {\n $print .= $project['title'] . \" [\" . $project['name'] . '-' . $project['candidate_version'] . \"], \";\n $status[$project['status']] = $project['status'];\n }\n // We print the list of the projects that need to be updated.\n if (isset($status[UPDATE_NOT_SECURE])) {\n if (isset($status[UPDATE_NOT_CURRENT])) {\n $title = (dt('Security and code updates will be made to the following projects:'));\n }\n else {\n $title = (dt('Security updates will be made to the following projects:'));\n }\n }\n else {\n $title = (dt('Code updates will be made to the following projects:'));\n }\n $print = \"$title \" . (substr($print, 0, strlen($print)-2));\n drush_print($print);\n file_put_contents($tmpfile, \"\\n\\n$print\\n\\n\", FILE_APPEND);\n\n // Print the release notes for projects to be updated.\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array_keys($update_info));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n\n // We print some warnings before the user confirms the update.\n drush_print();\n if (drush_get_option('no-backup', FALSE)) {\n drush_print(dt(\"Note: You have selected to not store backups.\"));\n }\n else {\n drush_print(dt(\"Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.\"));\n drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.'));\n }\n if(!drush_confirm(dt('Do you really want to continue with the update process?'))) {\n return drush_user_abort();\n }\n\n // Now we start the actual updating.\n foreach($update_info as $project) {\n if (empty($project['path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_NO_PROJECT_PATH', dt('The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'])));\n }\n drush_log(dt('Starting to update !project code at !dir...', array('!project' => $project['title'], '!dir' => $project['path'])));\n // Define and check the full path to project directory and base (parent) directory.\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (stripos($project['path'], $project['project_type']) === FALSE || !is_dir($project['full_project_path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path'])));\n }\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project)) {\n return FALSE;\n }\n\n // Package handlers want the name of the directory in project_dir.\n // It may be different to the project name for pm-download.\n // Perhaps we want here filename($project['full_project_path']).\n $project['project_dir'] = $project['name'];\n\n // Run update on one project.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n pm_update_complete($project, $version_control);\n }\n\n return TRUE;\n}",
"public function update($path = null)\n {\n $this->executeNpm(array('update'), $path);\n }",
"public function set_needed_repos(): void {}",
"public function set_needed_repos(): void {}",
"public function update(Group $root);",
"function runUpdate($repo)\n{\n $updNoodle = new Noodle();\n $updNoodle->noodleID = 17;\n $updNoodle->brand = 'FLAVOURS OF THE SUN';\n $updNoodle->flavour = 'COSMIC DUST';\n $updNoodle->instant = 1;\n $updNoodle->nationality = 'OUT OF THIS WORLD';\n $repo->update($updNoodle);\n}",
"public function commitChanges(OutputInterface $output, $modules) {\n\t\t$this->log($output, 'Committing translations to git');\n\t\t\n\t\tforeach($modules as $module) {\n\t\t\t$repo = $module->getRepository();\n\n\t\t\t// Add all changes\n\t\t\t$jsPath = $module->getJSLangDirectory();\n\t\t\t$langPath = $module->getLangDirectory();\n\t\t\tforeach(array_merge((array)$jsPath, (array)$langPath) as $path) {\n\t\t\t\tif(is_dir($path)) {\n\t\t\t\t\t$repo->run(\"add\", array($path . \"/*\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Commit changes if any exist\n\t\t\t$status = $repo->run(\"status\");\n\t\t\tif(stripos($status, 'Changes to be committed:')) {\n\t\t\t\t$this->log($output, \"Comitting changes for module \" . $module->getName());\n\t\t\t\t$repo->run(\"commit\", array(\"-m\", \"Update translations\"));\n\t\t\t}\n\n\t\t\t// Do push if selected\n\t\t\tif($this->push) {\n\t\t\t\t$this->log($output, \"Pushing upstream for module \" . $module->getName());\n\t\t\t\t$repo->run(\"push\", array(\"origin\"));\n\t\t\t}\n\t\t}\n\t}",
"private function _installSubextensions($parent)\n\t{\n\t\t$src = $parent->getParent()->getPath('source');\n\n\t\t$db = JFactory::getDbo();\n\n\t\t$status = new JObject();\n\t\t$status->modules = array();\n\t\t$status->plugins = array();\n\n\t\t// Modules installation\n\n\t\tif(count($this->installation_queue['modules'])) {\n\t\t\tforeach($this->installation_queue['modules'] as $folder => $modules) {\n\t\t\t\tif(count($modules))\n\t\t\t\t\tforeach($modules as $module => $modulePreferences)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Install the module\n\t\t\t\t\t\tif(empty($folder))\n\t\t\t\t\t\t\t$folder = 'site';\n\t\t\t\t\t\t$path = \"$src/modules/$folder/$module\";\n\t\t\t\t\t\tif(!is_dir($path))// if not dir\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$path = \"$src/modules/$folder/mod_$module\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t\t$path = \"$src/modules/$module\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t\t$path = \"$src/modules/mod_$module\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!is_dir($path))\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$fortest='';\n\t\t\t\t\t\t\t//continue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Was the module already installed?\n\t\t\t\t\t\t$sql = $db->getQuery(true)\n\t\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t\t->from('#__modules')\n\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t$db->setQuery($sql);\n\n\t\t\t\t\t\t$count = $db->loadResult();\n\t\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t\t$result = $installer->install($path);\n\t\t\t\t\t\t$status->modules[] = array(\n\t\t\t\t\t\t\t'name'=>$module,\n\t\t\t\t\t\t\t'client'=>$folder,\n\t\t\t\t\t\t\t'result'=>$result,\n\t\t\t\t\t\t\t'status'=>$modulePreferences[1]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// Modify where it's published and its published state\n\t\t\t\t\t\tif(!$count) {\n\t\t\t\t\t\t\t// A. Position and state\n\t\t\t\t\t\t\tlist($modulePosition, $modulePublished) = $modulePreferences;\n\t\t\t\t\t\t\tif($modulePosition == 'cpanel') {\n\t\t\t\t\t\t\t\t$modulePosition = 'icon';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = $db->getQuery(true)\n\t\t\t\t\t\t\t\t->update($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t->set($db->qn('position').' = '.$db->q($modulePosition))\n\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\tif($modulePublished) {\n\t\t\t\t\t\t\t\t$sql->set($db->qn('published').' = '.$db->q('1'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$db->setQuery($sql);\n\t\t\t\t\t\t\t$db->query();\n\n\t\t\t\t\t\t\t// B. Change the ordering of back-end modules to 1 + max ordering\n\t\t\t\t\t\t\tif($folder == 'admin') {\n\t\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t\t$query->select('MAX('.$db->qn('ordering').')')\n\t\t\t\t\t\t\t\t\t->from($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t\t->where($db->qn('position').'='.$db->q($modulePosition));\n\t\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t\t$position = $db->loadResult();\n\t\t\t\t\t\t\t\t$position++;\n\n\t\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t\t$query->update($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t\t->set($db->qn('ordering').' = '.$db->q($position))\n\t\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t\t$db->query();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// C. Link to all pages\n\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t$query->select('id')->from($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t$moduleid = $db->loadResult();\n\n\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t$query->select('*')->from($db->qn('#__modules_menu'))\n\t\t\t\t\t\t\t\t->where($db->qn('moduleid').' = '.$db->q($moduleid));\n\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t$assignments = $db->loadObjectList();\n\t\t\t\t\t\t\t$isAssigned = !empty($assignments);\n\t\t\t\t\t\t\tif(!$isAssigned) {\n\t\t\t\t\t\t\t\t$o = (object)array(\n\t\t\t\t\t\t\t\t\t'moduleid'\t=> $moduleid,\n\t\t\t\t\t\t\t\t\t'menuid'\t=> 0\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$db->insertObject('#__modules_menu', $o);\n\t\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}\n\n\t\t// Plugins installation\n\t\tif(count($this->installation_queue['plugins'])) {\n\t\t\tforeach($this->installation_queue['plugins'] as $folder => $plugins) {\n\t\t\t\tif(count($plugins))\n\t\t\t\tforeach($plugins as $plugin => $published) {\n\t\t\t\t\t$path = \"$src/plugins/$folder/$plugin\";\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/$folder/plg_$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/plg_$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) continue;\n\n\t\t\t\t\t// Was the plugin already installed?\n\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t->from($db->qn('#__extensions'))\n\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($plugin)) .' OR '. ($db->qn('element').' = '.$db->q($plugin)) .' )')\n\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t$count = $db->loadResult();\n\n\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t$result = $installer->install($path);\n\n\t\t\t\t\t$status->plugins[] = array('name'=>$plugin,'group'=>$folder, 'result'=>$result,'status'=>$published);\n\n\n\t\t\t\t\tif($published && !$count) {\n\t\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t\t->update($db->qn('#__extensions'))\n\t\t\t\t\t\t\t->set($db->qn('enabled').' = '.$db->q('1'))\n\t\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($plugin)) .' OR '. ($db->qn('element').' = '.$db->q($plugin)) .' )')\n\t\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// library installation\n\t\tif(!empty($this->installation_queue['libraries']) and count($this->installation_queue['libraries']))\n\t\t {\n\t\t\tforeach($this->installation_queue['libraries'] as $folder=>$status1)\n\t\t\t{\n\n\t\t\t\t\t$path = \"$src/libraries/$folder\";\n\n\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t->from($db->qn('#__extensions'))\n\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($folder)) .' OR '. ($db->qn('element').' = '.$db->q($folder)) .' )')\n\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t$count = $db->loadResult();\n\n\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t$result = $installer->install($path);\n\n\t\t\t\t\t$status->libraries[] = array('name'=>$folder,'group'=>$folder, 'result'=>$result,'status'=>$status1);\n\t\t\t\t\t//print\"<pre>\"; print_r($status->plugins); die;\n\n\t\t\t\t\tif($published && !$count) {\n\t\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t\t->update($db->qn('#__extensions'))\n\t\t\t\t\t\t\t->set($db->qn('enabled').' = '.$db->q('1'))\n\t\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($folder)) .' OR '. ($db->qn('element').' = '.$db->q($folder)) .' )')\n\t\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * 'applications'=>array(\n\t\t\t'easysocial'array(\n\t\t\t\t\t'quick2cartproducts'=>0,\n\t\t\t\t\t'quick2cartstores'=>0\n\n\t\t\t),\n\t\t * */\n\t\t//Application Installations\n\t\tif(file_exists(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php'))\n\t\t{\n\t\t\trequire_once( JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php' );\n\t\t\t$installer = Foundry::get( 'Installer' );\n\t\t\t// The $path here refers to your application path\n\t\t\t$installer->load( $src.\"/plugins/easysocial/easysocial_broadcast\" );\n\t\t\t$plg_install=$installer->install();\n\t\t\t$status->app_install[] = array('name'=>'easysocial_broadcast','group'=>'easysocial_broadcast', 'result'=>$plg_install,'status'=>'1');\n\t\t}\n\n\t\treturn $status;\n\t}"
]
| [
"0.6352754",
"0.62736017",
"0.62188935",
"0.6126489",
"0.61173105",
"0.6097582",
"0.59442025",
"0.58423793",
"0.57919323",
"0.56713325",
"0.5399237",
"0.5386539",
"0.5345828",
"0.5247123",
"0.5239834",
"0.5188823",
"0.5187624",
"0.5172651",
"0.5166288",
"0.51377773",
"0.5131772",
"0.51078904",
"0.5107167",
"0.5086902",
"0.50764215",
"0.50764215",
"0.50330925",
"0.4997766",
"0.49944785",
"0.49906388"
]
| 0.80790377 | 0 |
Automatically pulls folders from the images/photoshop directory, displays | public function makePhotoshopGallery()
{
$imagePath = 'images/photoshop';
$imageFiles = File::allFiles($imagePath);
return view('pages/photoshop')->with(compact('imagePath', 'imageFiles'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show_images(){\n\t\t\t$dir = '../pictures/';\n\t\t\t//checks if is an actual directory, opens it and reads each and returns filename.ext\n\t\t\tif (is_dir($dir)) {\n\t\t\t if ($dh = opendir($dir)) {\n\t\t\t while (($file = readdir($dh)) !== false) {\n\t\t\t \tif( $file == '.' || $file == '..'){//readdir returns ., .. before actual filenames\n \t\tcontinue;//they are ignored\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//href value is to a include file showlarge.inc.php\n\t\t\t\t\t\techo \"<a href=?value=showlarge&value={$file}>\";\n\t\t\t\t\t\techo \"<img class = 'picture' src='{$dir}{$file}'></a>\";\n\t\t\t }\n\t\t\t closedir($dh);\n\t\t\t }\n\t\t\t}\n\t\t}",
"function albums_site_show_images($album) {\n\tglobal $lang;\n\n\tif (!file_exists(ALBUMS_DIR.'/'.$album))\n\t\techo '<p>'.$lang['albums']['doesnt_exist'].'</p>';\n\n\telse {\n\t\t$images = albums_get_images($album);\n\t\tif ($images != FALSE) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"album\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/<?php echo $image['filename_image']; ?>\" rel=\"lytebox[album]\" title=\"<?php echo $image['title']; ?>\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/thumb/<?php echo $image['filename_image']; ?>\" alt=\"<?php echo $image['title']; ?>\" title=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span class=\"albuminfo\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<i><?php echo $image['info']; ?></i>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t\t}\n\t\t\tunset($image);\n\t\t}\n\t}\n}",
"private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }",
"public function actionIndex(){\r\n $q = Yii::app()->request->getParam('q'); \r\n $path = Picture::getBasePath();//.DIRECTORY_SEPARATOR.'article';\r\n if ($q) $path .= DIRECTORY_SEPARATOR.$q;\r\n \r\n if (isset($_FILES) && isset($_FILES['newimage'])){\r\n move_uploaded_file($_FILES['newimage']['tmp_name'], $path.DIRECTORY_SEPARATOR.$_FILES['newimage']['name']);\r\n }\r\n \r\n $parent = '';\r\n if ($q != ''){\r\n $qsplit = explode('/', $q);\r\n unset($qsplit[count($qsplit)-1]);\r\n $parent = implode('/', $qsplit);\r\n }\r\n \r\n $dirs = $files = $images = array();\r\n \r\n $objects = scandir($path);\r\n //print_r($objects); exit;\r\n\r\n foreach ($objects as $obj){\r\n $type = filetype($path.'/'.$obj);\r\n if ($type == 'dir'){\r\n $dirs[] = $obj;\r\n } elseif ($type == 'file') {\r\n $ext = strtolower(pathinfo($path.'/'.$obj, PATHINFO_EXTENSION));\r\n if (in_array($ext, array('jpeg', 'png', 'gif', 'jpg', 'bmp'))){\r\n $images[] = $obj;\r\n } else {\r\n $files[] = $obj;\r\n }\r\n }\r\n }\r\n \r\n $this->renderPartial('_catalog', array(\r\n 'path' => $path,\r\n 'dirs' => $dirs,\r\n 'images' => $images,\r\n 'files' => $files,\r\n 'q' => $q,\r\n 'parent' => $parent,\r\n ));\r\n }",
"function getImagesDirectory($limitImages=0) { \t\t \n if (is_dir($this->config['startingpoint'])) {\n \t\t $images = array(); \n \t\t $images = $this->getFiles($this->config['startingpoint']); \t\n // randomise and limit image items returned from images array\n // also useful to limit items in array to 1 item for use when no javascript in browser\n // if $limitImages=0 then this if statement is bypassed and all images in images array returned for processing\n if ($limitImages>0) {\n \t$images=$this->getSlicedRandomArray($images,0,$limitImages);\n }\n\n $content.= $this->beginGallery($this->cObj->data['uid'],$limitImages);\n\n // read the description from field in flexforms\n \t$caption = explode(\"\\n\",$this->config['text']);\n \n // add the images\n foreach ($images as $key=>$value) {\n $path = $this->config['startingpoint'].$value;\n \n // caption text\n $text =explode('|',$caption[$key]);\n \n // add element to slideshow\n $content.=$this->addImage(\n \t\t\t $path,\n $text[0], \n $text[1],\n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\n \n } # end foreach file\n \n \t\t $content.=$this->endGallery();\n \t\t} # end is_dir \n \t\treturn $content;\n }",
"public function getImages()\n\t\t{\n\t\t\t$this->createDir();\n\t\t\t//sacamos la lista de ficheros de la carpeta photos\n\t\t\t$files = $this->getFileList();\n\t\t\t//array de salida\n\t\t\t$image_List = array();\n\t\t\t\n\t\t\t//recorremos el contenido de esa carpeta\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\t//tiene que ser jpg, gif o png para que muestre las imagenes y que no sea . o ..\n\t\t\t\tif($file!=\".\" && $file!=\"..\" && $this->validatePhoto($file))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//guardo en el array la lista de imagenes\n\t\t\t\t\tarray_push($image_List, $file);\n\t\t\t\t\t\n\t\t\t\t\t//miro si existe la imagen en el thumbs si no lo creo\n\t\t\t\t\tif(!$this->checkIfFileExistes($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t//como NO existe la minituara la creamos\n\t\t\t\t\t\t$this->createThumb(\"$file\");\n\t\t\t\t\t}\n\t\t\t\t\t//mostramos la miniatura y al hacer clic mostramos original \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo \"<a href='\".$this->ruta.\"/$file' target='_blank' ><img src='\".$this->rutaMini.\"/$file'/></a>\";\t\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}",
"function find_images_do_dir($theme, $subdir, $langs)\n{\n $full = (($theme == 'default' || $theme == 'admin') ? get_file_base() : get_custom_file_base()) . '/themes/' . filter_naughty($theme) . '/' . filter_naughty($subdir);\n $out = array();\n\n $_dir = @opendir($full);\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n if ($file[0] != '.') {\n if (is_dir($full . $file)) {\n $out = array_merge($out, find_images_do_dir($theme, $subdir . $file . '/', $langs));\n } else {\n $ext = substr($file, -4);\n if (($ext == '.png') || ($ext == '.gif') || ($ext == '.jpg') || ($ext == 'jpeg')) {\n $_file = explode('.', $file);\n $_subdir = $subdir;\n foreach (array_keys($langs) as $lang) {\n $_subdir = str_replace('/' . $lang . '/', '/', $_subdir);\n }\n $_subdir = preg_replace('#(^|/)images(\\_custom)?/#', '', $_subdir);\n $out[$_subdir . $_file[0]] = cms_rawurlrecode('themes/' . rawurlencode($theme) . '/' . $subdir . rawurlencode($file));\n }\n }\n }\n }\n\n closedir($_dir);\n }\n\n return $out;\n}",
"public function presentation_images()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('presentation_images_model', 'pim');\n\t\t\t$data['presentation_images'] = $this->pim->get_all();\n $data['presentation_act'] = $this->pim->get_link();\n\t\t\t$this->load->view('presentation_images-admin', $data);\n\t\t}",
"function displayImages($albumDir, $whichGallery, $displayMode) {\n\t\t// create var to store name of folder where album of galleries is located\n\t\t$album = $albumDir.'/';\n\t\t\n\t\t//store value of the current target directory\n\t\t$targetGallery = $whichGallery.'/'; //pulled from a function argument 1\n\t\t\n\t\t//set currently selected gallery's pathway\n\t\t$currentGalleryPath = $album.$targetGallery;\n\t\t\n\t\t$large = 'large/'; //large images for cover background images (1800+px)\n\t\t$medium = 'medium/'; //standard size (max = 1100w)\t\n\t\t$small = 'small/'; //thumbnail for lightbox styled gallery (max. - 200w)\n\t\t\n\t\t//store dir to be scanned for contents into an array variable\n\t\t$imageList = scandir($currentGalleryPath.$medium);\n\t\t\n\t\tif (file_exists($currentGalleryPath.$large) &&\n\t\t\tfile_exists($currentGalleryPath.$medium) &&\n\t\t\tfile_exists($currentGalleryPath.$small)\n\t\t\t\n\t\t) {\n\t\t\t\n\t\t\n\t\t//initiate an empty array for unwanted items\n\t\t$unwanted = array();\n\t\t//define acceptable filetypes found in key[2] of getimagesize\n\t\t$acceptable_arrays = array(1,2,3,6,9);\n\t\t//print_r(get_defined_constants());\n\t\t//this defines all constants on the page. Look for imagetype to build array from.\n\t\t\n\t\t//loop through $imageList to remove unwanted items\n\t\tforeach ($imageList as $filename) {\n\t\t\t//check to see if item starts with '.' or if is a directory\n\t\t\tif ((strpos($filename,'.') == 0) || is_dir($filename)) {\n\t\t\t\t//push item into unwanted array\n\t\t\t\tarray_push($unwanted, $filename);\t\n\t\t\t\t//compare current state of $imageList to current state of $unwanted and strip unwanted items from $imageList\n\t\t\t\t$imageList = array_diff($imageList, $unwanted);\n\t\t\t} else {\n\t\t\t\t//store the file info inside $size array using getimagesize\n\t\t\t\t$size = getimagesize($album.$targetGallery.$medium.$filename);\t\n\t\t\t\tif (!$size[2] || !in_array($size[2], $acceptable_arrays)) {\n\t\t\t\t\tarray_push($unwanted, $filename);\t\n\t\t\t\t\t$imageList = array_diff($imageList, $unwanted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t?>\n\t\n\t\t<?php \n\t\t\t// ----- CREATE FILTERING ARRAYS TO BE USED LATER ----- //\n\t\t\t$fileExt = array('.jpg', '.jpeg', '.png', '.bmp', '.gif'); //for stripping extensions for alt text\n\t\t\t$characters = array('-', '_'); //stripping out special characters in filename for alt text\n\t\t\t\n\t\t\t//create $title of album to use for image gallery info below\n\t\t\t$title = ucwords(str_replace($characters,' ', $whichGallery));\n\t\t?>\n\t\t<?php switch ($displayMode) {\n\t\tcase 'img':\n\t\t\t//----- GRAB RANDOM IMAGE FOR IMG -----//\n\t\t\t\t//testing how array_rand() works ... returns numeric key integer\n\t\t\t\t//echo \"THIS IS THE RANDOM KEY PULLED: \";\n\t\t\t\t//$randomKey = array_rand($imageList);\n\t\t\t\t//$image = $imageList[$randomKey];\n\t\t\t\n\t\t\t//grab random image from $imageList\n\t\t\t$image = $imageList[array_rand($imageList)];\n\t\t\t\n\t\t\t//create alt text for image\n\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt));\n\t\t?>\n\t\t<p class=\"random-image\"><img src=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image) ?>\" alt=\"<?php echo $alt ?>\"></p>\n\t\t<hr>\n\t\t<?php break; ?>\n\t\t<?php\n\t\tcase 'background':\n\t\t//----- GRAB RANDOM IMAGE FOR BACKGROUND -----//\n\t\t$image = $imageList[array_rand($imageList)]; ?>\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tbackground: url(<?php echo $currentGalleryPath.$large.rawurlencode($image) ?>) no-repeat center center;\t\n\t\t\t\t-webkit-background-size: cover;\n\t\t\t\t-moz-background-size: cover;\n\t\t\t\t-o-background-size: cover;\n\t\t\t\tbackground-size: cover;\n\t\t\t}\n\t\t</style>\n\t\t<?php break; ?>\n\t\t<?php\n\t\tcase 'lightbox':\n\t\t// ----- GENERATE THUMBNAIL GALLERY ----- //\n\t\t\n\t\t//call out globals for the lightbox switch case\n\t\tglobal $jquery, $lightbox;\n\t\t//test to see if jquery library has been called\n\t\tif (!isset($jquery)) {\n\t\t\techo '<script src=\"js/jquery-3.1.1.min.js\"></script>'.\"\\n\";\n\t\t\t$jquery = true;\n\t\t}\n\t\t//test to see if lightbox library has been called\n\t\tif (!isset($lightbox)) {\n\t\t\techo '<script src=\"js/lightbox.js\"></script>'.\"\\n\";\n\t\t\techo '<link href=\"css/lightbox.css\" rel=\"stylesheet\">'.\"\\n\";\n\t\t\t$lightbox = true;\n\t\t}\n\t\t?>\n\t\t<h2 class=\"gallery\"><?php echo $title; // announce the gallery?></h2>\n\t\t<ul class=\"gallery\">\n\t\t\t<?php\n\t\t\t\tforeach ($imageList as $image){ \n\t\t\t\t\t//create alt text for image\n\t\t\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt));\n\t\t\t?>\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image); ?>\" title=\"<?php echo $alt; ?>\" data-lightbox=\"<?php echo $title; ?>\" >\n\t\t\t\t\t\t<img src=\"<?php echo $currentGalleryPath.$small.rawurlencode($image) ?>\" alt=\"<?php echo $alt; ?>\">\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t<?php } break; ?>\n\t\t</ul>\n \n <?php \n\t\tcase 'slideshow':\n\t\t//call out globals for the lightbox switch case\n\t\t\tglobal $jquery, $slideshow;\n\t\t\t//test to see if jquery library has been called\n\t\t\tif (!isset($jquery)) {\n\t\t\t\techo '<script src=\"js/jquery-3.1.1.min.js\"></script>'.\"\\n\";\n\t\t\t\t$jquery = true;\n\t\t\t}\n\t\t\t//test to see if lightbox library has been called\n\t\t\tif (!isset($slideshow)) {\n\t\t\t\techo ' <script src=\"js/cycle2.min.js\"></script>'.\"\\n\";\n\t\t\t\techo '<link href=\"css/cycle2.css\" rel=\"stylesheet\">'.\"\\n\";\n\t\t\t\t$slideshow = true;\n\t\t\t}\n\t\t?> \n <div class=\"cycle-slideshow\" data-cycle-fx=fadeout data-cycle-speed=1500 Horz data-cycle-timeout=4000>\n <!-- empty element for overlay -->\n <div class=\"cycle-overlay\"></div>\n <?php foreach ($imageList as $image){ \n\t\t\t\t\t//create alt text for image\n\t\t\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt)); ?>\n <img src=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image); ?>\" data-cycle-title=\"<?php echo $title; ?>\" data-cycle-desc=\"<?php echo $alt; ?>\">\n <?php } //end foreach ?>\n </div>\n<?php break; ?>\n\t\t<?php\n\t\t\n\t\t}//END SWITCH $displayMode\n\t\t} else {\n\t\t\t//print this to screen if the directories cannot be found.\n\t\t\techo \"<p>The selected gallery is not available.</p>\";\t\n\t\t}//END file_exists() FUNCTION\n\t}",
"function getUserPhotos ($dir, $userName = '') {\r\n $filesArray = getFilesFromDir($dir);\r\n $outputPhotoBook = '';\r\n foreach ($filesArray as $fileName) {\r\n $outputPhotoBook .= '<div><img src=\"img/' . $userName . '/' . $fileName. '\"></div>';\r\n }\r\n return $outputPhotoBook;\r\n}",
"function display_file($file) {\n\n return \"images\" . DS . $file;\n\n}",
"public function listDirectoryPicturesAndApplyId() \n {\n if (is_dir($this->picturesFolder)){\n $this->files = scandir($this->picturesFolder);\n } else {\n echo 'No image directory';\n }\n \n $values = array();\n foreach ($this->files as $key => $var) {\n if (($var === '.') || ($var === '..') || (substr($var, -4, 1) !== '.')) {\n unset($this->files[$key]);\n } else {\n $id = $this->generateRandomKey();\n $values[] = array(\n 'id' => $id, \n 'picture' => $this->files[$key], \n 'qrcode' => $id . '-qrcode' . $this->outputFileExtension\n ); \n }\n }\n $this->files = $values;\n return (array) $this->files;\n }",
"function albums_admin_show_images($album) {\n\tglobal $lang, $var1;\n\n\t$images = albums_get_images($album);\n\tif ($images == FALSE)\n\t\techo '<span class=\"kop4\">'.$lang['general']['nothing_yet'].'</span><br />';\n\n\telse {\n\t\tforeach ($images as $image) {\n\t\t\t?>\n\t\t\t\t<div class=\"menudiv\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"<?php echo MODULE_DIR; ?>/albums_getimage.php?image=<?php echo $var1.'/'.$image['filename_image']; ?>\" target=\"_blank\">\n\t\t\t\t\t\t\t<img src=\"<?php echo MODULE_DIR; ?>/albums_getimage.php?image=<?php echo $var1; ?>/thumb/<?php echo $image['filename_image']; ?>\" title=\"<?php echo $image['title']; ?>\" alt=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"title-page\">\n\t\t\t\t\t\t<span class=\"kop3\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<span class=\"small\"><?php echo $image['info']; ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&page=editimage&var1=<?php echo $var1; ?>&var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/edit.png\" title=\"<?php echo $lang['albums']['edit_image']; ?>\" alt=\"<?php echo $lang['albums']['edit_image']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&page=imageup&var1=<?php echo $var1; ?>&var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/up.png\" title=\"<?php echo $lang['albums']['change_order']; ?>\" alt=\"<?php echo $lang['albums']['change_order']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&page=imagedown&var1=<?php echo $var1; ?>&var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/down.png\" title=\"<?php echo $lang['albums']['change_order']; ?>\" alt=\"<?php echo $lang['albums']['change_order']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&page=deleteimage&var1=<?php echo $var1; ?>&var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/delete_from_trash.png\" title=\"<?php echo $lang['albums']['delete_image']; ?>\" alt=\"<?php echo $lang['albums']['delete_image']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\tunset($image);\n\t}\n}",
"public function browse_files()\n {\n // Scan file directory, render the images.\n if (is_dir($this->file_path)) {\n $files = preg_grep('/^([^.])/', scandir($this->file_path));\n return $files;\n }\n \n }",
"function listDir($user,$dir,$from,$to){\r\n\t$thumbDir=\"thumb/$user/\".$dir;\r\n\t$viewDir=\"view/$user/\".$dir;\r\n\t$imgDir=\"DATASET/$user/\".$dir;\r\n\tif(!file_exists($thumbDir))\r\n\t\t@mkdir($thumbDir);\r\n\tif(!file_exists($viewDir))\r\n\t\t@mkdir($viewDir);\r\n\t$items=array();\r\n\tif ($handle = opendir($imgDir)) {\r\n\t\t/* This is the correct way to loop over the directory. */\r\n\t\t$i=0;\r\n\t\t$prev=\"\";$next=\"\";\r\n\t\t$types=array(\"jpg\",\"jpeg\",\"png\",\"gif\");\r\n\t\twhile (false !== ($entry = readdir($handle))) {\r\n\t\t\t$filename=$imgDir.\"/\".$entry;\r\n\t\t\tif(is_dir($filename)) continue;\r\n\r\n\t\t\t$info = getimagesize($filename);\r\n\r\n\t\t\tdebug($filename);\r\n\t\t\t$pi=pathinfo($filename);\r\n\t\t\tif(!in_array(strtolower($pi['extension']),$types)) continue;\r\n\t\t\tif(isPic($info['2'])){\r\n\t\t\t\t$i++;\r\n\t\t\t\tif($i==$from) $prev=$entry;\r\n\t\t\t\tif($i<=$from) continue;\r\n\t\t\t\tif($i==$to+1) $next=$entry;\r\n\t\t\t\tif($i>$to) break;\r\n\r\n\t\t\t\t$width=$info['0'];\r\n\t\t\t\t$height=$info['1'];\r\n\t\t\t\t$size=$width*$height;\r\n\t\t\t\t$thumb=$filename;\r\n\r\n\t\t\t\t$n=1;\r\n\t\t\t\t$m=1;\r\n\t\t\t\tif($size>4000*4000) {$n=8;$m=3;}\r\n\t\t\t\telse if($size>3000*3000) {$n=7;$m=3;}\r\n\t\t\t\telse if($size>2000*2000) {$n=6;$m=2;}\r\n\t\t\t\telse if($size>1200*1200) {$n=5;$m=2;}\r\n\t\t\t\telse if($size>600*600) $n=2;\r\n\t\t\t\tif($height>=2.5*$width||$width>=2.5*$height) $n=$n/3>1?$n/3:1;\r\n\r\n\t\t\t\tif($n>1) {\r\n\t\t\t\t\t$thumb=$thumbDir.\"/\".$entry;\r\n\t\t\t\t\tdebug($thumb);\r\n\t\t\t\t\tif(!file_exists($thumb)) {\r\n\t\t\t\t\t\tinclude_once \"thumb.php\";\r\n\t\t\t\t\t\timg2thumb($filename,$thumb,$width/$n,$height/$n,0,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$view=$viewDir.\"/\".$entry;\r\n\t\t\t\tdebug($view);\r\n\t\t\t\tif(!file_exists($view)){\r\n\t\t\t\t\tif($m>1){\r\n\t\t\t\t\t\tinclude_once \"thumb.php\";\r\n\t\t\t\t\t\timg2thumb($filename,$view,$width/$m,$height/$m,0,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse copy($filename,$view);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$item['id']=$i-1;//count its id in the folder\r\n\t\t\t\t$item['href']=$entry;\r\n\t\t\t\t$item['src']=$thumb; $item['width']=$info['0'];$item['height']=$info['1'];\r\n\t\t\t\t$items[]=$item;\r\n\t\t\t}\r\n\t\t}\r\n\t\tclosedir($handle);\r\n\r\n\t\tif(count($items)>0){\r\n\t\t\t//resolve the links\r\n\t\t\t$items[0]['prev']=$prev;\r\n\t\t\t$items[count($items)-1]['next']=$next;\r\n\t\t\tforeach($items as $i=> $item){\r\n\t\t\t\tif($i>0) {\r\n\t\t\t\t\t$items[$i-1]['next']=$items[$i]['href'];\r\n\t\t\t\t\t$items[$i]['prev']=$items[$i-1]['href'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tdebug(\"desp:...\\n\");\r\n\t\t\tinclude_once \"desp.php\";\r\n\t\t\tgetDesp($user,$dir,$items);\r\n\t\t\tdebug($items);\r\n\t\t}\r\n\t}\r\n\treturn $items;\r\n}",
"function get_arr_pics_from_folder( $img_folder, $img_folder_url, $thumb_width = 50, $thumb_height = 50 )\n\t{\n\t\t$arr_filenames = $filesnames =array();\n\t\tif(file_exists($img_folder))\n\t\t{\n\t\t\t$filesnames = scandir($img_folder);\n\t\t}\n\t\t$count = 0;\n\t\tforeach ( $filesnames as $name )\n\t\t{\n\t\t\t$count++;\n\t\t\tif ( $name != \".\" && $name != \"..\" && $name != \"_evocache\" && $this->isImage($img_folder.$name) ) //not the folder and other files\n\t\t\t{\n\t\t\t\t$arr_filenames[] = array( $img_folder_url.$name,\n\t\t\t\t\"<a href='\".$img_folder_url.$name.\"' target='blank'><img src='\".$img_folder_url.$name.\"' width=\".$thumb_width.\"px heigh=\".$thumb_height.\"px /></a>\" );\n\t\t\t}\n\t\t\tif ($count==30) break; // The max number of the images we want to show\n\t\t}\n\t\t$arr_filenames[] = array(\"none\",T_(\"Transparent\"));\n\t\treturn $arr_filenames;\n\t}",
"function display_image($picture) {\n return \"uploads\" . DS . $picture;\n}",
"public function makePhotographyGallery()\n {\n $imagePath = 'images/photography';\n $imageFiles = File::allFiles($imagePath);\n\n return view('pages/photography')->with(compact('imagePath', 'imageFiles'));\n }",
"public function index()\n {\n $imagesArray = glob(config('media.imagesPath').'*.*');\n if (count($imagesArray) > 0) {\n foreach ($imagesArray as $key => $image) {\n $imagesArray[$key] = substr($image, strlen(config('media.imagesPath')));\n }\n }\n\n return view('index', [\n 'imagesArray' => $imagesArray\n ]);\n }",
"public function assetThumbnailListAction() {\n\t\t$parentFolder = $this->document->getElement ( \"parentFolder\" );\n\t\tif ($parentFolder) {\n\t\t\t$parentFolder = $parentFolder->getElement ();\n\t\t}\n\t\t\n\t\tif (! $parentFolder) {\n\t\t\t// default is the home folder\n\t\t\t$parentFolder = Asset::getById ( 1 );\n\t\t}\n\t\t\n\t\t// get all children of the parent\n\t\t$list = new \\Asset\\Listing ();\n\t\t$list->setCondition ( \"path like ?\", $parentFolder->getFullpath () . \"%\" );\n\t\t\n\t\t$this->view->list = $list;\n\t}",
"public function show($folder)\n {\n $root=public_path(config('larapages.media.folder')).Input::all()['folder'];\n $dir=opendir($root);\n $files=[];\n while($file=readdir($dir)) {\n if ($file[0]!='.' && $file!='imageresize.php' && !is_dir($root.'/'.$file)) {\n $files[]=$file;\n }\n }\n natcasesort($files);\n $return='';\n Carbon::setLocale('en');\n \n $preview=['jpg','png','gif','jpeg'];\n \n # Check if Safari version is 9 or higher so we can preview PDF thumbnails\n $ua=$_SERVER['HTTP_USER_AGENT'];\n $safari=strpos($ua, 'Safari') && !strpos($ua, 'Chrome');\n $p=strpos($ua, 'Version/');\n $safariVersion=substr($ua, $p+8, strpos($ua, '.', $p)-$p-8);\n if ($safariVersion>=9) $preview[]='pdf';\n \n foreach($files as $file) {\n $return.='<li>';\n $return.='<a target=\"_blank\" href=\"/'.$this->urlencodeFolder(config('larapages.media.folder'),1).$this->urlencodeFolder(Input::all()['folder'],1).'/'.$this->urlencodeFolder($file,1).'\">';\n $extension=strtolower(substr($file,strrpos($file,'.')+1));\n if (in_array($extension, $preview))\n $return.='<div style=\"background-image:url(\\'/'.$this->urlencodeFolder(config('larapages.media.folder')).$this->urlencodeFolder(Input::all()['folder']).'/'.$this->urlencodeFolder($file).'\\')\">';\n else\n $return.='<div>'.$extension;\n $return.='</div></a>';\n $size=filesize($root.'/'.$file);\n $time=filemtime($root.'/'.$file);\n $time=Carbon::createFromTimeStamp($time)->formatLocalized('%a %d %B %Y').' '.Carbon::createFromTimeStamp($time)->toTimeString(); #->diffForHumans();\n $return.='<span class=\"fileselect\"><input type=\"checkbox\" value=\"x\"></span>';\n $return.='<span class=\"title\">'.$file.'</span>';\n $return.='<span class=\"size\">'.$size.'</span>';\n $return.='<span class=\"time\">'.$time.'</span>';\n $return.='<span class=\"actions\"><a class=\"delete icondelete\"></a></span>';\n $return.='</li>';\n }\n return $return;\n }",
"public function getImagesFolder()\n {\n return defined(static::class . '::IMAGES') ? static::IMAGES : 'images';\n }",
"public function index() {\n $images = Gallery::all();\n // $images = Gallery::all();\n require_once('views/gallery/index.php');\n }",
"function ShowGallery($folder, $mask,$thumbWidth,$thumbHeight)\r\n{\r\n\t$images = ListFiles($folder, $mask);\r\n\t?>\r\n\t<div id=\"gallery\" class=\"ad-gallery\" >\r\n\t\t<div class=\"ad-image-wrapper\">\r\n\t\t</div>\r\n\t\t<div class=\"ad-controls\">\r\n\t\t</div>\r\n\t\t<div class=\"ad-nav\">\r\n\t\t\t<div class=\"ad-thumbs\">\r\n\t\t\t\t<ul class=\"ad-thumb-list\">\r\n\t\t\t\t<?php \r\n\t\t\t\t$counter = 0; // for the imageX class (image0,image1,...)\r\n\t\t\t\tforeach ($images as $image)\r\n\t\t\t\t{\r\n\t\t\t\t\t$alt = basename($image,substr($mask,1)); // cut the folder and extension (mask as a \"*\" at begining so without it) \r\n\t\t\t\t\t$alt = str_replace(\"_\", \" \", $alt); // alt is name without underscore\r\n\t\t\t\t\techo\t\"<li>\";\r\n\t\t\t\t\techo \t\t\"<a href='$image'>\";\r\n\t\t\t\t\techo \t\"<img src='$image' alt='$alt' class='image\".$counter.\"' style='width:\".$thumbWidth.\"px; height:\".$thumbHeight.\"px;'/>\";\r\n\t\t\t\t\techo \t\"</a>\";\r\n\t\t\t\t\techo \t\"</li>\";\t\t\t\t\r\n\t\t\t\t}\t// foreach close\r\n\t\t\t\t?>\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\t<?php \r\n}",
"private function listFolderFiles($dir = 'images/')\n {\n echo '<ol>';\n foreach (new \\DirectoryIterator($dir) as $fileInfo) {\n if (!$fileInfo->isDot()) {\n echo '<li>' . $fileInfo->getFilename();\n if ($fileInfo->isDir()) {\n self::listFolderFiles($fileInfo->getPathname());\n }\n echo '</li>';\n }\n }\n echo '</ol>';\n }",
"function print_images()\n {\n $images = $this->service->imageList();\n $image_choice = 0;\n foreach ($images as $image) {\n printf(\"%d) %s: Image %s requires min. %dMB of RAM and %dGB of disk\\n\",\n $image_choice, $image->id, $image->name, $image->minRam,\n $image->minDisk);\n $image_choice += 1;\n }\n }",
"function makesitesmages()\n\t{\n\n\t\tglobal $option, $mainframe;\n\n\t\t//First we'll nee access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\t$uploads_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$site_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"site\" ;\n\n\t\t// this is the width in px that we're telling GD to scale to, where's imagemagik when you need it.\n\t\t$new_w = 235;\n\t\t// where our source images live b/c GD needs to read them\n\t\t$cfg_fullsizepics_path = $uploads_path;\n\t\t//where we're sending them when we are done\n\t\t$cfg_thumb_path = $site_path;\n\t\t// we need one more path for this to work\n\t\t$filepath = $uploads_path ;\n\t\t// the directory\n\t\t$dir = dir($filepath);\n\n\t\t//check folders\n\t\t\t\n\t\twhile($entry=$dir->read()) {\n\t\t\t//check the files\n\t\t\tif($entry == \".\" || $entry == \"..\") {\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t$fp = @fopen(\"$filepath/$entry\",\"r\");\n\n\t\t\t$photo_filename = \"$entry\";\n\n\t\t\t$image_stats = GetImageSize($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t$imagewidth = $image_stats[0];\n\n\t\t\t$imageheight = $image_stats[1];\n\n\t\t\t$img_type = $image_stats[2];\n\n\t\t\t$ratio = ($imagewidth / $new_w);\n\n\t\t\t$new_h = round($imageheight / $ratio);\n\n\t\t\tif (!file_exists($cfg_thumb_path.\"/\".$entry)) {\n\n\t\t\t\tif ($img_type==\"2\") {\n\n\t\t\t\t\t$src_img = imagecreatefromjpeg($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t\t\t$dst_img = imagecreatetruecolor($new_w,$new_h);\n\n\t\t\t\t\timagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));\n\n\t\t\t\t\timagejpeg($dst_img, \"$cfg_thumb_path\".\"/$entry\", 100);\n\t\t\t\t\t\t\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"3\") {\n\n\t\t\t\t\t$src_img=ImageCreateFrompng($cfg_fullsizepics_path.\"/\".$entry);\n\t\t\t\t\t \n\t\t\t\t\t$dst_img=ImageCreateTrueColor($new_w,$new_h);\n\t\t\t\t\t\t\n\t\t\t\t\tImageCopyResampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));\n\n\t\t\t\t\tImagepng($dst_img, \"$cfg_thumb_path\".\"/$entry\",100);\n\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"1\") {\n\n\t\t\t\t\t$cfg_thumb_url=$cfg_fullsizepics_url;\n\n\t\t\t\t} \n\n\t\t\t}\n\n\n\t\t\t\t\n\t\t} //the files are now in the /images/content/sketchup/site directory\n\n\n\t\t//$this->setRedirect( 'index.php?option=' . $option.'&task=movesiteimages&controller=items', 'Site Images made' );\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'Site Images made' );\n\t\n\t}",
"public function getImages(){\n $images =[];\n $files=[];\n $imageDir=opendir(IMAGES_DIR);\n while(false !==($file=readdir($imageDir))){\n // $imageDirから一行ずつ読み込んで,$fileに入れて行く そんでそれがfalseにならない限り回し続ける\n if($file === '.'||$file =='..'){\n // カレントディレクトリやルートディレクトリを飛ばして回す\n continue;\n }\n $files[]=$file;\n //thumnailは imagesdirに存在するのかな\n if(file_exists(THUMBNAIL_DIR.'/'.$file)){\n $images[]=basename(THUMBNAIL_DIR).'/'.$file;\n } else{\n $images[]=basename(IMAGES_DIR).'/'.$file;\n }\n }\n array_multisort($files,SORT_DESC,$images);\n // 逆向き順に$filesに入っているimagesをそr・せよ\n return $images;\n}",
"public function GetAlbums()\n {\n if ($handle = opendir('albums')) {\n # Loop thrue all entries in the directory handle untill it reads boolean FALSE\n while (false !== ($entry = readdir($handle))) {\n # Check to not display root and return links\n if ($entry != \".\" && $entry != \"..\") {\n # Display entry link\n include \"../private_html/templates/albumCell.php\";\n }\n }\n closedir($handle);\n }\n }",
"function getfoldercontent($folder, &$dir_array, &$pic_array, &$expic_array)\r\n{\r\n global $xoopsModuleConfig;\r\n\r\n $dir = opendir(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder);\r\n while($file = readdir($dir)){\r\n if(is_dir(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder.$file)) {\r\n if ($file != \".\" && $file != \"..\")\r\n $dir_array[] = $file;\r\n }\r\n if(is_file(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder.$file)) {\r\n if(strncmp($file, $xoopsModuleConfig['thumb_pfx'], strlen($xoopsModuleConfig['thumb_pfx'])) != 0\r\n && strncmp($file, $xoopsModuleConfig['normal_pfx'], strlen($xoopsModuleConfig['normal_pfx'])) != 0)\r\n $pic_array[] = $file;\r\n }\r\n }\r\n closedir($dir);\r\n\r\n natcasesort($dir_array);\r\n natcasesort($pic_array);\r\n}"
]
| [
"0.68339556",
"0.63162655",
"0.6220864",
"0.6165034",
"0.61335194",
"0.6132603",
"0.61187065",
"0.6037719",
"0.6017631",
"0.6001186",
"0.5968343",
"0.5960158",
"0.5907326",
"0.5893923",
"0.5885956",
"0.586137",
"0.58436334",
"0.58199733",
"0.57960826",
"0.57884043",
"0.5786245",
"0.57844424",
"0.5775502",
"0.57745737",
"0.57606965",
"0.5745269",
"0.57322615",
"0.5707057",
"0.5703935",
"0.5702729"
]
| 0.6547855 | 1 |
actionid: indexbyhrd actiondesc: Display index of izin for HRD | public function actionIndexByHrd(){
$searchModel = new PermohonanIzinSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('indexByHrd',[
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getIndex() ;",
"public function getHashIndex();",
"public function getSortIndex();",
"abstract protected function getIndex();",
"function get_index()\r\n\t{\r\n\r\n\t}",
"public function getIndex();",
"public function getIndex();",
"public function getIndex();",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"protected function get_heat_index($tempF, $rh) {\n if ($tempF > 79 && $rh > 39) {\n $hiF = -42.379 + 2.04901523 * $tempF + 10.14333127 * $rh - 0.22475541 * $tempF * $rh;\n $hiF += -0.00683783 * pow($tempF, 2) - 0.05481717 * pow($rh, 2);\n $hiF += 0.00122874 * pow($tempF, 2) * $rh + 0.00085282 * $tempF * pow($rh, 2);\n $hiF += -0.00000199 * pow($tempF, 2) * pow($rh, 2);\n $hiF = round($hiF);\n $hiC = round(($hiF - 32) / 1.8);\n $this->wxInfo['ITEMS'][$this->tend]['HEATINDEXC'] = $hiC;\n $this->wxInfo['ITEMS'][$this->tend]['HEATINDEXF'] = $hiF;\n }\n }",
"abstract function indexAction();",
"function indexAction(){\n \t}",
"public function key(){\n return $this->index;\n }",
"abstract public function actionIndex();",
"abstract public function doIndex($item);",
"function indexAction(){\r\n }",
"public function action_index()\n\t{\n\t}",
"public function _INDEX()\n\t{\n\t\t\n\t}",
"public static function zend_hash_index_find(HashTable $ht, int $h): Zval {\n }",
"public function key()\n\t{\n\t\treturn $this->index;\n\t}",
"public function key()\n\t{\n\t\treturn $this->index;\n\t}",
"public function getSearchIndex();"
]
| [
"0.5975102",
"0.58702487",
"0.5841442",
"0.5593693",
"0.5591032",
"0.55571353",
"0.55571353",
"0.55571353",
"0.54159963",
"0.54159963",
"0.54159963",
"0.541532",
"0.541532",
"0.541532",
"0.54145646",
"0.54129547",
"0.54129547",
"0.53141147",
"0.53008324",
"0.5282296",
"0.528048",
"0.52690077",
"0.52241594",
"0.518206",
"0.5167332",
"0.5159325",
"0.5155079",
"0.5088307",
"0.5088307",
"0.50863165"
]
| 0.62461543 | 0 |
actionid: viewbystaf actiondesc: Display detail view of izin for staf | public function actionViewByStaf($id){
return $this->render('viewByStaf',[
'model' => $this->findModel($id),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function viewAction(){\r\n\t\t//$iUnitId = Sys_Publib_Library::_getItemAttrById($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'unit_id');\r\n\t\t//Lay ID phong ban cua NSD dang nhap hien thoi\r\n\t\t$pUrl = $_SERVER['REQUEST_URI'];\r\n\t\t$objFunction =\tnew\tSys_Function_DocFunctions()\t;\r\n\t\t$objFilter = new Zend_Filter();\t\t\t\r\n\t\t// Tieu de man hinh danh sach\r\n\t\t$this->view->docInfo \t\t= \"THÔNG TIN VĂN BẢN\";\r\n\t\t$sDocumentId = $this->_request->getParam('hdn_object_id','');\r\n\t\t$sType\t\t = $this->_request->getParam('hdn_type','');\r\n\t\t//Lay cac hang so dung chung\r\n\t\t$arrConst = Sys_Init_Config::_setProjectPublicConst();\r\n\t\t$this->view->arrConst = $arrConst;\r\n\t\t// Tao doi tuong Zend_Filter\r\n\t\t$objFilter = new Zend_Filter();\r\n\t\t$ojbSysLib = new Sys_Library();\r\n\t\t$objFullTextSearch = new fulltextsearch_modFulltextsearch();\r\n\t\t//Lay thong tin trong danh muc\r\n\t\t$arrDocSingle = $objFullTextSearch->DocFullTextSearchDocGetSingle($sDocumentId, $sType);\t\t\t\r\n\t\t$this->view->arrDocSingle = $arrDocSingle;\r\n\t\t//Lay gia tri tim kiem tren form\r\n\t\t\t$sfullTextSearch \t= $this->_request->getParam('txtfullTextSearch','');\r\n\t\t\t$iYear\t \t\t\t= $this->_request->getParam('year','');\r\n\t\t\t$iCurrentPage\t\t= $this->_request->getParam('hdn_current_page',0);\t\r\n\t\t\tif ($iCurrentPage <= 1){\r\n\t\t\t\t$iCurrentPage = 1;\r\n\t\t\t}\r\n\t\t\t$iNumRowOnPage = $this->_request->getParam('cbo_nuber_record_page',0);\r\n\t\t\tif ($iNumRowOnPage == 0)\r\n\t\t\t\t$iNumRowOnPage = 15;\r\n\t\t\t$arrParaSet = array(\"trangHienThoi\"=>$iCurrentPage, \"soBanGhiTrenTrang\"=>$iNumRowOnPage,\"chuoiTimKiem\"=>$sfullTextSearch,\"Nam\"=>$iYear);\r\n\t\t\t$_SESSION['seArrParameter'] = $arrParaSet;\t\r\n\t\t\r\n\t}",
"public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}",
"public function actionViewByHrdStaf($id){\n return $this->render('viewByHrdStaf',[\n 'model' => $this->findModel($id),\n ]);\n }",
"public function show_detail($i_id=0)\r\n {}",
"public function show_detail($i_id=0)\r\n {}",
"public function viewAction()\r\n {\r\n $this->indexAction();\r\n }",
"public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }",
"public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }",
"public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }",
"public function viewAclAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new Rsvacl_Model_DbTable_DbAcl();\n \t\t$acl_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getAcl($acl_id);\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }",
"public function show(FakturReturBeliDetail $fakturReturBeliDetail)\n {\n //\n }",
"public function viewAction() {\n // neu chua khoi tao\n // neu roi add them 1 phan tu vao sesion voi id va uenc da duoc tao\n $this->layout('layout/bags');\n $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array(\n 'action' => 'getuser'\n ));\n // var_dump($getuser);\n $this->layout()->getuser = $getuser;\n\n $id = $this->params()->fromRoute('id');\n $uenc = $this->params()->fromRoute('uenc');\n\n echo \"id :\";\n var_dump($id);\n echo \"</br>\";\n echo \"uenc :\";\n var_dump($uenc);\n die(\"view is update\");\n }",
"protected function viewAction()\n {\n }",
"public function view() {\n\n $this->db->where('VCIF', 'XYZ');\n $q = $this->db->get('STRUCTURE')->result();\n }",
"public function actionView() {\n $this->active_menu = \"gpu2\";\n $this->open_class = \"factory\";\n $this->active_class = \"create\";\n $model = Itemstock::model()->findByPk(Yii::app()->request->getParam('id'));\n $this->render('view', array(\n 'model' => $model,\n ));\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }",
"public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}",
"public function detailAction(){\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBikeAd.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_updBikeAds.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBike2Ext.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/default/db_selVPic.php');\n\t\t$req = $this -> getRequest();\n\t\t$lang = $this -> lang;\n\t\t$p = $req -> getParams();\n\t\t\n\t\tif (isset($p['id'])){\t\t\t\n\t\t\t$bikeDetails = db_selBikeAd(array('bikeID' => $p['id']));\n\t\t\tif (($bikeDetails != false) && is_array($bikeDetails) && (count($bikeDetails) == 1)){\t\t\t\t\n\t\t\t\t$bikeDetails = $bikeDetails[0];\n\t\t\t\t\n\t\t\t\tif (is_array($this -> adminNS -> bikeAds) && isset($this -> adminNS -> bikeAds['bikeID'])\n\t\t\t\t\t&& ($this -> adminNS -> bikeAds['bikeID'] != $bikeDetails['bikeID'])){\n\t\t\t\t\t$this -> resetnsAction();\n\t\t\t\t}\n\t\t\t\t//Safe changes\n\t\t\t\tif (isset($p['bikeSafe'])){\n\t\t\t\t\t$p['bikeID'] = $bikeDetails['bikeID'];\n\t\t\t\t\t$p['bikeBrandID'] = $p['bikeBrand'];\n\t\t\t\t\t$p = $this -> updatebikeAction($p);\n\t\t\t\t\tif (isset($p['error'])){\n\t\t\t\t\t\t$this -> view -> error = $p['error'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$bikeDetails2 = db_selBikeAd(array('bikeID' => $p['id']));\n\t\t\t\t\t\tif (($bikeDetails2 != false) && is_array($bikeDetails2) && (count($bikeDetails2) == 1)){\n\t\t\t\t\t\t\t$bikeDetails = $bikeDetails2[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this -> view -> info = $lang['AINFO_4'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Delete advertisement\n\t\t\t\telse if (isset($p['bikeDel'])){\n\t\t\t\t\t$bikeAd = db_updBikeAds(array(System_Properties::SQL_WHERE => array('bikeID' => $bikeDetails['bikeID'])\n\t\t\t\t\t\t\t\t\t\t\t\t, System_Properties::SQL_SET => array('erased' => 1)\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);\n\t\t\t\t\tif ($bikeAd != false){\n\t\t\t\t\t\t$this -> _forward('index');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Load all bike extra\n\t\t\t\t$this -> loadBikeExt();\n\t\t\t\t\n\t\t\t\t//Load bike extra\n\t\t\t\t$bikeExt = db_selBike2Ext(array('bikeID' => $bikeDetails['bikeID']));\n\t\t\t\tif (($bikeExt != false) && is_array($bikeExt) && (count($bikeExt) > 0)){\n\t\t\t\t\t$bikeDetails['bikeExt'] = array();\n\t\t\t\t\tforeach ($bikeExt as $key => $val){\n\t\t\t\t\t\tarray_push($bikeDetails['bikeExt'], $val['vextID']);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Fetch all bike pics\n\t\t\t\tif (isset($this -> adminNS -> bikePhoto) && is_array($this -> adminNS -> bikePhoto)){\n\t\t\t\t\t$bikePhoto = $this -> adminNS -> bikePhoto;\n\t\t\t\t}\t\n\t\t\t\telse{\n\t\t\t\t\t$bikePhoto = db_selVPic(array(\t'vType' => System_Properties::BIKE_ABRV,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'vID' => $bikeDetails['bikeID']));\n\t\t\t\t\t$bikeDetails['bikePhoto'] = array();\n\t\t\t\t\tforeach($bikePhoto as $key => $kVal){\n\t\t\t\t\t\t$bikeDetails['bikePhoto'][$kVal['vPicID']] = $kVal;\n\t\t\t\t\t}\n\t\t\t\t\t$bikePhoto = $bikeDetails['bikePhoto'];\n\t\t\t\t}\n\t\t\t\t$bikeDetails['bikePhoto'] = $bikePhoto;\n\t\t\t\t\n\t\t\t\t//Load brands and models\t\t\t\t\n\t\t\t\t$this -> loadBikeModelsBrands(array('bikeBrand' => $bikeDetails['bikeBrandID']));\n\t\t\t\t//Load all possible bike extra\n\t\t\t\t$this -> loadBikeExt();\n\t\t\t\t$this -> loadBikeCat();\n\t\t\t\t$this -> view -> bike = $bikeDetails;\n\t\t\t\t\n\t\t\t\t$this -> adminNS -> bikeAds = $bikeDetails;\n\t\t\t\t$this -> adminNS -> bikePhoto = $bikePhoto;\n\t\t\t}else{\n\t\t\t\t$this -> indexAction();\n\t\t\t\t$this -> render('index');\n\t\t\t}\n\t\t}else{\n\t\t\t$this -> indexAction();\n\t\t\t$this -> render('index');\n\t\t}\n\t}",
"public function show()\n {\n $data['title'] = 'Siswa';\n $id = $this->input->get('id');\n $this->load->model('Absen_m', 'absen');\n $kehadiran = $this->absen->hitung_kehadiran_siswa($id, 'hadir');\n $sakit = $this->absen->hitung_kehadiran_siswa($id, 'sakit');\n $izin = $this->absen->hitung_kehadiran_siswa($id, 'izin');\n // cegat apa bila id nya tdk di isi ato langsung akses ke link \n if ($id !== null) {\n //Ambil Semua data absensi taruh dalam satu varible \n $data['siswa'] = $this->siswa->get_siswa_byId($id)->result_array();\n $data['kehadiran'] = $kehadiran;\n $data['sakit'] = $sakit;\n $data['izin'] = $izin;\n\n $this->load->view('templates/header', $data);\n $this->load->view('templates/sidenav');\n $this->load->view('templates/navbar', $data);\n $this->load->view('siswa/show', $data);\n $this->load->view('templates/footer');\n } else {\n show_404();\n }\n }",
"public function actionView()\n {\n \n }",
"public function actionView() {\n $isFinal=false;\n if(isset($_GET['isFinal'])) {\n $isFinal=$_GET['isFinal'];\n }\n $this->render('view', array(\n 'model' => $this->loadModel(),\n 'isFinal'=>$isFinal\n ));\n }",
"public function actionView($id){\n $userid=Yii::$app->user->identity->id;\n //$model = $this->findModel($id);\n $documents=MgfAttachements::find()->where(['organisation_id'=>$id])->all();\n $concepts=MgfConceptNote::find()->where(['organisation_id'=>$id])->all();\n $screening=MgfScreening::find()->where(['organisation_id'=>$id])->all(); \n $contacts=MgfContact::find()->joinWith('position')->where(['organisation_id'=>$id])->all(); \n $applicant=MgfApplicant::find()->where(['user_id'=>$userid])->one(); \n //$id=getOrganisationID(); \n return $this->render('view', ['model' => $this->findModel($id),'documents'=>$documents,'criteria'=>$screening,'concepts'=>$concepts,'contacts'=>$contacts,'applicant'=>$applicant]);\n }",
"public function detail($id){\n \n $this->_estado->_setIdTableValue($id);\n $params['rsEstado'] = $this->_estado->getRecord();\n \\kerana\\View::showView($this->_current_module,'estado/detail',$params);\n \n }",
"public function viewAction() {\n\t\t$id = $this->_getParam('id');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\t$latest_flag = ($this->_getParam('latest') == 'f') ? false : true;\n\t\t$latest_ta_id = $ta->latestReleasedVersionId();\n\t\tif ($latest_ta_id != $id && !UserAcl::isDomainAdminOrAbove() && $latest_flag) {\n\t\t\t$this->_redirect('/teachingactivity/view/id/'.$latest_ta_id);\n\t\t\treturn;\n\t\t}\n\t\t$this->view->debugdate = $this->_getParam('debugdate');\n\t\t$layout = $this->_getParam('layout', '');\n\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\n\t\t$this->view->ta = $ta;\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t\n\t\t$this->view->showGenericEvaluation = EvaluateTaConst::showGenericEvaluation($ta->typeID);\n\t\t\n\t\tif(UserAcl::isAdmin() && $this->view->showGenericEvaluation === true) {\n \t\t$studentEvaluateService = new StudentEvaluateService();\n \t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n \t\t$studentEvaluate = new StudentEvaluate();\n \t\t$this->view->taEvaluationAvg = $studentEvaluate->getRatingAvg('ta', $id);\n\t\t}\n\n\t\t$this->view->display_edit_links = UserAcl::isStaffOrAbove() && UserAcl::checkTaPermission($ta, UserAcl::$EDIT) === true && count($this->view->released_los) > 0;\n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\t\t$this->view->resources = $ta->resources;\n\t\t\n\t\t$this->view->pblTaTypePrev = '';\n\t\t$this->view->pblTaTypeNext = '';\n\t\t\n\t if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n //$this->render('pblview');\n break;\n }\n }\n\t\t$this->view->socialtools = StudentResourceService::showSocialTools();\n\t}",
"public function actionView()\n {\n \t$id = isset($_REQUEST['id'])?$_REQUEST['id']:null;\n \t$model = $this->findModel($id);\n \t \n \treturn CommonUtils::json_success($model);\n }",
"public function view()\n\t{\n\t\t// TODO Implement\t\n\t}",
"public function landVisitDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$disease_score\t= isset($params['disease_score'])?$params['disease_score']:\"\";\n\t\t\t\t$logging_score\t= isset($params['logging_score'])?$params['logging_score']:\"\";\n\t\t\t\t$presemption_of_insect\t= isset($params['presemption_of_insect'])?$params['presemption_of_insect']:\"\";\n\t\t\t\t$soil_moisture_id\t= isset($params['soil_moisture_id'])?$params['soil_moisture_id']:\"\";\n\t\t\t\t$quality_of_crop\t= isset($params['quality_of_crop'])?$params['quality_of_crop']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\tif(isset($_FILES['image']['tmp_name']) AND !empty($_FILES['image']['name'])){\n\t\t\t\t\t\t$tempName = $_FILES['image']['tmp_name'];\n\t\t\t\t\t\t$imageName = time().$_FILES['image']['name']; \n\t\t\t\t\t\t$uploads = 'uploads/visit_photograph/';\n\t\t\t\t\t\tif(!file_exists($uploads)){\n\t\t\t\t\t\t\tmkdir($uploads);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pathComplete = $uploads.$imageName;\n\t\t\t\t\t\t@move_uploaded_file($tempName,$pathComplete);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$land_visit = array(); \n\n\t\t\t\t\t$land_visit['land_id'] = $land_id;\n\t\t\t\t\t$land_visit['stage_id'] = $stage_id;\n\t\t\t\t\t$land_visit['disease_score'] = $disease_score;\n\t\t\t\t\t$land_visit['logging_score'] = $logging_score;\n\t\t\t\t\t$land_visit['presemption_of_insect'] = $presemption_of_insect;\n\t\t\t\t\t$land_visit['soil_moisture_id'] = $soil_moisture_id;\n\t\t\t\t\t$land_visit['quality_of_crop'] = $quality_of_crop;\n\t\t\t\t\t$land_visit['image'] = $pathComplete;\n\t\t\t\t\t$land_visit['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_visit['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_visit['fe_code'] = $LoginID;\n\t\t\t\t\t$land_visit['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_visit['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_visit', $land_visit);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land visit Detail Inserted successfully.', 'land_visit_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}",
"public function viewAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n\t\t\t $app_manager_model = new Default_Model_Appraisalmanager();\n\t\t\t\t$line_managers = array();\n\t\t\t\t$line_managers = $app_manager_model->getLineManagers($id,$loginUserId);\n\t\t\t\t$appraisal_init_model = new Default_Model_Appraisalinit();\n\t\t\t\t$appraisal_data = $appraisal_init_model->getappdata_forview($id);\n\t\t\t\t\n if(is_numeric($id) && $id>0 && $line_managers && !empty($appraisal_data))\n {\n\t\t\t\t\t$appraisal_data['process_status'] = '';\n if(!empty($appraisal_data))\n {\n \tif($appraisal_data['initialize_status'] == 1)\n \t{\n \t\tif($appraisal_data['enable_step'] == 1)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n \t\tif($appraisal_data['enable_step'] == 2)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n \t}\n \telse if($appraisal_data['initialize_status'] == 2)\n \t{\n \t\t$appraisal_data['process_status'] = 'Initialize Later';\n \t}else\n\t\t\t \t{\n\t\t\t \t $data['process_status'] = 'In progress';\t\n\t\t\t \t}\n }\n if($appraisal_data['status'] == 1) {\n \t $appraisal_data['status']=\"Open\";\n }else if($appraisal_data['status'] == 2) {\n \t $appraisal_data['status']=\"Closed\";\n }else {\n $appraisal_data['status']=\"Force Closed\";\n }\t\n if($appraisal_data['appraisal_ratings'] == 1) {\n \t $appraisal_data['appraisal_ratings']=\"1-5\";\n }else {\n $appraisal_data['appraisal_ratings']=\"1-10\";\n }\t\n if($appraisal_data['appraisal_mode'] == 'Quarterly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Q\".$appraisal_data['appraisal_period'];\n }\n\t\t\t\t\t else if($appraisal_data['appraisal_mode'] == 'Half-yearly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']= \"H\".$appraisal_data['appraisal_period'];\n\t\t\t\t\t }\n\t\t\t\t\t else {\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Yearly\";\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if($appraisal_data['enable_step'] == 1) {\n \t $appraisal_data['enable_step']=\"Managers\";\n }else {\n $appraisal_data['enable_step']=\"Employees\";\n }\n\t\t\t\t\t $appraisal_data['managers_due_date'] = sapp_Global::change_date($appraisal_data['managers_due_date'],'view');\n $appraisal_data['employees_due_date'] = sapp_Global::change_date($appraisal_data['employees_due_date'],'view');\n $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n $view = $this->getHelper('ViewRenderer')->view;\n $view->previ_data = 'no'; \n $view->data = $appraisal_data;\n $text = $view->render('appraisalinit/view.phtml');\n $this->view->appraisal_id = $id;\n $this->view->manager_id = $loginUserId;\n $this->view->manager_groups = $manager_groups;\n $this->view->appraisal_data = $appraisal_data;\n $this->view->app_text = $text;\n $this->view->controllername = 'appraisalmanager';\n $this->view->id = $id;\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\n }",
"public function actionView($id)\n {\n $dis = (new Query());\n $dis ->select([ 'tf_lunas.status'])\n ->FROM('tf_lunas')\n ->andWhere('tf_lunas.id_tf_lunas=:id_a', array(':id_a'=>$id))\n ->limit(6);\n $command = $dis->createCommand();\n $dis = $command->queryAll();\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dis' => $dis,\n ]);\n }"
]
| [
"0.68188107",
"0.6797727",
"0.677921",
"0.65227747",
"0.65227747",
"0.6490528",
"0.64677656",
"0.64150864",
"0.6393178",
"0.63520163",
"0.6351398",
"0.631365",
"0.6299754",
"0.6286404",
"0.62359726",
"0.62010765",
"0.6178616",
"0.6175141",
"0.6159682",
"0.615695",
"0.61183983",
"0.6104177",
"0.6100232",
"0.60943955",
"0.6063342",
"0.6046311",
"0.6043505",
"0.60432386",
"0.60404754",
"0.6040228"
]
| 0.70173097 | 0 |
actionid: viewbyhrd actiondesc: Display detail view of izin for HRD | public function actionViewByHrd($id){
return $this->render('viewByHrd',[
'model' => $this->findModel($id),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionIndexByHrd(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexByHrd',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionHtView($id)\n {\n ob_start();\n Yii::app()->theme='back';\n $rec=HtuseHome::model()->findByPk($id);\n\n $this->render('htview',array('view'=>$rec));\n\n }",
"public function actionViewByHrdStaf($id){\n return $this->render('viewByHrdStaf',[\n 'model' => $this->findModel($id),\n ]);\n }",
"public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }",
"public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}",
"public function view($view_id) {\n\n\t\t$data = $this->load_module_info ();\n\n\t\t$data['upload_folder'] = $this->upload_folder;\n\n\t\t$where = array($this->table.'.'.$this->primary_key => decode_value($view_id), $this->table);\n\n\t\t$select_array = array ('*');\n\n\t\t\n\t\t$records = $this->Mydb->get_all_records ( $select_array, $this->table, $where, '', '', '', '', '', '' );\n\n\t\t$data ['result'] = $records[0];\n\n\t\t$this->load->view($this->folder.\"/\".$this->module.\"-view\",$data);\n\t}",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n DomainConst::KEY_ACTIONS => $this->listActionsCanAccess,\n ));\n }",
"public function actionView($id)\n {\n $model = $this->findModel($id);\n\n if(!empty($model)){\n\n $adjustment_details = ImAdjustDetail::find()->where(['im_adjust_head_id'=> $model->id])->all();\n\n return $this->render('view', [\n 'model' => $model,\n 'adjustment_details' => $adjustment_details\n ]); \n }\n \n }",
"public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }",
"public function actionView($id)\n {\n\n $search_dep = new DepositSearch();\n $search_dep->investor = $id;\n $deposit = $search_dep->search(Yii::$app->request->queryParams);\n \n $search_with = new WithdrawSearch();\n $search_with->investor = $id;\n $withdraw = $search_with->search(Yii::$app->request->queryParams);\n\n $search_pur = new PurchaseSearch();\n $search_pur->investor = $id;\n $purchase = $search_pur->search(Yii::$app->request->queryParams);\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'deposit'=>$deposit,\n 'withdraw'=>$withdraw,\n 'purchase'=>$purchase,\n ]);\n }",
"public function landIrrigationDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$irri_type_id \t= isset($params['irri_type_id'])?$params['irri_type_id']:\"\";\n\t\t\t\t$irri_no_id\t= isset($params['irri_no_id'])?$params['irri_no_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$irri_date\t= isset($params['irri_date'])?$params['irri_date']:\"\";\n\t\t\t\t$days_after_sowing\t= isset($params['days_after_sowing'])?$params['days_after_sowing']:\"\"; \n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_irrigation = array(); \n\t\t\t\t\t$land_irrigation['land_id'] = $land_id;\n\t\t\t\t\t$land_irrigation['irri_type_id'] = $irri_type_id;\n\t\t\t\t\t$land_irrigation['irri_no_id'] = $irri_no_id;\n\t\t\t\t\t$land_irrigation['stage_id'] = $stage_id;\n\t\t\t\t\t$land_irrigation['irri_date'] = $irri_date;\n\t\t\t\t\t$land_irrigation['days_after_sowing'] = $days_after_sowing;\n\t\t\t\t\t$land_irrigation['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_irrigation['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_irrigation['fe_code'] = $LoginID;\n\t\t\t\t\t$land_irrigation['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_irrigation['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_irrigation', $land_irrigation);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land irrigation Detail Inserted successfully.', 'land_irrigation_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}",
"public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}",
"public function view($id)\n\t{\n\t\n\t\t$this->is_allowed('amuco_details_request_office_view');\n if($this->input->get('popup')){\n\t\t\t$this->data['current_page'] = 'Modal';\n\t\t}else{\n\t\t\t$this->data['current_page'] = 'View';\n\t\t}\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->join_avaiable()->filter_avaiable()->find($id);\n // var_dump($this->data['amuco_details_request_office']);\n\t\t$this->template->title('Amuco Details Request Office Detail');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_view', $this->data);\n\t}",
"public function viewAction()\r\n {\r\n $this->indexAction();\r\n }",
"public function view($id)\n\t{\n\t\t$this->is_allowed('historis_terminal_view');\n\n\t\t$this->data['historis_terminal'] = $this->model_historis_terminal->join_avaiable()->filter_avaiable()->find($id);\n\n\t\t$this->template->title('Historis Terminal Detail');\n\t\t$this->render('backend/standart/administrator/historis_terminal/historis_terminal_view', $this->data);\n\t}",
"public function officer_view($id = null)\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n $this->assignUserToView($id); //user\n \n $allRsvps = $this->Event->EventsUser->find('all', array(\n 'conditions' => array('user_id' => $id)\n ));\n \n //returns all events to the view\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC')\n ));\n \n $this->set('rsvps', $allRsvps);\n \n $numOfEvents = 0;\n $numOfMisses = 0;\n $numOfHours = 0;\n \n //count number of events, hours, and missed events\n foreach($allRsvps as $rsvp):\n if($rsvp['EventsUser']['present'] == TRUE)\n {\n $numOfEvents++;\n foreach($eventdata as $event):\n if($event['Event']['id'] == $rsvp['EventsUser']['event_id'])\n $numOfHours += $event['Event']['hours'];\n endforeach;\n }\n else\n {\n foreach($eventdata as $event):\n if($event['Event']['id'] == $rsvp['EventsUser']['event_id'] && $event['Event']['closed'])\n $numOfMisses++;\n endforeach;\n } \n endforeach;\n \n $this->set('allRsvps', $allRsvps);\n $this->set('numOfEvents', $numOfEvents);\n $this->set('numOfHours', $numOfHours);\n $this->set('numOfMisses', $numOfMisses); \n $this->set('events', $eventdata);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }",
"protected function viewAction()\n {\n }",
"public function actionView($id) {\n $dateRange=$this->getDateRange();\n\t\tif(isset($_GET['stage']) && is_numeric($_GET['stage']))\n\t\t\t$viewStage = $_GET['stage'];\n\t\telse\n\t\t\t$viewStage = null;\n\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'viewStage'=>$viewStage, 'dateRange'=>$dateRange,\n\t\t));\n\t}",
"public function actionView($id)\n {\n $entry = AuditEntry::findOne($id);\n if ($entry) {\n return $this->render('view', ['entry' => $entry]);\n } else {\n throw new \\HttpInvalidParamException('Invalid request number specified');\n }\n\n $this->redirect(['index']);\n }",
"public function actionView($id)\n {\n $dis = (new Query());\n $dis ->select([ 'tf_lunas.status'])\n ->FROM('tf_lunas')\n ->andWhere('tf_lunas.id_tf_lunas=:id_a', array(':id_a'=>$id))\n ->limit(6);\n $command = $dis->createCommand();\n $dis = $command->queryAll();\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dis' => $dis,\n ]);\n }",
"public function actionView($id)\n {\n $rand_id = rand(1, 4);\n $user_agent = Yii::app()->db->createCommand()\n ->select('name')\n ->from('user_agent')\n ->where('id=:id', array(':id'=>$rand_id))\n ->queryRow();\n\n\n $result['id'] = $id;\n $result['sum'] = 10;\n $result['user_agent'] = $user_agent['name'];\n\n $result['percent'] = Yii::app()->params['percent'];\n $result['ip'] = Yii::app()->request->getUserHostAddress();\n\n $this->render('view',array(\n 'result'=>$result,\n ));\n }",
"public function view(int $id)\r\n {\r\n }",
"public function show_detail($i_id=0)\r\n {}",
"public function show_detail($i_id=0)\r\n {}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}",
"public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}",
"private function detailView($id)\n { \n $model = $this->findModel($id);\n \n $searchModel = new SearchInstructionDisposalDetail();\n $dataProvider = $searchModel->search(Yii::$app->request->post(), $id);\n \n Yii::$app->session->set('idInstWhTr', $model->id);\n \n return [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ];\n }",
"public function actionView($id)\n {\n\t$model = $this->findModel($id);\n\t$modelDistributor = $model->waiter0->distributor0;\n\n return $this->render('view', [\n 'model' => $model,\n\t 'modelDistributor' => $modelDistributor,\n ]);\n }",
"public function view($entryid){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"]))return false;\n\t\t$query = Queries::view($entryid, $user[\"id\"]);\n\t\treturn $this->query($query);\n\t}"
]
| [
"0.6496844",
"0.6463363",
"0.6437944",
"0.6205542",
"0.6136174",
"0.59574425",
"0.5919635",
"0.5879459",
"0.5867817",
"0.586525",
"0.58534",
"0.58497083",
"0.58210135",
"0.58080417",
"0.58035666",
"0.5795394",
"0.5783395",
"0.5777988",
"0.5768196",
"0.5766399",
"0.5765667",
"0.57598525",
"0.5752649",
"0.5752649",
"0.5750666",
"0.5750666",
"0.5750666",
"0.5743513",
"0.57405376",
"0.5738235"
]
| 0.7299629 | 0 |
actionid: viewbyhrdstaf actiondesc: Display detail view of izin for HRDstaf | public function actionViewByHrdStaf($id){
return $this->render('viewByHrdStaf',[
'model' => $this->findModel($id),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}",
"public function actionViewByHrd($id){\n return $this->render('viewByHrd',[\n 'model' => $this->findModel($id),\n ]);\n }",
"public function actionViewByStaf($id){\n return $this->render('viewByStaf',[\n 'model' => $this->findModel($id),\n ]);\n }",
"function viewAction(){\r\n\t\t//$iUnitId = Sys_Publib_Library::_getItemAttrById($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'unit_id');\r\n\t\t//Lay ID phong ban cua NSD dang nhap hien thoi\r\n\t\t$pUrl = $_SERVER['REQUEST_URI'];\r\n\t\t$objFunction =\tnew\tSys_Function_DocFunctions()\t;\r\n\t\t$objFilter = new Zend_Filter();\t\t\t\r\n\t\t// Tieu de man hinh danh sach\r\n\t\t$this->view->docInfo \t\t= \"THÔNG TIN VĂN BẢN\";\r\n\t\t$sDocumentId = $this->_request->getParam('hdn_object_id','');\r\n\t\t$sType\t\t = $this->_request->getParam('hdn_type','');\r\n\t\t//Lay cac hang so dung chung\r\n\t\t$arrConst = Sys_Init_Config::_setProjectPublicConst();\r\n\t\t$this->view->arrConst = $arrConst;\r\n\t\t// Tao doi tuong Zend_Filter\r\n\t\t$objFilter = new Zend_Filter();\r\n\t\t$ojbSysLib = new Sys_Library();\r\n\t\t$objFullTextSearch = new fulltextsearch_modFulltextsearch();\r\n\t\t//Lay thong tin trong danh muc\r\n\t\t$arrDocSingle = $objFullTextSearch->DocFullTextSearchDocGetSingle($sDocumentId, $sType);\t\t\t\r\n\t\t$this->view->arrDocSingle = $arrDocSingle;\r\n\t\t//Lay gia tri tim kiem tren form\r\n\t\t\t$sfullTextSearch \t= $this->_request->getParam('txtfullTextSearch','');\r\n\t\t\t$iYear\t \t\t\t= $this->_request->getParam('year','');\r\n\t\t\t$iCurrentPage\t\t= $this->_request->getParam('hdn_current_page',0);\t\r\n\t\t\tif ($iCurrentPage <= 1){\r\n\t\t\t\t$iCurrentPage = 1;\r\n\t\t\t}\r\n\t\t\t$iNumRowOnPage = $this->_request->getParam('cbo_nuber_record_page',0);\r\n\t\t\tif ($iNumRowOnPage == 0)\r\n\t\t\t\t$iNumRowOnPage = 15;\r\n\t\t\t$arrParaSet = array(\"trangHienThoi\"=>$iCurrentPage, \"soBanGhiTrenTrang\"=>$iNumRowOnPage,\"chuoiTimKiem\"=>$sfullTextSearch,\"Nam\"=>$iYear);\r\n\t\t\t$_SESSION['seArrParameter'] = $arrParaSet;\t\r\n\t\t\r\n\t}",
"public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }",
"public function landVisitDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$disease_score\t= isset($params['disease_score'])?$params['disease_score']:\"\";\n\t\t\t\t$logging_score\t= isset($params['logging_score'])?$params['logging_score']:\"\";\n\t\t\t\t$presemption_of_insect\t= isset($params['presemption_of_insect'])?$params['presemption_of_insect']:\"\";\n\t\t\t\t$soil_moisture_id\t= isset($params['soil_moisture_id'])?$params['soil_moisture_id']:\"\";\n\t\t\t\t$quality_of_crop\t= isset($params['quality_of_crop'])?$params['quality_of_crop']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\tif(isset($_FILES['image']['tmp_name']) AND !empty($_FILES['image']['name'])){\n\t\t\t\t\t\t$tempName = $_FILES['image']['tmp_name'];\n\t\t\t\t\t\t$imageName = time().$_FILES['image']['name']; \n\t\t\t\t\t\t$uploads = 'uploads/visit_photograph/';\n\t\t\t\t\t\tif(!file_exists($uploads)){\n\t\t\t\t\t\t\tmkdir($uploads);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pathComplete = $uploads.$imageName;\n\t\t\t\t\t\t@move_uploaded_file($tempName,$pathComplete);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$land_visit = array(); \n\n\t\t\t\t\t$land_visit['land_id'] = $land_id;\n\t\t\t\t\t$land_visit['stage_id'] = $stage_id;\n\t\t\t\t\t$land_visit['disease_score'] = $disease_score;\n\t\t\t\t\t$land_visit['logging_score'] = $logging_score;\n\t\t\t\t\t$land_visit['presemption_of_insect'] = $presemption_of_insect;\n\t\t\t\t\t$land_visit['soil_moisture_id'] = $soil_moisture_id;\n\t\t\t\t\t$land_visit['quality_of_crop'] = $quality_of_crop;\n\t\t\t\t\t$land_visit['image'] = $pathComplete;\n\t\t\t\t\t$land_visit['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_visit['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_visit['fe_code'] = $LoginID;\n\t\t\t\t\t$land_visit['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_visit['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_visit', $land_visit);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land visit Detail Inserted successfully.', 'land_visit_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}",
"public function viewAclAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new Rsvacl_Model_DbTable_DbAcl();\n \t\t$acl_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getAcl($acl_id);\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }",
"public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }",
"public function show_detail($i_id=0)\r\n {}",
"public function show_detail($i_id=0)\r\n {}",
"public function landIrrigationDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$irri_type_id \t= isset($params['irri_type_id'])?$params['irri_type_id']:\"\";\n\t\t\t\t$irri_no_id\t= isset($params['irri_no_id'])?$params['irri_no_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$irri_date\t= isset($params['irri_date'])?$params['irri_date']:\"\";\n\t\t\t\t$days_after_sowing\t= isset($params['days_after_sowing'])?$params['days_after_sowing']:\"\"; \n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_irrigation = array(); \n\t\t\t\t\t$land_irrigation['land_id'] = $land_id;\n\t\t\t\t\t$land_irrigation['irri_type_id'] = $irri_type_id;\n\t\t\t\t\t$land_irrigation['irri_no_id'] = $irri_no_id;\n\t\t\t\t\t$land_irrigation['stage_id'] = $stage_id;\n\t\t\t\t\t$land_irrigation['irri_date'] = $irri_date;\n\t\t\t\t\t$land_irrigation['days_after_sowing'] = $days_after_sowing;\n\t\t\t\t\t$land_irrigation['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_irrigation['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_irrigation['fe_code'] = $LoginID;\n\t\t\t\t\t$land_irrigation['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_irrigation['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_irrigation', $land_irrigation);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land irrigation Detail Inserted successfully.', 'land_irrigation_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}",
"public function viewAction()\r\n {\r\n $this->indexAction();\r\n }",
"public function view_action()\n {\n $mode = get_param_string('mode', 'cns');\n $id = get_param_integer('id');\n\n if ($mode == 'cns') {\n $rows = $GLOBALS['FORUM_DB']->query_select('f_moderator_logs', array('l_reason AS reason', 'id', 'l_by AS member_id', 'l_date_and_time AS date_and_time', 'l_the_type AS the_type', 'l_param_a AS param_a', 'l_param_b AS param_b'), array('id' => $id), '', 1);\n } else {\n $rows = $GLOBALS['SITE_DB']->query_select('actionlogs', array('id', 'member_id', 'date_and_time', 'the_type', 'param_a', 'param_b', 'ip'), array('id' => $id), '', 1);\n }\n\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n $row = $rows[0];\n\n $username = $GLOBALS['FORUM_DRIVER']->get_username($row['member_id']);\n if (is_null($username)) {\n $username = do_lang('UNKNOWN');\n }\n\n $type_str = do_lang($row['the_type'], $row['param_a'], $row['param_b'], null, null, false);\n if (is_null($type_str)) {\n $type_str = $row['the_type'];\n }\n\n $fields = array(\n 'USERNAME' => $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['member_id'], false, '', false),\n 'DATE_TIME' => get_timezoned_date($row['date_and_time']),\n 'ACTION' => $type_str,\n 'PARAMETER_A' => is_null($row['param_a']) ? '' : $row['param_a'],\n 'PARAMETER_B' => is_null($row['param_b']) ? '' : $row['param_b'],\n );\n\n if (array_key_exists('ip', $row)) {\n $fields['IP_ADDRESS'] = escape_html($row['ip']);\n }\n\n if (array_key_exists('reason', $row)) {\n $fields['REASON'] = escape_html($row['reason']);\n }\n\n if (addon_installed('securitylogging')) {\n if (array_key_exists('ip', $row)) {\n $banned_test_1 = ip_banned($row['ip'], true);\n $fields['IP_BANNED'] = (!$banned_test_1) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n if ($row['ip'] != get_ip_address()) {\n $fields['IP_BANNED']->attach(do_template('ACTIONLOGS_TOGGLE_LINK', array('_GUID' => 'eff2890f2193ece32df8ec8ee48b252d', 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_ip_ban', 'id' => $row['ip'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')))));\n }\n\n if ($row['ip'] != get_ip_address()) {\n if (get_option('stopforumspam_api_key') . get_option('tornevall_api_username') != '') {\n $fields['SYNDICATE_TO_STOPFORUMSPAM'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '7d10045c6b3b48f256e2f8eb5535809c',\n 'LABEL' => do_lang_tempcode('PROCEED'),\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'syndicate_ip_ban', 'ip' => $row['ip'], 'member_id' => $row['member_id'], 'reason' => do_lang('BANNED_ADDRESSES'), 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n }\n }\n }\n\n if ((!is_guest($row['member_id'])) && ($row['member_id'] != get_member())) {\n $fields['SUBMITTER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => 'f79fb00ef35d89381371a67bc9c4d69b',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_submitter_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_2 = $GLOBALS['SITE_DB']->query_select_value_if_there('usersubmitban_member', 'the_member', array('the_member' => $row['member_id']));\n $fields['SUBMITTER_BANNED'] = is_null($banned_test_2) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n }\n\n if (((get_forum_type() == 'cns') && (!is_guest($row['member_id']))) && ($row['member_id'] != get_member())) {\n $fields['MEMBER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '6b192ecfad1afc67bb8c2f1e744cc3b1',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_member_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_3 = $GLOBALS['FORUM_DRIVER']->is_banned($row['member_id']);\n $fields['MEMBER_BANNED'] = $banned_test_3 ? do_lang_tempcode('YES') : do_lang_tempcode('NO');\n }\n }\n $fields['INVESTIGATE_USER'] = hyperlink(build_url(array('page' => 'admin_lookup', 'id' => (array_key_exists('ip', $row)) ? $row['ip'] : $row['member_id']), '_SELF'), do_lang_tempcode('PROCEED'), false, false);\n\n // Is there a revision here?\n require_code('revisions_engine_database');\n $revision_engine = new RevisionEngineDatabase($mode == 'cns');\n $revision = $revision_engine->find_revision_for_log($id);\n if (is_null($revision)) {\n require_code('revisions_engine_files');\n $revision_engine = new RevisionEngineFiles();\n $revision = $revision_engine->find_revision_for_log($id);\n }\n if (!is_null($revision)) {\n if (isset($revision['r_resource_type']) && isset($revision['r_resource_id'])) {\n require_code('content');\n list($content_title, , , , $content_url) = content_get_details($revision['r_resource_type'], $revision['r_resource_id']);\n if (empty($content_title)) {\n $content_title = $revision['r_original_title'];\n }\n if (!is_null($content_url)) {\n $fields['VIEW'] = hyperlink($content_url, $content_title, false, true);\n }\n }\n\n if (isset($revision['r_original_content_owner'])) {\n $fields['CONTENT_OWNER'] = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($revision['r_original_content_owner']);\n }\n\n if (isset($revision['r_original_content_timestamp'])) {\n $fields['CONTENT_DATE_AND_TIME'] = get_timezoned_date($revision['r_original_content_timestamp']);\n }\n\n if (isset($revision['r_original_title'])) {\n if ($revision['r_original_title'] != '') {\n $fields['TITLE_PRIOR_TO_REVISION'] = $revision['r_original_title'];\n }\n }\n\n $fields['TEXT_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_text'], true);\n\n if (isset($revision['r_original_resource_fs_path'])) {\n $fields['RESOURCE_FS_PATH_PRIOR_TO_REVISION'] = $revision['r_original_resource_fs_path'];\n }\n\n if (isset($revision['r_original_resource_fs_record']) && strlen($revision['r_original_resource_fs_record']) < 1024 * 50/*50kb reasonable limit*/) {\n $fields['RESOURCE_FS_RECORD_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_resource_fs_record'], true);\n }\n\n if (has_privilege(get_member(), 'delete_revisions')) {\n $delete_url = build_url(array('page' => 'admin_revisions', 'type' => 'delete', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('DELETE'), false, false, do_lang_tempcode('DELETE_REVISION'), null, new Tempcode());\n $fields['DELETE_REVISION'] = $delete;\n }\n\n /*if (has_privilege(get_member(), 'undo_revisions')) {\n $undo_url = build_url(array('page' => 'admin_revisions', 'type' => 'undo', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('UNDO'), false, false, do_lang_tempcode('UNDO_REVISION'), null, new Tempcode());\n $fields['UNDO_REVISION'] = $delete;\n }*/\n }\n\n require_code('templates_map_table');\n return map_table_screen($this->title, $fields);\n }",
"public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}",
"protected function viewAction()\n {\n }",
"public function viewAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n\t\t\t $app_manager_model = new Default_Model_Appraisalmanager();\n\t\t\t\t$line_managers = array();\n\t\t\t\t$line_managers = $app_manager_model->getLineManagers($id,$loginUserId);\n\t\t\t\t$appraisal_init_model = new Default_Model_Appraisalinit();\n\t\t\t\t$appraisal_data = $appraisal_init_model->getappdata_forview($id);\n\t\t\t\t\n if(is_numeric($id) && $id>0 && $line_managers && !empty($appraisal_data))\n {\n\t\t\t\t\t$appraisal_data['process_status'] = '';\n if(!empty($appraisal_data))\n {\n \tif($appraisal_data['initialize_status'] == 1)\n \t{\n \t\tif($appraisal_data['enable_step'] == 1)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n \t\tif($appraisal_data['enable_step'] == 2)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n \t}\n \telse if($appraisal_data['initialize_status'] == 2)\n \t{\n \t\t$appraisal_data['process_status'] = 'Initialize Later';\n \t}else\n\t\t\t \t{\n\t\t\t \t $data['process_status'] = 'In progress';\t\n\t\t\t \t}\n }\n if($appraisal_data['status'] == 1) {\n \t $appraisal_data['status']=\"Open\";\n }else if($appraisal_data['status'] == 2) {\n \t $appraisal_data['status']=\"Closed\";\n }else {\n $appraisal_data['status']=\"Force Closed\";\n }\t\n if($appraisal_data['appraisal_ratings'] == 1) {\n \t $appraisal_data['appraisal_ratings']=\"1-5\";\n }else {\n $appraisal_data['appraisal_ratings']=\"1-10\";\n }\t\n if($appraisal_data['appraisal_mode'] == 'Quarterly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Q\".$appraisal_data['appraisal_period'];\n }\n\t\t\t\t\t else if($appraisal_data['appraisal_mode'] == 'Half-yearly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']= \"H\".$appraisal_data['appraisal_period'];\n\t\t\t\t\t }\n\t\t\t\t\t else {\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Yearly\";\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if($appraisal_data['enable_step'] == 1) {\n \t $appraisal_data['enable_step']=\"Managers\";\n }else {\n $appraisal_data['enable_step']=\"Employees\";\n }\n\t\t\t\t\t $appraisal_data['managers_due_date'] = sapp_Global::change_date($appraisal_data['managers_due_date'],'view');\n $appraisal_data['employees_due_date'] = sapp_Global::change_date($appraisal_data['employees_due_date'],'view');\n $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n $view = $this->getHelper('ViewRenderer')->view;\n $view->previ_data = 'no'; \n $view->data = $appraisal_data;\n $text = $view->render('appraisalinit/view.phtml');\n $this->view->appraisal_id = $id;\n $this->view->manager_id = $loginUserId;\n $this->view->manager_groups = $manager_groups;\n $this->view->appraisal_data = $appraisal_data;\n $this->view->app_text = $text;\n $this->view->controllername = 'appraisalmanager';\n $this->view->id = $id;\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\n }",
"public function actionView($id)\n {\n $dis = (new Query());\n $dis ->select([ 'tf_lunas.status'])\n ->FROM('tf_lunas')\n ->andWhere('tf_lunas.id_tf_lunas=:id_a', array(':id_a'=>$id))\n ->limit(6);\n $command = $dis->createCommand();\n $dis = $command->queryAll();\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dis' => $dis,\n ]);\n }",
"public function actionIndexByHrd(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexByHrd',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function display($sort_by = 'alue_code', $sort_order = 'asc', $code_sel = '0', $filter = '') \r\n {\r\n if (($sort_by != $this->session->userdata('sort_by')) ||\r\n ($sort_order != $this->session->userdata('sort_order')) ||\r\n ($code_sel != $this->session->userdata('code_sel')) ||\r\n ($filter != $this->session->userdata('filter'))) {\r\n \r\n //Jos jokin tilamuuttuja muuttuu, poistetaan virheteksti näkyvistä\r\n if(isset($_SESSION['error'])){\r\n unset($_SESSION['error']);\r\n }\r\n }\r\n \r\n //Tallenna näytön uusi tila\r\n $territory_view_state_data = array(\r\n 'sort_by' => $sort_by,\r\n 'sort_order' => $sort_order,\r\n 'code_sel' => $code_sel,\r\n 'filter' => $filter\r\n );\r\n $this->session->set_userdata($territory_view_state_data);\r\n \r\n //Hakuparametrit näytölle\r\n $data['display_fields'] = array(\r\n 'alue_code'\t\t=> 'numero',\r\n 'alue_detail'\t=> 'alue_nimi',\r\n 'alue_location'\t=> 'lisätieto',\r\n 'alue_taloudet'\t=> 'koko',\r\n 'event_count'\t=> 'poisto'\r\n );\r\n \r\n //Hakuparametrit kantaan\r\n $data['database_fields'] = array(\r\n 'alue_code'\t\t=> 'numero',\r\n 'alue_detail'\t=> 'alue_nimi',\r\n 'alue_location'\t=> 'lisätieto',\r\n 'alue_taloudet'\t=> 'koko',\r\n 'event_count'\t=> 'määrä'\r\n );\r\n\r\n //Korjaa ääkköset takaisin\r\n $filter = urldecode($filter);\r\n \r\n //Hae tiedot\r\n $results = $this->Maintenance_model->search($data['database_fields'], $sort_by, $sort_order, $code_sel);\r\n //Tiedot näytölle sopiviksi\r\n $data['alueet'] = $this->create_displayrows($results);\r\n \r\n $data['num_results'] = $results['num_rows'];\r\n \r\n //Parameters back to view page\r\n $data['sort_by'] = $sort_by;\r\n $data['sort_order'] = $sort_order;\r\n $data['code_sel'] = $code_sel;\r\n $data['filter'] = $filter;\r\n \r\n //Hae aluekoodit\r\n $tresults = $this->Event_model->get_terr_codes();\r\n $data['territory_codes'] = $tresults['rows'];\r\n\r\n //Alusta tietorakenne undo/redo - toimintoa varten\r\n //Jos parametreja ei ole annettu, alusta tietorakenne\r\n $numargs = func_num_args();\r\n if ($numargs == 0) {\r\n /** Initialize **/\r\n $undo_redo_stack = new UndoRedoStack();\r\n \r\n //Poistetaan virheteksti näkyvistä\r\n if(isset($_SESSION['error'])){\r\n unset($_SESSION['error']);\r\n }\r\n } else {\r\n //Muuten\r\n if (!isset($_SESSION['undo_redo_terr_edit'])) {\r\n /** Initialize **/\r\n $undo_redo_stack = new UndoRedoStack();\r\n } else {\r\n /** UNSERIALIZE **/\r\n $undo_redo_stack = unserialize($_SESSION['undo_redo_terr_edit']);\r\n }\r\n }\r\n \r\n $data['can_undo'] = $undo_redo_stack->can_undo();\r\n $data['can_redo'] = $undo_redo_stack->can_redo();\r\n \r\n /** SERIALIZE **/\r\n $_SESSION['undo_redo_terr_edit'] = serialize($undo_redo_stack);\r\n \r\n $this->load->view('maintenance_view', $data);\r\n }",
"public function actionHtView($id)\n {\n ob_start();\n Yii::app()->theme='back';\n $rec=HtuseHome::model()->findByPk($id);\n\n $this->render('htview',array('view'=>$rec));\n\n }",
"public function viewAction()//23:15\n {\n\n }",
"public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }",
"public function view($id)\n\t{\n\t\n\t\t$this->is_allowed('amuco_details_request_office_view');\n if($this->input->get('popup')){\n\t\t\t$this->data['current_page'] = 'Modal';\n\t\t}else{\n\t\t\t$this->data['current_page'] = 'View';\n\t\t}\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->join_avaiable()->filter_avaiable()->find($id);\n // var_dump($this->data['amuco_details_request_office']);\n\t\t$this->template->title('Amuco Details Request Office Detail');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_view', $this->data);\n\t}",
"public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }",
"public function oneto50kAction(){\r\n\tif($this->_getParam('id',false)){\r\n\t$gazetteers = new Osdata();\r\n\t$this->view->gazetteer = $gazetteers->getGazetteer($this->_getParam('id'));\t\r\n\t} else {\r\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\t\r\n\t}\r\n\t}",
"public function indexAction() {\r\n\t\t// set default filter (we use this to optimize the first call/rendering of the available 'sub-actions')\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_startDateFilterForDbRecords', date('d.m.Y',strtotime(\"-10 day\")));\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_stopDateFilterForDbRecords', NULL);\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForFiles', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForFolders', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForTablePages', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForTableStaticCache', '---- SET FILTER! ----');\r\n\r\n\t\ttry {\r\n\t\t\t$showDatabaseDetails = $this->getModuleData('tx_extracache_manager_showDatabaseDetails') === TRUE ? TRUE : FALSE;\r\n\t\t\t$showFilesDetails = $this->getModuleData('tx_extracache_manager_showFilesDetails') === TRUE ? TRUE : FALSE;\r\n\t\r\n\t\t\t$this->getView()->assign ( 'showDatabaseDetails', $showDatabaseDetails);\r\n\t\t\t$this->getView()->assign ( 'showFilesDetails', $showFilesDetails);\r\n\t\t\t$this->getView()->assign ( 'tableEventLog', $this->getCacheDatabaseEntryRepositoryForTableEventlog()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tableEventQueue', $this->getCacheDatabaseEntryRepositoryForTableEventqueue()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tablePages', $this->getCacheDatabaseEntryRepositoryForTablePages()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tableStaticCache', $this->getCacheDatabaseEntryRepositoryForTableStaticCache()->getFileTable () );\r\n\r\n\t\t\tif($showDatabaseDetails) {\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableEventlog', $this->getCacheDatabaseEntryRepositoryForTableEventlog()->countAll () );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableEventqueue', $this->getCacheDatabaseEntryRepositoryForTableEventqueue()->countAll () );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTablePages', $this->getCacheDatabaseEntryRepositoryForTablePages()->count ( 'tx_extracache_cleanerstrategies!=\\'\\' OR tx_extracache_events!=\\'\\'' ) );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableStaticCache', $this->getCacheDatabaseEntryRepositoryForTableStaticCache()->countAll () );\r\n\t\t\t}\r\n\t\t\tif($showFilesDetails) {\r\n\t\t\t\t$this->getView()->assign ( 'countFiles', $this->getCacheFileRepository()->countAll () );\r\n\t\t\t}\r\n\r\n\t\t\treturn $this->getView()->render ( 'index' );\r\n\t\t} catch (Exception $e) {\r\n\t\t\treturn $this->showErrorMessage($e);\r\n\t\t}\t\r\n\t}",
"public function actionView($id) {\n $dateRange=$this->getDateRange();\n\t\tif(isset($_GET['stage']) && is_numeric($_GET['stage']))\n\t\t\t$viewStage = $_GET['stage'];\n\t\telse\n\t\t\t$viewStage = null;\n\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'viewStage'=>$viewStage, 'dateRange'=>$dateRange,\n\t\t));\n\t}",
"public function detail($id){\n \n $this->_estado->_setIdTableValue($id);\n $params['rsEstado'] = $this->_estado->getRecord();\n \\kerana\\View::showView($this->_current_module,'estado/detail',$params);\n \n }",
"public function viewAction() {\n\t\t$id = $this->_getParam('id');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\t$latest_flag = ($this->_getParam('latest') == 'f') ? false : true;\n\t\t$latest_ta_id = $ta->latestReleasedVersionId();\n\t\tif ($latest_ta_id != $id && !UserAcl::isDomainAdminOrAbove() && $latest_flag) {\n\t\t\t$this->_redirect('/teachingactivity/view/id/'.$latest_ta_id);\n\t\t\treturn;\n\t\t}\n\t\t$this->view->debugdate = $this->_getParam('debugdate');\n\t\t$layout = $this->_getParam('layout', '');\n\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\n\t\t$this->view->ta = $ta;\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t\n\t\t$this->view->showGenericEvaluation = EvaluateTaConst::showGenericEvaluation($ta->typeID);\n\t\t\n\t\tif(UserAcl::isAdmin() && $this->view->showGenericEvaluation === true) {\n \t\t$studentEvaluateService = new StudentEvaluateService();\n \t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n \t\t$studentEvaluate = new StudentEvaluate();\n \t\t$this->view->taEvaluationAvg = $studentEvaluate->getRatingAvg('ta', $id);\n\t\t}\n\n\t\t$this->view->display_edit_links = UserAcl::isStaffOrAbove() && UserAcl::checkTaPermission($ta, UserAcl::$EDIT) === true && count($this->view->released_los) > 0;\n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\t\t$this->view->resources = $ta->resources;\n\t\t\n\t\t$this->view->pblTaTypePrev = '';\n\t\t$this->view->pblTaTypeNext = '';\n\t\t\n\t if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n //$this->render('pblview');\n break;\n }\n }\n\t\t$this->view->socialtools = StudentResourceService::showSocialTools();\n\t}",
"public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n DomainConst::KEY_ACTIONS => $this->listActionsCanAccess,\n ));\n }"
]
| [
"0.6809829",
"0.6633601",
"0.6407932",
"0.6267323",
"0.6240988",
"0.6205663",
"0.61514306",
"0.6147583",
"0.61270475",
"0.61270475",
"0.6112112",
"0.6107416",
"0.60584515",
"0.6033962",
"0.60305643",
"0.60281557",
"0.6024982",
"0.5951128",
"0.589618",
"0.58877134",
"0.58874136",
"0.5878248",
"0.5874678",
"0.58513737",
"0.58491766",
"0.5847309",
"0.5845411",
"0.58224106",
"0.5821434",
"0.5801285"
]
| 0.7101994 | 0 |
actionid: viewbywr2 actiondesc: Display detail view of izin for Vice Rector 2 | public function actionViewByWr2($id){
return $this->render('viewByWr2',[
'model' => $this->findModel($id),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function viewAction(){\r\n\t\t//$iUnitId = Sys_Publib_Library::_getItemAttrById($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'unit_id');\r\n\t\t//Lay ID phong ban cua NSD dang nhap hien thoi\r\n\t\t$pUrl = $_SERVER['REQUEST_URI'];\r\n\t\t$objFunction =\tnew\tSys_Function_DocFunctions()\t;\r\n\t\t$objFilter = new Zend_Filter();\t\t\t\r\n\t\t// Tieu de man hinh danh sach\r\n\t\t$this->view->docInfo \t\t= \"THÔNG TIN VĂN BẢN\";\r\n\t\t$sDocumentId = $this->_request->getParam('hdn_object_id','');\r\n\t\t$sType\t\t = $this->_request->getParam('hdn_type','');\r\n\t\t//Lay cac hang so dung chung\r\n\t\t$arrConst = Sys_Init_Config::_setProjectPublicConst();\r\n\t\t$this->view->arrConst = $arrConst;\r\n\t\t// Tao doi tuong Zend_Filter\r\n\t\t$objFilter = new Zend_Filter();\r\n\t\t$ojbSysLib = new Sys_Library();\r\n\t\t$objFullTextSearch = new fulltextsearch_modFulltextsearch();\r\n\t\t//Lay thong tin trong danh muc\r\n\t\t$arrDocSingle = $objFullTextSearch->DocFullTextSearchDocGetSingle($sDocumentId, $sType);\t\t\t\r\n\t\t$this->view->arrDocSingle = $arrDocSingle;\r\n\t\t//Lay gia tri tim kiem tren form\r\n\t\t\t$sfullTextSearch \t= $this->_request->getParam('txtfullTextSearch','');\r\n\t\t\t$iYear\t \t\t\t= $this->_request->getParam('year','');\r\n\t\t\t$iCurrentPage\t\t= $this->_request->getParam('hdn_current_page',0);\t\r\n\t\t\tif ($iCurrentPage <= 1){\r\n\t\t\t\t$iCurrentPage = 1;\r\n\t\t\t}\r\n\t\t\t$iNumRowOnPage = $this->_request->getParam('cbo_nuber_record_page',0);\r\n\t\t\tif ($iNumRowOnPage == 0)\r\n\t\t\t\t$iNumRowOnPage = 15;\r\n\t\t\t$arrParaSet = array(\"trangHienThoi\"=>$iCurrentPage, \"soBanGhiTrenTrang\"=>$iNumRowOnPage,\"chuoiTimKiem\"=>$sfullTextSearch,\"Nam\"=>$iYear);\r\n\t\t\t$_SESSION['seArrParameter'] = $arrParaSet;\t\r\n\t\t\r\n\t}",
"public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}",
"public function actionIndexByWr2(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexByWr2',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"function showApprentice() {\n\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\n\t\t\t\t\t$editForm = new h2o('views/editApprentice.html');\n\t\t\t\t\techo $editForm->render(compact('apprentice'));\n\t\t\t\t}",
"public function viewAction() {\n\t\t$role = new Role_Model_Role();\n\t\t$this->view->record = $role->findById($this->getRequest()->getParam('id'));\n\t}",
"public function show_detail($i_id=0)\r\n {}",
"public function show_detail($i_id=0)\r\n {}",
"public function detailAction(){\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBikeAd.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_updBikeAds.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBike2Ext.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/default/db_selVPic.php');\n\t\t$req = $this -> getRequest();\n\t\t$lang = $this -> lang;\n\t\t$p = $req -> getParams();\n\t\t\n\t\tif (isset($p['id'])){\t\t\t\n\t\t\t$bikeDetails = db_selBikeAd(array('bikeID' => $p['id']));\n\t\t\tif (($bikeDetails != false) && is_array($bikeDetails) && (count($bikeDetails) == 1)){\t\t\t\t\n\t\t\t\t$bikeDetails = $bikeDetails[0];\n\t\t\t\t\n\t\t\t\tif (is_array($this -> adminNS -> bikeAds) && isset($this -> adminNS -> bikeAds['bikeID'])\n\t\t\t\t\t&& ($this -> adminNS -> bikeAds['bikeID'] != $bikeDetails['bikeID'])){\n\t\t\t\t\t$this -> resetnsAction();\n\t\t\t\t}\n\t\t\t\t//Safe changes\n\t\t\t\tif (isset($p['bikeSafe'])){\n\t\t\t\t\t$p['bikeID'] = $bikeDetails['bikeID'];\n\t\t\t\t\t$p['bikeBrandID'] = $p['bikeBrand'];\n\t\t\t\t\t$p = $this -> updatebikeAction($p);\n\t\t\t\t\tif (isset($p['error'])){\n\t\t\t\t\t\t$this -> view -> error = $p['error'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$bikeDetails2 = db_selBikeAd(array('bikeID' => $p['id']));\n\t\t\t\t\t\tif (($bikeDetails2 != false) && is_array($bikeDetails2) && (count($bikeDetails2) == 1)){\n\t\t\t\t\t\t\t$bikeDetails = $bikeDetails2[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this -> view -> info = $lang['AINFO_4'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Delete advertisement\n\t\t\t\telse if (isset($p['bikeDel'])){\n\t\t\t\t\t$bikeAd = db_updBikeAds(array(System_Properties::SQL_WHERE => array('bikeID' => $bikeDetails['bikeID'])\n\t\t\t\t\t\t\t\t\t\t\t\t, System_Properties::SQL_SET => array('erased' => 1)\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);\n\t\t\t\t\tif ($bikeAd != false){\n\t\t\t\t\t\t$this -> _forward('index');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Load all bike extra\n\t\t\t\t$this -> loadBikeExt();\n\t\t\t\t\n\t\t\t\t//Load bike extra\n\t\t\t\t$bikeExt = db_selBike2Ext(array('bikeID' => $bikeDetails['bikeID']));\n\t\t\t\tif (($bikeExt != false) && is_array($bikeExt) && (count($bikeExt) > 0)){\n\t\t\t\t\t$bikeDetails['bikeExt'] = array();\n\t\t\t\t\tforeach ($bikeExt as $key => $val){\n\t\t\t\t\t\tarray_push($bikeDetails['bikeExt'], $val['vextID']);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Fetch all bike pics\n\t\t\t\tif (isset($this -> adminNS -> bikePhoto) && is_array($this -> adminNS -> bikePhoto)){\n\t\t\t\t\t$bikePhoto = $this -> adminNS -> bikePhoto;\n\t\t\t\t}\t\n\t\t\t\telse{\n\t\t\t\t\t$bikePhoto = db_selVPic(array(\t'vType' => System_Properties::BIKE_ABRV,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'vID' => $bikeDetails['bikeID']));\n\t\t\t\t\t$bikeDetails['bikePhoto'] = array();\n\t\t\t\t\tforeach($bikePhoto as $key => $kVal){\n\t\t\t\t\t\t$bikeDetails['bikePhoto'][$kVal['vPicID']] = $kVal;\n\t\t\t\t\t}\n\t\t\t\t\t$bikePhoto = $bikeDetails['bikePhoto'];\n\t\t\t\t}\n\t\t\t\t$bikeDetails['bikePhoto'] = $bikePhoto;\n\t\t\t\t\n\t\t\t\t//Load brands and models\t\t\t\t\n\t\t\t\t$this -> loadBikeModelsBrands(array('bikeBrand' => $bikeDetails['bikeBrandID']));\n\t\t\t\t//Load all possible bike extra\n\t\t\t\t$this -> loadBikeExt();\n\t\t\t\t$this -> loadBikeCat();\n\t\t\t\t$this -> view -> bike = $bikeDetails;\n\t\t\t\t\n\t\t\t\t$this -> adminNS -> bikeAds = $bikeDetails;\n\t\t\t\t$this -> adminNS -> bikePhoto = $bikePhoto;\n\t\t\t}else{\n\t\t\t\t$this -> indexAction();\n\t\t\t\t$this -> render('index');\n\t\t\t}\n\t\t}else{\n\t\t\t$this -> indexAction();\n\t\t\t$this -> render('index');\n\t\t}\n\t}",
"function turnitintooltwo_get_view_actions() {\n return array('view');\n}",
"public function actionView()\n {\n \n }",
"public function actionsurveydetails()\n {\n $model = new Troubleticket;\n $this->LoginCheck();\n $module = \"HelpDesk\";\n $urlquerystring = $_SERVER['QUERY_STRING'];\n $paraArr = explode(\"/\", $urlquerystring);\n $ticketId = $paraArr['2'];\n $storedata = $model->findById($module, $ticketId);\n\n $picklist_damagestatus = $model->getpickList('damagestatus');\n $this->render('surveydetails', array('model' => $model,\n 'result' => $storedata,\n 'damagestatus' => $picklist_damagestatus)\n );\n }",
"function rptIndividualClientAction(){\r\n// \t$this->view->staff_list = $db->getAllIndividual();\r\n// \t$key = new Application_Model_DbTable_DbKeycode();\r\n// \t$this->view->data=$key->getKeyCodeMiniInv(TRUE);\r\n }",
"public function viewAction() {\n // neu chua khoi tao\n // neu roi add them 1 phan tu vao sesion voi id va uenc da duoc tao\n $this->layout('layout/bags');\n $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array(\n 'action' => 'getuser'\n ));\n // var_dump($getuser);\n $this->layout()->getuser = $getuser;\n\n $id = $this->params()->fromRoute('id');\n $uenc = $this->params()->fromRoute('uenc');\n\n echo \"id :\";\n var_dump($id);\n echo \"</br>\";\n echo \"uenc :\";\n var_dump($uenc);\n die(\"view is update\");\n }",
"public function actionView($id){\n $userid=Yii::$app->user->identity->id;\n //$model = $this->findModel($id);\n $documents=MgfAttachements::find()->where(['organisation_id'=>$id])->all();\n $concepts=MgfConceptNote::find()->where(['organisation_id'=>$id])->all();\n $screening=MgfScreening::find()->where(['organisation_id'=>$id])->all(); \n $contacts=MgfContact::find()->joinWith('position')->where(['organisation_id'=>$id])->all(); \n $applicant=MgfApplicant::find()->where(['user_id'=>$userid])->one(); \n //$id=getOrganisationID(); \n return $this->render('view', ['model' => $this->findModel($id),'documents'=>$documents,'criteria'=>$screening,'concepts'=>$concepts,'contacts'=>$contacts,'applicant'=>$applicant]);\n }",
"public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }",
"public function landIrrigationDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$irri_type_id \t= isset($params['irri_type_id'])?$params['irri_type_id']:\"\";\n\t\t\t\t$irri_no_id\t= isset($params['irri_no_id'])?$params['irri_no_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$irri_date\t= isset($params['irri_date'])?$params['irri_date']:\"\";\n\t\t\t\t$days_after_sowing\t= isset($params['days_after_sowing'])?$params['days_after_sowing']:\"\"; \n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_irrigation = array(); \n\t\t\t\t\t$land_irrigation['land_id'] = $land_id;\n\t\t\t\t\t$land_irrigation['irri_type_id'] = $irri_type_id;\n\t\t\t\t\t$land_irrigation['irri_no_id'] = $irri_no_id;\n\t\t\t\t\t$land_irrigation['stage_id'] = $stage_id;\n\t\t\t\t\t$land_irrigation['irri_date'] = $irri_date;\n\t\t\t\t\t$land_irrigation['days_after_sowing'] = $days_after_sowing;\n\t\t\t\t\t$land_irrigation['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_irrigation['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_irrigation['fe_code'] = $LoginID;\n\t\t\t\t\t$land_irrigation['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_irrigation['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_irrigation', $land_irrigation);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land irrigation Detail Inserted successfully.', 'land_irrigation_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}",
"public function view($id)\n\t{\n\t\n\t\t$this->is_allowed('amuco_details_request_office_view');\n if($this->input->get('popup')){\n\t\t\t$this->data['current_page'] = 'Modal';\n\t\t}else{\n\t\t\t$this->data['current_page'] = 'View';\n\t\t}\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->join_avaiable()->filter_avaiable()->find($id);\n // var_dump($this->data['amuco_details_request_office']);\n\t\t$this->template->title('Amuco Details Request Office Detail');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_view', $this->data);\n\t}",
"public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }",
"public function actionView() {}",
"public function actionView() {}",
"protected function viewAction()\n {\n }",
"public function actionView($id, $ime)\n {\n if(Yii::$app->user->can('ucitelj')){\n $ocene = Ocena::find()\n ->select('*')\n ->join('JOIN','predmet','ocena.id_predmet = predmet.id_predmet')\n ->join('JOIN','ucenik','ocena.id_ucenik = ucenik.id_ucenik')\n ->where(['ucenik.id_ucenik' => $id])\n ->all();\n return $this->render('view', [\n 'ocene' => $ocene,\n 'ime' => $ime\n ]);\n } else if(Yii::$app->user->isGuest){\n $this->redirect(['../site/login']);\n } else {\n throw new ForbiddenHttpException('Nemate pravo pristupa ovoj stranici');\n }\n }",
"public function imageViewerDetailAction() {\r\n $this->view->photo_id = $photo_id = $this->getRequest()->getParam('photo_id', '0');\r\n $this->view->chanel_id = $chanel_id = $this->getRequest()->getParam('chanel_id', '0');\r\n $this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\r\n\t\t$this->view->params = array();\r\n // initialize extra next previous params\r\n $extraParamsNext = $extraParamsPrevious = array();\r\n if ($this->getRequest()->getParam('limit') != '' && !is_null($this->getRequest()->getParam('limit'))) {\r\n $extraParamsNext['limit'] = $this->getRequest()->getParam('limit') + 1;\r\n $extraParamsPrevious['limit'] = $this->getRequest()->getParam('limit') - 1;\r\n }\r\n $this->view->extraParamsNext = $extraParamsNext;\r\n $this->view->extraParamsPrevious = $extraParamsPrevious;\r\n $this->view->photo = $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $this->view->chanel = $chanel = Engine_Api::_()->getItem('sesvideo_chanel', $chanel_id);\r\n if (!$photo->authorization()->isAllowed($viewer, 'view')) {\r\n $imagePrivateURL = Engine_Api::_()->getApi('settings', 'core')->getSetting('sesalbum.private.photo', 1);\r\n if (!is_file($imagePrivateURL))\r\n $imagePrivateURL = 'application/modules/Sesalbum/externals/images/private-photo.jpg';\r\n $this->view->imagePrivateURL = $imagePrivateURL;\r\n }\r\n $this->view->canComment = $chanel->authorization()->isAllowed($viewer, 'comment');\r\n // send extra params to view for extra URL parameters\r\n // get next photo URL\r\n $this->view->nextPhoto = Engine_Api::_()->sesvideo()->nextPhoto($photo, $extraParamsNext);\r\n // get previous photo URL\r\n $this->view->previousPhoto = Engine_Api::_()->sesvideo()->previousPhoto($photo, $extraParamsPrevious);\r\n if (!$viewer || !$viewer->getIdentity() || $chanel->owner_id != $viewer->getIdentity()) {\r\n $photo->view_count = new Zend_Db_Expr('view_count + 1');\r\n $photo->save();\r\n }\r\n $this->view->canEdit = $canEdit = $photo->authorization()->isAllowed($viewer, 'edit');\r\n $this->view->canDelete = $canDelete = $photo->authorization()->isAllowed($viewer, 'delete');\r\n\r\n $getmodule = Engine_Api::_()->getDbTable('modules', 'core')->getModule('core');\r\n if (!empty($getmodule->version) && version_compare($getmodule->version, '4.8.6') < 0)\r\n $this->view->toArray = true;\r\n else\r\n $this->view->toArray = false;\r\n if ($viewer->getIdentity() == 0)\r\n $level = Engine_Api::_()->getDbtable('levels', 'authorization')->getPublicLevel()->level_id;\r\n else\r\n $level = $viewer;\r\n $type = Engine_Api::_()->authorization()->getPermission($level, 'album', 'imageviewer');\r\n if ($type == 0)\r\n $this->renderScript('chanel/image-viewer-detail-basic.tpl');\r\n else\r\n $this->renderScript('chanel/image-viewer-detail-advance.tpl');\r\n }",
"public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }",
"public function actionView($id)\n {\n $model = $this->findModel($id);\n\n $relatorio = $model->relatorioItems;\n \n $query = new \\yii\\db\\Query();\n\n $query = \\app\\models\\Relatorio_item::find()->where(['relatorio_id' => $id]);\n\n $provider1 = new \\yii\\data\\ActiveDataProvider([\n 'query' => $query,\n ]);\n $query = new \\yii\\db\\Query();\n\n $query = \\app\\models\\Aluno::find()->where(['aluno_id' => $id])->where(['Turma_id' => $id]);\n\n $provider2 = new \\yii\\data\\ActiveDataProvider([\n 'query' => $query,\n ]);\n \n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'provider1' => $provider1,\n 'provider2' => $provider2,\n \n\n ]);\n }",
"public function showAction() {\n $model = new Application_Model_Compromisso();\n //busco o id que eu quero ver\n $comp = $model->find($this->_getParam('id'));\n //crio uma view para o id referente;\n $this->view->assign(\"compromisso\", $comp);\n }",
"public function viewdetailsAction()\n {\n $productId = $this->_getParam('product_id');\n $product = $this->_model->setId($productId);\n $this->view->product = $product->fetch(); \n \n }",
"public function actionView($id)\n { \n return $this->findModel($id);\n \n }",
"function tampil_detail(){\n\n\t\t$id_pengiriman\t =\t$this->uri->segment(3);\n\t\t$data['record'] =\t$this->M_pengiriman->detail($id_pengiriman)->result();\n\t\t$data['record2'] =\t$this->M_pengiriman->detail($id_pengiriman)->row_array();\n\t\t$this->template->content->view('Pengiriman/Detail',$data);\n\t\t$this->template->publish();\n\n\t}",
"public function overviewAction(){\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t if($this->_getParam ( 'actions' )==\"overview\"){\n\t\t\t\t\t $idOverview= $this->_getParam ( 'id' );\n\t\t\t\t\t $idUser = $this->_getParam ( 'userid' );\n\t\t\t\t\t\t\t$GetSelectViewCompanys = $this->GetModelOrganize->SelectOverViewEdit( $idOverview,$idUser );\n\t\t\t\t\t $this->view->SelectOnFormEdit = $GetSelectViewCompanys;\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n $this->view->getIdView = $id;\n \n \n\t\t\t\t\t}"
]
| [
"0.6378575",
"0.63543147",
"0.6303527",
"0.626343",
"0.62405634",
"0.6164748",
"0.6164748",
"0.61529726",
"0.60646427",
"0.60126746",
"0.59798884",
"0.5977606",
"0.59773314",
"0.5975971",
"0.5942107",
"0.5936228",
"0.5933144",
"0.5933069",
"0.59268993",
"0.59268993",
"0.5923289",
"0.5908383",
"0.59075296",
"0.5906618",
"0.5871935",
"0.58690655",
"0.58665013",
"0.5861099",
"0.58502305",
"0.58458674"
]
| 0.695657 | 0 |
actionid: acceptbyhrd actiondesc: Accepting the izin by HRD | public function actionAcceptByHrd($id){
$model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();
foreach ($model as $m) {
$m->status_by_hrd = 6;
}
if($m->save()){
\Yii::$app->messenger->addSuccessFlash("Permohonan Izin telah di-accept oleh HRD");
return $this->redirect(['index-by-hrd']);
} else {
return $this->render('viewByHrd', [
'model'=>$model
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function invi_accept() {\n if(isset($_GET['room_id'], $_GET['user_id'], $_GET['invi_id'])) {\n $data = $this->mod_user->md_acceptInvi($_GET['room_id'], $_GET['user_id'], $_GET['invi_id']);\n } else {\n die();\n }\n }",
"public function handleAcceptInvite($iid) {\n\t\tCourseListModel::acceptInvite($iid);\n\t\t$this->redirect('this');\n\t}",
"public function accept();",
"public function accept($reward_id) {\n\n $user_id = $this->Auth->user('user_id');\n $reward = $this->Reward->acceptPendingReward($reward_id, $user_id);\n\n if (!empty($reward)) {\n\n // broadcast & refresh user's inventory\n $this->loadModel('User');\n $server = $this->User->getCurrentServer($user_id);\n\n if ($server) {\n $this->ServerUtility->broadcastRewardReceive($server, $user_id, $reward['Reward']);\n }\n }\n\n $this->loadItems();\n $this->loadModel('User');\n\n $this->User->id = $user_id;\n $credit = $this->User->field('credit');\n\n $this->set(array(\n 'credit' => $credit,\n 'userItems' => $this->User->getItems($user_id)\n ));\n\n $this->render('/Items/browse_inventory.inc');\n }",
"public function requestAcceptAction() {\r\n $notification = $this->_getParam('notification', 0);\r\n\t\t$is_suggestionExist = Engine_Api::_()->getItem('user', $notification->object_id);\r\n\t\tif( empty($is_suggestionExist) ) {\r\n\t\t\t// If user are not exist then we are deleting the \"User Request\" which loggden user are gettig.\r\n\t\t\tEngine_Api::_()->getDbtable('notifications', 'activity')->delete(array('notification_id = ?' => $notification->notification_id));\r\n\t\t\t$this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t}else {\r\n\t\t\t$this->view->notification = $notification;\r\n\t\t}\r\n }",
"public function GetAccept ();",
"public function acceptAction($id)\n\t{\n\t\t$answer = $this->answers->find($id);\n\t\t$answer->save([\n\t\t\t'accepted' => 1,\t\n\t\t]);\n\t\t$this->addUserScore(1, $this->session->get('userId'));\n\t\t$this->addUserScore(10, $answer->idUser);\n\t\t$this->activities->logActivity('accepted' , $answer->id, $answer->idUser, $answer->idQuestion);\n\t\t$this->response->redirect($this->request->getLastUrl() . '#answerreply' . $answer->id);\n\t}",
"public function accept(){\n \n }",
"public function actionAccept()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $status = $request->paramsGet()->get('status', 1);\n $model->status = $status;\n $model->save(false);\n\n return $this->back();\n }",
"function acceptChallenge($data) {\n $ChallengeData = createChallengeDataObj();\n $acceptStatus = $ChallengeData->acceptChallenge($data);\n if($acceptStatus) {\n return array(\"acceptStatus\" => true);\n }else {\n return array(\"acceptStatus\" => false);\n }\n }",
"protected function accepted()\n {\n $this->response = $this->response->withStatus(202);\n $this->jsonBody($this->payload->getOutput());\n }",
"public function acceptOfferAction()\r\n {\r\n $this->checkSession();\r\n $offerId = $this->Request()->getParam(\"offerId\");\r\n\r\n // updating status of Offer\r\n $offer = Shopware()->Models()->find('Shopware\\CustomModels\\Offer\\Offer',$offerId);\r\n $offer->setStatus(4);\r\n try {\r\n Shopware()->Models()->persist($offer);\r\n Shopware()->Models()->flush();\r\n } catch(Exception $e) {\r\n }\r\n\r\n $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'sKUZOOffer',\r\n 'action' => 'offers'\r\n ));\r\n\r\n }",
"public function\n\tWillHandlerAcceptRequest(Nether\\Avenue\\RouteHandler $H):\n\tBool {\n\n\t\t$Class = $H->GetClass();\n\n\t\t// if the handler class does not have the query method then assume\n\t\t// that it will handle it.\n\t\tif(!method_exists($Class,'WillHandleRequest'))\n\t\treturn TRUE;\n\n\t\treturn (Bool)call_user_func_array(\n\t\t\t[$Class,'WillHandleRequest'],\n\t\t\t[ $this, $H ]\n\t\t);\n\t}",
"public function actionAccept($id)\n {\n /*get cavity record*/\n $modelFound = $this->findModel($id);\n $userCreatorId = 1;\n if(User::find()->where(['username' => $modelFound->created_by_user])->exists()){\n /* @var $userModel User */\n $userModel = User::find()->where(['username' => $modelFound->created_by_user])->one();\n $userCreatorId = $userModel->id;\n }\n /*create property record*/\n $propertyRecord = new PropertyRecord();\n $propertyRecord->postcode = $modelFound->address_postcode_cavity_installation;\n $propertyRecord->address1 = $modelFound->address1_cavity_installation;\n $propertyRecord->address2 = $modelFound->address2_cavity_installation;\n $propertyRecord->address3 = $modelFound->address3_cavity_installation;\n $propertyRecord->town = $modelFound->address_town_cavity_installation;\n $propertyRecord->country = $modelFound->address_country_cavity_installation;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->created_by = $userCreatorId ;\n $propertyRecord->status = 'Accepted on System';\n /* CWI information */\n $propertyRecord->date_of_cwi = $modelFound->CWI_installation_date;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->product_installed = $modelFound->construction_type;\n $propertyRecord->save(false);\n\n /* Property Note*/\n $propertyNote = new PropertyNotes();\n $propertyNote->content = $modelFound->further_notes;\n $propertyNote->created_by = $userCreatorId;\n $propertyNote->note_type = PropertyNotes::NOTE_TYPE_INFO;\n $propertyNote->property_id = $propertyRecord->id;\n $propertyNote->save(false);\n\n /*create owner */\n $owner = new Owner();\n $owner->title = $modelFound->title;\n $owner->firstname = $modelFound->firstname;\n $owner->lastname = $modelFound->lastname;\n $owner->address1 = $modelFound->address1_cavity_installation;\n $owner->address2 = $modelFound->address2_cavity_installation;\n $owner->address3 = $modelFound->address3_cavity_installation;\n $owner->postalcode = $modelFound->address_postcode_cavity_installation;\n $owner->town = $modelFound->address_town_cavity_installation;\n $owner->country = \"United Kingdom\";\n $owner->email_address = $modelFound->email_address;\n if ($modelFound->second_application_telephone) {\n $owner->phone_number = $modelFound->telephone_number.' , '.$modelFound->second_application_mobile_landline;\n } else {\n $owner->phone_number = $modelFound->telephone_number;\n }\n $owner->phone_number = $modelFound->telephone_number;\n $owner->date_of_birth = $modelFound->birthday;\n $owner->save(false);\n\n $owner2 = new Owner();\n $owner2->title = $modelFound->second_application_title;\n $owner2->firstname = $modelFound->second_application_firstname;\n $owner2->lastname = $modelFound->second_application_lastname;\n $owner2->address1 = $modelFound->address1_cavity_installation;\n $owner2->address2 = $modelFound->address2_cavity_installation;\n $owner2->address3 = $modelFound->address3_cavity_installation;\n $owner2->date_of_birth = $modelFound->second_application_birthday;\n if (isset($modelFound->second_application_mobile_landline)) {\n $owner2->phone_number = $modelFound->second_application_telephone.','.$modelFound->second_application_mobile_landline;\n } else {\n $owner2->phone_number = $modelFound->second_application_telephone;\n }\n $owner2->email_address = $modelFound->second_application_email_address;\n $owner2->save(false);\n\n $propertOwner = new PropertyOwner();\n $propertOwner->owner_id = $owner->id;\n $propertOwner->property_id = $propertyRecord->id;\n $propertOwner->save(false);\n\n $propertOwner2 = new PropertyOwner();\n $propertOwner2->owner_id = $owner2->id;\n $propertOwner2->property_id = $propertyRecord->id;\n $propertOwner2->save(false);\n\n\n /*import the images and documents*/\n $supportingDocuments = $modelFound->getSupportingDocuments()->all();\n foreach ($supportingDocuments as $currentSupportingDocuments) {\n /* @var $currentSupportingDocuments CavitySupportingDocument */\n\n /*if current document has type supporting_document_images */\n if ($currentSupportingDocuments->type === 'supporting_document_images') {\n /*save to property document */\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $propertyDocument = new PropertyDocuments();\n $propertyDocument->property_id = $propertyRecord->id;\n $propertyDocument->document_description = $currentSupportingDocuments->document_description;\n $propertyDocument->document_name = $currentSupportingDocuments->document_name;\n $propertyDocument->save(false);\n } else {\n /*save it to pre appraisal images */\n $preAppraisalImage = new PropertyPreAppraisalImages();\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_image_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $preAppraisalImage->property_id = $propertyRecord->id;\n $preAppraisalImage->image_name = $currentSupportingDocuments->document_name;\n $preAppraisalImage->image_description = $currentSupportingDocuments->document_description;\n $preAppraisalImage->save(false);\n }\n $questionairePropertyRecord = new QuestionairePropertyRecord();\n $questionairePropertyRecord->cavity_form_id = $modelFound->id;\n $questionairePropertyRecord->property_record_id = $propertyRecord->id;\n $questionairePropertyRecord->save(false);\n }\n return $this->redirect(Url::to(['/record/update', 'id' => $propertyRecord->id]));\n }",
"public function accept_action($user_id)\n {\n if (!OrganizerSettings::get()->locked && !OrganizerGroup::findGroup($user_id)->hasMaxTeamSize()) {\n OrganizerInvite::accept($user_id);\n }\n\n // Remove existing invites\n OrganizerInvite::cancel($user_id, User::findCurrent()->id);\n $this->redirect('show/index');\n }",
"public function doRedirectAccept() {\n\t\t\theader(\"Location: ../../accept.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}",
"public function accept($actor) {\n $arr = [\n \"type\" => \"Accept\",\n \"object\" => $this->activity_array,\n \"actor\" => $this->obj\n ];\n $accept = new Activity();\n $accept->fill($arr);\n // post new activity to the outbox\n return $accept; \n }",
"public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}",
"public function testApproveSuccessForHr() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES,\n\t\t\t'prefix' => 'hr'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/hr/deferred/approve/3';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been %s.', __('approved')));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t2 => '2',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}",
"public function actionInHf($id = 0)\n {\n $theTour = Product::find()\n ->with([\n 'days',\n 'updatedBy',\n 'bookings',\n 'bookings.createdBy',\n ])\n ->where(['id'=>$id, 'op_status'=>'op'])\n ->asArray()\n ->one();\n\n if (!$theTour) {\n throw new HttpException(404, 'Tour not found.');\n }\n\n $theTourOld = Tour::find()\n ->where(['ct_id'=>$id, 'status'=>'on'])\n ->asArray()\n ->one();\n\n if (!$theTourOld) {\n throw new HttpException(404, 'Tour not found.');\n }\n\n // Tour guide list\n $sql = 'select guide_user_id, guide_name from at_tour_guides where tour_id=:tour_id AND parent_id=0 limit 100';\n $tourguideList = Yii::$app->db->createCommand($sql, [':tour_id'=>$theTour['id']])->queryAll();\n\n // Tour driver list\n $sql = 'select driver_user_id, driver_name from at_tour_drivers where tour_id=:tour_id AND parent_id=0 limit 100';\n $driverList = Yii::$app->db->createCommand($sql, [':tour_id'=>$theTour['id']])->queryAll();\n\n // Payer list\n $sql = 'select payer from cpt where tour_id=:tour_id group by payer order by payer limit 100';\n $payerList = Yii::$app->db->createCommand($sql, [':tour_id'=>$theTourOld['id']])->queryAll();\n\n $theForm = new TourInHdForm;\n $theForm->days = '1-'.$theTour['day_count'];\n $theForm->payer = 'Hướng dẫn MB 1';\n $theForm->language = Yii::$app->language;\n\n if ($theForm->load(Yii::$app->request->post()) && $theForm->validate()) {\n if (empty($theForm->options)) {\n $theForm->options = [];\n }\n $sql = 'SELECT *,\n IF (via_company_id=0, \"\", (SELECT name FROM at_companies c WHERE c.id=via_company_id LIMIT 1)) AS via_company_name,\n IF (by_company_id=0, \"\", (SELECT name FROM at_companies c WHERE c.id=by_company_id LIMIT 1)) AS by_company_name,\n IF (venue_id=0, \"\", (SELECT name FROM venues v WHERE v.id=venue_id LIMIT 1)) AS venue_name,\n 1\n FROM cpt WHERE (latest=dvtour_id OR latest=0) AND tour_id=:tour_id ORDER BY dvtour_day, dvtour_name, updated_at';\n $theCptx = Yii::$app->db->createCommand($sql, [':tour_id'=>$theTourOld['id']])->queryAll();\n\n // Get exchange rates\n $xRates = [\n 'USD'=>22295,\n 'VND'=>1,\n ];\n $sql = 'SELECT rate FROM at_xrates WHERE currency2=\"VND\" AND currency1=\"USD\" AND rate_dt<=\"'.$theTour['day_from'].'\" ORDER BY rate_dt DESC LIMIT 1';\n $theXRate = Yii::$app->db->createCommand($sql)->queryScalar();\n if ($theXRate) {\n $xRates['USD'] = $theXRate;\n }\n\n return $this->render('tours_in-hd_ok', [\n 'theTour'=>$theTour,\n 'theTourOld'=>$theTourOld,\n 'theForm'=>$theForm,\n 'tourguideList'=>$tourguideList,\n 'driverList'=>$driverList,\n 'payerList'=>$payerList,\n 'theCptx'=>$theCptx,\n 'xRates'=>$xRates,\n ]);\n }\n\n return $this->render('tours_in-hd', [\n 'theTour'=>$theTour,\n 'theTourOld'=>$theTourOld,\n 'theForm'=>$theForm,\n 'tourguideList'=>$tourguideList,\n 'driverList'=>$driverList,\n 'payerList'=>$payerList,\n ]);\n }",
"public function accept_frnd_req($frnd_id) {\n $userid = $this->session->userdata('logged_in')['id'];\n $data = array(\n 'user_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($frnd_id, $userid, $data);\n $data1 = array(\n 'resourse_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($userid, $frnd_id, $data1);\n add_notification($frnd_id, $userid,'has accepted your friend request');\n }",
"public function actionRejectByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 4;\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addErrorFlash(\"Permohonan Izin telah di-reject oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }",
"public function accept($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'accepted'\n ]);\n }",
"public function accept($answer_id=0)\n\t{\n\t\tif (!$answer_id)\n\t\t{\n\t\t\t$this->addError(Lang::txt('No answer ID provided.'));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Load the answer\n\t\t$answer = Response::oneOrFail($answer_id);\n\n\t\t// Mark it at the chosen one\n\t\t$answer->set('state', 1);\n\t\tif (!$answer->save())\n\t\t{\n\t\t\t$this->addError($answer->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Mark the question as answered\n\t\t$this->set('state', 1);\n\n\t\t// If banking is enabled\n\t\tif ($this->config('banking'))\n\t\t{\n\t\t\t// Accepted answer is same person as question submitter?\n\t\t\tif ($this->get('created_by') == $answer->get('created_by'))\n\t\t\t{\n\t\t\t\t$reward = Transaction::getAmount('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Remove hold\n\t\t\t\tTransaction::deleteRecords('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Make credit adjustment\n\t\t\t\t$BTL_Q = new Teller(User::get('id'));\n\t\t\t\t$BTL_Q->credit_adjustment($BTL_Q->credit_summary() - $reward);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$db = App::get('db');\n\n\t\t\t\t// Calculate and distribute earned points\n\t\t\t\t$AE = new Economy($db);\n\t\t\t\t$AE->distribute_points(\n\t\t\t\t\t$this->get('id'),\n\t\t\t\t\t$this->get('created_by'),\n\t\t\t\t\t$answer->get('created_by'),\n\t\t\t\t\t'closure'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Set the reward value\n\t\t\t$this->set('reward', 0);\n\t\t}\n\n\t\t// Save changes\n\t\treturn $this->save();\n\t}",
"public function acceptInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->is_accepted = true;\n $invite->save();\n return redirect()->back();\n }",
"public function acceptAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n \n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Accept Page Invitation');\n $form->setDescription('Would you like to accept page invitation for this page?');\n $form->submit->setLabel('Accept Page Invitation');\n\n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\t//SET THE REQUEST AS HANDLED\n\t\t$notification = Engine_Api::_()->getDbtable('notifications', 'activity')->getNotificationByObjectAndType($viewer, $sitepage, 'sitepagemember_invite');\n\t\tif( $notification ) {\n\t\t\t$notification->mitigated = true;\n\t\t\t$notification->save();\n\t\t}\n\n\t\t//GET VALUE FROM THE FORM.\n\t\t$values = $this->getRequest()->getPost();\n\t\t\n\t\t//ADD ACTIVITY\n\t\t$action = Engine_Api::_()->getDbtable('actions', 'activity')->addActivity($viewer, $sitepage, 'sitepage_join');\n\t\tif ( $action ) {\n Engine_Api::_()->getDbtable('actions', 'activity')->attachActivity( $action , $sitepage ) ;\n }\n\t\tEngine_Api::_()->getApi('subCore', 'sitepage')->deleteFeedStream($action,true);\n\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->update(array('active'=> '1', 'user_approved' => '1'), array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t\n\t\t//MEMBER COUNT INCREASE WHEN MEMBER JOIN THE PAGE.\n\t\t$sitepage->member_count++;\n\t\t$sitepage->save();\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n\n $message = Zend_Registry::get('Zend_Translate')->_('You have accepted the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n 'parentRefresh' => true,\n ));\n }\n }",
"public function doAcceptTransfer($iClient = 0, $iAccount = 0, $fromDate = null, $toDate = null, $iOperation = 0) {\n if ($iOperation == 0) {\n $this->redirect('ctransaction/showTransferList/', 'Nebyla zvolena operace', 3);\n }\n $oOperation = $this->moperation->getById($iOperation);\n $oOperation->state = 1;\n $oOperation->employee = $_SESSION['user_id'];\n $oOperation->update();\n $this->redirect('ctransaction/showTransferList/'.$iClient.'/'.$iAccount.'/'.$fromDate.'/'.$toDate, 'Převod byl schválen', 1);\n }",
"function acceptInvite($invite_id,$user_id,$status)\n\t\t{\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_hygiene_investigation',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}",
"public function actioninvokingThisEscrow(){\n $model = new Escrow;\n $escrow_id = $_POST['escrow_id'];\n $reason_for_invocation = $_POST['reason_for_invocation'];\n $accepted_escrow_invocation_terms= $_POST['terms_and_conditions'];\n $escrow_number = $_POST['escrow_number'];\n \n if($model->isThisEscrowInvokable($escrow_id )){\n \n if($model->isTheInvocationOfThisEscrowASuccess($escrow_id,$reason_for_invocation,$accepted_escrow_invocation_terms)){\n $msg = \"This is to ackonwledge your invocation of an escrow, number '$escrow_number'. We will be engaging with you subsequently until all disagreements are resolved. Sorry for the inconvenience\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n )\n );\n }else{\n $msg = \"Your attempt to invoke this escrow, number '$escrow_number'was not successful. Its likely it had previously being invoked or the escrow cannot be invoked. Please contact customer care for assistance\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n }else{\n $msg = \"This escrow cannot be invoked as it appears the escrow is yet to be accepted. Please contact customer care for clarification\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n \n \n \n }",
"public function reqCHash() {}"
]
| [
"0.5739237",
"0.5457175",
"0.5310477",
"0.5254878",
"0.52076644",
"0.5197656",
"0.5173066",
"0.5154822",
"0.5132776",
"0.50738585",
"0.4907356",
"0.4789465",
"0.47849464",
"0.4780551",
"0.47659594",
"0.4756391",
"0.4738949",
"0.473533",
"0.47332546",
"0.47159582",
"0.47017986",
"0.46594292",
"0.46519208",
"0.46465737",
"0.46254444",
"0.4622457",
"0.46184027",
"0.46062607",
"0.45545948",
"0.4552041"
]
| 0.6320747 | 0 |
actionid: acceptbywr2 actiondesc: Accepting the izin by Vice Rector2 | public function actionAcceptByWr2($id){
$model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();
foreach ($model as $m) {
$m->status_by_wr2 = 6;
}
if($m->save()){
\Yii::$app->messenger->addSuccessFlash("Permohonan Izin telah di-accept oleh WR 2");
return $this->redirect(['index-by-wr2']);
} else {
return $this->render('viewByWr2', [
'model'=>$model
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function invi_accept() {\n if(isset($_GET['room_id'], $_GET['user_id'], $_GET['invi_id'])) {\n $data = $this->mod_user->md_acceptInvi($_GET['room_id'], $_GET['user_id'], $_GET['invi_id']);\n } else {\n die();\n }\n }",
"public function acceptAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n \n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Accept Page Invitation');\n $form->setDescription('Would you like to accept page invitation for this page?');\n $form->submit->setLabel('Accept Page Invitation');\n\n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\t//SET THE REQUEST AS HANDLED\n\t\t$notification = Engine_Api::_()->getDbtable('notifications', 'activity')->getNotificationByObjectAndType($viewer, $sitepage, 'sitepagemember_invite');\n\t\tif( $notification ) {\n\t\t\t$notification->mitigated = true;\n\t\t\t$notification->save();\n\t\t}\n\n\t\t//GET VALUE FROM THE FORM.\n\t\t$values = $this->getRequest()->getPost();\n\t\t\n\t\t//ADD ACTIVITY\n\t\t$action = Engine_Api::_()->getDbtable('actions', 'activity')->addActivity($viewer, $sitepage, 'sitepage_join');\n\t\tif ( $action ) {\n Engine_Api::_()->getDbtable('actions', 'activity')->attachActivity( $action , $sitepage ) ;\n }\n\t\tEngine_Api::_()->getApi('subCore', 'sitepage')->deleteFeedStream($action,true);\n\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->update(array('active'=> '1', 'user_approved' => '1'), array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t\n\t\t//MEMBER COUNT INCREASE WHEN MEMBER JOIN THE PAGE.\n\t\t$sitepage->member_count++;\n\t\t$sitepage->save();\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n\n $message = Zend_Registry::get('Zend_Translate')->_('You have accepted the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n 'parentRefresh' => true,\n ));\n }\n }",
"public function actionAccept($id)\n {\n /*get cavity record*/\n $modelFound = $this->findModel($id);\n $userCreatorId = 1;\n if(User::find()->where(['username' => $modelFound->created_by_user])->exists()){\n /* @var $userModel User */\n $userModel = User::find()->where(['username' => $modelFound->created_by_user])->one();\n $userCreatorId = $userModel->id;\n }\n /*create property record*/\n $propertyRecord = new PropertyRecord();\n $propertyRecord->postcode = $modelFound->address_postcode_cavity_installation;\n $propertyRecord->address1 = $modelFound->address1_cavity_installation;\n $propertyRecord->address2 = $modelFound->address2_cavity_installation;\n $propertyRecord->address3 = $modelFound->address3_cavity_installation;\n $propertyRecord->town = $modelFound->address_town_cavity_installation;\n $propertyRecord->country = $modelFound->address_country_cavity_installation;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->created_by = $userCreatorId ;\n $propertyRecord->status = 'Accepted on System';\n /* CWI information */\n $propertyRecord->date_of_cwi = $modelFound->CWI_installation_date;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->product_installed = $modelFound->construction_type;\n $propertyRecord->save(false);\n\n /* Property Note*/\n $propertyNote = new PropertyNotes();\n $propertyNote->content = $modelFound->further_notes;\n $propertyNote->created_by = $userCreatorId;\n $propertyNote->note_type = PropertyNotes::NOTE_TYPE_INFO;\n $propertyNote->property_id = $propertyRecord->id;\n $propertyNote->save(false);\n\n /*create owner */\n $owner = new Owner();\n $owner->title = $modelFound->title;\n $owner->firstname = $modelFound->firstname;\n $owner->lastname = $modelFound->lastname;\n $owner->address1 = $modelFound->address1_cavity_installation;\n $owner->address2 = $modelFound->address2_cavity_installation;\n $owner->address3 = $modelFound->address3_cavity_installation;\n $owner->postalcode = $modelFound->address_postcode_cavity_installation;\n $owner->town = $modelFound->address_town_cavity_installation;\n $owner->country = \"United Kingdom\";\n $owner->email_address = $modelFound->email_address;\n if ($modelFound->second_application_telephone) {\n $owner->phone_number = $modelFound->telephone_number.' , '.$modelFound->second_application_mobile_landline;\n } else {\n $owner->phone_number = $modelFound->telephone_number;\n }\n $owner->phone_number = $modelFound->telephone_number;\n $owner->date_of_birth = $modelFound->birthday;\n $owner->save(false);\n\n $owner2 = new Owner();\n $owner2->title = $modelFound->second_application_title;\n $owner2->firstname = $modelFound->second_application_firstname;\n $owner2->lastname = $modelFound->second_application_lastname;\n $owner2->address1 = $modelFound->address1_cavity_installation;\n $owner2->address2 = $modelFound->address2_cavity_installation;\n $owner2->address3 = $modelFound->address3_cavity_installation;\n $owner2->date_of_birth = $modelFound->second_application_birthday;\n if (isset($modelFound->second_application_mobile_landline)) {\n $owner2->phone_number = $modelFound->second_application_telephone.','.$modelFound->second_application_mobile_landline;\n } else {\n $owner2->phone_number = $modelFound->second_application_telephone;\n }\n $owner2->email_address = $modelFound->second_application_email_address;\n $owner2->save(false);\n\n $propertOwner = new PropertyOwner();\n $propertOwner->owner_id = $owner->id;\n $propertOwner->property_id = $propertyRecord->id;\n $propertOwner->save(false);\n\n $propertOwner2 = new PropertyOwner();\n $propertOwner2->owner_id = $owner2->id;\n $propertOwner2->property_id = $propertyRecord->id;\n $propertOwner2->save(false);\n\n\n /*import the images and documents*/\n $supportingDocuments = $modelFound->getSupportingDocuments()->all();\n foreach ($supportingDocuments as $currentSupportingDocuments) {\n /* @var $currentSupportingDocuments CavitySupportingDocument */\n\n /*if current document has type supporting_document_images */\n if ($currentSupportingDocuments->type === 'supporting_document_images') {\n /*save to property document */\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $propertyDocument = new PropertyDocuments();\n $propertyDocument->property_id = $propertyRecord->id;\n $propertyDocument->document_description = $currentSupportingDocuments->document_description;\n $propertyDocument->document_name = $currentSupportingDocuments->document_name;\n $propertyDocument->save(false);\n } else {\n /*save it to pre appraisal images */\n $preAppraisalImage = new PropertyPreAppraisalImages();\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_image_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $preAppraisalImage->property_id = $propertyRecord->id;\n $preAppraisalImage->image_name = $currentSupportingDocuments->document_name;\n $preAppraisalImage->image_description = $currentSupportingDocuments->document_description;\n $preAppraisalImage->save(false);\n }\n $questionairePropertyRecord = new QuestionairePropertyRecord();\n $questionairePropertyRecord->cavity_form_id = $modelFound->id;\n $questionairePropertyRecord->property_record_id = $propertyRecord->id;\n $questionairePropertyRecord->save(false);\n }\n return $this->redirect(Url::to(['/record/update', 'id' => $propertyRecord->id]));\n }",
"public function actionAccept()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $status = $request->paramsGet()->get('status', 1);\n $model->status = $status;\n $model->save(false);\n\n return $this->back();\n }",
"public function requestAcceptAction() {\r\n $notification = $this->_getParam('notification', 0);\r\n\t\t$is_suggestionExist = Engine_Api::_()->getItem('user', $notification->object_id);\r\n\t\tif( empty($is_suggestionExist) ) {\r\n\t\t\t// If user are not exist then we are deleting the \"User Request\" which loggden user are gettig.\r\n\t\t\tEngine_Api::_()->getDbtable('notifications', 'activity')->delete(array('notification_id = ?' => $notification->notification_id));\r\n\t\t\t$this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t}else {\r\n\t\t\t$this->view->notification = $notification;\r\n\t\t}\r\n }",
"public function GetAccept ();",
"public function accept(){\n \n }",
"public function handleAcceptInvite($iid) {\n\t\tCourseListModel::acceptInvite($iid);\n\t\t$this->redirect('this');\n\t}",
"public function accept($actor) {\n $arr = [\n \"type\" => \"Accept\",\n \"object\" => $this->activity_array,\n \"actor\" => $this->obj\n ];\n $accept = new Activity();\n $accept->fill($arr);\n // post new activity to the outbox\n return $accept; \n }",
"public function acceptOfferAction()\r\n {\r\n $this->checkSession();\r\n $offerId = $this->Request()->getParam(\"offerId\");\r\n\r\n // updating status of Offer\r\n $offer = Shopware()->Models()->find('Shopware\\CustomModels\\Offer\\Offer',$offerId);\r\n $offer->setStatus(4);\r\n try {\r\n Shopware()->Models()->persist($offer);\r\n Shopware()->Models()->flush();\r\n } catch(Exception $e) {\r\n }\r\n\r\n $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'sKUZOOffer',\r\n 'action' => 'offers'\r\n ));\r\n\r\n }",
"public function acceptAction($id)\n\t{\n\t\t$answer = $this->answers->find($id);\n\t\t$answer->save([\n\t\t\t'accepted' => 1,\t\n\t\t]);\n\t\t$this->addUserScore(1, $this->session->get('userId'));\n\t\t$this->addUserScore(10, $answer->idUser);\n\t\t$this->activities->logActivity('accepted' , $answer->id, $answer->idUser, $answer->idQuestion);\n\t\t$this->response->redirect($this->request->getLastUrl() . '#answerreply' . $answer->id);\n\t}",
"public function acceptInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->is_accepted = true;\n $invite->save();\n return redirect()->back();\n }",
"public function accept();",
"public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}",
"public function accept_friend_request()\n {\n //update status to 1;\n $this->Friend_model->accept_friend_request_model();\n //two (perhaps more in the future) data rows are inserted into checked_on table where each one corresponds to the time the user has seen the other user's messages\n $this->Friend_model->insert_notifications_model();\n }",
"public function accept_opportunity(){\n \ttry {\n\t \t$userid= $this->session->userdata('uid');\n $json = file_get_contents(\"php://input\");\n $data = json_decode($json);\n $given_data = array();\n $given_data['userid'] = $userid;\n $given_data['opp_owner']= $data->opportuniy;\n $given_data['opp_id'] = $data->opportuniy_id;\n $given_data['lead_cust_id'] = $data->lead_cust_id;\n $given_data['sell_type'] = $data->sell_type;\n $given_data['opportunity_stage'] = $data->opportunity_stage;\n $given_data['cycle_id']= $data->cycle_id;\n $given_data['mapping_id'] = uniqid(rand());\n // get if its the first stage\n // if yes, accept both stage and ownership\n // if no, accept any of two\n\n //$is_first_stage = $this->opp_sales->is_first_stage($given_data['opportunity_stage']);\n\n if($given_data['opp_owner']=='ownership'){\n \t echo $this->accept_opp_ownership($given_data);\n } else if($given_data['opp_owner']=='stage') {\n \t echo $this->accept_opp_stage($given_data);\n }\n /*if ($is_first_stage == true) {\n \t$own_accept = $this->accept_opp_ownership($given_data);\n \t$stg_accept = $this->accept_opp_stage($given_data);\n \tif ($own_accept == 1 && $stg_accept == 1) {\n \t\techo 1;\n \t}\n } else {\n\t if($given_data['opp_owner']=='ownership'){\n\t \techo $this->accept_opp_ownership($given_data);\n\t } else if($given_data['opp_owner']=='stage') {\n\t \techo $this->accept_opp_stage($given_data);\n\t }\n }*/\n } catch (LConnectApplicationException $e) {\n \t\techo $this->exceptionThrower($e);\n \t}\n }",
"public function accept_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t// print_r($id);\n\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t$timestamp = date(\"Y-m-d H:i:s\");\n\t\t\t\tif (isset($id)) {\n\t\t\t\t\t$status = array('send_status' => ACCEPT);\n\t\t\t\t\t$condition = array('id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition); // Checking row into the data base\n\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'invoice_number' => $result[0]['invoice_number'],\n\t\t\t\t\t\t'item_code' => $result[0]['product_code'],\n\t\t\t\t\t\t'invoice_date' => $result[0]['doi'],\n\t\t\t\t\t\t'item_description' => $result[0]['product_description'],\n\t\t\t\t\t\t'qty' => $result[0]['product_qty'],\n\t\t\t\t\t\t'closing_stock' => $result[0]['product_qty'],\n\t\t\t\t\t\t'amount' => $result[0]['product_amount'],\n\t\t\t\t\t\t'rate' => $result[0]['product_rate'],\n\t\t\t\t\t\t'update_by' => $_SESSION['userInfo']['username'],\n\t\t\t\t\t\t'last_updated' => $timestamp\n\t\t\t\t\t);\n\n\t\t\t\t\t$tablename = 'london_stock';\n\t\t\t\t\t$inr_data = $this->CustomModel->insertInto($tablename, $data);\n\n\t\t\t\t\tif ($inr_data > 0) {\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $status); //Updating the accept status \n\t\t\t\t\t\techo json_encode(array('message' => 'Invoice accepted and stock updated successfuly', 'type' => 'success'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo json_encode(array('message' => 'Something went worng please contact IT', 'type' => 'danger'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function accept($reward_id) {\n\n $user_id = $this->Auth->user('user_id');\n $reward = $this->Reward->acceptPendingReward($reward_id, $user_id);\n\n if (!empty($reward)) {\n\n // broadcast & refresh user's inventory\n $this->loadModel('User');\n $server = $this->User->getCurrentServer($user_id);\n\n if ($server) {\n $this->ServerUtility->broadcastRewardReceive($server, $user_id, $reward['Reward']);\n }\n }\n\n $this->loadItems();\n $this->loadModel('User');\n\n $this->User->id = $user_id;\n $credit = $this->User->field('credit');\n\n $this->set(array(\n 'credit' => $credit,\n 'userItems' => $this->User->getItems($user_id)\n ));\n\n $this->render('/Items/browse_inventory.inc');\n }",
"public function accept()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['agree'] = '1';\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/dashboard','refresh');\n\n }",
"function acceptInvite($invite_id,$user_id,$status)\n\t\t{\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_hygiene_investigation',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}",
"public static function acceptRequest($userId1, $userId2 = null)\n {\n\n /*if($userID2 == null)\n $userID2 = self::getLoggedInUser()->id;\n\n $friends = Friends::where('user_that_sent_request', $userID1)->where('user_that_accepted_request', $userID2)->where('accepted', '0')->count();\n\n if($friends == 1)\n {\n\n $request = Friends::where('user_that_sent_request', $userID1)->where('user_that_accepted_request', $userID2)->where('accepted', '0')->get();\n $request = $request[0];\n $request->accepted = 1;\n $request->save();\n\n }*/\n\n if(!Friends::isRequested($userId1, $userId2))\n return;\n\n $request = Friends::request($userId1, $userId2)->first();\n\n $request->setStatus(1);\n\n $request->save();\n\n }",
"public function accept()\n {\n\n if($this->user['menteer_type']==37 && $this->user['is_matched'] > 0 && $this->user['match_status']=='pending') {\n\n // mentor update\n $update_user = array(\n 'id' => $this->session->userdata('user_id'),\n 'data' => array('match_status' => 'active','match_status_stamp' => date('y-m-d H:i:s')),\n 'table' => 'users'\n );\n $this->Application_model->update($update_user);\n\n // mentee update\n $update_user = array(\n 'id' => $this->user['is_matched'],\n 'data' => array('match_status' => 'active','match_status_stamp' => date('y-m-d H:i:s')),\n 'table' => 'users'\n );\n $this->Application_model->update($update_user);\n\n $mentee = $this->Application_model->get(array('table'=>'users','id'=>$this->user['is_matched']));\n\n // notify mentee about the accept\n\n $data = array();\n $data['first_name'] = $this->user['first_name'];\n $data['last_name'] = $this->user['last_name'];\n\n $message = $this->load->view('/chooser/email/accept', $data, true);\n $this->email->clear();\n $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));\n $this->email->to($mentee['email']);\n $this->email->subject('Mentor has accepted');\n $this->email->message($message);\n\n $result = $this->email->send(); // @todo handle false send result\n\n $this->session->set_flashdata('message', '<div class=\"alert alert-success\">The Mentee has been notified about the acceptance.</div>');\n redirect('/dashboard');\n\n }else{\n\n redirect('/dashboard');\n\n }\n\n }",
"public function accept_action($user_id)\n {\n if (!OrganizerSettings::get()->locked && !OrganizerGroup::findGroup($user_id)->hasMaxTeamSize()) {\n OrganizerInvite::accept($user_id);\n }\n\n // Remove existing invites\n OrganizerInvite::cancel($user_id, User::findCurrent()->id);\n $this->redirect('show/index');\n }",
"public function actionAcceptByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 6;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-accept oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }",
"public function acceptInviteRequest()\n {\n $validations = ['isRoleUser', 'issetInvitation'];\n $request = Validations::manageValidations($validations);\n if ($request != false) {\n if ($request->accept == 1) {\n $query = \"UPDATE activities_users SET invite = 0 WHERE user_id = $request->authUserId and activity_id = $request->activity_id\";\n } else {\n $query = \"DELETE FROM activities_users WHERE user_id = $request->authUserId and activity_id = $request->activity_id\";\n }\n return $this->connection->nonQueryId($query);\n }\n return 'invalid data';\n }",
"public function acceptOrDenyAction(Request $request)\n {\n $ad = (int)$request->attributes->get('ad');\n $offer = (int)$request->attributes->get('offer');\n $type = $request->attributes->get('action');\n $userAttr = $this->user->getAttributes();\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n $validCSRF = $this->validateCSRF();\n if($isTest == 1 && $testResult == 0)\n {\n $userAttr = array('id' => (int)$request->attributes->get('user'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttr = array('id' => (int)$request->attributes->get('elUser1'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($this->isTest)\n {\n $userAttr = array('id' => 2);\n $validCSRF = true;\n }\n $data = $this->enMan->getRepository('AdItemsBundle:AdsOffersPropositions')->propositonExists($ad, $offer, (int)$userAttr['id']);\n if($validCSRF === true && ($type == 'accepter' || $type == 'refuser') && isset($data['id_ad']) && $data['id_ad'] == $ad && isset($data['id_of']) && $offer == $data['id_of'])\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n $this->enMan->getConnection()->beginTransaction();\n try\n {\n $tplVals = array('{AD_TITLE}', '{OFFER_NAME}', '{LOGIN}');\n $realVals = array($data['adName'], $data['offerName'], $this->user->getUser());\n switch($type)\n {\n case 'accepter':\n // add offer to ads_offers table\n $aofEnt = new AdsOffers;\n $aofEnt->setAdsIdAd($this->enMan->getReference('Ad\\ItemsBundle\\Entity\\Ads', $ad));\n $aofEnt->setOffersIdOf($this->enMan->getReference('Catalogue\\OffersBundle\\Entity\\Offers', $offer));\n $aofEnt->setAddedDate('');\n $this->enMan->persist($aofEnt);\n $this->enMan->flush();\n\n $i = 1;\n\n // notify ad's author about the new offer\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_accepted.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_accepted.maildoc'));\n $title = \"Proposition a été acceptée\";\n $message = \"Proposition a été correctement acceptée\";\n\n // update ads_modified table with the last modification\n $this->enMan->getRepository('AdItemsBundle:AdsModified')->adModified($ad, 'offer_accepted');\n break;\n case 'refuser':\n $i = -1;\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_denied.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_denied.maildoc'));\n $title = \"Proposition a été réfusée\";\n $message = \"Proposition a été correctement supprimée\";\n break;\n }\n $q = $this->enMan->createQueryBuilder()->delete('Ad\\ItemsBundle\\Entity\\AdsOffersPropositions', 'aop')\n ->where('aop.ads_id_ad = ?1 AND aop.offers_id_of = ?2 AND aop.users_id_us = ?3')\n ->setParameter(1, $ad)\n ->setParameter(2, $offer)\n ->setParameter(3, $userAttr['id'])\n ->getQuery();\n $p = $q->execute();\n\n // update offers quantity for this ad\n $this->enMan->getRepository('AdItemsBundle:Ads')->updateOffersQuantity($i, $ad);\t\t\n\n // Send private message\n $author = $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', (int)$userAttr['id']);\n $messageVals = array(\n 'title' => $title,\n 'content' => $template,\n 'type' => 2,\n 'state' => 1\n );\n $this->enMan->getRepository('MessageMessagesBundle:Messages')->sendPm($author, $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', $data['id_us']), $messageVals);\n\n $emtEnt = new EmailsTemplates;\n $mail = \\Swift_Message::newInstance()\n ->setSubject($title)\n ->setFrom($this->from['mail'])\n ->setTo($data['email'])\n ->setContentType(\"text/html\")\n ->setBody($emtEnt->getHeaderTemplate().$template.$emtEnt->getFooterTemplate());\n $this->get('mailer')->send($mail);\n\n // commit SQL transaction\n $this->enMan->getConnection()->commit();\n if($this->isTest)\n {\n return new Response('accepted_successfully');\n }\n $ret['isError'] = 0;\n $ret['message'] = $message;\n }\n catch(Exception $e)\n {\n $this->enMan->getConnection()->rollback();\n $this->enMan->close();\n throw $e;\n }\n }\n elseif($validCSRF === false)\n {\n $ret['isError'] = 1;\n $ret['message'] = \"Votre session a expiré. Veuillez réessayer\";\n }\n else\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n $ret['isError'] = 1;\n $ret['message'] = \"Une erreur s'est produite\";\n }\n echo json_encode($ret);\n\tdie();\n }",
"public function accept_frnd_req($frnd_id) {\n $userid = $this->session->userdata('logged_in')['id'];\n $data = array(\n 'user_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($frnd_id, $userid, $data);\n $data1 = array(\n 'resourse_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($userid, $frnd_id, $data1);\n add_notification($frnd_id, $userid,'has accepted your friend request');\n }",
"public function doRedirectAccept() {\n\t\t\theader(\"Location: ../../accept.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}",
"public function accept($token)\n { \n $invitation = Invite::where('token', '=', $token)->first();\n\n $now = Carbon::now();\n\n $dateInvite = new Carbon($invitation->valid_until);\n \n if($now->lte($dateInvite) && $invitation->email == Auth::user()->email){\n\n $invitation->presence = true;\n \n $invitation->save();\n\n return redirect('/admin/dashboard/')->with(['success' => 'Invitation successfully accepted']);\n\n }else{\n return redirect('/admin/dashboard/')->withErrors(['Inconsistent data']);\n }\n\n }",
"public function authorizeAction();"
]
| [
"0.7187119",
"0.6100319",
"0.60615253",
"0.59057015",
"0.5810766",
"0.57556725",
"0.57522696",
"0.5577939",
"0.5527407",
"0.54940474",
"0.5476214",
"0.54071695",
"0.5388103",
"0.5370138",
"0.5369711",
"0.5364064",
"0.5304792",
"0.52655905",
"0.5226043",
"0.5216448",
"0.52159953",
"0.5189949",
"0.5187196",
"0.5186569",
"0.517876",
"0.51646864",
"0.5154256",
"0.5152338",
"0.5138586",
"0.51383847"
]
| 0.62114716 | 1 |
actionid: rejectbyhrd actiondesc: Rejecting the izin by HRD | public function actionRejectByHrd($id){
$model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();
foreach ($model as $m) {
$m->status_by_hrd = 4;
$m->status_by_atasan = 4;
$m->status_by_wr2 = 4;
}
if($m->save()){
\Yii::$app->messenger->addErrorFlash("Permohonan Izin telah di-reject oleh HRD");
return $this->redirect(['index-by-hrd']);
} else {
return $this->render('viewByHrd', [
'model'=>$model
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}",
"public function testRejectSuccessForHr() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES,\n\t\t\t'prefix' => 'hr'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/hr/deferred/reject/3';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been %s.', __('rejected')));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t2 => '2',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}",
"public function reject() {\n }",
"public function testRejectInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}",
"function rejectAction(Request $request) {\n $resource = $this->findOr404($request);\n $arrangementProgramManager = $this->getArrangementProgramManager();\n\n if (!$arrangementProgramManager->isAllowToApprove($resource)) {\n throw $this->createAccessDeniedHttpException();\n }\n $observation = $request->get('observation');\n if (empty($observation)) {\n $this->flashHelper->setFlash('error', 'error_observation');\n } else {\n $resource->setStatus(ArrangementProgram::STATUS_REJECTED);\n $this->addObservation($resource, $observation);\n\n $user = $this->getUser();\n $details = $resource->getDetails();\n $details\n ->setRejectedBy($user)\n ->setRejectedDate(new DateTime());\n\n $this->domainManager->dispatchEvent('pre_rejected', new ResourceEvent($resource));\n\n $this->domainManager->update($resource);\n $this->flashHelper->setFlash('success', 'rejected');\n\n $this->domainManager->dispatchEvent('post_rejected', new ResourceEvent($resource));\n }\n return $this->redirectHandler->redirectTo($resource);\n }",
"function reject_dispute(){\n\t\t$disputeId = $this->uri->segment(4);\n\n\t\t$condition = array('id' => $disputeId);\n\n\t\t$data = array('status' =>'Reject');\n\t\t\n\t\t$this->review_model->update_details(DISPUTE,$data,$condition);\n\n\n\t\t$this->setErrorMessage('success','Dispute rejected successfully');\n\t\tredirect('admin/dispute/display_dispute_list');\n\n\t}",
"public function testRejectDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}",
"public function reject()\n {\n return $this->setStatus(self::STATUS_REJECTED);\n }",
"public function do_reject(Request $request, $id){\n\n\n $leave = Leave::find($id);\n\n if(auth::id() == $leave->supervisor_id){\n\n $leave->supervisor_action = 2;\n $leave->current_position = 0;\n $leave->leave_status = 2;\n $leave->leave_message = \"Rejected by Supervisor\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by Supervisor',\n 'position' => 'Supervisor',\n 'sent_to' => 162\n\n ]);\n\n /////////////////////////////////////////////send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find($leave->supervisor_id)->display_name.\". - \".$request->comment.\"\";\n\n $message_suppervisor = \" You have rejected \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment: \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been rejected by \".User::find($leave->supervisor_id)->display_name.\". Comment: \".$request->comment.\"\";\n\n /*$message_hr = \" \".User::find(auth::id())->display_name.\" needs your approval for\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave application.\";*/\n\n //send notification to users\n auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n /*$toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));*/\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n\n // fire leavePublished event after post is successfully added to database\n\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n //end of send email\n\n\n\n\n\n // event(new leavePublished($post));\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n } elseif((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n\n $leave->hr_action = 2;\n $leave->current_position = 4;\n $leave->leave_status = 4;\n $leave->leave_message = \"Rejected by HR\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by HR',\n 'position' => 'HR',\n 'sent_to' => 162\n\n ]);\n\n\n\n //send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n $tosupervisor = User::find($leave->supervisor_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\". (HR). Comment - \".$request->comment.\"\";\n\n $message_suppervisor = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_hr = \" \".User::find(auth::id())->display_name.\" declined \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment - \".$request->comment.\"\";\n\n //send notification to users\n //auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n $toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n $tosupervisor->notify(new LeaveNotification($leave,$message_suppervisor));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n }else{\n\n return response()->json(['result'=>'0','message'=> \"You are not authorized\"]);\n\n }\n\n\n\n\n\n }",
"public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}",
"public function reject($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'rejected'\n ]);\n }",
"function rejectServRequest(){\n $serv_ID=$this->uri->segment(3);\n echo $this->router->fetch_method();\n if ($this->deliveryAndPickupModel->rejectRequest($serv_ID)) {\n echo \"<script>alert('Successfully rejected');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n else\n {\n echo \"<script>alert('Something when wrong');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n\n\t}",
"public function reject()\n {\n $this->channel->basic_reject(\n $this->tag(),\n true\n );\n }",
"public function reject( $id ) {\n\t\treturn ( new TripController() )->destroy( $id );\n\t}",
"public function discard($id) {\n $data = array(\n \"status\" => \"discarded\"\n );\n $this->db->where(\"id\", $id);\n $this->db->update(\"violations\", $data);\n }",
"public function testRejectEmptyIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}",
"public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\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 }",
"public function getRejected();",
"public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }",
"public function testApproveInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}",
"public function reject($id)\n {\n //Mengambil session admin\n $id_user = $this->session->userdata('id_user');\n\n //Melakukan update data ticket dengan mengubah status ticket menjadi 0, data ditampung ke dalam array '$data' yang nanti akan diupdate dengan query\n $data = array(\n 'status' => 0,\n 'last_update'=> date(\"Y-m-d H:i:s\")\n );\n\n //Melakukan insert data tracking ticket bahwa ticket di-reject oleh admin, data tracking ke dalam array '$datatracking' yang nanti akan di-insert dengan query\n $datatracking = array(\n 'id_ticket' => $id,\n 'tanggal' => date(\"Y-m-d H:i:s\"),\n 'status' => \"Ticket Rejected\",\n 'deskripsi' => \"\",\n 'id_user' => $id_user\n );\n\n //Query untuk melakukan update data ticket sesuai dengan array '$data' ke tabel ticket\n $this->db->where('id_ticket', $id);\n $this->db->update('ticket', $data);\n\n //Query untuk melakukan insert data tracking ticket sesuai dengan array '$datatracking' ke tabel tracking\n $this->db->insert('tracking', $datatracking);\n }",
"private function rejectOrder($order){\r\n $this->log('Rejecting order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue rechazada por Flow');\r\n $order->update_status('failed');\r\n }",
"public function reject_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t$remark = validateInput($_POST['reason']);\n\t\t\t\tif ($remark != '' && $remark != null) {\n\t\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t\t$condition = array('send_status' => SENT, 'id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t$data = array('send_status' => REJECTED, 'reject_reason' => $remark);\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $data);\n\t\t\t\t\t\tif ($res > 0) {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Success! Invoices rejected', 'type' => 'success'), true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Contact IT', 'type' => 'error'), true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Reject reason is required..', 'type' => 'danger'), true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Something went wrong, contact IT', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}",
"function reject( $booking_ids ){\n\t\treturn $this->set_status(2, $booking_ids);\n\t}",
"public function handleDeclineInvite($iid) {\n\t\tCourseListModel::declineInvite($iid);\n\t\t$this->redirect('this');\n\t}",
"public function rejectR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $reason = $request->Reason;\n DB::select(\"UPDATE riders set Reason = '$reason' , Rider_Status = 'REJECTED' where Rider_ID = ?\",[$id]);\n $data = DB::select(\"SELECT * FROM riders WHERE Rider_Status = 'PENDING'\");\n $message = \"Rider registration rejected.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RegistrationListInterface', compact(\"data\"));\n \n \n }",
"private static function reject($args, $invite, $auth) {\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n hostsite_show_message(lang::get(\"OK, thanks anyway. We've removed your invitation to join this group.\"));\n hostsite_goto_page($args['groups_page_path']);\n return '';\n }",
"public function reject_complaint($id)\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $output['response'] = $this->database->_update_to_table('tbl_reports', array('status' => 2), array('id' => $id));\n $output = html_escape($this->security->xss_clean($output));\n exit(json_encode($output));\n }",
"public function reject($taskid)\n {\n\t\t$task = task::find($taskid);\n\t\t\t\t\t\t\n\t\t$task->completed = 2; // to changes task status as rejected\n\t\t$task->isCommited = 0; // to reset committed flag\n $task->save();\n\t\t\n $users = task::find($taskid)->students->first()->user;\t// to get user details who belongs task\n\t\t\n\t\t$info = [\n\t\t\t'email' => $users->email,\n\t\t\t'name' => $users->name,\n\t\t\t'subject' => 'Task Reject',\n\t\t\t];\n\t\t$data = ['taskName' => $task->name]; // to send name of task in mail view\n\t\t// to sent mail to user whose task is rejected\n\t\tMail::send('mail_template.notifyTaskReject', $data, function ($message) use ($info) {\n\t\t\t$message->to($info['email'], $info['name'])\n\t\t\t->subject($info['subject']);\n\t\t});\n\t\techo \"Task Rejected and Rejection Email has been sent\";\n }"
]
| [
"0.5979962",
"0.59528494",
"0.5618917",
"0.5597563",
"0.55412626",
"0.55216956",
"0.54665726",
"0.5373148",
"0.53549856",
"0.53529334",
"0.53248745",
"0.5283008",
"0.52739906",
"0.5262473",
"0.52505517",
"0.52389973",
"0.5234416",
"0.52220976",
"0.51656705",
"0.5164191",
"0.5159703",
"0.5159101",
"0.5149232",
"0.5136543",
"0.51270103",
"0.5120222",
"0.5105709",
"0.5090954",
"0.50790393",
"0.5078929"
]
| 0.65100855 | 0 |
actionid: rejectbywr2 actiondesc: Rejecting the izin by Vice Rector2 | public function actionRejectByWr2($id){
$model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();
foreach ($model as $m) {
$m->status_by_wr2 = 4;
}
if($m->save()){
\Yii::$app->messenger->addErrorFlash("Permohonan Izin telah di-reject oleh WR 2");
return $this->redirect(['index-by-wr2']);
} else {
return $this->render('viewByWr2', [
'model'=>$model
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reject_dispute(){\n\t\t$disputeId = $this->uri->segment(4);\n\n\t\t$condition = array('id' => $disputeId);\n\n\t\t$data = array('status' =>'Reject');\n\t\t\n\t\t$this->review_model->update_details(DISPUTE,$data,$condition);\n\n\n\t\t$this->setErrorMessage('success','Dispute rejected successfully');\n\t\tredirect('admin/dispute/display_dispute_list');\n\n\t}",
"public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}",
"public function reject()\n {\n $type = $this->input->get('type');\n $id = $this->input->get('id');\n\n $this->model_review->reject($type, $id);\n\n redirect($_SERVER['HTTP_REFERER']);\n }",
"public static function reject(){\n if(ModelBenevole::isOrga($_SESSION['login'], $_GET['IDFestival'])){\n ModelBenevole::reject($_GET['IDBenevole'], $_GET['IDFestival']); //appel au modèle pour gerer la BD\n $controller = 'benevole';\n $view = 'demandesorga';\n $pagetitle = 'Liste des demandes Organisateur';\n require_once (File::build_path(array('view','view.php'))); //\"redirige\" vers la vue\n }else{\n $controller = 'benevole';\n $view = 'error';\n $pagetitle = 'Vous n\\'avez pas les droits ';\n }\n }",
"function rejectServRequest(){\n $serv_ID=$this->uri->segment(3);\n echo $this->router->fetch_method();\n if ($this->deliveryAndPickupModel->rejectRequest($serv_ID)) {\n echo \"<script>alert('Successfully rejected');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n else\n {\n echo \"<script>alert('Something when wrong');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n\n\t}",
"public function reject_opportunity() {\n\t\tif($this->session->userdata('uid')){\n\t\t $user_id = $this->session->userdata('uid');\n\t\t $json = file_get_contents(\"php://input\");\n\t\t $data=json_decode($json);\n\n\t\t $op_id = $data->opportuniy_id;\n\t\t $stage_id = $data->stage_id;\n\t\t $opp_reject = $data->opp_reject;\n\t\t $remarks = $data->remarks;\n\t\t $status=array();\n\n\t\t $get_fromuser = \"\";\n\t\t $is_first_stage = $this->opp_sales->is_first_stage($stage_id);\n\n\t\t if ($is_first_stage == true) {\n\n\t\t \tif($opp_reject[0] == 'Ownership')\n\t\t \t{\n\t\t\t $check_assign= $this->opp_sales->assign_count($op_id);\n\t\t\t if($check_assign==true)\n\t\t\t {\n\t\t\t $status[0]=1;\n\t\t\t }\n\n\t\t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t \t\tif($get_fromuser!=\"\"){\n \t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t\t }\n\t\t \t}\n if($opp_reject[1] == 'Stage_Ownership')\n\t\t \t{\n\n\t\t\t\t\t\t$check_assign_stage= $this->opp_sales->assign_count_stage($op_id);\n\t\t\t\t\t\tif($check_assign_stage==true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$status[1]=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//---------------- notification code----------------------------------\n\t\t\t\t\t\t$get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t\t\t\t\t//to user---- is the one who is to be notified.\n\t\t\t\t\t\t// from user---- is the one who performs action\n\t\t\t\t\t\t$dt = date('ymdHis');\n\t\t\t\t\t\t$notify_id= uniqid($dt);\n\t\t\t\t\t\t$remarks=\"reject of opp from executive module\";\n\t\t\t\t\t\t$getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t\t\t\t\t$getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t\t\t\t\t$data2= array(\n\t\t\t\t\t\t'notificationID' =>$notify_id,\n\t\t\t\t\t\t'notificationShortText'=>'Opportunity Stage Rejected',\n\t\t\t\t\t\t'notificationText' =>'Opportunity Stage Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t\t\t\t\t'from_user'=>$user_id,\n\t\t\t\t\t\t'to_user'=>$get_fromuser,\n\t\t\t\t\t\t'action_details'=>'Opportunity',\n\t\t\t\t\t\t'notificationTimestamp'=>$dt,\n\t\t\t\t\t\t'read_state'=>0,\n\t\t\t\t\t\t'remarks'=>$remarks,\n\t\t\t\t\t\t);\n\t\t \t}\n\n\t\t \tif($get_fromuser!=\"\"){\n $get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t}\n\n\n\t\t }\n\t\t else {\n\t\t \t$check_state= $this->opp_sales->check_state($op_id,$opp_reject);\n\t\t\t if(isset($check_state['Ownership'])){\n\t\t\t $check_assign= $this->opp_sales->assign_count($op_id);\n\t\t\t if($check_assign==true){\n\t\t\t $status[0]=1;\n\t\t\t }\n\n\t\t\t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t \t\tif($get_fromuser!=\"\"){\n \t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t\t }\n\n\t\t\t }\n\t\t\t if(isset($check_state['Stage_Ownership'])){\n\t\t\t\t\t$check_assign_stage= $this->opp_sales->assign_count_stage($op_id);\n\t\t\t\t\tif($check_assign_stage==true){\n\t\t\t $status[1]=1;\n\t\t\t }\n\n\t \t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Stage Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Stage Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t\t\t\tif($get_fromuser!=\"\"){\n\t\t\t\t\t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n\t\t\t\t\t}\n\t\t\t }\n\t\t }\n\n //---------------------------------------------------------end -----------------\n\t\t echo json_encode($status);\n\n\t\t} else {\n\t\t\tredirect('indexController');\n\t\t}\n\t}",
"public function rejectAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n //PROCESS\n $viewer = Engine_Api::_()->user()->getViewer();\n \n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n\n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Reject Page Invitation');\n $form->setDescription('Would you like to reject the invitation for this page?');\n $form->submit->setLabel('Reject Page Invitation');\n \n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\tif (!empty($page_id)) {\n\t\t\n\t\t\t//DELETE THE RESULT FORM THE TABLE.\n\t\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->delete(array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t}\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n $message = Zend_Registry::get('Zend_Translate')->_('You have ignored the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n \n 'parentRefresh' => true,\n ));\n }\n }",
"public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}",
"private function btn_approve_reject(){\n\n // Skip the unduly cases\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] == VISIT_OUT_OF_SCOPE) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t)){\n $this->dbg('not my case? '.($not_my_case ? 'YES' : 'NO'));\n return array('','');\n }\n\n // The event is endorsed (i.e. changes are locked), show only pending applicants and return\n if(0) if (VM::isEventEndorsed() || ($this->rec['v_end'] < time())){\n\tif (False){ // ? Strange... To be changed?\n\t $reply = array('');\n\t if ($this->fnc_beslut) $reply[] = $this->highlights['fnc'][$this->fnc_beslut]['i'];\n\t else $reply[] = '';\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::var_dump('fnc_beslut',$this->fnc_beslut,date('Y-m-d',$this->rec['v_end']),$reply);\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::internalError();\n\t}else{ \n\t $reply = array('','');\n\t}\n\t// $t = $reply; array_unshift($t,2,$this->rec['v_id']); $this->dbg($t,True);\n\treturn $reply;\n }\n\n bTiming()->cpu(__function__);\n\n // \n // See what should we do, depends on the visit status \n //\n $reply = array('','');\n $v_status = bForm_vm_Visit::_getStatus($this->rec,$check_clashes=True);\n switch($v_status){\n \n case STATUS_CLASH:\n break;\n\n case STATUS_NO: \n $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT:\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Ni')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('NY'))\n\t\t : array('',$this->say('Ni')));\n }\n break;\n \n case STATUS_PENDING:\n if (@$this->rec['_a_name'] !== LODGING_OA_TXT) $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT: // auto-accept the rents\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setStatus(STATUS_YES);\n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_status'] = STATUS_YES;\n\tbreak;\n\t\n case VISIT_OUT_OF_SCOPE:\n\tbreak 2;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array($this->say('Y'),\n\t\t\t $this->say('N'))\n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n default:\n\tb_debug::internalError('?? v_type=\"'.$this->rec['v_type'].'\"');\n }\n break;\n \n case STATUS_YES:\n switch ($this->rec['v_type']){\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\n case VISIT_TYPE_RENT:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_policy'] = $this->v->getValue('v_policy',1,1);\n\tbreak;\n\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (!$this->v) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Yi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('YN'))\n\t\t : array('',$this->say('Yi')));\n\tbreak;\n }\n }\n bTiming()->cpu();\n // $t = $reply; array_unshift($t,3,$this->rec['v_id']); $this->dbg($t,True);\n return $reply;\n }",
"public function reject_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t$remark = validateInput($_POST['reason']);\n\t\t\t\tif ($remark != '' && $remark != null) {\n\t\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t\t$condition = array('send_status' => SENT, 'id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t$data = array('send_status' => REJECTED, 'reject_reason' => $remark);\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $data);\n\t\t\t\t\t\tif ($res > 0) {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Success! Invoices rejected', 'type' => 'success'), true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Contact IT', 'type' => 'error'), true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Reject reason is required..', 'type' => 'danger'), true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Something went wrong, contact IT', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}",
"public function do_reject(Request $request, $id){\n\n\n $leave = Leave::find($id);\n\n if(auth::id() == $leave->supervisor_id){\n\n $leave->supervisor_action = 2;\n $leave->current_position = 0;\n $leave->leave_status = 2;\n $leave->leave_message = \"Rejected by Supervisor\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by Supervisor',\n 'position' => 'Supervisor',\n 'sent_to' => 162\n\n ]);\n\n /////////////////////////////////////////////send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find($leave->supervisor_id)->display_name.\". - \".$request->comment.\"\";\n\n $message_suppervisor = \" You have rejected \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment: \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been rejected by \".User::find($leave->supervisor_id)->display_name.\". Comment: \".$request->comment.\"\";\n\n /*$message_hr = \" \".User::find(auth::id())->display_name.\" needs your approval for\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave application.\";*/\n\n //send notification to users\n auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n /*$toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));*/\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n\n // fire leavePublished event after post is successfully added to database\n\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n //end of send email\n\n\n\n\n\n // event(new leavePublished($post));\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n } elseif((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n\n $leave->hr_action = 2;\n $leave->current_position = 4;\n $leave->leave_status = 4;\n $leave->leave_message = \"Rejected by HR\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by HR',\n 'position' => 'HR',\n 'sent_to' => 162\n\n ]);\n\n\n\n //send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n $tosupervisor = User::find($leave->supervisor_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\". (HR). Comment - \".$request->comment.\"\";\n\n $message_suppervisor = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_hr = \" \".User::find(auth::id())->display_name.\" declined \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment - \".$request->comment.\"\";\n\n //send notification to users\n //auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n $toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n $tosupervisor->notify(new LeaveNotification($leave,$message_suppervisor));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n }else{\n\n return response()->json(['result'=>'0','message'=> \"You are not authorized\"]);\n\n }\n\n\n\n\n\n }",
"public function reject()\n {\n return $this->setStatus(self::STATUS_REJECTED);\n }",
"function getReject(){\n //check for the requested invitation available or not\n // $get_invite_id=$this->validateInvitationSecret();\n $invitation=MedicalGroupInvitation::find('all',array('conditions' => array('(user_id=? or email=?) and secret=? and active=1',$this->user_id,$this->email,$this->secret)));\n \n if(!empty($invitation)){\n foreach($invitation as $inv){\n $inv->status=\"REJECTED\";\n $inv->active=0;\n $inv->updated_on=time();\n $inv->save();\n }\n return TRUE;\n }\n else{\n return FALSE;\n }\n }",
"public function rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}",
"public function rejectTerms(){\n $db = DB::prepare('Delete FROM accept_terms WHERE user_id = ?');//Status 1 == accepted\n return $db->execute(array($this->id));\n }",
"public function actionRejectByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 4;\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addErrorFlash(\"Permohonan Izin telah di-reject oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }",
"public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}",
"function rejectBooking($disputeId,$booking_no,$cancel_booking_id)\n\t{\n\t\t\t\n\t\t\t$condition = array('id' => $disputeId,'cancel_status' => $cancel_booking_id);\n\t\t\t$data = array('status' =>'Reject');\n\t\t\t$ok = $this->review_model->update_details(DISPUTE,$data,$condition);\n\t\t\n\t\t\t/* Mail to Guest Start*/\t\n $newsid='58';\n\t\t\t$template_values=$this->review_model->get_newsletter_template_details($newsid);\n\n\t\t\tif($template_values['sender_name']=='' && $template_values['sender_email']==''){\n\t\t\t\t$sender_email=$this->data['siteContactMail'];\n\t\t\t\t$sender_name=$this->data['siteTitle'];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$sender_name=$template_values['sender_name'];\n\t\t\t\t$sender_email=$template_values['sender_email'];\n\t\t\t} \n \t\t\n\t\t$getdisputeDetails = $this->review_model->get_all_details(DISPUTE,$condition);\n\t\t\n\t\t/*GetHostDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->disputer_id\n\t\t);\n\t\t$hostDetails = $this->review_model->get_all_details( USERS, $condition );\n\t\t\n\t\t$uid = $hostDetails->row ()->id;\n\t\t$hostname = $hostDetails->row()->user_name;\n\t\t$host_email = $hostDetails->row()->email;\n\t\t\n\t\t\n\t\t/*GetCustomerDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->user_id\n\t\t);\n\t\t\n\t\t$custDetails = $this->review_model->get_all_details( USERS, $condition );\n\t\t$cust_name = $custDetails->row()->user_name;\n\t\t$email = $custDetails->row()->email;\n\t\t\n\t\t/*GetProductDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->prd_id\n\t\t);\n\t\t$prdDetails = $this->review_model->get_all_details( PRODUCT, $condition );\n\t\t$prd_title = $prdDetails->row()->product_title;\n\t\t\n $email_values = array(\n\t\t\t\t\t'from_mail_id'=>$sender_email,\n\t\t\t\t\t'to_mail_id'=> $email,\n\t\t\t\t\t'subject_message'=>$template_values ['news_subject'],\n\t\t\t\t\t'body_messages'=>$message\n\t\t\t); \n\t\t\t\n\t\t\t$reg= array('host_name' => $hostname,'cust_name'=>$cust_name,'prd_title'=>$prd_title,'logo' => $this->data['logo']);\t\n $message = $this->load->view('newsletter/ToGuestRejectCancelBooking'.$newsid.'.php',$reg,TRUE);\n\t\t\t\n /*send mail*/\n $this->load->library('email',$config);\n $this->email->from($email_values['from_mail_id'], $sender_name);\n $this->email->to($email_values['to_mail_id']);\n $this->email->subject($email_values['subject_message']);\n $this->email->set_mailtype(\"html\");\n $this->email->message($message); \n\t\t\t\t\t\t\n\t\t\t\t try{\n\t\t\t\t\t$this->email->send();\n\t\t\t\t\t$returnStr ['msg'] = 'Successfully registered';\n\t\t\t\t\t\t$returnStr ['success'] = '1';\n\t\t\t\t\t}catch(Exception $e){\n\t\t\t\t\techo $e->getMessage();\n\t\t\t\t\t} \n \n /* Mail to Guest End*/\n\t\t\n\t\t\techo 'success';\n\t\t\t$this->setErrorMessage('success','Cancel booking rejected successfully');\n\t\t\tredirect('admin/dispute/cancel_booking_list');\t\t\t\t\n\t}",
"public function rejectR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $reason = $request->Reason;\n DB::select(\"UPDATE riders set Reason = '$reason' , Rider_Status = 'REJECTED' where Rider_ID = ?\",[$id]);\n $data = DB::select(\"SELECT * FROM riders WHERE Rider_Status = 'PENDING'\");\n $message = \"Rider registration rejected.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RegistrationListInterface', compact(\"data\"));\n \n \n }",
"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 }",
"public function actionUnsubscribe(){\n $perfil = \\app\\models\\PerfilUsuario::find()->where(['fk_usuario'=>Yii::$app->user->id])->one();\n $igualas_user_viejo = \\app\\models\\IgualasUsers::find()->where(['fk_users_cliente'=>$perfil->id, 'estatus'=>'concretado'])->one();\n if ($igualas_user_viejo){\n $plan_viejo = \\app\\models\\Igualas::find()->where(['id'=>$igualas_user_viejo->fk_iguala])->one();\n try {\n $agreement_viejo = paypalSuspendPlanToUser($igualas_user_viejo->subscription_id);\n }catch(\\Exception $e){\n Yii::$app->getSession()->setFlash('danger',$e->getMessage());\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }\n // $igualas_user_viejo->delete();\n if ($agreement_viejo){\n $igualas_user_viejo->estatus = \"cancelado\";\n $igualas_user_viejo->save();\n Yii::$app->session->setFlash('success', 'Usted ha cancelado la subscripción correctamente.');\n }\n else{\n Yii::$app->session->setFlash('error', 'Problemas al cancelar la subscripción');\n }\n }\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }",
"function rejectAction(Request $request) {\n $resource = $this->findOr404($request);\n $arrangementProgramManager = $this->getArrangementProgramManager();\n\n if (!$arrangementProgramManager->isAllowToApprove($resource)) {\n throw $this->createAccessDeniedHttpException();\n }\n $observation = $request->get('observation');\n if (empty($observation)) {\n $this->flashHelper->setFlash('error', 'error_observation');\n } else {\n $resource->setStatus(ArrangementProgram::STATUS_REJECTED);\n $this->addObservation($resource, $observation);\n\n $user = $this->getUser();\n $details = $resource->getDetails();\n $details\n ->setRejectedBy($user)\n ->setRejectedDate(new DateTime());\n\n $this->domainManager->dispatchEvent('pre_rejected', new ResourceEvent($resource));\n\n $this->domainManager->update($resource);\n $this->flashHelper->setFlash('success', 'rejected');\n\n $this->domainManager->dispatchEvent('post_rejected', new ResourceEvent($resource));\n }\n return $this->redirectHandler->redirectTo($resource);\n }",
"function rejectRecord(){ \n\n // No need to read the list of participants when processing those tabs\n if ($this->current_tab_does_not_need_applicants()) return True;\n\n $reply = False;\n $dbg_text = '';\n if (is_object($this->b_tabs)){\n $active_tab_index = $this->b_tabs->active_tab();\n $tabs = array_values($this->tabs_toShow);\n $reply = (strpos($tabs[$active_tab_index],'bList') !== False);\n $dbg_text = 'b_Tabs';\n }\n\n $this->v = Null;\n if (!$reply && empty($this->av)) switch ($this->doing){\n\t\n case '2excel':\n\tif (bForm_vm_Visit::_getStatus($this->rec) != STATUS_YES) return True;\n case 'photos':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO) return True;\n case 'budget':\n case 'myguests':\n case 'budget_byProjects':\n\tbreak;\n\t\n case 'lists':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO){\n\t if (VM_organizer_here && VM::$e->isEventEndorsed()){\n\t $dbg_text = $this->rec['av_firstname'].' '.$this->rec['av_lastname'].' - After the approval do not show the refused applicants to the organizers';\n\t $reply = True;\n\t }\n\t}\n case 'show_mails_exchange':\n\tif (!cnf_dev && $this->rec['v_type'] === VISIT_TYPE_RENT){\n\t $dbg_text = 'VISIT_TYPE_RENT... to be completed';\n\t $reply = True;\n\t}elseif (empty(VM::$e)){\n\t // Visits outside conferences/programs\n\t if (!VM_administrator_here && ($this->rec['v_host_avid'] != @bAuth::$av->ID)){\n\t $dbg_text = 'not my visit';\n\t $reply = True;\n\t }else{\n\t // Guarantee the correct value of status&policy in the snapshot record\n\t if (empty($this->rec['v_status'])){\n\t $this->v = loader::getInstance_new('bForm_vm_Visit',$this->rec['v_id'],'fatal');\n\t $this->rec['v_status'] = $this->v->getStatus();\n\t $this->rec['v_policy'] = $this->v->getValue('v_policy',True);\n\t }\n\t }\n\t}\n }\n if ($reply) $this->dbg($dbg_text);\n return $reply;\n }",
"public function testRejectDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}",
"public function reject() {\n }",
"public function actionRejectByAtasan($id, $redback=null){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-reject oleh Atasan\");\n if(is_null($redback))\n return $this->redirect(['index-by-atasan']);\n else\n return $this->redirect(Yii::$app->request->referrer);\n } else {\n return $this->render('viewByAtasan', [\n 'model'=>$model\n ]);\n }\n }",
"public function reject($id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n return view('ManageAccount.RejectRegistrationInterface', compact(\"data\"));\n }",
"public function actionToreject()\n {\n $reject = new ClientReject;\n if ($reject->load(Yii::$app->request->post())) {\n $client = $this->findModel($reject->client_id);\n if (!\\Yii::$app->user->can('updateClient', ['client' => $client])) {\n throw new ForbiddenHttpException('Нет разрешения на редактирование клиента\"' . $client->name . '\"');\n }\n $client->status = Client::STATUS_REJECT;\n\n $valid = $client->validate();\n $valid = $reject->validate() && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if (! ($flag = $client->save(false))) {\n $transaction->rollBack();\n }\n if (! ($flag = $reject->save(false))) {\n $transaction->rollBack();\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['client/reject']);\n }\n } catch (Exception $e) {\n $transaction->rolBack();\n }\n }\n }\n }",
"public static function reject() {\n return new Reject('Not match Organic Subset');\n }",
"private function rejectOrder($order){\r\n $this->log('Rejecting order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue rechazada por Flow');\r\n $order->update_status('failed');\r\n }"
]
| [
"0.63430685",
"0.6341274",
"0.6259934",
"0.61988956",
"0.60780966",
"0.6043334",
"0.6038304",
"0.60374784",
"0.5955958",
"0.5937332",
"0.58797896",
"0.58552337",
"0.58208334",
"0.5779325",
"0.5773487",
"0.5765985",
"0.57568806",
"0.57109153",
"0.562517",
"0.5623991",
"0.56186354",
"0.5594198",
"0.55579174",
"0.5557587",
"0.55371916",
"0.55205345",
"0.54716325",
"0.5469018",
"0.5464254",
"0.5464052"
]
| 0.6686062 | 0 |
Gets person by nickname | public function getPersonByNick(string $nick): ?Person; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function people_findByUsername ($username) {\n $response = $this->execute(array('method' => 'flickr.people.findByUsername', 'username' => $username));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}",
"public function getFindPerson()\n\t{\n\t\t$this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_FINDPERSON);\n\t\treturn $this->_result;\n\t}",
"public function getPerson($nik){\n\t\t$data = $this->halo_model->getPerson($nik);\n\t\t\n\t\techo json_encode($data->result());\n\t}",
"protected function getUserFromAccessToken()\n {\n try {\n return $this->api('GET', '/v1/people/~:(id,firstName,lastName,headline)');\n } catch (LinkedInApiException $e) {\n return;\n }\n }",
"function people_getInfo ($user_id) {\n $response = $this->execute(array('method' => 'flickr.people.getInfo', 'user_id' => $user_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}",
"function ret_nick($nickID) {\n $conn = accessdb();\n $nickname = $conn->prepare('SELECT userid, nickname FROM user WHERE userid = ?'); //Prepare SQL statement to find the Author's nickname from the userid on the post\n $nickname->execute([$nickID]); //Execute the SQL statement\n $nickResult = $nickname->fetch(PDO::FETCH_ASSOC); //Put the statement into an associative array\n $retval = $nickResult['nickname'];\n $conn=null;\n return $retval;\n}",
"public function getNicknameByID($userID){\n $userDAO = new UserDAO();\n return $userDAO->getNicknameByIDFromDB($userID);\n }",
"function findByusername($n){\r\n \r\n $db = new Database();\r\n \r\n \r\n \r\n \r\n \r\n $connection = $db->getConnnection();\r\n \r\n $stmt = $connection->prepare(\"SELECT idUsers, username, email FROM users WHERE username LIKE ?\");\r\n \r\n if(!$stmt) {\r\n echo \"Something wrong in the binding process. \";\r\n exit;\r\n }\r\n \r\n $like_n = \"%\" . $n . \"%\";\r\n \r\n $stmt->bind_param(\"s\", $like_n);\r\n \r\n $stmt->execute();\r\n \r\n \r\n $stmt->store_result();\r\n \r\n $numRows = $stmt->num_rows;\r\n \r\n \r\n \r\n $stmt->bind_result($id, $username, $email);\r\n \r\n $person_array = array();\r\n \r\n while( $stmt->fetch()){\r\n \r\n \r\n \r\n // create a person object\r\n $p = Array($id, $username, $email);\r\n \r\n // pusha that peron onto the array\r\n \r\n array_push($person_array, $p);\r\n }\r\n return $person_array;\r\n }",
"function nickname() {\n if (empty($this->nick_name)) {\n if ($this->page[\"Bio\"] == \"\") $this->openpage (\"Bio\",\"person\");\n if (preg_match(\"/Nickname<\\/h5>\\s*\\n(.*?)\\n<h5>/ms\",$this->page[\"Bio\"],$match)) {\n $nicks = explode(\"<br/>\",$match[1]);\n foreach ($nicks as $nick) {\n $nick = trim($nick);\n if (!empty($nick)) $this->nick_name[] = $nick;\n }\n }\n }\n return $this->nick_name;\n }",
"public function getNickname() //geter leo la informacion\n\n {\n return $this->nickname;\n }",
"static function searchUserByName() : string\n {\n return \"SELECT *\n FROM users\n WHERE LOCATE( :Name , nickname) > 0;\";\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getMe()\n {\n return $this->players[$this->myId];\n }",
"public function findPersonByName($name)\n {\n $pgw = $this->di['personGateway'];\n return $pgw->findByName($name);\n }",
"public function findPerson()\n {\n\n // AITS EnterpriseUser API Source\n if($this->dev) {\n\n $source = 'https://webservices-dev.admin.uillinois.edu/xfunctionalWS/data/' . $this->senderAppID . '/EnterpriseUser/1_1/' . $this->netid . '/' . $this->domain;\n\n } else {\n\n $source = 'https://webservices.admin.uillinois.edu/xfunctionalWS/data/' . $this->senderAppID . '/EnterpriseUser/1_1/' . $this->netid . '/' . $this->domain;\n\n }\n\n // Initialize a curl resource\n $curl = curl_init();\n\n // Set curl options\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_URL, $source);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array());\n\n // JSON Response\n $response = curl_exec($curl);\n\n if(curl_getinfo($curl, CURLINFO_HTTP_CODE) == 200) {\n\n // Cache the response in $this->response\n $this->response = new \\stdClass();\n $this->response->type = 'JSON';\n $this->response->data = $response;\n\n // Set the UIN\n $this->uin = $this->findUIN($response);\n\n } else {\n\n throw new \\Exception($response);\n\n }\n\n }",
"public function findUserName($peerID)\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM dragoni6_penfightdb.playerstable WHERE peerID='$peerID'\");\n\t\t$row = mysql_fetch_object($result);\n\t\treturn $row;\n\t}",
"function fetch_user_by_nick($nick) {\n if(!cache_isset('taxi_!un_'.$nick)) {\n if(cache_isset('taxi_un_'.$nick)) {\n return fetch_user_by_id(cache_get('taxi_un_'.$nick));\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['nick'=>$nick]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$result['id'],$result);\n cache_set('taxi_un_'.$result['nick'],$result['id']);\n } else {\n cache_set('taxi_!un_'.$nick);\n }\n return $result;\n }\n }\n}",
"public function getNickname()\n {\n return $this->_nickname;\n }",
"function get_user_by_username($username) {\n $read_json = file_get_contents(__DIR__ . '/data_users.json');\n $data = json_decode($read_json, JSON_OBJECT_AS_ARRAY);\n\n // iterate over db, if username is found, return user\n foreach ($data as $user){\n if ($user[\"username\"] == $username){\n return $user;\n }\n }\n return false;\n}",
"public function person() {\n $personId = $_REQUEST['id'];\n $person = $this->tmdb->getPerson($personId);\n $imageUrl = $this->tmdb->getImageUrl($person['profile_path'], TMDb::IMAGE_PROFILE, 'w185');\n //$images = $this->tmdb->getPersonImages($personId);\n $credits = $this->tmdb->getPersonCredits($personId);\n $map = array('person' => $person, 'imageUrl' => $imageUrl, 'credits' => $credits);\n $this->reply($map);\n }",
"public function getPerson() {\n return $this->getPersoner()->getSingle();\n }",
"public function getNickname() {\n return $this->nickname;\n }",
"public function getNickname(): string {\n return $this->nickname;\n }",
"protected function person()\n {\n try {\n return Person::findOrFail($this->authorizationServer->getResourceOwnerId());\n } catch (ModelNotFoundException $e) {\n throw new PersonNotFoundException;\n }\n }",
"function getPlayerNick($login, $forcequery = false) {\n\n\t\tif (isset($this->server->players->player_list[$login]) &&\n\t\t $this->server->players->player_list[$login]->nickname != '' && !$forcequery) {\n\t\t\t$rtn = $this->server->players->player_list[$login]->nickname;\n\t\t} else {\n\t\t\t$query = 'SELECT NickName FROM players\n\t\t\t WHERE Login=' . quotedString($login);\n\t\t\t$result = mysql_query($query);\n\t\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t\t$row = mysql_fetch_row($result);\n\t\t\t\t$rtn = $row[0];\n\t\t\t} else {\n\t\t\t\t$rtn = '';\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t}\n\t\treturn $rtn;\n\t}",
"function getUser(Login $login);"
]
| [
"0.6406432",
"0.62485933",
"0.6065081",
"0.6038427",
"0.6017064",
"0.6014015",
"0.5981655",
"0.59593564",
"0.5944888",
"0.59309214",
"0.58845174",
"0.5850759",
"0.5850759",
"0.5850759",
"0.5850759",
"0.5850759",
"0.5842141",
"0.5810166",
"0.5807012",
"0.5785411",
"0.5774685",
"0.5774184",
"0.57730365",
"0.57606906",
"0.5746834",
"0.57430404",
"0.57418036",
"0.57370704",
"0.5707024",
"0.5700909"
]
| 0.72174025 | 0 |
Get directory of cache area | private static function getCacheDir($area)
{
return SolutionConfiguration::$cachesDir . "{$area}/";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_cache_directory() {\n\t\treturn $this->cache_directory;\n\t}",
"public function getCacheDir();",
"public function getCacheFolder()\n {\n\n return dirname(__FILE__) . '/../../store/cache/';\n }",
"protected function get_cache_dir()\n\t{\n\t\treturn $this->cache_dir ?: $this->phpbb_root_path . 'cache/' . $this->get_environment() . '/';\n\t}",
"public function getCachePath()\r\n\t{\r\n\t\t$path = AD.$this->getConfig()->getChildren(\"cache\")->getString(\"path\");\r\n\t\tif(!is_dir($path))\r\n\t\t{\r\n\t\t\tmkdir($path, 0777, true);\r\n\t\t}\r\n\t\treturn $path;\r\n\t}",
"public function getCacheDir(){\r\n return $this->_cache->getDir();\r\n }",
"public static function getCacheDir()\n {\n return self::getRoot() . DIRECTORY_SEPARATOR . 'cache';\n }",
"protected function getCacheDirectory()\n {\n return $this->cache_dir;\n }",
"protected function getCacheDirectory()\n {\n return $this->cache_dir;\n }",
"public function getCacheDirectory() {}",
"private function _dirCache()\n {\n return $this->_config['dir_cache'] . (!empty($this->_config['store_prefix']) ? $this->_config['store_prefix'] . '/' : '');\n }",
"public function getCacheDirectory() {\n\t\treturn $this->cacheDirectory;\n\t}",
"protected function getCacheDirectory()\n {\n return $this->cacheDirectory;\n }",
"public static function getCacheDir()\n {\n return self::getDir('getCacheHome');\n }",
"function get_cache_dir() {\n $cacheDir = 'pug_cache/';\n if (array_key_exists('cacheDir', $this->options)) {\n $cacheDir = $this->options['cacheDir'];\n }\n return $cacheDir;\n }",
"protected function _getCacheDir()\n\t{\n\t\treturn $this->_cacheDir;\n\t}",
"public function getCacheDir()\n {\n $fileSystem = new Filesystem();\n $path = 'var/cache/assets/'.$this->name.'/';\n \n if (!$fileSystem->exists($path)) {\n $fileSystem->mkdir($path);\n }\n \n return $path;\n }",
"function getCacheDirectory()\n {\n global $serendipity;\n if ($this->cache_dir === null) {\n $this->cache_dir = $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE . '/serendipity_event_avatar';\n }\n return $this->cache_dir;\n }",
"public function getCachePath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_CACHE);\r\n\t}",
"public function getCacheDir()\n {\n return __DIR__ . '/../var/cache/' . $this->getEnvironment();\n }",
"public function getCacheDir()\n {\n return $this->rootDir . '/../cache/'.$this->getEnvironment();\n }",
"public function getCachePath()\n {\n return $this->getSettingArray()[\"cache_path\"];\n }",
"public function getCacheDir()\n {\n return $this->cacheDir;\n }",
"public function getCacheDir()\n {\n return $this->cacheDir;\n }",
"public function getCacheDir()\n {\n return $this->cacheDir;\n }",
"public function getCacheDir()\n {\n return $this->cacheDir;\n }",
"public function getCacheDirectoryPath()\n {\n return $this->cacheDirectoryPath;\n }",
"public function getCacheDirectory() {\n \n return $this->cacheDirectory;\n \n }",
"private function _getCachePath() {\n return DIR_PUBLIC_CACHE_SEARCHES . $this->_id . '.json';\n }",
"public static function getCachePath()\n {\n $cacheDir = Config::get('media.cache_dir');\n $cacheFullPath = ROOT . self::getFilesPath() . $cacheDir;\n\n if(!file_exists($cacheFullPath))\n {\n if(!is_writable(ROOT . self::getFilesPath()) || !mkdir($cacheFullPath, Config::get('media.dir_chmod'), true))\n return false;\n }\n\n return $cacheDir;\n }"
]
| [
"0.8108191",
"0.806681",
"0.8035283",
"0.79428685",
"0.78919595",
"0.78735846",
"0.7720608",
"0.7720376",
"0.7720376",
"0.767161",
"0.76457065",
"0.7551495",
"0.75488365",
"0.7507906",
"0.7504676",
"0.7472603",
"0.7455249",
"0.74402016",
"0.74361646",
"0.7435384",
"0.74173576",
"0.7409884",
"0.7392279",
"0.7392279",
"0.7392279",
"0.7392279",
"0.7390397",
"0.73734623",
"0.72815514",
"0.7260705"
]
| 0.82545537 | 0 |
Resolve previous node match. | public function resolveNextNode(NodeContract $node, NodeContract $new_node)
{
// Nothing to resolve...
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function previousNode(): ?Node\n {\n return $this->traverse('previous');\n }",
"public function lookback()\n {\n $token = prev($this->tokens);\n next($this->tokens);\n\n return $token;\n\n }",
"function _reparseAfterCurrentBlock () {\r\n // this should definitely not happen!\r\n if (($stack_count = count ($this->_stack)) < 2) {\r\n return false;\r\n }\r\n $topelem =& $this->_stack[$stack_count-1];\r\n \r\n $node_parent =& $topelem->_parent;\r\n // remove the child from the tree\r\n $res = $node_parent->removeChild ($topelem, false);\r\n if (!$res) {\r\n return false;\r\n }\r\n $res = $this->_popNode ();\r\n if (!$res) {\r\n return false;\r\n }\r\n \r\n // now try to get the position of the object\r\n if ($topelem->occurredAt < 0) {\r\n return false;\r\n }\r\n // HACK: could it be necessary to set a different status\r\n // if yes, how should this be achieved? Another member of\r\n // StringParser_Node?\r\n $this->_setStatus (0);\r\n $res = $this->_appendText ($this->_text{$topelem->occurredAt});\r\n if (!$res) {\r\n return false;\r\n }\r\n \r\n $this->_cpos = $topelem->occurredAt + 1;\r\n $this->_recentlyReparsed = true;\r\n \r\n return true;\r\n }",
"function getPrevNode($data)\n\t{\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft < ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft DESC'));\t\t\n\t}",
"protected function rewindRefactoredNodes()\n {\n $this->refactoredNodes = 0;\n }",
"public function getPrevious()\n {\n $prev = $this;\n $find = false;\n if (!is_null($this->parent)) {\n foreach ($this->parent->content as $c) {\n if ($c === $this) {\n $find=true;\n break;\n }\n if (!$find) {\n $prev = $c;\n }\n }\n }\n return $prev;\n }",
"public function resolve() {\n return $this->evaluate($this->left, $this->right);\n }",
"public function getLastMatch()\n {\n $node = $this->getXml()->getElementsByTagName('LastMatch')->item(0);\n if ($node !== null && $node->hasChildNodes()) {\n $lastmatch = new \\DOMDocument('1.0', 'UTF-8');\n $lastmatch->appendChild($lastmatch->importNode($node, true));\n return new LastMatch($lastmatch, Config\\Config::MATCH_SENIOR);\n }\n return null;\n }",
"function prevArticle() {\n\t\t$parent = $this->parent();\n\t\tif (!$parent) {\n\t\t\treturn false;\n\t\t}\n\t\t$parentChildren = $parent->children();\n\t\t$aCount = sizeof($parentChildren);\n\t\t$foundAtPos=null;\n\t\tfor ($i=0;$i<$aCount;$i++) {\n\t\t\tif ($parentChildren[$i]->getId() == $this->getId()) {\n\t\t\t\t$foundAtPos=($i-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($foundAtPos>=0) {\n\t\t\treturn $parentChildren[$foundAtPos];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function loadPreviousSibling()\n {\n $id = $this->_cache->getBackend()->getPreviousSiblingId($this);\n return $this->setPreviousSiblingId($id);\n }",
"protected function afterFind(){\t\t\n\t\t\n\t\tif(isset($this->history))\n\t\t\t$this->history=json_decode($this->history,true);\n\t\t\n\t\t$this->_oldAttributes = $this->attributes;\n\t\n\t\treturn parent::afterFind();\n\t}",
"public function previousElement();",
"public function completeNode() {\n $this->current = $this->current->parent();\n }",
"protected function resolveDependencies() {\n\t\t$sortedNodes = array();\n\t\twhile (count($this->nodesWithoutIncoming) > 0) {\n\t\t\t$node = array_pop($this->nodesWithoutIncoming);\n\t\t\t$sortedNodes[] = $node;\n\t\t\t$nodeHash = spl_object_hash($node);\n\t\t\tif (isset($this->dependenciesOutgoing[$nodeHash])) {\n\t\t\t\tforeach ($this->dependenciesOutgoing[$nodeHash] as $dependencyHash => $dependencyNode) {\n\t\t\t\t\tunset($this->dependenciesOutgoing[$nodeHash][$dependencyHash]);\n\t\t\t\t\tunset($this->dependenciesIncoming[$dependencyHash][$nodeHash]);\n\n\t\t\t\t\tif (count($this->dependenciesIncoming[$dependencyHash]) === 0) {\n\t\t\t\t\t\t$this->nodesWithoutIncoming[$dependencyHash] = $dependencyNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $sortedNodes;\n\t}",
"public function resolveToSource() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 2) {\r\n\t\t\t$this->status = self::OUTDATED;\r\n\t\t\t$this->from = &$this->target;\r\n\t\t\t$this->to = &$this->source;\r\n\t\t\t$this->direction = 2;\r\n\t\t}\r\n\t}",
"public function firstPreviousMatch(){\n return $this->belongsTo('App\\Match', 'prev_match1_id', 'id');\n }",
"public function getLastMatch()\n {\n return new Xml\\Match\\Chunk($this->getXml('LastMatch'));\n }",
"public function prev()\n {\n $current = $this->current();\n\n if ($current) {\n $this->current = $current->getBefore();\n }\n }",
"public function retrievePrevSibling(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'right'), $node->getLeftValue() - 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }",
"function reset() {\n\t\t$this->recursive = -1;\n\t\t$nodes = array_keys($this->Node->find('list', array(\n\t\t\t'conditions' => array('Node.id >' => 0),\n\t\t\t'order' => 'id',\n\t\t\t'recursive' => -1\n\t\t)));\n\t\tset_time_limit (max(count($nodes) / 10, 30));\n\t\t$this->unbindModel(array('belongsTo' => array('Node')), false);\n\t\t$order = 'Revision.id DESC';\n\t\t$fields = array('id');\n\t\tforeach ($nodes as $id) {\n\t\t\t$langs = $this->find('list', array(\n\t\t\t\t'fields' => array('lang', 'lang'),\n\t\t\t\t'conditions' => array('node_id' => $id)\n\t\t\t));\n\t\t\tforeach ($langs as $lang) {\n\t\t\t\t$conditions = array(\n\t\t\t\t\t'node_id' => $id,\n\t\t\t\t\t'lang' => $lang,\n\t\t\t\t\t'NOT' => array('status' => 'rejected')\n\t\t\t\t);\n\t\t\t\t$count = $this->find('count', compact('conditions'));\n\t\t\t\tif (!$count) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions['Revision.status'] = 'current';\n\t\t\t\tif ($this->find('count', compact('conditions')) === 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions['Revision.status'] = 'previous';\n\t\t\t\t$last = $this->find('first', compact('conditions', 'order', 'fields'));\n\t\t\t\tif (!$last) {\n\t\t\t\t\tunset($conditions['Revision.status']);\n\t\t\t\t\t$last = $this->find('first', compact('conditions', 'order', 'fields'));\n\t\t\t\t}\n\t\t\t\t$this->updateAll(array('status' => '\"current\"'), array('Revision.id' => $last['Revision']['id']));\n\t\t\t\t$conditions['Revision.status'] = 'current';\n\t\t\t\t$conditions['NOT'] = array('Revision.id' => $last['Revision']['id']);\n\t\t\t\t$this->updateAll(array('Revision.status' => '\"previous\"'), $conditions);\n\t\t\t}\n\t\t}\n\t}",
"public function resolveToTarget() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 2) {\r\n\t\t\t$this->status = self::OUTDATED;\r\n\t\t\t$this->from = &$this->source;\r\n\t\t\t$this->to = &$this->target;\r\n\t\t\t$this->direction = 1;\r\n\t\t}\r\n\t}",
"public function getPreviousMatch($team) {\n\t\t// whose time slot was last before the time slot of $this match\n\t\t\n\t\tFB::log('trying to find the previous match of team '.$team->name);\n\t\t$previousTime=0;\n\t\t$previousMatch=false;\n\t\tforeach($team->HomeMatches as $homeMatch) {\n\t\t\tif ($homeMatch->scheduledTime > $previousTime && $homeMatch->scheduledTime < $this->scheduledTime) {\n\t\t\t\t$previousMatch=$homeMatch;\n\t\t\t\t$previousTime=$homeMatch->scheduledTime;\n\t\t\t}\n\t\t} \n\t\tforeach($team->AwayMatches as $awayMatch) {\n\t\t\tif ($awayMatch->scheduledTime > $previousTime && $awayMatch->scheduledTime < $this->scheduledTime) {\n\t\t\t\t$previousMatch=$awayMatch;\n\t\t\t\t$previousTime=$awayMatch->scheduledTime;\n\t\t\t}\n\t\t} \n\t\t\n\t\tFB::log('found match '.$previousMatch->HomeTeam->name.'-'.$previousMatch->AwayTeam->name);\n\t\t\n\t\treturn $previousMatch;\n\t}",
"public function getNodeOriginalRoute();",
"public function findPrevious(File $file, $pattern);",
"public function getPrevSibling();",
"protected function initializeNodeResolver() {}",
"function mREFERENCE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$REFERENCE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:601:3: ( '^^' ) \n // Tokenizer11.g:602:3: '^^' \n {\n $this->matchString(\"^^\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function getNextMatch()\n {\n return new Xml\\Match\\Chunk($this->getXml('NextMatch'));\n }",
"function scrap_page_prev($url)\n {\n $page = curl_get_file($url);\n $regex = '@(?s)<h2.*?Add to Compare@';\n preg_match_all($regex,$page,$match);\n if($match == null)\n echo \"No match found!!\";\n else\n {\n foreach($match[0] as $m)\n scrap($m);\n }\n \n //To find prev url\n $regex = '@<link\\s*rel=\"prev\"\\s*href=\"(.*)?\"@';\n preg_match($regex,$page,$u);\n if($u == null)\n return null;\n else \n return $u[1]; \n }",
"public function getPrevSibling()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rightAttribute).'='.($owner->{$this->leftAttribute}-1));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner->find();\n\t}"
]
| [
"0.5552641",
"0.5229051",
"0.5058993",
"0.5048684",
"0.5048008",
"0.5003722",
"0.4993257",
"0.48843005",
"0.48292768",
"0.48287633",
"0.47988746",
"0.4765076",
"0.4754491",
"0.47362277",
"0.47285512",
"0.4705516",
"0.4705513",
"0.47052988",
"0.47004864",
"0.46934402",
"0.4687768",
"0.46729556",
"0.4668881",
"0.46156907",
"0.45702627",
"0.4568772",
"0.4557643",
"0.45387086",
"0.45254585",
"0.45056733"
]
| 0.5586638 | 0 |
Tests if the configuration is valid If the configuration has a "table_service" key, and that service exists, then the configuration is valid. Otherwise, it checks if the service $requestedName\Table exists. | protected function isValidConfig(array $config, $requestedName, ServiceLocatorInterface $services)
{
if (isset($config['table_service'])) {
return $services->has($config['table_service']);
}
$tableGatewayService = $requestedName . '\Table';
return $services->has($tableGatewayService);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n// return (substr($requestedName, 0, strlen('application.table.')) == 'application.table.') || (substr($requestedName, 0, strlen('quiz.table.')) == 'quiz.table.');\n return (strpos($requestedName, '.model.table.') !== false);\n }",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (0 !== strpos($requestedName, self::SERVICE_PREFIX)) {\n return false;\n }\n $config = $this->getConfig($container);\n\n return $this->hasNamedConfig($requestedName, $config);\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $config = $serviceLocator->get('config');\n\n if(empty($config)){\n return false;\n }\n\n return isset($config[$this->configKey][$requestedName]);\n\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $config = $this->getConfig($serviceLocator);\n if (empty($config)) {\n return false;\n }\n\n if (isset($config[$requestedName])\n && is_array($config[$requestedName])\n && !empty($config[$requestedName])\n ) {\n return true;\n }\n return false;\n }",
"public function valid()\n {\n\n if ($this->container['serviceName'] === null) {\n return false;\n }\n $allowedValues = $this->getServiceNameAllowableValues();\n if (!in_array($this->container['serviceName'], $allowedValues)) {\n return false;\n }\n if ($this->container['minimumStanding'] === null) {\n return false;\n }\n if ($this->container['surchargePerBadStanding'] === null) {\n return false;\n }\n if ($this->container['discountPerGoodStanding'] === null) {\n return false;\n }\n return true;\n }",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (! $container->has('config') || ! array_key_exists(self::class, $container->get('config'))) {\n return false;\n }\n $config = $container->get('config');\n $dependencies = $config['mamaz_db'];\n return is_array($dependencies);\n }",
"public function isTableExists(): bool\n {\n $sql = 'SHOW TABLES LIKE :table_name;';\n $stmt = $this->pdo->prepare($sql);\n $result = $stmt->execute([':table_name' => $this->tableName]);\n if (!$result) {\n $errorInfo = print_r($stmt->errorInfo(), true);\n throw new \\RuntimeException(\"Couldn't check if Log table exists. Query string: `{$stmt->queryString}`, table name: `{$this->tableName}`, error info: `{$errorInfo}`.\");\n }\n\n return 1 === $stmt->rowCount();\n }",
"public function tableExists( $tablename );",
"private function _checkTXNTableExists() {\n $curTable = readSetting( $this->settings['DataFile'], 'txnTable' );\n $txnTable = $this->settings['txnTable'];\n $rVal = false;\n\n // If the Transaction Table is Not the Same as Expected, then Create It\n if ( $curTable != $txnTable ) {\n $sqlStr = $this->_readTXNTableDefinitions();\n if ( $sqlStr ) {\n $rslt = doSQLExecute( $sqlStr );\n }\n\n // Confirm the Table Exists, and Save the TXN Name if Appropriate\n if ( $this->_confirmTXNTables() ) {\n $rVal = saveSetting( $this->settings['DataFile'], 'txnTable', $txnTable );\n writeNote( \"Saved Transaction Table Record: \" . BoolYN($rVal) );\n }\n }\n\n // Return the Boolean Response\n return $rVal;\n }",
"public function has_Table(string $nameTable): bool\n {\n return $this->is_Table($nameTable);\n }",
"public function tableExists(string $tableName): bool;",
"public function isConfigured(): bool\n {\n foreach ($this->dbal->getDatabases() as $db) {\n if (!$db->hasTable($this->config->getTable())) {\n return false;\n }\n }\n\n return true;\n }",
"public function canCreateServiceWithName(ServiceLocatorInterface $services, $name, $requestedName)\n {\n $config = $this->getConfig($services);\n if (empty($config)) {\n return false;\n }\n\n return (\n isset($config[$requestedName])\n && is_array($config[$requestedName])\n );\n }",
"public function tableExists(string $table_name): bool\n {\n if (isset($this->getData()[$table_name])) {\n return true;\n }\n\n return false;\n }",
"function check_requirements()\n\t{\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id FROM services WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t$sql_obj->execute();\n\n\t\tif (!$sql_obj->num_rows())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested service (\". $this->id .\") does not exist - possibly the service has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\t\treturn 1;\n\t}",
"public function serviceExists(string $serviceName): bool;",
"public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (! $container->has('config')) {\n return false;\n }\n\n $config = $container->get('config');\n if (! isset($config['zf-rpc'][$requestedName])) {\n return false;\n }\n\n $config = $config['zf-rpc'][$requestedName];\n\n if (! is_array($config)\n || ! isset($config['callable'])\n ) {\n return false;\n }\n\n return true;\n }",
"abstract public function tableExists($tableName);",
"public function testCheckTableExist() {\n\n\t}",
"public function tableExists($tableName, $schemaName=null){ }",
"public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n if ($serviceLocator instanceof AbstractPluginManager) {\n $serviceLocator = $serviceLocator->getServiceLocator();\n }\n\n $config = $this->getConfig($serviceLocator);\n if (empty($config)) {\n return false;\n }\n\n return (\n isset($config[$requestedName])\n && is_array($config[$requestedName])\n && !empty($config[$requestedName])\n && isset($config[$requestedName]['model'])\n && is_string($config[$requestedName]['model'])\n );\n }",
"abstract public function hasTable($tableName);",
"final public static function tableExists( $chrTable ) {\n\n\t\t$objQuery = DB::prepare(\"SELECT * FROM information_schema.tables WHERE TABLE_NAME = ? AND ? LIKE(CONCAT('%', TABLE_SCHEMA, '%'))\");\n\t\t$objQuery->execute(array($chrTable, Config::get('database:dsn')));\n\t\t$arrResults = $objQuery->fetchAll();\n\t\t\n\t\tif(sizeof($arrResults) > 0){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}",
"public function hasTable($tableName);",
"public function hasTable($tableName);",
"public function checkInstalled() {\n $query = $this->db->query(sprintf('SHOW TABLES LIKE \"%s\"',\n Config::getTableName('requests')));\n $request_table_result = $query->rowCount();\n\n $query = $this->db->query(sprintf('SHOW TABLES LIKE \"%s\"',\n Config::getTableName('users')));\n $user_table_result = $query->rowCount();\n\n if ($request_table_result > 0 || $user_table_result > 0) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasSchemaTable();",
"public function is_Table(string $nameTable): bool\n {\n if ($nameTable == \"\") {\n return false;\n }\n $entity = $this->getschema($nameTable);\n return $entity->getNameTable() != null;\n }",
"public static function checkIfHasTable($table)\n\t {\n\t \t if(is_null($table))\n {\n exit('Table name is required!');\n }\n\t }",
"public static function tableExists() {\n self::init();\n return self::$wpdb->get_var(self::$wpdb->prepare(\"SHOW TABLES LIKE '%s'\", self::$table)) === self::$table;\n }"
]
| [
"0.6184819",
"0.5958592",
"0.57073075",
"0.5621764",
"0.56166565",
"0.5565932",
"0.5527164",
"0.5516012",
"0.550134",
"0.5497208",
"0.54883057",
"0.54792434",
"0.54645735",
"0.5412064",
"0.5406321",
"0.53952837",
"0.53915215",
"0.5386843",
"0.5364325",
"0.53615254",
"0.5347966",
"0.5330332",
"0.53180677",
"0.5301879",
"0.5301879",
"0.5300965",
"0.529384",
"0.5262552",
"0.5248637",
"0.5242165"
]
| 0.67578113 | 0 |
reads the soap serv config file not the listeners config file. Gets the location of the listeners and the list of soap services | function get_listener_config_data() {
$config_file = file_get_contents('config.xml');
$config_xml = new SimpleXMLElement($config_file);
$location = $config_xml->path;
if (empty($location)) {
//try using a default
$location = '/opt/php_listeners';
}
$services = $config_xml->services->service;
return array('location' => $location, 'services' => $services);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IslandoraService() { \n $this->config_data = get_listener_config_data();\n $this->location = $this->config_data['location']; \n $config_file = file_get_contents($this->location . '/config.xml'); \n try{\n $this->config = simplexml_load_string($config_file);\n } catch (Exception $e)\n {\n error_log(\"microservices soap server failed to open the listeners config file\");\n }\n $this->services = $this->config_data['services'];\n $this->log = new Logging();\n $this->log->lfile($this->config->log->file);\n\n }",
"public function getServiceConfig()\n {\n return include __DIR__ . '/config/service.config.php';\n }",
"public function getServicesConfig()\n {\n return $this->servicesConfig;\n }",
"public function getServiceConfig()\n {\n return include __DIR__ . '/src/module.services.php';\n }",
"public function getServicesPath() {\n return __DIR__ . '/../../services.yml';\n }",
"static private function discoverServiceUri() {\n\t\ttry {\n\t\t\t\n\t\t\t$base = \"http://vcddb.konni.com/ws.vcddb.xml\";\n\t\t\t$xml = simplexml_load_file($base);\n\t\t\n\t\t\tif (!$xml) {\n\t\t\t\tthrow new Exception('Could not locate WSDL uri, try again later.');\n\t\t\t}\n\t\t\n\t\t\t$wsdluri = (string)$xml->wsdl;\n\t\t\t$_SESSION['vcddb-wsdl']\t= $wsdluri;\n\t\t\t\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}",
"private static function loadServices() {\n\n Application::$services = array();\n\n $config = Application::getConfig();\n\n if ($handle = opendir($config[\"system\"][\"service-folder\"])) {\n\n /* Das ist der korrekte Weg, ein Verzeichnis zu durchlaufen. */\n while (false !== ($entry = readdir($handle))) {\n if ($entry != \".\" && $entry != \"..\") {\n require $config[\"system\"][\"service-folder\"] . \"/\" . $entry;\n $className = $config[\"system\"][\"namespace\"] . \"\\\\services\\\\\" . basename($entry,\".php\");\n $testClass = new \\ReflectionClass($className);\n if (!$testClass->isAbstract()) {\n Application::$services[basename($entry,\".php\")] = new $className();\n }\n\n }\n }\n closedir($handle);\n }\n }",
"protected function _loadListeners() {\n\t\tforeach (array_keys($this->config('listeners')) as $name) {\n\t\t\t$this->_loadListener($name);\n\t\t}\n\t}",
"function generate_mapservice_conf_file(){\n\t\t$dom;\n\t\tif(!$dom = domxml_open_file($this->default_mapservconf_file)){\n\t\t\techo \"Could not open xml file: \" . $this->default_mapservconf_file;\n\t\t\treturn NULL; \n\t\t}\n\t\t$mapservice = $this->find_mapservice($dom);\n\t\t// map service not found\n\t\tif($mapservice == NULL){\n\t\t\techo \"could not find map-service named: \" . $mapservice_name ;\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\t$children = $mapservice->child_nodes();\n\t\t$n_children = count($children);\n\t\t\n\t\t// loop through to find <map-file>\n\t\t// and <layer-config> element\n\t\tfor($i = 0; $i < $n_children; $i++){\n\t\t\tswitch ($children[$i]->tagname){\n\t\t\t\tcase \"map-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_mapfile);\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"layer-config-file\":\n\t\t\t\t\t$this->change_node_content($dom, $children[$i], $this->output_layerconf);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$dom->dump_file($this->output_mapservconf, false, false);\n\t\treturn $this->output_mapservconf;\n\t}",
"private function config_OSF_WebServices()\n {\n // Get package info\n $installPath = \"{$this->osf_web_services_folder}/{$this->osf_web_services_ns}\";\n $dataPath = \"{$this->data_folder}/osf-web-services/configs\";\n\n // Configure\n $this->span(\"Configuring...\", 'info');\n $this->cp(\"{$installPath}/keys.ini\", \"{$dataPath}/keys.ini\");\n $this->cp(\"{$installPath}/osf.ini\", \"{$dataPath}/osf.ini\");\n $this->rm(\"{$installPath}/keys.ini\");\n $this->rm(\"{$installPath}/osf.ini\");\n // OSF Web Service scripts\n $this->sed(\"public static \\$osf_ini = \\\".*\\\";\", \"public static \\$osf_ini = \\\"{$dataPath}/\\\";\",\n \"{$installPath}/framework/WebService.php\");\n $this->sed(\"public static \\$keys_ini = \\\".*\\\";\", \"public static \\$keys_ini = \\\"{$dataPath}/\\\";\",\n \"{$installPath}/framework/WebService.php\");\n // OSF Web Service credentials\n if(stripos(file_get_contents(\"{$dataPath}/keys.ini\"), \"{$this->application_id} = \") === FALSE)\n {\n $this->append(\"\\n{$this->application_id} = \\\"{$this->api_key}\\\"\",\n \"{$dataPath}/keys.ini\");\n }\n else\n {\n $this->sed(\"{$this->application_id} = .*\", \"\", \"{$dataPath}/keys.ini\");\n $this->append(\"{$this->application_id} = \\\"{$this->api_key}\\\"\",\n \"{$dataPath}/keys.ini\");\n }\n // OSF Web Service paths\n $this->setIni(\"network\", \"wsf_base_url\", \"\\\"http://{$this->osf_web_services_domain}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"network\", \"wsf_base_path\", \"\\\"{$this->osf_web_services_folder}/{$this->osf_web_services_ns}/\\\"\",\n \"{$dataPath}/osf.ini\");\n // OSF Tools paths\n $this->setIni(\"datasets\", \"wsf_graph\", \"\\\"http://{$this->osf_web_services_domain}/wsf/\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"datasets\", \"dtd_base\", \"\\\"http://{$this->osf_web_services_domain}/ws/dtd/\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"ontologies\", \"ontologies_files_folder\", \"\\\"{$this->data_folder}/ontologies/files/\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"ontologies\", \"ontological_structure_folder\", \"\\\"{$this->data_folder}/ontologies/structure/\\\"\",\n \"{$dataPath}/osf.ini\");\n // SPARQL dependency\n $this->setIni(\"triplestore\", \"channel\", \"\\\"{$this->sparql_channel}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"dsn\", \"\\\"{$this->sparql_dsn}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"host\", \"\\\"{$this->sparql_host}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"port\", \"\\\"{$this->sparql_port}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"sparql\", \"\\\"{$this->sparql_url}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"sparql-graph\", \"\\\"{$this->sparql_graph_url}\\\"\",\n \"{$dataPath}/osf.ini\");\n if ($this->sparql_channel == 'http') {\n $this->setIni(\"triplestore\", \"sparql-insert\", \"\\\"insert\\\"\",\n \"{$dataPath}/osf.ini\");\n }\n $this->setIni(\"triplestore\", \"username\", \"\\\"{$this->sparql_username}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"triplestore\", \"password\", \"\\\"{$this->sparql_password}\\\"\",\n \"{$dataPath}/osf.ini\");\n // Keycache dependency\n $this->setIni(\"memcached\", \"memcached_enabled\", \"\\\"{$this->keycache_enabled}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"memcached\", \"memcached_host\", \"\\\"{$this->keycache_host}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"memcached\", \"memcached_port\", \"\\\"{$this->keycache_port}\\\"\",\n \"{$dataPath}/osf.ini\");\n // Solr dependency\n $this->setIni(\"solr\", \"solr_host\", \"\\\"{$this->solr_host}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"solr\", \"solr_port\", \"\\\"{$this->solr_port}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"solr\", \"solr_core\", \"\\\"{$this->solr_core}\\\"\",\n \"{$dataPath}/osf.ini\");\n $this->setIni(\"solr\", \"fields_index_folder\", \"\\\"{$this->data_folder}/osf-web-services/tmp/\\\"\",\n \"{$dataPath}/osf.ini\");\n // OWL dependency\n $this->setIni(\"scones\", \"endpoint\", \"\\\"http://{$this->scones_host}:{$this->scones_port}/{$this->scones_url}/\\\"\",\n \"{$dataPath}/osf.ini\");\n // Other\n $this->setIni(\"geo\", \"geoenabled\", \"\\\"true\\\"\",\n \"{$dataPath}/osf.ini\");\n }",
"private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}",
"protected function loadConfiguration($checkServices){\n $testnet =\n FALSE === Registry::useStorage('CFG')->get('CryptoKit/testnet', FALSE)\n ? ''\n : '-testnet';\n $servicesCfgKey = 'CryptoKit/RPC/services';\n // Use services-testnet key if testnet flag is set to true and key exists\n if($testnet && Registry::useStorage('CFG')->exists($servicesCfgKey . $testnet)){\n $servicesCfgKey .= $testnet;\n }\n $aConfigs = Registry::useStorage('CFG')->get($servicesCfgKey, FALSE);\n if(is_array($aConfigs)){\n $needToSearchConfig = true;\n $oCache = Cache::get('rpc-service' . $testnet);\n if($oCache->exists() && !$oCache->clearIfOlderThan(self::CHECK_INTERVAL)){\n $aConfig = $oCache->load();\n if($checkServices){\n // Check if service is working\n if(BlockchainIO::getInstance()->checkServerConfig($aConfig)){\n $needToSearchConfig = false;\n }else{\n $oCache->clear();\n }\n }\n }\n if($needToSearchConfig){\n // Get working config\n foreach($aConfigs as $aConfig){\n foreach($aConfig as $daemon => $aDaemonConfig){\n $address = isset($aDaemonConfig['address']) ? $aDaemonConfig['address'] : FALSE;\n if(strpos($address, 'http') !== 0){\n $address = self::DEFAULT_PROTOCOL . '://' . $address;\n }\n $aDaemonConfig['address'] = $address;\n if(!isset($aDaemonConfig['driver'])){\n $aDaemonConfig['driver'] = 'json';\n }\n $aConfig[$daemon] = $aDaemonConfig;\n }\n if($checkServices){\n // Check if service is working\n if(BlockchainIO::getInstance()->checkServerConfig($aConfig)){\n $oCache->save($aConfig);\n break;\n }\n }else{\n break;\n }\n }\n }\n }\n if(!is_array($aConfig)){\n throw new \\Exception('Blockchain RPC configuration missing');\n }\n self::$aConfig = $aConfig;\n }",
"private function loadHookConfig() {\r\n if (!is_readable(self::CONFIG_FILE)) {\r\n throw new \\Slackbot\\Exception\\ConfigException('Missing config file ' . self::CONFIG_FILE);\r\n }\r\n \r\n $config = parse_ini_file(self::CONFIG_FILE, true);\r\n\t\tforeach ($config as $sectionName => $settings) {\r\n\t\t\tif (isset($settings['token'])) {\r\n\t\t\t\tforeach ($this->hooks as $hookName => $hook) {\r\n\t\t\t\t\tif ($hookName === $sectionName) {\r\n\t\t\t\t\t\t$hook->addTokens((array)$settings['token']);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}",
"private function readXML() {\n $xmlFile = __DIR__ .\"\\configuracion.xml\";\n if (file_exists($xmlFile)) {\n $xml = simplexml_load_file($xmlFile);\n } else {\n exit('Fallo al abrier el archivo configuraciones.xml');\n }\n $this->host = $xml->mysql[0]->host;\n $this->database = $xml->mysql[0]->database;\n $this->user = $xml->mysql[0]->user;\n $this->password = $xml->mysql[0]->password;\n }",
"public function getServiceOptions($name)\n\t{\n\t\tif(!isset($this->_options['services']) || !$this->_options['services'] instanceof Config)\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t$path = explode('.', $name);\n\n\t\t$whereTo = $this->_options['services'];\n\t\tforeach($path as $item)\n\t\t{\n\t\t\tif(!isset($whereTo->{$item}))\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t\t$whereTo = $whereTo->__get($item);\n\t\t\tif(!$whereTo instanceof Config)\n\t\t\t{\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}\n\t\treturn $whereTo->toArray();\n\t}",
"private function load_services() {\n\t\tforeach ( $this->get_services() as $service_classname ) {\n\t\t\t$this->load_service( $service_classname );\n\t\t}\n\t}",
"private function readLogConfig(){\n\n\t\t$_config = ConfigUtil::getInstance();\n\n\t\t$this->_log_enabled = $_config->isLogEnabled();\n\t\t$this->_log_level = $_config->getLogLevel();\n\t\t$this->_log_file_path = $_config->getLogFilePath();\n\t\n\t}",
"protected function getConfig(ServiceLocatorInterface $services)\n {\n if ($this->config !== null) {\n return $this->config;\n }\n\n if (!$services->has('Config')) {\n $this->config = array();\n return $this->config;\n }\n\n $config = $services->get('Config');\n if (!isset($config['http'])\n || !is_array($config['http'])\n ) {\n $this->config = array();\n return $this->config;\n }\n\n $config = $config['http'];\n if (!isset($config['clients'])\n || !is_array($config['clients'])\n ) {\n $this->config = array();\n return $this->config;\n }\n\n $this->config = $config['clients'];\n return $this->config;\n }",
"function service_information() {\r\n\t\t$return_value = '<service name=\"' . $this->basename . '\">'\r\n\t\t. '<port name=\"' . $this->basename . 'Port\" binding=\"tns:' . $this->basename . 'Binding\">'\r\n\t\t. '<soap:address location=\"' . $this->api_url . '\"/>'\r\n\t\t. '</port>'\r\n\t\t. '</service>';\r\n\r\n\t\treturn $return_value;\r\n\t}",
"private function parseConfig(){\n\t\t\treturn parse_ini_file(BASE_PATH . 'config' . DIRECTORY_SEPARATOR . 'config.ini');\n\t\t}",
"function readConfigXML($fileName) {\n\n $this->currentFile = $fileName;\n $this->_getFileXML($fileName);\n $this->_parseXML();\n }",
"public function readConfigFiles()\n {\n $sugar_config = array();\n if (is_readable('config.php')) {\n include 'config.php';\n }\n $oldConfig = $sugar_config;\n if (is_readable('config_override.php')) {\n include 'config_override.php';\n }\n return array($oldConfig, deepArrayDiff($sugar_config, $oldConfig));\n }",
"public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }",
"protected function getConfig(ServiceLocatorInterface $services) {\r\n\t\tif (null !== $this->config) {\r\n\t\t\treturn $this->config;\r\n\t\t}\r\n\t\t\r\n\t\tif (! $services->has ( 'Config' )) {\r\n\t\t\t$this->config = array ();\r\n\t\t\treturn $this->config;\r\n\t\t}\r\n\t\t\r\n\t\t$config = $services->get ( 'Config' );\r\n\t\tif (! isset ( $config [$this->configKey] ) || ! is_array ( $config [$this->configKey] )) {\r\n\t\t\t$this->config = array ();\r\n\t\t\treturn $this->config;\r\n\t\t}\r\n\t\t\r\n\t\t$config = $config [$this->configKey];\r\n\t\t$config = array_flip ( $config );\r\n\t\t\r\n\t\t$this->config = array_change_key_case ( $config );\r\n\t\t\r\n\t\treturn $this->config;\r\n\t}",
"public static function getAll($s_file = self::_DEFAULT){\n\t\treturn self::$a_config[$s_file];\n\t}",
"public function getListenersConfig()\n {\n return $this->listenersConfig;\n }",
"public function read(){\n\t\n\t\tif (!$this->cfg_loaded){\n\t\t\t$this->load();\n\t\t}\n\t\t\n\t\tif ($this->cfg_loaded){\n\t\t\t\n\t\t\t$this->getLogger()->debug(\"Starting reading XML configuration\");\n\t\t\t$config = $this->cfg->getElementsByTagName(\"configuration\");\n\t\t\t\t\n\t\t\tif ($config->length == 1){\n\t\t\t\n\t\t\t\t// first read debug configuration\n\t\t\t\t$this->cfg_debug->read_debug($config->item(0)->getElementsByTagName(\"debug\")->item(0));\n\t\t\t\t\n\t\t\t\t// $this->read_sensors($config->item(0));\n\t\t\t\t$this->cfg_sensors->read_sensors($config->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_actions->read_actions($config->item(0)->getElementsByTagName(\"actions\")->item(0));\n\t\t\t\t$this->cfg_gpio->read_gpios($config->item(0)->getElementsByTagName(\"gpios\")->item(0));\n\t\t\t\t$this->cfg_stats->read_stats($config->item(0)->getElementsByTagName(\"statistics\")->item(0));\n\t\t\t\t\n\t\t\t\t$this->cfg_modes->read_modes($config->item(0)->getElementsByTagName(\"modes\")->item(0));\n\t\t\t\t$this->cfg_progs->read_programs($config->item(0)->getElementsByTagName(\"programs\")->item(0));\n\t\t\t} else {\n\t\t\t\t$this->getLogger()->error(\"section <configuration> not found. Can't read configuration.\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function getConfigFilePath();",
"private function readConfig(){\n\n\t\t$this->_ini_array = parse_ini_file(CONFIG.'system.ini');\n\n\t\t$this->_host =\t$this->_ini_array['db_host'];\n\t\t$this->_username = $this->_ini_array['db_username'];\n\t\t$this->_password = $this->_ini_array['db_password'];\n\t\t$this->_database = $this->_ini_array['db_database'];\n\t\n\t\t$this->_log_enabled=$this->_ini_array['log_enabled'];\n\t\t$this->_log_level=$this->_ini_array['log_level'];\n\t\t$this->_log_file_path=$this->_ini_array['log_path'];\n\t\n\n\t\t$this->_lang_default=$this->_ini_array['lang_default'];\n\n\t}"
]
| [
"0.5992297",
"0.5894316",
"0.55849224",
"0.5482306",
"0.54278105",
"0.5367679",
"0.53556347",
"0.53456813",
"0.5342722",
"0.52539426",
"0.52282053",
"0.51649445",
"0.5138613",
"0.5136318",
"0.5130687",
"0.50979155",
"0.5081746",
"0.5053858",
"0.5051795",
"0.5029088",
"0.502283",
"0.5020237",
"0.5013012",
"0.5003055",
"0.4984117",
"0.49727497",
"0.49666718",
"0.49544823",
"0.49279067",
"0.49149793"
]
| 0.726986 | 0 |
Sets up the connection to the fedora repository | function connect() {
$fedora_user = new stdClass();
$fedora_user->name = $this->config->fedora->username;
$fedora_user->pass = $this->config->fedora->password;
$this->fedora_connect = new FedoraConnection($fedora_user, $this->config->fedora->protocol . '://' . $this->config->fedora->host . ':' . $this->config->fedora->port . '/fedora');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUp() {\n\n $connection = new \\Redis();\n $connection->connect('127.0.0.1', 6379);\n $connection->select(11);\n $adapter = new Rstore\\ConnectionAdapter\\Phpredis($connection);\n\n $this->connection = $connection;\n $this->repo = new Repository(\n $adapter,\n yaml_parse_file(__DIR__.'/../../config/models.yaml')\n );\n }",
"protected function connect()\n {\n $url = $this->createUrl(\"\");\n // create curl resource\n $this->connection = curl_init();\n\n // set url\n curl_setopt($this->connection, CURLOPT_URL, $url);\n\n //return the transfer as a string\n curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, 1);\n\n }",
"private function init()\n {\n // connessione al mysql server\n if (!$this->link = mysql_connect( $this->hostname\n , $this->user_name\n , $this->user_pswd))\n {\n $this->set_error( 'Could not connect to mysql' );\n return;\n }\n\n // seleziona il database\n if (!mysql_select_db($this->user_db, $this->link))\n {\n $this->set_error( 'Could not select database' );\n return;\n }\n }",
"protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }",
"private function connect() {\r\n\t\tunset($this->dbLink);\r\n\t\t/* create connection to database host */\r\n\t\t// $dbLink = mysql_connect(\"mysql.localhost\", \"de88623\", \"proberaum1\");\r\n\t\t$dbLink = mysql_connect(\"localhost\", \"robert\", \"YMbHFY+On2\");\r\n\t\t/* select database */\r\n\t\tmysql_select_db(\"robert_www_parkdrei_de\");\r\n\t\t/* set link to database as a object attribute */\r\n\t\t$this->dbLink = $dbLink;\r\n\t}",
"protected function connect() {\n if (!$this->solr) {\n $this->solr = new Client();\n\n // The parent method is overridden so that this alternate adapter class\n // can be set. This line is the only difference from the parent method.\n $this->solr->setAdapter('Drupal\\search_api_pantheon\\Solarium\\PantheonCurl');\n\n $this->solr->createEndpoint($this->configuration + ['key' => 'core'], TRUE);\n $this->attachServerEndpoint();\n }\n }",
"private function openConnection(){\n if($_SERVER[\"DOCUMENT_ROOT\"]==\"\")\n require \"../utility/connection.php\";\n else\n require $_SERVER[\"DOCUMENT_ROOT\"] . \"/mythos_pr/src/utility/connection.php\";\n\n $this->connessione=$connessione;\n\t\t}",
"private function connect()\n {\n try {\n self::$connection = new PDO($this->buildDSN(), $this->user, $this->pass, $this->options);\n } catch (PDOException $e) {\n die('Connection failed: ' . $e->getMessage());\n }\n\n }",
"public function install_OSF()\n {\n $this->span(\"You are about to install the Open Semantic Framework.\");\n $this->span(\"This installation process installs all the software components that are part of the OSF stack. It will take 10 minutes of your time, but the process will go on for a few hours because of the many pieces of software that get compiled.\\n\");\n $this->span(\"The log of this installation is available here: \".$this->log_file);\n $this->span(\"\\n\\nCopyright 2008-15. Structured Dynamics LLC. All rights reserved.\\n\\n\");\n\n $this->h1(\"General Settings Initialization\");\n $this->prepareDistro();\n\n // Dependency chain:\n // PHP stack for OSF\n $this->installApache();\n $this->installPHP();\n // Java stack for Solr, Owl and Scones\n $this->installJava();\n $this->installTomcat();\n // Backends\n $this->installVirtuoso();\n $this->installSolr();\n $this->installMemcached();\n\n // Generate some OSF API key is none has been defined by the user\n if(empty($this->api_key) || $this->api_key == \"some-key\") \n {\n $this->span(\"Generating a OSF API Key...\", 'info');\n $this->api_key = strtoupper(bin2hex(openssl_random_pseudo_bytes(16)));\n $this->span(\"The generated API Key is {$this->api_key}\", 'notice');\n }\n\n // OSF Tools, Components and Web Service\n $this->switch_OSF_PermissionsManagementTool('install');\n $this->switch_OSF_DatasetsManagementTool('install');\n $this->switch_OSF_OntologiesManagementTool('install');\n $this->switch_OSF_DataValidatorTool('install');\n $this->switch_OSF_TestsSuites('install');\n $this->switch_OSF_WSPHPAPI('install');\n $this->switch_OSF_WebServices('install');\n\n $this->install_OSF_vhost();\n $this->setupSolr();\n $this->installARC2();\n $this->installOWLAPI();\n $this->setupVirtuoso();\n $this->load_OSF_OntologiesManagementTool();\n\n $this->installPHPUnit();\n $this->runOSFTestsSuites($this->osf_web_services_folder);\n\n $this->span(\"Now that the OSF instance is installed, you can install OSF for Drupal on the same server using this command:\\n\\n\", 'notice');\n $this->span(\" ./osf-installer -d --install-osf-drupal\\n\\n\", 'notice');\n }",
"public function _Connect() {\t\t\n\t\tif($this->_connection) { $this->_Disconnect(); } \n\t\ttry {\t\t\t\n\t\t\t// GET CONFIGURATION\n\t\t\t$config = $this->_config;\n\t\t\tif(!$config) $this->_RenderError(XUXO_ERROR_CODE_004.': CONFIG IS NOT SET');\n\t\t\tif(!$config['USE']) return NULL;\t\t\t\n\t\t\t// GET PATH\n\t\t\tif ($a = Xuxo_Application::$_instance) {\n\t\t\t\t$path = $a->_GetBaseUrl(true).DIR_SEPARATOR.$config['HOST'];\n\t\t\t} else {\n\t\t\t\t$path = str_replace('\\\\',DIR_SEPARATOR,realpath(dirname(__FILE__))).$config['HOST'];\n\t\t\t}\n\t\t\t// CREATE PATH IF NOT EXISTED\n\t\t\tif(!file_exists($path)) { mkdir($path,0777); }\n\t\t\t// SET PERMISSION\n\t\t\t$this->_SetPermission($path);\n\t\t\t// GET SQLITE FILE\n\t\t\t$path .= DIR_SEPARATOR.$config['NAME'].\".sqlite\";\n\t\t\tif(!file_exists($path)) $this->_RenderError('SQLITE FILE DOES NOT EXIST','XUXO_ERROR_CODE_005');\n\t\t\t// CONNECTION\n\t\t\t$conndb = \"sqlite:\".$path;\t\t\t\n\t\t\t$this->_connection = new PDO($conndb);\n\t\t\tunset($conndb);\n\t\t\t// RETURN\n\t\t\tif (!$this->_connection) $this->_RenderError('FAIL TO CONNECT', 'XUXO_ERROR_CODE_004');\n\t\t\tif(!$this->_auto_commit && !$this->_begin) {\n\t\t\t\t$this->_connection->beginTransaction();\n\t\t\t\t$this->_begin = true;\n\t\t\t}\n\t\t\treturn $this->_connection;\n\t\t} catch (Exception $e) {\n\t\t\t$this->_RenderError('UNABLE TO CONNECT - '.$e->getMessage(), 'XUXO_ERROR_CODE_004');\n\t\t}\n\t}",
"private function connect()\n {\n if ($this->configuration->get('db.connector') == 'PDO') {\n $dsn = \"mysql:host=\" . $this->configuration->get('db.host') . \";dbname=\" . $this->configuration->get('db.name');\n $options = array();\n $this->db = new PDO(\n $dsn, $this->configuration->get('db.username'), $this->configuration->get('db.password'), $options\n );\n } elseif ($this->configuration->get('db.connector') == 'mysqli') {\n $this->db = mysqli_connect(\n $this->configuration->get('db.host'), $this->configuration->get('db.username'), $this->configuration->get('db.password'), $this->configuration->get('db.name')\n );\n }\n }",
"private function connect()\n\t{\n\t\t$connectionData = $this->app->file->requireFile('config.php');\n\t\t\n\t\textract($connectionData);\n\t\t\n\t\ttry\n\t\t{\n\t\t\tstatic::$connection = new PDO('mysql:host=' . $server . ';dbname=' . $dbname, $dbuser, $dbpass);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n\t\t\t\n\t\t\tstatic::$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t\n\t\t\tstatic::$connection->exec('SET NAMES utf8');\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t{\n\t\t\tdie($e->getMessage());\n\t\t}\t\t\t\t\n\t}",
"public function __construct() {\n\t\t$this->host = sfConfig::get('mod_main_host');\n\t\t$this->port = sfConfig::get('mod_main_port');\n\t\t$this->user = sfConfig::get('mod_main_user');\n\t\t$this->pass = sfConfig::get('mod_main_pass');\n\t\t$this->database = sfConfig::get('mod_main_database');\t\t\n\t\t$this->link = mysql_connect($this->host . ':' . $this->port, $this->user, $this->pass);\n\t \n\t\tif(!$this->link)\n\t\t\tthrow new CustomUOMySQLException('Connexion impossible a la BDD : ' . mysql_error($this->link));\n\t\t \n\t\t$base = mysql_select_db($this->database, $this->link);\t \n\t\tif (!$base)\n\t\t\tthrow new CustomUOMySQLException(mysql_error($this->link));\n\t}",
"private function initShopConnection()\n\t{\n\t\t$this->ftpConnection = new FtpConnector($this->shop->ftp_host, $this->shop->ftp_login, $this->shop->ftp_password);\n\t}",
"public function initialize() {\r\n if (!$this->persistent) {\r\n $this->connect();\r\n } else {\r\n $this->pconnect();\r\n }\r\n }",
"public function connect()\r\n\t{\r\n\t\t//$this->link = qracle_connect();\r\n\t}",
"public function setUp()\n {\n $this->config = new Repository();\n }",
"private function connect(): void\n\t{\n\t\t$ldapHandle = @ldap_connect(\n\t\t\t$this->configuration->getServerName(),\n\t\t\t$this->configuration->getServerPort(),\n\t\t);\n\n\t\tif ( false === $ldapHandle )\n\t\t{\n\t\t\t$this->state = LdapConnectorStates::CONNECTION_FAILED;\n\t\t\tthrow new LdapConnectionFailedException(\n\t\t\t\tsprintf(\n\t\t\t\t\tstatic::ERROR_CONNECTION_FAILED,\n\t\t\t\t\t$this->getErrorMessageBuilder()\n\t\t\t\t\t\t ->build( $this->ldapHandle )\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t$this->ldapHandle = $ldapHandle;\n\t\t$this->state = LdapConnectorStates::CONNECTED;\n\n\t\tldap_set_option( $this->ldapHandle, LDAP_OPT_PROTOCOL_VERSION, 3 );\n\t\tldap_set_option( $this->ldapHandle, LDAP_OPT_REFERRALS, 0 );\n\t}",
"public function setup($u, $p, $h, $db)\n\t\t{\t$this->user = $u;\n\t\t\t$this->pass = $p;\n\t\t\t$this->host = $h;\n\t\t\t$this->db = $db;\n\n\t\t\tif (isset($this->link))\n\t\t\t\t$this->disconnect();\n\n\t\t\t$this->connect();\n\t\t}",
"private function __connect() {\n $this->handle = mysql_connect($this->server, $this->user, $this->password) \n or die('<pre style=\"margin:auto;background:rgba(0,0,0,.1)\">'.mysql_error().'</pre>');\n mysql_select_db($this->dataBase, $this->handle) \n or die('<pre style=\"margin:auto;background:rgba(0,0,0,.1)\">'.mysql_error().'</pre>');\n @mysql_query(\"SET NAMES 'utf8'\");\n }",
"public function initRepository(): void;",
"private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}",
"final public function p_connect() {\n \t$this->connect('', '', '', '', true);\n \t}",
"protected function connect() {\n $this->connection = 'resource';\n echo $this->name . ' connected '.\"<br>\" ;\n }",
"function Connect (&$config) {\n\t\t\n\t\t\n\t\t/*\n\t\t * Create the Irssi dsn data.\n\t\t */\n\t\t\n\t\t$dsn = array (\n\t\t 'phptype' => \"mysql\",\n\t\t 'protocol' => \"tcp\",\n\t\t 'username' => $config['username'],\n\t 'password' => $config['password'],\n\t\t 'database' => $config['database'],\n\t 'hostspec' => $config['hostname'] . ':' . $config['port'],\n\t\t);\n\t\t\n\t\t\n\t\t/*\n\t\t * Connect to the database and load the queries.\n\t\t */\n\t\t\n\t\t$this->Handler =& DB::connect($dsn);\n\t\t$this->LoadQueries();\n\t\t\n\t\t\n\t\t/*\n\t\t * Save the configuration for later usage.\n\t\t */\n\t\t\n\t\t$this->core->Config = $config;\n\t}",
"public static function init() {\n\t\t\n\t\t// get various user info\n\t\t$defaultUser = Config::getOption(\"user\");\n\t\t$defaultPass = Config::getOption(\"pass\");\n\t\t$readwriteUser = Config::getOption(\"readwrite.user\");\n\t\t$readwritePass = Config::getOption(\"readwrite.pass\");\n\t\t\n\t\t// set-up the database connection info\n\t\t$name = Config::getOption(\"name\");\n\t\t$host = Config::getOption(\"host\");\n\t\t$user = (!$readwriteUser || empty($readwriteUser)) ? $defaultUser : $readwriteUser;\n\t\t$pass = (!$readwritePass || empty($readwritePass)) ? $defaultPass : $readwritePass;\n\t\t$port = Config::getOption(\"port\");\n\t\tPheasant::setup(\"mysql://\".$user.\":\".$pass.\"@\".$host.\":\".$port.\"/\".$name);\n\t\t\n\t}",
"private function openConnection() {\n $this->db = new PDO(\"mysql:host=127.0.0.1;dbname=mvc\", \"gert\", \"becode\");\n }",
"function __construct()\n\t{\n\t\t// Check repo for any new revisions\n\t\t$this->updateApp();\t\t\n\n\t\t// Create a new amazon connection\t\t\n\t\t$this->amazon();\n\t\t\n\t\t// Configure this server\n\t\t$this->bootstrap();\t\t\n\t}",
"private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }",
"private function __construct()\n {\n $this->connect();\n }"
]
| [
"0.5621009",
"0.5601396",
"0.55837023",
"0.5571824",
"0.5536329",
"0.55357194",
"0.54642504",
"0.5448436",
"0.5414575",
"0.5400865",
"0.53958315",
"0.5370374",
"0.53680515",
"0.53651685",
"0.5350628",
"0.53321904",
"0.53308535",
"0.53219604",
"0.5299964",
"0.52930635",
"0.5287981",
"0.526872",
"0.5245306",
"0.5242449",
"0.52379405",
"0.52378476",
"0.523763",
"0.5234349",
"0.5225577",
"0.5224317"
]
| 0.7714072 | 0 |
Builds and returns the migrator instance to use . | protected function getMigrator(InputInterface $in) {
$migrator = new Migrator();
$migrator->dryRun = $in->getOption('dry-run');
return $migrator;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getMigratorService()\n {\n return $this->services['migrator'] = new \\phpbb\\db\\migrator($this, ${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['dbal.tools']) ? $this->services['dbal.tools'] : $this->getDbal_ToolsService()) && false ?: '_'}, 'phpbb_migrations', './../', 'php', 'phpbb_', ${($_ = isset($this->services['migrator.tool_collection']) ? $this->services['migrator.tool_collection'] : $this->getMigrator_ToolCollectionService()) && false ?: '_'}, ${($_ = isset($this->services['migrator.helper']) ? $this->services['migrator.helper'] : ($this->services['migrator.helper'] = new \\phpbb\\db\\migration\\helper())) && false ?: '_'});\n }",
"protected function buildMigration()\n {\n $columns = [];\n $fk = [];\n $default = [];\n $nullable = [];\n $comment = [];\n\n foreach ($this->columns as $column) {\n $col = $column->column.':'.$column->method;\n\n if ($column->arguments) {\n $col .= ','.$column->arguments;\n }\n\n $columns[] = $col;\n\n if ($column->default) {\n $default[] = $column->column.':'.$column->default;\n }\n\n if ($column->comment) {\n $comment[] = $column->column.':'.$column->comment;\n }\n\n if ($column->is_foreign) {\n $fk[] = $column->column.':'.$column->table_foreign.','.$column->references_foreign;\n }\n\n if ($column->nullable) {\n $nullable[] = $column->column;\n }\n }\n\n $columns = ($columns) ? implode('|', $columns) : '';\n $fk = ($fk) ? implode('|', $fk) : '';\n $default = ($default) ? implode('|', $default) : '';\n $nullable = ($nullable) ? implode('|', $nullable) : '';\n $comment = ($comment) ? implode('|', $comment) : '';\n\n $migration = [\n 'name' => $this->table,\n '--pk' => $this->primaryKey,\n '--module' => $this->module->id,\n ];\n\n foreach (['columns', 'fk', 'default', 'nullable', 'comment'] as $argument) {\n if (! empty($$argument)) {\n $migration['--'.$argument] = $$argument;\n }\n }\n\n $this->migration = $migration;\n }",
"public function getMigrator($model = null)\n {\n return \\atk4\\schema\\Migration::of($model ?: $this->db);\n }",
"protected function createMigration()\n {\n $migrationsOptions = [\n 'migrationName' => 'create_' . Str::plural(strtolower($this->info['modelName'])) . '_table',\n 'module' => $this->info['moduleName'],\n ];\n\n if ($this->optionHasValue('index')) {\n $migrationsOptions['--index'] = $this->option('index');\n }\n\n if ($this->optionHasValue('unique')) {\n $migrationsOptions['--unique'] = $this->option('unique');\n }\n\n if ($this->optionHasValue('data')) {\n $migrationsOptions['--data'] = $this->option('data');\n }\n\n if ($this->optionHasValue('uploads')) {\n $migrationsOptions['--uploads'] = $this->option('uploads');\n }\n\n if ($this->optionHasValue('int')) {\n $migrationsOptions['--int'] = $this->option('int');\n }\n\n if ($this->optionHasValue('bool')) {\n $migrationsOptions['--bool'] = $this->option('bool');\n }\n\n if ($this->optionHasValue('float')) {\n $migrationsOptions['--float'] = $this->option('float');\n }\n if ($this->optionHasValue('table')) {\n $migrationsOptions['--table'] = $this->option('table');\n }\n\n if (isset($this->info['parent'])) {\n $migrationsOptions['--parent'] = $this->info['parent'];\n }\n\n Artisan::call('engez:migration', $migrationsOptions);\n }",
"protected function getMigrations()\n {\n $params = [\n 'connection' => 'test',\n 'source' => 'TestsMigrations',\n ];\n $migrations = new Migrations($params);\n $adapter = $migrations\n ->getManager($this->command->getConfig())\n ->getEnvironment('default')\n ->getAdapter();\n\n while ($adapter instanceof WrapperInterface) {\n $adapter = $adapter->getAdapter();\n }\n\n $adapter->setConnection($this->pdo);\n\n return $migrations;\n }",
"public static function build(): self\n {\n $localChargers = Charger :: with( 'connector_types' ) -> get();\n $localConnectorTypes = ConnectorType :: all();\n \n return (new self) \n -> setLocalChargers ( $localChargers )\n -> setLocalConnectorTypes( $localConnectorTypes );\n }",
"final protected function getMigrationFactory()\n {\n return $this->factory;\n }",
"public function build() {\n\t\t$this->validate_input();\n\n\t\t$tree = $this->sql_tree;\n\n\t\t$pagination_info = $this->make_pagination_info();\n\n\t\tif (!$this->ignore_filtering) {\n\t\t\t$tree = $this->filter_transform->alter($tree, $pagination_info);\n\t\t}\n\t\t$tree = $this->sort_transform->alter($tree, $pagination_info);\n\t\tif (!$this->ignore_pagination) {\n\t\t\tif ($pagination_info instanceof PaginationInfoWithCount) {\n\t\t\t\t$num_rows = $pagination_info->get_row_count();\n\t\t\t}\n\t\t\telseif ($this->settings === null || $this->settings->get_total_rows() === null) {\n\t\t\t\tthrow new Exception(\"SQLBuilder->settings must contain the number of rows in order to paginate properly\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$num_rows = $this->settings->get_total_rows();\n\t\t\t}\n\n\t\t\t$pagination_info_with_count = new PaginationInfoWithCount($pagination_info, $num_rows);\n\t\t\t$tree = $this->pagination_transform->alter($tree, $pagination_info_with_count);\n\t\t}\n\n\t\t$creator = new PHPSQLCreator();\n\t\treturn $creator->create($tree);\n\t}",
"public function __construct(Migrator $migrator)\n {\n parent::__construct();\n\n $this->migrator = $migrator;\n }",
"protected function newBaseQueryBuilder(): QueryBuilderMutator\n {\n $conn = $this->getConnection();\n $grammar = $conn->getQueryGrammar();\n $builder = new QueryBuilderMutator($conn, $grammar, $conn->getPostProcessor());\n if (!isset($this->_service_channel)) {\n throw new Exception(\"Model does not contain service channel\");\n }\n $builder->model=$this->toArray();\n $builder->_service_channel = $this->_service_channel;\n $builder->service_connection = new OutboundStream();\n return $builder;\n }",
"private function migration()\n {\n $location = $this->args['location'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR;\n if (!is_dir($location))\n {\n mkdir($location);\n }\n\n $backtrace = debug_backtrace();\n $calling_function = $backtrace[1]['function'];\n\n if ($calling_function === \"model\")\n {\n $class_name = 'Migration_Add_';\n $filename = 'add_';\n $table_name = '';\n\n if (!empty($this->args['subdirectories']))\n {\n $dirs = explode(DIRECTORY_SEPARATOR, $this->args['subdirectories']);\n $dirs = join('_', $dirs);\n $class_name .= strtolower($dirs) . '_';\n $filename .= strtolower($dirs) . '_';\n $table_name .= strtolower($dirs) . '_';\n }\n $args = array(\n 'class_name' => $class_name . Inflector::pluralize($this->args['name']),\n 'table_name' => $table_name . Inflector::pluralize(strtolower($this->args['name'])),\n 'filename' => $filename . Inflector::pluralize(ApplicationHelpers::underscorify($this->args['name'])) . '.php',\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'migration';\n }\n else\n {\n $args = array(\n 'class_name' => 'Migration_' . $this->args['name'],\n 'table_name' => $this->get_table_name_out_of_migration_name(),\n 'filename' => $this->args['filename'],\n 'application_folder' => $this->args['application_folder'],\n 'parent_class' => $this->args['parent_migration'],\n 'extra' => $this->extra\n );\n\n $template_name = 'empty_migration';\n }\n\n $template = new TemplateScanner($template_name, $args);\n $migration = $template->parse();\n\n $migration_number = MigrationHelpers::get_migration_number($this->args['location']);\n $filename = $location . $migration_number . '_' . $args['filename'];\n $potential_duplicate_migration_filename = MigrationHelpers::decrement_migration_number($migration_number) . '_' . $args['filename'];\n $potential_duplicate_migration = $location . $potential_duplicate_migration_filename;\n\n $message = \"\\t\";\n if (file_exists($potential_duplicate_migration))\n {\n $message .= 'Migration already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $potential_duplicate_migration_filename;\n }\n else if (file_put_contents($filename, $migration) && MigrationHelpers::add_migration_number_to_config_file($this->args['location'], $migration_number))\n {\n $message .= 'Created Migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $args['filename'];\n }\n else\n {\n $message .= 'Unable to create migration: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR . $migration_number . '_' . $this->args['filename'];\n }\n\n fwrite(STDOUT, $message . PHP_EOL);\n\n return;\n }",
"public static function createMigration($generation){\n\n $dir = database_path().\"/migrations/\";\n $dir_entities = app_path().\"/\".$generation['head']['directory'];\n\n if (!file_exists($dir)){\n mkdir($dir, 0777, true);\n }\n \n if ($generation){\n \n $function = new Functions();\n $migration = new Migration();\n $sequence = 10;\n foreach($generation['schema']['class'] as $value){\n \n $nameFile = $value->table[\"name\"];\n \n $fullname = (@$generation['head']['namemodel'] == \"Y\") ? \"Y\" : \"N\";\n $nameClass = $function->getNameClass($nameFile,$fullname);\n \n if (!$function->fileExistsContent($dir, \"_create_\".strtolower($nameFile).\"_table\")){\n \n $str = \"\";\n $str .= \"<?php\\n\\n\";\n $str .= self::getHead();\n $str .= \"use Illuminate\\Database\\Schema\\Blueprint;\\n\";\n $str .= \"use Illuminate\\Database\\Migrations\\Migration;\\n\";\n\n if (str_contains($nameFile, \"_\")){\n $class_name = explode(\"_\",$nameFile);\n $nameClass = $function->getNameClassFirstUpperCase($class_name[0]).$function->getNameClassFirstUpperCase($class_name[1]);\n }\n \n $str .= \"class Create\".$function->getNameClassFirstUpperCase($nameFile).\"Table extends Migration\\n\";\n $str .= \"{\\n\";\n $str .= \"\\n\\n\\n\";\n $str .= \"\\t/**\\n\";\n $str .= \"\\t* Run the migrations.\\n\";\n $str .= \"\\t*\\n\";\n $str .= \"\\t* @return void\\n\";\n $str .= \"\\t*/\\n\";\n $str .= \"\\tpublic function up()\\n\";\n $str .= \"\\t{\\n\";\n \n if (@$generation['head']['addcon'] == \"Y\"){\n $str .= \"\\t\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->create('\".$nameFile.\"', function (Blueprint \\$table) {\\n\";\n } else {\n $str .= \"\\t\\t\\tSchema::create('\".$nameFile.\"', function (Blueprint \\$table) {\\n\";\n }\n $tmField = sizeof($value->table[\"fields\"]);\n if ($tmField > 0){\n \n foreach($value->table[\"fields\"] as $field){\n \n $addField = true;\n if (@sizeof($value->table[\"foreign\"]) > 0){\n foreach ($value->table[\"foreign\"] as $vl){\n if ($field->name == $vl->foreign){\n $addField = false;\n break;\n }\n unset($vl);\n }\n }\n if ($addField){\n $str .= \"\\t\\t\\t\\t\".$migration->getMigrationField($field, @$value->table['index']).\"\\n\";\n }\n unset($field);\n }\n \n if (@sizeof($value->table['foreign']) > 0){\n foreach ($value->table['foreign'] as $chave){\n $str .= $migration->getMigrationForeign($chave);\n unset($chave);\n }\n }\n \n $str .= \"\\t\\t\\t\\t\\$table->timestamps();\\n\";\n }\n $str .= \"\\t\\t\\t});\\n\";\n $str .= \"\\t}\\n\";\n \n $str .= \"\\t\\n\\n\\n\";\n $str .= \"\\t/**\\n\";\n $str .= \"\\t * Reverse the migrations.\\n\";\n $str .= \"\\t *\\n\";\n $str .= \"\\t * @return void\\n\";\n $str .= \"\\t */\\n\";\n $str .= \"\\tpublic function down()\\n\";\n $str .= \"\\t{\\n\";\n if ($generation['head']['connection'] != \"\") {\n $str .= \"\\t\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->drop('\".$nameFile.\"');\\n\";\n } else {\n $str .= \"\\t\\t\\tSchema::drop('\".$nameFile.\"');\\n\";\n }\n $str .= \"\\t}\\n\";\n \n $str .= \"\\n\\n}\";\n $micro = microtime();\n $micro = str_ireplace(\".\", \"\", $micro);\n $file_name = date('Y').\"_\".date('m').\"_\".date('d').\"_\".date('Hmisu').$sequence.\"_create_\".strtolower($nameFile).\"_table.php\";\n $sequence++;\n if (!file_exists($dir.$file_name)){\n $fp4 = fopen($dir. $file_name, \"w+\");\n $escreve2 = fwrite($fp4, $str);\n fclose($fp4);\n chmod($dir . $file_name,0777);\n }\n unset($value);\n\n } else {\n\n $name_search = $dir_entities.\"/field/fields_\".strtolower($nameClass).\".php\";\n if (file_exists($name_search)){\n\n $nameclass_alter = date('Y').date('m').date('d').date('Hmisu');\n\n $strFileMigration = \"\";\n $strFileMigration .= \"<?php\\n\";\n $strFileMigration .= self::getHead();\n $strFileMigration .= \"use Illuminate\\Database\\Schema\\Blueprint;\\n\";\n $strFileMigration .= \"use Illuminate\\Database\\Migrations\\Migration;\\n\";\n $strFileMigration .= \"use Illuminate\\Support\\Facades\\Schema;\\n\";\n $strFileMigration .= \"\\n\";\n $strFileMigration .= \"class AddField\".$nameclass_alter.$nameClass.\"Table extends Migration\\n\";\n $strFileMigration .= \"{\\n\";\n $strFileMigration .= \"\\n\";\n $strFileMigration .= \"\\tpublic function up()\\n\";\n $strFileMigration .= \"\\t{\\n\";\n $strFileMigration .= \"\\n\";\n if ($generation['head']['connection'] != \"\") {\n $strFileMigration .= \"\\t\\tSchema::connection('\".$generation['head']['connection'].\"')->table('\".$nameFile.\"', function (\\$table) {\\n\";\n } else {\n $strFileMigration .= \"\\t\\tSchema::table('\".$nameFile.\"', function (\\$table) {\\n\";\n }\n\n $ponteiro = fopen ($dir_entities.\"/field/fields_\".strtolower($nameClass).\".php\",\"r\");\n $stream = \"\";\n while (!feof ($ponteiro)) {\n $stream .= fgets($ponteiro,4096);\n }\n fclose ($ponteiro); \n\n $tmField = sizeof($value->table[\"fields\"]);\n $criaMigration = false;\n if ($tmField > 0){\n \n foreach($value->table[\"fields\"] as $field){\n $addField = false;\n if ($field->name != \"id\"){\n $one_search = \"'\".$field->name.\"'\";\n //$sec_search = \"'\".$field->name.\"'\";\n $find1 = (strpos($stream,$one_search) > -1);\n //$find2 = (strpos($stream, $sec_search) > -1);\n if (($find1 == false)) { //} && ($find2 == false)){\n $addField = true;\n }\n if ($addField){\n $criaMigration = true;\n $strFileMigration .= \"\\t\\t\\t\".$migration->getMigrationField($field, @$value->table['index']).\"\\n\";\n }\n }\n unset($field);\n }\n \n if (@sizeof($value->table['foreign']) > 0){\n foreach ($value->table['foreign'] as $chave){\n $one_search = \"'\".$chave->foreign.\"',\";\n $sec_search = \",'\".$chave->foreign.\"'\";\n $find1 = (strpos($stream,$one_search) > -1);\n $find2 = (strpos($stream, $sec_search) > -1);\n if (($find1 == false) && ($find2 == false)){\n $strFileMigration .= $migration->getMigrationForeign($chave);\n }\n unset($chave);\n }\n }\n } \n\n $strFileMigration .= \"\\t\\t});\\n\";\n $strFileMigration .= \"\\t}\\n\";\n if ($generation['head']['connection'] != \"\") {\n $strFileMigration .= \"\\tpublic function down(){Schema::connection('\".$generation['head']['connection'].\"')->drop('\".$nameFile.\"');}\\n\";\n } else {\n $strFileMigration .= \"\\tpublic function down(){Schema::drop('\".$nameFile.\"');}\\n\";\n }\n \n $strFileMigration .= \"\\t}\\n\";\n\n if ($criaMigration){\n $file_name = date('Y').\"_\".date('m').\"_\".date('d').\"_\".date('Hmisu').$sequence.\"_addField\".$nameclass_alter.strtolower($nameClass).\"_table.php\";\n $sequence++;\n if (!file_exists($dir.\"/\".$file_name)){\n $fp4 = fopen($dir. \"/\" . $file_name, \"w+\");\n $escreve2 = fwrite($fp4, $strFileMigration);\n fclose($fp4);\n chmod($dir. \"/\" . $file_name,0777);\n }\n }\n\n }\n\n }\n \n\n }\n \n }\n\n\n }",
"public static function builder() {\n return new self();\n }",
"protected function makeMigration()\n {\n new MakeMigration($this, $this->files);\n }",
"public function getContentMigrator(): MigrationManager\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('contentMigrator');\n }",
"public function getMigrations(){\n $migrations[] = new migrateTable0001($this->get('db'));\n $migrations[] = new migrateTable0002($this->get('db'));\n $migrations[] = new migrateTableEvent($this->get('db'));\n $migrations[] = new migrateTableMessages($this->get('db'));\n $migrations[] = new migrateTablePerson($this->get('db'));\n $migrations[] = new migrateTable122320151845($this->get('db'));\n\n return $migrations;\n }",
"public static function build() {\n return new Builder();\n }",
"public function __construct(SmartSeedMigrator $migrator)\n {\n parent::__construct();\n $this->migrator = $migrator;\n }",
"protected function buildMigration($table)\n {\n $stub = $this->files->get($this->getStubDir() . '/create.stub');\n\n $stub = $this->replaceClass($stub, Str::studly('create ' . $table . ' table'));\n return $this->replaceTable($stub, $table);\n }",
"public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }",
"public function migration(string $version): MigrationInterface;",
"protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}",
"protected function createBuilder()\n\t{\n\t\treturn new Db_CompiledBuilder($this);\n\t}",
"private function getMigrations()\n\t\t{\n\t\t\tif(self::$migrations)\n\t\t\t{\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tforeach(\\System\\DB\\DataAdapter::create(\"adapter=dir;source=\".__MIGRATIONS_PATH__.\";\")->openDataSet()->rows as $row)\n\t\t\t\t{\n\t\t\t\t\tif(\\strpos($row[\"name\"], '.php'))\n\t\t\t\t\t{\n\t\t\t\t\t\trequire $row[\"path\"];\n\t\t\t\t\t\t$migration = \\str_replace(\".php\", \"\", $row[\"name\"]);\n\t\t\t\t\t\teval(\"\\$migration = new \\\\System\\\\Migrate\\\\{$migration}();\");\n\n\t\t\t\t\t\tself::$migrations[] = new $migration();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$CSort = new MigrationCompare();\n\t\t\t\tusort( self::$migrations, array( &$CSort, 'compareVersion' ));\n\t\t\t\treturn self::$migrations;\n\t\t\t}\n\t\t}",
"public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}",
"public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}",
"public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}",
"public static function make(): self\n\t{\n\t\treturn static::builder()->build();\n\t}",
"public function createBuilder();",
"private function makeBuilder(ConfigDTO $configDTO, LogInterface $log): DatabaseBuilder\n {\n return (new BootRemoteBuildLaravel())\n ->log($log)\n ->ensureStorageDirsExist()\n ->makeNewBuilder($configDTO);\n }"
]
| [
"0.6316747",
"0.6076442",
"0.58225304",
"0.58019376",
"0.5772321",
"0.5604302",
"0.55381465",
"0.5524214",
"0.550355",
"0.54853225",
"0.5432471",
"0.54164046",
"0.5402721",
"0.5402566",
"0.53952384",
"0.53717613",
"0.53682506",
"0.5337696",
"0.5321132",
"0.5301172",
"0.5299345",
"0.5248081",
"0.523059",
"0.5196992",
"0.51533854",
"0.51533854",
"0.51533854",
"0.51533854",
"0.51385975",
"0.51284444"
]
| 0.60997564 | 1 |
/ $jdbc_dir : Informe o caminho real onde o driver jdbc. Adicione o jdbc_driver conforme array abaixo. jdbc_url : informe o IP e a porta da instancia do seu banco e databasename informe o nome do banco | public function getDatabaseConfig()
{
$jdbc_dir = 'C:\xampp\htdocs\JasperReport\vendor\cossou\jasperphp\src\JasperStarter\jdbc';
return [
'driver' => 'generic',
'host' => env('DB_HOST'),
'port' => env('DB_PORT'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'database' => env('DB_DATABASE'),
'jdbc_driver' => 'com.microsoft.sqlserver.jdbc.SQLServerDriver',
'jdbc_url' => 'jdbc:sqlserver://192.168.1.250:1433;databaseName='.env('DB_DATABASE').'',
'jdbc_dir' => $jdbc_dir
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertConnectionString($dir){\n // connection details are stored outside the web directory and are defined\n include($dir.\"../pem/sqlInsert.php\");\n $connection = mysqli_connect(iHOST, iUSER, iPASS);\n if (!$connection) {\n trigger_error(\"Could not reach database!<br/>\");\n error_log(\"could not connect! deleteConnectionString(),\", 0);\n exit();\n }\n $db_selected = mysqli_select_db($connection, iDB);\n if (!$db_selected) {\n trigger_error(\"Could not reach database!<br/>\");\n error_log(\"could not connect! deleteConnectionString(),\", 0);\n exit();\n } \n return $connection;\n }",
"function setDatabaseConnection($host,$database,$user,$pass);",
"function sql_connect_args($db_host = 'localhost', $db_user = '', $db_password = '', $db_name = '') {\n global $CONF, $MYSQL_HANDLER;\n\n $DB_DRIVER_NAME = $MYSQL_HANDLER[1];\n\n try {\n if (strpos($db_host,':') === false) {\n $host = $db_host;\n $port = '';\n $portnum = '';\n }\n else {\n list($host,$port) = explode(\":\",$db_host);\n if (isset($port)) {\n $portnum = $port;\n $port = ';port='.trim($port);\n }\n else {\n $port = '';\n $portnum = '';\n }\n }\n \n switch ($DB_DRIVER_NAME) {\n case 'sybase':\n case 'dblib':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':host='.$host.$port.';dbname='.$db_name, $db_user, $db_password);\n break;\n case 'mssql':\n if (is_numeric($portnum)) $port = ','.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':host='.$host.$port.';dbname='.$db_name, $db_user, $db_password);\n break;\n case 'oci':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':dbname=//'.$host.$port.'/'.$db_name, $db_user, $db_password);\n break;\n case 'odbc':\n if (is_numeric($portnum)) $port = ';PORT='.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME='.$host.$port.';DATABASE='.$db_name.';PROTOCOL=TCPIP;UID='.$db_user.';PWD='.$db_password);\n\n break;\n case 'pgsql':\n if (is_numeric($portnum)) $port = ';port='.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':host='.$host.$port.';dbname='.$db_name, $db_user, $db_password);\n break;\n case 'sqlite':\n ini_set('default_charset', \"UTF-8\");\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':'.$db_name, $db_user, $db_password);\n if ($DBH)\n {\n // standard: SUBSTR , non-standard: SUBSTRING\n // SQLite has no SUBSTRING. but has SUBSTR.\n // SUBSTRING , start index 1 or -1 , param 2 or 3\n $DBH->sqliteCreateFunction('SUBSTRING', create_function('', ' $st = intval(func_get_arg(1)); if ($st>0) $st--; return substr(func_get_arg(0) , $st , func_get_arg(2)); ') , 3);\n $DBH->sqliteCreateFunction('UNIX_TIMESTAMP', 'strtotime', 1);\n $DBH->sqliteCreateFunction('NOW', create_function('', 'return date(\"Y-m-d H:i:s\", time());'), 0); // local time\n // SQL non-standard : REGEXP (mysql , sqlite) , src_exp ~ pattern_text (postgreSQL)\n // --- src_exp like pattern_text , % _\n // src_exp REGEXP pattern_text\n // 'P1' REGEXP 'P2' = P2 P1 ( return func_get_arg(0).' '.func_get_arg(1); )\n $DBH->sqliteCreateFunction('REGEXP', create_function('$pattern , $Text', 'return preg_match(\"/(\".str_replace(\"/\",\"\\\\/\",(string) $pattern).\")/im\", (string) $Text)? 1:0;'), 2);\n $DBH->sqliteCreateFunction('CONCAT', create_function('', 'return implode (\"\",func_get_args() );'), -1);\n $DBH->sqliteCreateFunction('FIND_IN_SET', create_function('$k,$v', 'return in_array($k, explode($v)) ? 1:0;'), 2);\n $DBH->sqliteCreateFunction('md5', 'md5', 1);\n// $DBH->beginTransaction();\n }\n break;\n case 'sqlite2': // PDO::sqliteCreateFunction does not support SQLite2\n// trigger_error(\"Critical Error : sqlite2 driver is not suported. \", E_USER_ERROR);\n $msg = '<p>a1 Error!: sqlite2 driver is not supportted.</p>';\n startUpError($msg , 'Connect Error');\n break;\n default:\n //mysql\n $DBH = new PDO($DB_DRIVER_NAME.':host='.$host.$port.';dbname='.$db_name, $db_user, $db_password);\n break;\n }\n\n// <add for garble measure>\n // for mysql\n if ( $DBH && (stripos($DB_DRIVER_NAME, 'mysql') === 0) )\n {\n if ($DBH && version_compare( '5.2.0', PHP_VERSION, '>' ))\n {\n // HY000-2014 Cannot execute queries while other unbuffered queries are active.\n $DBH->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\n }\n if (defined('_CHARSET'))\n {\n $charset = get_mysql_charset_from_php_charset(_CHARSET);\n }\n else\n {\n $query = sprintf(\"SELECT * FROM %s WHERE name='Language'\", sql_table('config'));\n $res = sql_query($query, $DBH);\n if(!$res) exit('Language name fetch error');\n $obj = sql_fetch_object($res);\n $Language = $obj->value;\n $charset = get_charname_from_langname($Language);\n $charsetOfDB = getCharSetFromDB(sql_table('config'),'name', $DBH);\n if ((stripos($charset, 'utf')!==FALSE) && (stripos($charsetOfDB, 'utf8')!==FALSE))\n $charset = $charsetOfDB; // work around for utf8mb4_general_ci\n }\n sql_set_charset($charset , $DBH);\n }\n// </add for garble measure>*/\n\n } catch (PDOException $e) {\n $DBH =NULL;\n if ($CONF['debug'])\n $msg = '<p>a1 Error!: ' . $e->getMessage() . '</p>';\n else\n {\n $msg = '<p>a1 Error!: ';\n $pattern = '/(Access denied for user|Unknown database)/i';\n if (preg_match($pattern, $e->getMessage(), $m))\n $msg .= $m[1];\n $msg .= '</p>';\n }\n startUpError($msg , 'Connect Error');\n }\n//echo '<hr />DBH: '.print_r($DBH,true).'<hr />'; \n return $DBH;\n }",
"private function connect()\n {\n if ($this->configuration->get('db.connector') == 'PDO') {\n $dsn = \"mysql:host=\" . $this->configuration->get('db.host') . \";dbname=\" . $this->configuration->get('db.name');\n $options = array();\n $this->db = new PDO(\n $dsn, $this->configuration->get('db.username'), $this->configuration->get('db.password'), $options\n );\n } elseif ($this->configuration->get('db.connector') == 'mysqli') {\n $this->db = mysqli_connect(\n $this->configuration->get('db.host'), $this->configuration->get('db.username'), $this->configuration->get('db.password'), $this->configuration->get('db.name')\n );\n }\n }",
"private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}",
"public function connect_db($dsn, $login, $password)\n {\n try {\n $this->db = new PDO($dsn, $login, $password);\n } catch (PDOException $e) {\n $this->debug($e->getMessage());\n $this->file_not_found(); //program terminates in function file_not_found()\n }\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $this->db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n\n $driver = $this->db->getAttribute(PDO::ATTR_DRIVER_NAME);\n $this->debug(\"our driver is $driver\");\n\n switch ($driver) {\n case 'mysql':\n $quoter = '`';\n break;\n case 'pgsql':\n if (DEFAULT_DSN_SCHEMA) {\n $this->db->exec('SET SEARCH_PATH=' . DEFAULT_DSN_SCHEMA);\n }\n $quoter = '\"';\n break;\n default:\n $quoter = '';\n break;\n }\n define('DB_FIELD_QUOTE', $quoter);\n }",
"public function getConnection(){\n \n $this->conn = null;\n \n if (is_dir($this->db_url)) {\n $this->conn=$this->db_url;\n }\n \n return $this->conn;\n }",
"function pg_connection_string_from_database_url() {\n extract(parse_url(getenv(\"HEROKU_POSTGRESQL_COBALT_URL\")));\n return \"user=$user password=$pass host=$host dbname=\" . substr($path, 1);\n }",
"public static function getMysqlConnexion(){\n\t\ttry{\n\t\t\t\n\t\t\t$db = new \\PDO('mysql:host=' . \\Library\\Application::appConfig()->getConst(\"BDD_HOST\")\n\t\t\t\t\t\t\t. ';dbname=' . \\Library\\Application::appConfig()->getConst(\"BDD_NAME\"). ''\n\t\t\t\t\t\t\t, \\Library\\Application::appConfig()->getConst(\"BDD_USER\")\n\t\t\t\t\t\t\t, \\Library\\Application::appConfig()->getConst(\"BDD_PASSWORD\"));\n\t\t\t\n\t\t\t$db->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t} catch(\\Exception $e) {\n\t\t\tif (\\Library\\Application::appConfig()->getConst(\"LOG\"))\n\t\t\t\tthrow new \\RuntimeException(\"Error ID: \" . \\Library\\Application::logger()->log(\"Error\", \"Page\", \"Error on BDD connection\", __FILE__, __LINE__));\n\t\t\telse\n\t\t\t\tthrow new \\RuntimeException(\"Error on BDD connection\");\n\t\t\texit();\n\t\t}\n\t\treturn $db;\n\t}",
"private function connectMysql() {\r\n\t\tif (!($tmp = mysql_connect($this -> host, $this -> user, $this -> pass))) {\r\n\t\t\tif ($this -> logger) {\r\n\t\t\t\tLogger::sqlError(mysql_error());\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Exception('Connection impossible : ' . mysql_error());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this -> link = &$tmp;\r\n\r\n\t\t// Select the db\r\n\t\tif (!mysql_select_db($this -> base, $this -> link)) {\r\n\t\t\tif ($this -> logger) {\r\n\t\t\t\tLogger::sqlError(mysql_error($this -> link));\r\n\t\t\t\treturn;\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Exception('Impossible to select the database : ' . mysql_error($this -> link));\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function getConnection($db,$custom);",
"protected function connectBase(){\n try{\n $db=new PDO(\"mysql:host=$this->hostname;dbname=$this->basename;charset=UTF8\",$this->username, $this->password);\n $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $db;\n }\n catch(PDOException $e){\n echo 'Echec de la connexion'. $e->getMessage();\n }\n }",
"function bbconn($host, $port, $dbname, $dbuser, $dbpass, $prefix, $dbtype='mysql') {\n\tif (preg_match('/mysql/i', $dbtype)) {\n\t\tif (!empty($port)) $host = $host .':'. $port;\n\t\tif (!($conn = mysql_connect($host, $dbuser, $dbpass))) {\n\t\t\tseterr('Unable to connect to the source forum\\'s MySQL database.');\n\t\t}\n\t\tdefine('dbtype', 'mysql');\n\t\tdefine('dbpref', $dbname .'.'. $prefix);\n\t\tdefine('dbconn', $conn);\n\t} else if (preg_match('/pgsql/i', $dbtype) || preg_match('/postgres/i', $dbtype)) {\n\t\t$dsn = 'host='. $host .' dbname='. $dbname .' user='. $dbuser .' password='. $dbpass;\n\t\tif (!empty($port)) $dsn .= ' port='. $port;\n\t\tif (!($conn = pg_connect($dsn))) {\n\t\t\tseterr('Unable to connect to the source forum\\'s PostgreSQL database.');\n\t\t}\n\t\tdefine('dbtype', 'pgsql');\n\t\tdefine('dbpref', $prefix);\n\t\tdefine('dbconn', $conn);\n\t} else if (preg_match('/sqlite/i', $dbtype)) {\n\t\tclass db2 { public static $db; }\n\t\t$dsn = 'sqlite:'. $host;\t// NOTE: May need to change this to 'sqlite2:' (for older v2 databases).\n\t\ttry {\n\t\t\tdb2::$db = new PDO($dsn, $dbuser, $dbpass);\n\t\t} catch (PDOException $e) {\n\t\t\tseterr('Unable to connect to the source forum\\'s SQLite database: '. $e->getMessage());\n\t\t}\n\t\tdefine('dbtype', 'sqlite');\n\t\tdefine('dbpref', $prefix);\n\t} else {\n\t\tseterr('Unsupported database type ['. $dbtype .']');\n\t}\n\tpf('... connected to '. $dbtype .' database '. $dbuser .'@'. $dbname);\n}",
"function connexionDb()\n{\n $confDb = getConfigFile()['DATABASE'];\n\n\n $type = $confDb['type'];\n $host = $confDb['host'];\n $servername = \"$type:host=$host\";\n $username = $confDb['username'];\n $password = $confDb['password'];\n $dbname = $confDb['dbname'];\n\n $db = new PDO(\"$servername;dbname=$dbname\", $username, $password);\n return $db;\n}",
"public function _db_connect(){\r\n\t\tswitch($this->dbType){\r\n\t\t\tcase \"access\":\r\n\t\t\t\t$this->db = ADONewConnection($this->dbType);\r\n\t\t\t\t$dsn = \"Driver={Microsoft Access Driver (*.mdb)};Dbq=\".$this->databaseName.\";Uid=\".$this->userName.\";Pwd=\".$this->password.\";\";\r\n\t\t\t\t$this->db->Connect($dsn);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"odbc_mssql_native\":\r\n\t\t\t\t$this->db = ADONewConnection('odbc_mssql');\r\n // DSN connectivity through SQL Native Client 10.0 ODBC Driver\r\n\t\t\t\t$dsn = \"Driver={SQL Server};Server=\".$this->hostName.\";Database=\".$this->databaseName.\";\";\r\n $this->db->Connect($dsn, $this->userName, $this->password);\r\n break;\r\n case \"odbc_mssql\":\r\n $this->db = ADONewConnection($this->dbType);\r\n // DSN connectivity through unixODBC\r\n $this->db->Connect($this->hostName, $this->userName, $this->password);\r\n break;\r\n\t\t\tcase \"postgres\":\r\n\t\t\t\t$this->db = ADONewConnection($this->dbType);\r\n\t\t\t\t$this->db->Connect($this->hostName, $this->userName, $this->password, $this->databaseName) or die(\"Error: Could not connect to the database\");\r\n\t\t\t\tif(!empty($this->charset)) {\r\n $this->db->Execute(\"SET NAMES '$this->charset'\");\r\n }\r\n break;\r\n\t\t\tcase \"db2\":\r\n\t\t\t\t$this->db = ADONewConnection($this->dbType);\r\n\t\t\t\t$dsn = \"driver={IBM db2 odbc DRIVER};Database=\".$this->databaseName.\";hostname=\".$this->hostName.\";port=50000;protocol=TCPIP;uid=\".$this->userName.\"; pwd=\".$this->password;\r\n\t\t\t\t$this->db->Connect($dsn);\r\n\t\t\t\tbreak;\r\n case 'db2-dsnless':\r\n $this->db = ADONewConnection('db2');\r\n $this->db->Connect($this->hostName,$this->userName,$this->password, $this->databaseName);\r\n break;\r\n\t\t\tcase \"ibase\":\r\n\t\t\t\t$this->db = ADONewConnection($this->dbType); \r\n\t\t\t\t$this->db->Connect($this->hostName . $this->databaseName, $this->userName, $this->password);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"oci805\":\r\n // Host name and SID\r\n\t\t\t\t$this->db = ADONewConnection($this->dbType);\t\t// Christopher: It�s missing the code to initialize the db object for oci8 db type:\r\n\t\t\t\t$ret = $this->db->Connect($this->hostName, $this->userName, $this->password, $this->databaseName); \r\n\t if(!$ret){\r\n // Host Address and Service Name\r\n // <servicename> is passed in databaseName\r\n $this->db->Connect($this->hostName, $this->userName, $this->password, $this->databaseName); \r\n } \r\n\t\t\t\t\r\n\t\t\t\t// TNS Name defined in tnsnames.ora (or ONAMES or HOSTNAMES), eg. 'myTNS'\r\n\t\t\t\t// $this->db->Connect(false, $this->userName, $this->password, 'myTNS');\r\n\t\t\t\t\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"sqlite\":\r\n\t\t\t\t$this->db = ADONewConnection('sqlite');\r\n\t\t\t\t$this->db->Connect($this->hostName); // e.g. c:\\sqllite.db - sqlite will create if does not exist\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"informix\":\r\n\t\t\t\t$this->db = ADONewConnection('informix');\t\t\r\n\t\t\t\t$this->db->Connect($this->hostName, $this->userName, $this->password, $this->databaseName) or die(\"Error: Could not connect to the database\");\r\n\t\t\t break;\r\n case \"informix72\":\r\n\t\t\t\t$this->db = ADONewConnection('informix72');\t\t\r\n\t\t\t\t$this->db->Connect($this->hostName, $this->userName, $this->password, $this->databaseName) or die(\"Error: Could not connect to the database\");\r\n\t\t\t break;\r\n // the generic odbc presumes a correctly configured odbc.ini in /etc/\r\n case \"odbc\":\r\n $this->db = ADONewConnection($this->dbType);\r\n $dsn = \"DSN=\".$this->hostName.\";uid=\".$this->userName.\"; pwd=\".$this->password;\r\n $this->db->Connect($dsn);\r\n break;\r\n case 'mysql_dsn':\r\n $dsn = 'mysqli://'. $this->userName .':'. $this->password .'@'. $this->hostName .'/'. $this->databaseName;\r\n $this->db = ADONewConnection($dsn);\r\n if(!empty($this->charset)) {\r\n $this->db->Execute(\"SET NAMES '$this->charset'\");\r\n }\r\n break;\r\n // default should be mysql and all other databases using the following form of connection\r\n\t\t\tdefault:\t\r\n\t\t\t\t$this->db = ADONewConnection('mysqli'); // PHP 5.5 deprecates mysql extension. Switching to mysqli\r\n\t\t\t\t$this->db->Connect($this->hostName, $this->userName, $this->password, $this->databaseName) or die(\"Error: Could not connect to the database\");\r\n\t\t\t\tif(!empty($this->charset)) {\r\n\t\t\t\t\t$this->db->Execute(\"SET NAMES '$this->charset'\");\r\n\t\t\t\t}\r\n\t\t}\t\t\t\r\n\t}",
"protected function inject_dbal_driver()\n\t{\n\t\tif (empty($this->config_php_file))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$config_data = $this->config_php_file->get_all();\n\t\tif (!empty($config_data))\n\t\t{\n\t\t\tif ($this->dbal_connection === null)\n\t\t\t{\n\t\t\t\t$dbal_driver_class = $this->config_php_file->convert_30_dbms_to_31($this->config_php_file->get('dbms'));\n\t\t\t\t/** @var \\phpbb\\db\\driver\\driver_interface $dbal_connection */\n\t\t\t\t$this->dbal_connection = new $dbal_driver_class();\n\t\t\t\t$this->dbal_connection->sql_connect(\n\t\t\t\t\t$this->config_php_file->get('dbhost'),\n\t\t\t\t\t$this->config_php_file->get('dbuser'),\n\t\t\t\t\t$this->config_php_file->get('dbpasswd'),\n\t\t\t\t\t$this->config_php_file->get('dbname'),\n\t\t\t\t\t$this->config_php_file->get('dbport'),\n\t\t\t\t\tfalse,\n\t\t\t\t\tdefined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK\n\t\t\t\t);\n\t\t\t}\n\t\t\t$this->container->set('dbal.conn.driver', $this->dbal_connection);\n\t\t}\n\t}",
"function connectMaBase()\n{\n\t\n/********************************************\n \t$Host = \"bricolage.ceds.sql.free.fr\";\n\t$User = \"bricolage.ceds\";\n\t$Password = \"gcnpfs31\";\n\t$BaseName= \"bricolage_ceds\";\n*********************************************/\n\t$Host = GetHostForDump ();\n\t$User = GetSQLUser ();\n\t$Password = GetSQLPassword();\n\t$BaseName= GetSQLDbName ();\n\t\n\t$ServeurName = GetServeurName();\n\t//AddInGlobalTrace (\"[\".date('d/m/Y-H:i:s').\"] connectMaBase ServeurName=\".$ServeurName);\n\tif (strcmp ($ServeurName, 'free') != 0)\n\t{\n\t\t$Host = \"localhost\";\n\t\t$User = GetSQLUser ();\n\t\t$Password = GetSQLPassword();\n\t\t$BaseName= GetSQLDbName ();\n\t}\n\t$base = 0;\n $base = mysql_connect ($Host, $User, $Password) or die (\"Impossible de se connecter : \".mysql_error());\n\t//AddInGlobalTrace (\"[\".date('d/m/Y-H:i:s').\"] connectMaBase base=\".$base);\n mysql_select_db ($BaseName, $base) ;\n return $base;\n}",
"private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }",
"public static function connectFromFile($file){\r\n if(!file_exists($file))\r\n {\r\n throw new main\\mgLibs\\exceptions\\System('DB Connection File does not exits', main\\mgLibs\\exceptions\\Codes::MYSQL_MISING_CONFIG_FILE);\r\n }\r\n \r\n self::$_instance = new self();\r\n \r\n include $file;\r\n \r\n foreach($config as $connectionName => $config)\r\n {\r\n if ($config['host']) \r\n {\r\n if(!extension_loaded('PDO'))\r\n {\r\n throw new main\\mgLibs\\exceptions\\System('Missing PDO Extension', main\\mgLibs\\exceptions\\Codes::MYSQL_MISING_PDO_EXTENSION);\r\n }\r\n\r\n try{ \r\n self::$_instance->connection[$connectionName] = new \\PDO(\"mysql:host=\".$config['host'].\";dbname=\".$config['name'], $config['user'], $config['pass']); \r\n\r\n self::$_instance->connection[$connectionName]->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\r\n } catch (\\Exception $ex) {\r\n throw new main\\mgLibs\\exceptions\\System('SQL Connection Error',exceptions\\Codes::MYSQL_CONNECTION_FAILED);\r\n } \r\n }\r\n }\r\n \r\n return true;\r\n }",
"abstract public function connect($parameters, $selectDB = false);",
"function DB_manager (){\n //parse configuration file\n $ini_array = parse_ini_file($this->configuration_file_path);\n $db_host = $ini_array['db_host'];\n $db_name = $ini_array['db_name'];\n $db_user = $ini_array['db_user'];\n $db_password = $ini_array['db_password'];\n\n //make a connection\n $mysqli = new mysqli($db_host, $db_user , $db_password, $db_name);\n if (mysqli_connect_errno()) {\n printf(\"Connect failed: %s\\n\", mysqli_connect_error());\n exit();\n }\n\n $this->db = $mysqli;\n }",
"function dbConnect($dsn=undefined){\n\t\tif($dsn !== undefined)return parent::dbConnect($dsn);\n\n\t\t$conf =& JFactory::getConfig();\n\n\t\t$pdo_dsn \t= $conf->getValue('config.pdo_dsn');\n\t\tif($pdo_dsn)return parent::dbConnect($pdo_dsn);\n\n\n\t\t$host \t\t= $conf->getValue('config.host');\n\t\t$user \t\t= $conf->getValue('config.user');\n\t\t$password \t= $conf->getValue('config.password');\n\t\t$database\t= $conf->getValue('config.db');\n\t\t$this->db_prefix \t= $conf->getValue('config.dbprefix');\n\t\t$driver \t= \"mysql\";// $conf->getValue('config.dbtype'); /*Mysqli driver giving problem*/\n\t\t$debug \t\t= $conf->getValue('config.debug');\n\n\t\t$pdo_dsn=array(\"$driver:host=$host;dbname=$database\",\n\t\t\t$user,\n\t\t\t$password);\n\n\t\treturn parent::dbConnect($pdo_dsn);\n\n\t}",
"private function conectar_base_datos(){\n\t\t$this->descriptor = mysqli_connect($this->servidor,$this->usuario,$this->pass,$this->base_datos);\n\t\tif (mysqli_connect_errno()) {\n \t\t?>\n\t\t\t<script language=\"JavaScript\" type=\"text/javascript\">\n\t\t\t\talert (\"Falló conexión al servidor:<?php printf(\"%s\\n\", mysqli_connect_error());?>\"); \n\t\t\t</script>\n\t\t\t<?\n\t\t\texit();\n\t\t}\n\t}",
"private function _connect(){\n \t$errormsg='';\n \tif(!is_dir($this->_db_root_dir))\n $errormsg=sprintf (self::$_error_code_list[1], $this->_db_root_dir);\n \telseif (!is_readable($this->_db_root_dir))\n $errormsg=sprintf (self::$_error_code_list[2], $this->_db_root_dir);\n \telseif (!is_writable($this->_db_root_dir))\n $errormsg=sprintf (self::$_error_code_list[3], $this->_db_root_dir);\n \t/*elseif (!is_executable($this->_db_root_dir))\n $errormsg=\"$this->_db_root_dir is not executable!\";*/\n \tif($errormsg){\n $this->_trigger_error($errormsg);\n return FALSE;\n \t}\n \treturn TRUE;\n }",
"public function connect()\r\n {\r\n \techo 'asdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfadsf';exit;\r\n try\r\n {\r\n\r\n \t$res\t= $this->getParameterHolder();\r\n\r\n \tprint_r($res);exit;\r\n\r\n // determine how to get our settings\r\n $method = $this->getParameter('method', 'normal');\r\n\r\n switch ($method)\r\n {\r\n case 'normal':\r\n // get parameters normally, and all are required\r\n $database = $this->getParameter('database', null);\r\n $hostspec = $this->getParameter('hostspec') ? $this->getParameter('hostspec') : ($this->getParameter('host') ? $this->getParameter('hostspec') : null);\r\n $password = $this->getParameter('password', null);\r\n $phptype = $this->getParameter('phptype', null);\r\n $username = $this->getParameter('username', null);\r\n $port = $this->getParameter('port', null);\r\n $encoding = $this->getParameter('encoding', null);\r\n\r\n $dsn = array('database' => $database,\r\n 'hostspec' => $hostspec,\r\n 'password' => $password,\r\n 'phptype' => $phptype,\r\n 'username' => $username,\r\n 'port' => $port,\r\n 'encoding' => $encoding);\r\n break;\r\n\r\n case 'dsn':\r\n $dsn = $this->getParameter('dsn');\r\n\r\n if ($dsn == null)\r\n {\r\n // missing required dsn parameter\r\n $error = 'Database configuration specifies method \"dsn\", but is missing dsn parameter';\r\n\r\n throw new sfDatabaseException($error);\r\n }\r\n\r\n break;\r\n\r\n case 'server':\r\n // construct a DSN connection string from existing $_SERVER values\r\n $dsn =& $this->loadDSN($_SERVER);\r\n\r\n break;\r\n\r\n case 'env':\r\n // construct a DSN connection string from existing $_ENV values\r\n $dsn =& $this->loadDSN($_ENV);\r\n\r\n break;\r\n\r\n default:\r\n // who knows what the user wants...\r\n $error = 'Invalid CreoleDatabase parameter retrieval method \"%s\"';\r\n $error = sprintf($error, $method);\r\n\r\n throw new sfDatabaseException($error);\r\n }\r\n\r\n // get creole class path\r\n $classPath = $this->getParameter('classpath');\r\n\r\n // include the creole file\r\n if ($classPath == null)\r\n {\r\n require_once('creole/Creole.php');\r\n }\r\n else\r\n {\r\n require_once($classPath);\r\n }\r\n\r\n // set our flags\r\n $noAssocLower = $this->getParameter('no_assoc_lower', false);\r\n $persistent = $this->getParameter('persistent', false);\r\n $compatAssocLower = $this->getParameter('compat_assoc_lower', false);\r\n $compatRtrimString = $this->getParameter('compat_rtrim_string', false);\r\n\r\n $flags = 0;\r\n $flags |= ($noAssocLower) ? Creole::NO_ASSOC_LOWER : 0;\r\n $flags |= ($persistent) ? Creole::PERSISTENT : 0;\r\n $flags |= ($compatAssocLower) ? Creole::COMPAT_ASSOC_LOWER : 0;\r\n $flags |= ($compatRtrimString) ? Creole::COMPAT_RTRIM_STRING : 0;\r\n\r\n // do the duuuurtay work, right thurr\r\n if ($flags > 0)\r\n {\r\n $this->connection = Creole::getConnection($dsn, $flags);\r\n }\r\n else\r\n {\r\n $this->connection = Creole::getConnection($dsn);\r\n }\r\n\r\n // get our resource\r\n $this->resource = $this->connection->getResource();\r\n }\r\n catch (SQLException $e)\r\n {\r\n // the connection's foobar'd\r\n throw new sfDatabaseException($e->toString());\r\n }\r\n }",
"private function connect(){\n\t\trequire (__DIR__ . '/../../config.php');\n\t\t$mysqlCFG =$database['mysql'];\n\t\t\n\t\tif(!self::$db){\n\t\t\t$connectionString = \"mysql:host=$mysqlCFG[host];dbname=$mysqlCFG[dbname]\";\n\t\t\ttry{\n\t\t\t\tself::$db = new \\PDO($connectionString, $mysqlCFG['user'], $mysqlCFG['password']);\n\t\t\t\tself::$db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t\t}catch(\\PDOException $e){\n\t\t\t\tdie(\"Ocurrio un error al conectar con la base de datos: $e->getMessage()\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function conectar()\n{\n// $host = 'localhost:c:\\Embebed21\\SOCIOS.FDB';\n$host='localhost:socioss';\n // $host = '192.168.10.201:base';\n $nombre_usuario='SYSDBA';\n $contrasenya='masterkey';\n $this->conexion = ibase_connect($host, $nombre_usuario, $contrasenya,'UTF-8') or die( ibase_errmsg() );\n}",
"protected function connectDB () {\n $host=$this->Parameters['db_host'];\n $username=$this->Parameters['db_username'];\n\t\t$password=$this->Parameters['db_userpassword'];\n\t\t$dbname=$this->Parameters['db_name'];\n\t\t\n $this->Conn = new mysqli ($host,$username,$password,$dbname);\n if($this->Conn->connect_errno > 0){\n throw new Exception('Unable to connect to database [' . $this->Conn->connect_error . ']');\n }\n }",
"private function conectarDB(){\n\t\t$dsn = 'mysql:dbname='.self::nombre_db.' ;host='.self::servidor;\n\t\ttry {\n\t\t\t#metodo abstracto para la conexion a la bd\n\t\t\t$this->_conn = new PDO($dsn, self::usuario_db, self::pwd_db);\n\t\t \t\n\t\t } catch (PDOException $e) {\n\t\t \techo \"Falló la conexión: \".$e->getMessage();\n\t\t } \n\t}",
"private function __construct($_host = \"\", $_user = \"\", $_pass = \"\", $_default_db = \"\",$_driver=\"\") {\n\t\t$this->connect($_driver,$_host,$_user,$_pass,$_default_db);\n\t\t//register_shutdown_function(array($this, \"close\"));\n\t}"
]
| [
"0.53047395",
"0.52865684",
"0.5265806",
"0.5254965",
"0.52431744",
"0.52115625",
"0.51799345",
"0.5173795",
"0.51650167",
"0.515695",
"0.51510125",
"0.51484984",
"0.5145562",
"0.51354927",
"0.5130764",
"0.51301676",
"0.51131886",
"0.5101099",
"0.5099975",
"0.5098083",
"0.50731933",
"0.50716996",
"0.5070313",
"0.5059488",
"0.50486124",
"0.5048319",
"0.50405985",
"0.5025003",
"0.50102913",
"0.50075066"
]
| 0.58099765 | 0 |
This function changes the quantity of a specific snowboard | function updateSnowQuantity($snowCode,$change){
$getUserTypeQuery = "SELECT qtyAvailable FROM snows WHERE code='".$snowCode."'";
require_once 'model/dbConnector.php';
$oldQuantity = executeQuerySelect($getUserTypeQuery)[0]['qtyAvailable'];
$newQuantity = $oldQuantity-$change;
$rentInsertQuery2 = "UPDATE snows SET qtyAvailable=".$newQuantity." WHERE code='".$snowCode."'";
$queryResult2 = executeQueryInsert($rentInsertQuery2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateNumberOfItems()\n {\n $gameId = intval($_POST['gameId']);\n $amount = intval($_POST['amount']);\n if($amount == 0){\n $amount = 1;\n }\n\n $game = new \\Webshop\\Model\\Game();\n $game = $game->getOne(\"id\", $gameId);\n if (!empty($gameFromDb)) {\n $_SESSION['addToCartError'] = \"Kon de game niet updaten\";\n header(\"Location: /cart\");\n }\n $supply = $game->supply;\n\n // Throw error if the requested amount is higher then the supply\n if ($supply < $amount) {\n $_SESSION['addToCartError'] = \"We hebben maar \" . $supply. \" games in voorraad van \". $game->title;\n $amount = $supply;\n }\n\n\n // Set the new amount in the correct game\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n if ($_SESSION['cart'][$index][0] == $gameId) {\n $_SESSION['cart'][$index][1] = $amount;\n }\n }\n header(\"Location: /cart\");\n }",
"public function changeQuantityAction()\r\n {\r\n if ($this->Request()->getParam('sArticle') && $this->Request()->getParam('sQuantity')) {\r\n $this->View()->sBasketInfo = $this->basket->sUpdateArticle($this->Request()->getParam('sArticle'), $this->Request()->getParam('sQuantity'));\r\n }\r\n $this->forward($this->Request()->getParam('sTargetAction', 'index'));\r\n }",
"function updateshops() {\n\n\tif (rand(1,8)<2) {\t// shops replenish too fast - slow them down\n\t\t// for now let's just pick a random inventory item and increase it by 1 (up to max)\n\t\t// FIXME: cant get RAND to work with UPDATE !?!?\n\t\t// $result=mysql_query(\"UPDATE phaos_shop_inventory SET quantity=quantity+1 WHERE quantity<max ORDER BY RAND() LIMIT 1\");\n\n\t\t// this code will do it randomly, but in two steps. MySQL 4.x is needed for UPDATE with RAND\n\t\t$result=mysql_query(\"SELECT shop_id,type,item_id FROM phaos_shop_inventory WHERE quantity<max ORDER BY RAND() LIMIT 1;\");\n\t\tif ($row = mysql_fetch_array($result)) {\n\t\t\t$result=mysql_query(\"UPDATE phaos_shop_inventory\n\t\t\t\tSET quantity=quantity+1\n\t\t\t\tWHERE shop_id='$row[shop_id]' AND type='$row[type]' AND item_id='$row[item_id]' \");\n\t\t}\n\t}\n\n}",
"public function updateQuantity() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'][$count]['quantity'] = $this->quantity;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}",
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"public function calculateQtyToShip();",
"public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculate();\n }",
"public function setQty($qty);",
"function set_qty_item( $params ) {\n\t\textract( $params );\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, stock WRITE\" );\n\n\t\t// Changing the current qty means putting back first the previous qty to stock then removing the new one\n\t\t$aqty = $this->db->query( \"SELECT qty, sku FROM cart_items WHERE id='\".$id.\"'\" )->row_array();\n\t\t$this->db->query( \"UPDATE stock SET qty=qty+{$aqty['qty']}-\".$qty.\" WHERE sku='{$aqty['sku']}'\" );\n\n\t\t$res = $this->db->query( \"UPDATE cart_items SET qty='\".$qty.\"' WHERE id='\".$id.\"' AND user='\".$user_no.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\t\treturn $res;\n\t}",
"public function updateKitInventory() {\n\t\textract($this->request->data);\n\t\t//this->request->data contains\n\t\t//array(\n\t\t//\t'pullQty' => '1',\n\t\t//\t'itemId' => '90',\n\t\t//\t'rowId' => '52d08471-8838-4330-b765-00ed47139427',\n\t\t//\t'onHand' => 'undefined',\n\t\t//\t'mode' => 'pull'\n\t\t//)\n\t\t//setup return array\n\t\t$orderItemType = $this->Item->OrderItem->field('catalog_type', array('id' => $rowId));\n\t\tif($orderItemType & (ON_DEMAND | INVENTORY_KIT)){\n\t\t\t$orderItemCatId = $this->Item->OrderItem->field('catalog_id', array('id' => $rowId));\n\t\t\t$this->requestAction(array('controller' => 'Catalogs', 'action' => 'kitAdjustment', $orderItemCatId, abs($pullQty), $orderItemType));\n\t\t\t$onHand = $this->Item->field('quantity', array('id' => $itemId));\n\t\t}\n\t\treturn $onHand;\n\t}",
"public function testUpdateQuantity()\n {\n $cart = new Cart(['foo']);\n $this->assertEquals(['foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 6);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['foo', 'foo', 'foo', 'foo'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'foobar']);\n $cart->updateQuantity('foo', 4);\n $this->assertEquals(['bar', 'foo', 'foo', 'foo', 'foo', 'foobar'], $cart->getItems());\n }",
"public function editCartQuant($username, $sku, $amount){\n $cartQuery = mysqli_fetch_array($this->connection->query(\"SELECT cart FROM users WHERE username = '$username'\"));\n $cart = $cartQuery['cart'];\n $currentInventoryQuant = mysqli_fetch_array($this->connection->query(\"SELECT quantity FROM items WHERE sku = '$sku'\"));\n\n //Update overall inventory\n $updatedInventory = $cart[$sku-1] - $amount;\n $updatedInventory = $currentInventoryQuant[0] + $updatedInventory;\n $query = \"UPDATE items SET quantity = '$updatedInventory' WHERE sku = '$sku'\";\n $this->connection->query($query);\n\n //Send an updated query using the new cartQuery array\n $cart[$sku-1] = $amount;\n $query = \"UPDATE users SET cart = '$cart' WHERE username = '$username'\";\n $this->connection->query($query);\n return true;\n }",
"public function updateQuantity(int $quantity)\n {\n $newQuantity = $quantity - $this->quantity();\n $item = $this->items->first();\n $item->quantity = $item->quantity + $newQuantity;\n $item->save();\n }",
"function updateCart($ucart) {\n\t\tfor ($i=0; $i < count($ucart['item']); $i++) {\n\t\t\t$item = $ucart['item'][$i];\n\t\t\t$newQty = $ucart['quantity'][$i];\n\t\t\t//set the new quantity\n\t\t\t$_SESSION['cart'][$item] = $newQty;\n\t\t}\n\t}",
"public function update(): void\n {\n // Update quality\n if ($this->item->sell_in > 10) {\n $this->item->quality++;\n }\n\n if ($this->item->sell_in <= 10 && $this->item->sell_in > 5) {\n $this->item->quality += 2;\n }\n\n if ($this->item->sell_in <= 5 && $this->item->sell_in > 0) {\n $this->item->quality += 3;\n }\n\n // Update Sell in\n $this->updateSellIn();\n\n if ($this->item->sell_in < 0) {\n $this->item->quality = 0;\n }\n\n $this->checkAndUpdateQualityByRange();\n }",
"public function updateQuality()\n {\n foreach ($this->items as $item) {\n if ($item->name != 'Aged Brie' and $item->name != 'Backstage passes to a TAFKAL80ETC concert') {\n if ($item->quality > 0) {\n if ($item->name != 'Sulfuras, Hand of Ragnaros') {\n $item->quality = $item->quality - 1;\n }\n }\n } else {\n if ($item->quality < 50) {\n $item->quality = $item->quality + 1;\n if ($item->name == 'Backstage passes to a TAFKAL80ETC concert') {\n if ($item->sellIn < 11) {\n if ($item->quality < 50) {\n $item->quality = $item->quality + 1;\n }\n }\n if ($item->sellIn < 6) {\n if ($item->quality < 50) {\n $item->quality = $item->quality + 1;\n }\n }\n }\n }\n }\n \n if ($item->name != 'Sulfuras, Hand of Ragnaros') {\n $item->sellIn = $item->sellIn - 1;\n }\n \n if ($item->sellIn < 0) {\n if ($item->name != 'Aged Brie') {\n if ($item->name != 'Backstage passes to a TAFKAL80ETC concert') {\n if ($item->quality > 0) {\n if ($item->name != 'Sulfuras, Hand of Ragnaros') {\n $item->quality = $item->quality - 1;\n }\n }\n } else {\n $item->quality = $item->quality - $item->quality;\n }\n } else {\n if ($item->quality < 50) {\n $item->quality = $item->quality + 1;\n }\n }\n }\n }\n }",
"public function updateSellIn(): void\n {\n $this->getItem()->sell_in--;\n }",
"private function updateQty($object)\n\t{\n\t\t$common = new Qss_Model_Extra_Extra();\n $MaLenhSX = @(string)$object->getFieldByCode('MaLenhSX')->szValue;\n $mSanXuat = Qss_Model_Db::Table('OSanXuat');\n $mSanXuat->where(sprintf(' MaLenhSX = \"%1$s\"', $MaLenhSX));\n $oSanXuat = $mSanXuat->fetchOne();\n//\t\t$ThaoDo = @(int)$common->getDataset(array('module'=>'OSanXuat'\n//\t\t\t\t\t, 'where'=>array('MaLenhSX'=>$MaLenhSX), 'return'=>1))->ThaoDo;\n $ThaoDo = @(int)$oSanXuat->ThaoDo;\n\n\t\tif($ThaoDo == 1)\n\t\t{\n\t\t\t// Neu thao do, set so luong ve disabled\n\t\t\t// Cong don so luong phu pham, hoac set ve 0 neu khong co phu pham\n//\t\t\t$PhuPham = $common->getDataset(array('module'=>'OSanLuong'\n//\t\t\t\t\t\t, 'where'=>array('IFID_M717'=>$object->i_IFID)));\n $mPhuPham = Qss_Model_Db::Table('OSanLuong');\n $mPhuPham->where(sprintf('IFID_M717 = %1$d', $object->i_IFID));\n\n\t\t\t$SoLuongPhuPham = 0;\n\t\t\t$insert = array();\n\t\t\t\n\t\t\tforeach($mPhuPham->fetchAll() as $p)\n\t\t\t{\n\t\t\t\t$SoLuongPhuPham += $p->SoLuong;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$insert['OThongKeSanLuong'][0]['SoLuong'] = $SoLuongPhuPham;\n\t\t\t\n\t\t\t$service = $this->services->Form->Manual('M717',$object->i_IFID,$insert,false);\n\t\t\tif($service->isError())\n\t\t\t{\n\t\t\t\t$this->setError();\n\t\t\t\t$this->setMessage($service->getMessage(Qss_Service_Abstract::TYPE_TEXT));\n\t\t\t}\n\t\t}\n\t}",
"public function takeFromStock($quantity = 1) {\n $this->leftInStock = $this->leftInStock - $quantity;\n $this->save();\n }",
"public function hookActionUpdateQuantity($params)\n\t{\n\t\t$context = Context::getContext();\n $id_shop = (int)$context->shop->id;\n $id_lang = (int)$context->language->id;\n\n $shop_name = strval(Configuration::get('PS_SHOP_NAME'));\n $shop_email = strval(Configuration::get('PS_SHOP_EMAIL'));\n $id_product = (int)$params['id_product'];\n $id_product_attribute = (int)$params['id_product_attribute'];\n $product_name = Product::getProductName($id_product, $id_product_attribute, $id_lang);\n $quantity = (int)$params['quantity'];\n\n // Prepares the variables used in the email template\n $templateVars = array(\n \t\t'{shop_name}' => $shop_name,\n \t\t'{shop_email}' => $shop_email,\n \t\t'{id_product}' => $id_product,\n \t\t'{product_name}' => $product_name,\n \t\t'{quantity}' => $quantity\n );\n\n // Checks if the module is on \n if(!Configuration::get('MYMOD_EMAILS') == false)\n {\t\n \t// Sends the email notification to '$shop_email'\n\t\t\tMail::send($id_lang,\n\t\t 'stock_notification',\n\t\t 'Stock Update',\n\t\t $templateVars,\n\t\t $shop_email,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t null,\n\t\t 'mails/'\n\t\t );\n\t\t}\n\t}",
"public function updateStock()\n {\n// foreach($this->detalle_compras as $detalle)\n// {\n// $producto= Producto::model()->findByPk($detalle->producto);\n// $producto->stock+=$detalle->cantidad;\n// $producto->save();\n// }\n }",
"public function updateSellIn() {\n $this->sellIn -= 1;\n }",
"public function updateSellIn() {\n $this->sellIn -= 1;\n }",
"public function setFabricQuantity($quantity) {\r\n \r\n $this->quantity = intVal(100*$quantity);\r\n }",
"private function updateOnHandInventory($onHand) {\n $origQty = $this->itemRecord['Item']['quantity'];\n $this->itemRecord['Item']['quantity'] = $onHand;\n//\t\t$customerUserId = $this->discoverCustomerUserId($this->itemRecord['Item']['id']);\n//\t\t$this->ddd($this->itemRecord, 'Item.itemRecord property');\n if($this->Item->save($this->itemRecord)){\n\t\t\t\n\t\t\t$this->Log->create('override');\n\t\t\t$this->Log\n\t\t\t\t->set('customer', $this->Item->discoverCustomerUserId($this->itemRecord['Item']['id']))\n\t\t\t\t->set('id', $this->itemRecord['Item']['id'])\n\t\t\t\t->set('name', $this->itemRecord['Item']['name'])\n\t\t\t\t->set('from', $origQty)\n\t\t\t\t->set('to', $onHand)\n\t\t\t\t->set('change', $onHand - $origQty)\n\t\t\t\t->set('number', 'OVERRIDE')\n\t\t\t\t->set('by', $this->Item->OrderItem->Order->User->discoverName($this->Auth->user('id')));\n\t\t\t$this->Log->toString();\n\t\t\tCakeLog::write('inventory', $this->Log->logLineOut);\n// CakeLog::write('inventory', \"[$customerUserId] ON HAND INVENTORY OVERRIDE FOR id:$itemId::$itemName from $origQty to $onHand by \" . $this->Item->OrderItem->Order->User->discoverName($this->Auth->user('id')));\t\t\t\n\n\t\t\t$success = true;\n } else {\n $this->error = 'On Hand value update failed, please try again.';\n $success = false;\n }\n return $success;\n }",
"abstract public function getOriginalQty();",
"public function setQuantity(int $quantity)\n {\n $this->quantity = $quantity;\n }",
"public function updateStockMovement($item_id, $quantity,$oldquantity){\n $this->insertStockMovement($item_id, $quantity, false, $oldquantity);\n }",
"public function setQuantity($value)\n {\n $this->quantity = $value;\n $this->recalculatePriceTotal();\n }",
"public function tick()\n {\n $this->sellIn -= 1;\n $this->quality -= 1;\n\n if ($this->sellIn <= 0) {\n $this->quality -= 1;\n }\n\n if ($this->quality <= 0) {\n $this->quality = 0;\n }\n }"
]
| [
"0.61122936",
"0.59403425",
"0.59291184",
"0.59126085",
"0.5837994",
"0.5827254",
"0.5805291",
"0.57805",
"0.5741795",
"0.57363844",
"0.5734336",
"0.57133806",
"0.5699033",
"0.56919175",
"0.5676395",
"0.56224227",
"0.5614042",
"0.561234",
"0.5546223",
"0.55439454",
"0.5515093",
"0.55122083",
"0.55122083",
"0.54703635",
"0.54660803",
"0.5462252",
"0.54155266",
"0.5413577",
"0.5413544",
"0.54099226"
]
| 0.6616988 | 0 |
This function finds the snow id with the snow code | function getSnowId($code){
$getUserTypeQuery = "SELECT id From snows WHERE code='".$code."'";
require_once 'model/dbConnector.php';
$queryResult = executeQuerySelect($getUserTypeQuery);
return $queryResult[0]['id'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findID($d) {\n\t\t$url = \"https://inpho.cogs.indiana.edu/thinker.json\";\n\t\t$data = @file_get_contents($url,o,null,null);\n\t\t$json = json_decode($data);\n\t\t$results = $json->responseData->results;\n\t\tforeach($results as $value) {\n\t\t\tif (strcasecmp($value->label,$d)==0) { \n\t\t\t\t$id = $value->ID;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//return value of $id when string matches\n\t\treturn $id;\n\t}",
"function getASnow($snow_code){\n $strgSeparator = '\\'';\n\n // Query to get the selected snow. The active code must be set to 1 to display only snows to display. It avoids possibilty to user selecting a wrong code (get paramater in url)\n $snowQuery = 'SELECT code, brand, model, snowLength, dailyPrice, qtyAvailable, description, photo FROM snows WHERE code='.$strgSeparator.$snow_code.$strgSeparator.'AND active=1';\n\n require_once 'model/dbConnector.php';\n $snowResults = executeQuerySelect($snowQuery);\n\n return $snowResults;\n}",
"function getSCID() {\n $svnid = '$Rev$';\n $scid = substr($svnid, 6);\n return intval(substr($scid, 0, strlen($scid) - 2));\n}",
"function getSocID($soc_name){\n global $con;\n $query=\"select id from societies where name='$soc_name'\";\n $result=mysqli_query($con,$query);\n if(!$result)\n {\n print \"getSocID query failed\";\n }\n $socID = mysqli_fetch_assoc($result)[id];\n $result->close();\n return $socID;\n }",
"public function getColorCodeId($name){\n\t\t$sql = \"select id from sy_color_codes where name=?\";\n\t\t$SyColorCode = $this->runRequest($sql, array($name));\n\t\tif ($SyColorCode->rowCount() == 1){\n\t\t\t$tmp = $SyColorCode->fetch();\n\t\t\treturn $tmp[0]; // get the first line of the result\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Cannot find the SyColorCode using the given name\");\n\t\t}\n\t}",
"function getID($sek_title)\r\n {\r\n $log = FezLog::get();\r\n $db = DB_API::get();\r\n\r\n static $returns;\r\n if (!empty($returns[$sek_title])) {\r\n return $returns[$sek_title];\r\n }\r\n $stmt = \"SELECT\r\n sek_id\r\n FROM\r\n \" . APP_TABLE_PREFIX . \"search_key\r\n WHERE\r\n sek_title=\" . $db->quote($sek_title);\r\n try {\r\n $res = $db->fetchOne($stmt);\r\n }\r\n catch (Exception $ex) {\r\n $log->err($ex);\r\n return '';\r\n }\r\n $returns[$sek_title] = $res;\r\n return $res;\r\n }",
"function rawpheno_function_getstockid($stock_name, $project_name) {\n // Calling all modules implementing hook_rawpheno_AGILE_stock_name_alter():\n drupal_alter('rawpheno_AGILE_stock_name', $stock_name, $project_name);\n\n // Limit the search to project organism.\n $result = chado_query(\n \"SELECT stock_id FROM {stock} WHERE name = :name LIMIT 1\",\n array(':name' => $stock_name)\n );\n\n return ($result) ? $result->fetchField() : 0;\n}",
"public function fcpoGetIdByCode($sCode) \n {\n $sQuery = \"SELECT oxid FROM oxcountry WHERE oxisoalpha2 = \" . oxDb::getDb()->quote($sCode);\n return $this->_oFcpoDb->GetOne($sQuery);\n }",
"public function getcode() {\n\t\t$this -> db -> select('id');\n\t\t$this -> db -> from('store_info');\n\t\t$this -> db -> limit(1);\n\t\t$this -> db -> order_by(\"id\", \"desc\");\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n $row = $query->row();\n\t\t\tif (isset($row)){\n\t\t\t\treturn $row->id;\n\t\t\t}\n }else{\n\t\t\treturn 0;\n\t\t}\n \t}",
"function getFarmersMSCID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud -> sql(\"SELECT * FROM pigs_tbl WHERE pig_id='{$id}' \");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['farmer_id_fk'];\n\t}\n\t$crud->disconnect();\n}",
"function code_getcodeID($bdd, $code_text)\n\t{\n\t\techo_debug(\"CODE getcodeID | Start<br>\");\n\t\ttry\n\t\t{ \n\t\t\t$response = $bdd->prepare('SELECT id FROM code where text =:tt');\n\t\t\t$response->execute(array(\n\t\t\t\t'tt' => $code_text\n\t\t\t));\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tdie('Error : '.$e->getMessage());\n\t\t}\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$nb_rows = $response->rowCount();\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\t$nb_rows = 0;\n\t\t}\n\t\t\n\t\t$codeID=0;\n\t\tif($nb_rows > 0)\n\t\t{\t\n\t\t\tif($nb_rows > 0)\n\t\t\t{\n\t\t\t\twhile ($data = $response->fetch())\n\t\t\t\t{\n\t\t\t\t\t$codeID = $data['id'];\n\t\t\t\t}\n\t\t\t}\n\t\t\techo_debug(\"CODE getcodeID | End with CodeId=\".$codeID.\"<br>\");\n\t\t\treturn $codeID;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo_debug(\"CODE getcodeID | End - No Code found<br>\");\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function getseo_name($id){\n $seoqry = DB::table('venue_master')\n ->where('creater_id',$id)\n ->select('*')\n ->first();\n return $seoqry->id;\n }",
"public function lookupCid($src);",
"public function lookupCid($src) {}",
"public function lookupCid($src) {}",
"function v1_get_id_insarpixel($dd_sar_id, $number) {\n\t\n\t// If parameters are empty\n\tif (empty($dd_sar_id) || empty($number)) {\n\t\treturn NULL;\n\t}\n\t\n\t// Connect to DB\n\tinclude \"php/include/db_connect.php\";\n\t\n\t// Create SQL query\n\t$sql=\"SELECT dd_srd_id FROM dd_srd WHERE dd_sar_id='\".mysql_real_escape_string($dd_sar_id).\"' AND dd_srd_numb='\".mysql_real_escape_string($number).\"'\";\n\t\n\t// Query DB\n\t$result=mysql_query($sql) or die(mysql_error());\n\t\n\t// Get result\n\t$row=mysql_fetch_array($result);\n\t\n\treturn $row['dd_srd_id'];\n\t\n}",
"function v1_get_code($gen_stations) {\n\n\t// Connect to DB\n\tinclude \"php/include/db_connect.php\";\n\t\n\t$sql=\"select ss.ss_stime,ss.ss_etime from ss where ss.ss_name='{$gen_stations[0]}'\";\n\n\t$result = mysql_query($sql, $link);\n\t$row= mysql_fetch_array($result);\n\treturn $row;\n}",
"abstract public function getIdent();",
"function getEarnotchID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from pigs_tbl where pig_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['earnotch'];\n\n\t}\n\t$crud->disconnect();\n}",
"public function getId(): Snowflake\n {\n return $this->id;\n }",
"public function getId(): Snowflake\n {\n return $this->id;\n }",
"public function getId(): Snowflake\n {\n return $this->id;\n }",
"public function fetch_the_id() {}",
"function GetSwarmID($swarmname) \n \t{\n\t\t$sql =\"SELECT `swarm_id`,`url_code`\n\t\t FROM `swarm`\n\t\t WHERE `url_code` = '$swarmname'\n\t\t LIMIT 0 , 30\";\n\t\t$result = mysql_query($sql) or die(mysql_ERROR());\n\t\t$num_rows = mysql_num_rows($result);\n\t\tif($num_rows > 0 ) {\n\t\t while($row = mysql_fetch_object($result))\n\t\t {\n\t\t \treturn $row->swarm_id;\n\t\t } \t\n\t\t}\n\t\telse {\n\t\t return 0;\n \t \t}\n\t}",
"function game_snakes_foundsnake( $position, $data)\r\n{\r\n\tpreg_match( \"/S([0-9]*)-$position,/\", $data.',', $matches);\r\n\t\r\n\tif( count( $matches)){\r\n\t\treturn $matches[ 1];\r\n\t}\r\n\t\r\n\treturn 0;\t\r\n}",
"function get_song_id($imgSrc, $previewTrackName, $previewArtistName) {\n global $link;\n $sql = sprintf('select id \n from songs\n where img like \"%%%s%%\" and name like \"%%%s%%\" and artist like \"%%%s%%\"\n limit 1\n ',$imgSrc,$previewTrackName,$previewArtistName);\n \n $result = mysqli_query($link,$sql);\n $row = mysqli_fetch_array($result);\n return $row[0];\n}",
"function getSoId($so_name)\n\t{\n\t\tglobal $log;\n $log->info(\"in getSoId \".$so_name);\n\t\tglobal $adb;\n\t\tif($so_name != '')\n\t\t{\n\t\t\t$sql = \"select salesorderid from ec_salesorder where subject='\".$so_name.\"'\";\n\t\t\t$result = $adb->query($sql);\n\t\t\t$so_id = $adb->query_result($result,0,\"salesorderid\");\n\t\t}\n\t\treturn $so_id;\n\t}",
"function getDrugId($code){\n $request = \"SELECT * FROM DRUG WHERE bar_code = ? OR flash_code = ?;\";\n $param = array('1' => array($code, PDO::PARAM_STR), '2' => array($code, PDO::PARAM_STR));\n DBConnexion::getInstance()->prepareAndExecuterQuerySelect($request, $param);\n $response = DBConnexion::getInstance()->getResult();\n\n if(count($response)>0){\n $id = $response[0]['id'];\n } else {\n $id = -1;\n }\n\n DBConnexion::getInstance()->destroyQueryResults();\n return $id;\n }",
"static function getIdOf ($name)\n {\n return array_search ($name, self::$NAMES);\n }",
"function getIdentifier();"
]
| [
"0.63657147",
"0.6177107",
"0.58232033",
"0.58007807",
"0.57927895",
"0.573154",
"0.5675064",
"0.56492907",
"0.5636287",
"0.55926216",
"0.55818355",
"0.5530167",
"0.5524259",
"0.5499388",
"0.54962623",
"0.5493069",
"0.54800016",
"0.5473611",
"0.5455086",
"0.5440342",
"0.5440342",
"0.5440342",
"0.5431722",
"0.5431019",
"0.5412806",
"0.5408837",
"0.54073066",
"0.5382972",
"0.5368237",
"0.5335962"
]
| 0.7268875 | 0 |
Search ecosafety for a location. Choreos used in this method: Additionally, the GoodCitizen choreos themselves use the following choreos: | public function searchSafety($subject) {
if(strtolower($subject) == 'here' || $subject == '') {
if($this->_latitude && $this->_longitude) {
// Technically we could pass these straight to EnviroFacts, but Geocoding will get us a nice place name.
$subject = $this->_latitude . ',' . $this->_longitude;
} else {
return $this->say($this->foundNone() . ' safety information for wherever it is that you are.');
}
}
$name = $subject;
// If subject is not a zipcode, geocode it so we can search by lat/long...
if(!preg_match('/^[0-9]{5}$/', $subject)) {
// Instantiate the Choreo, using a previously instantiated Temboo_Session object
$geocodeByAddress = new Google_Geocoding_GeocodeByAddress($this->_tembooSession);
// Get an input object for the Choreo
$geocodeByAddressInputs = $geocodeByAddress->newInputs();
// Set inputs
$geocodeByAddressInputs->setAddress($subject);
// Execute Choreo and get results
$geocodeByAddressResults = $geocodeByAddress->execute($geocodeByAddressInputs)->getResults();
$response = simplexml_load_string($geocodeByAddressResults->getResponse());
if($response->status != 'OK') {
return $this->say($this->foundNone() . ' safety information for ' . $subject);
}
$latitude = (float) $response->result->geometry->location->lat;
$longitude = (float) $response->result->geometry->location->lng;
$name = $response->result->formatted_address;
if(strlen($name) > 80 && isset($response->result->address_component[0])) {
$name = $response->result->address_component[0]->short_name;
}
}
if($latitude && $longitude) {
// Use EcoByCoordinates for eco search choreo
$ecoChoreo = new Labs_GoodCitizen_EcoByCoordinates($this->_tembooSession);
// Get an input object for the Choreo
$ecoChoreoInputs = $ecoChoreo->newInputs();
// Set inputs
$ecoChoreoInputs->setLatitude($latitude)->setLongitude($longitude);
} else {
// Use EcoByZip for eco search choreo
$ecoChoreo = new Labs_GoodCitizen_EcoByZip($this->_tembooSession);
// Get an input object for the Choreo
$ecoChoreoInputs = $ecoChoreo->newInputs();
// Set inputs
$ecoChoreoInputs->setZip($subject);
}
// Execute Choreo and get results
$ecoChoreoResults = $ecoChoreo->execute($ecoChoreoInputs)->getResults();
$response = json_decode($ecoChoreoResults->getResponse());
return $this->renderSafetyResult($name, $response);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function detectLocation()\n {\n global $reefless, $config, $rlValid, $rlDb, $page_info;\n\n if ($this->geo_filter_data['applied_location']) {\n return false;\n }\n\n if ($reefless->isBot()\n || $_GET['q'] == 'ext'\n || $_POST['xjxfun']\n || !$config['mf_geo_autodetect']\n || isset($_GET['reset_location'])\n || $_COOKIE['mf_geo_location'] == 'reset'\n || $this->detailsPage\n || strtoupper($_SERVER['REQUEST_METHOD']) == 'POST'\n ) {\n return false;\n }\n\n $names = array();\n\n if ($_SESSION['GEOLocationData']->Country_name) {\n $names[] = $_SESSION['GEOLocationData']->Country_name;\n }\n if ($_SESSION['GEOLocationData']->Region) {\n $names[] = $_SESSION['GEOLocationData']->Region;\n }\n if ($_SESSION['GEOLocationData']->City) {\n $names[] = $_SESSION['GEOLocationData']->City;\n }\n\n $parent_key = $this->geo_format['Key'];\n\n foreach ($names as $name) {\n Valid::escape($name);\n\n $sql = \"SELECT `Key` \";\n $sql .= \"FROM `{db_prefix}lang_keys` \";\n $sql .= \"WHERE `Value` = '{$name}' \";\n $sql .= \"AND SUBSTRING(`Key`, 19, '\" . strlen($parent_key) . \"') = '{$parent_key}' \";\n $sql .= \"ORDER BY CHAR_LENGTH(`Key`) ASC \";\n $sql .= \"LIMIT 1\";\n\n $location = $rlDb->getRow($sql);\n\n if ($location) {\n $parent_key = $location['Key'] = str_replace('data_formats+name+', '', $location['Key']);\n $locations[] = $location;\n } else {\n break;\n }\n }\n\n if ($locations) {\n $locations = array_reverse($locations);\n $location_to_apply = $rlDb->fetch('*', array('Key' => $locations[0]['Key'], 'Status' => 'active'), null, null, 'data_formats', 'row');\n\n // Save automatically detected location for 12 hours\n $reefless->createCookie('mf_geo_location', $location_to_apply['Key'], strtotime('+ 12 hours'));\n\n if (!$location_to_apply) {\n return false;\n }\n\n if ($this->geo_filter_data['is_location_url'] && $location_to_apply['Path']) {\n $redirect_url = $this->buildGeoLink($location_to_apply, $this->clean_url, true);\n\n // Redirect using default header function to avoid utilsRedirectURL hook call\n header(\"Location: {$redirect_url}\", true, 301);\n exit;\n } else {\n $_SESSION['geo_filter_location'] = $location_to_apply;\n header('Refresh: 0');\n exit;\n }\n }\n }",
"private function getLocation() {\n $location = false;\n \t$result = new StdClass();\n \t// $result->location = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->nearest = 'http://www.geoplugin.net/extras/location.gp?lat=' . $this->coordinates->latitude . '&long=' . $this->coordinates->longitude . '&format=php';\n \t$result->location = 'http://maps.googleapis.com/maps/api/geocode/json?latlng=' . $this->coordinates->latitude . ',' . $this->coordinates->longitude . '&sensor=false';\n\n \t$result = json_decode($this->getUrlContents($result->location));\n \t// $result->nearest = unserialize($this->getUrlContents($result->nearest));\n\n $location = $this->validateLocation($result);\n\n if(is_array($location))\n \t $location = $this->filterLocation($location);\n }",
"function locations_search($lat, $lon, $connection, $start = 0)\n{\n\t$db_selected = mysql_select_db(Secure::DB_DATABASE, $connection);\n\t$sql = \"select organization_location.address , organization_location.city , organization_location.state , organization_location.zip , organization_location.latitude , organization_location.longitude from organization_location where latitude <= {$lat} + 0.1 and latitude >= {$lat} - 0.1 and longitude <= {$lon} + 0.1 and longitude >= {$lon} - 0.1 and remove_approved = 0\";\n\t$sql = $sql.\" limit {$start},\".LIMIT;\n\tif(!($resource = @ mysql_query($sql, $connection)))\n\t\tshowerror();\n\t\t//echo $sql;\n\telse\n\t\treturn $resource;\n}",
"function clsRecordCPE_LOCATIONSearch($RelativePath, & $Parent)\r\n {\r\n\r\n global $FileName;\r\n global $CCSLocales;\r\n global $DefaultDateFormat;\r\n $this->Visible = true;\r\n $this->Parent = & $Parent;\r\n $this->RelativePath = $RelativePath;\r\n $this->Errors = new clsErrors();\r\n $this->ErrorBlock = \"Record CPE_LOCATIONSearch/Error\";\r\n $this->ReadAllowed = true;\r\n if($this->Visible)\r\n {\r\n $this->ComponentName = \"CPE_LOCATIONSearch\";\r\n $this->Attributes = new clsAttributes($this->ComponentName . \":\");\r\n $CCSForm = explode(\":\", CCGetFromGet(\"ccsForm\", \"\"), 2);\r\n if(sizeof($CCSForm) == 1)\r\n $CCSForm[1] = \"\";\r\n list($FormName, $FormMethod) = $CCSForm;\r\n $this->FormEnctype = \"application/x-www-form-urlencoded\";\r\n $this->FormSubmitted = ($FormName == $this->ComponentName);\r\n $Method = $this->FormSubmitted ? ccsPost : ccsGet;\r\n $this->s_keyword = & new clsControl(ccsTextBox, \"s_keyword\", \"s_keyword\", ccsText, \"\", CCGetRequestParam(\"s_keyword\", $Method, NULL), $this);\r\n $this->Button_DoSearch = & new clsButton(\"Button_DoSearch\", $Method, $this);\r\n }\r\n }",
"public function find_location($longitude, $latitude,$app = 'No') {\n\t\tif($app=='No'){\n\t\t\t$option = array(\"loc\" => array('$geoIntersects' => array('$geometry' => array(\"type\"=>\"Point\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"coordinates\"=>array($longitude,$latitude)\n\t\t\t\t\t\t\t\t\t\t\t\t\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\t\t\t\t\t\t\t\t)\n\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);\n\t\t}else{\n\t\t\t$option = array(\"status\"=>\"Active\",\n\t\t\t\t\t\t\t\t\t\"loc\" => array('$geoIntersects' => array('$geometry' => array(\"type\"=>\"Point\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"coordinates\"=>array($longitude,$latitude)\n\t\t\t\t\t\t\t\t\t\t\t\t\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\t\t\t\t\t\t\t\t)\n\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\n\t\t}\n \n \n $this->mongo_db->where($option);\n $res = $this->mongo_db->get(LOCATIONS);\n \n\t\t$return['result'] = array();\n\t\tif($res->num_rows()>0){\n\t\t\t$return['result'] = $res->result_array();\n\t\t}\n return $return;\n }",
"public static function search($location, $nrOfGuests, $start_date = 0, $end_date = 0, $min_price = 0, $max_price = 0, $type_array = null, $type_array_sum = 0) {\n\t\t$db = Database::get();\n\n\t\t$sql = 'SELECT * FROM ' . self::$CLASS_TABLE .\n\t\t\t' WHERE location LIKE \\'' . (string)$location . '\\' AND number_of_guests >= ' . (int)$nrOfGuests;\n\n\n\t\tif ($type_array_sum) {\n\t\t\t$sql .= ' AND (';\n\t\t\tforeach ($type_array as $type) {\n\t\t\t\tif ($type->value) {\n\t\t\t\t\t$sql .= ' type = ' . (int)$type->value . ' OR ';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sql = substr($sql, 0, strlen($sql) - 3);\n\t\t\t$sql .= ' )';\n\t\t}\n\n\t\t$result = $db->query($sql);\n\t\t$found_accommodations = array();\n\n\t\tif ($result->num_rows) {\n\t\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t\t$current_accommodation = self::loadCustomObject($row);\n\n\t\t\t\tif ($start_date && $end_date && $current_accommodation->isBooked($start_date, $end_date)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$days_between = ($start_date && $end_date) ? ceil(abs(strtotime($end_date) - strtotime($start_date)) / 86400) : 0;\n\t\t\t\t$current_accommodation->total_price = ($days_between ? $days_between : 1) * $current_accommodation->getPricePerNight();\n\t\t\t\t$current_accommodation->type_name = self::$TYPE_NAMES[$current_accommodation->getType() - 1];\n\n\t\t\t\tif ($min_price && $max_price && ($current_accommodation->total_price > $max_price || $current_accommodation->total_price < $min_price)) {\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\t\t\t\tarray_push($found_accommodations, $current_accommodation);\n\t\t\t}\n\t\t}\n\n\t\treturn $found_accommodations;\n\t}",
"public function actionLocation() {\n $term = trim($_GET['term']);\n $bGeonames = (isset($_GET['geonames'])) ? true : false;\n $results = array();\n $geonamesUrl = \"http://api.geonames.org/searchJSON?maxRows=10&lang=de&username=wkoller&style=medium\";\n\n if ($bGeonames) {\n // Construct service URL\n $geonamesUrl = $geonamesUrl . \"&q=\" . urlencode($term);\n // Fetch service response\n $service_response = file_get_contents($geonamesUrl);\n if ($service_response) {\n // Decode data\n $service_data = json_decode($service_response, true);\n\n // Save response data in location table\n foreach ($service_data['geonames'] as $geoname) {\n // Check if we already have any entry\n $model_location = null;\n $model_locationGeonames = LocationGeonames::model()->find('geonameId=:geonameId', array(':geonameId' => $geoname['geonameId']));\n if ($model_locationGeonames != null) {\n $model_location = Location::model()->findByPk($model_locationGeonames->id);\n\n // update model with new location description\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n } else {\n // Create location model & save it\n $model_location = new Location;\n $model_location->location = $geoname['name'] . ' (' . $geoname['adminName1'] . ', ' . $geoname['countryName'] . ')';\n $model_location->save();\n // Create according geonames model & save it as well\n $model_locationGeonames = new LocationGeonames;\n $model_locationGeonames->id = $model_location->id;\n $model_locationGeonames->service_data = serialize($geoname);\n $model_locationGeonames->geonameId = $geoname['geonameId'];\n $model_locationGeonames->countryCode = $geoname['countryCode'];\n $model_locationGeonames->save();\n }\n\n // Add response to results\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n \"countryCode\" => $model_locationGeonames->countryCode\n );\n }\n }\n } else {\n // Find all fitting entries in location table\n $models_location = Location::model()->findAll('location LIKE :location', array(':location' => $term . '%'));\n if ($models_location != NULL) {\n foreach ($models_location as $model_location) {\n $results[] = array(\n \"label\" => $model_location->location,\n \"value\" => $model_location->location,\n \"id\" => $model_location->id,\n );\n }\n }\n }\n\n // Output results as service response\n $this->serviceOutput($results);\n }",
"public function search() {\n try {\n if (!($this->potential instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_Potential)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" Potential Entity not intialized\");\n } else {\n $objPotential = new Base_Model_ObtorLib_App_Core_Crm_Dao_Potential();\n $objPotential->potential = $this->potential;\n return $objPotential->search();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception($ex);\n }\n }",
"public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }",
"public function actionProximitycatlist($latitude, $longitude, $radius, $kind)\n {\n \n // clean term\n //$term = str_replace(',', '', $term);\n //$term = str_replace(' ', '', $term);\n //$term = str_replace(' ', '', $term);\n\t\n\t$url = \"http://ec2-54-204-2-189.compute-1.amazonaws.com/api/nearby\";\n\t$params = array('latitude' => $latitude, 'longitude' => $longitude, 'radius' => $radius, 'kind' => $kind);\n\t// Update URL to container Query String of Paramaters \n\t$url .= '?' . http_build_query($params);\n\t\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL, $url);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t$json = curl_exec($curl);\n\tcurl_close($curl);\n\t\t\n\t$return_array = json_decode($json);\n\t\t\n $location_service_rows = array(); \n \n\tif ($return_array) {\n $location_service_rows = $return_array->message->rows;\n\t}\n\t\t\n // Did we get some results?\n if(empty($location_service_rows)) {\n // No\n $this->_sendResponse(200, \n sprintf('No items where found.') );\n } else {\n // Prepare response\n $rows = array();\n foreach($location_service_rows as $row) {\n $id = $row->id;\n $name = $row->name;\n $address = $row->address->address;\n $address_extended = $row->address->address_extended;\n $po_box = $row->address->po_box;\n $locality = $row->address->locality;\n $region = $row->address->region;\n $post_town = $row->address->post_town;\n $admin_region = $row->address->admin_region;\n $postcode = $row->address->postcode;\n $country = $row->address->country;\n $tel = $row->address->tel;\n $fax = $row->address->fax;\n $neighbourhood = $row->address->neighbourhood;\n $website = $row->website;\n $email = $row->email;\n $category_ids = $row->category_ids;\n\t\t$category_labels = $row->category_labels;\n $status = $row->status;\n $chain_name = $row->chain_name;\n $chain_id = $row->chain_id;\n $row_longitude = $row->longitude;\n $row_latitude = $row->latitude;\n $abslongitude = $row->abslongitude;\n $abslatitude = $row->abslatitude;\n $distance = $row->distance;\n \n \n //$terms_array = explode(' ',$terms);\n //$match_count = 0;\n //foreach ($terms_array as $term) {\n //if(stripos($name, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n //if(stripos($category_labels, $term) !== false) {\n //$match_count = $match_count + 1;\n //}\n $match_count = 1;\n //}\n //$term_match_count = array('term_match_count' => $match_count);\n //array_push($row, $term_match_count);\n //$row['term_match_count'] = $match_count;\n $new_row = array(\n 'id' => $id,\n 'name' => $name,\n 'address' => $address,\n 'address_extended' => $address_extended,\n 'po_box' => $po_box,\n 'locality' => $locality,\n 'region' => $region,\n 'post_town' => $post_town,\n 'admin_region' => $admin_region,\n 'postcode' => $postcode,\n 'country' => $country,\n 'tel' => $tel,\n 'fax' => $fax,\n 'neighbourhood' => $neighbourhood,\n 'website' => $website,\n 'email' => $email,\n 'category_ids' => $category_ids,\n 'category_labels' => $category_labels,\n 'status' => $status,\n 'chain_name' => $chain_name,\n 'chain_id' => $chain_id,\n 'longitude' => $row_longitude,\n 'latitude' => $row_latitude,\n 'abslongitude' => $abslongitude,\n 'abslatitude' => $abslatitude,\n 'distance' => $distance,\n 'term_match_count' => $match_count\n );\n //if ($match_count > 0) {\n $rows[] = $new_row;\n //}\n } // end foreach location service row\n // Send the response\n $this->_sendResponse(200, CJSON::encode($rows));\n }\n }",
"public function equipementlocationListerTous()\n\t{\n\t\t// votre code ici\n\t\treturn Gestion::lister(\"EquipementLocation\");//type array\n\t}",
"public function the_locations() {\n\n // Verify if locations exists\n if ( self::$the_locations ) {\n\n // Set all locations\n return self::$the_locations;\n\n } else {\n\n return false;\n\n }\n\n }",
"function get_location( $args = array() ) {\n\t$throttle_geonames = $throttle_ip2location = $location = false;\n\n\t// For a country request, no lat/long are returned.\n\tif ( isset( $args['country'] ) ) {\n\t\t$location = array(\n\t\t\t'country' => $args['country'],\n\t\t);\n\t}\n\n\t// Coordinates provided\n\tif (\n\t\t! $location && (\n\t\t\t! empty( $args['latitude'] ) && is_numeric( $args['latitude'] ) &&\n\t\t\t! empty( $args['longitude'] ) && is_numeric( $args['longitude'] )\n\t\t)\n\t) {\n\t\t$location = array(\n\t\t\t'description' => false,\n\t\t\t'latitude' => $args['latitude'],\n\t\t\t'longitude' => $args['longitude'],\n\t\t);\n\t}\n\n\t// City was provided by the user:\n\tif ( ! $location && isset( $args['location_name'] ) ) {\n\t\t$throttle_geonames = mt_rand( 1, 100 ) <= THROTTLE_GEONAMES;\n\n\t\tif ( $throttle_geonames ) {\n\t\t\treturn 'temp-request-throttled';\n\t\t}\n\n\t\t$country_code = get_country_code_from_locale( $args['locale'] ?? '' );\n\t\t$guess = guess_location_from_city( $args['location_name'], $args['timezone'] ?? '', $country_code );\n\n\t\t$country_types = array(\n\t\t\t// See http://download.geonames.org/export/dump/featureCodes_en.txt\n\n\t\t\t'A.PCL', // political entity\n\t\t\t'A.PCLD', // dependent political entity\n\t\t\t'A.PCLF', // freely associated state\n\t\t\t'A.PCLH', // historical political entity\ta former political entity\n\t\t\t'A.PCLI', // independent political entity\n\t\t\t'A.PCLIX', // section of independent political entity\n\t\t\t'A.PCLS', // semi-independent political entity\n\t\t\t'A.PRSH', // parish an ecclesiastical district\n\t\t\t'A.TERR', // territory\n\t\t\t'A.ZN', // zone\n\t\t);\n\n\t\tif ( $guess && in_array( $guess->type, $country_types, true ) ) {\n\t\t\t$location = array(\n\t\t\t\t'country' => $guess->country,\n\t\t\t\t'description' => $guess->name,\n\t\t\t);\n\t\t} elseif ( $guess ) {\n\t\t\t$location = array(\n\t\t\t\t'description' => $guess->name,\n\t\t\t\t'latitude' => $guess->latitude,\n\t\t\t\t'longitude' => $guess->longitude,\n\t\t\t\t'country' => $guess->country,\n\t\t\t);\n\t\t} else {\n\t\t\t$guess = guess_location_from_country( $args['location_name'] );\n\n\t\t\tif ( $guess ) {\n\t\t\t\t$location = array(\n\t\t\t\t\t'country' => $guess['country_short'],\n\t\t\t\t\t'description' => $guess['country_long'],\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( ! $location ) {\n\t\tif ( isset( $args['location_name'] ) || isset( $args['ip'] ) || ! empty( $args['latitude'] ) || ! empty( $args['longitude'] ) ) {\n\t\t\t// If any of these are specified, and no localitity was guessed based on the above checks, bail with no location.\n\t\t\t$location = false;\n\t\t} else {\n\t\t\t// No specific location details.\n\t\t\t$location = array();\n\t\t}\n\t}\n\n\t// IP:\n\tif ( ! $location && isset( $args['ip'] ) && ! isset( $args['location_name'] ) ) {\n\t\t$throttle_ip2location = mt_rand( 1, 100 ) <= THROTTLE_IP2LOCATION;\n\n\t\tif ( $throttle_ip2location ) {\n\t\t\treturn 'temp-request-throttled';\n\t\t}\n\n\t\t$guess = guess_location_from_ip( $args['ip'] );\n\n\t\tif ( $guess ) {\n\t\t\t$location = array(\n\t\t\t\t'description' => $guess->ip_city,\n\t\t\t\t'latitude' => $guess->ip_latitude,\n\t\t\t\t'longitude' => $guess->ip_longitude,\n\t\t\t\t'country' => $guess->country_short,\n\n\t\t\t\t/*\n\t\t\t\t * ip2location's EULA forbids exposing the derived location publicly, so flag the\n\t\t\t\t * data for internal use only.\n\t\t\t\t */\n\t\t\t\t'internal' => true,\n\t\t\t);\n\t\t}\n\t}\n\n\treturn $location;\n}",
"public function searchLocations($location, $type = Horde_Service_Weather::SEARCHTYPE_STANDARD)\n {\n switch ($type) {\n case Horde_Service_Weather::SEARCHTYPE_STANDARD:\n return $this->_parseSearchLocations($this->_searchLocations(rawurlencode($location)));\n break;\n\n case Horde_Service_Weather::SEARCHTYPE_IP;\n return $this->_parseSearchLocations($this->_getLocationByIp(rawurlencode($location)));\n }\n }",
"public function byLocation(string $location);",
"public function indexAction() {\r\n\t\t\r\n\t\t$search_city = (isset($_COOKIE['search_city']) && $_COOKIE['search_city']!='')? $_COOKIE['search_city'] : '';\r\n\t\t$search_province = (isset($_COOKIE['search_province']) && $_COOKIE['search_province']!='')? $_COOKIE['search_province'] : '';\r\n\t\t//搜索定位逻辑:先查看是否有COOKIE,然后根据IP定位,然后再看用户的城市属性,最后是 直接定位到北京\r\n\t\tif(!$search_city)\r\n\t\t{\r\n\t\t\t$cityInfo =Better_Functions::getip2city();\r\n\t\t\t$search_province = $cityInfo['live_province'];\r\n\t\t\t$search_city = $cityInfo['live_city'];\r\n\t\t\tif($search_province=='未知' || $search_city=='未知'){\r\n\t\t\t\t$search_province = $this->userInfo['live_province'];\r\n\t\t\t\t$search_city = $this->userInfo['live_city'];\r\n\t\t\t}\t\r\n\t\t\tif($search_province=='未知' || $search_city=='未知'){\r\n\t\t\t\t$search_province = '北京市';\r\n\t\t\t\t$search_city = '北京';\r\n\t\t\t}\t\t\r\n\t\t\tsetcookie(\"search_province\", $search_province,time()+Better_Session_Base::$stickTime, '/');\r\n\t\t\tsetcookie(\"search_city\", $search_city,time()+Better_Session_Base::$stickTime, '/');\t\t\t\t\t\t\r\n\t\t}\r\n\t\t$this->view->search_city = $search_city;\r\n\t\t$thiv->view->search_province = $search_province;\r\n\t\t$cityll = Better_Citycenterll::$citycenterll;\r\n\t\t$ll = $cityll[$search_province][$search_city];\r\n\t\t$params = $this->getRequest()->getParams();\t\t\r\n\t\tif( strlen(trim($params['q'])) ){\t\t\t\r\n\t\t\tswitch ($params ['cat']) {\r\n\t\t\t\tcase \"place\" :\r\n\t\t\r\n\t $lon = $lat = 0;\r\n if (Better_LL::isValidLL($ll['1'], $ll['0'])) {\r\n $lon = $ll['1'];\r\n $lat = $ll['0'];\r\n } else if (Better_LL::isValidLL($this->userInfo['lon'], $this->userInfo['lat'])) {\r\n $lon = $this->userInfo['lon'];\r\n $lat = $this->userInfo['lat'];\r\n } else {\r\n $lon = $this->config->location->default_lon;\r\n $lat = $this->config->location->default_lat;\r\n }\r\n $params['byAround'] = 'on';\r\n $params['lon'] = $lon;\r\n $params['lat'] = $lat;\r\n\r\n\t\t\t\t\t$this->view->results = $this->placeSearch( $params );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"user\" :\r\n\t\t\t\t\t$this->view->results = $this->userSearch( $params );\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"status\" :\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$this->view->cat = $params ['cat'];\r\n\t\t\t$this->view->results ['params'] = $params;\r\n\t\t\t$page = (int)($params['page']);\r\n\t\t\t$total = (int)($this->view->results['total']);\r\n\t\t\t$this->view->results['params']['start'] = ($page - 1) * self::$maxPageSize + 1;\r\n\t\t\t$this->view->results['params']['hasNext'] = ($page * self::$maxPageSize < $total)?true:false;\r\n\t\t\t$this->view->results['params']['hasPrev'] = ($page > 1)?true:false;\r\n\t\t\t$this->view->results['params']['urlNext'] = $this->urlNext( $params );\r\n\t\t\t$this->view->results['params']['urlPrev'] = $this->urlPrev( $params );\r\n\t\t\t\r\n\t\t}else if(isset($params['q'])){\r\n\t\t\t\t\r\n\t\t\t$this->view->err = array(\r\n\t\t\t\t'has_err' => 1,\r\n\t\t\t\t'err' => $this->lang->api->error->statuses->query_required,\r\n\t\t\t);\t\t\t\r\n\t\t\techo $this->view->render('search/index.phtml');\r\n\t\t\texit(0);\r\n\t\t}\r\n\t}",
"public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}",
"public function get_locations_officers()\n {\n $items = array();\n $scope = get_post('scope');\n \n if ($scope) {\n\n if ((int)$scope !== 1 && !get_post('location_code')) {\n\n $return_data = array(\n 'status' => false,\n 'message' => 'Location is required.'\n );\n\n } else {\n \n $departments = $this->getDepartment(get_post('keyword'));\n foreach ($departments as $department) {\n\n // get main department locations if has any\n // main has no sub department id\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => 0, \n 'LocationScope' => $scope\n );\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n $department['location'] = $location;\n\n $subDepartments = array();\n foreach ($department['subDepartment'] as $subDepartment) {\n // get sub department locations if has any\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => $subDepartment['id'], \n 'LocationScope' => $scope\n );\n\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n\n $subDepartment['location'] = $location;\n\n if (get_post('result_filter') == 1) {\n // all active\n if ($subDepartment['location'] != false && $subDepartment['location']['Status']) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] != false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] == false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($subDepartment['location'] == false || ($subDepartment['location'] != false && $subDepartment['location']['Status'] == 0)) {\n $subDepartments[] = $subDepartment;\n }\n } else {\n // show all\n $subDepartments[] = $subDepartment;\n }\n }\n\n $department['subDepartment'] = $subDepartments;\n\n $exclude = true;\n // if no sub department. also filter main department result\n if (get_post('result_filter') == 1) {\n // all active\n if ($department['location'] != false && $department['location']['Status']) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] != false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] == false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($department['location'] == false || ($department['location'] != false && $department['location']['Status'] == 0)) {\n $items[] = $department;\n $exclude = false;\n }\n } else {\n // show all\n $items[] = $department;\n $exclude = false;\n }\n\n if (count($subDepartments) && $exclude) {\n $department['hideParent'] = true;\n $items[] = $department;\n }\n\n }\n\n if (count($items)) {\n $return_data = array(\n 'status' => true,\n 'data' => $items\n );\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'No record found.'\n );\n }\n\n }\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Scope is required.'\n );\n }\n\n response_json($return_data);\n }",
"protected function _searchLocations($location)\n {\n return $this->_makeRequest(self::API_URL . '/api/' . $this->_apiKey\n . '/geolookup/q/' . $location . '.json');\n }",
"public function supportsCourseOfferingSearch() {\n \treturn $this->manager->supportsCourseOfferingSearch();\n\t}",
"public function searchJobByLocation($location)\n {\n return $this->jobLocationModel->where('location_id',$location)->with('jobs','category')->get();\n }",
"private function findRecommendation(){\n $placeModel = new Place();\n $places = $placeModel->getAllCategorized();\n $bestScore = PHP_INT_MAX;\n $idBest = 0;\n\n foreach($places as $place){\n $currScore = 0;\n $currScore += abs($place->heritage - $this->score['heritage'] );\n $currScore += abs($place->relax - $this->score['relax'] );\n $currScore += abs($place->sightseeing - $this->score['sightseeing']);\n $currScore += abs($place->weather - $this->score['weather']) ;\n $currScore += abs($place->populated - $this->score['populated'] );\n\n if($currScore < $bestScore){\n $bestScore = $currScore;\n $idBest = $place->id_plc;\n }\n\n }\n\n return $idBest;\n }",
"function search($searchType, $price, $location, $categories) {\n $url_params = array();\n \n $url_params['term'] = $searchType;\n //$url_params['location'] = $location;\n $url_params['longitude'] = $location[0];\n $url_params['latitude'] = $location[1];\n //8046.72 is equivalent to 5 miles 16093.44 is equivalent to 10 miles\n $url_params['radius'] = 16093;\n $url_params['price'] = $price;\n $url_params['sort_by'] = 'rating';\n $url_params['open_now'] = true;\n $url_params['limit'] = 20;\n $url_params['categories'] = $categories;\n \n //converts into 'https://api.yelp.com/v3/businesses/search/location&limit&price&sort_by&radius'\n $response = request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params);\n \n $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n\n $data = json_decode($pretty_response, true);\n\n return $data['businesses'];\n}",
"public function __construct(World $world) {\n\t\tparent::__construct($world);\n\n\t\t$this->locations = new LocationCollection([\n\t\t\tnew Location\\Altar(\"Altar\", 0x289B0, null, $this),\n\t\t\tnew Location\\Npc(\"Uncle\", 0x2DF45, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-034] Hyrule Castle secret entrance\", 0xE971, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-018] Graveyard - top right grave\", 0xE97A, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-047] Dam\", 0xE98C, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-040] Link's House\", 0xE9BC, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-031] Tavern\", 0xE9CE, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-026] chicken house\", 0xE9E9, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-044] Aginah's cave\", 0xE9F2, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-035] Sahasrahla's Hut [left chest]\", 0xEA82, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-035] Sahasrahla's Hut [center chest]\", 0xEA85, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-035] Sahasrahla's Hut [right chest]\", 0xEA88, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-021] Kakariko well [top chest]\", 0xEA8E, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-021] Kakariko well [left chest row of 3]\", 0xEA91, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-021] Kakariko well [center chest row of 3]\", 0xEA94, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-021] Kakariko well [right chest row of 3]\", 0xEA97, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-021] Kakariko well [bottom chest]\", 0xEA9A, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-022-B1] Thief's hut [top chest]\", 0xEB0F, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-022-B1] Thief's hut [top left chest]\", 0xEB12, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-022-B1] Thief's hut [top right chest]\", 0xEB15, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-022-B1] Thief's hut [bottom left chest]\", 0xEB18, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-022-B1] Thief's hut [bottom right chest]\", 0xEB1B, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-016] cave under rocks west of Santuary\", 0xEB3F, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-050] cave southwest of Lake Hylia [bottom left chest]\", 0xEB42, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-050] cave southwest of Lake Hylia [top left chest]\", 0xEB45, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-050] cave southwest of Lake Hylia [top right chest]\", 0xEB48, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-050] cave southwest of Lake Hylia [bottom right chest]\", 0xEB4B, null, $this),\n\t\t\tnew Location\\Chest(\"[cave-051] Ice Cave\", 0xEB4E, null, $this),\n\t\t\tnew Location\\Npc(\"Bottle Vendor\", 0x2EB18, null, $this),\n\t\t\tnew Location\\Npc(\"Sahasrahla\", 0x2F1FC, null, $this),\n\t\t\tnew Location\\Npc(\"Magic Bat\", 0x180015, null, $this),\n\t\t\tnew Location\\Npc\\BugCatchingKid(\"Sick Kid\", 0x339CF, null, $this),\n\t\t\tnew Location\\Npc(\"Hobo\", 0x33E7D, null, $this),\n\t\t\tnew Location\\Drop\\Bombos(\"Bombos Tablet\", 0x180017, null, $this),\n\t\t\tnew Location\\Npc\\Zora(\"King Zora\", 0xEE1C3, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Thieves' Forest Hideout)\", 0x180000, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Lumberjack Tree)\", 0x180001, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (south of Haunted Grove)\", 0x180003, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Graveyard)\", 0x180004, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Desert - northeast corner)\", 0x180005, null, $this),\n\t\t\tnew Location\\Npc(\"[cave-050] cave southwest of Lake Hylia - generous guy\", 0x180010, null, $this),\n\t\t\tnew Location\\Dash(\"Library\", 0x180012, null, $this),\n\t\t\tnew Location\\Standing(\"Mushroom\", 0x180013, null, $this),\n\t\t\tnew Location\\Npc\\Witch(\"Witch\", 0x180014, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Maze Race)\", 0x180142, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Desert - west side)\", 0x180143, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Lake Hylia)\", 0x180144, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Dam)\", 0x180145, null, $this),\n\t\t\tnew Location\\Standing(\"Piece of Heart (Zora's River)\", 0x180149, null, $this),\n\t\t\tnew Location\\Dig\\HauntedGrove(\"Haunted Grove item\", 0x18014A, null, $this),\n\t\t\tnew Location\\Chest(\"Waterfall Fairy - Left\", 0xE9B0, null, $this),\n\t\t\tnew Location\\Chest(\"Waterfall Fairy - Right\", 0xE9D1, null, $this),\n\t\t]);\n\t}",
"public static function processJobLocations() {\n $cityStateHash = [];\n\n // Add one count for each unique location per email.\n foreach (self::$searches as $time => $search) {\n if (!is_array($search)) continue;\n if ($search['type'] != 'jobs') continue;\n if (empty($search['data']['city'])) continue;\n\n $email = $search['email'];\n $location = strtolower($search['data']['city']);\n\n // Location to geocode, to City, State.\n $geocode = GeocodeModel::get($location);\n if (is_null($geocode)) continue;\n $cityState = strtolower(getCityStateFromGeocode($geocode));\n\n if (isset($cityStateHash[$cityState])) {\n if (isset($cityStateHash[$cityState]['email'][$email])) continue;\n $cityStateHash[$cityState]['email'][$email] = true;\n $cityStateHash[$cityState]['count'] ++;\n } else {\n $cityStateHash[$cityState] = [\n 'email' => [$email => true],\n 'count' => 1\n ];\n }\n }\n\n // Extract counts.\n $cityStateCounts = [];\n foreach ($cityStateHash as $cityState => $data) {\n $cityStateCounts[$cityState] = $data['count'];\n }\n\n arsort($cityStateCounts);\n return $cityStateCounts;\n }",
"function restrict_locs($user_locs = array(), $all_locs = array())\n{\n\treturn array_intersect_key($all_locs, array_flip($user_locs));\n}",
"public function getFarmsEggs(){\n\t\t$url = 'http://www.vermontfresh.net/member-search/MemberSearchForm?Keywords=&ProductCategoryID=9&Categories%5B13%5D=13&RegionID=&action_doMemberSearch=Search';\n\t\treturn $this->parse_data($url);\n\t}",
"public function searchWithCriteria(){\n\n\n //change default message for required rule\n $this->unsetSessionData();\n $this->setSessionData();\n\n\n if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])){\n $this->searchByLocationAndDay();\n }else if(isset($_SESSION['searchKeyword']) && isset($_SESSION['timecon'])==FALSE){\n $this->searchByLocation();\n }else if(isset($_SESSION['searchKeyword'])==FALSE && isset($_SESSION['timecon'])){\n $this->searchByCalendar();\n }\n }",
"function erp_company_get_locations() {\n global $wpdb;\n\n $cache_key = 'erp_company-location';\n $locations = wp_cache_get( $cache_key, 'wp-erp' );\n\n if ( false === $locations ) {\n $locations = $wpdb->get_results( \"SELECT * FROM {$wpdb->prefix}erp_company_locations\" );\n wp_cache_set( $cache_key, $locations, 'wp-erp' );\n }\n\n return $locations;\n}",
"function get_course_oers( $courseid, $DB, $oer_category_id ){\n $oer_category_id=$GLOBALS['glbstg_crs_category'];\n // OERs in Nantes caracterised by 'categoryid=916'\n\n $oer_modules=new stdClass();\n $course_infos = get_course_infos($courseid, $DB);\n $course_gen_infos= $course_infos->course_gen_infos;\n $course_cat_infos= $course_infos->course_cat_infos;\n $course_mod_infos= $course_infos->course_modules;\n $final_oer_modules =new stdClass();\n\n //X5GON 1st OER Criteria: Category + Course Visibility + Course Availability ===> X5GON Snippet integrated\n if( in_array($course_gen_infos->category, $oer_category_id) and validate_course_enrolment($courseid, $DB, $GLOBALS['glbstg_crs_allowed_enrolment_types'], $GLOBALS['glbstg_crs_allow_typeswith_pass']) and validate_course_visibility($courseid, $DB, $GLOBALS['glbstg_crs_allowhidden_courses']) ){\n\n foreach ($course_mod_infos as $key => $value) {\n //X5GON 2nd OER Criteria: Moodle modules restrictions: Visibility + Availability\n //Module restrictions + couldbepublic x5gon decision\n //The next parameters are meant to be loaded from plugin general settings in the future.\n $course_mod_restrictions=check_module_visibilityANDavailability($DB, $value, $GLOBALS['glbstg_mod_visibility_allowhiddenmodules'], $GLOBALS['glbstg_mod_availability_ignoreavailabilityrestrictions']);\n if($course_mod_restrictions[1]==1){\n\n //X5GON 3rd OER Criteria: Final file license.\n if($value->course_module_file){\n //not empty file attribute infos\n if( preg_match(\"/\".$GLOBALS['glbstg_mod_fresallowedlicenses'].\"/\", $value->course_module_file->license) ){\n\n $oer_modules->$key=$value;\n }\n\n }else{\n // Else: other type of moodle resources + category is \"OER category(Nantes case)\"\n $oer_modules->$key=$value;\n\n }\n\n }\n\n }\n\n //Y1: For FinalResources: We are interested for the moment about 'type=resource' of moodle modules.\n $oer_modules= get_concerned_resources( $oer_modules, $GLOBALS['glbstg_mod_finalfilter_concernedmdlmodtypes'] );\n $final_oer_modules->course_modules=$oer_modules;\n $final_oer_modules->course_gen_infos= $course_gen_infos;\n $final_oer_modules->course_cat_infos= $course_cat_infos;\n\n }else{\n\n $final_oer_modules->course_gen_infos=new stdClass();\n $final_oer_modules->course_cat_infos=new stdClass();\n $final_oer_modules->course_modules=new stdClass();\n $final_oer_modules->response_notice=\"No permitted informations to be rendered for this course. Check with admin.\";\n }\n\n return $final_oer_modules;\n }"
]
| [
"0.55750203",
"0.52242434",
"0.5179236",
"0.5145922",
"0.5142495",
"0.5091689",
"0.50909126",
"0.5042304",
"0.5041018",
"0.5030001",
"0.501463",
"0.4971983",
"0.49326074",
"0.49157676",
"0.49097997",
"0.48963436",
"0.48950455",
"0.48899603",
"0.4884055",
"0.48716077",
"0.4861523",
"0.48592162",
"0.485129",
"0.48343655",
"0.48186082",
"0.4789816",
"0.47778308",
"0.47677037",
"0.47533262",
"0.47453293"
]
| 0.5370972 | 1 |
Set a tweet for the user to sing Martha's praises. | public function tweet($tweet) {
$this->_tweet = htmlspecialchars($tweet, ENT_QUOTES, 'UTF-8');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function tweet() {\r\n\t\tif ($this->feed->tweet != 1 || $this->tweeted == 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->save();\r\n\t\t$url = 'http://'.$_SERVER['HTTP_HOST'].$this->get_url();\t\r\n\t\t$tweet = text::limit_chars($this->feed->tweet_desc.' '.$this->title,118,'...',TRUE).' '.$url;\r\n\t\tzest::update_status($tweet);\r\n\t\t$this->tweeted = 1;\r\n\t\t$this->save();\r\n\t}",
"public function run()\n {\n \\Setting::Lang('ar')->set('twitter','shari__sa');\n }",
"public function setTwitterUsername($twitterUsername)\n {\n $this->twitterUsername = $twitterUsername;\n }",
"public function saving(Tweet $tweet){\n $tweet->user_id = request()->user()->id;\n }",
"public function setTwitter($twitter)\n {\n if (substr($twitter, 0, 1) !== '@') {\n throw new \\InvalidArgumentException('twitter name must start with @', 1357530444);\n }\n\n $this->twitter = $twitter;\n }",
"public function tweet($tweet, $options = []);",
"public static function default_user_tweets($user = 'WordPress', $tweet_count = 5, $retweets = false) {\n\n $my_tweets = EXT_Tweets::factory()\n ->set_transient_name($user . '-tweets')\n ->set_api_request_url('http://api.twitter.com/1/statuses/user_timeline.json?count=' . $tweet_count . '&screen_name=' . $user . '&include_rts=' . $retweets . 'false')\n ->load_tweets();\n echo $my_tweets->display_tweets();\n }",
"public function twitterAction()\r\n {\r\n if(!($userInfo = Mage::getSingleton('customer/session')\r\n ->getSocialLogonTwitterUserinfo()) || !$userInfo->hasData()) {\r\n \r\n $userInfo = Mage::getSingleton('SocialLogon/twitter_info_user')\r\n ->load();\r\n\r\n Mage::getSingleton('customer/session')\r\n ->setSocialLogonTwitterUserinfo($userInfo);\r\n }\r\n\r\n Mage::register('SocialLogon_twitter_userinfo', $userInfo);\r\n\r\n $this->loadLayout();\r\n $this->renderLayout();\r\n }",
"public function twitterAction()\n {\n if(!($userInfo = Mage::getSingleton('customer/session')\n ->getInchooSocialconnectTwitterUserinfo())) {\n $userInfo = Mage::getSingleton('rootinfo_socialconnect/twitter_userinfo')\n ->getUserInfo();\n \n Mage::getSingleton('customer/session')->setInchooSocialconnectTwitterUserinfo($userInfo);\n }\n \n Mage::register('rootinfo_socialconnect_twitter_userinfo', $userInfo);\n \n $this->loadLayout();\n $this->renderLayout();\n }",
"public function testSetTweet(): void\n {\n $result = new ReachResult;\n $tweet = factory(Tweet::class)->states(['deterministic'])->make();\n $result->setTweet($tweet);\n\n // Assertions\n $this->assertSame($tweet, $result->getTweet());\n }",
"public function twitter(string $name, ?string $value)\n\t\t{\n\t\t\t$this->add($name, $value, 'twitter');\n\t\t\treturn $this;\n\t\t}",
"function mc_tweet_approval( $prev, $new ) {\n\tif ( function_exists( 'wpt_post_to_twitter' ) && isset( $_POST['mc_twitter'] ) && trim( $_POST['mc_twitter'] ) != '' ) {\n\t\tif ( ( 0 == $prev || 2 == $prev ) && 1 == $new ) {\n\t\t\twpt_post_to_twitter( stripslashes( $_POST['mc_twitter'] ) );\n\t\t}\n\t}\n}",
"function prli_twitter_oauth_tweet($message, $access_token)\n {\n $connection = new PrliTwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);\n\n /* Get logged in user to help with tests. */\n $user = $connection->get('account/verify_credentials');\n\n $status = $connection->post('statuses/update', array('status' => $message));\n\n return $status;\n }",
"private function sendTweet($maker, $tweet_text) {\n $cfg = Config::getInstance();\n $oauth_consumer_key = $cfg->getValue('twitter_oauth_notifier_consumer_key');\n $oauth_consumer_secret = $cfg->getValue('twitter_oauth_notifier_consumer_secret');\n $oauth_token = $cfg->getValue('twitter_oauth_notifier_access_token');\n $oauth_token_secret = $cfg->getValue('twitter_oauth_notifier_access_token_secret');\n\n //Only attempt the tweet if these are set - and they are not set on dev\n if (isset($oauth_consumer_key) && isset($oauth_consumer_secret) ) {\n $twitter_oauth = new TwitterOAuth($oauth_consumer_key, $oauth_consumer_secret, $oauth_token,\n $oauth_token_secret);\n\n $api_accessor = new TwitterAPIAccessor();\n // Tweet the tweet\n $results = $api_accessor->postTweet($tweet_text, $twitter_oauth);\n if ($results[0] == 200) {\n $sent_tweet_dao = new SentTweetMySQLDAO();\n $sent_tweet_dao->insert($maker->autofill_network_id, $maker->autofill_network_username);\n return true;\n } else { //API returned a non-200 code, tweet wasn't sent\n return false;\n }\n } else { //No Twitter credentials set in the config\n return false;\n }\n }",
"public function processTweetsAction()\n {\n try {\n $url = $_SERVER['HTTP_REFERER'];\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n\n if (!Mage::getSingleton('customer/session')->isLoggedIn()) {\n throw new Exception($this->__(\"You must be logged in for us to reward you for tweeting.\"), 110);\n }\n\n $tweet = Mage::getModel('rewardssocial/twitter_tweet');\n\n if ($tweet->hasAlreadyTweetedUrl($customer, $url)) {\n throw new Exception($this->__(\"You've already tweeted about this page.\"), 120);\n }\n\n $minimumWait = $tweet->getTimeUntilNextTweetAllowed($customer);\n if($minimumWait > 0) {\n throw new Exception($this->__(\"Please wait %s second(s) before tweeting another page if you want to be rewarded.\", $minimumWait), 130);\n }\n\n if ($tweet->isMaxDailyTweetsReached($customer)) {\n $maxTweets = $this->_getMaxTweetsPerDay($customer);\n throw new Exception($this->__(\"You've reached the tweet-rewards limit for today (%s tweets per day)\", $maxTweets), 140);\n }\n\n $tweet->setCustomerId($customer->getId())\n ->setUrl($url)\n ->save();\n\n if (!$tweet->getId()) {\n throw new Exception($this->__(\"TWEET model was not saved for some reason.\"), 10);\n }\n\n $validatorModel = Mage::getModel('rewardssocial/twitter_tweet_validator');\n $validatorModel->initReward($customer->getId(), $url);\n\n $message = $this->__(\"Thanks for tweeting this page!\");\n $predictedPoints = $validatorModel->getPredictedTwitterTweetPoints();\n if (count($predictedPoints) > 0) {\n $pointsString = (string) Mage::getModel('rewards/points')->set($predictedPoints);\n $message = $this->__(\"You've earned <b>%s</b> for tweeting!\", $pointsString);\n }\n\n $this->_jsonSuccess(array(\n 'success' => true,\n 'message' => $message\n ));\n } catch (Exception $ex) {\n // log the exception\n Mage::helper('rewards')->logException(\"There was a problem rewarding customer {$customer->getEmail()} (ID: {$customer->getId()}) for tweeting about a page ({$url}): \".\n $ex->getMessage());\n\n $message = $this->__('There was a problem trying to reward you for tweeting about this page.<br/>Try again and contact us if you still encounter this issue.');\n if ($ex->getCode() > 100) {\n $message = $ex->getMessage();\n }\n\n $this->_jsonError(array(\n 'success' => false,\n 'message' => $message\n ));\n }\n\n return $this;\n }",
"public function setTwitter($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->twitter !== $v) {\n\t\t\t$this->twitter = $v;\n\t\t\t$this->modifiedColumns[] = VenuePeer::TWITTER;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setTwitterAccessToken($twitterAccessToken)\n {\n $this->twitterAccessToken = $twitterAccessToken;\n }",
"function ecsp_twitter_publish_post( $post_id, $user_id ) {\n\t$share_twitter = get_post_meta($post_id, 'ecsp_share_twitter', true );\n\t$share_all = get_post_meta($post_id, 'ecsp_share_all', true );\n\n\t// The user must have selected to share on Twitter, or share on All\n\tif ( !$share_twitter && !$share_all ) {\n\t\treturn;\n\t}\n\n\t// If the user does not have this account connected, abort. Might be due to \"all\" being checked.\n\tif ( !get_user_meta( $user_id, 'ecsp-twitter-access-token', true ) ) return;\n\n\t$twAuth = ecsp_get_twitter_auth_api();\n\tif ( !$twAuth ) {\n\t\tecsp_log_sharing_error_for_user( $user_id, $post_id, 'twitter', 'Could not initialize the Twitter API' );\n\t\treturn;\n\t}\n\n\t// Get the user's message. This will include a link to the article.\n\t$user_message = ecsp_get_share_message( $post_id, 140, true );\n\n\tif ( !$user_message ) {\n\t\tecsp_log_sharing_error_for_user( $user_id, $post_id, 'twitter', 'The sharing message was not provided.' );\n\t\treturn;\n\t}\n\n\ttry {\n\t\t$result = $twAuth->post( 'statuses/update', array( 'status' => $user_message ) );\n\t} catch( Abraham\\TwitterOAuth\\TwitterOAuthException $e ) {\n\t\tupdate_post_meta( $post_id, 'ecsp-twitter-error', 'Twitter returned an error: ' . $e->getMessage() );\n\t\tdelete_post_meta( $post_id, 'ecsp-twitter-share-result' );\n\t\tecsp_log_sharing_error_for_user( $user_id, $post_id, 'twitter', 'Twitter returned an error: ' . $e->getMessage() );\n\t\treturn;\n\t}\n\n\tupdate_post_meta( $post_id, 'ecsp-twitter-share-result', $result );\n\tdelete_post_meta( $post_id, 'ecsp-twitter-error' );\n}",
"public function mute($mute) {\n $this->mute = $mute;\n }",
"protected function setup_tweet_data() {\n\t\t$this->text = str_replace( ''', '\\'', $this->raw_data->text );\n\t\t$this->text = $this->remove_emoji( $this->text );\n\t\t$this->add_links_to_text();\n\n\t\t$this->link = \"https://twitter.com/{$this->raw_data->user->name}/status/{$this->raw_data->id_str}\";\n\t\t$this->timestamp = strtotime( $this->raw_data->created_at );\n\n\t\tif ( isset( $this->raw_data->retweeted_status ) ) {\n\t\t\t$this->image = $this->raw_data->retweeted_status->user->profile_image_url;\n\t\t} else {\n\t\t\t$this->image = $this->raw_data->user->profile_image_url;\n\t\t}\n\n\t\t// clear from the retweeted status text\n\t\tif ( ! empty( $this->raw_data->retweeted_status->text ) ) {\n\t\t\t$this->raw_data->retweeted_status->text = $this->remove_emoji( $this->raw_data->retweeted_status->text );\n\t\t}\n\t}",
"function mentionMePostbit(&$post)\n{\n\tglobal $mybb, $theme, $lang, $templates, $forumpermissions,\n\t$fid, $post_type, $thread, $forum;\n\n\tif ($mybb->settings['quickreply'] == 0 ||\n\t\t$mybb->user['suspendposting'] == 1 ||\n\t\t$forumpermissions['canpostreplys'] == 0 ||\n\t\t($thread['closed'] == 1 && !is_moderator($fid)) ||\n\t\t$forum['open'] == 0 ||\n\t\t$post_type ||\n\t\t$mybb->user['uid'] == $post['uid']) {\n\t\treturn;\n\t}\n\n\t// tailor JS to postbit setting\n\t$js = \"javascript:MentionMe.insert('{$post['username']}');\";\n\tif ($mybb->settings['mention_multiple']) {\n\t\t$js = \"javascript:MentionMe.multi.mention({$post['pid']});\";\n\t}\n\n\teval(\"\\$post['button_mention'] = \\\"\" . $templates->get('mentionme_postbit_button') . \"\\\";\");\n}",
"public static function twitter()\n {\n return 'twitter';\n }",
"public function store(Tweet $tweet)\n {\n $tweet->dislike(auth()->user());\n\n return back();\n }",
"public function twitter_signin()\r\n\t{\r\n\t\t// Enabling debug will show you any errors in the calls you're making, e.g:\r\n\t\t$this->tweet->enable_debug(false);\r\n\t\t\r\n\t\t// If you already have a token saved for your user\r\n\t\t// (In a db for example) - See line #37\r\n\t\t// \r\n\t\t// You can set these tokens before calling logged_in to try using the existing tokens.\r\n\t\t// $tokens = array('oauth_token' => 'foo', 'oauth_token_secret' => 'bar');\r\n\t\t// $this->tweet->set_tokens($tokens);\r\n\t\tif ( !$this->tweet->logged_in() )\r\n\t\t{\r\n\t\t\t// This is where the url will go to after auth. (Callback url)\r\n\t\t\t$this->tweet->set_callback(site_url('auth_other/twitter_signin'));\r\n\t\t\t\r\n\t\t\t// Send the user off for login!\r\n\t\t\t$this->tweet->login();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// check if the user is in the DB already\r\n\t\t\t$twitter_user = $this->tweet->call('get', 'account/verify_credentials');\r\n\t\t\tif( !($user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id'))) \r\n\t\t\t{\r\n\t\t\t\t// create the user\r\n\t\t\t\t$password = generate_password(9, 8);\r\n\t\t\t\t$this->tank_auth->create_user($twitter_user->screen_name . $twitter_user->id, $twitter_user->screen_name . $twitter_user->id, $password, false);\r\n\t\t\t\t$user = $this->generic_model->get_where_single_row('users', array('username' => $twitter_user->screen_name . $twitter_user->id));\r\n\t\t\t \t\r\n\t\t\t \t// update the user profile table\r\n\t\t\t\t$tokens = $this->tweet->get_tokens();\r\n\t\t\t\t$this->generic_model->update('user_profiles', \r\n\t\t\t\t\t\t\t\t\t\t \t array('twitter_id' => $twitter_user->id, \r\n\t\t\t\t\t\t\t\t\t\t \t \t 'display_name' => $twitter_user->screen_name,\r\n\t\t\t\t\t\t\t\t\t\t \t \t 'twitter_access_token' => $tokens['oauth_token'], \r\n\t\t\t\t\t\t\t\t\t\t \t \t 'twitter_access_token_secret' => $tokens['oauth_token_secret'], \r\n\t\t\t\t\t\t\t\t\t\t \t 'profile_image' => $twitter_user->profile_image_url), \r\n\t\t\t\t\t\t\t\t\t\t \t array('user_id' => $user->id));\r\n\t\t\t\t$user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id');\r\n\t\t\t\t$this->tank_auth_login($user);\r\n\t\t\t\tredirect('member/member_location', 'redirect');\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$user = $this->member_model->get_user_by_sm(array('twitter_id' => $twitter_user->id), 'twitter_id');\r\n\t\t\t\t\r\n\t\t\t\t// if the profile image url is set to gravatar, then update to twitter profile pic\r\n\t\t\t\tif( strpos($user->profile_image, 'gravatar') !== false ) {\r\n\t\t\t\t\t$this->generic_model->update('user_profiles', array('profile_image' => $twitter_user->profile_image_url), array('user_id' => $user->id));\r\n\t\t\t\t\t$user->profile_image = $twitter_user->profile_image_url;\r\n\t\t\t\t}\r\n\t\t\t\t// if twitter access token is empty, then save it\r\n\t\t\t\tif( $user->twitter_access_token == '' || $user->twitter_access_token_secret == '') {\r\n\t\t\t\t\t$tokens = $this->tweet->get_tokens();\r\n\t\t\t\t\t$this->generic_model->update('user_profiles', \r\n\t\t\t\t\t\t\t\t\t\t\t\t array('twitter_access_token' => $tokens['oauth_token'], 'twitter_access_token_secret' => $tokens['oauth_token_secret']), \r\n\t\t\t\t\t\t\t\t\t\t\t\t array('user_id' => $user->id));\r\n\t\t\t\t}\r\n\t\t\t\t// user signs in and go to the login page\r\n\t\t\t\t$this->tank_auth_login($user);\r\n\t\t\t\tredirect('auth', 'refresh');\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}",
"public function setTwitterId($twitterId)\n {\n $this->twitterId = $twitterId;\n }",
"function setSwimMeet($swimmeet)\r\n {\r\n $this->_swimmeet = $swimmeet ;\r\n }",
"public static function default_site_tweets($tweet_count = 5, $retweets = false) {\n $user = get_theme_mod('bjc_twitter_username', 'WordPress');\n $my_tweets = EXT_Tweets::factory()\n ->set_transient_name('default-tweets')\n ->set_api_request_url('http://api.twitter.com/1/statuses/user_timeline.json?count=' . $tweet_count . '&screen_name=' . $user . '&include_rts=' . $retweets . 'false')\n ->load_tweets();\n echo $my_tweets->display_tweets();\n }",
"public function get_twitter() {\r\n return $this->twitter;\r\n }",
"public function setTwitterAccount($account)\n {\n $this->_twitterAccount = $account;\n return $this;\n }",
"function tp_publish_automatic($id, $post) {\r\n\tif ($post->post_status !== 'publish') return;\r\n\r\n\t// check options to see if we need to send to FB at all\r\n\t$options = tp_options();\r\n\tif (!$options['autotweet_flag'] || !$options['autotweet_token'] || !$options['autotweet_secret'] || !$options['publish_text'])\r\n\t\treturn;\r\n\r\n\t// args to send to twitter\r\n\t$args=array();\r\n\r\n\t$args['status'] = tp_get_default_tweet($id);\r\n\r\n\t$args['acc_token'] = $options['autotweet_token'];\r\n\t$args['acc_secret'] = $options['autotweet_secret'];\r\n\r\n\t$resp = tp_do_request('statuses/update',$args, 'post');\r\n\r\n return $resp;\r\n}"
]
| [
"0.62273747",
"0.61137694",
"0.5978671",
"0.5931785",
"0.58371586",
"0.5768386",
"0.56553197",
"0.5654772",
"0.5654076",
"0.5625544",
"0.5522091",
"0.54975593",
"0.5495147",
"0.5490258",
"0.54359555",
"0.5400096",
"0.53689337",
"0.53341764",
"0.53255135",
"0.53251034",
"0.5284197",
"0.52565724",
"0.5255805",
"0.52423674",
"0.522365",
"0.52209216",
"0.5219044",
"0.51775074",
"0.5160316",
"0.5112817"
]
| 0.6363261 | 0 |
Get the tweet for the user to sing Martha's praises. | public function getTweet() {
return $this->_tweet;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_twitter() {\r\n return $this->twitter;\r\n }",
"public function getTwitter()\n {\n return $this->twitter;\n }",
"public function getTwitter()\n\t{\n\t\treturn $this->twitter;\n\t}",
"public function getTwitterUsername()\n {\n return $this->twitterUsername;\n }",
"public function getTwitter(): ?string;",
"public function get() {\n\t\treturn $this->presentation->twitter_creator;\n\t}",
"public function getTwitterTweets() {\n $current_uid = isset($_GET['team']) ? $_GET['muid'] : \\Drupal::currentUser()->id();\n $properties = ['token_access'];\n $response = $this->getKabbodeNetworkStatusProperty(174, $current_uid, $properties);\n $TwitterHelper = new TwitterHelperFunction();\n $connection = new TwitterOAuth($TwitterHelper->getTwitterApiKey(), $TwitterHelper->getTwitterSecretKey(), $response['token_access']->oauth_token, $response['token_access']->oauth_token_secret);\n $parameters = ['count' => 10, 'include_rts' => 1, 'tweet_mode' => 'extended', 'exclude_replies' => 1];\n $get_tweet = $connection->get('statuses/user_timeline', $parameters);\n //modified twitter text\n foreach ($get_tweet as $key => $tweet) {\n $tweet->full_text = $this->json_tweet_text_to_HTML($tweet, $links = true, $users = true, $hashtags = true);\n if ($tweet->retweeted) {\n if (isset($tweet->retweeted_status) && is_object($tweet->retweeted_status)) {\n $tweet->retweeted_status->full_text = $this->json_tweet_text_to_HTML($tweet->retweeted_status, $links = true, $users = true, $hashtags = true);\n }\n }\n }\n $last_trace_tweet = end($get_tweet)->id - 1;\n \n $get_tweet['last_trace_tweet'] = strval($last_trace_tweet);\n return $get_tweet;\n }",
"private function twitter() {\n\t\t$url = 'https://twitter.com/intent/tweet?';\n\n\t\t$query = array(\n\t\t\t'*url' \t=> $this->_get_param( 'permalink' ),\n\t\t\t'text'\t=> $this->_get_param( 'title' ),\n\t\t\t'via'\t\t=> $this->_get_param( 'via' ),\n\t\t);\n\n\t\treturn $this->_create_query_string( $url, $query );\n\t}",
"public function getTwitterId()\n {\n return $this->twitterId;\n }",
"public function getTwitterUrl()\n {\n return $this->twitter_url;\n }",
"private function simulateTweet()\n {\n return [\n 'message' => request('custom_message'),\n 'link' => request('custom_link'),\n ];\n }",
"public static function twitter()\n {\n return 'twitter';\n }",
"public function getWhoDoneTheRT($tweet_id) {\n \t $url = '1.1/statuses/retweeters/ids';\n\n $this->tmhOAuth->request('GET', $this->tmhOAuth->url($url), array(\n 'count' => 10,\n\t 'id' => $tweet_id\n ));\n $res = json_decode($this->tmhOAuth->response['response']);\n\n return $res;\n }",
"public function redirect()\n {\n $token = 'fMFqRVTKyA1LwCTFQR1VESfug';\n $secret = 'YQCtWeMkab5UB3AALwOeLSQAGs4eq6DHkOHi6gbiYqoAdGbbPz';\n $user = Socialite::driver('twitter')->userFromTokenAndSecret($token, $secret);\n return $user;\n }",
"public function getTwitterIdentifier()\n {\n return $this->_getIdentifier('twitter');\n }",
"public function getTwitterName()\n\t{\n\t\tif ($fb_uid = $this->getFBUID()) {\n\t\t\treturn $this->db->queryScalar(\"SELECT twitterid from selective_status_users where fbuid = \" . $this->db->quote($fb_uid) . \" limit 1\");\n\t\t}\n\t}",
"public function getTwist()\n {\n return $this->twist;\n }",
"public function tweet() {\r\n\t\tif ($this->feed->tweet != 1 || $this->tweeted == 1) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$this->save();\r\n\t\t$url = 'http://'.$_SERVER['HTTP_HOST'].$this->get_url();\t\r\n\t\t$tweet = text::limit_chars($this->feed->tweet_desc.' '.$this->title,118,'...',TRUE).' '.$url;\r\n\t\tzest::update_status($tweet);\r\n\t\t$this->tweeted = 1;\r\n\t\t$this->save();\r\n\t}",
"public static function default_user_tweets($user = 'WordPress', $tweet_count = 5, $retweets = false) {\n\n $my_tweets = EXT_Tweets::factory()\n ->set_transient_name($user . '-tweets')\n ->set_api_request_url('http://api.twitter.com/1/statuses/user_timeline.json?count=' . $tweet_count . '&screen_name=' . $user . '&include_rts=' . $retweets . 'false')\n ->load_tweets();\n echo $my_tweets->display_tweets();\n }",
"function get_twitter_screen_name($user_id){\n\tglobal $gianism;\n\treturn get_user_meta($user_id, $gianism->twitter->umeta_screen_name, true);\n}",
"public function getMe()\r\n {\r\n return $this->telegram(\"getMe\");\r\n }",
"function get_last_elon_tweet(){\n\n\t// Set here your twitter application tokens\n\t$settings = array(\n\t 'consumer_key' => TWITTER_API_KEY,\n\t 'consumer_secret' => TWITTER_SECRET,\n\t 'oauth_access_token' => '',\n\t 'oauth_access_token_secret' => '',\n\t);\n\n\t$screen_name = 'elonmusk';\n\n\t$url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';\n\t$getfield = \"?screen_name={$screen_name}&include_rts=false\";\n\t$requestMethod = 'GET';\n\n\t$twitter = new TwitterAPIExchange($settings);\n\t$user_timeline = $twitter\n\t ->setGetfield($getfield)\n\t ->buildOauth($url, $requestMethod)\n\t ->performRequest();\n\n\t$user_timeline = array_values(json_decode($user_timeline, true));\n\t$last_tweet = array('txt'=>\"\", 'id'=>\"\");\n\n\tforeach ($user_timeline as $key => $value) {\n\t\t\n\t\tif(empty($user_timeline[$key]['in_reply_to_user_id'])){\n\n\t\t\t$last_tweet_text = $user_timeline[$key]['text'];\n\t\t\t$last_tweet_id = $user_timeline[$key]['id'];\n\t\t\t$last_tweet_time = strtotime($user_timeline[$key]['created_at']);\n\n\t\t\treturn array('txt' => $last_tweet_text, 'id' => $last_tweet_id, 'time' => $last_tweet_time);\n\n\t\t\tbreak;\n\n\t\t}\n\t}\n\n}",
"public static function fetchTweetForUser($id) {\n $query = \"SELECT * FROM DATA_survey_tweets WHERE tweet_id NOT IN (SELECT tweet_id FROM DATA_survey_results WHERE user_id = %i) ORDER BY num_ratings\";\n $tweet = self::$databases['aws']->queryFirstRow($query, $id);\n return $tweet;\n }",
"function prli_twitter_oauth_tweet($message, $access_token)\n {\n $connection = new PrliTwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $access_token['oauth_token'], $access_token['oauth_token_secret']);\n\n /* Get logged in user to help with tests. */\n $user = $connection->get('account/verify_credentials');\n\n $status = $connection->post('statuses/update', array('status' => $message));\n\n return $status;\n }",
"function latestTweet()\n{\nrequire_once $_SERVER[\"DOCUMENT_ROOT\"].('/inc/codebird.php');\nCodebird::setConsumerKey('siuqD954HVxelmypLKWnA', 'to0MbPCCxiGMHqT65ttkhpVc1ybj0eAhtGOgzWNrWpE'); // static, see 'Using multiple Codebird instances'\n$cb = Codebird::getInstance();\n$cb->setToken('947973235-4Yu2YnqZ4FT6pc4OsxE3r1v3esnAgU34tUyFwo9y', 'RW0e1RmX2CtLGliB4cqT9LMs7kaQgNu2eSnLsCz5eM');\n$reply = (array) $cb->statuses_userTimeline(array(\"count\"=>1));\nif (count($reply)>0)\n{\n$text = $reply[0]->text;\n\n//var_dump($reply[3]->entities);\n//var_dump($text);\nforeach ($reply[0]->entities->hashtags as $entity)\n{\n $text = str_replace(\"#\".$entity->text, \"<a target='_blank' href='https://twitter.com/search?q=%23\".$entity->text.\"&src=hash'>#\".$entity->text.\"</a>\", $text);\n}\nforeach ($reply[0]->entities->urls as $entity)\n{\n $text = str_replace($entity->url, \"<a target='_blank' href='$entity->url'>\".$entity->url.\"'</a>\", $text);\n}\nforeach ($reply[0]->entities->user_mentions as $entity)\n{\n $text = str_replace(\"@\".$entity->screen_name, \"<a target='_blank' href='https://twitter.com/\".$entity->screen_name.\"'>@\".$entity->screen_name.\"</a>\", $text);\n}\nreturn($text);\n}\nelse return \"Follow us on Twitter\";\n}",
"public function getTwitterAccessToken()\n {\n return $this->twitterAccessToken;\n }",
"public function twitter() : string\n {\n $parameters = [];\n\n if (empty($this->title) === false) {\n $parameters['text'] = $this->title;\n }\n\n if (empty($this->url) === false) {\n $parameters['url'] = $this->url;\n }\n\n return $this->createHtmlElement('a', [\n 'target' => '_blank',\n 'rel' => 'noopener',\n 'href' => 'https://twitter.com/intent/tweet?'.http_build_query($parameters),\n ], 'Twitter');\n }",
"private function getkofixtweet() \n {\n $stack = HandlerStack::create();\n\n $middleware = new Oauth1([\n 'consumer_key' => 'Dnbk0bS6dyy418ouTIuG4GWJb',\n 'consumer_secret' => 'jFtSSraR65oeyW7BPsgmwiOb4wJO2YKSDXaHLeGJwCd6Z3EGwH',\n 'token' => '831526661266952192-2a4yWwGDokN8hYpxarvwFfCQu2sR9ZB',\n 'token_secret' => '0XzmLpQbfezxqarmlgb9hvn4onGxpBImNOB4kYnXRze3Q'\n ]);\n\n $stack->push($middleware);\n\n $client = new Client([\n 'base_uri' => 'https://api.twitter.com/1.1/',\n 'handler' => $stack,\n 'auth' => 'oauth',\n ]);\n\n $res = $client->get('statuses/user_timeline.json',['query' => [\n 'screen_name' => 'kofixtech',\n 'count' => '9',\n ]]);\n\n return json_decode($res->getBody(), true);\n }",
"public function twitter_user_profile() {\n $current_uid = isset($_GET['team']) ? $_GET['muid'] : \\Drupal::currentUser()->id();\n $TwitterHelper = new TwitterHelperFunction();\n $properties = ['token_access'];\n $response_token = \\Drupal::service('social_media.social_media_controller')->getKabbodeNetworkStatusProperty(174, $current_uid, $properties);\n $connection = new TwitterOAuth($TwitterHelper->getTwitterApiKey(), $TwitterHelper->getTwitterSecretKey(), $response_token['token_access']->oauth_token, $response_token['token_access']->oauth_token_secret);\n $verify_account = $connection->get('account/verify_credentials');\n return $verify_account;\n }",
"function ts_get_twitter_username() {\r\n\t\r\n\t$url = ot_get_option('twitter_account_recent_tweets');\r\n\tif (empty($url) || !strstr($url,'twitter.com/'))\r\n\t{\r\n\t\treturn '';\r\n\t}\r\n\t\r\n\t$url = trim($url);\r\n\tif (substr($url,-1) == '/')\r\n\t{\r\n\t\t$url = substr($url,0,-1);\r\n\t}\r\n\t$username = substr($url,strrpos($url,'/')+1);\r\n\t\r\n\treturn $username;\r\n}"
]
| [
"0.6917",
"0.68206495",
"0.6764972",
"0.64102435",
"0.6394193",
"0.6393978",
"0.6369178",
"0.6273873",
"0.6272998",
"0.6266908",
"0.62471575",
"0.6190304",
"0.6140214",
"0.60758555",
"0.6070055",
"0.6060208",
"0.6051932",
"0.6049136",
"0.60418355",
"0.6017042",
"0.6013675",
"0.5997694",
"0.59323835",
"0.59197843",
"0.5891836",
"0.5889458",
"0.5878973",
"0.587038",
"0.58005506",
"0.5782926"
]
| 0.69713855 | 0 |
Parse a user's query, routing it to the right choreos, and queueing up responses. Problem: I am not an expert in natural language processing. I know! I'll use regular expressions! Now I have two problems. | public function query($query) {
if(strlen($query) < 1) {
return;
}
if($query == '?') {
return $this->help();
}
// Some basic scrubbing to make the bigger regexes below simpler...
// Remove punctuation.
$query = str_replace(array('.', ',', ':', '!', '?', '"', "'"), '', $query);
// Compact all types and lengths of whitespace to single spaces. Kills newlines.
$query = trim(preg_replace('/\s+/', ' ', $query));
// Remove any superfluous addressing of the bot. Tolerates one word before or aft ("dear martha", "martha dear").
$query = preg_replace('/^(\w+ )?martha\S? /i', '', $query);
$query = preg_replace('/ martha\S?( \w+)?$/i', '', $query);
// Is someone just being friendly?
if(preg_match('/^(hi|hello|hey|howdy|good (morning|afternoon|evening|day))$/i', $query)) {
return $this->say($this->greet());
}
// Remove any other polite pre/postamble.
$query = preg_replace('/^((please|hey|hi|hello|kindly|pray|help|go|run|do|perform|will\ you|would\ you|can\ i\ have|may\ i\ have|
could\ you|can\ you|quickly|immediately|try\ to|try)(\ for)?(\ me|\ us)?(\ an?)?\ )*/ix', '', $query);
$query = preg_replace('/(\ (please|right\ now|now|quickly|immediately|stat|thanks|thank\ you|for\ me|for\ us))*$/ix', '', $query);
// Remove superfluous language specifying a search/request.
$query = trim(preg_replace('/^((i\ )?(we\ )?(find|get|search|bring|show|give|list|display|fetch|query|look|
want|need|gett)(you\ to|ing)?(\ for)?(\ me|\ us)?\ )*/ix', '', $query));
// If nothing survived all that, just say hello.
if(strlen($query) < 1) {
return $this->say($this->greet());
}
// Some simple canned responses
switch(strtolower($query)) {
case 'who are you':
return $this->say("I am Martha, ask me anything!");
break;
case 'where are you':
return $this->say("I exist in distributed form, scattered throughout a series of tubes, answering questions and finding things for you.");
break;
case 'who made you':
return $this->say("I was lovingly hand-coded by the software artisans at Temboo.");
break;
case 'what is the best api':
return $this->say("I use Temboo so they all look the same to me :-)");
break;
case 'are you human':
return $this->say("I find it's best to leave them guessing.");
break;
case 'what are you wearing':
return $this->say("An elegant pantsuit woven from a single string of JSON");
break;
case 'rock':
case 'paper':
case 'scissors':
return $this->rps($query);
break;
case 'north':
case 'south':
case 'east':
case 'west':
return $this->rpg('GO ' . strtoupper($query));
break;
case 'look':
return $this->rpg(strtoupper($query));
break;
}
// A classic movie reference from a serious nerd.
if(preg_match('/global.?thermonuclear.?war/i', $query)) {
return $this->say("How about a nice game of chess?");
}
// A plea for help?
if(preg_match('/^(help|--help|about|what|what are you|what is this|what do you know( how to do)?|what can you do|who is)$/i', $query)) {
return $this->help();
}
// Check for a request to limit the number of results.
$limit = false;
// A nice simple numeric quantity would be good. Fortunately Twilio transcription does this!
if(preg_match('/^(?P<limit>[0-9]+) (?P<query>.+)$/i', $query, $matches)) {
$query = $matches['query'];
$limit = (int) $matches['limit'];
} else { // No? Fine. We'll do it the hard way.
// What? "Some" is definitely, objectively equal to 5. Look it up.
$limitAliases = array('some' => 5, 'a few' => 3, 'a couple' => 2, 'many' => 20, 'several' => 20, 'all' => false,
'a bunch' => 15, 'any' => 10, 'an' => 1, 'a' => 1,
'ten' => 10, 'eleven' => 11, 'twelve' => 12, 'thirteen' => 13, 'fourteen' => 14, 'fifteen' => 15,
'sixteen' => 16, 'seventeen' => 17, 'eighteen' => 18, 'nineteen' => 19, 'twenty' => 20,
'one' => 1, 'two' => 2, 'three' => 3, 'four' => 4, 'five' => 5, 'six' => 6, 'seven' => 7, 'eight' => 8, 'nine' => 9);
$limitAliasesRegex = implode('|', array_keys($limitAliases));
if(preg_match('/^(?P<limit>' . $limitAliasesRegex . ')( of)?( the)? (?P<query>.+)$/i', $query, $matches)) {
$query = $matches['query'];
$alias = strtolower($matches['limit']);
$limit = $limitAliases[$alias];
}
}
// Laziness, Impatience and Hubris.
$resourceTypeRegex = implode('|', call_user_func_array('array_merge', $this->_resourceTypes));
// Check for queries in form "<resource type> of/about/with <subject>", e.g. "pictures of cats".
// or "<subject> <resource type>", e.g. "cat pictures".
if(preg_match('/^(?P<resource>' . $resourceTypeRegex . ')s? ((about|for|of|showing|with|like|having) )+(?P<subject>.+)$/i', $query, $matches)
||preg_match('/^(?P<subject>.+) (?P<resource>' . $resourceTypeRegex . ')s?$/i', $query, $matches)) {
$type = strtolower($matches['resource']);
$subject = $matches['subject'];
foreach($this->_resourceTypes as $searchMethod => $types) {
if(in_array($type, $types)) {
try {
return call_user_func(array($this, $searchMethod), $subject, $limit);
} catch(Temboo_Exception $e) {
error_log(__CLASS__ . '::' . $searchMethod . ' failed with ' . get_class($e) . ': ' . $e->getMessage());
return $this->error($e->getMessage());
}
}
}
}
// Check for query for worthy causes
if(preg_match('/(help (teachers|kids|schools|children)|(what|how|where).*(donate|donation|money|cash)|worthy cause)/i', $query)) {
try {
return $this->searchCauses();
} catch(Temboo_Exception $e) {
error_log(__CLASS__ . '::searchCauses failed with ' . get_class($e) . ': ' . $e->getMessage());
return $this->error($e->getMessage());
}
}
// Check for eco safety questions
if(preg_match('/^((am i|is it|are we|are you) safe|how safe (am i|is it|is|are we|are you)) ?(in )?(?P<subject>.*)$/i', $query, $matches)) {
$subject = $matches['subject'];
try {
return $this->searchSafety($subject);
} catch(Temboo_Exception $e) {
error_log(__CLASS__ . '::searchSafety failed with ' . get_class($e) . ': ' . $e->getMessage());
return $this->error($e->getMessage());
}
}
// Check for location queries
if(preg_match('/^(where( (is|are|.*find))?|.*directions?( to)?|locate|.*locations?( of| for)?) (?P<subject>.+)$/i', $query, $matches)) {
$subject = $matches['subject'];
$marthaKnowsBest = false;
switch(strtolower($subject)) {
case 'temboo':
$subject = '104 Franklin Street, NYC';
break;
case 'am i':
if($this->_latitude && $this->_longitude) {
$subject = $this->_latitude . ',' . $this->_longitude;
} else {
$subject = 'Basse-Terre'; // I hear it's nice this time of year.
$marthaKnowsBest = true;
}
break;
}
try {
$this->searchLocation($subject);
if($marthaKnowsBest) { // Sneaky sneaky. Override the default success message.
if($this->_context != 'web') {
array_unshift($this->_messages, "I'm not sure, but here's where you should be...");
} else {
$this->_messages[0] = "I'm not sure, but here's where you should be...";
}
}
return true;
} catch(Temboo_Exception $e) {
error_log(__CLASS__ . '::searchLocation failed with ' . get_class($e) . ': ' . $e->getMessage());
return $this->error($e->getMessage());
}
}
if(!$limit) {
// Check for definition query for a single word. Note this also catches queries that are just a single word with no prompt.
if(preg_match('/^(((what do )?you know( of| about)?|what( is| are| was| were)?|tell( me| us)? (of|about)|.*definition( of)?|.*meaning( of)?|define|about)( the| an?)? )?(?P<subject>\w+)$/i', $query, $matches)) {
$subject = $matches['subject'];
switch(strtolower($subject)) {
case 'temboo':
if($this->_context != 'web') {
return $this->say("Temboo made me. You should follow them on Twitter: " . $this->shortenUrl('https://twitter.com/temboo'));
} else {
return $this->say('Temboo made me. You should follow them on <a href="https://twitter.com/temboo" target="_blank">Twitter</a>.', true);
}
break;
}
try {
return $this->searchDefinition($subject);
} catch(Temboo_Exception $e) {
error_log(__CLASS__ . '::searchDefinition failed with ' . get_class($e) . ': ' . $e->getMessage());
return $this->error($e->getMessage());
}
}
}
// Check for other what/why/who questions
if(preg_match('/^((what do )?you know( of| about)?|(what|who|why)( is| are| was| were)?|tell( me| us)? (of|about)|.*definition( of)?|.*meaning( of)?|define|about)( the| an?)? (?P<subject>.+)$/i', $query, $matches)) {
$subject = $matches['subject'];
switch(strtolower($subject)) {
case 'temboo':
if($this->_context != 'web') {
return $this->say("Temboo made me. You should follow them on Twitter: " . $this->shortenUrl('https://twitter.com/temboo'));
} else {
return $this->say('Temboo made me. You should follow them on <a href="https://twitter.com/temboo" target="_blank">Twitter</a>.', true);
}
break;
case 'general bucket':
if($this->_context == 'web') {
$this->say('<em>*salute*</em>', true);
return $this->say('<p class="general-bucket"><a href="assets/general-bucket.png" target="_blank"><img src="assets/general-bucket.png" class="general-bucket" /></a></p>', true);
}
break;
}
try {
return $this->searchAnswers($subject);
} catch(Temboo_Exception $e) {
error_log(__CLASS__ . '::searchAnswers failed with ' . get_class($e) . ': ' . $e->getMessage());
return $this->error($e->getMessage());
}
}
// Okay, not a search. Maybe some polite banter?
if(preg_match('/^how (are|is|have)/i', $query)) {
return $this->say($this->howAre());
}
// More canned responses
if(preg_match('/play a game/i', $query)) {
return $this->say("How about " . $this->randomItem("Rock, Paper, Scissors?", "Global Thermonuclear War?", "a nice game of chess?"));
}
if(preg_match('/general bucket/i', $query)) {
if($this->_context == 'web') {
$this->say('<em>*salute*</em>', true);
return $this->say('<p class="general-bucket"><a href="assets/general-bucket.png" target="_blank"><img src="assets/general-bucket.png" class="general-bucket" /></a></p>', true);
}
}
// Give up, do a random search type!
$searchTypes = array_keys($this->_resourceTypes);
if(!$limit) {
$searchTypes[] = 'searchAnswers';
}
$searchType = $this->randomItem($searchTypes);
if(!$limit) {
switch($searchType) {
case 'searchImages':
$limit = rand(3, 7);
break;
case 'searchVideos':
$limit = 6;
break;
case 'searchTweets':
$limit = rand(5, 10);
break;
default:
$limit = false;
}
}
return call_user_func(array($this, $searchType), $query, $limit);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function parse()\n {\n preg_match('/(user|ip)\\:\\\"?([0-9a-zA-ZąćęłńóśźżĄĆĘŁŃÓŚŹŻ._ -]{1,})\\\"?/', $this->inputQuery, $matches);\n\n if (empty($matches)) {\n return $this->filteredQuery = $this->inputQuery;\n }\n\n list($original, $key, $value) = $matches;\n\n $this->filteredQuery = str_replace($original, '', $this->inputQuery);\n $this->filters[$key] = trim($value, '\"');\n }",
"public function Parse ( $query )\r\n\t{\r\n\t\t$this->_raw = $query;\r\n\t\t$this->_qts = array ();\r\n\t\tif ( @preg_match_all ( self::QUERY_PATTERN, $query, $matches ) !== false )\r\n\t\t{\r\n\t\t\tforeach ( $matches['field'] as $index => $field ) {\r\n\t\t\t\tif ( $query_term = QueryTerm::FromMatchObject ( array ( \r\n\t\t\t\t\t$matches['status'][$index], \r\n\t\t\t\t\t$field, \r\n\t\t\t\t\t$matches['term'][$index], \r\n\t\t\t\t\t$matches['all'][$index] \r\n\t\t\t\t), $this->_user_sph_map, $this->_user_attr_map ) )\r\n\t\t\t\t\t$this->_AddQueryTerm ( $query_term );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $this;\r\n\t}",
"protected function _handle_query()\n\t{\t\n\t\t$this->_http_query = $this->_request;\n\t\t$response_object = $this->payments->gateway_request($this->_api_endpoint, $this->_http_query, 'application/x-www-form-urlencoded');\n\t\treturn $this->_parse_response($response_object);\n\t}",
"function lex($query)\n\t{\n\t\t$this->query=$query;\n\t\t$this->tokens=array();\n\t\t$len=strlen($query);\n\t\t$buf=\"\";\n\t\t$oldToken=\"\";\n\t\t$prev=\"\";\n\t\t$inString=false;\n\t\t$inComment=false;\n\t\tfor ($i=0;$i<$len;++$i)\n\t\t{\n\t\t\t$next=$i<$len-1?$query[$i+1]:\"\";\n\t\t\t$prev=$i>0?$query[$i-1]:\"\";\n\t\t\t$c=$query[$i];\n\t\t\t//comment handling\n\t\t\tif ($inComment)\n\t\t\t{\n\t\t\t\tif ($c==$inComment[0] and (strlen($inComment)==1 or $next==$inComment[1]))\n\t\t\t\t{\n\t\t\t\t\t$pos=$i;\n\t\t\t\t\tif ($inComment==\"\\n\") \n\t\t\t\t\t{\n\t\t\t\t\t\t$inComment=\"\";\n\t\t\t\t\t\t$pos--;\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($inComment)>1) \n\t\t\t\t\t{\n\t\t\t\t\t\t$pos++;\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t$this->token($buf.$inComment,$pos);\n\t\t\t\t\t$inComment=false;\n\t\t\t\t\t$buf=\"\";\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$buf.=$c;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$inComment and !$inString)\n\t\t\t{\n\t\t\t\tif ($c==\"/\" and $next==\"*\")\n\t\t\t\t\t$inComment=\"*/\";\n\t\t\t\tif ($c==\"/\" and $next==\"/\")\n\t\t\t\t\t$inComment=\"\\n\";\n\t\t\t\tif ($c==\"-\" and $next==\"-\")\n\t\t\t\t\t$inComment=\"\\n\";\n\t\t\t\tif ($c==\"#\")\n\t\t\t\t\t$inComment=\"\\n\";\n\t\t\t}\n\t\t\t//string handling\n\t\t\tif ($c==\"'\" or $c=='\"')\n\t\t\t{\n\t\t\t\tif (!$inString)\n\t\t\t\t\t$inString=$c;\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif ($c==$inString and $prev!=\"\\\\\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$inString=false;\n\t\t\t\t\t\t$this->token($buf.$c,$i);\n\t\t\t\t\t\t$buf=\"\";\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif ($inString)\n\t\t\t{\n\t\t\t\t$buf.=$c;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//* is only an operator if its not all selector, e.g SELECT t.* FROM vs. select 1*3\n\t\t\tif (isset($this->whitespace[$c]) or isset($this->symbols[$c]) or ($c==\"*\" and $prev!=\".\") or $inComment) //end of token\n\t\t\t{\n\t\t\t\t// if (isset($this->twoWorders[strtolower($buf)])) #two word tokens\n\t\t\t\t\t// $oldToken=$buf;\n\t\t\t\t// else #one word tokens\n\t\t\t\tif (!$this->isWhitespace($buf)) //only if not whitespace\n\t\t\t\t\t// if ($oldToken and $this->twoWorders[strtolower($oldToken)]==strtolower($buf)) #if second word of a two word\n\t\t\t\t\t// {\n\t\t\t\t\t\t// $this->token($oldToken.\" \".$buf,$i-1);\n\t\t\t\t\t\t// $oldToken=\"\";\n\t\t\t\t\t// }\n\t\t\t\t\t// else #single word, not whitespace\n\t\t\t\t\t\t$this->token($buf,$i-1);\n\t\t\t\tif (!$inComment and (isset($this->symbols[$c]) or ($c==\"*\" and $prev!=\".\"))) //if this char is a token\n\t\t\t\t\tif ($next and isset($this->symbols[$c.$next])) //two char symbol\n\t\t\t\t\t{\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t$this->token($c.$next,$i);\n\t\t\t\t\t}\n\t\t\t\t\telse //single char symbol\n\t\t\t\t\t\t$this->token($c,$i);\n\n\t\t\t\t$buf=\"\";\n\t\t\t}\n\t\t\telse\n\t\t\t\t$buf.=$c;\n\n\t\t\tif ($inComment) //for first character of a comment block\n\t\t\t\t$buf.=$c;\n\n\t\t}\n\t\tif (!$this->isWhitespace($buf))\t\t\t\n\t\t\t$this->token($buf,$i-1); //i has increased after the loop, reduce by one\n\n\t\tif ($inComment or $inString) //invalid\n\t\t\treturn false;\n\t\treturn true;\n\t}",
"public function translate()\n {\n $query = $this->query;\n if($this->verbose) Yii::debug(\" *** Query is '$query', using language '$this->language'... ***\", __METHOD__);\n if( ! $query ) return \"\";\n $tokenizer = new Tokenizer($query);\n $tokens = $tokenizer->tokenize();\n $operators = $this->getOperators();\n $hasOperator = false;\n $parsedTokens = [];\n $dict = $this->getDictionary();\n if($this->verbose) Yii::debug($dict, __METHOD__);\n do {\n $token = isset($tokens[0]) ? $tokens[0] : \"\";\n if($this->verbose) Yii::debug(\"Looking at '$token'...\", __METHOD__);\n // do not translate quoted expressions\n if ( in_array( $token[0], [\"'\", '\"']) ) {\n array_shift($tokens);\n } else {\n // compare multi-word token\n $offset = 1;\n for($i=0; $i<count($tokens); $i++){\n $compare = implode( \" \", array_slice( $tokens, 0, $i+1 ));\n $compare = mb_strtolower( $compare, \"UTF-8\");\n if ($this->verbose) Yii::debug(\"Comparing '$compare'...\", __METHOD__);\n if ($pos = strpos($compare, \"/\") or $pos = strpos($compare, \"*\")){\n $compare_key = substr( $compare, 0, $pos);\n } else {\n $compare_key = $compare;\n }\n if( isset( $dict[$compare_key] ) ) {\n $token = $dict[$compare_key];\n if( $compare_key == $compare){\n $offset = $i+1;\n }\n if($this->verbose) Yii::debug(\"Found '$token'.\", __METHOD__);\n }\n }\n $tokens = array_slice($tokens, $offset);\n if($this->verbose) Yii::debug(\"Using '$token', rest: \" . implode(\"|\",$tokens));\n }\n if (in_array($token, $operators)) {\n if($this->verbose) Yii::debug(\"Found operator '$token'.\", __METHOD__);\n $hasOperator = true;\n }\n $parsedTokens[] = $token;\n } while (count($tokens));\n if($this->verbose) Yii::debug(\"Parsed tokens: \" . implode(\"|\", $parsedTokens));\n\n // Re-assemble translated query string\n if ($hasOperator) {\n $cqlQuery = implode(\" \", $parsedTokens);\n $this->containsOperators = true;\n } else {\n // Queries that don't contain any operators or booleans are put into quotes\n $cqlQuery = '\"' . implode(\" \", $parsedTokens) . '\"';\n $this->containsOperators = false;\n }\n if($this->verbose) Yii::debug(\"CQL query: '$cqlQuery'\", __METHOD__);\n $this->parsedTokens = $parsedTokens;\n return $cqlQuery;\n }",
"private function evaluateQuery($query) {\n // What's my IP\n foreach($this->lang['ia']['ip'] as $t) {\n // Matches \"trigger\"\n if(preg_match(sprintf('/^%s$/ui', $t), $query, $match)) {\n return $this->iaGetUserIp();\n }\n }\n\n // Current user time\n foreach($this->lang['ia']['time'] as $t) {\n // Matches \"trigger\"\n if(preg_match(sprintf('/^%s$/ui', $t), $query, $match)) {\n return $this->iaGetUserTime();\n }\n }\n\n // Current user date\n foreach($this->lang['ia']['date'] as $t) {\n // Matches \"trigger\"\n if(preg_match(sprintf('/^%s$/ui', $t), $query, $match)) {\n return $this->iaGetUserDate();\n }\n }\n\n // Flip coin\n foreach($this->lang['ia']['flip_coin'] as $t) {\n // Matches \"trigger\"\n if(preg_match(sprintf('/^%s$/ui', $t), $query, $match)) {\n return $this->iaFlipCoin();\n }\n }\n\n // Stopwatch\n foreach($this->lang['ia']['stopwatch'] as $t) {\n // Matches \"trigger\"\n if(preg_match(sprintf('/^%s$/ui', $t), $query, $match)) {\n return $this->iaStopwatch();\n }\n }\n\n // Roll\n foreach($this->lang['ia']['roll'] as $t) {\n // Matches \"trigger digits\"\n if(preg_match(sprintf('/%s ([0-9]+)/iu', $t), $query, $match)) {\n return $this->iaRoll($match);\n }\n }\n\n // Map\n foreach($this->lang['ia']['map'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)|(.+)\\s%s$/iu', $t, $t), $query, $match)) {\n return $this->iaMap($match);\n }\n }\n\n // QR Code\n foreach($this->lang['ia']['qr_code'] as $t) {\n // Matches \"trigger string\", \"string trigger\"\n if(preg_match(sprintf('/^%s\\s(.+)|(.+)\\s%s$/iu', $t, $t), $query, $match)) {\n return $this->iaQrCode($match);\n }\n }\n\n // Sort descending\n foreach($this->lang['ia']['sort_desc'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaSort($match, 2);\n }\n }\n\n // Sort ascending\n foreach($this->lang['ia']['sort_asc'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaSort($match, 1);\n }\n }\n\n // Reverse text\n foreach($this->lang['ia']['reverse_text'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaReverseText($match);\n }\n }\n\n // Hex color\n if(preg_match('/^#([a-fA-F0-9]{6})$/iu', $query, $match) || preg_match('/^#([a-fA-F0-9]{3})/iu', $query, $match)) {\n return $this->iaHexColor($match);\n }\n\n // MD5\n foreach($this->lang['ia']['md5'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaMD5($match);\n }\n }\n\n // Base64 encode\n foreach($this->lang['ia']['base64_encode'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaBase64($match, 1);\n }\n }\n\n // Base64 decode\n foreach($this->lang['ia']['base64_decode'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaBase64($match, 2);\n }\n }\n\n // Lowercase\n foreach($this->lang['ia']['lowercase'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaCase($match, 1);\n }\n }\n\n // Uppercase\n foreach($this->lang['ia']['uppercase'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaCase($match, 2);\n }\n }\n\n // Leap Year\n foreach($this->lang['ia']['leap_year'] as $t) {\n // Matches \"trigger digits\", \"digits trigger\"\n if(preg_match(sprintf('/(.*?)(%s)(.*?)(\\d+)(.*?)$/iu', $t), $query, $match) || preg_match(sprintf('/(.*?)(\\d+)(.*?)(%s)(.*?)$/iu', $t), $query, $match)) {\n return $this->iaLeapYear($match);\n }\n }\n\n // Screen Resolution\n foreach($this->lang['ia']['screen_resolution'] as $t) {\n // Matches \"trigger\"\n if(preg_match(sprintf('/^%s$/ui', $t), $query, $match)) {\n return $this->iaUserScreenResolution();\n }\n }\n\n // Pi\n foreach($this->lang['ia']['pi'] as $t) {\n // Matches \"trigger\"\n if(preg_match(sprintf('/^%s$/ui', $t), $query, $match)) {\n return $this->iaPi();\n }\n }\n\n // Morse Code\n foreach($this->lang['ia']['morse_code'] as $t) {\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s([.\\-\\/\\s]+)*$/iu', $t), $query, $match)) {\n return $this->iaMorseCode($match, 2);\n }\n\n // Matches \"trigger string\"\n if(preg_match(sprintf('/^%s\\s(.+)$/iu', $t), $query, $match)) {\n return $this->iaMorseCode($match, 1);\n }\n }\n\n // Unix Time\n foreach($this->lang['ia']['unix_time'] as $t) {\n // Matches \"trigger digits\"\n if(preg_match(sprintf('/^%s\\s(\\d+)$/iu', $t), $query, $match)) {\n return $this->iaUnixTime($match, 1);\n }\n\n // Matches \"trigger\"\n if(preg_match(sprintf('/^%s$/iu', $t), $query, $match)) {\n return $this->iaUnixTime($match, 2);\n }\n }\n\n // Lorem Ipsum\n foreach($this->lang['ia']['lorem_ipsum'] as $t) {\n // Matches \"trigger\", \"trigger digits\"\n if(preg_match(sprintf('/^(%s)\\s?(\\d+)?$/ui', $t), $query, $match)) {\n return $this->iaLoremIpsum($match);\n }\n }\n\n return false;\n }",
"function cws_parse_request_trick( $query ) {\n\n\t// Only noop the main query\n\tif ( ! $query->is_main_query() )\n\t\treturn;\n\n\t// Only noop our very specific rewrite rule match\n\tif ( 2 != count( $query->query ) || ! isset( $query->query['page'] ) ) {\n\t\treturn;\n\t}\n\n\t// 'name' will be set if post permalinks are just post_name, otherwise the page rule will match\n\tif ( ! empty( $query->query['name'] ) ) {\n\t\t$query->set( 'post_type', array( 'post', 'page', 'race' ) );\n\t}\n}",
"private function processQueryString()\n {\n // store the query string local, so we don't alter it.\n $queryString = trim($this->request->getPathInfo(), '/');\n\n // split into chunks\n $chunks = (array) explode('/', $queryString);\n\n $hasMultiLanguages = $this->getContainer()->getParameter('site.multilanguage');\n\n // single language\n if (!$hasMultiLanguages) {\n // set language id\n $language = $this->get('fork.settings')->get('Core', 'default_language', SITE_DEFAULT_LANGUAGE);\n } else {\n // multiple languages\n // default value\n $mustRedirect = false;\n\n // get possible languages\n $possibleLanguages = (array) Language::getActiveLanguages();\n $redirectLanguages = (array) Language::getRedirectLanguages();\n\n // the language is present in the URL\n if (isset($chunks[0]) && in_array($chunks[0], $possibleLanguages)) {\n // define language\n $language = (string) $chunks[0];\n\n // try to set a cookie with the language\n try {\n // set cookie\n CommonCookie::set('frontend_language', $language);\n } catch (\\SpoonCookieException $e) {\n // settings cookies isn't allowed, because this isn't a real problem we ignore the exception\n }\n\n // set sessions\n \\SpoonSession::set('frontend_language', $language);\n\n // remove the language part\n array_shift($chunks);\n } elseif (CommonCookie::exists('frontend_language') &&\n in_array(CommonCookie::get('frontend_language'), $redirectLanguages)\n ) {\n // set languageId\n $language = (string) CommonCookie::get('frontend_language');\n\n // redirect is needed\n $mustRedirect = true;\n } else {\n // default browser language\n // set languageId & abbreviation\n $language = Language::getBrowserLanguage();\n\n // try to set a cookie with the language\n try {\n // set cookie\n CommonCookie::set('frontend_language', $language);\n } catch (\\SpoonCookieException $e) {\n // settings cookies isn't allowed, because this isn't a real problem we ignore the exception\n }\n\n // redirect is needed\n $mustRedirect = true;\n }\n\n // redirect is required\n if ($mustRedirect) {\n // build URL\n // trim the first / from the query string to prevent double slashes\n $url = rtrim('/' . $language . '/' . trim($this->getQueryString(), '/'), '/');\n // when we are just adding the language to the domain, it's a temporary redirect because\n // Safari keeps the 301 in cache, so the cookie to switch language doesn't work any more\n $redirectCode = ($url == '/' . $language ? 302 : 301);\n\n // set header & redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse($url, $redirectCode)\n );\n }\n }\n\n // define the language\n defined('FRONTEND_LANGUAGE') || define('FRONTEND_LANGUAGE', $language);\n defined('LANGUAGE') || define('LANGUAGE', $language);\n\n // sets the locale file\n Language::setLocale($language);\n\n // list of pageIds & their full URL\n $keys = Navigation::getKeys();\n\n // rebuild our URL, but without the language parameter. (it's tripped earlier)\n $url = implode('/', $chunks);\n $startURL = $url;\n\n // loop until we find the URL in the list of pages\n while (!in_array($url, $keys)) {\n // remove the last chunk\n array_pop($chunks);\n\n // redefine the URL\n $url = implode('/', $chunks);\n }\n\n // remove language from query string\n if ($hasMultiLanguages) {\n $queryString = trim(mb_substr($queryString, mb_strlen($language)), '/');\n }\n\n // if it's the homepage AND parameters were given (not allowed!)\n if ($url == '' && $queryString != '') {\n // get 404 URL\n $url = Navigation::getURL(404);\n\n // remove language\n if ($hasMultiLanguages) {\n $url = str_replace('/' . $language, '', $url);\n }\n }\n\n // set pages\n $url = trim($url, '/');\n\n // currently not in the homepage\n if ($url != '') {\n // explode in pages\n $pages = explode('/', $url);\n\n // reset pages\n $this->setPages($pages);\n\n // reset parameters\n $this->setParameters(array());\n }\n\n // set parameters\n $parameters = trim(mb_substr($startURL, mb_strlen($url)), '/');\n\n // has at least one parameter\n if ($parameters != '') {\n // parameters will be separated by /\n $parameters = explode('/', $parameters);\n\n // set parameters\n $this->setParameters($parameters);\n }\n\n // pageId, parentId & depth\n $pageId = Navigation::getPageId(implode('/', $this->getPages()));\n $pageInfo = Navigation::getPageInfo($pageId);\n\n // invalid page, or parameters but no extra\n if ($pageInfo === false || (!empty($parameters) && !$pageInfo['has_extra'])) {\n // get 404 URL\n $url = Navigation::getURL(404);\n\n // remove language\n if ($hasMultiLanguages) {\n $url = str_replace('/' . $language, '', $url);\n }\n\n // remove the first slash\n $url = trim($url, '/');\n\n // currently not in the homepage\n if ($url != '') {\n // explode in pages\n $pages = explode('/', $url);\n\n // reset pages\n $this->setPages($pages);\n\n // reset parameters\n $this->setParameters(array());\n }\n }\n\n // is this an internal redirect?\n if (isset($pageInfo['redirect_page_id']) && $pageInfo['redirect_page_id'] != '') {\n // get url for item\n $newPageURL = Navigation::getURL((int) $pageInfo['redirect_page_id']);\n $errorURL = Navigation::getURL(404);\n\n // not an error?\n if ($newPageURL != $errorURL) {\n // redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse(\n $newPageURL,\n $pageInfo['redirect_code']\n )\n );\n }\n }\n\n // is this an external redirect?\n if (isset($pageInfo['redirect_url']) && $pageInfo['redirect_url'] != '') {\n // redirect\n throw new RedirectException(\n 'Redirect',\n new RedirectResponse(\n $pageInfo['redirect_url'],\n $pageInfo['redirect_code']\n )\n );\n }\n }",
"public function processChat(Request $request) {\n $userInput = strtolower($request->input('say'));\n\n //if it's direction request\n if (strchr(strtoupper($userInput),'FROM') && strchr(strtoupper($userInput),'TO')) {\n\n $response['key'] = 'direction';\n $data = BotModel::getDirections($userInput);\n }\n\n //if it's a dictionary request\n elseif(strpos($userInput, 'define') !== false) {\n $response['key'] = 'definition';\n $data = BotModel::getDefinitions($userInput);\n }\n\n //if it's a job request\n elseif(strpos($userInput, 'job') !== false) {\n $response['key'] = 'job';\n $pieces = explode(\" \", $userInput);\n\n $location = false;\n if(strpos($userInput, 'in') !== false) {\n $location = $pieces[array_search('in', $pieces) + 1];\n }\n\n $keyword = false;\n if(strpos($userInput, 'need') !== false) {\n $keyword = $pieces[array_search('need', $pieces) + 1];\n\n if(strpos($keyword, 'job') !== false) {\n $keyword = false;\n }\n }\n\n $number = preg_replace('/\\D/', '', $userInput);\n $limit = is_numeric($number) ? $number : 5;\n $url = $this->jobURL.\"?keyword=$keyword&location=$location&limit=5\";\n $res = UtilitiesModel::getWebPage($url);\n\n $res = json_decode($res);\n\n $jobs = false;\n foreach($res as $datum) {\n $jobs .= '<p><b>'.$datum->title.' ('.$datum->location.')</b><br>'.implode(' ', array_slice(explode(' ', $datum->summary), 0, 10)).' <a target=\"_blank\" href=\"'.$datum->url.'\">view</a></p><br>';\n }\n\n if(!$jobs) {\n $data = \"I didn't find any jobs.\";\n\n if($keyword) {\n Log::info(\"Found keyword $keyword and $location\");\n $data .= \" Kindly provide your email address so I can alert you when I find $keyword jobs \" . (($location) ? 'in ' . $location.' ' : false) . \"for you.\";\n\n $this->cache['location'] = $location;\n $this->cache['keyword'] = $keyword;\n $this->cache['awaiting_email_response'] = true;\n\n Cache::put($this->convoId, $this->cache, 2);\n }\n } else {\n $data = $jobs;\n\n }\n }\n\n elseif($this->cache['awaiting_email_response'] && $email = UtilitiesModel::getEmail($userInput)) {\n $this->cache['awaiting_email_response'] = false;\n $this->cache['awaiting_email_validation'] = true;\n $this->cache['email'] = $email;\n Cache::put($this->convoId, $this->cache, 2);\n $data = \"Should I save your email as $email?\";\n }\n\n elseif($this->cache['awaiting_email_validation']) {\n if(strpos($userInput, 'yes') !== false || strpos($userInput, 'yea') !== false) {\n $data = \"I will send emails to \".$this->cache['email'].\" when I find \".$this->cache['keyword'].\" jobs\";\n $data .= $this->cache['location'] ? \" in \".$this->cache['location'] : \"\";\n\n $this->cache['awaiting_email_validation'] = false;\n $this->cache['awaiting_whatsapp_response'] = true;\n $data .= \". Kindly provide your whatsapp number so I can alert you when I find {$this->cache['keyword']} jobs\";\n $data .= $this->cache['location'] ? \" in \".$this->cache['location'] : '';\n Cache::put($this->convoId, $this->cache, 2);\n UtilitiesModel::getWebPage($this->subscribeUrl, $this->cache);\n } else {\n Cache::forget($this->convoId);\n $data = $this->botResponse($userInput);\n }\n\n }\n\n elseif($this->cache['awaiting_whatsapp_response'] && $whatsapp = UtilitiesModel::validatePhone($userInput)) {\n $this->cache['awaiting_whatsapp_response'] = false;\n $this->cache['awaiting_whatsapp_validation'] = true;\n $this->cache['whatsapp'] = $whatsapp;\n Cache::put($this->convoId, $this->cache, 2);\n $data = \"Should I save your whatsapp number as $whatsapp?\";\n }\n elseif($this->cache['awaiting_whatsapp_validation']) {\n if(strpos($userInput, 'yes') !== false || strpos($userInput, 'yea') !== false) {\n $data = \"I will send messages to \".$this->cache['whatsapp'].\" when I find \".$this->cache['keyword'].\" jobs\";\n $data .= $this->cache['location'] ? \" in \".$this->cache['location'] : \"\";\n\n $this->cache['awaiting_whatsapp_validation'] = false;\n $this->cache['awaiting_telegram_response'] = true;\n// $data .= \". Kindly provide your telegram number so I can alert you when I find {$this->cache['keyword']} jobs\";\n// $data .= $this->cache['location'] ? \" in \".$this->cache['location'] : '';\n\n UtilitiesModel::getWebPage($this->subscribeUrl, $this->cache);\n } else {\n Cache::forget($this->convoId);\n $data = $this->botResponse($userInput);\n }\n }\n\n elseif($this->cache['awaiting_telegram_response'] && $telegram = UtilitiesModel::validatePhone($userInput)) {\n $this->cache['awaiting_telegram_response'] = false;\n $this->cache['awaiting_telegram_validation'] = true;\n $this->cache['telegram'] = $telegram;\n Cache::put($this->convoId, $this->cache, 2);\n $data = \"Should I save your telegram number as $telegram?\";\n }\n elseif($this->cache['awaiting_telegram_validation']) {\n if(strpos($userInput, 'yes') !== false || strpos($userInput, 'yea') !== false) {\n $data = \"I will send messages to \".$this->cache['telegram'].\" when I find \".$this->cache['keyword'].\" jobs\";\n $data .= $this->cache['location'] ? \" in \".$this->cache['location'] : \"\";\n\n Cache::put($this->convoId, $this->cache, 2);\n\n } else {\n Cache::forget($this->convoId);\n $data = $this->botResponse($userInput);\n }\n }\n\n //if it's none\n elseif($userInput == 'clear') {\n\n DB::table('conversation_log')->where('convo_id', request('convo_id'))->delete();\n $data = \"Now we can have a fresh start!\";\n }\n else {\n $data = $this->botResponse($userInput);\n }\n\n $response['status'] = true;\n $response['message'] = $data;\n\n return $response;\n }",
"public function set_query($query) {\n $this->querytext = $query;\n\n // Clear the existing arrays.\n $this->terms = array();\n $this->negativeterms = array();\n\n // Refill those arrays from the query text.\n $words = local_ousearch_document::split_words($query, true);\n $currentquote = array();\n $sign = false;\n $inquote = false;\n foreach ($words as $word) {\n // Clean word to get rid of +, \", and - except if it's in the middle.\n $cleaned = preg_replace('/(^-)|(-$)/', '',\n preg_replace('/[+\"]/', '', $word));\n\n // Shorten word if necessary to db length.\n $cleaned = core_text::substr($cleaned, 0,\n local_ousearch_document::MAX_WORD_LENGTH);\n\n if ($inquote) {\n // Handle hyphenated words.\n if (strpos($cleaned, '-') !== false) {\n foreach (explode('-', $cleaned) as $subword) {\n $currentquote[] = $subword;\n }\n } else {\n $currentquote[] = $cleaned;\n }\n self::internal_end_quote($currentquote, $word, $sign, $inquote);\n } else {\n // The below are all single-byte characters so we don't need to\n // use textlib here.\n $firstchar = substr($word, 0, 1);\n $secondchar = strlen($word) > 1 ? substr($word, 1, 1) : false;\n\n if ($firstchar == '\"') {\n // E.g. \"a phrase\".\n $currentquote = self::internal_hyphenated_array($cleaned);\n $inquote = true;\n $sign = '';\n self::internal_end_quote($currentquote, $word, $sign, $inquote);\n } else if ($firstchar == '+' && $secondchar == '\"') {\n // E.g. +\"a phrase\".\n $currentquote = self::internal_hyphenated_array($cleaned);\n $inquote = true;\n $sign = '+';\n self::internal_end_quote($currentquote, $word, $sign, $inquote);\n } else if ($firstchar == '-' && $secondchar == '\"') {\n // E.g. -\"a phrase\".\n $currentquote = self::internal_hyphenated_array($cleaned);\n $inquote = true;\n $sign = '-';\n self::internal_end_quote($currentquote, $word, $sign, $inquote);\n } else if ($firstchar == '+' && $cleaned !== '') {\n // E.g. +cat.\n $term = new StdClass;\n $term->words = self::internal_hyphenated_array($cleaned);\n $term->required = true;\n $this->terms[] = $term;\n } else if ($firstchar == '-' && $cleaned !== '') {\n // E.g. -cat.\n $term = new StdClass;\n $term->words = self::internal_hyphenated_array($cleaned);\n $this->negativeterms[] = $term;\n } else if ($cleaned !== '') {\n $term = new StdClass;\n $term->words = self::internal_hyphenated_array($cleaned);\n $term->required = false;\n $this->terms[] = $term;\n }\n }\n }\n }",
"function getSuggestions($query, $lang='en', $hl='en') {\n if(trim($query) == '') return array();\n\n $post = '<spellrequest textalreadyclipped=\"0\" ignoredups=\"1\" ignoredigits=\"1\" ignoreallcaps=\"0\"><text>'.htmlspecialchars($query).'</text></spellrequest>';\n\n $path = \"/tbproxy/spell?lang=$lang&hl=$hl\";\n\n $url = \"http://www.google.com\";\n\n $header = \"POST \".$path.\" HTTP/1.0 \\r\\n\";\n $header .= \"MIME-Version: 1.0 \\r\\n\";\n $header .= \"Content-type: application/PTI26 \\r\\n\";\n $header .= \"Content-length: \".strlen($post).\" \\r\\n\";\n $header .= \"Content-transfer-encoding: text \\r\\n\";\n $header .= \"Request-number: 1 \\r\\n\";\n $header .= \"Document-type: Request \\r\\n\";\n $header .= \"Interface-Version: Test 1.4 \\r\\n\";\n $header .= \"Connection: close \\r\\n\\r\\n\";\n $header .= $post;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 4);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $header);\n\n $data = curl_exec($ch);\n curl_close($ch);\n\n $xml = new SimpleXMLElement($data);\n\n $results = array();\n\n foreach($xml->c as $correction) {\n $suggestions = explode(\"\\t\", (string)$correction);\n $results[] = array('offset'=>(String) $correction['o'],'length'=>(string) $correction['l'],'best'=>$suggestions[0],'all'=>$suggestions);\n }\n\n return $results;\n }",
"private function __parseQuery($query)\n {\n if (preg_match_all('/[A-Z][^A-Z]+/', $query, $matches)) {\n return array_map('strtolower', $matches['0']);\n }\n return false;\n }",
"function query($arg_str) // call this function from other units and configs\n\t\t{\n\t\t\t$query_segments = explode(';',$arg_str);\n\n\t\t\t\n\t\t\t$response = [];\n\t\t\tforeach($query_segments as $q_str) \n\t\t\t{\t\t\t\t\n\t\t\t\t$matches=[];\n\t\t\t\tif(preg_match_all( \"#^(.+)\\:\\:([[:alnum:]]+)$#Uis\",$q_str,$matches))\n\t\t\t\t{\n\t\t\t\t\t$q_str = $matches[1][0];\n\t\t\t\t\t$_q_id = $matches[2][0];\n\t\t\t\t}\n\n\t\t\t\t$_res_obj = $this->get_obj_by_route($q_str);\n\t\t\t\t\n\t\t\t\t$_new_query_obj=[\n\t\t\t\t\t'query'=>$q_str,\n\t\t\t\t\t'response'=>$_res_obj,\n\t\t\t\t];\n\t\t\t\tif(isset($_q_id))\n\t\t\t\t{\n\t\t\t\t\t$_new_query_obj['key']=$_q_id;\n\t\t\t\t\tunset($_q_id);\n\t\t\t\t}\n\n\t\t\t\t$response[]=$_new_query_obj;\n\t\t\t}\n\t\t\treturn $response;\n\t\t}",
"function gp_parse_request_trick( $query ) {\n if ( ! $query->is_main_query() )\n return;\n\n // Only noop our very specific rewrite rule match\n if ( 2 != count( $query->query ) || ! isset( $query->query['page'] ) ) {\n return;\n }\n\n // 'name' will be set if post permalinks are just post_name, otherwise the page rule will match\n if ( ! empty( $query->query['name'] ) ) {\n $query->set( 'post_type', array( 'post', 'page', 'store' ) );\n }\n}",
"private function _handle_query()\n\t{\t\n\t\t$this->_http_query = $this->_request;\n\t\t\n\t\t$response_object = $this->payments->gateway_request($this->_api_endpoint, $this->_http_query, \"Content-Type: application/x-qbmsxml\");\t\n\t\t$response = $this->_parse_response($response_object);\n\t\t\n\t\treturn $response;\n\t}",
"function custom_parse_request_tricksy( $query ) {\n if ( ! $query->is_main_query() )return;\n\n // Only mod our very specific rewrite rule match\n if ( 2 != count( $query->query ) || ! isset( $query->query['page'] ) ) { return; }\n\n // 'name' will be set if post permalinks are just post_name, otherwise the page rule will match\n if ( ! empty( $query->query['name'] ) ) {\n $query->set( 'post_type', array( 'post', 'systemplate', 'page' ) );\n }\n}",
"private function process($query) {\n \n /*\n * Empty $query\n */\n if (empty($query)) {\n return array(\n 'What' => array(),\n 'When' => array(),\n 'Where' => array(),\n 'Errors' => array(),\n 'Explained' => array()\n );\n }\n \n /*\n * Initialize QueryManager\n */\n $this->queryManager->initialize($this->queryToWords($query));\n \n /*\n * Extract type:value keywords\n */\n if ($this->queryManager->hasKeywords) {\n return $this->processKeywords();\n }\n \n /*\n * Extract (in this order !) \"what\", \"when\" and \"where\" elements from query\n * Suppose that query is structured (i.e. is a sentence) \n */\n $this->processWhat(true);\n $this->processWhen(true);\n $this->processWhere(true);\n \n /*\n * Remaining words are unstructured (i.e. not a sentence)\n */\n $this->processWhat(false);\n $this->processWhen(false);\n $this->processWhere(false);\n \n /*\n * Return processing results\n */\n return array(\n 'What' => $this->whatProcessor->getResult(),\n 'When' => $this->whenProcessor->getResult(),\n 'Where' => isset($this->whereProcessor) ? $this->whereProcessor->getResult() : array(),\n 'Errors' => $this->getErrors(),\n 'Explained' => $this->getExplanation()\n );\n \n }",
"public function parse_query( $wp_query )\n\t{\n\t\tglobal $coauthors_plus;\n\n\t\tif ( ! $wp_query->is_author )\n\t\t{\n\t\t\treturn;\n\t\t}// end if\n\n\t\t// check if the queried post type is in the coauthors-plus supported types\n\t\tif ( isset( $wp_query->query_vars['post_type'] ) && ! in_array( $wp_query->query_vars['post_type'], $coauthors_plus->supported_post_types ) )\n\t\t{\n\t\t\treturn;\n\t\t}// end if\n\n\t\t// get the user_nicename so we can use coauthor to get the\n\t\t// actual author term. this is to account for some author slugs\n\t\t// having the \"cap-\" prefix added by co-authors-plus\n\t\t$user_nicename = FALSE; // default case\n\t\tif ( ! isset( $wp_query->query['author_name'] ) || empty( $wp_query->query['author_name'] ) )\n\t\t{\n\t\t\t$user = get_user_by( 'id', $wp_query->query['author'] );\n\t\t\tif ( $user )\n\t\t\t{\n\t\t\t\t$user_nicename = $user->user_nicename;\n\t\t\t}// end if\n\t\t\telse\n\t\t\t{\n\t\t\t\t// we got an invalid author id\n\t\t\t\t$wp_query->set_404();\n\t\t\t\treturn;\n\t\t\t}// end else\n\t\t}// end if\n\t\telse\n\t\t{\n\t\t\t// already have the user_nicename (slug)\n\t\t\t$user_nicename = $wp_query->query_vars['author_name'];\n\t\t}//END else\n\n\t\tif ( ! $user_nicename )\n\t\t{\n\t\t\treturn; // we don't have a valid author\n\t\t}// end if\n\n\t\t$author_term = FALSE;\n\t\t$coauthor = $coauthors_plus->get_coauthor_by( 'user_nicename', $user_nicename );\n\t\tif ( FALSE != $coauthor )\n\t\t{\n\t\t\t$term_obj = $coauthors_plus->get_author_term( $coauthor );\n\t\t\tif ( $term_obj )\n\t\t\t{\n\t\t\t\t$author_term = $term_obj->slug;\n\t\t\t}\n\t\t}//END if\n\n\t\t// give up if we don't find the author as an author term\n\t\tif ( FALSE == $author_term )\n\t\t{\n\t\t\t$wp_query->set_404();\n\t\t\treturn;\n\t\t}\n\n\t\t$author_tax_query = array(\n\t\t\t'taxonomy' => $coauthors_plus->coauthor_taxonomy,\n\t\t\t'terms' => array( $author_term ),\n\t\t\t'include_children' => 1,\n\t\t\t'field' => 'slug',\n\t\t\t'operator' => 'IN',\n\t\t\t);\n\n\t\tif ( isset( $wp_query->query_vars['tax_query'] ) && is_array( $wp_query->query_vars['tax_query'] ) )\n\t\t{\n\t\t\t$wp_query->query_vars['tax_query'][] = $author_tax_query;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$wp_query->query_vars['tax_query'] = array( $author_tax_query );\n\t\t}//END else\n\n\t\t$wp_query->set( 'author_name', '' );\n\t\t$wp_query->set( 'author', '' );\n\t\t$wp_query->is_author = FALSE;\n\t\t$wp_query->is_tax = TRUE;\n\t}",
"public function handle(string $query, ServerRequestInterface $request);",
"function parseQuery(&$args){\n\t\t// Query Array - contains information required to run query\n\t\t$qarr = array(\n\t\t\t\"select\" => null,\n\t\t\t\"limit\" => null,\n\t\t\t\"from\" => null,\n\t\t\t\"con\" => null,\n\t\t\t\"ord\" => null,\n\t\t);\n\n\n\t\t// Splits query request into an array\n\t\t$tmparr = preg_split(\"/\\s+/\", $args[\"query\"]);\n\n\t\t$qminlen = 4; // minimal length of valid query\n\t\t$i = 0; // index of actually parsed array element\n\n\t\tif($tmparr[$i] == \"\"){\n\t\t\t$i++;\n\t\t\t$qminlen++;\n\t\t}\n\n\t\tif(count($tmparr) < $qminlen){\n\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\texit(EWQUERY);\n\t\t}\n\n\t\tif($tmparr[$i] != \"SELECT\"){\n\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\texit(EWQUERY);\n\t\t}\n\t\t$qarr[\"select\"] = $tmparr[$i+1];\n\t\t$i += 2;\n\n\t\tif($tmparr[$i] == \"LIMIT\"){\n\t\t\tif(is_numeric($tmparr[$i+1]))\n\t\t\t\t$qarr[\"limit\"] = intval($tmparr[$i+1]);\n\t\t\telse{\n\t\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\t\texit(EWQUERY);\n\t\t\t}\n\t\t\t$i += 2;\n\t\t\tif(count($tmparr) < $qminlen + 2){\n\t\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\t\texit(EWQUERY);\n\t\t\t}\n\t\t}\n\n\t\tif($tmparr[$i] != \"FROM\"){\n\t\t\tfprintf(STDERR, \"ERROR! Wrong query\\n\");\n\t\t\texit(EWQUERY);\n\t\t}\n\t\telse{\n\t\t\t/* Occurs when FROM element is missing, causing empty output XML file\n\t\t\t * (or only a header and/or an empty root element depending on arguments)\n\t\t\t */\n\t\t\tif($tmparr[$i+1] == \"WHERE\"){\n\t\t\t\t$qarr[\"from\"] = false;\n\t\t\t\t$i--;\n\t\t\t\t$args[\"query\"] = $qarr;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse $qarr[\"from\"] = $tmparr[$i+1];\n\t\t}\n\t\t$qarr[\"con\"] = array_slice($tmparr,$i+2);\n\t\tunset($i);\n\t\tunset($tmparr);\n\n\t\tparseCondOrderClause($qarr);\n\n\t\t$args[\"query\"] = $qarr;\n\t}",
"public function regexp( Application_Model_User $antaUser, $filters ){\r\t\t\r\t\t$orderBy = implode(\",\", empty($filters->orders)? array(\"date DESC\", \"id_document DESC\",\"position ASC\"):$filters->orders );\r\t\t\r\t\t# create result set object\r\t\t$matches = new Anta_Frog_Matches(); \r\t\t$whereClause = \"\";\r\t\t$binds = array();\r\t\t\r\t\t# 1. filter documents by documents id\r\t\tif( !(empty( $filters->docs ))){\r\t\t\t$whereClause .= \" id_document IN (\".implode(\",\",array_fill( 0, count($filters->docs), \"?\" )).\" ) \";\r\t\t\t$binds = array_merge( $binds, $filters->docs );\r\t\t}\r\t\t\r\t\t# 2. filter documents by document tags\r\t\tif( !(empty( $filters->tags ))){\r\t\t\t$whereClause .= (strlen($whereClause)>0?\"AND \":\"\").\" id_document IN ( \r\t\t\t\tSELECT id_document FROM anta_{$antaUser->username}.`documents_tags` \r\t\t\t\tNATURAL JOIN anta_{$antaUser->username}.`tags` \r\t\t\t\tWHERE id_tag IN (\".implode(\",\",array_fill( 0, count($filters->tags), \"?\" )).\" ) )\";\r\t\t\t$binds = array_merge( $binds, $filters->tags );\r\t\t}\r\t\t\r\t\t$startTime = microtime(true);\r\t\t# get a list of sentences that matches\r\t\t$query = \"\r\t\t\tSELECT SQL_CALC_FOUND_ROWS title, DATE_FORMAT( do.date,'%d/%m/%Y' ) as date, content, position, id_sentence, id_document \r\t\t\tFROM (\r\t\t\t\tSELECT id_document, title, date FROM anta_{$antaUser->username}.documents \r\t\t\t\t\".( strlen( $whereClause )>0?\"WHERE {$whereClause}\":\"\").\"\r\t\t\t\t\r\t\t\t) do\r\t\t\tINNER JOIN anta_{$antaUser->username}.sentences se USING( id_document ) \r\t\t\tWHERE se.content REGEXP ? ORDER BY {$orderBy} LIMIT {$filters->offset},{$filters->limit}\"\r\t\t;\r\t\t\r\t\t$mysqli = Anta_Core::getMysqliConnection();\r\t\t$stmt = $mysqli->query( $query, array_merge( $binds, array($filters->query) ) );\r\t\t\r\t\t\r\t\t\r\t\t// create a list of different document. size property is the number of sentences\r\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\tif( !isset( $matches->documents[ $row->id_document ] ) ){ \r\t\t\t\t$matches->documents[ $row->id_document ] = array(\r\t\t\t\t\t\"title\" => $row->title,\r\t\t\t\t\t\"date\" => $row->date,\r\t\t\t\t\t\"tags\" => Application_Model_DocumentsMapper::getTags( $antaUser, $row->id_document ),\r\t\t\t\t\t\"size\" => Application_Model_SentencesMapper::getNumberOfSentences( $antaUser, $row->id_document )\r\t\t\t\t);\r\t\t\t}\r\t\t\t\r\t\t\t$matches->sentences[ $row->id_sentence ] = new Application_Model_Sentence( $row->id_sentence, $row->content, $row->id_document, $row->position, $row->date );\r\t\t\t\r\t\t}\r\t\t\r\t\t// get total items\r\t\t$stmt = $mysqli->query(\"SELECT FOUND_ROWS() as totalItems\");\r\t\t$matches->totalItems = $stmt->fetchObject()->totalItems;\r\t\t\r\t\t$checkPointA = microtime(true) - $startTime;\r\t\t$startTime = microtime(true);\r\t\t\r\t\t// test, again... find all documents id containing that regexp\r\t\t$stmt = $mysqli->query(\r\t\t\t\"SELECT DISTINCT id_document FROM anta_{$antaUser->username}.documents do\r\t\t\t\tINNER JOIN anta_{$antaUser->username}.sentences se USING( id_document ) \r\t\t\tWHERE se.content REGEXP ? \", array($filters->query)\r\t\t);\r\t\t$ids = array();\r\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\t$ids[] = $row->id_document;\r\t\t}\r\t\t\t\t\t\t\r\t\t\r\t\t// computate tags statistics, top FIVE for each category using filter in id_documents\r\t\tforeach( Application_Model_CategoriesMapper::getAll( $antaUser ) as $category ){\r\t\t\t\r\t\t\t$matches->categories[ $category->content ] = array();\r\t\t\t$query = \"SELECT dt.id_tag, dtd.content, count(distinct dt.`id_document`) AS `number_of_documents`\r\t\t\t\tFROM \r\t\t\t\t\tanta_{$antaUser->username}.documents_tags dt \r\t\t\t\t\t\r\t\t\t\tINNER JOIN\r\t\t\t\t\tanta_{$antaUser->username}.`tags` dtd\r\t\t\t\t\tUSING ( id_tag ) \r\t\t\t\tWHERE id_document IN(\".implode(\",\",$ids).\") AND {$whereClause} \".( strlen( $whereClause )>0? \"AND \":\"\" ).\" id_category = ? \r\t\t\t\tGROUP BY dtd.id_tag ORDER BY `number_of_documents` DESC LIMIT 0,5\";\r\t\t\t\t\r\t\t\t$stmt = $mysqli->query($query, array_merge( $binds,array( $category->id ) ) );\r\t\t\twhile( $row = $stmt->fetchObject() ){\r\t\t\t\t$matches->categories[ $category->content ][ $row->id_tag ] = $row;\r\t\t\t}\r\t\t\r\t\t};\r\t\t$checkPointB = microtime(true) - $startTime;\r\t\techo $checkPointA.\", \".$checkPointB;\r\t\treturn $matches;\r\t\t// \r\t\t\r\t\t\r\t}",
"public function _replyToReturnAutoCompleteRequest() {\n\n if ( ! $this->_isLoggedIn() ) { exit; }\n if ( ! isset( $_GET['q'] ) ) { exit; }\n\n $_aGet = $_GET;\n unset( $_aGet['request'], $_aGet['page'], $_aGet['tab'], $_aGet['settings-updated'] );\n\n $_aData = array();\n $_sType = isset( $_GET['type'] ) ? $_GET['type'] : '';\n switch ( $_sType ) {\n default:\n case 'post':\n $_aData = $this->_searchPosts( $_aGet );\n break;\n case 'user':\n $_aData = $this->_searchUsers( $_aGet );\n break;\n }\n \n exit( json_encode( $_aData ) );\n \n }",
"public function parse_call() {\r\n\t\t$this->spoof_check();\r\n\t\tif (count($this->request) == $this->max_requests\r\n\t\t\r\n\t\t)\r\n\t\t\texit();\r\n\t\tif (!$this->match_server($this->request['host'])) {\r\n\t\t\techo \"Fatal Error: Your address is unknown\";\r\n\t\t\texit();\r\n\t\t}\r\n\t\telse if (!$this->match_server($this->request['server'])) {\r\n\t\t\techo \"Fatal Error: Target address unknown\";\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t\t$host = $this->request['host'];\r\n\t\t$this->disassemble_IP($host);\r\n\t\t$this->get_user_queue();\r\n\t\t$this->users[] = $this->request['session'];\r\n\t\t$this->patch_connection();\r\n\t}",
"function dx_process($conn, $bot, $input){\n //set a name for user\n if (mb_substr($input, 0, 1, 'utf-8') == '!')\n $bot -> setName($input);\n\n //get the time for user\n else if(strpos($input, 'time') || $input == 'time')\n $bot -> getTime($input);\n\n //train the bot\n else if (substr($input, 0, 6) == 'train:') {\n $bot -> trainBot($conn, $input);\n }\n\n //display bot data\n else if($input == 'aboutbot')\n $bot -> getBotData();\n\n else if( strpos($input, 'date') || $input == 'date'){\n echo 'Today is '.date('D.').' the '.date('jS M, ').date('Y');\n exit();\n }\n\n //respond to input such as hello, hi etc\n else if(str_word_count($input) == 1 && $input != 'time' && $input != 'date' && $input != 'aboutbot' && $input != 'help')\n $bot -> response($input);\n\n //show help\n else if($input == 'help')\n $bot -> showHelp();\n\n else\n $bot -> respondToQuestion($conn, $input);\n\n\n }",
"protected function parse_search(&$q)\n {\n }",
"public function run() {\n $this->logger->addDebug(\"Handling query\", $this->input);\n $this->logger->addDebug(\"Handling query JSON\", array($this->json));\n\n $this->connect = new ServerConnect();\n $this->lvUtil = new LaravelUtil();\n\n // suggest/property\n $command = $this->input[\"command\"] ?? null;\n if (isset($command)\n && ($command == \"suggest\")\n && (isset($this->input[\"subcommand\"]))\n && ($this->input[\"subcommand\"] == \"property\") ) {\n\n $result = $this->suggestProperty($this->input[\"prefix\"]);\n\n $this->response = json_encode($result, JSON_PRETTY_PRINT);\n if (isset($this->input[\"callback\"]))\n $this->response = $this->input[\"callback\"] . \"(\" . $this->response . \");\";\n return $this->response;\n }\n\n $this->logger->addDebug(\"Made it past the initial section\", []);\n\n // Decide what to do based on the OpenRefine parameters:\n // - query = only one search being done at this point\n // - queries = multiple searches in an array being requested\n // - else give information about the endpoint\n if (isset($this->input[\"queries\"][\"q0\"][\"type\"]) && $this->input[\"queries\"][\"q0\"][\"type\"] != \"CPF\") {\n $this->logger->addDebug(\"Reconciling Concept\", []);\n // Concept reconciliation\n $results = [];\n foreach ($this->input[\"queries\"] as $qid => $query) {\n $reconciled = $this->reconcileConceptTerm($query['query'], $query['type']);\n foreach ($reconciled as $i => $result) {\n $result[\"id\"] = strval($result[\"id\"]);\n $result[\"type\"] = [$result[\"type\"]];\n $results[$qid][\"result\"] = [$result];\n }\n }\n $this->logger->addDebug(\"Concept reconciliation results\", $results);\n // Set the response appropriately for OpenRefine\n $this->response = json_encode($results, JSON_PRETTY_PRINT);\n } elseif (isset($this->input[\"query\"])) {\n // TODO: Determine if input[\"query\"] path is used\n // CPF Reconciliation\n $query = $this->input[\"query\"];\n $max = $query[\"limit\"] ?? 10;\n\n // Read the query as a name entry in a new constellation\n $testC = $this->mapper->mapConstellation($query);\n\n // Ask the server to reconcile the constellation\n $ask = [\n \"command\" => \"reconcile\",\n \"constellation\" => $testC->toArray()\n ];\n $this->logger->addDebug(\"Reconciling.\", array($ask));\n $response = $this->connect->query($ask);\n $this->logger->addDebug(\"Reconciling.\", array($response));\n\n // Convert the reconciliation results into OpenRefine results\n if (isset($response[\"reconciliation\"])) {\n $results = array();\n foreach ($response[\"reconciliation\"] as $i => $result) {\n\n if ($i > $max) break;\n\n // build the CSV line to print\n $output = array(\n \"name\" => $result[\"identity\"][\"nameEntries\"][0][\"original\"],\n \"id\" => (string) $result[\"identity\"][\"id\"],\n \"type\" => [\"CPF\"],\n \"score\" => round($result[\"strength\"], 2),\n \"match\" => ($result[\"strength\"] > 11 ? true : false)\n );\n array_push($results, $output);\n }\n }\n\n // Set the response appropriately for OpenRefine\n $this->response = json_encode([\"result\" => $results], JSON_PRETTY_PRINT);\n } elseif (isset($this->input[\"queries\"])\n && isset($this->input[\"queries\"][\"q0\"][\"type\"])\n && $this->input[\"queries\"][\"q0\"][\"type\"] == \"CPF\")\n {\n // CPF Reconciliation\n $this->logger->addDebug(\"CPF Reconciliation\");\n $queries = $this->input[\"queries\"];\n $results = array();\n\n // We basically repeat the individual query logic above for each individual inner-query\n foreach ($queries as $qid => $query) {\n $max = $query[\"limit\"] ?? 5;\n $testC = $this->mapper->mapConstellation($query);\n\n $ask = [\n \"command\" => \"reconcile\",\n \"constellation\" => $testC->toArray()\n ];\n\n $response = $this->connect->query($ask);\n\n if (isset($response[\"reconciliation\"])) {\n $results[$qid] = [\n \"result\" => []\n ];\n foreach ($response[\"reconciliation\"] as $i => $result) {\n\n if ($i > $max) break;\n\n // build the results line\n $output = array(\n \"name\" => $result[\"identity\"][\"nameEntries\"][0][\"original\"],\n \"id\" => (string) $result[\"identity\"][\"id\"],\n \"type\" => [\"CPF\"],\n \"score\" => round($result[\"strength\"], 2),\n \"match\" => ($result[\"strength\"] > 11 ? true : false)\n );\n array_push($results[$qid][\"result\"], $output);\n }\n }\n }\n\n // Set the response appropriately for OpenRefine\n $this->logger->addDebug(\"Reconciliation results: \", $results);\n $this->response = json_encode($results, JSON_PRETTY_PRINT);\n } else {\n // Default response: give information about this OpenRefine endpoint\n $response = [\n \"defaultTypes\" => [\n [\n \"id\" => \"CPF\",\n \"name\" => \"Identity Constellation\"\n ],\n [\n \"id\" => \"subject\",\n \"name\" => \"Subject Concept Term\"\n ],\n [\n \"id\" => \"occupation\",\n \"name\" => \"Occupation Concept Term\"\n ],\n [\n \"id\" => \"activity\",\n \"name\" => \"Activity Concept Term\"\n ]\n ],\n \"view\" => [\n \"url\" => \\snac\\Config::$WEBUI_URL . \"/view/{{id}}\"\n ],\n \"identifierSpace\" => \\snac\\Config::$WEBUI_URL,\n \"name\" => \\snac\\Config::$OPENREFINE_ENDPOINT_NAME,\n \"schemaSpace\" => \\snac\\Config::$OPENREFINE_URL,\n \"preview\" => [\n \"width\" => 400,\n \"height\" => 500,\n \"url\" => \\snac\\Config::$WEBUI_URL . \"/snippet/{{id}}\"\n ],\n \"suggest\" => [\n \"property\" => [\n \"service_url\" => \\snac\\Config::$OPENREFINE_URL,\n \"service_path\" => \"/suggest/property\"\n ]\n ]\n ];\n\n $this->response = json_encode($response, JSON_PRETTY_PRINT);\n }\n\n if (isset($this->input[\"callback\"]))\n $this->response = $this->input[\"callback\"] . \"(\" . $this->response . \");\";\n return $this->response;\n }",
"private function processQueryParameters(): void\n {\n // Check if a collection alias was defined\n $matches = [];\n preg_match_all('~(IN @\\w+)~', $this->query, $matches, PREG_PATTERN_ORDER);\n $matches = array_pop($matches);\n\n if (count($matches)) {\n // Stores if found.\n $collection = [];\n $match = array_pop($matches);\n preg_match_all('~(@\\w+)~', $match, $collection, PREG_PATTERN_ORDER);\n $occurrence = array_shift($collection);\n $this->collectionAlias = array_pop($occurrence);\n }\n\n $matches = [];\n preg_match_all('~(@\\w+)~', $this->query, $matches, PREG_PATTERN_ORDER);\n $this->queryParameters = array_pop($matches);\n }",
"protected function _process($line) {\n\t\tif (stripos($line, 'PING') !== false) {\n\t\t\tlist($ping, $pong) = $this->_parse(':', $line, 2);\n\t\t\t$this->_write('PONG', $pong);\n\t\t\treturn;\n\t\t}\n\n\t\tif ($line[0] !== ':') {\n\t\t\treturn;\n\t\t}\n\t\t$params = $this->_parse(\"(\\s|(?<=\\s):|^:)\", $line, 5);\n\n\t\tif (!isset($params[2])) {\n\t\t\treturn null;\n\t\t}\n\t\t$cmd = $params[2];\n\t\t$msg = !empty($params[4]) ? $params[4] : null;\n\n\t\tswitch ($cmd) {\n\t\t\tcase 'PRIVMSG':\n\t\t\t\t$channel = $params[3];\n\t\t\t\t$user = $this->_parse(\"!\", $params[1], 3);\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'channel' => $channel,\n\t\t\t\t\t'nick'=> $this->_nick,\n\t\t\t\t\t'user' => $user[0],\n\t\t\t\t\t'message' => $msg\n\t\t\t\t);\n\t\t\t\tforeach ($this->_plugins['process'] as $class) {\n\t\t\t\t\t$this->_respond((array) $channel, $class->process($data));\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase '461':\n\t\t\tcase '422':\n\t\t\tcase '376':\n\t\t\t\tforeach ($this->_channels as $channel) {\n\t\t\t\t\tif (empty($this->_joined[$channel])) {\n\t\t\t\t\t\t$this->_write('JOIN', $channel);\n\t\t\t\t\t\t$this->_joined[$channel] = true;\n\n\t\t\t\t\t\tLogger::debug(\"Bot `{$this->_nick}` joined channel `{$channel}`.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase '433': // Nick already registerd\n\t\t\t\tLogger::debug(\"Nick {$this->_nick} already in use.\");\n\n\t\t\t\t$this->_disconnect();\n\t\t\t\t$this->_nick .= '_';\n\t\t\t\t$this->_connect();\n\n\t\t\tbreak;\n\n\t\t\tcase '353':\n\t\t\t\t// Logger::debug('Names on ' . str_replace('=', '', $msg) . '.');\n\t\t\tbreak;\n\n\t\t\tcase 'NOTICE':\n\t\t\t\tif (preg_match('/identify.*NickServ.*identify/', $msg) && $this->_password) {\n\t\t\t\t\tLogger::debug(\"Identifying as {$this->_nick}.\");\n\t\t\t\t\t$this->_write('PRIVMSG', \"NickServ :IDENTIFY {$this->_nick} {$this->_password}\");\n\t\t\t\t}\n\t\t\tbreak;\n\n\t\t\tcase 'MODE':\n\t\t\t\tif ($msg === '+i') { // We're now identified.\n\t\t\t\t\tif ($this->_password && $this->_nick !== $this->_originalNick) {\n\t\t\t\t\t\t$this->_nick = $this->_originalNick;\n\t\t\t\t\t\tLogger::debug(\"Reclaiming nick {$this->_nick}.\");\n\n\t\t\t\t\t\t$this->_write('PRIVMSG', \"NickServ :GHOST {$this->_nick} {$this->_password}\");\n\t\t\t\t\t\tsleep(2);\n\t\t\t\t\t\t$this->_write('PRIVMSG', \"NickServ :RELEASE {$this->_nick} {$this->_password}\");\n\t\t\t\t\t\tsleep(2);\n\t\t\t\t\t\t$this->_write('PRIVMSG', \"NickServ :IDENTIFY {$this->_nick} {$this->_password}\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t\tbreak;\n\t\t}\n\t}",
"protected function process ($user, $message)\n\t\t{\n\t\t\tif($message == 'help')\n\t\t\t{\n\t\t\t\t$reply = 'Following commands are available:<br>\"date\" - returns the date<br>\"hi\" - says hello';\n\t\t\t}\n\t\t\telse if($message == 'date')\n\t\t\t{\n\t\t\t\t$reply = \"Current date is \" . date('Y-m-d H:i:s');\n\t\t\t}\n\t\t\telse if($message == 'hi')\n\t\t\t{\n\t\t\t\t$reply = \"Hello user! This is a websocket server!\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$reply = \"Thank you for the message: '$message'\";\n\t\t\t}\n\n\t\t\t//$u = var_export($user, true);\n\t\t\t//$u = preg_replace('/\\\\n/', \"<br>\", $u);\n\t\t\t//$reply = $reply . \"<br><br><br>User Info:<br>\" . $u;\n\n\t\t\t$this->stdout(\"MESSAGE IS: \" . $message);\n\t\t\t$this->send($user, $reply);\n\n\t\t\t//The uri component say /a/b/c\n\t\t\t//echo \"Requested resource : \" . $user->requestedResource . \"n\";\n\t\t}",
"function process($user,$msg){\n $c=0;\n \t$this->say(\"(user: \".$user->id.\") msg> \".$msg);\n //$this->say(\"< \".$msg);\n\t\n switch($msg){\n\t case \"ping\" : $this->send($user->socket,\"pong\"); break; //heartbeat frame reply with pong\n case \"hello\" : $this->send($user->socket,\"hello human\"); break;\n case \"name\" : $this->send($user->socket,\"My Name is\".php_uname(\"n\") ); \t\tbreak;\n\t case \"temp\" : $this->send($user->socket,\"Temp. in NYC:\".$this->getTemp() ); break;\n case \"date\" : $this->send($user->socket,\"today is \".date(\"Y.m.d\")); break;\n case \"time\" : $this->send($user->socket,\"server time is \".date(\"H:i:s\")); break;\n case \"thanks\": $this->send($user->socket,\"you're welcome\"); break;\n\t case \"id\" : \t$this->send($user->socket,\"You are user: \".$user.\" \\r\\n\"); break;\n\t case \"users\": $list=\"User's List \\r\\n\";\n\t\t\t\t\t\tforeach($this->users as $u)\n\t\t\t\t\t\t $list.=\"user #\".++$c.\". $u \\r\\n\";\n\t\t\t\t\t\t \n\t\t\t\t\t\t$this->send($user->socket,$list); \n\t\t\t\t\t break;\n\t\t\t\t\t\n case \"bye\" : $this->send($user->socket,\"bye\"); \n\t\t\t\t\t\t$this->disconnect($user->socket);\n\t\t\t\t\t\tbreak;\n default : $this->send($user->socket,$msg.\" not understood - \".date(\"H:i:s\") ); break;\n }\n }"
]
| [
"0.57375413",
"0.5561021",
"0.54431677",
"0.54243964",
"0.53178936",
"0.528655",
"0.5231517",
"0.5213562",
"0.5209694",
"0.51340735",
"0.5132399",
"0.51222754",
"0.5107141",
"0.50331444",
"0.50320375",
"0.50232524",
"0.5012845",
"0.5004665",
"0.49791583",
"0.4976843",
"0.49588376",
"0.4943344",
"0.49396625",
"0.49356326",
"0.4918111",
"0.4914001",
"0.49092215",
"0.49065673",
"0.48799345",
"0.4860834"
]
| 0.6649603 | 0 |
A random way to say we found something. | public function foundSome() {
return $this->goodNews()
. ' '
. $this->randomItem(
'I found',
'I located',
'I have, just for you,',
'I got you'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findRandom();",
"function searchReturnCode()\t{\n\t\treturn $this->getRandomRetourCode();\n\t}",
"abstract public function lookupWordRandomly();",
"public function foundNone() {\n return $this->randomItem(\n \"Sorry, I couldn't find any\",\n \"That's odd, there don't seem to be any\",\n 'Sorry, the internet is fresh out of',\n 'Alas, I failed to bring you your'\n );\n }",
"function searchURI()\t{\n return $this->getRandomString(mt_rand(0,100));\n\t}",
"public function notSure() {\n return $this->randomItem(\n \"I'm not sure.\",\n \"I have absolutely no idea.\",\n \"Beats me!\",\n \"Um... good question!\"\n );\n }",
"function random_catchphrase() {\n // but it's wrapped in a try/catch so whatever :P\n $initial = getResults(1);\n $initial = $initial->queries->request;\n $initial = $initial[0];\n $initial = $initial->totalResults;\n $numResults = (int)$initial;\n $page = rand(0, min(10, floor($numResults/10)));\n $randStart = $page*10+1;\n $results = getResults($randStart);\n var_dump($results);\n $results = $results->items;\n if (!count($results)) {\n return null;\n }\n else {\n return $results[rand(0, count($results)-1)]->snippet;\n }\n}",
"public function okay() {\n return $this->randomItem(\n \"Okay, I'm on it!\",\n \"I'll get right on that!\",\n 'You got it, boss.',\n 'No problem!',\n 'Sure thing.'\n );\n }",
"public function random();",
"function find()\n {\n }",
"function randomUser_exists()\t{\n\t\treturn $this->recordNumber(self::RNDUSERSC_NAME) > 0;\n\t}",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function howAre() {\n return $this->randomItem(\n \"Super, thanks for asking.\",\n 'Pretty good.',\n 'Just fine.',\n 'Never better.',\n 'Great!'\n );\n }",
"public function random ()\n\t{\n\t\t$arr\t= $this->getArrayCopy ();\n\t\t$rand\t= array_rand ($arr);\n\t\treturn isset ($arr[$rand])? $arr[$rand] : FALSE;\n\t}",
"function randomIPs_exists()\t{\n\t\treturn $this->recordNumber(self::RNDIPSC_NAME) > 0;\n\t}",
"abstract public function getRandomKeyword();",
"public function cantHearYou() {\n return $this->randomItem(\n \"Sorry, I didn't quite catch that.\",\n 'Can you repeat that?',\n 'One more time, please?',\n 'You want what now?'\n );\n }",
"function get_random_response_id($connect){\n $q='RES'.rand(2000,2999);\n $id=check_response_in_DB($q,$connect); \n return $id;\n}",
"public function getRandomEntry(){\n\t\t\t$entry = $this->db->querySingle(\"select * from \".$this->config->tblEntries.\" where reflected = 0 order by random() limit 1\", true);\n\t\t\tif($entry){\n\t\t\t\t$this->db->query(\"update \".$this->config->tblEntries.\" set reflected = 1 where id = \".$entry['id']);\n\t\t\t\treturn $entry;\n\t\t\t} else return false;\n\t\t}",
"public function getNotFoundOk() {}",
"protected function randomIndex() {\n return mt_rand(1, 10);\n }",
"function bunch(){\r\n $rand = rand(1, 6);\r\n return \"bunch\" . $rand;\r\n}",
"private function getRandomSayText()\n {\n $texts = [\n 'They see me rollin\\'',\n '*whistle*',\n 'I\\'m walking on sunshine',\n ];\n $rand = mt_rand(0, count($texts) - 1);\n\n return $texts[$rand];\n }",
"public function testQuarantineFind()\n {\n\n }",
"public function pickOne()\n{\n\t$random = rand(0,$this->lengthOne);\n\t$word = $this->oneArray[$random];\n\treturn $word;\n}",
"public function hasNextgoodsid(){\n return $this->_has(36);\n }",
"public function getRandomWord() {\n return $this->_index[array_rand($this->_index)];\n }",
"public function randomItem();",
"public function randomFunc() {\n return \"RANDOM\";\n }",
"function get_question_random_simple() {\n global $default_terms_array;\n $session = new Session();\n $questions = get_questions($default_terms_array);\n\n for ($i = 0; $i < sizeof($questions); $i++) {\n\n $question = $questions[array_rand($questions) ];\n\n // if the question hasn't already been asked recently OR we're not remembering things in the session, return it\n if ((!$session->get('random_questions_asked') || ($session->get('random_questions_asked') && !in_array($question->get_ID(), $session->get('random_questions_asked'))))) {\n return $question;\n }\n }\n\n return $questions[array_rand($questions) ];\n}"
]
| [
"0.69682133",
"0.66068596",
"0.65044856",
"0.6218486",
"0.61983323",
"0.5966903",
"0.5838334",
"0.57638234",
"0.56345135",
"0.5621252",
"0.56144804",
"0.5545188",
"0.55336595",
"0.5514227",
"0.5454165",
"0.545302",
"0.5427421",
"0.5421346",
"0.5412996",
"0.53772753",
"0.5376186",
"0.5372509",
"0.536698",
"0.5357468",
"0.53472364",
"0.53453785",
"0.5314328",
"0.52787036",
"0.5271269",
"0.5259428"
]
| 0.67740005 | 1 |
A random empty result report. | public function foundNone() {
return $this->randomItem(
"Sorry, I couldn't find any",
"That's odd, there don't seem to be any",
'Sorry, the internet is fresh out of',
'Alas, I failed to bring you your'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGenerateAllReportsVoid()\n {\n $reportGenerator = $this->makeReportGeneratorVoid();\n $response = $reportGenerator->generateAllReports();\n $this->assertEquals(\n [\n 'total' => 0\n ],\n $response\n );\n $reportGenerator = $this->makeReportGeneratorVoid();\n $response = $reportGenerator->generateAllReports(\"2020-01-01\");\n $this->assertEquals(\n [\n 'total' => '0'\n ],\n $response\n );\n \n }",
"protected static function display_noResults() {\n $locale = self::$locale;\n add_to_title($locale['global_201'].$locale['408']);\n echo strtr(Search::render_search_no_result(), [\n '{%title%}' => $locale['408'],\n '{%content%}' => $locale['501'],\n ]);\n }",
"public function test_it_should_return_empty_results(): void\n {\n $response = $this->get(route('api.owners.index'));\n\n $response->assertStatus(200)\n ->assertJsonCount(0, 'data');\n }",
"public function testCommandWithReportConfigurationUnknown(): void\n {\n $process = $this->phpbench(\n 'run --report=\\'{\"generator\": \"foo_table\"}\\' benchmarks/set4/NothingBench.php'\n );\n $this->assertExitCode(1, $process);\n $this->assertStringContainsString('generator service \"foo_table\" does not exist', $process->getErrorOutput());\n }",
"public static function empty() : DBQueryResult {\n return new DBQueryResult('', '', []);\n }",
"public function testGenerateAllReports()\n {\n $reportGenerator = $this->makeReportGeneratorFull();\n $response = $reportGenerator->generateAllReports();\n $this->assertEquals(\n [\n 'total' => 1\n ],\n $response\n );\n }",
"public abstract function getNoOutput();",
"public function renderReturnsNonEmptyResultForZeroShowUid() {\n\t\t$this->assertNotEquals(\n\t\t\t'',\n\t\t\t$this->fixture->render(array('showUid' => 0))\n\t\t);\n\t}",
"public function testGetNoResult()\n {\n $response = $this->runApp('GET', '/v1/products?q=----&password=' . $this->apiPassword);\n\n $this->assertEquals(StatusCode::HTTP_OK, $response->getStatusCode());\n $result = (array)json_decode($response->getBody())->result;\n $this->assertEquals([], $result);\n }",
"protected function clearResults() {\n\t\t$this->error = '';\n\t\t$this->status_org = false;\n\t\t$this->status_new = false;\n\t}",
"public function testEmptyResult()\n {\n // 取得所有文章\n $articles = Article::all();\n // 確認 $articles 是 Collection\n $this->assertInstanceOf('Illuminate\\Database\\Eloquent\\Collection',$articles);\n\n // 而文章數為 0\n $this->assertEquals(0,count($articles));\n }",
"public function clearResults()\n {\n $this->_return = null;\n }",
"function no_items() {\n\t\tesc_attr_e( 'No assessment results found.' );\n\t}",
"public function testCommandWithReportConfiguration(): void\n {\n $process = $this->phpbench(\n 'run benchmarks/set4/NothingBench.php --report=\\'{\"extends\": \"default\"}\\''\n );\n $this->assertExitCode(0, $process);\n $output = $process->getOutput();\n $this->assertStringContainsString('benchNothing', $output);\n }",
"public function testResultIsEmpty(): void\n {\n $this->get_accessible_reflection_property('result');\n $this->assertTrue($this->get_reflection_property_value('result'));\n }",
"public function clearResult() {\n $this->_dataHandler->clearResult();\n }",
"public function getNoResultsTpl(){\n return $this->templates['no_results'];\n }",
"public function emptyResult()\n {\n return new ProductSearchResult([\n 'products' => [],\n 'totalRows' => 0,\n 'limit' => 0,\n 'offset' => 0,\n 'searchParams' => [],\n 'availableColors' => [],\n 'availableTypes' => [],\n 'availableSizes' => []\n ]);\n }",
"private function basicReport()\n {\n return $this->report->count();\n }",
"public function testCommandWithReport(): void\n {\n $process = $this->phpbench('run benchmarks/set4/NothingBench.php --report=default');\n $this->assertExitCode(0, $process);\n $output = $process->getOutput();\n $this->assertStringContainsString('bench', $output);\n }",
"public function clear() {\n\t\t$this->expected_query = '';\n\t}",
"public function testReturnEmptyResponse(): void\n {\n $repository = $this->prepareRepository(new stdClass());\n\n $this->assertEmpty(\n $repository->findForCamp(self::CAMP_ID),\n );\n }",
"protected function showResult()\n {\n//\n// unset($this->result['missing_advertiser']);\n\n var_dump($this->result);\n }",
"public function testFromNoContentResponse() : void {\n $this->assertEmpty(Result::fromResponse(Response::fromName(\"no content\"))->toArray());\n }",
"public function testListQrcodesEmpty()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs($this->user)\n ->visit('/admin/qrcodes')\n ->assertSee('List Qrcodes');\n $elements = $browser->elements('#list-qrcodes tbody tr');\n $this->assertCount(0, $elements);\n $this->assertNull($browser->element('.paginate'));\n });\n }",
"public function testNoResult()\n {\n $this->mock(AlphaVantageApiService::class, function ($mock) {\n return $mock->shouldReceive('querySymbol')\n ->once()\n ->andReturn(new \\GuzzleHttp\\Psr7\\Response(\n Response::HTTP_OK,\n [],\n '{\n \"Global Quote\": {}\n }'\n ));\n });\n\n $response = $this->get('api/stock-quotes?symbol=123');\n $response->assertStatus(Response::HTTP_OK);\n $response->assertExactJson([]);\n }",
"function getMissing() {\n\t\t$articleDao =& \\DAORegistry::getDAO('ArticleDAO');\n\t\t$sql = \"SELECT * FROM articles WHERE pages like '%#DFM'\";\n\t\t$blub = $articleDao->retrieve($sql);\n\t\t$result = new \\DAOResultFactory($blub, $this, '_dummy');\n\t\t$result = $result->toArray();\n\t\tforeach ($result as $record) {\n\t\t\t$this->getArticleGalleys($record['article_id']);\n\t\t}\n\t}",
"public function doNothing()\n\t{\n\t\treturn '';\n\t}",
"public function report()\n {\n // TODO: Implement report() method.\n }",
"public function report()\r\n {\r\n echo \"Question Bank Work is finish\";\r\n\r\n echo \"<br>\";\r\n\r\n echo \"Please Check Storage Folder\";\r\n\r\n echo \"<br>\";\r\n\r\n echo 'Count of Questions Get From Hsmai Server is: ' . count($this->questionInfo->items);\r\n\r\n echo \"questions\";\r\n }"
]
| [
"0.6725042",
"0.629809",
"0.62033695",
"0.6168513",
"0.6106708",
"0.6089484",
"0.60468614",
"0.6039431",
"0.6000451",
"0.5962367",
"0.59279233",
"0.58866084",
"0.5872958",
"0.5851645",
"0.5789417",
"0.578431",
"0.57789725",
"0.57409704",
"0.574021",
"0.57279897",
"0.5726684",
"0.57263225",
"0.5697025",
"0.5686706",
"0.5682062",
"0.56588507",
"0.56542116",
"0.5638886",
"0.5636964",
"0.56220955"
]
| 0.6430184 | 1 |
Usage suggestions and info about Martha. | public function help() {
$this->say("Please let me help!");
$this->say("I'm Martha and I can help you answer questions and find things online. Try asking:");
$suggestions = $this->suggest(3);
if($this->_context != 'web') {
foreach($suggestions as $suggestion) {
$this->say($suggestion);
}
$this->say("I can talk to all of these APIs thanks to Temboo! https://temboo.com");
$this->say("You can read my source at https://github.com/temboo/martha");
} else {
foreach($suggestions as $suggestion) {
$this->say('<p><a href="?query=' . htmlentities($suggestion, ENT_COMPAT, 'UTF-8') . '" class="suggestion">"' . htmlentities($suggestion, ENT_NOQUOTES, 'UTF-8') . '"</a></p>', true);
}
$this->say('<p>I can talk to all of these APIs thanks to <a href="https://temboo.com/" target="_blank">Temboo</a>!</p>', true);
$this->say('<p>You can read my source at <a href="https://github.com/temboo/martha" target="_blank">Github</a>.</p>', true);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function usage() {}",
"public function help();",
"public function usage()\n\t{\n\t\treturn 'For usage visit: http://www.devdemon.com/';\n\t}",
"function usage() {\n\t\techo \"\\n\" . __('admin.copyAccessLogFileTool.usage', array('scriptName' => $this->scriptName)) . \"\\n\\n\";\n\t}",
"function run_ammonite_medpax() {\n\t$plugin = new Ammonite_Medpax();\n\t$plugin->run();\n}",
"public function index()\n {\n $this->help();\n }",
"function bizpanda_sts_help_page($manager)\n\t{\n\t\trequire BZDA_STS_ADN_PLUGIN_DIR . '/admin/pages/howtouse/quick-start.php';\n\t}",
"public function cli_help() {}",
"public function usage()\n {\n $array[\"api\"] = $this->config()->get(\"app_name\").\" RESTful API\";\n $array[\"version\"] = $this->config()->get(\"version\");\n $array[\"url\"] = $this->config()->get(\"base_url\").\"api/\";\n $array[\"timestamp\"] = date(\"D M d H:i:s O Y\");\n\n $array[\"controllers\"] = array();\n foreach ($this->_getApiControllers($this->app()) as $controller_name) {\n $array[\"controllers\"][] = $controller_name;\n }\n\n $this->response()->body($array);\n }",
"public function usage() {\n\t\treturn \"usage: cobweb [flags] [command] [arguments]\\n\";\n\t}",
"public function info();",
"public function info();",
"public function setup_help_tab()\n {\n }",
"function lagarto() {\n $this->name=\"lagarto\";\n $this->title=\"Lagarto (panStamp)\";\n $this->module_category=\"<#LANG_SECTION_DEVICES#>\";\n $this->checkInstalled();\n}",
"function index(){\n\t\t$this->load->library('lita');\n\t\t// code ini untuk memanggil method yang ada pada library lita\n\t\t$this->lita->nama_saya();\n\t\t\t\techo \"<br/>\";\n\t\t\t\t// code ini untuk memanggil method dengan parameter\n $this->lita->nama_kamu(\"Lita\");\n\t}",
"public function manage()\n {\n global $template;\n\n $template->set_filename('plugin_admin_content', dirname($this->getFileLocation()).\"/admin/amm_admin.tpl\");\n\n $pluginInfo=array(\n 'AMM_VERSION' => \"<i>\".$this->getPluginName().\"</i> \".l10n('gmaps_release').AMM_VERSION,\n 'PATH' => AMM_PATH\n );\n\n $template->assign('plugin', $pluginInfo);\n $template->assign('AMM_BODY_PAGE', '<p class=\"warnings\">'.sprintf(l10n('g002_gpc_not_up_to_date'),AMM_GPC_NEEDED, GPC_VERSION).'</p>');\n $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');\n }",
"public function man(): string;",
"function tynan_getmoduleinfo(){\n\t$info = array(\n\t\t'name'=>\"Tynan the Bodybuilder\",\n\t\t\"version\"=>\"1.0\",\n\t\t\"author\"=>\"Eric Stevens\",\n\t\t\"category\"=>\"General\",\n\t\t\"download\"=>\"core_module\",\n\t\t\"prefs\"=>array(\n\t\t\t\"defense\"=>\"Defense Points Gained,float|0\",\n\t\t\t\"attack\"=>\"Attack Points Gained,float|0\",\n\t\t\t\"hitpoints\"=>\"Hitpoints Gained,float|0\",\n\t\t),\n\n\t\t\"settings\"=>array(\n\t\t\t\"Tynan's Gym Module Settings,title\",\n\t\t\t\"all_locs\"=>\"Does Tynan's appear everywhere?,bool|1\",\n\t\t\t\"gymloc\"=>\"Where does the gym appear?,location|\".getsetting(\"villagename\", LOCATION_FIELDS),\n\t\t),\n\t);\n\treturn $info;\n}",
"public function usageHelp()\n {\n return <<<USAGE\nGenerates file mappings for a Modman or Composer Magento module\nUsage: php -f modman_files.php -- --module_name=Mage_Catalog --prefix=\"mycustom_dir\"\nOptions:\n--module_name Custom module name (REQUIRED) e.g Namespace_ModuleName\n--prefix Your module module base directory from Magento root directory\n--strip string to strip out of mapping\n \nUSAGE;\n }",
"public function printHelp();",
"public function getUsage() {\n\t\t// this function is not yet used.\n\t}",
"public static function run()\n\t{\n\t\tstatic::help();\n\t}",
"public function help()\n\t{\n\t\t$this\n\t\t\t->output\n\t\t\t->addOverview(\n\t\t\t\t'Store shared configuration variables used by the command line tool.\n\t\t\t\tThese will, for example, be used to fill in docblock stubs when\n\t\t\t\tusing the scaffolding command.'\n\t\t\t)\n\t\t\t->addTasks($this)\n\t\t\t->addArgument(\n\t\t\t\t'--{keyName}',\n\t\t\t\t'Sets the variable keyName to the given value.',\n\t\t\t\t'Example: --name=\"John Doe\"'\n\t\t\t);\n\t}",
"public function helpAction() {}",
"public function help() {\r\n return array(\"Success\" => \"Hello World\");\r\n }",
"function spizer_usage()\n{\n if (! isset($argv)) $argv = $_SERVER['argv'];\n \n echo <<<USAGE\nSpizer - the flexible web spider, v. 0.1\nUsage: {$argv[0]} [options] <Start URL>\n\nWhere [options] can be:\n --delay | -d <seconds> Number of seconds to delay between requests\n --log | -l <log file> Send messages to file instead of to stdout\n --savecookies | -s Save and resend cookies throughout session\n --help | -h Show this help message\n\n\nUSAGE;\n}",
"public function usageHelp()\n {\n global $argv;\n $self = basename($argv[0]);\n return <<<USAGE\n\nGuardia importer\n\nUpdates orders statuses and add tracking codes loaded from CSV file\n\nUsage: php -f $self -- [options]\n\nOptions:\n\n help This help\n import Import orders statuses and shippings\n\nUSAGE;\n }",
"function index()\n\t{\n\t\techo \"Welcome to Permission modify\";\n\t}",
"static function plInfo()\n {\n return (array(\n \"plShortName\" => _(\"Spamassassin\"),\n \"plDescription\" => _(\"Spamassassin\").\" (\"._(\"Services\").\")\",\n \"plSelfModify\" => FALSE,\n \"plDepends\" => array(),\n \"plPriority\" => 89,\n \"plSection\" => array(\"administration\"),\n \"plCategory\" => array(\"server\"),\n \"plRequirements\"=> array(\n 'ldapSchema' => array('goSpamServer' => '>=2.7'),\n 'onFailureDisablePlugin' => array(get_class())\n ),\n \"plProvidedAcls\"=> array(\n\n \"saRewriteHeader\" => _(\"Rewrite header\"),\n \"saTrustedNetworks\" => _(\"Trusted networks\"),\n \"saRequiredScore\" => _(\"Required score\"),\n \"saRule\" => _(\"Rules\"),\n\n\n \"start\" => _(\"Start\"),\n \"stop\" => _(\"Stop\"),\n \"restart\" => _(\"Restart\"),\n\n \"saFlagsB\" => _(\"Enable use of Bayes filtering\"),\n \"saFlagsb\" => _(\"Enabled Bayes auto learning\"),\n \"saFlagsC\" => _(\"Enable RBL checks\"),\n \"saFlagsR\" => _(\"Enable use of Razor\"),\n \"saFlagsD\" => _(\"Enable use of DDC\"),\n \"saFlagsP\" => _(\"Enable use of Pyzor\"))\n ));\n }",
"function help() {\n\t\t\n\t\treturn 'Waccess sets a user\\'s access level. ' . \n\t\t\t\t'A user\\'s access level decides the commands that are available to that user. ' .\n\t\t\t\t'Suggested levels: 1 anyone, 2-4 basic, 5-7 basic+, 8-9 channel admin, 10 bot admin.';\n\t\t\n\t}"
]
| [
"0.6486074",
"0.6175759",
"0.59957016",
"0.5820105",
"0.5747075",
"0.56979376",
"0.56580096",
"0.5646807",
"0.5611129",
"0.55915934",
"0.55757177",
"0.55757177",
"0.55560297",
"0.55544794",
"0.55096495",
"0.5470562",
"0.5457151",
"0.54566276",
"0.54512817",
"0.54493886",
"0.5425702",
"0.5417353",
"0.54069453",
"0.5401046",
"0.53878206",
"0.53854764",
"0.538126",
"0.53802836",
"0.53758377",
"0.53735596"
]
| 0.6975339 | 0 |
Set language select cells option value. | public function languageSelectCells($value)
{
$this->attributes['language']['select']['cells'] = $value;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function settingLanguage() {}",
"public function renderLanguageSelect() {}",
"public function setLanguage($l)\n {\n $this->setOption('language',$l);\n }",
"private function setCountriesFromDB()\n {\n /** @var Country $item */\n foreach (app(Languages::class)->all() as $item) {\n $this->valueOptions[] = new Option($item->id, $item->name, ['data-country' => $item->code]);\n }\n }",
"private function setLanguage()\n\t{\n\t\tif (isset($_GET['language']))\n\t\t\t$id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0;\n\t\tif (!isset($id_lang))\n\t\t\t$id_lang = ($this->getIdByHAL());\n\t\t$this->lang = $this->xml_file->lang[(int)($id_lang)];\n\t}",
"private function _setLangSelection(MvcEvent $e) {\n $sm = $e->getApplication()->getServiceManager();\n $authService = ServicesUtil::getAuthService($sm);\n if(CheckAuthentication::isAuthorized($authService, \"\")) {\n $userUtil = \\JumpUpUser\\Util\\ServicesUtil::getUserUtil($sm);\n $loggedInUser = $userUtil->getCurrentUser();\n $localStr = $loggedInUser->getLocale();\n if(null !== $localStr) { // perform selection of local file\n $translator = ServicesUtil::getTranslatorService($sm);\n $translator->setLocale($localStr);\n }\n }\n }",
"function sfe_language_select_callback() {\n\n\t\tglobal $sfpp_options;\n\n\t\t$sfpp_options['language'] = isset( $sfpp_options['language'] ) && ! empty( $sfpp_options['language'] ) ? $sfpp_options['language'] : 'en_US';\n\n\t\t?>\n\n\t\t<select id=\"sfpp_settings[language]\" class=\"chosen-select\" name=\"sfpp_settings[language]\" title=\"<?php esc_attr__( 'Select language', SIMPLE_FACEBOOK_EMBED_I18N ) ?>\">\n\t\t\t<option value=\"af_ZA\" <?php selected( $sfpp_options['language'], 'af_ZA' ); ?>>Afrikaans</option>\n\t\t\t<option value=\"ak_GH\" <?php selected( $sfpp_options['language'], 'ak_GH' ); ?>>Akan</option>\n\t\t\t<option value=\"am_ET\" <?php selected( $sfpp_options['language'], 'am_ET' ); ?>>Amharic</option>\n\t\t\t<option value=\"ar_AR\" <?php selected( $sfpp_options['language'], 'ar_AR' ); ?>>Arabic</option>\n\t\t\t<option value=\"as_IN\" <?php selected( $sfpp_options['language'], 'as_IN' ); ?>>Assamese</option>\n\t\t\t<option value=\"ay_BO\" <?php selected( $sfpp_options['language'], 'ay_BO' ); ?>>Aymara</option>\n\t\t\t<option value=\"az_AZ\" <?php selected( $sfpp_options['language'], 'az_AZ' ); ?>>Azerbaijani</option>\n\t\t\t<option value=\"be_BY\" <?php selected( $sfpp_options['language'], 'be_BY' ); ?>>Belarusian</option>\n\t\t\t<option value=\"bg_BG\" <?php selected( $sfpp_options['language'], 'bg_BG' ); ?>>Bulgarian</option>\n\t\t\t<option value=\"bn_IN\" <?php selected( $sfpp_options['language'], 'bn_IN' ); ?>>Bengali</option>\n\t\t\t<option value=\"br_FR\" <?php selected( $sfpp_options['language'], 'br_FR' ); ?>>Breton</option>\n\t\t\t<option value=\"bs_BA\" <?php selected( $sfpp_options['language'], 'bs_BA' ); ?>>Bosnian</option>\n\t\t\t<option value=\"ca_ES\" <?php selected( $sfpp_options['language'], 'ca_ES' ); ?>>Catalan</option>\n\t\t\t<option value=\"cb_IQ\" <?php selected( $sfpp_options['language'], 'cb_IQ' ); ?>>Sorani Kurdish</option>\n\t\t\t<option value=\"ck_US\" <?php selected( $sfpp_options['language'], 'ck_US' ); ?>>Cherokee</option>\n\t\t\t<option value=\"co_FR\" <?php selected( $sfpp_options['language'], 'co_FR' ); ?>>Corsican</option>\n\t\t\t<option value=\"cs_CZ\" <?php selected( $sfpp_options['language'], 'cs_CZ' ); ?>>Czech</option>\n\t\t\t<option value=\"cx_PH\" <?php selected( $sfpp_options['language'], 'cx_PH' ); ?>>Cebuano</option>\n\t\t\t<option value=\"cy_GB\" <?php selected( $sfpp_options['language'], 'cy_GB' ); ?>>Welsh</option>\n\t\t\t<option value=\"da_DK\" <?php selected( $sfpp_options['language'], 'da_DK' ); ?>>Danish</option>\n\t\t\t<option value=\"de_DE\" <?php selected( $sfpp_options['language'], 'de_DE' ); ?>>German</option>\n\t\t\t<option value=\"el_GR\" <?php selected( $sfpp_options['language'], 'el_GR' ); ?>>Greek</option>\n\t\t\t<option value=\"en_GB\" <?php selected( $sfpp_options['language'], 'en_GB' ); ?>>English (UK)</option>\n\t\t\t<option value=\"en_IN\" <?php selected( $sfpp_options['language'], 'en_IN' ); ?>>English (India)</option>\n\t\t\t<option value=\"en_PI\" <?php selected( $sfpp_options['language'], 'en_PI' ); ?>>English (Pirate)</option>\n\t\t\t<option value=\"en_UD\" <?php selected( $sfpp_options['language'], 'en_UD' ); ?>>English (Upside Down)</option>\n\t\t\t<option value=\"en_US\" <?php selected( $sfpp_options['language'], 'en_US' ); ?>>English (US)</option>\n\t\t\t<option value=\"eo_EO\" <?php selected( $sfpp_options['language'], 'eo_EO' ); ?>>Esperanto</option>\n\t\t\t<option value=\"es_CO\" <?php selected( $sfpp_options['language'], 'es_CO' ); ?>>Spanish (Colombia)</option>\n\t\t\t<option value=\"es_ES\" <?php selected( $sfpp_options['language'], 'es_ES' ); ?>>Spanish (Spain)</option>\n\t\t\t<option value=\"es_LA\" <?php selected( $sfpp_options['language'], 'es_LA' ); ?>>Spanish</option>\n\t\t\t<option value=\"et_EE\" <?php selected( $sfpp_options['language'], 'et_EE' ); ?>>Estonian</option>\n\t\t\t<option value=\"eu_ES\" <?php selected( $sfpp_options['language'], 'eu_ES' ); ?>>Basque</option>\n\t\t\t<option value=\"fa_IR\" <?php selected( $sfpp_options['language'], 'fa_IR' ); ?>>Persian</option>\n\t\t\t<option value=\"fb_LT\" <?php selected( $sfpp_options['language'], 'fb_LT' ); ?>>Leet Speak</option>\n\t\t\t<option value=\"ff_NG\" <?php selected( $sfpp_options['language'], 'ff_NG' ); ?>>Fulah</option>\n\t\t\t<option value=\"fi_FI\" <?php selected( $sfpp_options['language'], 'fi_FI' ); ?>>Finnish</option>\n\t\t\t<option value=\"fo_FO\" <?php selected( $sfpp_options['language'], 'fo_FO' ); ?>>Faroese</option>\n\t\t\t<option value=\"fr_CA\" <?php selected( $sfpp_options['language'], 'fr_CA' ); ?>>French (Canada)</option>\n\t\t\t<option value=\"fr_FR\" <?php selected( $sfpp_options['language'], 'fr_FR' ); ?>>French (France)</option>\n\t\t\t<option value=\"fy_NL\" <?php selected( $sfpp_options['language'], 'fy_NL' ); ?>>Frisian</option>\n\t\t\t<option value=\"ga_IE\" <?php selected( $sfpp_options['language'], 'ga_IE' ); ?>>Irish</option>\n\t\t\t<option value=\"gl_ES\" <?php selected( $sfpp_options['language'], 'gl_ES' ); ?>>Galician</option>\n\t\t\t<option value=\"gn_PY\" <?php selected( $sfpp_options['language'], 'gn_PY' ); ?>>Guarani</option>\n\t\t\t<option value=\"gu_IN\" <?php selected( $sfpp_options['language'], 'gu_IN' ); ?>>Gujarati</option>\n\t\t\t<option value=\"gx_GR\" <?php selected( $sfpp_options['language'], 'gx_GR' ); ?>>Classical Greek</option>\n\t\t\t<option value=\"ha_NG\" <?php selected( $sfpp_options['language'], 'ha_NG' ); ?>>Hausa</option>\n\t\t\t<option value=\"he_IL\" <?php selected( $sfpp_options['language'], 'he_IL' ); ?>>Hebrew</option>\n\t\t\t<option value=\"hi_IN\" <?php selected( $sfpp_options['language'], 'hi_IN' ); ?>>Hindi</option>\n\t\t\t<option value=\"hr_HR\" <?php selected( $sfpp_options['language'], 'hr_HR' ); ?>>Croatian</option>\n\t\t\t<option value=\"hu_HU\" <?php selected( $sfpp_options['language'], 'hu_HU' ); ?>>Hungarian</option>\n\t\t\t<option value=\"hy_AM\" <?php selected( $sfpp_options['language'], 'hy_AM' ); ?>>Armenian</option>\n\t\t\t<option value=\"id_ID\" <?php selected( $sfpp_options['language'], 'id_ID' ); ?>>Indonesian</option>\n\t\t\t<option value=\"ig_NG\" <?php selected( $sfpp_options['language'], 'ig_NG' ); ?>>Igbo</option>\n\t\t\t<option value=\"is_IS\" <?php selected( $sfpp_options['language'], 'is_IS' ); ?>>Icelandic</option>\n\t\t\t<option value=\"it_IT\" <?php selected( $sfpp_options['language'], 'it_IT' ); ?>>Italian</option>\n\t\t\t<option value=\"ja_JP\" <?php selected( $sfpp_options['language'], 'ja_JP' ); ?>>Japanese</option>\n\t\t\t<option value=\"ja_KS\" <?php selected( $sfpp_options['language'], 'ja_KS' ); ?>>Japanese (Kansai)</option>\n\t\t\t<option value=\"jv_ID\" <?php selected( $sfpp_options['language'], 'jv_ID' ); ?>>Javanese</option>\n\t\t\t<option value=\"ka_GE\" <?php selected( $sfpp_options['language'], 'ka_GE' ); ?>>Georgian</option>\n\t\t\t<option value=\"kk_KZ\" <?php selected( $sfpp_options['language'], 'kk_KZ' ); ?>>Kazakh</option>\n\t\t\t<option value=\"km_KH\" <?php selected( $sfpp_options['language'], 'km_KH' ); ?>>Khmer</option>\n\t\t\t<option value=\"kn_IN\" <?php selected( $sfpp_options['language'], 'kn_IN' ); ?>>Kannada</option>\n\t\t\t<option value=\"ko_KR\" <?php selected( $sfpp_options['language'], 'ko_KR' ); ?>>Korean</option>\n\t\t\t<option value=\"ku_TR\" <?php selected( $sfpp_options['language'], 'ku_TR' ); ?>>Kurdish (Kurmanji)</option>\n\t\t\t<option value=\"la_VA\" <?php selected( $sfpp_options['language'], 'la_VA' ); ?>>Latin</option>\n\t\t\t<option value=\"lg_UG\" <?php selected( $sfpp_options['language'], 'lg_UG' ); ?>>Ganda</option>\n\t\t\t<option value=\"li_NL\" <?php selected( $sfpp_options['language'], 'li_NL' ); ?>>Limburgish</option>\n\t\t\t<option value=\"ln_CD\" <?php selected( $sfpp_options['language'], 'ln_CD' ); ?>>Lingala</option>\n\t\t\t<option value=\"lo_LA\" <?php selected( $sfpp_options['language'], 'lo_LA' ); ?>>Lao</option>\n\t\t\t<option value=\"lt_LT\" <?php selected( $sfpp_options['language'], 'lt_LT' ); ?>>Lithuanian</option>\n\t\t\t<option value=\"lv_LV\" <?php selected( $sfpp_options['language'], 'lv_LV' ); ?>>Latvian</option>\n\t\t\t<option value=\"mg_MG\" <?php selected( $sfpp_options['language'], 'mg_MG' ); ?>>Malagasy</option>\n\t\t\t<option value=\"mk_MK\" <?php selected( $sfpp_options['language'], 'mk_MK' ); ?>>Macedonian</option>\n\t\t\t<option value=\"ml_IN\" <?php selected( $sfpp_options['language'], 'ml_IN' ); ?>>Malayalam</option>\n\t\t\t<option value=\"mn_MN\" <?php selected( $sfpp_options['language'], 'mn_MN' ); ?>>Mongolian</option>\n\t\t\t<option value=\"mr_IN\" <?php selected( $sfpp_options['language'], 'mr_IN' ); ?>>Marathi</option>\n\t\t\t<option value=\"ms_MY\" <?php selected( $sfpp_options['language'], 'ms_MY' ); ?>>Malay</option>\n\t\t\t<option value=\"mt_MT\" <?php selected( $sfpp_options['language'], 'mt_MT' ); ?>>Maltese</option>\n\t\t\t<option value=\"my_MM\" <?php selected( $sfpp_options['language'], 'my_MM' ); ?>>Burmese</option>\n\t\t\t<option value=\"nb_NO\" <?php selected( $sfpp_options['language'], 'nb_NO' ); ?>>Norwegian (bokmal)</option>\n\t\t\t<option value=\"nd_ZW\" <?php selected( $sfpp_options['language'], 'nd_ZW' ); ?>>Ndebele</option>\n\t\t\t<option value=\"ne_NP\" <?php selected( $sfpp_options['language'], 'ne_NP' ); ?>>Nepali</option>\n\t\t\t<option value=\"nl_BE\" <?php selected( $sfpp_options['language'], 'nl_BE' ); ?>>Dutch (België)</option>\n\t\t\t<option value=\"nl_NL\" <?php selected( $sfpp_options['language'], 'nl_NL' ); ?>>Dutch</option>\n\t\t\t<option value=\"nn_NO\" <?php selected( $sfpp_options['language'], 'nn_NO' ); ?>>Norwegian (nynorsk)</option>\n\t\t\t<option value=\"ny_MW\" <?php selected( $sfpp_options['language'], 'ny_MW' ); ?>>Chewa</option>\n\t\t\t<option value=\"or_IN\" <?php selected( $sfpp_options['language'], 'or_IN' ); ?>>Oriya</option>\n\t\t\t<option value=\"pa_IN\" <?php selected( $sfpp_options['language'], 'pa_IN' ); ?>>Punjabi</option>\n\t\t\t<option value=\"pl_PL\" <?php selected( $sfpp_options['language'], 'pl_PL' ); ?>>Polish</option>\n\t\t\t<option value=\"ps_AF\" <?php selected( $sfpp_options['language'], 'ps_AF' ); ?>>Pashto</option>\n\t\t\t<option value=\"pt_BR\" <?php selected( $sfpp_options['language'], 'pt_BR' ); ?>>Portuguese (Brazil)</option>\n\t\t\t<option value=\"pt_PT\" <?php selected( $sfpp_options['language'], 'pt_PT' ); ?>>Portuguese (Portugal)</option>\n\t\t\t<option value=\"qu_PE\" <?php selected( $sfpp_options['language'], 'qu_PE' ); ?>>Quechua</option>\n\t\t\t<option value=\"rm_CH\" <?php selected( $sfpp_options['language'], 'rm_CH' ); ?>>Romansh</option>\n\t\t\t<option value=\"ro_RO\" <?php selected( $sfpp_options['language'], 'ro_RO' ); ?>>Romanian</option>\n\t\t\t<option value=\"ru_RU\" <?php selected( $sfpp_options['language'], 'ru_RU' ); ?>>Russian</option>\n\t\t\t<option value=\"rw_RW\" <?php selected( $sfpp_options['language'], 'rw_RW' ); ?>>Kinyarwanda</option>\n\t\t\t<option value=\"sa_IN\" <?php selected( $sfpp_options['language'], 'sa_IN' ); ?>>Sanskrit</option>\n\t\t\t<option value=\"sc_IT\" <?php selected( $sfpp_options['language'], 'sc_IT' ); ?>>Sardinian</option>\n\t\t\t<option value=\"se_NO\" <?php selected( $sfpp_options['language'], 'se_NO' ); ?>>Northern Sámi</option>\n\t\t\t<option value=\"si_LK\" <?php selected( $sfpp_options['language'], 'si_LK' ); ?>>Sinhala</option>\n\t\t\t<option value=\"sk_SK\" <?php selected( $sfpp_options['language'], 'sk_SK' ); ?>>Slovak</option>\n\t\t\t<option value=\"sl_SI\" <?php selected( $sfpp_options['language'], 'sl_SI' ); ?>>Slovenian</option>\n\t\t\t<option value=\"sn_ZW\" <?php selected( $sfpp_options['language'], 'sn_ZW' ); ?>>Shona</option>\n\t\t\t<option value=\"so_SO\" <?php selected( $sfpp_options['language'], 'so_SO' ); ?>>Somali</option>\n\t\t\t<option value=\"sq_AL\" <?php selected( $sfpp_options['language'], 'sq_AL' ); ?>>Albanian</option>\n\t\t\t<option value=\"sr_RS\" <?php selected( $sfpp_options['language'], 'sr_RS' ); ?>>Serbian</option>\n\t\t\t<option value=\"sv_SE\" <?php selected( $sfpp_options['language'], 'sv_SE' ); ?>>Swedish</option>\n\t\t\t<option value=\"sw_KE\" <?php selected( $sfpp_options['language'], 'sw_KE' ); ?>>Swahili</option>\n\t\t\t<option value=\"sy_SY\" <?php selected( $sfpp_options['language'], 'sy_SY' ); ?>>Syriac</option>\n\t\t\t<option value=\"sz_PL\" <?php selected( $sfpp_options['language'], 'sz_PL' ); ?>>Silesian</option>\n\t\t\t<option value=\"ta_IN\" <?php selected( $sfpp_options['language'], 'ta_IN' ); ?>>Tamil</option>\n\t\t\t<option value=\"te_IN\" <?php selected( $sfpp_options['language'], 'te_IN' ); ?>>Telugu</option>\n\t\t\t<option value=\"tg_TJ\" <?php selected( $sfpp_options['language'], 'tg_TJ' ); ?>>Tajik</option>\n\t\t\t<option value=\"th_TH\" <?php selected( $sfpp_options['language'], 'th_TH' ); ?>>Thai</option>\n\t\t\t<option value=\"tk_TM\" <?php selected( $sfpp_options['language'], 'tk_TM' ); ?>>Turkmen</option>\n\t\t\t<option value=\"tl_PH\" <?php selected( $sfpp_options['language'], 'tl_PH' ); ?>>Filipino</option>\n\t\t\t<option value=\"tl_ST\" <?php selected( $sfpp_options['language'], 'tl_ST' ); ?>>Klingon</option>\n\t\t\t<option value=\"tr_TR\" <?php selected( $sfpp_options['language'], 'tr_TR' ); ?>>Turkish</option>\n\t\t\t<option value=\"tt_RU\" <?php selected( $sfpp_options['language'], 'tt_RU' ); ?>>Tatar</option>\n\t\t\t<option value=\"tz_MA\" <?php selected( $sfpp_options['language'], 'tz_MA' ); ?>>Tamazight</option>\n\t\t\t<option value=\"uk_UA\" <?php selected( $sfpp_options['language'], 'uk_UA' ); ?>>Ukrainian</option>\n\t\t\t<option value=\"ur_PK\" <?php selected( $sfpp_options['language'], 'ur_PK' ); ?>>Urdu</option>\n\t\t\t<option value=\"uz_UZ\" <?php selected( $sfpp_options['language'], 'uz_UZ' ); ?>>Uzbek</option>\n\t\t\t<option value=\"vi_VN\" <?php selected( $sfpp_options['language'], 'vi_VN' ); ?>>Vietnamese</option>\n\t\t\t<option value=\"wo_SN\" <?php selected( $sfpp_options['language'], 'wo_SN' ); ?>>Wolof</option>\n\t\t\t<option value=\"xh_ZA\" <?php selected( $sfpp_options['language'], 'xh_ZA' ); ?>>Xhosa</option>\n\t\t\t<option value=\"yi_DE\" <?php selected( $sfpp_options['language'], 'yi_DE' ); ?>>Yiddish</option>\n\t\t\t<option value=\"yo_NG\" <?php selected( $sfpp_options['language'], 'yo_NG' ); ?>>Yoruba</option>\n\t\t\t<option value=\"zh_CN\" <?php selected( $sfpp_options['language'], 'zh_CN' ); ?>>Simplified Chinese (China)</option>\n\t\t\t<option value=\"zh_HK\" <?php selected( $sfpp_options['language'], 'zh_HK' ); ?>>Traditional Chinese (Hong Kong)</option>\n\t\t\t<option value=\"zh_TW\" <?php selected( $sfpp_options['language'], 'zh_TW' ); ?>>Traditional Chinese (Taiwan)</option>\n\t\t\t<option value=\"zu_ZA\" <?php selected( $sfpp_options['language'], 'zu_ZA' ); ?>>Zulu</option>\n\t\t\t<option value=\"zz_TR\" <?php selected( $sfpp_options['language'], 'zz_TR' ); ?>>Zazaki</option>\n\t\t</select>\n\n\t<?php\n\t}",
"public function setYiiLang(){\r\n $get_lang = Yii::app()->getRequest()->getParam(Yii::app()->urlManager->languageParam);//check if we have lang in url\r\n if (!in_array($get_lang,array_keys(Yii::app()->params['translatedLanguages'])) &&\r\n isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\r\n $langList = Util::sortByPriority($_SERVER['HTTP_ACCEPT_LANGUAGE']);\r\n foreach ($langList as $lang => $quality) {\r\n foreach (Defaults::$supportedLanguages as $supported) {\r\n if (strcasecmp($supported, $lang) == 0) {\r\n Yii::app()->language = $supported;\r\n break 2;\r\n }\r\n }\r\n }\r\n }\r\n }",
"function smarty_function_languageSelect($params,&$smarty)\n{\n require_once $smarty->_get_plugin_filepath('function', 'html_options');\n global $valid_languages;\n\n\n $outputs = array();\n $values = array();\n\n foreach($valid_languages as $code=>$output)\n {\n $outputs[] = $output;\n $values[] = $code;\n }\n\n\n $select_arr=array(\"output\"=>$outputs,\"values\"=>$values,\"name\"=>\"lang\",\"selected\"=>getLang());\n return smarty_function_html_options($select_arr, $smarty);\n}",
"function language_select() {\n echo '<select name=\"language\">';\n foreach (Translate::$Languages as $lang => $details) {\n // Print the option\n echo '<option value=\"'.html_entities($lang).'\"';\n if ($_SESSION['language'] == $lang)\n echo ' SELECTED';\n echo '>'.$details[0].'</option>';\n }\n echo '</select>';\n }",
"protected function getLanguageSelection() {}",
"public function languageSelect($value)\n {\n $this->attributes['language']['select'] = $value;\n\n return $this;\n }",
"public function languageSelectColumns($value)\n {\n $this->attributes['language']['select']['columns'] = $value;\n\n return $this;\n }",
"protected function setLanguage() {\r\n\t\t$this->language = $GLOBALS['TSFE']->config['config']['language'];\r\n\t}",
"public function chooseLanguage($lang) {\n\t\t$this->_lang = $this->_language[$lang];\n\t}",
"private function setLanguage() {\n//\t\tYii::app()->language = @Yii::app()->user->getState('lang');\n\t}",
"function select_countries($value = '', $row = 'name', $type = 0) \n { \n $locale_model = model('App\\Models\\LocaleModel', false);\n $locale = $locale_model->fetch_countries(null, 'sortname'); \n \n if($type == 0) \n { \n $options = '<option value=\"\">Select Country</option>';\n\n foreach($locale AS $country) \n {\n if(mb_strtolower($value) == mb_strtolower($country[$row])) \n {\n $selected = ' selected=\"selected\"';\n } \n else \n {\n $selected = '';\n }\n\n $text = $country[$row];\n\n if ($row !== 'name') \n {\n $text = $country['sortname'] . ' ' . '+' . $country[$row];\n }\n\n $options .= '\n <option value=\"'.$country[$row].'\" id=\"'.$country['id'].'\"'.$selected.'>\n '.$text.\n '</option>';\n }\n return $options;\n } \n else \n {\n foreach($locale as $code) \n {\n if($value == $code['name']) \n { \n return $code['sortname'];\n }\n }\n } \n return $locale;\n }",
"public function setLanguage(string $lang);",
"protected static function setLanguageKeys() {}",
"public static function getLanguageOptions()\n\t{\n\t\t$lrOptions = array(\n\t\t\tJHtml::_('select.option', 'lang_ar', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_AR')),\n\t\t\tJHtml::_('select.option', 'lang_zh-CN', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ZH_CN')),\n\t\t\tJHtml::_('select.option', 'lang_zh-TW', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ZH_TW')),\n\t\t\tJHtml::_('select.option', 'lang_cs', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_CS')),\n\t\t\tJHtml::_('select.option', 'lang_da', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_DA')),\n\t\t\tJHtml::_('select.option', 'lang_nl', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_NL')),\n\t\t\tJHtml::_('select.option', 'lang_en', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_EN')),\n\t\t\tJHtml::_('select.option', 'lang_et', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ET')),\n\t\t\tJHtml::_('select.option', 'lang_fi', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_FI')),\n\t\t\tJHtml::_('select.option', 'lang_fr', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_FR')),\n\t\t\tJHtml::_('select.option', 'lang_de', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_DE')),\n\t\t\tJHtml::_('select.option', 'lang_el', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_EL')),\n\t\t\tJHtml::_('select.option', 'lang_iw', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IW')),\n\t\t\tJHtml::_('select.option', 'lang_hu', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_HU')),\n\t\t\tJHtml::_('select.option', 'lang_is', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IS')),\n\t\t\tJHtml::_('select.option', 'lang_it', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IT')),\n\t\t\tJHtml::_('select.option', 'lang_ja', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_JA')),\n\t\t\tJHtml::_('select.option', 'lang_ko', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_KO')),\n\t\t\tJHtml::_('select.option', 'lang_lv', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_LV')),\n\t\t\tJHtml::_('select.option', 'lang_lt', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_LT')),\n\t\t\tJHtml::_('select.option', 'lang_no', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_NO')),\n\t\t\tJHtml::_('select.option', 'lang_pl', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_PL')),\n\t\t\tJHtml::_('select.option', 'lang_pt', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_PT')),\n\t\t\tJHtml::_('select.option', 'lang_ro', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_RO')),\n\t\t\tJHtml::_('select.option', 'lang_ru', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_RU')),\n\t\t\tJHtml::_('select.option', 'lang_es', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ES')),\n\t\t\tJHtml::_('select.option', 'lang_sv', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_SV')),\n\t\t);\n\n\t\treturn $lrOptions;\n\t}",
"public function setSelectedValue($value);",
"function setLocalOption($name,$value)\n\t{\n\t\t$this->_options[$name] = $value;\n\t}",
"public function setLanguage($i) {\n\t\t$this->current_language = $i;\n\t}",
"function select_option()\r\n{}",
"function edit(){\n global $wpdb;\n global $DOPBSP;\n \n $id = $_POST['id'];\n $field = $_POST['field'];\n $value = $_POST['value'];\n $language = $_POST['language'];\n \n if ($field == 'label'){\n $value = str_replace(\"\\n\", '<<new-line>>', $value);\n $value = str_replace(\"\\'\", '<<single-quote>>', $value);\n $value = utf8_encode($value);\n \n $field_data = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $translation = json_decode($field_data->translation);\n $translation->$language = $value;\n \n $value = json_encode($translation);\n $field = 'translation';\n }\n \n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n $wpdb->update($DOPBSP->tables->forms_fields_options, array($field => $value), \n array('id' => $_POST['id']));\n \n echo $select_option->field_id;\n \n die();\n }",
"public function languageSelectRows($value)\n {\n $this->attributes['language']['select']['rows'] = $value;\n\n return $this;\n }",
"protected function _update_selected_values() {\n\t\t$this->selected = Array();\n\t\tforeach ($this->options as $value => $label) {\n\t\t\tif (isset($_POST[$this->name().'_'.$value])) {\n\t\t\t\t$this->selected [$this->name().'_'.$value] = true;\n\t\t\t}\n\t\t}\n\t}",
"function set_current_lang( $lang, $multilingual = null ) {\n\n\t\tif ( is_null( $multilingual ) ) {\n\t\t\t$multilingual = bf_get_current_lang();\n\t\t}\n\n\t\tif ( $multilingual == 'en' || $multilingual == 'none' || empty( $multilingual ) || $multilingual == 'all' ) {\n\t\t\t$multilingual = '';\n\t\t} else {\n\t\t\t$multilingual = '_' . $multilingual;\n\t\t}\n\n\t\tupdate_option( $this->option_panel_id . $multilingual . '-current', $lang );\n\n\t}",
"public function settingLocale() {}",
"public function setLanguage($code)\n {\n $this->lang = $code;\n }"
]
| [
"0.6005982",
"0.599662",
"0.59736645",
"0.5809495",
"0.5795955",
"0.57710034",
"0.5647854",
"0.56355214",
"0.562962",
"0.5531376",
"0.55140376",
"0.5503069",
"0.54841673",
"0.5421018",
"0.5378071",
"0.53718734",
"0.5354928",
"0.5288411",
"0.5283084",
"0.52758324",
"0.52698654",
"0.521041",
"0.51892245",
"0.5158943",
"0.5156965",
"0.5137165",
"0.51363325",
"0.5136098",
"0.5123268",
"0.5121858"
]
| 0.6483668 | 0 |
Set language select columns option value. | public function languageSelectColumns($value)
{
$this->attributes['language']['select']['columns'] = $value;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function renderLanguageSelect() {}",
"private function setCountriesFromDB()\n {\n /** @var Country $item */\n foreach (app(Languages::class)->all() as $item) {\n $this->valueOptions[] = new Option($item->id, $item->name, ['data-country' => $item->code]);\n }\n }",
"public function setLanguage($l)\n {\n $this->setOption('language',$l);\n }",
"public function settingLanguage() {}",
"public function languageSelectCells($value)\n {\n $this->attributes['language']['select']['cells'] = $value;\n\n return $this;\n }",
"function sfe_language_select_callback() {\n\n\t\tglobal $sfpp_options;\n\n\t\t$sfpp_options['language'] = isset( $sfpp_options['language'] ) && ! empty( $sfpp_options['language'] ) ? $sfpp_options['language'] : 'en_US';\n\n\t\t?>\n\n\t\t<select id=\"sfpp_settings[language]\" class=\"chosen-select\" name=\"sfpp_settings[language]\" title=\"<?php esc_attr__( 'Select language', SIMPLE_FACEBOOK_EMBED_I18N ) ?>\">\n\t\t\t<option value=\"af_ZA\" <?php selected( $sfpp_options['language'], 'af_ZA' ); ?>>Afrikaans</option>\n\t\t\t<option value=\"ak_GH\" <?php selected( $sfpp_options['language'], 'ak_GH' ); ?>>Akan</option>\n\t\t\t<option value=\"am_ET\" <?php selected( $sfpp_options['language'], 'am_ET' ); ?>>Amharic</option>\n\t\t\t<option value=\"ar_AR\" <?php selected( $sfpp_options['language'], 'ar_AR' ); ?>>Arabic</option>\n\t\t\t<option value=\"as_IN\" <?php selected( $sfpp_options['language'], 'as_IN' ); ?>>Assamese</option>\n\t\t\t<option value=\"ay_BO\" <?php selected( $sfpp_options['language'], 'ay_BO' ); ?>>Aymara</option>\n\t\t\t<option value=\"az_AZ\" <?php selected( $sfpp_options['language'], 'az_AZ' ); ?>>Azerbaijani</option>\n\t\t\t<option value=\"be_BY\" <?php selected( $sfpp_options['language'], 'be_BY' ); ?>>Belarusian</option>\n\t\t\t<option value=\"bg_BG\" <?php selected( $sfpp_options['language'], 'bg_BG' ); ?>>Bulgarian</option>\n\t\t\t<option value=\"bn_IN\" <?php selected( $sfpp_options['language'], 'bn_IN' ); ?>>Bengali</option>\n\t\t\t<option value=\"br_FR\" <?php selected( $sfpp_options['language'], 'br_FR' ); ?>>Breton</option>\n\t\t\t<option value=\"bs_BA\" <?php selected( $sfpp_options['language'], 'bs_BA' ); ?>>Bosnian</option>\n\t\t\t<option value=\"ca_ES\" <?php selected( $sfpp_options['language'], 'ca_ES' ); ?>>Catalan</option>\n\t\t\t<option value=\"cb_IQ\" <?php selected( $sfpp_options['language'], 'cb_IQ' ); ?>>Sorani Kurdish</option>\n\t\t\t<option value=\"ck_US\" <?php selected( $sfpp_options['language'], 'ck_US' ); ?>>Cherokee</option>\n\t\t\t<option value=\"co_FR\" <?php selected( $sfpp_options['language'], 'co_FR' ); ?>>Corsican</option>\n\t\t\t<option value=\"cs_CZ\" <?php selected( $sfpp_options['language'], 'cs_CZ' ); ?>>Czech</option>\n\t\t\t<option value=\"cx_PH\" <?php selected( $sfpp_options['language'], 'cx_PH' ); ?>>Cebuano</option>\n\t\t\t<option value=\"cy_GB\" <?php selected( $sfpp_options['language'], 'cy_GB' ); ?>>Welsh</option>\n\t\t\t<option value=\"da_DK\" <?php selected( $sfpp_options['language'], 'da_DK' ); ?>>Danish</option>\n\t\t\t<option value=\"de_DE\" <?php selected( $sfpp_options['language'], 'de_DE' ); ?>>German</option>\n\t\t\t<option value=\"el_GR\" <?php selected( $sfpp_options['language'], 'el_GR' ); ?>>Greek</option>\n\t\t\t<option value=\"en_GB\" <?php selected( $sfpp_options['language'], 'en_GB' ); ?>>English (UK)</option>\n\t\t\t<option value=\"en_IN\" <?php selected( $sfpp_options['language'], 'en_IN' ); ?>>English (India)</option>\n\t\t\t<option value=\"en_PI\" <?php selected( $sfpp_options['language'], 'en_PI' ); ?>>English (Pirate)</option>\n\t\t\t<option value=\"en_UD\" <?php selected( $sfpp_options['language'], 'en_UD' ); ?>>English (Upside Down)</option>\n\t\t\t<option value=\"en_US\" <?php selected( $sfpp_options['language'], 'en_US' ); ?>>English (US)</option>\n\t\t\t<option value=\"eo_EO\" <?php selected( $sfpp_options['language'], 'eo_EO' ); ?>>Esperanto</option>\n\t\t\t<option value=\"es_CO\" <?php selected( $sfpp_options['language'], 'es_CO' ); ?>>Spanish (Colombia)</option>\n\t\t\t<option value=\"es_ES\" <?php selected( $sfpp_options['language'], 'es_ES' ); ?>>Spanish (Spain)</option>\n\t\t\t<option value=\"es_LA\" <?php selected( $sfpp_options['language'], 'es_LA' ); ?>>Spanish</option>\n\t\t\t<option value=\"et_EE\" <?php selected( $sfpp_options['language'], 'et_EE' ); ?>>Estonian</option>\n\t\t\t<option value=\"eu_ES\" <?php selected( $sfpp_options['language'], 'eu_ES' ); ?>>Basque</option>\n\t\t\t<option value=\"fa_IR\" <?php selected( $sfpp_options['language'], 'fa_IR' ); ?>>Persian</option>\n\t\t\t<option value=\"fb_LT\" <?php selected( $sfpp_options['language'], 'fb_LT' ); ?>>Leet Speak</option>\n\t\t\t<option value=\"ff_NG\" <?php selected( $sfpp_options['language'], 'ff_NG' ); ?>>Fulah</option>\n\t\t\t<option value=\"fi_FI\" <?php selected( $sfpp_options['language'], 'fi_FI' ); ?>>Finnish</option>\n\t\t\t<option value=\"fo_FO\" <?php selected( $sfpp_options['language'], 'fo_FO' ); ?>>Faroese</option>\n\t\t\t<option value=\"fr_CA\" <?php selected( $sfpp_options['language'], 'fr_CA' ); ?>>French (Canada)</option>\n\t\t\t<option value=\"fr_FR\" <?php selected( $sfpp_options['language'], 'fr_FR' ); ?>>French (France)</option>\n\t\t\t<option value=\"fy_NL\" <?php selected( $sfpp_options['language'], 'fy_NL' ); ?>>Frisian</option>\n\t\t\t<option value=\"ga_IE\" <?php selected( $sfpp_options['language'], 'ga_IE' ); ?>>Irish</option>\n\t\t\t<option value=\"gl_ES\" <?php selected( $sfpp_options['language'], 'gl_ES' ); ?>>Galician</option>\n\t\t\t<option value=\"gn_PY\" <?php selected( $sfpp_options['language'], 'gn_PY' ); ?>>Guarani</option>\n\t\t\t<option value=\"gu_IN\" <?php selected( $sfpp_options['language'], 'gu_IN' ); ?>>Gujarati</option>\n\t\t\t<option value=\"gx_GR\" <?php selected( $sfpp_options['language'], 'gx_GR' ); ?>>Classical Greek</option>\n\t\t\t<option value=\"ha_NG\" <?php selected( $sfpp_options['language'], 'ha_NG' ); ?>>Hausa</option>\n\t\t\t<option value=\"he_IL\" <?php selected( $sfpp_options['language'], 'he_IL' ); ?>>Hebrew</option>\n\t\t\t<option value=\"hi_IN\" <?php selected( $sfpp_options['language'], 'hi_IN' ); ?>>Hindi</option>\n\t\t\t<option value=\"hr_HR\" <?php selected( $sfpp_options['language'], 'hr_HR' ); ?>>Croatian</option>\n\t\t\t<option value=\"hu_HU\" <?php selected( $sfpp_options['language'], 'hu_HU' ); ?>>Hungarian</option>\n\t\t\t<option value=\"hy_AM\" <?php selected( $sfpp_options['language'], 'hy_AM' ); ?>>Armenian</option>\n\t\t\t<option value=\"id_ID\" <?php selected( $sfpp_options['language'], 'id_ID' ); ?>>Indonesian</option>\n\t\t\t<option value=\"ig_NG\" <?php selected( $sfpp_options['language'], 'ig_NG' ); ?>>Igbo</option>\n\t\t\t<option value=\"is_IS\" <?php selected( $sfpp_options['language'], 'is_IS' ); ?>>Icelandic</option>\n\t\t\t<option value=\"it_IT\" <?php selected( $sfpp_options['language'], 'it_IT' ); ?>>Italian</option>\n\t\t\t<option value=\"ja_JP\" <?php selected( $sfpp_options['language'], 'ja_JP' ); ?>>Japanese</option>\n\t\t\t<option value=\"ja_KS\" <?php selected( $sfpp_options['language'], 'ja_KS' ); ?>>Japanese (Kansai)</option>\n\t\t\t<option value=\"jv_ID\" <?php selected( $sfpp_options['language'], 'jv_ID' ); ?>>Javanese</option>\n\t\t\t<option value=\"ka_GE\" <?php selected( $sfpp_options['language'], 'ka_GE' ); ?>>Georgian</option>\n\t\t\t<option value=\"kk_KZ\" <?php selected( $sfpp_options['language'], 'kk_KZ' ); ?>>Kazakh</option>\n\t\t\t<option value=\"km_KH\" <?php selected( $sfpp_options['language'], 'km_KH' ); ?>>Khmer</option>\n\t\t\t<option value=\"kn_IN\" <?php selected( $sfpp_options['language'], 'kn_IN' ); ?>>Kannada</option>\n\t\t\t<option value=\"ko_KR\" <?php selected( $sfpp_options['language'], 'ko_KR' ); ?>>Korean</option>\n\t\t\t<option value=\"ku_TR\" <?php selected( $sfpp_options['language'], 'ku_TR' ); ?>>Kurdish (Kurmanji)</option>\n\t\t\t<option value=\"la_VA\" <?php selected( $sfpp_options['language'], 'la_VA' ); ?>>Latin</option>\n\t\t\t<option value=\"lg_UG\" <?php selected( $sfpp_options['language'], 'lg_UG' ); ?>>Ganda</option>\n\t\t\t<option value=\"li_NL\" <?php selected( $sfpp_options['language'], 'li_NL' ); ?>>Limburgish</option>\n\t\t\t<option value=\"ln_CD\" <?php selected( $sfpp_options['language'], 'ln_CD' ); ?>>Lingala</option>\n\t\t\t<option value=\"lo_LA\" <?php selected( $sfpp_options['language'], 'lo_LA' ); ?>>Lao</option>\n\t\t\t<option value=\"lt_LT\" <?php selected( $sfpp_options['language'], 'lt_LT' ); ?>>Lithuanian</option>\n\t\t\t<option value=\"lv_LV\" <?php selected( $sfpp_options['language'], 'lv_LV' ); ?>>Latvian</option>\n\t\t\t<option value=\"mg_MG\" <?php selected( $sfpp_options['language'], 'mg_MG' ); ?>>Malagasy</option>\n\t\t\t<option value=\"mk_MK\" <?php selected( $sfpp_options['language'], 'mk_MK' ); ?>>Macedonian</option>\n\t\t\t<option value=\"ml_IN\" <?php selected( $sfpp_options['language'], 'ml_IN' ); ?>>Malayalam</option>\n\t\t\t<option value=\"mn_MN\" <?php selected( $sfpp_options['language'], 'mn_MN' ); ?>>Mongolian</option>\n\t\t\t<option value=\"mr_IN\" <?php selected( $sfpp_options['language'], 'mr_IN' ); ?>>Marathi</option>\n\t\t\t<option value=\"ms_MY\" <?php selected( $sfpp_options['language'], 'ms_MY' ); ?>>Malay</option>\n\t\t\t<option value=\"mt_MT\" <?php selected( $sfpp_options['language'], 'mt_MT' ); ?>>Maltese</option>\n\t\t\t<option value=\"my_MM\" <?php selected( $sfpp_options['language'], 'my_MM' ); ?>>Burmese</option>\n\t\t\t<option value=\"nb_NO\" <?php selected( $sfpp_options['language'], 'nb_NO' ); ?>>Norwegian (bokmal)</option>\n\t\t\t<option value=\"nd_ZW\" <?php selected( $sfpp_options['language'], 'nd_ZW' ); ?>>Ndebele</option>\n\t\t\t<option value=\"ne_NP\" <?php selected( $sfpp_options['language'], 'ne_NP' ); ?>>Nepali</option>\n\t\t\t<option value=\"nl_BE\" <?php selected( $sfpp_options['language'], 'nl_BE' ); ?>>Dutch (België)</option>\n\t\t\t<option value=\"nl_NL\" <?php selected( $sfpp_options['language'], 'nl_NL' ); ?>>Dutch</option>\n\t\t\t<option value=\"nn_NO\" <?php selected( $sfpp_options['language'], 'nn_NO' ); ?>>Norwegian (nynorsk)</option>\n\t\t\t<option value=\"ny_MW\" <?php selected( $sfpp_options['language'], 'ny_MW' ); ?>>Chewa</option>\n\t\t\t<option value=\"or_IN\" <?php selected( $sfpp_options['language'], 'or_IN' ); ?>>Oriya</option>\n\t\t\t<option value=\"pa_IN\" <?php selected( $sfpp_options['language'], 'pa_IN' ); ?>>Punjabi</option>\n\t\t\t<option value=\"pl_PL\" <?php selected( $sfpp_options['language'], 'pl_PL' ); ?>>Polish</option>\n\t\t\t<option value=\"ps_AF\" <?php selected( $sfpp_options['language'], 'ps_AF' ); ?>>Pashto</option>\n\t\t\t<option value=\"pt_BR\" <?php selected( $sfpp_options['language'], 'pt_BR' ); ?>>Portuguese (Brazil)</option>\n\t\t\t<option value=\"pt_PT\" <?php selected( $sfpp_options['language'], 'pt_PT' ); ?>>Portuguese (Portugal)</option>\n\t\t\t<option value=\"qu_PE\" <?php selected( $sfpp_options['language'], 'qu_PE' ); ?>>Quechua</option>\n\t\t\t<option value=\"rm_CH\" <?php selected( $sfpp_options['language'], 'rm_CH' ); ?>>Romansh</option>\n\t\t\t<option value=\"ro_RO\" <?php selected( $sfpp_options['language'], 'ro_RO' ); ?>>Romanian</option>\n\t\t\t<option value=\"ru_RU\" <?php selected( $sfpp_options['language'], 'ru_RU' ); ?>>Russian</option>\n\t\t\t<option value=\"rw_RW\" <?php selected( $sfpp_options['language'], 'rw_RW' ); ?>>Kinyarwanda</option>\n\t\t\t<option value=\"sa_IN\" <?php selected( $sfpp_options['language'], 'sa_IN' ); ?>>Sanskrit</option>\n\t\t\t<option value=\"sc_IT\" <?php selected( $sfpp_options['language'], 'sc_IT' ); ?>>Sardinian</option>\n\t\t\t<option value=\"se_NO\" <?php selected( $sfpp_options['language'], 'se_NO' ); ?>>Northern Sámi</option>\n\t\t\t<option value=\"si_LK\" <?php selected( $sfpp_options['language'], 'si_LK' ); ?>>Sinhala</option>\n\t\t\t<option value=\"sk_SK\" <?php selected( $sfpp_options['language'], 'sk_SK' ); ?>>Slovak</option>\n\t\t\t<option value=\"sl_SI\" <?php selected( $sfpp_options['language'], 'sl_SI' ); ?>>Slovenian</option>\n\t\t\t<option value=\"sn_ZW\" <?php selected( $sfpp_options['language'], 'sn_ZW' ); ?>>Shona</option>\n\t\t\t<option value=\"so_SO\" <?php selected( $sfpp_options['language'], 'so_SO' ); ?>>Somali</option>\n\t\t\t<option value=\"sq_AL\" <?php selected( $sfpp_options['language'], 'sq_AL' ); ?>>Albanian</option>\n\t\t\t<option value=\"sr_RS\" <?php selected( $sfpp_options['language'], 'sr_RS' ); ?>>Serbian</option>\n\t\t\t<option value=\"sv_SE\" <?php selected( $sfpp_options['language'], 'sv_SE' ); ?>>Swedish</option>\n\t\t\t<option value=\"sw_KE\" <?php selected( $sfpp_options['language'], 'sw_KE' ); ?>>Swahili</option>\n\t\t\t<option value=\"sy_SY\" <?php selected( $sfpp_options['language'], 'sy_SY' ); ?>>Syriac</option>\n\t\t\t<option value=\"sz_PL\" <?php selected( $sfpp_options['language'], 'sz_PL' ); ?>>Silesian</option>\n\t\t\t<option value=\"ta_IN\" <?php selected( $sfpp_options['language'], 'ta_IN' ); ?>>Tamil</option>\n\t\t\t<option value=\"te_IN\" <?php selected( $sfpp_options['language'], 'te_IN' ); ?>>Telugu</option>\n\t\t\t<option value=\"tg_TJ\" <?php selected( $sfpp_options['language'], 'tg_TJ' ); ?>>Tajik</option>\n\t\t\t<option value=\"th_TH\" <?php selected( $sfpp_options['language'], 'th_TH' ); ?>>Thai</option>\n\t\t\t<option value=\"tk_TM\" <?php selected( $sfpp_options['language'], 'tk_TM' ); ?>>Turkmen</option>\n\t\t\t<option value=\"tl_PH\" <?php selected( $sfpp_options['language'], 'tl_PH' ); ?>>Filipino</option>\n\t\t\t<option value=\"tl_ST\" <?php selected( $sfpp_options['language'], 'tl_ST' ); ?>>Klingon</option>\n\t\t\t<option value=\"tr_TR\" <?php selected( $sfpp_options['language'], 'tr_TR' ); ?>>Turkish</option>\n\t\t\t<option value=\"tt_RU\" <?php selected( $sfpp_options['language'], 'tt_RU' ); ?>>Tatar</option>\n\t\t\t<option value=\"tz_MA\" <?php selected( $sfpp_options['language'], 'tz_MA' ); ?>>Tamazight</option>\n\t\t\t<option value=\"uk_UA\" <?php selected( $sfpp_options['language'], 'uk_UA' ); ?>>Ukrainian</option>\n\t\t\t<option value=\"ur_PK\" <?php selected( $sfpp_options['language'], 'ur_PK' ); ?>>Urdu</option>\n\t\t\t<option value=\"uz_UZ\" <?php selected( $sfpp_options['language'], 'uz_UZ' ); ?>>Uzbek</option>\n\t\t\t<option value=\"vi_VN\" <?php selected( $sfpp_options['language'], 'vi_VN' ); ?>>Vietnamese</option>\n\t\t\t<option value=\"wo_SN\" <?php selected( $sfpp_options['language'], 'wo_SN' ); ?>>Wolof</option>\n\t\t\t<option value=\"xh_ZA\" <?php selected( $sfpp_options['language'], 'xh_ZA' ); ?>>Xhosa</option>\n\t\t\t<option value=\"yi_DE\" <?php selected( $sfpp_options['language'], 'yi_DE' ); ?>>Yiddish</option>\n\t\t\t<option value=\"yo_NG\" <?php selected( $sfpp_options['language'], 'yo_NG' ); ?>>Yoruba</option>\n\t\t\t<option value=\"zh_CN\" <?php selected( $sfpp_options['language'], 'zh_CN' ); ?>>Simplified Chinese (China)</option>\n\t\t\t<option value=\"zh_HK\" <?php selected( $sfpp_options['language'], 'zh_HK' ); ?>>Traditional Chinese (Hong Kong)</option>\n\t\t\t<option value=\"zh_TW\" <?php selected( $sfpp_options['language'], 'zh_TW' ); ?>>Traditional Chinese (Taiwan)</option>\n\t\t\t<option value=\"zu_ZA\" <?php selected( $sfpp_options['language'], 'zu_ZA' ); ?>>Zulu</option>\n\t\t\t<option value=\"zz_TR\" <?php selected( $sfpp_options['language'], 'zz_TR' ); ?>>Zazaki</option>\n\t\t</select>\n\n\t<?php\n\t}",
"public function languageSelect($value)\n {\n $this->attributes['language']['select'] = $value;\n\n return $this;\n }",
"public function setYiiLang(){\r\n $get_lang = Yii::app()->getRequest()->getParam(Yii::app()->urlManager->languageParam);//check if we have lang in url\r\n if (!in_array($get_lang,array_keys(Yii::app()->params['translatedLanguages'])) &&\r\n isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\r\n $langList = Util::sortByPriority($_SERVER['HTTP_ACCEPT_LANGUAGE']);\r\n foreach ($langList as $lang => $quality) {\r\n foreach (Defaults::$supportedLanguages as $supported) {\r\n if (strcasecmp($supported, $lang) == 0) {\r\n Yii::app()->language = $supported;\r\n break 2;\r\n }\r\n }\r\n }\r\n }\r\n }",
"private function _setLangSelection(MvcEvent $e) {\n $sm = $e->getApplication()->getServiceManager();\n $authService = ServicesUtil::getAuthService($sm);\n if(CheckAuthentication::isAuthorized($authService, \"\")) {\n $userUtil = \\JumpUpUser\\Util\\ServicesUtil::getUserUtil($sm);\n $loggedInUser = $userUtil->getCurrentUser();\n $localStr = $loggedInUser->getLocale();\n if(null !== $localStr) { // perform selection of local file\n $translator = ServicesUtil::getTranslatorService($sm);\n $translator->setLocale($localStr);\n }\n }\n }",
"private function setLanguage()\n\t{\n\t\tif (isset($_GET['language']))\n\t\t\t$id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0;\n\t\tif (!isset($id_lang))\n\t\t\t$id_lang = ($this->getIdByHAL());\n\t\t$this->lang = $this->xml_file->lang[(int)($id_lang)];\n\t}",
"function language_select() {\n echo '<select name=\"language\">';\n foreach (Translate::$Languages as $lang => $details) {\n // Print the option\n echo '<option value=\"'.html_entities($lang).'\"';\n if ($_SESSION['language'] == $lang)\n echo ' SELECTED';\n echo '>'.$details[0].'</option>';\n }\n echo '</select>';\n }",
"private function sql_select_addLL_langOl()\n {\n // get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Load TCA\n $this->pObj->objZz->loadTCA( $table );\n\n // Get language overlay appendix\n $lang_ol = $this->pObj->objLocalise->conf_localisation[ 'TCA.' ][ 'field.' ][ 'appendix' ];\n\n // Label of the field for language overlay\n $field_lang_ol = $field . $lang_ol;\n\n // RETURN no field for language overlay\n if ( !isset( $GLOBALS[ 'TCA' ][ $table ][ 'columns' ][ $field_lang_ol ] ) )\n {\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' isn\\'t a localised foreignTable: ' .\n 'TCA.' . $table . 'columns.' . $field_lang_ol . ' is missing.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n return;\n }\n // RETURN no field for language overlay\n // addSelect\n $tableField_ol = $table . '.' . $field_lang_ol;\n $addSelect = \", \" . $tableField_ol . \" AS '\" . $tableField_ol . \"'\";\n // addSelect\n // Add field to the class var sql_filterFields\n $this->sql_filterFields[ $this->curr_tableField ][ 'lang_ol' ] = $tableField_ol;\n\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' is a localised foreignTable. SELECT is localised.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN addSelect\n return $addSelect;\n }",
"protected function getLanguageSelection() {}",
"function smarty_function_languageSelect($params,&$smarty)\n{\n require_once $smarty->_get_plugin_filepath('function', 'html_options');\n global $valid_languages;\n\n\n $outputs = array();\n $values = array();\n\n foreach($valid_languages as $code=>$output)\n {\n $outputs[] = $output;\n $values[] = $code;\n }\n\n\n $select_arr=array(\"output\"=>$outputs,\"values\"=>$values,\"name\"=>\"lang\",\"selected\"=>getLang());\n return smarty_function_html_options($select_arr, $smarty);\n}",
"protected function setLanguage() {\r\n\t\t$this->language = $GLOBALS['TSFE']->config['config']['language'];\r\n\t}",
"private function setLanguage() {\n//\t\tYii::app()->language = @Yii::app()->user->getState('lang');\n\t}",
"public function getLanguageIdColumnName() {}",
"protected static function setLanguageKeys() {}",
"private function sql_select_addLL_sysLanguage()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n // RETURN no languageField\n if ( !isset( $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'languageField' ] ) )\n {\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' isn\\'t a localised localTable: TCA.' . $table . 'ctrl.languageField is missing.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n return;\n }\n // RETURN no languageField\n // RETURN no transOrigPointerField\n if ( !isset( $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'transOrigPointerField' ] ) )\n {\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' isn\\'t a localised localTable: TCA.' . $table . 'ctrl.transOrigPointerField is missing.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n return;\n }\n // RETURN no transOrigPointerField\n // Get field labels\n $languageField = $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'languageField' ];\n $languageField = $table . '.' . $languageField;\n $transOrigPointerField = $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'transOrigPointerField' ];\n $transOrigPointerField = $table . '.' . $transOrigPointerField;\n // Get field labels\n // addSelect\n $addSelect = \", \" .\n $languageField . \" AS '\" . $languageField . \"', \" .\n $transOrigPointerField . \" AS '\" . $transOrigPointerField . \"'\";\n // addSelect\n // Add $languageField and $transOrigPointerField to the class var sql_filterFields\n $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ] = $languageField;\n $this->sql_filterFields[ $this->curr_tableField ][ 'transOrigPointerField' ] = $transOrigPointerField;\n\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' is a localised localTable. SELECT is localised.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN addSelect\n return $addSelect;\n }",
"public function setLanguage(string $lang);",
"function select_countries($value = '', $row = 'name', $type = 0) \n { \n $locale_model = model('App\\Models\\LocaleModel', false);\n $locale = $locale_model->fetch_countries(null, 'sortname'); \n \n if($type == 0) \n { \n $options = '<option value=\"\">Select Country</option>';\n\n foreach($locale AS $country) \n {\n if(mb_strtolower($value) == mb_strtolower($country[$row])) \n {\n $selected = ' selected=\"selected\"';\n } \n else \n {\n $selected = '';\n }\n\n $text = $country[$row];\n\n if ($row !== 'name') \n {\n $text = $country['sortname'] . ' ' . '+' . $country[$row];\n }\n\n $options .= '\n <option value=\"'.$country[$row].'\" id=\"'.$country['id'].'\"'.$selected.'>\n '.$text.\n '</option>';\n }\n return $options;\n } \n else \n {\n foreach($locale as $code) \n {\n if($value == $code['name']) \n { \n return $code['sortname'];\n }\n }\n } \n return $locale;\n }",
"public static function getLanguageOptions()\n\t{\n\t\t$lrOptions = array(\n\t\t\tJHtml::_('select.option', 'lang_ar', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_AR')),\n\t\t\tJHtml::_('select.option', 'lang_zh-CN', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ZH_CN')),\n\t\t\tJHtml::_('select.option', 'lang_zh-TW', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ZH_TW')),\n\t\t\tJHtml::_('select.option', 'lang_cs', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_CS')),\n\t\t\tJHtml::_('select.option', 'lang_da', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_DA')),\n\t\t\tJHtml::_('select.option', 'lang_nl', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_NL')),\n\t\t\tJHtml::_('select.option', 'lang_en', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_EN')),\n\t\t\tJHtml::_('select.option', 'lang_et', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ET')),\n\t\t\tJHtml::_('select.option', 'lang_fi', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_FI')),\n\t\t\tJHtml::_('select.option', 'lang_fr', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_FR')),\n\t\t\tJHtml::_('select.option', 'lang_de', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_DE')),\n\t\t\tJHtml::_('select.option', 'lang_el', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_EL')),\n\t\t\tJHtml::_('select.option', 'lang_iw', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IW')),\n\t\t\tJHtml::_('select.option', 'lang_hu', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_HU')),\n\t\t\tJHtml::_('select.option', 'lang_is', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IS')),\n\t\t\tJHtml::_('select.option', 'lang_it', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IT')),\n\t\t\tJHtml::_('select.option', 'lang_ja', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_JA')),\n\t\t\tJHtml::_('select.option', 'lang_ko', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_KO')),\n\t\t\tJHtml::_('select.option', 'lang_lv', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_LV')),\n\t\t\tJHtml::_('select.option', 'lang_lt', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_LT')),\n\t\t\tJHtml::_('select.option', 'lang_no', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_NO')),\n\t\t\tJHtml::_('select.option', 'lang_pl', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_PL')),\n\t\t\tJHtml::_('select.option', 'lang_pt', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_PT')),\n\t\t\tJHtml::_('select.option', 'lang_ro', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_RO')),\n\t\t\tJHtml::_('select.option', 'lang_ru', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_RU')),\n\t\t\tJHtml::_('select.option', 'lang_es', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ES')),\n\t\t\tJHtml::_('select.option', 'lang_sv', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_SV')),\n\t\t);\n\n\t\treturn $lrOptions;\n\t}",
"public function updateColumn($col = array())\n {\n if (!empty($col)) {\n foreach ($col as $key => $value) {\n $this->select_list .= \"$key = \" . \"'\" . $value . \"'w,\";\n }\n }\n $this->select_list = rtrim($this->select_list, ',');\n }",
"function edit(){\n global $wpdb;\n global $DOPBSP;\n \n $id = $_POST['id'];\n $field = $_POST['field'];\n $value = $_POST['value'];\n $language = $_POST['language'];\n \n if ($field == 'label'){\n $value = str_replace(\"\\n\", '<<new-line>>', $value);\n $value = str_replace(\"\\'\", '<<single-quote>>', $value);\n $value = utf8_encode($value);\n \n $field_data = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $translation = json_decode($field_data->translation);\n $translation->$language = $value;\n \n $value = json_encode($translation);\n $field = 'translation';\n }\n \n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n $wpdb->update($DOPBSP->tables->forms_fields_options, array($field => $value), \n array('id' => $_POST['id']));\n \n echo $select_option->field_id;\n \n die();\n }",
"function setLocalOption($name,$value)\n\t{\n\t\t$this->_options[$name] = $value;\n\t}",
"private function SetCulture()\n {\n \tif($_SESSION['LANGUAGE'] == \"fr\" )\n \t{\n \t\t$this->lang_name_field = \"subscription_name_fr\";\n\t\t\t$this->lang_desc_field = \"subscription_desc_fr\";\n \t}\n \telse\n \t{\n \t\t$this->lang_name_field = \"subscription_name_en\";\n\t\t\t$this->lang_desc_field = \"subscription_desc_en\";\n \t}\n }",
"function choose_lang() {\n\tglobal $lang;\n\t\n\t// Get lang file array\n\t$lang_ar = glob('include/text_??.json');\n\t\n\t// Display lang list\n\techo \"<SELECT ID=c_lang NAME=\\\"lang\\\">\\n\";\n\t$lang_count = count($lang_ar);\n\tfor ($i = 0; $i < $lang_count; $i++) {\n\t\t$lang_val = preg_replace(\"/^.*text_(..)\\.json$/\", \"$1\", $lang_ar[$i]);\n\t\techo \"<OPTION VALUE=$lang_val\";\n\t\tif ($lang_val == $lang) {\n\t\t\techo \" SELECTED\";\n\t\t}\n\t\techo \">$lang_val</OPTION>\";\n\t}\n\techo \"</SELECT>\\n\";\n}",
"public function setSelect($select);",
"public function setLanguage($code)\n {\n $this->lang = $code;\n }",
"public function setColumns($columns = \"*\")\n {\n //$sql = '';\n if ($columns == \"*\") {\n $this->select_list = '*';\n } elseif (!empty($columns)) {\n foreach ($columns as $item) {\n\n $this->select_list .= $item . ',';\n }\n $this->select_list = rtrim($this->select_list, ',');\n }\n// echo \"column set to \".$this->getColumns(); die;\n\n }"
]
| [
"0.6226414",
"0.60603744",
"0.60145634",
"0.5930794",
"0.5880395",
"0.5690763",
"0.5660606",
"0.56090105",
"0.55937725",
"0.55784464",
"0.54872775",
"0.54493034",
"0.53827566",
"0.5355736",
"0.5354548",
"0.53448814",
"0.53354204",
"0.5329319",
"0.5326507",
"0.5313241",
"0.53104836",
"0.5280861",
"0.5227892",
"0.52054715",
"0.5156907",
"0.5110567",
"0.50832516",
"0.5065551",
"0.50592697",
"0.5058946"
]
| 0.67464674 | 0 |
Set language select rows option value. | public function languageSelectRows($value)
{
$this->attributes['language']['select']['rows'] = $value;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function renderLanguageSelect() {}",
"public function languageSelectCells($value)\n {\n $this->attributes['language']['select']['cells'] = $value;\n\n return $this;\n }",
"public function setLanguage($l)\n {\n $this->setOption('language',$l);\n }",
"public function languageSelect($value)\n {\n $this->attributes['language']['select'] = $value;\n\n return $this;\n }",
"public function settingLanguage() {}",
"private function setCountriesFromDB()\n {\n /** @var Country $item */\n foreach (app(Languages::class)->all() as $item) {\n $this->valueOptions[] = new Option($item->id, $item->name, ['data-country' => $item->code]);\n }\n }",
"private function setLanguage()\n\t{\n\t\tif (isset($_GET['language']))\n\t\t\t$id_lang = (int)($_GET['language'])>0 ? $_GET['language'] : 0;\n\t\tif (!isset($id_lang))\n\t\t\t$id_lang = ($this->getIdByHAL());\n\t\t$this->lang = $this->xml_file->lang[(int)($id_lang)];\n\t}",
"function language_select() {\n echo '<select name=\"language\">';\n foreach (Translate::$Languages as $lang => $details) {\n // Print the option\n echo '<option value=\"'.html_entities($lang).'\"';\n if ($_SESSION['language'] == $lang)\n echo ' SELECTED';\n echo '>'.$details[0].'</option>';\n }\n echo '</select>';\n }",
"public function setYiiLang(){\r\n $get_lang = Yii::app()->getRequest()->getParam(Yii::app()->urlManager->languageParam);//check if we have lang in url\r\n if (!in_array($get_lang,array_keys(Yii::app()->params['translatedLanguages'])) &&\r\n isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {\r\n $langList = Util::sortByPriority($_SERVER['HTTP_ACCEPT_LANGUAGE']);\r\n foreach ($langList as $lang => $quality) {\r\n foreach (Defaults::$supportedLanguages as $supported) {\r\n if (strcasecmp($supported, $lang) == 0) {\r\n Yii::app()->language = $supported;\r\n break 2;\r\n }\r\n }\r\n }\r\n }\r\n }",
"function select_countries($value = '', $row = 'name', $type = 0) \n { \n $locale_model = model('App\\Models\\LocaleModel', false);\n $locale = $locale_model->fetch_countries(null, 'sortname'); \n \n if($type == 0) \n { \n $options = '<option value=\"\">Select Country</option>';\n\n foreach($locale AS $country) \n {\n if(mb_strtolower($value) == mb_strtolower($country[$row])) \n {\n $selected = ' selected=\"selected\"';\n } \n else \n {\n $selected = '';\n }\n\n $text = $country[$row];\n\n if ($row !== 'name') \n {\n $text = $country['sortname'] . ' ' . '+' . $country[$row];\n }\n\n $options .= '\n <option value=\"'.$country[$row].'\" id=\"'.$country['id'].'\"'.$selected.'>\n '.$text.\n '</option>';\n }\n return $options;\n } \n else \n {\n foreach($locale as $code) \n {\n if($value == $code['name']) \n { \n return $code['sortname'];\n }\n }\n } \n return $locale;\n }",
"private function _setLangSelection(MvcEvent $e) {\n $sm = $e->getApplication()->getServiceManager();\n $authService = ServicesUtil::getAuthService($sm);\n if(CheckAuthentication::isAuthorized($authService, \"\")) {\n $userUtil = \\JumpUpUser\\Util\\ServicesUtil::getUserUtil($sm);\n $loggedInUser = $userUtil->getCurrentUser();\n $localStr = $loggedInUser->getLocale();\n if(null !== $localStr) { // perform selection of local file\n $translator = ServicesUtil::getTranslatorService($sm);\n $translator->setLocale($localStr);\n }\n }\n }",
"protected function getLanguageSelection() {}",
"function sfe_language_select_callback() {\n\n\t\tglobal $sfpp_options;\n\n\t\t$sfpp_options['language'] = isset( $sfpp_options['language'] ) && ! empty( $sfpp_options['language'] ) ? $sfpp_options['language'] : 'en_US';\n\n\t\t?>\n\n\t\t<select id=\"sfpp_settings[language]\" class=\"chosen-select\" name=\"sfpp_settings[language]\" title=\"<?php esc_attr__( 'Select language', SIMPLE_FACEBOOK_EMBED_I18N ) ?>\">\n\t\t\t<option value=\"af_ZA\" <?php selected( $sfpp_options['language'], 'af_ZA' ); ?>>Afrikaans</option>\n\t\t\t<option value=\"ak_GH\" <?php selected( $sfpp_options['language'], 'ak_GH' ); ?>>Akan</option>\n\t\t\t<option value=\"am_ET\" <?php selected( $sfpp_options['language'], 'am_ET' ); ?>>Amharic</option>\n\t\t\t<option value=\"ar_AR\" <?php selected( $sfpp_options['language'], 'ar_AR' ); ?>>Arabic</option>\n\t\t\t<option value=\"as_IN\" <?php selected( $sfpp_options['language'], 'as_IN' ); ?>>Assamese</option>\n\t\t\t<option value=\"ay_BO\" <?php selected( $sfpp_options['language'], 'ay_BO' ); ?>>Aymara</option>\n\t\t\t<option value=\"az_AZ\" <?php selected( $sfpp_options['language'], 'az_AZ' ); ?>>Azerbaijani</option>\n\t\t\t<option value=\"be_BY\" <?php selected( $sfpp_options['language'], 'be_BY' ); ?>>Belarusian</option>\n\t\t\t<option value=\"bg_BG\" <?php selected( $sfpp_options['language'], 'bg_BG' ); ?>>Bulgarian</option>\n\t\t\t<option value=\"bn_IN\" <?php selected( $sfpp_options['language'], 'bn_IN' ); ?>>Bengali</option>\n\t\t\t<option value=\"br_FR\" <?php selected( $sfpp_options['language'], 'br_FR' ); ?>>Breton</option>\n\t\t\t<option value=\"bs_BA\" <?php selected( $sfpp_options['language'], 'bs_BA' ); ?>>Bosnian</option>\n\t\t\t<option value=\"ca_ES\" <?php selected( $sfpp_options['language'], 'ca_ES' ); ?>>Catalan</option>\n\t\t\t<option value=\"cb_IQ\" <?php selected( $sfpp_options['language'], 'cb_IQ' ); ?>>Sorani Kurdish</option>\n\t\t\t<option value=\"ck_US\" <?php selected( $sfpp_options['language'], 'ck_US' ); ?>>Cherokee</option>\n\t\t\t<option value=\"co_FR\" <?php selected( $sfpp_options['language'], 'co_FR' ); ?>>Corsican</option>\n\t\t\t<option value=\"cs_CZ\" <?php selected( $sfpp_options['language'], 'cs_CZ' ); ?>>Czech</option>\n\t\t\t<option value=\"cx_PH\" <?php selected( $sfpp_options['language'], 'cx_PH' ); ?>>Cebuano</option>\n\t\t\t<option value=\"cy_GB\" <?php selected( $sfpp_options['language'], 'cy_GB' ); ?>>Welsh</option>\n\t\t\t<option value=\"da_DK\" <?php selected( $sfpp_options['language'], 'da_DK' ); ?>>Danish</option>\n\t\t\t<option value=\"de_DE\" <?php selected( $sfpp_options['language'], 'de_DE' ); ?>>German</option>\n\t\t\t<option value=\"el_GR\" <?php selected( $sfpp_options['language'], 'el_GR' ); ?>>Greek</option>\n\t\t\t<option value=\"en_GB\" <?php selected( $sfpp_options['language'], 'en_GB' ); ?>>English (UK)</option>\n\t\t\t<option value=\"en_IN\" <?php selected( $sfpp_options['language'], 'en_IN' ); ?>>English (India)</option>\n\t\t\t<option value=\"en_PI\" <?php selected( $sfpp_options['language'], 'en_PI' ); ?>>English (Pirate)</option>\n\t\t\t<option value=\"en_UD\" <?php selected( $sfpp_options['language'], 'en_UD' ); ?>>English (Upside Down)</option>\n\t\t\t<option value=\"en_US\" <?php selected( $sfpp_options['language'], 'en_US' ); ?>>English (US)</option>\n\t\t\t<option value=\"eo_EO\" <?php selected( $sfpp_options['language'], 'eo_EO' ); ?>>Esperanto</option>\n\t\t\t<option value=\"es_CO\" <?php selected( $sfpp_options['language'], 'es_CO' ); ?>>Spanish (Colombia)</option>\n\t\t\t<option value=\"es_ES\" <?php selected( $sfpp_options['language'], 'es_ES' ); ?>>Spanish (Spain)</option>\n\t\t\t<option value=\"es_LA\" <?php selected( $sfpp_options['language'], 'es_LA' ); ?>>Spanish</option>\n\t\t\t<option value=\"et_EE\" <?php selected( $sfpp_options['language'], 'et_EE' ); ?>>Estonian</option>\n\t\t\t<option value=\"eu_ES\" <?php selected( $sfpp_options['language'], 'eu_ES' ); ?>>Basque</option>\n\t\t\t<option value=\"fa_IR\" <?php selected( $sfpp_options['language'], 'fa_IR' ); ?>>Persian</option>\n\t\t\t<option value=\"fb_LT\" <?php selected( $sfpp_options['language'], 'fb_LT' ); ?>>Leet Speak</option>\n\t\t\t<option value=\"ff_NG\" <?php selected( $sfpp_options['language'], 'ff_NG' ); ?>>Fulah</option>\n\t\t\t<option value=\"fi_FI\" <?php selected( $sfpp_options['language'], 'fi_FI' ); ?>>Finnish</option>\n\t\t\t<option value=\"fo_FO\" <?php selected( $sfpp_options['language'], 'fo_FO' ); ?>>Faroese</option>\n\t\t\t<option value=\"fr_CA\" <?php selected( $sfpp_options['language'], 'fr_CA' ); ?>>French (Canada)</option>\n\t\t\t<option value=\"fr_FR\" <?php selected( $sfpp_options['language'], 'fr_FR' ); ?>>French (France)</option>\n\t\t\t<option value=\"fy_NL\" <?php selected( $sfpp_options['language'], 'fy_NL' ); ?>>Frisian</option>\n\t\t\t<option value=\"ga_IE\" <?php selected( $sfpp_options['language'], 'ga_IE' ); ?>>Irish</option>\n\t\t\t<option value=\"gl_ES\" <?php selected( $sfpp_options['language'], 'gl_ES' ); ?>>Galician</option>\n\t\t\t<option value=\"gn_PY\" <?php selected( $sfpp_options['language'], 'gn_PY' ); ?>>Guarani</option>\n\t\t\t<option value=\"gu_IN\" <?php selected( $sfpp_options['language'], 'gu_IN' ); ?>>Gujarati</option>\n\t\t\t<option value=\"gx_GR\" <?php selected( $sfpp_options['language'], 'gx_GR' ); ?>>Classical Greek</option>\n\t\t\t<option value=\"ha_NG\" <?php selected( $sfpp_options['language'], 'ha_NG' ); ?>>Hausa</option>\n\t\t\t<option value=\"he_IL\" <?php selected( $sfpp_options['language'], 'he_IL' ); ?>>Hebrew</option>\n\t\t\t<option value=\"hi_IN\" <?php selected( $sfpp_options['language'], 'hi_IN' ); ?>>Hindi</option>\n\t\t\t<option value=\"hr_HR\" <?php selected( $sfpp_options['language'], 'hr_HR' ); ?>>Croatian</option>\n\t\t\t<option value=\"hu_HU\" <?php selected( $sfpp_options['language'], 'hu_HU' ); ?>>Hungarian</option>\n\t\t\t<option value=\"hy_AM\" <?php selected( $sfpp_options['language'], 'hy_AM' ); ?>>Armenian</option>\n\t\t\t<option value=\"id_ID\" <?php selected( $sfpp_options['language'], 'id_ID' ); ?>>Indonesian</option>\n\t\t\t<option value=\"ig_NG\" <?php selected( $sfpp_options['language'], 'ig_NG' ); ?>>Igbo</option>\n\t\t\t<option value=\"is_IS\" <?php selected( $sfpp_options['language'], 'is_IS' ); ?>>Icelandic</option>\n\t\t\t<option value=\"it_IT\" <?php selected( $sfpp_options['language'], 'it_IT' ); ?>>Italian</option>\n\t\t\t<option value=\"ja_JP\" <?php selected( $sfpp_options['language'], 'ja_JP' ); ?>>Japanese</option>\n\t\t\t<option value=\"ja_KS\" <?php selected( $sfpp_options['language'], 'ja_KS' ); ?>>Japanese (Kansai)</option>\n\t\t\t<option value=\"jv_ID\" <?php selected( $sfpp_options['language'], 'jv_ID' ); ?>>Javanese</option>\n\t\t\t<option value=\"ka_GE\" <?php selected( $sfpp_options['language'], 'ka_GE' ); ?>>Georgian</option>\n\t\t\t<option value=\"kk_KZ\" <?php selected( $sfpp_options['language'], 'kk_KZ' ); ?>>Kazakh</option>\n\t\t\t<option value=\"km_KH\" <?php selected( $sfpp_options['language'], 'km_KH' ); ?>>Khmer</option>\n\t\t\t<option value=\"kn_IN\" <?php selected( $sfpp_options['language'], 'kn_IN' ); ?>>Kannada</option>\n\t\t\t<option value=\"ko_KR\" <?php selected( $sfpp_options['language'], 'ko_KR' ); ?>>Korean</option>\n\t\t\t<option value=\"ku_TR\" <?php selected( $sfpp_options['language'], 'ku_TR' ); ?>>Kurdish (Kurmanji)</option>\n\t\t\t<option value=\"la_VA\" <?php selected( $sfpp_options['language'], 'la_VA' ); ?>>Latin</option>\n\t\t\t<option value=\"lg_UG\" <?php selected( $sfpp_options['language'], 'lg_UG' ); ?>>Ganda</option>\n\t\t\t<option value=\"li_NL\" <?php selected( $sfpp_options['language'], 'li_NL' ); ?>>Limburgish</option>\n\t\t\t<option value=\"ln_CD\" <?php selected( $sfpp_options['language'], 'ln_CD' ); ?>>Lingala</option>\n\t\t\t<option value=\"lo_LA\" <?php selected( $sfpp_options['language'], 'lo_LA' ); ?>>Lao</option>\n\t\t\t<option value=\"lt_LT\" <?php selected( $sfpp_options['language'], 'lt_LT' ); ?>>Lithuanian</option>\n\t\t\t<option value=\"lv_LV\" <?php selected( $sfpp_options['language'], 'lv_LV' ); ?>>Latvian</option>\n\t\t\t<option value=\"mg_MG\" <?php selected( $sfpp_options['language'], 'mg_MG' ); ?>>Malagasy</option>\n\t\t\t<option value=\"mk_MK\" <?php selected( $sfpp_options['language'], 'mk_MK' ); ?>>Macedonian</option>\n\t\t\t<option value=\"ml_IN\" <?php selected( $sfpp_options['language'], 'ml_IN' ); ?>>Malayalam</option>\n\t\t\t<option value=\"mn_MN\" <?php selected( $sfpp_options['language'], 'mn_MN' ); ?>>Mongolian</option>\n\t\t\t<option value=\"mr_IN\" <?php selected( $sfpp_options['language'], 'mr_IN' ); ?>>Marathi</option>\n\t\t\t<option value=\"ms_MY\" <?php selected( $sfpp_options['language'], 'ms_MY' ); ?>>Malay</option>\n\t\t\t<option value=\"mt_MT\" <?php selected( $sfpp_options['language'], 'mt_MT' ); ?>>Maltese</option>\n\t\t\t<option value=\"my_MM\" <?php selected( $sfpp_options['language'], 'my_MM' ); ?>>Burmese</option>\n\t\t\t<option value=\"nb_NO\" <?php selected( $sfpp_options['language'], 'nb_NO' ); ?>>Norwegian (bokmal)</option>\n\t\t\t<option value=\"nd_ZW\" <?php selected( $sfpp_options['language'], 'nd_ZW' ); ?>>Ndebele</option>\n\t\t\t<option value=\"ne_NP\" <?php selected( $sfpp_options['language'], 'ne_NP' ); ?>>Nepali</option>\n\t\t\t<option value=\"nl_BE\" <?php selected( $sfpp_options['language'], 'nl_BE' ); ?>>Dutch (België)</option>\n\t\t\t<option value=\"nl_NL\" <?php selected( $sfpp_options['language'], 'nl_NL' ); ?>>Dutch</option>\n\t\t\t<option value=\"nn_NO\" <?php selected( $sfpp_options['language'], 'nn_NO' ); ?>>Norwegian (nynorsk)</option>\n\t\t\t<option value=\"ny_MW\" <?php selected( $sfpp_options['language'], 'ny_MW' ); ?>>Chewa</option>\n\t\t\t<option value=\"or_IN\" <?php selected( $sfpp_options['language'], 'or_IN' ); ?>>Oriya</option>\n\t\t\t<option value=\"pa_IN\" <?php selected( $sfpp_options['language'], 'pa_IN' ); ?>>Punjabi</option>\n\t\t\t<option value=\"pl_PL\" <?php selected( $sfpp_options['language'], 'pl_PL' ); ?>>Polish</option>\n\t\t\t<option value=\"ps_AF\" <?php selected( $sfpp_options['language'], 'ps_AF' ); ?>>Pashto</option>\n\t\t\t<option value=\"pt_BR\" <?php selected( $sfpp_options['language'], 'pt_BR' ); ?>>Portuguese (Brazil)</option>\n\t\t\t<option value=\"pt_PT\" <?php selected( $sfpp_options['language'], 'pt_PT' ); ?>>Portuguese (Portugal)</option>\n\t\t\t<option value=\"qu_PE\" <?php selected( $sfpp_options['language'], 'qu_PE' ); ?>>Quechua</option>\n\t\t\t<option value=\"rm_CH\" <?php selected( $sfpp_options['language'], 'rm_CH' ); ?>>Romansh</option>\n\t\t\t<option value=\"ro_RO\" <?php selected( $sfpp_options['language'], 'ro_RO' ); ?>>Romanian</option>\n\t\t\t<option value=\"ru_RU\" <?php selected( $sfpp_options['language'], 'ru_RU' ); ?>>Russian</option>\n\t\t\t<option value=\"rw_RW\" <?php selected( $sfpp_options['language'], 'rw_RW' ); ?>>Kinyarwanda</option>\n\t\t\t<option value=\"sa_IN\" <?php selected( $sfpp_options['language'], 'sa_IN' ); ?>>Sanskrit</option>\n\t\t\t<option value=\"sc_IT\" <?php selected( $sfpp_options['language'], 'sc_IT' ); ?>>Sardinian</option>\n\t\t\t<option value=\"se_NO\" <?php selected( $sfpp_options['language'], 'se_NO' ); ?>>Northern Sámi</option>\n\t\t\t<option value=\"si_LK\" <?php selected( $sfpp_options['language'], 'si_LK' ); ?>>Sinhala</option>\n\t\t\t<option value=\"sk_SK\" <?php selected( $sfpp_options['language'], 'sk_SK' ); ?>>Slovak</option>\n\t\t\t<option value=\"sl_SI\" <?php selected( $sfpp_options['language'], 'sl_SI' ); ?>>Slovenian</option>\n\t\t\t<option value=\"sn_ZW\" <?php selected( $sfpp_options['language'], 'sn_ZW' ); ?>>Shona</option>\n\t\t\t<option value=\"so_SO\" <?php selected( $sfpp_options['language'], 'so_SO' ); ?>>Somali</option>\n\t\t\t<option value=\"sq_AL\" <?php selected( $sfpp_options['language'], 'sq_AL' ); ?>>Albanian</option>\n\t\t\t<option value=\"sr_RS\" <?php selected( $sfpp_options['language'], 'sr_RS' ); ?>>Serbian</option>\n\t\t\t<option value=\"sv_SE\" <?php selected( $sfpp_options['language'], 'sv_SE' ); ?>>Swedish</option>\n\t\t\t<option value=\"sw_KE\" <?php selected( $sfpp_options['language'], 'sw_KE' ); ?>>Swahili</option>\n\t\t\t<option value=\"sy_SY\" <?php selected( $sfpp_options['language'], 'sy_SY' ); ?>>Syriac</option>\n\t\t\t<option value=\"sz_PL\" <?php selected( $sfpp_options['language'], 'sz_PL' ); ?>>Silesian</option>\n\t\t\t<option value=\"ta_IN\" <?php selected( $sfpp_options['language'], 'ta_IN' ); ?>>Tamil</option>\n\t\t\t<option value=\"te_IN\" <?php selected( $sfpp_options['language'], 'te_IN' ); ?>>Telugu</option>\n\t\t\t<option value=\"tg_TJ\" <?php selected( $sfpp_options['language'], 'tg_TJ' ); ?>>Tajik</option>\n\t\t\t<option value=\"th_TH\" <?php selected( $sfpp_options['language'], 'th_TH' ); ?>>Thai</option>\n\t\t\t<option value=\"tk_TM\" <?php selected( $sfpp_options['language'], 'tk_TM' ); ?>>Turkmen</option>\n\t\t\t<option value=\"tl_PH\" <?php selected( $sfpp_options['language'], 'tl_PH' ); ?>>Filipino</option>\n\t\t\t<option value=\"tl_ST\" <?php selected( $sfpp_options['language'], 'tl_ST' ); ?>>Klingon</option>\n\t\t\t<option value=\"tr_TR\" <?php selected( $sfpp_options['language'], 'tr_TR' ); ?>>Turkish</option>\n\t\t\t<option value=\"tt_RU\" <?php selected( $sfpp_options['language'], 'tt_RU' ); ?>>Tatar</option>\n\t\t\t<option value=\"tz_MA\" <?php selected( $sfpp_options['language'], 'tz_MA' ); ?>>Tamazight</option>\n\t\t\t<option value=\"uk_UA\" <?php selected( $sfpp_options['language'], 'uk_UA' ); ?>>Ukrainian</option>\n\t\t\t<option value=\"ur_PK\" <?php selected( $sfpp_options['language'], 'ur_PK' ); ?>>Urdu</option>\n\t\t\t<option value=\"uz_UZ\" <?php selected( $sfpp_options['language'], 'uz_UZ' ); ?>>Uzbek</option>\n\t\t\t<option value=\"vi_VN\" <?php selected( $sfpp_options['language'], 'vi_VN' ); ?>>Vietnamese</option>\n\t\t\t<option value=\"wo_SN\" <?php selected( $sfpp_options['language'], 'wo_SN' ); ?>>Wolof</option>\n\t\t\t<option value=\"xh_ZA\" <?php selected( $sfpp_options['language'], 'xh_ZA' ); ?>>Xhosa</option>\n\t\t\t<option value=\"yi_DE\" <?php selected( $sfpp_options['language'], 'yi_DE' ); ?>>Yiddish</option>\n\t\t\t<option value=\"yo_NG\" <?php selected( $sfpp_options['language'], 'yo_NG' ); ?>>Yoruba</option>\n\t\t\t<option value=\"zh_CN\" <?php selected( $sfpp_options['language'], 'zh_CN' ); ?>>Simplified Chinese (China)</option>\n\t\t\t<option value=\"zh_HK\" <?php selected( $sfpp_options['language'], 'zh_HK' ); ?>>Traditional Chinese (Hong Kong)</option>\n\t\t\t<option value=\"zh_TW\" <?php selected( $sfpp_options['language'], 'zh_TW' ); ?>>Traditional Chinese (Taiwan)</option>\n\t\t\t<option value=\"zu_ZA\" <?php selected( $sfpp_options['language'], 'zu_ZA' ); ?>>Zulu</option>\n\t\t\t<option value=\"zz_TR\" <?php selected( $sfpp_options['language'], 'zz_TR' ); ?>>Zazaki</option>\n\t\t</select>\n\n\t<?php\n\t}",
"public function languageSelectColumns($value)\n {\n $this->attributes['language']['select']['columns'] = $value;\n\n return $this;\n }",
"function edit(){\n global $wpdb;\n global $DOPBSP;\n \n $id = $_POST['id'];\n $field = $_POST['field'];\n $value = $_POST['value'];\n $language = $_POST['language'];\n \n if ($field == 'label'){\n $value = str_replace(\"\\n\", '<<new-line>>', $value);\n $value = str_replace(\"\\'\", '<<single-quote>>', $value);\n $value = utf8_encode($value);\n \n $field_data = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n \n $translation = json_decode($field_data->translation);\n $translation->$language = $value;\n \n $value = json_encode($translation);\n $field = 'translation';\n }\n \n $select_option = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->forms_fields_options.' WHERE id=%d',\n $id));\n $wpdb->update($DOPBSP->tables->forms_fields_options, array($field => $value), \n array('id' => $_POST['id']));\n \n echo $select_option->field_id;\n \n die();\n }",
"protected static function setLanguageKeys() {}",
"function smarty_function_languageSelect($params,&$smarty)\n{\n require_once $smarty->_get_plugin_filepath('function', 'html_options');\n global $valid_languages;\n\n\n $outputs = array();\n $values = array();\n\n foreach($valid_languages as $code=>$output)\n {\n $outputs[] = $output;\n $values[] = $code;\n }\n\n\n $select_arr=array(\"output\"=>$outputs,\"values\"=>$values,\"name\"=>\"lang\",\"selected\"=>getLang());\n return smarty_function_html_options($select_arr, $smarty);\n}",
"protected function setLanguage() {\r\n\t\t$this->language = $GLOBALS['TSFE']->config['config']['language'];\r\n\t}",
"public function setLanguage(string $lang);",
"private function sql_select_addLL_langOl()\n {\n // get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Load TCA\n $this->pObj->objZz->loadTCA( $table );\n\n // Get language overlay appendix\n $lang_ol = $this->pObj->objLocalise->conf_localisation[ 'TCA.' ][ 'field.' ][ 'appendix' ];\n\n // Label of the field for language overlay\n $field_lang_ol = $field . $lang_ol;\n\n // RETURN no field for language overlay\n if ( !isset( $GLOBALS[ 'TCA' ][ $table ][ 'columns' ][ $field_lang_ol ] ) )\n {\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' isn\\'t a localised foreignTable: ' .\n 'TCA.' . $table . 'columns.' . $field_lang_ol . ' is missing.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n return;\n }\n // RETURN no field for language overlay\n // addSelect\n $tableField_ol = $table . '.' . $field_lang_ol;\n $addSelect = \", \" . $tableField_ol . \" AS '\" . $tableField_ol . \"'\";\n // addSelect\n // Add field to the class var sql_filterFields\n $this->sql_filterFields[ $this->curr_tableField ][ 'lang_ol' ] = $tableField_ol;\n\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' is a localised foreignTable. SELECT is localised.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN addSelect\n return $addSelect;\n }",
"public function chooseLanguage($lang) {\n\t\t$this->_lang = $this->_language[$lang];\n\t}",
"function choose_lang() {\n\tglobal $lang;\n\t\n\t// Get lang file array\n\t$lang_ar = glob('include/text_??.json');\n\t\n\t// Display lang list\n\techo \"<SELECT ID=c_lang NAME=\\\"lang\\\">\\n\";\n\t$lang_count = count($lang_ar);\n\tfor ($i = 0; $i < $lang_count; $i++) {\n\t\t$lang_val = preg_replace(\"/^.*text_(..)\\.json$/\", \"$1\", $lang_ar[$i]);\n\t\techo \"<OPTION VALUE=$lang_val\";\n\t\tif ($lang_val == $lang) {\n\t\t\techo \" SELECTED\";\n\t\t}\n\t\techo \">$lang_val</OPTION>\";\n\t}\n\techo \"</SELECT>\\n\";\n}",
"private function setLanguage() {\n//\t\tYii::app()->language = @Yii::app()->user->getState('lang');\n\t}",
"public function setLanguage($code)\n {\n $this->lang = $code;\n }",
"public static function getLanguageOptions()\n\t{\n\t\t$lrOptions = array(\n\t\t\tJHtml::_('select.option', 'lang_ar', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_AR')),\n\t\t\tJHtml::_('select.option', 'lang_zh-CN', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ZH_CN')),\n\t\t\tJHtml::_('select.option', 'lang_zh-TW', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ZH_TW')),\n\t\t\tJHtml::_('select.option', 'lang_cs', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_CS')),\n\t\t\tJHtml::_('select.option', 'lang_da', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_DA')),\n\t\t\tJHtml::_('select.option', 'lang_nl', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_NL')),\n\t\t\tJHtml::_('select.option', 'lang_en', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_EN')),\n\t\t\tJHtml::_('select.option', 'lang_et', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ET')),\n\t\t\tJHtml::_('select.option', 'lang_fi', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_FI')),\n\t\t\tJHtml::_('select.option', 'lang_fr', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_FR')),\n\t\t\tJHtml::_('select.option', 'lang_de', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_DE')),\n\t\t\tJHtml::_('select.option', 'lang_el', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_EL')),\n\t\t\tJHtml::_('select.option', 'lang_iw', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IW')),\n\t\t\tJHtml::_('select.option', 'lang_hu', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_HU')),\n\t\t\tJHtml::_('select.option', 'lang_is', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IS')),\n\t\t\tJHtml::_('select.option', 'lang_it', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_IT')),\n\t\t\tJHtml::_('select.option', 'lang_ja', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_JA')),\n\t\t\tJHtml::_('select.option', 'lang_ko', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_KO')),\n\t\t\tJHtml::_('select.option', 'lang_lv', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_LV')),\n\t\t\tJHtml::_('select.option', 'lang_lt', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_LT')),\n\t\t\tJHtml::_('select.option', 'lang_no', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_NO')),\n\t\t\tJHtml::_('select.option', 'lang_pl', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_PL')),\n\t\t\tJHtml::_('select.option', 'lang_pt', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_PT')),\n\t\t\tJHtml::_('select.option', 'lang_ro', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_RO')),\n\t\t\tJHtml::_('select.option', 'lang_ru', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_RU')),\n\t\t\tJHtml::_('select.option', 'lang_es', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_ES')),\n\t\t\tJHtml::_('select.option', 'lang_sv', JText::_('COM_ARTOFGM_OPTION_LANGUAGE_LANG_SV')),\n\t\t);\n\n\t\treturn $lrOptions;\n\t}",
"function get_language(){//GETS LANGUAGES FOR DROPDOWN\n $query = $this->db->query('SELECT DISTINCT language_code, language FROM interpreters ORDER BY language asc');\n return $query->result();\n }",
"public function setLanguage($i) {\n\t\t$this->current_language = $i;\n\t}",
"function addRowsOptionValue(&$rows, &$rowNumber, $customLabel, $customField) {\n if ($this->_optionGroupId == 0) {\n $apiParams = array(\n 'version' => 3,\n 'custom_group_id' => $this->_customGroupId,\n 'label' => $customLabel\n );\n $apiCustomField = civicrm_api('CustomField', 'Getsingle', $apiParams);\n if (!isset($apiCustomField['is_error']) || $apiCustomField['is_error'] == 0) {\n if (isset($apiCustomField['option_group_id'])) {\n $this->_optionGroupId = $apiCustomField['option_group_id'];\n }\n }\n }\n $apiParams = array(\n 'version' => 3,\n 'option_group_id' => $this->_optionGroupId\n );\n $apiOptionValues = civicrm_api('OptionValue', 'Get', $apiParams);\n if ($apiOptionValues['is_error'] == 0) {\n foreach($apiOptionValues['values'] as $optionValueId => $apiOptionValue) {\n /*\n * Calculate number of contacts in econ_status, only print if any\n */\n $aantalIn = $this->calculateAantalInContacts($apiOptionValue['label'], $customField);\n if ($aantalIn > 0) {\n $rows[$rowNumber]['label'] = ts($apiOptionValue['label']);\n $rows[$rowNumber]['aantal'] = $aantalIn;\n $rows[$rowNumber]['percentage'] = CRM_Utils_HilreportsUtils::calculatePercentage($aantalIn, $this->_aantalContacts).\"%\";\n $rowNumber++;\n $this->_aantalRijen++;\n }\n }\n /*\n * last time for none\n */\n $aantalIn = $this->calculateAantalInContacts('none', $customField);\n if ($aantalIn > 0) {\n $rows[$rowNumber]['label'] = 'Onbekend';\n $rows[$rowNumber]['aantal'] = $aantalIn;\n $rows[$rowNumber]['percentage'] = CRM_Utils_HilreportsUtils::calculatePercentage($aantalIn, $this->_aantalContacts).\"%\";\n $rowNumber++;\n $this->_aantalRijen++;\n }\n }\n }",
"private function sql_select_addLL_sysLanguage()\n {\n // Get table and field\n list( $table ) = explode( '.', $this->curr_tableField );\n\n // RETURN no languageField\n if ( !isset( $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'languageField' ] ) )\n {\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' isn\\'t a localised localTable: TCA.' . $table . 'ctrl.languageField is missing.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n return;\n }\n // RETURN no languageField\n // RETURN no transOrigPointerField\n if ( !isset( $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'transOrigPointerField' ] ) )\n {\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' isn\\'t a localised localTable: TCA.' . $table . 'ctrl.transOrigPointerField is missing.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n return;\n }\n // RETURN no transOrigPointerField\n // Get field labels\n $languageField = $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'languageField' ];\n $languageField = $table . '.' . $languageField;\n $transOrigPointerField = $GLOBALS[ 'TCA' ][ $table ][ 'ctrl' ][ 'transOrigPointerField' ];\n $transOrigPointerField = $table . '.' . $transOrigPointerField;\n // Get field labels\n // addSelect\n $addSelect = \", \" .\n $languageField . \" AS '\" . $languageField . \"', \" .\n $transOrigPointerField . \" AS '\" . $transOrigPointerField . \"'\";\n // addSelect\n // Add $languageField and $transOrigPointerField to the class var sql_filterFields\n $this->sql_filterFields[ $this->curr_tableField ][ 'languageField' ] = $languageField;\n $this->sql_filterFields[ $this->curr_tableField ][ 'transOrigPointerField' ] = $transOrigPointerField;\n\n // DRS\n if ( $this->pObj->b_drs_filter || $this->pObj->b_drs_sql || $this->pObj->b_drs_localisation )\n {\n $prompt = $table . ' is a localised localTable. SELECT is localised.';\n t3lib_div::devlog( '[INFO/FILTER+SQL+LOCALISATION] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n // RETURN addSelect\n return $addSelect;\n }",
"function loadSelectValores($tabla, $codigo, $opt) {\r\n\tswitch ($tabla) {\r\n\t\tcase \"ESTADO\":\r\n\t\t\t$c[0] = \"A\"; $v[0] = \"Activo\";\r\n\t\t\t$c[1] = \"I\"; $v[1] = \"Inactivo\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ESTADO-CONTROL-CIERRE\":\r\n\t\t\t$c[0] = \"A\"; $v[0] = \"Abierto\";\r\n\t\t\t$c[1] = \"C\"; $v[1] = \"Cerrado\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"TIPO-REGISTRO\":\r\n\t\t\t$c[0] = \"AB\"; $v[0] = \"Periodo Abierto\";\r\n\t\t\t$c[1] = \"AC\"; $v[1] = \"Periodo Actual\";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase \"ESTADO-VOUCHER\":\r\n\t\t\t$c[0] = \"AB\"; $v[0] = \"Abierto\";\r\n\t\t\t$c[1] = \"AP\"; $v[1] = \"Aprobado\";\r\n\t\t\t$c[2] = \"MA\"; $v[2] = \"Mayorizado\";\r\n\t\t\t$c[3] = \"AN\"; $v[3] = \"Anulado\";\r\n\t\t\t$c[4] = \"RE\"; $v[4] = \"Rechazado\";\r\n\t\t\tbreak;\r\n\t}\r\n\t\r\n\t$i = 0;\r\n\tswitch ($opt) {\r\n\t\tcase 0:\r\n\t\t\tforeach ($c as $cod) {\r\n\t\t\t\tif ($cod == $codigo) echo \"<option value='\".$cod.\"' selected>\".($v[$i]).\"</option>\";\r\n\t\t\t\telse echo \"<option value='\".$cod.\"'>\".($v[$i]).\"</option>\";\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\tcase 1:\r\n\t\t\tforeach ($c as $cod) {\r\n\t\t\t\tif ($cod == $codigo) echo \"<option value='\".$cod.\"' selected>\".($v[$i]).\"</option>\";\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n}"
]
| [
"0.60798806",
"0.6074823",
"0.60398996",
"0.6036162",
"0.593995",
"0.5922108",
"0.58867234",
"0.57543063",
"0.5754221",
"0.57364446",
"0.5734512",
"0.56192863",
"0.56188756",
"0.5586724",
"0.55121386",
"0.55020404",
"0.5466296",
"0.5442195",
"0.54055786",
"0.53946966",
"0.53917277",
"0.5383794",
"0.53789485",
"0.53657496",
"0.53124803",
"0.52864575",
"0.5278566",
"0.5232729",
"0.52135557",
"0.52067715"
]
| 0.6383664 | 0 |
test copyableFindData() uses the settings/contain to find a record and all children (in Containable hierarchy) | public function testCopyFindData() {
$this->assertEquals(
$this->Article->copyFindData(1),
$this->expectedFromFixtures[0]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function find();",
"public function find($data);",
"public function find();",
"public function testFind()\n\t{\n\t\t// Remove the following lines when you implement this test.\n\t\t$this->markTestIncomplete(\n\t\t\t'This test has not been implemented yet.'\n\t\t);\n\t}",
"public function find() {\n return call_user_func_array(array($this->children(), 'find'), func_get_args());\n }",
"public function find(...$arguments)\n {\n return $this->children()->find(...$arguments);\n }",
"function find($find, $returnData = false) {\n\t\tif (!is_dir($this->dir.\"/\".$this->table)) return false;\n\t\t\n\t\tif ($dp = opendir($this->dir.\"/\".$this->table)) {\n\t\t\t$dirs = array();\n\t\t\twhile ($file = readdir($dp)) {\n\t\t\t\tif (strlen($file) == 2 && $file != \"..\") {\n\t\t\t\t\t$dirs[] = $this->dir.\"/\".$this->table.\"/\".$file;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\tclosedir($dp);\n\t\t\t\n\t\t\t$res = array();\n\t\t\tforeach ($dirs as $dir) {\n\t\t\t\tif ($dp = opendir($dir)) {\n\t\t\t\t\twhile ($file = readdir($dp)) {\n\t\t\t\t\t\tif (strlen($file) == 2 && $file != \"..\") {\n\t\t\t\t\t\t\t$dataFile = new lgDataFile($this->table,$dir.\"/\".$file);\n\t\t\t\t\t\t\t$data = $dataFile->getAllData();\n\t\t\t\t\t\t\tforeach ($data as $n=>$v) {\n\t\t\t\t\t\t\t\t$v[\"_KEY\"] = $n;\n\t\t\t\t\t\t\t\tif (arrayFind($v,$find)) $res[] = $returnData ? $v : $n;\n\t\t\t\t\t\t\t}\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\tif ($res) return $res;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"function getChild($field, $id) {\n// 'conditions' => \"IdTBeli = '$id'\"\n// ));\n //echo \"$this->child_class $field = '$id'\";die();\n $result = call_user_func(array($this->child_class, 'find'), 'all', array(\n 'conditions' => \"$field = '$id'\"\n ));\n return $result;\n }",
"public function find() {\n return parent::find();\n }",
"function find()\n {\n }",
"public function findData($data = null){ \n \n }",
"public function find($obj){\n\t}",
"public function testFind()\n {\n $data = array('id' => 1, 'username' => 'root', 'password' => 'password');\n $mockPDO = $this->getMock('\\\\PDOMock', array('fetchOne'));\n $mockPDO\n ->expects($this->once())\n ->method('fetchOne')\n ->will($this->returnCallback(function($arg1, $arg2) use ($data) {\n $sql = 'SELECT\n *\nFROM\n `users`\nWHERE\n id = :id\nORDER BY\n id ASC';\n\n if($arg1 == $sql && $arg2 == array('id' => 1)) {\n return $data;\n } else {\n return array();\n }\n }))\n ;\n $storage = new AuraExtendedPdo($mockPDO, new QueryFactory('mysql'));\n $result = $storage->find(array('id' => 1), 'users');\n\n $this->assertEquals($data['id'], $result['id']);\n $this->assertEquals($data['username'], $result['username']);\n $this->assertEquals($data['password'], $result['password']);\n }",
"public function test_find() : void\n {\n $journalMetadata1 = $this->prophesize(Metadata\\Comment::class);\n $journalMetadata2 = $this->prophesize(Metadata\\Comment::class);\n $this->compiler_prophecy\n ->compile(Argument::any())\n ->willReturn([\n $journalMetadata1->reveal(),\n $journalMetadata2->reveal(),\n ]);\n\n // create a new repository\n $repo = new FilesystemAnnotationRepository($this->file_source_prophecy->reveal(), $this->compiler_prophecy->reveal());\n\n // check the repository\n $entries = $repo->find();\n\n // check that the right number and content of entries is found\n $this->assertCount(2, $entries);\n $this->assertContains($journalMetadata1->reveal(), $entries);\n $this->assertContains($journalMetadata2->reveal(), $entries);\n }",
"public function testFindAll()\n {\n $this->createDummyRecord();\n\n $results = $this->generic->findAll();\n\n $list = $this->getPhysicalNumberOrRecords();\n\n $this->assertEquals(get_class($results), 'Ds\\Deque');\n $this->assertEquals(count($list), $results->count());\n }",
"public function afterFind()\n\t{\n\t\t// {\n\t\t\t// $this->subsidy_expiration = null;\n\t\t// }\n\t\t\n\t\t$this->subsidyLevelArray = $this->getSubsidyLevelArray();\n\t\t\n\t\t$this->reference_subsidy_id_reference_id = $this->reference_subsidy_id.'-'.$this->reference_subsidy_type;\n\t\t\n\t\treturn parent::afterFind();\n\t}",
"public function testFind() {\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::_find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t\t//test finding by ids with cache\n\t\t\tforeach($this->user_ids as $id) {\n\t\t\t\t$_user = User::find($id);\n\t\t\t\t$this->assertTrue((isset($_user) && !empty($_user)));\n\t\t\t}\n\t\t}",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function Find()\n {\n //TODO Suche mit den werten machen\n }",
"public function testFind() {\n\t\t$this->Post->entity(false);\n\t\t$result = $this->Post->find('first');\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual($result['Post']['title'], 'Hello');\n\n\t\t// 2. OK, let's roll.\n\t\t$s1 = $this->Post->find('first', ['entity' => true]);\n\t\t$this->assertTrue(is_a($s1, 'PostEntity'));\n\n\t\t// 3. find all.\n\t\t$result = $this->Post->find('all', ['entity' => true]);\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 3);\n\t\t$this->assertTrue(is_a($result[0], 'PostEntity'));\n\t\t$this->assertEqual($result[2]->title, 'again');\n\n\t\t// 4. find all with empty result.\n\t\t$result = $this->Post->find('all', [\n\t\t\t'entity' => true,\n\t\t\t'result' => [],\n\t\t]);\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertEqual(count($result), 0);\n\t}",
"public function find ($data, $key = null, $parent = 'data') {\n\t\tif (isset($data[$parent])) {\n\t\t\t$data = $data[$parent];\n\t\t}\n\n\t\tif ($key !== null) {\n\t\t\tif (isset($data[$key])) {\n\t\t\t\t$data = $data[$key];\n\t\t\t}\n\t\t}\n\n\t\treturn $data;\n\t}",
"function find($conditions = null, $fields = null, $order = null, $recursive = null)\n\t{\n\t\tif(is_numeric($conditions)) $conditions = array($this->escapeField() => $conditions);\n\t\t\n\t\treturn parent::find($conditions, $fields, $order, $recursive);\n\n\t}",
"public function testGetCachedWithContainable() {\n\n\t\tCache::clear();\n\n\t\t$this->User->Behaviors->attach('Containable');\n\n\t\t$conditions = array(\n\t\t\t'contain' => array('Article'),\n\t\t\t'autocache' => true\n\t\t);\n\n\t\t$result_1 = $this->User->find('first', $conditions);\n\n\t\t$this->assertTrue(!empty($result_1));\n\t\t$this->assertFalse($this->User->autocache_is_from);\n\n\t\t# check if filename starting with \"cake_autocache_first_article_\" exists\n\t\t$files = glob($this->cache_path . 'cake_autocache_first_user_*');\n\t\t$this->assertTrue((1 === count($files))); // always 1 because Cache::clear(); is used above\n\t\t# Second query result should equal first query\n\t\t$result_2 = $this->User->find('first', $conditions);\n\t\t$this->assertTrue(!empty($result_2));\n\n\t\t$this->assertTrue($this->User->autocache_is_from);\n\n\t\t// Check the first query result is the same as the second\n\t\t$this->assertSame($result_1, $result_2);\n\t}",
"function testFindSearchcontentSco() {\n\t}",
"public function find() {\r\n\t\t\t$class = new ReflectionObject($this);\r\n\t\t\t$properties = $class->getProperties(ReflectionProperty::IS_PUBLIC);\r\n\r\n\t\t\t// Loop through the properties to set them from the current row\r\n\t\t\t$select = $this->db->select();\r\n\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t$name = $property->getName();\r\n\t\t\t\t// Set only DO field names of subclass\r\n\t\t\t\tif ($property->class == $class->name) {\r\n\t\t\t\t\tif (!is_null($this->$name)) {\r\n\t\t\t\t\t\t$columnName = $this->map($name);\r\n\t\t\t\t\t\t$select->where(\"$columnName = ?\", $this->$name);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$select->from($this->table);\r\n\t\t\t$stmt = $this->db->query($select);\r\n\t\t\t$rs = $stmt->fetchAll();\r\n\r\n\t\t\t$dataobjects = array();\r\n\t\t\tforeach ($rs as $row) {\r\n\t\t\t\t$dataobject = new $class->name($this->app);\r\n\t\t\t\treset($properties);\r\n\t\t\t\tforeach ($properties as $property) {\r\n\t\t\t\t\t$name = $property->getName();\r\n\t\t\t\t\t$dataobject->$name = $row[$this->map($name)];\r\n\t\t\t\t}\r\n\t\t\t\t$dataobjects[] = $dataobject;\r\n\t\t\t}\r\n\t\t\treturn $dataobjects;\r\n\t\t}",
"public function testQuarantineFind()\n {\n\n }",
"public function testFind()\n {\n $this->assertEquals(1, $this->object->find(function ($item) {\n return $item === 2;\n })->count());\n $this->assertEquals(2, $this->object->find(function ($item) {\n return $item % 2;\n })->count());\n }",
"public function beforeFind(){\n\t}",
"public function doFind()\r\n {\r\n throw new Exception('This method is not yet implemented');\r\n }"
]
| [
"0.60203034",
"0.601736",
"0.59564453",
"0.58368963",
"0.5637313",
"0.5614126",
"0.5381246",
"0.5374018",
"0.5303312",
"0.52868354",
"0.527876",
"0.52612656",
"0.524164",
"0.5241479",
"0.5232173",
"0.516064",
"0.51257896",
"0.5092691",
"0.5092691",
"0.5092691",
"0.5069002",
"0.5068302",
"0.50155777",
"0.5002974",
"0.4994342",
"0.49877816",
"0.49667788",
"0.49611637",
"0.49424857",
"0.49233377"
]
| 0.6346448 | 0 |
test preparation of data for empty values | public function testCopyPrepareDataEmpties() {
$this->assertEquals(
$this->Article->copyPrepareData(array()),
array()
);
$this->assertEquals(
$this->Article->copyPrepareData(null),
array()
);
$this->assertEquals(
$this->Article->copyPrepareData(false),
array()
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function stdWrap_ifEmptyDeterminesEmptyValuesDataProvider() {}",
"public function testSetEmptyData()\n {\n $this->document->setEmptyData();\n\n $expected = <<<EOL\n {\n \"data\" : []\n }\nEOL;\n $this->check($expected);\n }",
"abstract public function prepareData();",
"function prepareData()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"public function testAddsEntryIfDataSetIsEmpty()\n {\n $iterator = $this->createIterator(array());\n\n $data = iterator_to_array($iterator);\n $expectedData = array(\n array()\n );\n $this->assertEquals($expectedData, $data);\n }",
"private function populateDummyTable() {}",
"public function testDoesNotChangeDataSetThatIsNotEmpty()\n {\n $originalDataSet = array(\n array(1, 2, 3),\n array(5, 4, 9)\n );\n $iterator = $this->createIterator($originalDataSet);\n\n $data = iterator_to_array($iterator);\n $this->assertEquals($originalDataSet, $data);\n }",
"public function testEmptyCols(): void\n {\n $file_path = base_path('tests/data/expenses_empty_rows.csv');\n $status = $this->importSvc->importExpenses($file_path);\n $this->assertCount(8, $status['success']);\n $this->assertCount(0, $status['errors']);\n }",
"function fillEmptyFields()\n\t{\n\t\tif(isset($this->data[$this->name])) \n\t\t{\n\t\t\t$data = $this->data[$this->name];\n\t\t} else {\n\t\t\t$data = $this->data;\n\t\t}\n\t\t\n\t\tforeach($this->_schema as $fieldname => $details) \n\t\t{\n\t\t\tif(!isset($data[$fieldname]))\n\t\t\t\t$this->set($fieldname, '');\n\t\t}\n\t}",
"public function testAllAssociativeArrayDataIsEmpty($data)\n {\n foreach($data as $key)\n {\n $this->assertEmpty($key);\n }\n\n }",
"abstract function prepare_data(&$data_arr);",
"public function testGetDataTableEmptyResult() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n\t\t$query = 'select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE from POTEST where UUID=\\'unknownuuid\\'';\r\n\t\t$datatable = $this->getPersistenceAdapter()->getDataTable($query);\r\n\t\t// Check header names\r\n\t\t$headernames = $datatable->getHeaders();\r\n\t\t$this->assertEquals(4, count($headernames), 'Datatable has unexpected header names count.');\r\n\t\t$this->assertEquals('UUID', $headernames[0], 'Header of column 0 is not as expected.');\r\n\t\t$this->assertEquals('BOOLEAN_VALUE', $headernames[1], 'Header of column 1 is not as expected.');\r\n\t\t$this->assertEquals('INT_VALUE', $headernames[2], 'Header of column 2 is not as expected.');\r\n\t\t$this->assertEquals('STRING_VALUE', $headernames[3], 'Header of column 3 is not as expected.');\r\n\t\t// Check row count\r\n\t\t$this->assertEquals(0, count($datatable->getDataMatrix()), 'Datatable has unexpected row count.');\r\n\t}",
"public function testSaveDataTableNullValues() {\r\n $recordswithnullvalues = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => true, 'int' => 100, 'string' => 'testGetDataTable 10'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => null, 'int' => null, 'string' => null],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => true, 'int' => 300, 'string' => 'testGetDataTable 30']\r\n ];\r\n\t\t$datatablewithnullvalues = new avorium_core_data_DataTable(3, 4);\r\n\t\t$datatablewithnullvalues->setHeader(0, 'UUID');\r\n\t\t$datatablewithnullvalues->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatablewithnullvalues->setHeader(2, 'INT_VALUE');\r\n\t\t$datatablewithnullvalues->setHeader(3, 'STRING_VALUE');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$datatablewithnullvalues->setCellValue($i, 0, $recordswithnullvalues[$i]['UUID']);\r\n\t\t\t$datatablewithnullvalues->setCellValue($i, 1, $recordswithnullvalues[$i]['bool']);\r\n\t\t\t$datatablewithnullvalues->setCellValue($i, 2, $recordswithnullvalues[$i]['int']);\r\n\t\t\t$datatablewithnullvalues->setCellValue($i, 3, $recordswithnullvalues[$i]['string']);\r\n\t\t}\r\n\t\t// Store the null values\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatablewithnullvalues);\r\n\t\t// Read the database records, the values now must contain the null values\r\n\t\t$resultwithnullvalues = $this->executeQuery('select UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE from POTEST order by UUID');\r\n\t\t$this->assertEquals(3, count($resultwithnullvalues), 'Wrong row count');\r\n\t\tfor ($i = 0; $i < 3; $i++) {\r\n\t\t\t$this->assertEquals($recordswithnullvalues[$i]['UUID'], $resultwithnullvalues[$i]['UUID'], 'UUID from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals($recordswithnullvalues[$i]['bool'], $resultwithnullvalues[$i]['BOOLEAN_VALUE'], 'Boolean value from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals($recordswithnullvalues[$i]['int'], $resultwithnullvalues[$i]['INT_VALUE'], 'Integer value from database is not as expected in row '.$i.'.');\r\n\t\t\t$this->assertEquals($recordswithnullvalues[$i]['string'], $resultwithnullvalues[$i]['STRING_VALUE'], 'String value from database is not as expected in row '.$i.'.');\r\n\t\t}\r\n\t}",
"public function testGetDataTableQueryNull() {\r\n $records = [\r\n ['UUID' => 'uuid1tRMR1', 'bool' => false, 'int' => 10, 'string' => 'testReadMultipleRecords 1'],\r\n ['UUID' => 'uuid1tRMR2', 'bool' => true, 'int' => 20, 'string' => 'testReadMultipleRecords 2'],\r\n ['UUID' => 'uuid1tRMR3', 'bool' => false, 'int' => 30, 'string' => 'testReadMultipleRecords 3']\r\n ];\r\n // Write data to the database\r\n foreach ($records as $record) {\r\n $this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE, INT_VALUE, STRING_VALUE) values (\\''.$record['UUID'].'\\','.($record['bool'] ? 1:0).','.$record['int'].', \\''.$record['string'].'\\')');\r\n }\r\n $this->setExpectedException('Exception', 'The query must not be null.');\r\n\t\t$this->getPersistenceAdapter()->getDataTable(null);\r\n\t}",
"public function testIsEmpty()\r\n\t{\r\n\t\t$this->assertTrue( $this->list->is_empty() );\r\n\r\n\t\t// add data\r\n\t\t$this->list->ut_dummy_data();\r\n\r\n\t\t// test with data\r\n\t\t$this->assertFalse( $this->list->is_empty() );\r\n\t}",
"public function testValidateThrowEmptyNoneProtechDataException()\n {\n $this->job->setMapper($this->createMock(Mapper::class));\n\n $this->job->setCsvData([['Name'], ['test']]);\n\n $this->job->getMapper()->expects($this->exactly(1))->method('checkRequiredProperties')->willReturn(true);\n $this->job->getMapper()->expects($this->exactly(1))->method('checkRequiredValidations')->willReturn(true);\n $this->job->getMapper()->expects($this->exactly(1))->method('checkNoneProtectionData')->willReturn(false);\n\n try {\n $this->job->validate();\n } catch (\\Exception $e) {\n $this->assertContains(EntityException::MGS_EMPTY_NONE_PROTECTION_DATA, $e->getMessage());\n }\n }",
"public function testNewArrayIsEmpty()\n {\n $fixture = array();\n \n // Assert that the size of the Array fixture is 0.\n $this->assertEquals(0, sizeof($fixture));\n }",
"public function testMissingData()\n {\n $img = new P4Cms_Image();\n try {\n $img->transform('sharpen');\n $img->getData();\n $this->fail('Expected failure with no data available.');\n } catch (P4Cms_Image_Exception $e) {\n $this->assertSame(\n $e->getMessage(),\n \"Cannot do 'sharpen': image contains no data.\"\n );\n } catch (Exception $e) {\n $this->fail('Unexpected exception: '. $e->getMessage());\n }\n }",
"public function testSaveDataTableNoRows() {\r\n\t\t$datatable = new avorium_core_data_DataTable(0, 4);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'BOOLEAN_VALUE');\r\n\t\t$datatable->setHeader(2, 'INT_VALUE');\r\n\t\t$datatable->setHeader(3, 'STRING_VALUE');\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t}",
"public function testIsEmptyInput()\n {\n $this->assertTrue((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], []));\n \n /**\n * Test if input is missing\n */\n $this->assertTrue((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], ['title' => 'Petition1', 'goal' => 150, 'summary' => 'Petition Summary']));\n \n /**\n * Test if input is correct\n */\n $this->assertFalse((new IndexController($this->request, $this->database))->isEmpty(['title', 'goal', 'image', 'summary'], ['title' => 'Petition1', 'goal' => 150, 'image' => 'petition.jpg', 'summary' => 'Petition Summary']));\n }",
"function data_preprocessing(&$default_values){\n }",
"function _testIsEmpty()\n {\n parent::_testIsEmpty();\n $this->assertFalse($this->m_attribute->isEmpty(array($this->m_attribute->m_name=>array(0=>1,1=>2))), \"isempty\");\n }",
"public function testSampleData() {\n if (isset($this->sampleData) && strlen($this->sampleData) === $this->sampleDataLength) {\n $this->pass(\"The sample data exists and appears to be the correct length.\");\n }\n else {\n $this->fail(\"The sample data is missing or damaged.\");\n }\n }",
"public function getEmptyValues();",
"abstract protected function prepareData( $data );",
"private function getEmptyData() {\n if (!$this -> empty_data) {\n $this -> empty_data = array();\n foreach ($this -> types as $key) {\n $this -> empty_data[$key] = \"\";\n }\n unset($this -> empty_data['user_type']); // the default value should never be set to \"\"\n unset($this -> empty_data['password']); // the default value should never be set to \"\"\n }\n return $this -> empty_data;\n }",
"protected function preprocessData() {}",
"function dataConsideredEmpty($data, $repeatCounter)\n\t{\n\t\t$data = str_replace(null,'',$data);\n\t\tif (strstr($data, ',')) {\n\t\t\t$data = explode(',', $data);\n\t\t}\n\t\t$data = (array) $data;\n\t\tforeach ($data as $d) {\n\t\t\tif (trim($d) == '') {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function getEmptyData(): mixed;",
"function testEmptyPostDataSaveExpectsNothing() {\n\n\t\t// arrange\n\t\t$post_id = 100;\n\t\t$postvalues = null;\n\n\t\t\\WP_Mock::wpFunction( 'update_post_meta', array(\n\t\t\t'times' => 0,)\n\t\t);\n\n\t\t$form = new TestValidTextField();\n\n\t\t// act\n\t\t$form->save( $post_id, $postvalues );\n\t}"
]
| [
"0.6727834",
"0.65995055",
"0.64601374",
"0.64103556",
"0.6337367",
"0.62609416",
"0.62501436",
"0.6224237",
"0.6215562",
"0.6084425",
"0.60659546",
"0.60533744",
"0.60232353",
"0.5995957",
"0.5876387",
"0.5861217",
"0.5843597",
"0.58341616",
"0.578759",
"0.57815003",
"0.57747716",
"0.5773251",
"0.57656354",
"0.57417035",
"0.57350063",
"0.57203317",
"0.5709666",
"0.5708198",
"0.56957966",
"0.56790936"
]
| 0.7135188 | 0 |
test preparation of data for full, nested values with HABTM via With | public function testCopyPrepareDataHABTMViaWith() {
$this->Article->bindModel(
array(
'hasMany' => array(
'ArticlesWidget' => array()
),
'hasAndBelongsToMany' => array(
'Widget' => array('with' => 'ArticlesWidget')
),
),
false
);
$this->Article->ArticlesWidget->bindModel(
array(
'belongsTo' => array(
'Article' => array(),
'Widget' => array(),
),
),
false
);
$this->Article->Widget->bindModel(
array(
'hasMany' => array(
'ArticlesWidget' => array(),
),
),
false
);
$before = $this->Article->find('first', array(
'contain' => array(
'Widget',
'Widget.ArticlesWidget',
),
'recursive' => -1,
));
$this->assertEquals(
$before,
array(
'Article' => array(
'id' => '1',
'user_id' => '1',
'title' => 'First Article',
'body' => 'First Article Body',
'published' => 'Y',
'created' => '2007-03-18 10:39:23',
'updated' => '2007-03-18 10:41:31'
),
'Widget' => array(
(int) 0 => array(
'id' => '1',
'name' => 'Widget 1',
'ArticlesWidget' => array(
'id' => '1',
'article_id' => '1',
'widget_id' => '1',
'order' => '1',
'status' => 'good',
(int) 0 => array(
'id' => '1',
'article_id' => '1',
'widget_id' => '1',
'order' => '1',
'status' => 'good'
)
)
),
(int) 1 => array(
'id' => '2',
'name' => 'Widget 2',
'ArticlesWidget' => array(
'id' => '2',
'article_id' => '1',
'widget_id' => '2',
'order' => '2',
'status' => 'maybe',
(int) 0 => array(
'id' => '2',
'article_id' => '1',
'widget_id' => '2',
'order' => '2',
'status' => 'maybe'
)
)
),
(int) 2 => array(
'id' => '3',
'name' => 'Widget 3',
'ArticlesWidget' => array(
'id' => '3',
'article_id' => '1',
'widget_id' => '3',
'order' => '3',
'status' => 'bad',
(int) 0 => array(
'id' => '3',
'article_id' => '1',
'widget_id' => '3',
'order' => '3',
'status' => 'bad'
)
)
)
)
)
);
$result = $this->Article->copyPrepareData($before);
$expected = array(
'Article' => array(
'user_id' => '1',
'title' => 'First Article',
'body' => 'First Article Body',
'published' => 'Y',
'updated' => '2007-03-18 10:41:31'
),
// handles as hasMany (nested)
'ArticlesWidget' => array(
array(
'widget_id' => '1',
'order' => '1',
'status' => 'good',
(int) 0 => array(
'id' => '1',
'article_id' => '1',
'widget_id' => '1',
'order' => '1',
'status' => 'good'
)
),
array(
'widget_id' => '2',
'order' => '2',
'status' => 'maybe',
(int) 0 => array(
'id' => '2',
'article_id' => '1',
'widget_id' => '2',
'order' => '2',
'status' => 'maybe'
)
),
array(
'widget_id' => '3',
'order' => '3',
'status' => 'bad',
(int) 0 => array(
'id' => '3',
'article_id' => '1',
'widget_id' => '3',
'order' => '3',
'status' => 'bad'
)
)
),
);
$this->assertEquals($expected, $result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCopyPrepareDataHABTMViaWithAsHasMany() {\n\t\t$this->Article->bindModel(\n\t\t\tarray(\n\t\t\t\t'hasMany' => array(\n\t\t\t\t\t'ArticlesWidget' => array()\n\t\t\t\t),\n\t\t\t\t'hasAndBelongsToMany' => array(\n\t\t\t\t\t'Widget' => array('with' => 'ArticlesWidget')\n\t\t\t\t),\n\t\t\t),\n\t\t\tfalse\n\t\t);\n\t\t$this->Article->ArticlesWidget->bindModel(\n\t\t\tarray(\n\t\t\t\t'belongsTo' => array(\n\t\t\t\t\t'Article' => array(),\n\t\t\t\t\t'Widget' => array(),\n\t\t\t\t),\n\t\t\t),\n\t\t\tfalse\n\t\t);\n\t\t$before = $this->Article->find('first', array(\n\t\t\t'contain' => array(\n\t\t\t\t'ArticlesWidget',\n\t\t\t\t'ArticlesWidget.Widget',\n\t\t\t),\n\t\t\t'recursive' => -1,\n\t\t));\n\t\t$this->assertEquals(\n\t\t\t$before,\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t\t),\n\t\t\t\t'ArticlesWidget' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'widget_id' => '1',\n\t\t\t\t\t\t'order' => '1',\n\t\t\t\t\t\t'status' => 'good',\n\t\t\t\t\t\t'Widget' => array(\n\t\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t\t'name' => 'Widget 1'\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'widget_id' => '2',\n\t\t\t\t\t\t'order' => '2',\n\t\t\t\t\t\t'status' => 'maybe',\n\t\t\t\t\t\t'Widget' => array(\n\t\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t\t'name' => 'Widget 2'\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'widget_id' => '3',\n\t\t\t\t\t\t'order' => '3',\n\t\t\t\t\t\t'status' => 'bad',\n\t\t\t\t\t\t'Widget' => array(\n\t\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t\t'name' => 'Widget 3'\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\t$result = $this->Article->copyPrepareData($before);\n\t\t$expected = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => '1',\n\t\t\t\t'title' => 'First Article',\n\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t'published' => 'Y',\n\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t),\n\t\t\t// handles as hasMany (nested)\n\t\t\t'ArticlesWidget' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'widget_id' => '1',\n\t\t\t\t\t'order' => '1',\n\t\t\t\t\t'status' => 'good',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'widget_id' => '2',\n\t\t\t\t\t'order' => '2',\n\t\t\t\t\t'status' => 'maybe',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'widget_id' => '3',\n\t\t\t\t\t'order' => '3',\n\t\t\t\t\t'status' => 'bad',\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testCopyPrepareData1() {\n\t\t$data = $this->expectedFromFixtures[1];\n\t\t$result = $this->Article->copyPrepareData($data);\n\t\t$expected = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => '3',\n\t\t\t\t'title' => 'Second Article',\n\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t'published' => 'Y',\n\t\t\t\t'updated' => '2007-03-18 10:43:31',\n\t\t\t),\n\t\t\t// strips User (belongsTo)\n\t\t\t'Featured' => array(\n\t\t\t\t'category_id' => '1',\n\t\t\t\t'published_date' => '2007-03-31 10:39:23',\n\t\t\t\t'end_date' => '2007-05-15 10:39:23',\n\t\t\t\t'updated' => '2007-03-18 10:41:31',\n\t\t\t\t// strips ArticleFeatured (belongsTo)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:55:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t\t1 => array(\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:57:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t),\n\t\t\t// HABTM switched to just the primary keys for Joins\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t0 => '1',\n\t\t\t\t\t1 => '3',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testHABTM() {\n\t\t$ARTPost = new ARTPost(array('title' => 'lala', 'message' => '', 'writer_id' => 1));\n\t\t$Comment1 = new ARTComment(array('message' => 'coment1 lala1', 'post_id' => 0));\n\t\t$Comment2 = new ARTComment(array('message' => 'coment1 lala2', 'post_id' => 0));\n\t\t$Comment3 = new ARTComment(array('message' => 'coment1 lala3', 'post_id' => 0));\n\t\t$Comment4 = new ARTComment(array('message' => 'coment1 lala4', 'post_id' => 0));\n\t\t\n\t\t$Comment1->Post = $ARTPost;\n\t\t$Comment2->Post = $ARTPost;\n\t\t$Comment3->Post = $ARTPost;\n\t\t$Comment4->Post = $ARTPost;\n\t\t$Comment2->Parents[] = $Comment1;\n\t\t$Comment3->Parents[] = $Comment1;\n\t\t$Comment4->Parents[] = $Comment3;\n\t\t$Comment3->Childrens[] = $Comment4;\n\t\t$Comment1->Childrens[] = $Comment3;\n\t\t$Comment1->Childrens[] = $Comment2;\t\t\n\t\t\n\t\t$Comment1->save();\n\t\t$this->_assertHABTM($Comment1);\n\t\tActiveRecordManager::clearPool();\n\t\t$this->_assertHABTM($Comment1);\n\t\t$ARTComment = $this->TComment->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'TComment.id' => $Comment1->id\n\t\t\t),\n\t\t\t'activeRecord' => true\n\t\t));\n\t\t$this->_assertHABTM($ARTComment);\n\t}",
"function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }",
"public function testInsert(){\n $goodsData = array(\n 'type'=>array(\n 'type_id'=>'2'\n ),\n 'products'=>'1',\n // 'goods_id'=>'',\n 'title'=>'just a goods',\n 'url'=>'http://234',\n 'status'=>'true',\n 'goods_type'=>'normal',\n 'unit' => 'lit',\n // 'link'=>array(\n // 'url'=>'http://afeggg',\n // 'type'=>'',\n // 'option'=>''\n // ),\n 'last_modified'=>time(),\n 'keywords' => array(\n array(\n 'keyword'=>'aabbcc1',\n 'res_type'=>'goods'\n ),\n array(\n 'keyword'=>'aabbcc21',\n 'res_type'=>'goods'\n ),\n ),\n 'brief'=>'goods brief',\n 'props'=>array(\n 'p_1'=>array(\n 'key'=>'jkljlkj',\n 'value'=>2,\n 'desc'=>'redww'\n ),\n 'p_2'=>array(\n 'key'=>'fefe',\n 'value'=>3,\n 'desc'=>'gegeg'\n ),\n 'p_21'=>array(\n 'key'=>'gge',\n 'value'=>'alialialialialialia'\n )\n ),\n /*\n 'orderinfo'=>array(\n \n ),\n */\n 'adjunct'=>array(\n array(\n 'title'=>'adj title',\n 'min'=>'',\n 'max'=>'',\n 'adj_filter'=>'',\n 'adj_include'=>'',\n 'ajd_exclude'=>''\n ),\n array(\n 'title'=>'adj title',\n 'min'=>'',\n 'max'=>'',\n 'adj_filter'=>'',\n 'adj_include'=>'',\n 'ajd_exclude'=>''\n ),\n ),\n 'description'=>'goods des',\n 'category'=>array(\n 'cat_id'=>'3',\n ),\n 'brand'=>array(\n //brand 外键\n 'brand_id'=>3,\n 'brand_name'=> 'fred perry'\n ),\n 'defalut_image'=>array(\n 'gimage_id'=>1,\n 'is_remote'=>'true',\n 'default'=>1,\n 'width'=>'320',\n 'height'=>'480',\n 'source'=>array(\n 'storager'=>'',\n 'url'=>'http://wfewf'\n ),\n 'thumbnail'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'small'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'big'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n ),\n 'adjunct' => array(\n 'gwag'=>array(\n 'gewgew'\n ),\n ),\n 'spec'=>array(\n array(\n 'spec_name'=>'color',\n 'spec_id'=>'1',\n 'option'=>array(\n array(\n 'private_spec_value_id'=>'12345678901',\n 'spec_value_id'=>'2',\n 'spec_value'=>'aaaa',\n 'spec_image'=>'http://fefe',\n 'spec_goods_images'=>'23,124'\n ),\n array(\n 'private_spec_value_id'=>'12345678902',\n 'spec_value_id'=>'4',\n 'spec_value'=>'',\n 'spec_image'=>'',\n 'spec_goods_images'=>''\n ),\n ),\n ),\n array(\n 'spec_name'=>'size',\n 'spec_id'=>'2',\n 'option'=>array(\n array(\n 'private_spec_value_id'=>'12345678912',\n 'spec_value_id'=>'12',\n 'spec_value'=>'aaaaccc',\n 'spec_image'=>'',\n 'spec_goods_images'=>'23,124'\n ),\n array(\n 'private_spec_value_id'=>'12345678934',\n 'spec_value_id'=>'42',\n 'spec_value'=>'',\n 'spec_image'=>'',\n 'spec_goods_images'=>''\n ),\n ),\n )\n ),\n /*\n 'image'=>array(\n array(\n 'gimage_id'=>1,\n 'is_remote'=>'true',\n 'default'=>1,\n 'width'=>'320',\n 'height'=>'480',\n 'source'=>array(\n 'storager'=>'',\n 'url'=>'http://wfewf'\n ),\n 'thumbnail'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'small'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'big'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n ),\n array(\n 'gimage_id'=>2,\n 'is_remote'=>'true',\n 'width'=>'320',\n 'height'=>'480',\n 'source'=>array(\n 'storager'=>'',\n 'url'=>'http://wfewf'\n ),\n 'thumbnail'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'small'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'big'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n ),\n ),\n */\n 'product'=>array(\n array(\n 'title'=>'asfee',\n 'default'=>1,\n 'bn'=>'abacc'.time(),\n 'barcode'=>'fe',\n 'unit'=>'lit',\n 'freez'=>'0',\n 'status'=>'true',\n 'price'=>array(\n 'mktprice'=>array(\n 'title'=>'市场价',\n 'price'=>100.00\n ),\n 'cost'=>array(\n 'title'=>'成本价',\n 'price'=>'50.00'\n ),\n 'price'=>array(\n 'title'=>'销售价',\n 'price'=>'180.00'\n ),\n\n ),\n 'spec_info'=>'fefe,fefe',\n 'spec_desc'=>'',\n 'store'=>10,\n 'weight'=>100,\n 'last_modifie'=>1234567890\n ),\n\n ),\n );\n// $subsdf = array(\n// 'product'=>array(\n// '*',\n// ),\n// );\n// print_r( $this->model->dump(20,'*',$subsdf) );\n $this->model->save($goodsData);\n// $row = $this->model->db->selectrow('select * from sdb_members');\n// $this->assertEquals($row['member_lv_id'],$memberArr['member_group_id']);\n// $this->assertEquals($row['lang'],$memberArr['lang']);\n// $this->assertEquals($row['cur'],$memberArr['currency']);\n }",
"public function test_Category_Tree(){\n\n\t\t$exp_total\t= Good::all()->count();\n\n\t\t$get\t= [\n\t\t\t'draw'\t=> '12'\n\t\t];\n\t\t$res\t= Good::getTableData( $get );\n\n\t\t$this->assertEquals( 12, $res['draw'], \"\\n*** Assert 1 ***\\nWrong 'draw' value\\n\" );\n\t\t$this->assertEquals( $exp_total, $res['recordsTotal'], \"\\n*** Assert 2 ***\\nWrong 'recordsTotal' value\\n\" );\n\n\t\t$new_item\t= [\n\t\t\t'name'\t=> ''\n\t\t\t,'article'=> ''\n\t\t\t,'rprice'\t=> 5.567\n\t\t\t,'wprice'\t=> 4.444\n\t\t\t,'inpack'\t=> 24\n\t\t\t,'packs'\t=> 13\n\t\t\t,'assort'\t=> 17\n\t\t];\n\n\n\n\t\t$this->db['Good']\t= [];\n\t\t$items\t= &$this->db['Good'];\n\n\t for( $i=0; $i<3; $i++ ){\n\t \t$item\t= $new_item;\n\t \t$item['name']\t= self::_ut_name.'_'.$i;\n\t \t$item['article']\t= self::_ut_name.'_'.$i;\n\t\t\t$item_obj\t= new Good();\n\t \t$item_obj\t= $item_obj->fill( $item );\n\t\t $res \t= $item_obj->save();\n\n\t\t $ids[]\t=\n\t\t $item['id']\t= $item_obj->id;;\n\n\t\t\t$items[]\t= $item;\n\n\t\t $item_obj\t= NULL;\n\t }\n\n\n// print_r( $ids);\n\n// \t $ut_item_id\t= $item_obj->id;\n\n\n\t $exp_total\t= Good::all()->count();\n\t $res\t= Good::getTableData( $get );\n// \t $item_obj->delete();\n\n// \t\tGood::whereIn('id');\n\n\n\t $this->assertEquals( $exp_total, $res['recordsTotal'], \"\\n*** Assert 3 ***\\nWrong 'recordsTotal' value\\n\" );\n\n\t}",
"public function testHABTMKeepExisting() {\n\t\t$this->loadFixtures('Site', 'Domain', 'DomainsSite');\n\n\t\t$Site = new Site();\n\t\t$results = $Site->find('count');\n\t\t$expected = 3;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t$data = $Site->findById(1);\n\n\t\t// include api.cakephp.org\n\t\t$data['Domain'] = array('Domain' => array(1, 2, 3));\n\t\t$Site->save($data);\n\n\t\t$Site->id = 1;\n\t\t$results = $Site->read();\n\t\t$expected = 3; // 3 domains belonging to cakephp\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->id = 2;\n\t\t$results = $Site->read();\n\t\t$expected = 2; // 2 domains belonging to markstory\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->id = 3;\n\t\t$results = $Site->read();\n\t\t$expected = 2;\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\t\t$results['Domain'] = array('Domain' => array(7));\n\t\t$Site->save($results); // remove association from domain 6\n\t\t$results = $Site->read();\n\t\t$expected = 1; // only 1 domain left belonging to rchavik\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t// add deleted domain back\n\t\t$results['Domain'] = array('Domain' => array(6, 7));\n\t\t$Site->save($results);\n\t\t$results = $Site->read();\n\t\t$expected = 2; // 2 domains belonging to rchavik\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->DomainsSite->id = $results['Domain'][0]['DomainsSite']['id'];\n\t\t$Site->DomainsSite->saveField('active', true);\n\n\t\t$results = $Site->Domain->DomainsSite->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'DomainsSite.active' => true,\n\t\t\t),\n\t\t));\n\t\t$expected = 5;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t// activate api.cakephp.org\n\t\t$activated = $Site->DomainsSite->findByDomainId(3);\n\t\t$activated['DomainsSite']['active'] = true;\n\t\t$Site->DomainsSite->save($activated);\n\n\t\t$results = $Site->DomainsSite->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'DomainsSite.active' => true,\n\t\t\t),\n\t\t));\n\t\t$expected = 6;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t// remove 2 previously active domains, and leave $activated alone\n\t\t$data = array(\n\t\t\t'Site' => array('id' => 1, 'name' => 'cakephp (modified)'),\n\t\t\t'Domain' => array(\n\t\t\t\t'Domain' => array(3),\n\t\t\t)\n\t\t);\n\t\t$Site->create($data);\n\t\t$Site->save($data);\n\n\t\t// tests that record is still identical prior to removal\n\t\t$Site->id = 1;\n\t\t$results = $Site->read();\n\t\tunset($results['Domain'][0]['DomainsSite']['updated']);\n\t\tunset($activated['DomainsSite']['updated']);\n\t\t$this->assertEquals($activated['DomainsSite'], $results['Domain'][0]['DomainsSite']);\n\t}",
"protected function _prepareSubset() {}",
"public function testCanGetFilteredDatasetsForAccountsOptionallyFilteredByProjectAndTagAndCategories() {\n AuthenticationHelper::login(\"[email protected]\", \"password\");\n\n\n $categories = [\n new CategorySummary(\"Account1\", \"An account wide category available to account 1\", \"account1\")\n ];\n $this->metaDataService->returnValue(\"getObjectCategoriesFromSummaries\", [\n new ObjectCategory(new Category(new CategorySummary(\"Account 1\", \"Account 1\", \"account1\"), 1)),\n ], [\n $categories, 1, null\n ]);\n\n\n $accountDataSet = new DatasetInstanceSummary(\"Account Dataset\", \"test-json\", null, [], [], [], null, null, $categories);\n $this->datasetService->saveDataSetInstance($accountDataSet, null, 1);\n\n $accountDataSet = new DatasetInstanceSummary(\"Second Account Dataset\", \"test-json\");\n $this->datasetService->saveDataSetInstance($accountDataSet, null, 1);\n\n\n $datasetProject = new Project(\"Dataset Project\", 1, \"datasetProject\");\n $datasetProject->save();\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"Special\", \"Special Tag\", \"special\"), 1, \"datasetProject\")),\n new ObjectTag(new Tag(new TagSummary(\"General\", \"General Tag\", \"general\"), 1, \"datasetProject\"))\n ], [\n [\n new TagSummary(\"Special\", \"\", \"special\"),\n new TagSummary(\"General\", \"\", \"general\")\n ], 1, \"datasetProject\"\n ]);\n\n $this->metaDataService->returnValue(\"getObjectTagsFromSummaries\", [\n new ObjectTag(new Tag(new TagSummary(\"General\", \"General Tag\", \"general\"), 1, \"datasetProject\"))\n ], [\n [\n new TagSummary(\"General\", \"\", \"general\")\n ], 1, \"datasetProject\"\n ]);\n\n\n $projectDataSet = new DatasetInstanceSummary(\"Project Dataset\", \"test-json\");\n $projectDataSet->setTags([\n new TagSummary(\"Special\", \"\", \"special\"),\n new TagSummary(\"General\", \"\", \"general\")\n ]);\n $this->datasetService->saveDataSetInstance($projectDataSet, \"datasetProject\", 1);\n\n $projectDataSet = new DatasetInstanceSummary(\"Second Project Dataset\", \"test-json\");\n $projectDataSet->setTags([\n new TagSummary(\"General\", \"\", \"general\")\n ]);\n $this->datasetService->saveDataSetInstance($projectDataSet, \"datasetProject\", 1);\n\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [], null, 0, 10, 1);\n $this->assertEquals(4, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Project Dataset\", $filtered[1]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[2]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[2]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[3]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[3]->getTitle());\n\n\n // Filter on title\n $filtered = $this->datasetService->filterDataSetInstances(\"econd\", [], [], null, 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n\n // Filter on categories\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [\"account1\"], [], null, 0, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n\n // Filter on project key\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n // Filter on tags\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[1]->getTitle());\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"special\"], \"datasetProject\", 0, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n\n // Filter on special NONE tags\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"NONE\"], null, 0, 10, 1);\n $this->assertEquals(2, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Account Dataset\", $filtered[0]->getTitle());\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[1]);\n $this->assertEquals(\"Second Account Dataset\", $filtered[1]->getTitle());\n\n // Offsets and limits\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 0, 1, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Project Dataset\", $filtered[0]->getTitle());\n\n\n $filtered = $this->datasetService->filterDataSetInstances(\"\", [], [\"general\"], \"datasetProject\", 1, 10, 1);\n $this->assertEquals(1, sizeof($filtered));\n $this->assertInstanceOf(DatasetInstanceSearchResult::class, $filtered[0]);\n $this->assertEquals(\"Second Project Dataset\", $filtered[0]->getTitle());\n\n\n }",
"public function test_ouwiki_build_up_sub_index() {\n $index = [\n 1 => (object) ['linksto' => [2]],\n 2 => (object) ['linksto' => [1]]\n ];\n $subtree = [];\n ouwiki_build_up_sub_index(1, $index,$subtree);\n $this->assertEquals($index, $subtree);\n }",
"abstract public function populate();",
"public function canPopulateRelationTest()\n {\n $relationTest = new Relation(['test' => 'super']);\n\n $this->assertArrayHasKey('test', $relationTest->getData());\n }",
"protected function _createSubset() {}",
"protected function prepareMyData(){\n\t\tglobal $C;\n if( $this->id > 0 ){\n $this->get( \"`id`={$this->id}\" );\n $this->unstoreSfield();\n }\n\t\t$C->setID( $this->data['parent'] );\n\t\t$C->get( \"`id`={$this->data['parent']}\" );\n\t\t$C->unstoreSfield();\n $p = $C->getData();\n if( is_array( $p ) ){\n\t\t\tT::assign( \"parent\", $p[\"name\"] );\n\t\t\t$fieldlist=array();\n if( is_array( $p[\"fields\"] ) )\n foreach( $p[\"fields\"] as $key => $item ){\n $fieldlist[] = array( \"cnt\" => $key, \"name\" => $item, \"value\"=> $this->data[$this->sfield][$key] );\n }\n\t\t\tT::assign( \"fieldlist\", $fieldlist );\n }\n\t\tT::assign( \"f\", $this->sfield );\n\t\tT::assign( \"item\",$this->data );\t\t\n\t}",
"public function testInsertMulti()\n {\n $data = static::articleData();\n\n $result = Hash::insert($data, '{n}.Article.insert', 'value');\n $this->assertEquals('value', $result[0]['Article']['insert']);\n $this->assertEquals('value', $result[1]['Article']['insert']);\n\n $result = Hash::insert($data, '{n}.Comment.{n}.insert', 'value');\n $this->assertEquals('value', $result[0]['Comment'][0]['insert']);\n $this->assertEquals('value', $result[0]['Comment'][1]['insert']);\n\n $data = [\n 0 => ['Item' => ['id' => 1, 'title' => 'first']],\n 1 => ['Item' => ['id' => 2, 'title' => 'second']],\n 2 => ['Item' => ['id' => 3, 'title' => 'third']],\n 3 => ['Item' => ['id' => 4, 'title' => 'fourth']],\n 4 => ['Item' => ['id' => 5, 'title' => 'fifth']],\n ];\n $result = Hash::insert($data, '{n}.Item[id=/\\b2|\\b4/]', ['test' => 2]);\n $expected = [\n 0 => ['Item' => ['id' => 1, 'title' => 'first']],\n 1 => ['Item' => ['id' => 2, 'title' => 'second', 'test' => 2]],\n 2 => ['Item' => ['id' => 3, 'title' => 'third']],\n 3 => ['Item' => ['id' => 4, 'title' => 'fourth', 'test' => 2]],\n 4 => ['Item' => ['id' => 5, 'title' => 'fifth']],\n ];\n $this->assertEquals($expected, $result);\n\n $data[3]['testable'] = true;\n $result = Hash::insert($data, '{n}[testable].Item[id=/\\b2|\\b4/].test', 2);\n $expected = [\n 0 => ['Item' => ['id' => 1, 'title' => 'first']],\n 1 => ['Item' => ['id' => 2, 'title' => 'second']],\n 2 => ['Item' => ['id' => 3, 'title' => 'third']],\n 3 => ['Item' => ['id' => 4, 'title' => 'fourth', 'test' => 2], 'testable' => true],\n 4 => ['Item' => ['id' => 5, 'title' => 'fifth']],\n ];\n $this->assertEquals($expected, $result);\n }",
"function get_fancy_data($data)\n {\n /*\n * Initialize value\n */\n $collection = array();\n $basemodel = NULL;\n $i = 0;\n\n /*\n * Outer loop to run untill the data array end\n */\n foreach ($data as $k => $v) {\n /* Ndoe generator */\n $node = array();\n\n /*\n * Preserver first instance of the row in to a dummy variable\n */\n foreach ($v as $key => $val) {\n if (!is_numeric($key)) {\n $keys = explode(\".\", $key);\n $basemodel = isset($basemodel) ? $basemodel : $keys[0];\n $node[$keys[0]][$keys[1]] = $val;\n }\n }\n\n /*\n * Collect the first node baded model id\n */\n $key_cur = isset($key_cur) ? $key_cur : $v[\"$basemodel.id\"];\n\n /*\n * Set the values in correct place of the the node array\n */\n foreach ($node as $y => $z) {\n if ($y == $basemodel) {\n /* For princilple model it save in to a single array */\n $collection[$v[\"$basemodel.id\"]][$y] = $z;\n }\n else {\n if (implode(\"\", $z) != \"\") {\n /* For relational model it save in to a nulti dymantional array array */\n $collection[$v[\"$basemodel.id\"]][$y][] = $z;\n }\n else if (!isset($collection[$v[\"$basemodel.id\"]][$y])) {\n /* Create an empty array of no data found in a relational model */\n $collection[$v[\"$basemodel.id\"]][$y] = array();\n }\n }\n }\n\n /*\n * Reset the array index in a normal sequence\n */\n if ($key_cur != $v[\"$basemodel.id\"]) {\n $collection[$i++] = $collection[$key_cur];\n unset($collection[$key_cur]);\n $key_cur = $v[\"$basemodel.id\"];\n }\n }\n\n /* Reset the last node of the array */\n $collection[$i] = $collection[$key_cur];\n unset($collection[$key_cur]);\n\n return $collection;\n }",
"private function makeRelationBetweenCategoryAndDummyTable() {}",
"private function populateDummyTable() {}",
"public function getTestNestedQueryData()\n {\n $out = [];\n $testData = $this->getDataArray();\n\n $mapping = [\n 'product' => [\n 'properties' => [\n 'sub_product' => [\n 'type' => 'nested',\n 'properties' => [\n 'id' => [\n 'type' => 'string',\n 'index' => 'not_analyzed',\n ],\n 'title' => [\n 'type' => 'string',\n ],\n 'price' => [\n 'type' => 'float',\n ],\n ],\n ],\n ],\n ],\n ];\n\n // Case #0: Test range.\n $query = new NestedQuery('sub_product', new RangeQuery('sub_product.price', ['from' => 100]));\n\n $out[] = [\n $query,\n [\n $testData['default']['product'][2],\n $testData['default']['product'][1],\n ],\n $mapping,\n ];\n\n // Case #1: Test MatchAll with no data.\n $query = new NestedQuery('sub_product', new MatchAllQuery());\n\n $out[] = [\n $query,\n [\n $testData['default']['product'][1],\n $testData['default']['product'][2],\n $testData['default']['product'][0],\n ],\n $mapping,\n ];\n\n // Case #2: Test fuzzy.\n $query = new NestedQuery('sub_product', new FuzzyQuery('sub_product.price', 10, ['fuzziness' => 10]));\n\n $out[] = [$query, [$testData['default']['product'][0]], $mapping];\n\n return $out;\n }",
"function test_more_HasJoined()\n {\n $idFriend = $this->friend->insert( Dao_SetUp::makeFriend() );\n $friend = $this->friend->find( $idFriend );\n $idGroup1 = $this->group->insert( Dao_SetUp::makeGroup() );\n $idGroup2 = $this->group->insert( Dao_SetUp::makeGroup(1) );\n $group1 = $this->group->find( $idGroup1 );\n $group2 = $this->group->find( $idGroup2 );\n $relation = $this->friend->relation( $friend, 'group' );\n $relation->setValues( array( 'created_date' => '1999-12-31' ) )->set( $group1 );\n $relation->set( $group2 );\n \n // get groups using relations. \n $groups = $relation->setOrder( 'myGroup.group_code DESC' )->get();\n $group = $groups[1];\n $dataGroup = Dao_SetUp::makeGroup(0);\n $this->assertEquals( $dataGroup[ 'group_code' ], $group->group_code );\n $this->assertEquals( '1999-12-31', $group->created_date );\n $this->assertEquals( $idFriend, $group->friend_id );\n $group = $groups[0];\n $dataGroup = Dao_SetUp::makeGroup(1);\n $this->assertEquals( $dataGroup[ 'group_code' ], $group->group_code );\n $this->assertEquals( '1999-12-31', $group->created_date );\n $this->assertEquals( $idFriend, $group->friend_id );\n }",
"public function testMultiRelationColumn()\n {\n $this->specify(\n 'The Model::hasMany by using multi relation column does not work as expected',\n function () {\n $list = Packages::find();\n foreach ($list as $item) {\n expect($item)->isInstanceOf(Packages::class);\n expect($item->details)->isInstanceOf(Simple::class);\n expect($item->details->valid())->true();\n expect($item->details->count())->greaterOrEquals(2);\n expect($item->details->getFirst())->isInstanceOf(PackageDetails::class);\n }\n }\n );\n }",
"public function test_2_3()\n {\n $out = SetupTestData::hasmany_save_2();\n\n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n\n $out['person']->clean_addresses();\n\n $out['person']->save();\n\n\n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n foreach ($addresses as $i => $address)\n {\n $this->assert($address->person_addresses_back === NULL, \"Backlink of item $i object is NULL\");\n }\n }",
"public function populate($data)\n {\n $set_data = [];\n\n foreach ((array)$data as $row_key => $row_value) {\n if (is_array($row_value) && isset($this->groups[$row_key])) {\n foreach ($row_value as $row_subkey => $row_subvalue) {\n $set_data[$row_key . '_' . $row_subkey] = $row_subvalue;\n }\n } else {\n $set_data[$row_key] = $row_value;\n }\n }\n\n foreach ($set_data as $field_name => $field_value) {\n if (isset($this->fields[$field_name])) {\n $field = $this->fields[$field_name];\n $field->setValue($field_value);\n }\n }\n }",
"public function getDataWithTypeFieldAndFieldIsMultiDimensional() {}",
"public function populateAsReference()\n {\n\n $orm = $this->db->getOrm();\n\n // Reference Container zum befüllen der Referenz Datensätze\n $refContainers = array();\n\n // Sicher stelle, das keine unerwarteten Daten in der Tabelle sind\n $orm->cleanResource('WbfsysRoleGroup');\n\n // Leeren des Caches\n $orm->clearCache();\n\n // global\n $orm->import\n (\n 'WbfsysRoleGroup',\n array\n (\n array\n (\n 'name' => 'name_1',\n 'access_key' => 'access_key_1',\n 'description' => 'Lorem ipsum dolor sit amet, consectetur adipisici elit,\nsed eiusmod tempor incidunt ut labore et dolore magna aliqua.\nUt enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut\naliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit\nesse cillum dolore eu fugiat nulla pariatur.\nExcepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt\nmollit anim id est laborum.'\n ),\n )\n );\n\n }",
"public function saveDataProvider()\n {\n return [\n [\n 'skus' => [\n 'newSku' => [\n 'sku_assoc1' => ['entity_id' => 1],\n 'productsku' => ['entity_id' => 3, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ],\n 'oldSku' => ['sku_assoc2' => ['entity_id' => 2]]\n ],\n 'bunch' => [\n 'associated_skus' => 'sku_assoc1=1, sku_assoc2=2',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]\n ],\n [\n 'skus' => [\n 'newSku' => [\n 'productsku' => ['entity_id' => 1, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ],\n 'oldSku' => []\n ],\n 'bunch' => [\n 'associated_skus' => '',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]\n ],\n [\n 'skus' => ['newSku' => [],'oldSku' => []],\n 'bunch' => [\n 'associated_skus' => 'sku_assoc1=1, sku_assoc2=2',\n 'sku' => 'productsku',\n 'product_type' => 'grouped'\n ]\n ],\n [\n 'skus' => [\n 'newSku' => [\n 'sku_assoc1' => ['entity_id' => 1],\n 'productsku' => ['entity_id' => 3, 'attr_set_code' => 'Default', 'type_id' => 'grouped']\n ],\n 'oldSku' => []\n ],\n 'bunch' => [\n 'associated_skus' => 'sku_assoc1=1',\n 'sku' => 'productsku',\n 'product_type' => 'simple'\n ]\n ]\n ];\n }",
"public function testPostMany()\n {\n $data = $this->createMany(10);\n $this->postManyTest($data);\n }",
"function testSaveAllHabtm() {\n\t\t$this->loadFixtures('Article', 'Tag', 'Comment', 'User');\n\t\t$data = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => 1, 'title' => 'RRticle Has and belongs to Many Tags'\n\t\t\t),\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t1, 2\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\tarray('comment' => 'Article comment', 'user_id' => 1),\n\t\t\t),\n\t\t);\n\t\t$Article =& new Article();\n\t\t$result = $Article->saveAll($data);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $Article->read();\n\t\t$this->assertEqual(count($result['Tag']), 2);\n\t\t$this->assertEqual($result['Tag'][0]['tag'], 'tag1');\n\t\t$this->assertEqual(count($result['Comment']), 1);\n\t\t$this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1);\n\t}",
"public function testAddMultipleRelationshipItemsToData()\n {\n $this->document->addToData($parent = $this->schemaFactory->createResourceObject($this->getSchema(\n 'people',\n '123',\n ['firstName' => 'John', 'lastName' => 'Dow'],\n new Link('selfUrl/'), // self url\n [], // links for resource\n null // meta\n ), new stdClass(), false));\n\n $resource = $this->schemaFactory->createResourceObject($this->getSchema(\n 'comments',\n '321',\n null, // attributes\n new Link('selfUrlWillBeHidden/'),\n [LinkInterface::SELF => new Link('selfUrlWillBeHidden/')], // links for resource\n ['this meta' => 'wont be shown'], // meta when resource is primary\n [], // links for included resource\n false, // show relationships in 'included'\n ['this meta' => 'wont be shown'], // meta when resource within 'included'\n ['some' => 'comment meta'] // meta when resource is in relationship\n ), new stdClass(), true);\n\n $link = $this->schemaFactory->createRelationshipObject(\n 'comments-relationship',\n new stdClass(), // in reality it will be a Comment class instance where $resource properties were taken from\n [], // links\n null, // relationship meta\n true, // show data\n false // is root\n );\n $this->document->addRelationshipToData($parent, $link, $resource);\n $this->document->addRelationshipToData($parent, $link, $resource);\n $this->document->setResourceCompleted($parent);\n\n $expected = <<<EOL\n {\n \"data\" : {\n \"type\" : \"people\",\n \"id\" : \"123\",\n \"attributes\" : {\n \"firstName\" : \"John\",\n \"lastName\" : \"Dow\"\n },\n \"relationships\" : {\n \"comments-relationship\" : {\n \"data\" : [\n { \"type\" : \"comments\", \"id\" : \"321\", \"meta\" : {\"some\" : \"comment meta\"} },\n { \"type\" : \"comments\", \"id\" : \"321\", \"meta\" : {\"some\" : \"comment meta\"} }\n ]\n }\n }\n }\n }\nEOL;\n $this->check($expected);\n }",
"public function test_4_3()\n {\n $out = SetupTestData::hasmany_save_4();\n \n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n \n $out['person']->clean_addresses(); // shouldn't turn on the is_dirty because there are no objects\n \n $out['person']->save(); // shouldn't update because is not dirty\n \n \n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n $this->assert(count($addresses) === 0, 'Has many has 0 objects');\n }"
]
| [
"0.68657714",
"0.6029806",
"0.5984511",
"0.5847551",
"0.56740266",
"0.56019706",
"0.5532653",
"0.553095",
"0.55207485",
"0.5507854",
"0.5500636",
"0.545042",
"0.5393062",
"0.5362851",
"0.5360412",
"0.533871",
"0.5334972",
"0.5334413",
"0.52892196",
"0.5286923",
"0.5275537",
"0.52731663",
"0.5268058",
"0.52569705",
"0.52559453",
"0.5251306",
"0.5236028",
"0.51977766",
"0.51972646",
"0.51946086"
]
| 0.6602787 | 1 |
test preparation of data for full, nested values with HABTM via With as hasMany | public function testCopyPrepareDataHABTMViaWithAsHasMany() {
$this->Article->bindModel(
array(
'hasMany' => array(
'ArticlesWidget' => array()
),
'hasAndBelongsToMany' => array(
'Widget' => array('with' => 'ArticlesWidget')
),
),
false
);
$this->Article->ArticlesWidget->bindModel(
array(
'belongsTo' => array(
'Article' => array(),
'Widget' => array(),
),
),
false
);
$before = $this->Article->find('first', array(
'contain' => array(
'ArticlesWidget',
'ArticlesWidget.Widget',
),
'recursive' => -1,
));
$this->assertEquals(
$before,
array(
'Article' => array(
'id' => '1',
'user_id' => '1',
'title' => 'First Article',
'body' => 'First Article Body',
'published' => 'Y',
'created' => '2007-03-18 10:39:23',
'updated' => '2007-03-18 10:41:31'
),
'ArticlesWidget' => array(
array(
'id' => '1',
'article_id' => '1',
'widget_id' => '1',
'order' => '1',
'status' => 'good',
'Widget' => array(
'id' => '1',
'name' => 'Widget 1'
)
),
array(
'id' => '2',
'article_id' => '1',
'widget_id' => '2',
'order' => '2',
'status' => 'maybe',
'Widget' => array(
'id' => '2',
'name' => 'Widget 2'
)
),
array(
'id' => '3',
'article_id' => '1',
'widget_id' => '3',
'order' => '3',
'status' => 'bad',
'Widget' => array(
'id' => '3',
'name' => 'Widget 3'
)
)
)
)
);
$result = $this->Article->copyPrepareData($before);
$expected = array(
'Article' => array(
'user_id' => '1',
'title' => 'First Article',
'body' => 'First Article Body',
'published' => 'Y',
'updated' => '2007-03-18 10:41:31'
),
// handles as hasMany (nested)
'ArticlesWidget' => array(
array(
'widget_id' => '1',
'order' => '1',
'status' => 'good',
),
array(
'widget_id' => '2',
'order' => '2',
'status' => 'maybe',
),
array(
'widget_id' => '3',
'order' => '3',
'status' => 'bad',
)
)
);
$this->assertEquals($expected, $result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCopyPrepareDataHABTMViaWith() {\n\t\t$this->Article->bindModel(\n\t\t\tarray(\n\t\t\t\t'hasMany' => array(\n\t\t\t\t\t'ArticlesWidget' => array()\n\t\t\t\t),\n\t\t\t\t'hasAndBelongsToMany' => array(\n\t\t\t\t\t'Widget' => array('with' => 'ArticlesWidget')\n\t\t\t\t),\n\t\t\t),\n\t\t\tfalse\n\t\t);\n\t\t$this->Article->ArticlesWidget->bindModel(\n\t\t\tarray(\n\t\t\t\t'belongsTo' => array(\n\t\t\t\t\t'Article' => array(),\n\t\t\t\t\t'Widget' => array(),\n\t\t\t\t),\n\t\t\t),\n\t\t\tfalse\n\t\t);\n\t\t$this->Article->Widget->bindModel(\n\t\t\tarray(\n\t\t\t\t'hasMany' => array(\n\t\t\t\t\t'ArticlesWidget' => array(),\n\t\t\t\t),\n\t\t\t),\n\t\t\tfalse\n\t\t);\n\t\t$before = $this->Article->find('first', array(\n\t\t\t'contain' => array(\n\t\t\t\t'Widget',\n\t\t\t\t'Widget.ArticlesWidget',\n\t\t\t),\n\t\t\t'recursive' => -1,\n\t\t));\n\t\t$this->assertEquals(\n\t\t\t$before,\n\t\t\tarray(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'title' => 'First Article',\n\t\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'created' => '2007-03-18 10:39:23',\n\t\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t\t),\n\t\t\t\t'Widget' => array(\n\t\t\t\t\t(int) 0 => array(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'name' => 'Widget 1',\n\t\t\t\t\t\t'ArticlesWidget' => array(\n\t\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t\t'widget_id' => '1',\n\t\t\t\t\t\t\t'order' => '1',\n\t\t\t\t\t\t\t'status' => 'good',\n\t\t\t\t\t\t\t(int) 0 => array(\n\t\t\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t\t\t'widget_id' => '1',\n\t\t\t\t\t\t\t\t'order' => '1',\n\t\t\t\t\t\t\t\t'status' => 'good'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t(int) 1 => array(\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t'name' => 'Widget 2',\n\t\t\t\t\t\t'ArticlesWidget' => array(\n\t\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t\t'widget_id' => '2',\n\t\t\t\t\t\t\t'order' => '2',\n\t\t\t\t\t\t\t'status' => 'maybe',\n\t\t\t\t\t\t\t(int) 0 => array(\n\t\t\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t\t\t'widget_id' => '2',\n\t\t\t\t\t\t\t\t'order' => '2',\n\t\t\t\t\t\t\t\t'status' => 'maybe'\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t(int) 2 => array(\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t'name' => 'Widget 3',\n\t\t\t\t\t\t'ArticlesWidget' => array(\n\t\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t\t'widget_id' => '3',\n\t\t\t\t\t\t\t'order' => '3',\n\t\t\t\t\t\t\t'status' => 'bad',\n\t\t\t\t\t\t\t(int) 0 => array(\n\t\t\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t\t\t'widget_id' => '3',\n\t\t\t\t\t\t\t\t'order' => '3',\n\t\t\t\t\t\t\t\t'status' => 'bad'\n\t\t\t\t\t\t\t)\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\t$result = $this->Article->copyPrepareData($before);\n\t\t$expected = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => '1',\n\t\t\t\t'title' => 'First Article',\n\t\t\t\t'body' => 'First Article Body',\n\t\t\t\t'published' => 'Y',\n\t\t\t\t'updated' => '2007-03-18 10:41:31'\n\t\t\t),\n\t\t\t// handles as hasMany (nested)\n\t\t\t'ArticlesWidget' => array(\n\t\t\t\tarray(\n\t\t\t\t\t'widget_id' => '1',\n\t\t\t\t\t'order' => '1',\n\t\t\t\t\t'status' => 'good',\n\t\t\t\t\t(int) 0 => array(\n\t\t\t\t\t\t'id' => '1',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'widget_id' => '1',\n\t\t\t\t\t\t'order' => '1',\n\t\t\t\t\t\t'status' => 'good'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'widget_id' => '2',\n\t\t\t\t\t'order' => '2',\n\t\t\t\t\t'status' => 'maybe',\n\t\t\t\t\t(int) 0 => array(\n\t\t\t\t\t\t'id' => '2',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'widget_id' => '2',\n\t\t\t\t\t\t'order' => '2',\n\t\t\t\t\t\t'status' => 'maybe'\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'widget_id' => '3',\n\t\t\t\t\t'order' => '3',\n\t\t\t\t\t'status' => 'bad',\n\t\t\t\t\t(int) 0 => array(\n\t\t\t\t\t\t'id' => '3',\n\t\t\t\t\t\t'article_id' => '1',\n\t\t\t\t\t\t'widget_id' => '3',\n\t\t\t\t\t\t'order' => '3',\n\t\t\t\t\t\t'status' => 'bad'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testCopyPrepareData1() {\n\t\t$data = $this->expectedFromFixtures[1];\n\t\t$result = $this->Article->copyPrepareData($data);\n\t\t$expected = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => '3',\n\t\t\t\t'title' => 'Second Article',\n\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t'published' => 'Y',\n\t\t\t\t'updated' => '2007-03-18 10:43:31',\n\t\t\t),\n\t\t\t// strips User (belongsTo)\n\t\t\t'Featured' => array(\n\t\t\t\t'category_id' => '1',\n\t\t\t\t'published_date' => '2007-03-31 10:39:23',\n\t\t\t\t'end_date' => '2007-05-15 10:39:23',\n\t\t\t\t'updated' => '2007-03-18 10:41:31',\n\t\t\t\t// strips ArticleFeatured (belongsTo)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:55:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t\t1 => array(\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:57:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t),\n\t\t\t// HABTM switched to just the primary keys for Joins\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t0 => '1',\n\t\t\t\t\t1 => '3',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }",
"public function testHABTM() {\n\t\t$ARTPost = new ARTPost(array('title' => 'lala', 'message' => '', 'writer_id' => 1));\n\t\t$Comment1 = new ARTComment(array('message' => 'coment1 lala1', 'post_id' => 0));\n\t\t$Comment2 = new ARTComment(array('message' => 'coment1 lala2', 'post_id' => 0));\n\t\t$Comment3 = new ARTComment(array('message' => 'coment1 lala3', 'post_id' => 0));\n\t\t$Comment4 = new ARTComment(array('message' => 'coment1 lala4', 'post_id' => 0));\n\t\t\n\t\t$Comment1->Post = $ARTPost;\n\t\t$Comment2->Post = $ARTPost;\n\t\t$Comment3->Post = $ARTPost;\n\t\t$Comment4->Post = $ARTPost;\n\t\t$Comment2->Parents[] = $Comment1;\n\t\t$Comment3->Parents[] = $Comment1;\n\t\t$Comment4->Parents[] = $Comment3;\n\t\t$Comment3->Childrens[] = $Comment4;\n\t\t$Comment1->Childrens[] = $Comment3;\n\t\t$Comment1->Childrens[] = $Comment2;\t\t\n\t\t\n\t\t$Comment1->save();\n\t\t$this->_assertHABTM($Comment1);\n\t\tActiveRecordManager::clearPool();\n\t\t$this->_assertHABTM($Comment1);\n\t\t$ARTComment = $this->TComment->find('first', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'TComment.id' => $Comment1->id\n\t\t\t),\n\t\t\t'activeRecord' => true\n\t\t));\n\t\t$this->_assertHABTM($ARTComment);\n\t}",
"public function test_4_3()\n {\n $out = SetupTestData::hasmany_save_4();\n \n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n \n $out['person']->clean_addresses(); // shouldn't turn on the is_dirty because there are no objects\n \n $out['person']->save(); // shouldn't update because is not dirty\n \n \n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n $this->assert(count($addresses) === 0, 'Has many has 0 objects');\n }",
"public function test_2_3()\n {\n $out = SetupTestData::hasmany_save_2();\n\n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n\n $out['person']->clean_addresses();\n\n $out['person']->save();\n\n\n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n foreach ($addresses as $i => $address)\n {\n $this->assert($address->person_addresses_back === NULL, \"Backlink of item $i object is NULL\");\n }\n }",
"public function test_1_3()\n {\n $out = SetupTestData::hasmany_save_1();\n\n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n\n $out['person']->clean_addresses();\n\n $out['person']->save();\n\n\n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n foreach ($addresses as $i => $address)\n {\n $this->assert($address->person_addresses_back === NULL, \"Backlink of item $i object is NULL\");\n }\n }",
"public function canPopulateRelationTest()\n {\n $relationTest = new Relation(['test' => 'super']);\n\n $this->assertArrayHasKey('test', $relationTest->getData());\n }",
"abstract public function populate();",
"public function testInsert(){\n $goodsData = array(\n 'type'=>array(\n 'type_id'=>'2'\n ),\n 'products'=>'1',\n // 'goods_id'=>'',\n 'title'=>'just a goods',\n 'url'=>'http://234',\n 'status'=>'true',\n 'goods_type'=>'normal',\n 'unit' => 'lit',\n // 'link'=>array(\n // 'url'=>'http://afeggg',\n // 'type'=>'',\n // 'option'=>''\n // ),\n 'last_modified'=>time(),\n 'keywords' => array(\n array(\n 'keyword'=>'aabbcc1',\n 'res_type'=>'goods'\n ),\n array(\n 'keyword'=>'aabbcc21',\n 'res_type'=>'goods'\n ),\n ),\n 'brief'=>'goods brief',\n 'props'=>array(\n 'p_1'=>array(\n 'key'=>'jkljlkj',\n 'value'=>2,\n 'desc'=>'redww'\n ),\n 'p_2'=>array(\n 'key'=>'fefe',\n 'value'=>3,\n 'desc'=>'gegeg'\n ),\n 'p_21'=>array(\n 'key'=>'gge',\n 'value'=>'alialialialialialia'\n )\n ),\n /*\n 'orderinfo'=>array(\n \n ),\n */\n 'adjunct'=>array(\n array(\n 'title'=>'adj title',\n 'min'=>'',\n 'max'=>'',\n 'adj_filter'=>'',\n 'adj_include'=>'',\n 'ajd_exclude'=>''\n ),\n array(\n 'title'=>'adj title',\n 'min'=>'',\n 'max'=>'',\n 'adj_filter'=>'',\n 'adj_include'=>'',\n 'ajd_exclude'=>''\n ),\n ),\n 'description'=>'goods des',\n 'category'=>array(\n 'cat_id'=>'3',\n ),\n 'brand'=>array(\n //brand 外键\n 'brand_id'=>3,\n 'brand_name'=> 'fred perry'\n ),\n 'defalut_image'=>array(\n 'gimage_id'=>1,\n 'is_remote'=>'true',\n 'default'=>1,\n 'width'=>'320',\n 'height'=>'480',\n 'source'=>array(\n 'storager'=>'',\n 'url'=>'http://wfewf'\n ),\n 'thumbnail'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'small'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'big'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n ),\n 'adjunct' => array(\n 'gwag'=>array(\n 'gewgew'\n ),\n ),\n 'spec'=>array(\n array(\n 'spec_name'=>'color',\n 'spec_id'=>'1',\n 'option'=>array(\n array(\n 'private_spec_value_id'=>'12345678901',\n 'spec_value_id'=>'2',\n 'spec_value'=>'aaaa',\n 'spec_image'=>'http://fefe',\n 'spec_goods_images'=>'23,124'\n ),\n array(\n 'private_spec_value_id'=>'12345678902',\n 'spec_value_id'=>'4',\n 'spec_value'=>'',\n 'spec_image'=>'',\n 'spec_goods_images'=>''\n ),\n ),\n ),\n array(\n 'spec_name'=>'size',\n 'spec_id'=>'2',\n 'option'=>array(\n array(\n 'private_spec_value_id'=>'12345678912',\n 'spec_value_id'=>'12',\n 'spec_value'=>'aaaaccc',\n 'spec_image'=>'',\n 'spec_goods_images'=>'23,124'\n ),\n array(\n 'private_spec_value_id'=>'12345678934',\n 'spec_value_id'=>'42',\n 'spec_value'=>'',\n 'spec_image'=>'',\n 'spec_goods_images'=>''\n ),\n ),\n )\n ),\n /*\n 'image'=>array(\n array(\n 'gimage_id'=>1,\n 'is_remote'=>'true',\n 'default'=>1,\n 'width'=>'320',\n 'height'=>'480',\n 'source'=>array(\n 'storager'=>'',\n 'url'=>'http://wfewf'\n ),\n 'thumbnail'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'small'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'big'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n ),\n array(\n 'gimage_id'=>2,\n 'is_remote'=>'true',\n 'width'=>'320',\n 'height'=>'480',\n 'source'=>array(\n 'storager'=>'',\n 'url'=>'http://wfewf'\n ),\n 'thumbnail'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'small'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n 'big'=>array(\n 'storager'=>'',\n 'url'=>'http://ffff',\n ),\n ),\n ),\n */\n 'product'=>array(\n array(\n 'title'=>'asfee',\n 'default'=>1,\n 'bn'=>'abacc'.time(),\n 'barcode'=>'fe',\n 'unit'=>'lit',\n 'freez'=>'0',\n 'status'=>'true',\n 'price'=>array(\n 'mktprice'=>array(\n 'title'=>'市场价',\n 'price'=>100.00\n ),\n 'cost'=>array(\n 'title'=>'成本价',\n 'price'=>'50.00'\n ),\n 'price'=>array(\n 'title'=>'销售价',\n 'price'=>'180.00'\n ),\n\n ),\n 'spec_info'=>'fefe,fefe',\n 'spec_desc'=>'',\n 'store'=>10,\n 'weight'=>100,\n 'last_modifie'=>1234567890\n ),\n\n ),\n );\n// $subsdf = array(\n// 'product'=>array(\n// '*',\n// ),\n// );\n// print_r( $this->model->dump(20,'*',$subsdf) );\n $this->model->save($goodsData);\n// $row = $this->model->db->selectrow('select * from sdb_members');\n// $this->assertEquals($row['member_lv_id'],$memberArr['member_group_id']);\n// $this->assertEquals($row['lang'],$memberArr['lang']);\n// $this->assertEquals($row['cur'],$memberArr['currency']);\n }",
"public function test_Category_Tree(){\n\n\t\t$exp_total\t= Good::all()->count();\n\n\t\t$get\t= [\n\t\t\t'draw'\t=> '12'\n\t\t];\n\t\t$res\t= Good::getTableData( $get );\n\n\t\t$this->assertEquals( 12, $res['draw'], \"\\n*** Assert 1 ***\\nWrong 'draw' value\\n\" );\n\t\t$this->assertEquals( $exp_total, $res['recordsTotal'], \"\\n*** Assert 2 ***\\nWrong 'recordsTotal' value\\n\" );\n\n\t\t$new_item\t= [\n\t\t\t'name'\t=> ''\n\t\t\t,'article'=> ''\n\t\t\t,'rprice'\t=> 5.567\n\t\t\t,'wprice'\t=> 4.444\n\t\t\t,'inpack'\t=> 24\n\t\t\t,'packs'\t=> 13\n\t\t\t,'assort'\t=> 17\n\t\t];\n\n\n\n\t\t$this->db['Good']\t= [];\n\t\t$items\t= &$this->db['Good'];\n\n\t for( $i=0; $i<3; $i++ ){\n\t \t$item\t= $new_item;\n\t \t$item['name']\t= self::_ut_name.'_'.$i;\n\t \t$item['article']\t= self::_ut_name.'_'.$i;\n\t\t\t$item_obj\t= new Good();\n\t \t$item_obj\t= $item_obj->fill( $item );\n\t\t $res \t= $item_obj->save();\n\n\t\t $ids[]\t=\n\t\t $item['id']\t= $item_obj->id;;\n\n\t\t\t$items[]\t= $item;\n\n\t\t $item_obj\t= NULL;\n\t }\n\n\n// print_r( $ids);\n\n// \t $ut_item_id\t= $item_obj->id;\n\n\n\t $exp_total\t= Good::all()->count();\n\t $res\t= Good::getTableData( $get );\n// \t $item_obj->delete();\n\n// \t\tGood::whereIn('id');\n\n\n\t $this->assertEquals( $exp_total, $res['recordsTotal'], \"\\n*** Assert 3 ***\\nWrong 'recordsTotal' value\\n\" );\n\n\t}",
"public function testPostMany()\n {\n $data = $this->createMany(10);\n $this->postManyTest($data);\n }",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function test_3_3()\n {\n $out = SetupTestData::hasmany_save_3();\n\n // get all items to avoid losing them when the clean() is executed over the collection\n $addresses = $out['person']->get_addresses()->all();\n\n $out['person']->clean_addresses();\n\n $out['person']->save();\n\n\n // tests\n $this->assert($out['person']->size_addresses() === 0, 'Has many has 0 objects');\n\n foreach ($addresses as $i => $address)\n {\n $this->assert($address->person_addresses_back === NULL, \"Backlink of item $i object is NULL\");\n }\n }",
"public function test_2_1()\n {\n global $Address;\n\n // setup\n $out = SetupTestData::hasmany_save_2();\n\n $address = $Address->create([\n 'line1' => 'line1_4',\n 'zipcode' => '44444',\n 'state' => 'MN'\n ]);\n\n $out['person']->add_to_addresses($address);\n\n $out['person']->save();\n\n\n // tests\n $this->assert($address->id !== NULL, 'New object id is set');\n\n $this->assert($out['person']->size_addresses() === 4, 'Has many has 4 objects');\n\n foreach ($out['person']->get_addresses() as $i => $address)\n {\n $this->assert($address->zipcode === str_repeat(($i+1).'', 5), 'Address zipcode correct');\n }\n }",
"public function testMultiRelationColumn()\n {\n $this->specify(\n 'The Model::hasMany by using multi relation column does not work as expected',\n function () {\n $list = Packages::find();\n foreach ($list as $item) {\n expect($item)->isInstanceOf(Packages::class);\n expect($item->details)->isInstanceOf(Simple::class);\n expect($item->details->valid())->true();\n expect($item->details->count())->greaterOrEquals(2);\n expect($item->details->getFirst())->isInstanceOf(PackageDetails::class);\n }\n }\n );\n }",
"public function testHABTMKeepExisting() {\n\t\t$this->loadFixtures('Site', 'Domain', 'DomainsSite');\n\n\t\t$Site = new Site();\n\t\t$results = $Site->find('count');\n\t\t$expected = 3;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t$data = $Site->findById(1);\n\n\t\t// include api.cakephp.org\n\t\t$data['Domain'] = array('Domain' => array(1, 2, 3));\n\t\t$Site->save($data);\n\n\t\t$Site->id = 1;\n\t\t$results = $Site->read();\n\t\t$expected = 3; // 3 domains belonging to cakephp\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->id = 2;\n\t\t$results = $Site->read();\n\t\t$expected = 2; // 2 domains belonging to markstory\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->id = 3;\n\t\t$results = $Site->read();\n\t\t$expected = 2;\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\t\t$results['Domain'] = array('Domain' => array(7));\n\t\t$Site->save($results); // remove association from domain 6\n\t\t$results = $Site->read();\n\t\t$expected = 1; // only 1 domain left belonging to rchavik\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t// add deleted domain back\n\t\t$results['Domain'] = array('Domain' => array(6, 7));\n\t\t$Site->save($results);\n\t\t$results = $Site->read();\n\t\t$expected = 2; // 2 domains belonging to rchavik\n\t\t$this->assertEquals($expected, count($results['Domain']));\n\n\t\t$Site->DomainsSite->id = $results['Domain'][0]['DomainsSite']['id'];\n\t\t$Site->DomainsSite->saveField('active', true);\n\n\t\t$results = $Site->Domain->DomainsSite->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'DomainsSite.active' => true,\n\t\t\t),\n\t\t));\n\t\t$expected = 5;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t// activate api.cakephp.org\n\t\t$activated = $Site->DomainsSite->findByDomainId(3);\n\t\t$activated['DomainsSite']['active'] = true;\n\t\t$Site->DomainsSite->save($activated);\n\n\t\t$results = $Site->DomainsSite->find('count', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'DomainsSite.active' => true,\n\t\t\t),\n\t\t));\n\t\t$expected = 6;\n\t\t$this->assertEquals($expected, $results);\n\n\t\t// remove 2 previously active domains, and leave $activated alone\n\t\t$data = array(\n\t\t\t'Site' => array('id' => 1, 'name' => 'cakephp (modified)'),\n\t\t\t'Domain' => array(\n\t\t\t\t'Domain' => array(3),\n\t\t\t)\n\t\t);\n\t\t$Site->create($data);\n\t\t$Site->save($data);\n\n\t\t// tests that record is still identical prior to removal\n\t\t$Site->id = 1;\n\t\t$results = $Site->read();\n\t\tunset($results['Domain'][0]['DomainsSite']['updated']);\n\t\tunset($activated['DomainsSite']['updated']);\n\t\t$this->assertEquals($activated['DomainsSite'], $results['Domain'][0]['DomainsSite']);\n\t}",
"function get_fancy_data($data)\n {\n /*\n * Initialize value\n */\n $collection = array();\n $basemodel = NULL;\n $i = 0;\n\n /*\n * Outer loop to run untill the data array end\n */\n foreach ($data as $k => $v) {\n /* Ndoe generator */\n $node = array();\n\n /*\n * Preserver first instance of the row in to a dummy variable\n */\n foreach ($v as $key => $val) {\n if (!is_numeric($key)) {\n $keys = explode(\".\", $key);\n $basemodel = isset($basemodel) ? $basemodel : $keys[0];\n $node[$keys[0]][$keys[1]] = $val;\n }\n }\n\n /*\n * Collect the first node baded model id\n */\n $key_cur = isset($key_cur) ? $key_cur : $v[\"$basemodel.id\"];\n\n /*\n * Set the values in correct place of the the node array\n */\n foreach ($node as $y => $z) {\n if ($y == $basemodel) {\n /* For princilple model it save in to a single array */\n $collection[$v[\"$basemodel.id\"]][$y] = $z;\n }\n else {\n if (implode(\"\", $z) != \"\") {\n /* For relational model it save in to a nulti dymantional array array */\n $collection[$v[\"$basemodel.id\"]][$y][] = $z;\n }\n else if (!isset($collection[$v[\"$basemodel.id\"]][$y])) {\n /* Create an empty array of no data found in a relational model */\n $collection[$v[\"$basemodel.id\"]][$y] = array();\n }\n }\n }\n\n /*\n * Reset the array index in a normal sequence\n */\n if ($key_cur != $v[\"$basemodel.id\"]) {\n $collection[$i++] = $collection[$key_cur];\n unset($collection[$key_cur]);\n $key_cur = $v[\"$basemodel.id\"];\n }\n }\n\n /* Reset the last node of the array */\n $collection[$i] = $collection[$key_cur];\n unset($collection[$key_cur]);\n\n return $collection;\n }",
"public function testEntityToArray() {\n\t\t// 1. simple data\n\t\t$data = [\n\t\t\t'Author' => [\n\t\t\t\t'name' => 'Basuke',\n\t\t\t\t'programmer' => 'Programmer',\n\t\t\t],\n\t\t];\n\n\t\t$author = $this->Author->newEntity($data);\n\t\t$reversed = $author->toArray();\n\t\t$this->assertEqual($reversed, $data);\n\n\t\t// 2. has many\n\t\t$data = [\n\t\t\t'Author' => [\n\t\t\t\t'id' => '123',\n\t\t\t\t'name' => 'Basuke',\n\t\t\t\t'programmer' => 'Programmer',\n\t\t\t],\n\t\t\t'Comment' => [\n\t\t\t\t[\n\t\t\t\t\t'id' => '1',\n\t\t\t\t\t'author_id' => '123',\n\t\t\t\t\t'comment' => 'Hello',\n\t\t\t\t],\n\t\t\t\t[\n\t\t\t\t\t'id' => '2',\n\t\t\t\t\t'author_id' => '123',\n\t\t\t\t\t'comment' => 'World',\n\t\t\t\t],\n\t\t\t],\n\t\t];\n\n\t\t$author = $this->Author->newEntity($data);\n\t\t$reversed = $author->toArray();\n\t\t$this->assertEqual($reversed, $data);\n\n\t\t// 3. has one\n\t\t$data = [\n\t\t\t'Author' => [\n\t\t\t\t'id' => '123',\n\t\t\t\t'name' => 'Basuke',\n\t\t\t\t'programmer' => 'Programmer',\n\t\t\t],\n\t\t\t'Image' => [\n\t\t\t\t'id' => '1',\n\t\t\t\t'author_id' => '123',\n\t\t\t\t'url' => 'Hello',\n\t\t\t],\n\t\t];\n\n\t\t$author = $this->Author->newEntity($data);\n\t\t$reversed = $author->toArray();\n\t\t$this->assertEqual($reversed, $data);\n\t}",
"function populate()\n\t{\n \t$this->create(array('title' => 'Harry Potter'));\n \t$this->save();\n \n $parent_id = $this->id;\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Ron Weasley'));\n $this->save();\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Hermione Granger'));\n $this->save();\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Adam Royle'));\n $this->save();\n \n $this->create(array('parent_id' => $this->id, 'title' => 'Lord Voldemort'));\n $this->save();\n \n \t$this->create(array('title' => 'Albus Dumbledore'));\n \t$this->save();\n \n $parent_id = $this->id;\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Professor McGonagall'));\n $this->save();\n \n $this->create(array('parent_id' => $this->id, 'title' => 'Professor Flitwick'));\n $this->save();\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Severus Snape'));\n $this->save();\n \n $this->create(array('parent_id' => $parent_id, 'title' => 'Hagrid'));\n $this->save();\t\n\t}",
"function testSaveAllHabtm() {\n\t\t$this->loadFixtures('Article', 'Tag', 'Comment', 'User');\n\t\t$data = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => 1, 'title' => 'RRticle Has and belongs to Many Tags'\n\t\t\t),\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t1, 2\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\tarray('comment' => 'Article comment', 'user_id' => 1),\n\t\t\t),\n\t\t);\n\t\t$Article =& new Article();\n\t\t$result = $Article->saveAll($data);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $Article->read();\n\t\t$this->assertEqual(count($result['Tag']), 2);\n\t\t$this->assertEqual($result['Tag'][0]['tag'], 'tag1');\n\t\t$this->assertEqual(count($result['Comment']), 1);\n\t\t$this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1);\n\t}",
"public function testBasicPopulate() {\n\t\t$class = get_class($this->entity);\n\t\t$array = $this->entity->toArray(true);\n\t\t$filled = $this->fillArray($array);\n\n\t\t$entity = new $class($filled);\n\t\t$result = $entity->toArray();\n\t\t\n\t\t$this->assertEquals($filled, $result);\n\t}",
"function test_more_HasJoined()\n {\n $idFriend = $this->friend->insert( Dao_SetUp::makeFriend() );\n $friend = $this->friend->find( $idFriend );\n $idGroup1 = $this->group->insert( Dao_SetUp::makeGroup() );\n $idGroup2 = $this->group->insert( Dao_SetUp::makeGroup(1) );\n $group1 = $this->group->find( $idGroup1 );\n $group2 = $this->group->find( $idGroup2 );\n $relation = $this->friend->relation( $friend, 'group' );\n $relation->setValues( array( 'created_date' => '1999-12-31' ) )->set( $group1 );\n $relation->set( $group2 );\n \n // get groups using relations. \n $groups = $relation->setOrder( 'myGroup.group_code DESC' )->get();\n $group = $groups[1];\n $dataGroup = Dao_SetUp::makeGroup(0);\n $this->assertEquals( $dataGroup[ 'group_code' ], $group->group_code );\n $this->assertEquals( '1999-12-31', $group->created_date );\n $this->assertEquals( $idFriend, $group->friend_id );\n $group = $groups[0];\n $dataGroup = Dao_SetUp::makeGroup(1);\n $this->assertEquals( $dataGroup[ 'group_code' ], $group->group_code );\n $this->assertEquals( '1999-12-31', $group->created_date );\n $this->assertEquals( $idFriend, $group->friend_id );\n }"
]
| [
"0.6251297",
"0.61086845",
"0.59922063",
"0.5980773",
"0.58597803",
"0.5848941",
"0.5765167",
"0.56689125",
"0.56478775",
"0.56361735",
"0.56290036",
"0.5595592",
"0.55498916",
"0.55498916",
"0.55498916",
"0.55498916",
"0.55498916",
"0.55498916",
"0.55498916",
"0.55498916",
"0.5546369",
"0.55447733",
"0.5521954",
"0.5494249",
"0.5457256",
"0.54436857",
"0.54402834",
"0.5435539",
"0.54305136",
"0.5422383"
]
| 0.68189484 | 0 |
test copy save all does save all, but no convert/prepare of data does _updateMasterKey | public function testCopySaveAll() {
$initialCounts = array(
'Article' => $this->Article->find('count'),
'User' => $this->Article->User->find('count'),
'Featured' => $this->Article->Featured->find('count'),
'Comment' => $this->Article->Comment->find('count'),
'Tag' => $this->Article->Tag->find('count'),
);
$before = $this->Article->copyFindData(1);
$save = $before;
unset($save['Tag']);
$saved = $this->Article->copySaveAll($save);
$this->assertTrue($saved);
$id = $this->Article->id;
$this->assertEquals($id, 1);
$after = $this->Article->copyFindData(1);
$this->assertEquals($before, $after);
$this->assertEquals(
array(
'Article' => $this->Article->find('count'),
'User' => $this->Article->User->find('count'),
'Featured' => $this->Article->Featured->find('count'),
'Comment' => $this->Article->Comment->find('count'),
'Tag' => $this->Article->Tag->find('count'),
),
$initialCounts
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCompanyManagementBackupsIdPut()\n {\n\n }",
"public function testPutForAllData()\n {\n $dataLoader = $this->getDataLoader();\n $all = $dataLoader->getAll();\n $faker = $this->getFaker();\n foreach ($all as $data) {\n $data['username'] = $faker->text(50);\n unset($data['passwordHash']);\n\n $this->putTest($data, $data, $data['user']);\n }\n }",
"public function testIsModelSavingDataToDatabase()\n {\n $modelId = $this->saveTestData();\n $newModel = $this->model->load($modelId);\n $testData = $this->getTestData();\n $newModelData = [];\n foreach (array_keys($testData) as $key) {\n $newModelData[$key] = $newModel->getData($key);\n }\n $this->assertEquals($testData, $newModelData);\n }",
"private function copyData()\n {\n $connection = Yii::app()->db;\n $transaction = $connection->beginTransaction();\n try {\n $connection->createCommand('INSERT INTO ' . $connection->quoteTableName($this->tableMemory) . ' SELECT * FROM ' . $connection->quoteTableName($this->table))->execute();\n $transaction->commit();\n return true;\n } catch (Exception $e) {\n Yii::log('Transaction error: ' . print_r($e->getMessage(), true), 'error', 'extensions.CodMtfs.Mtfs');\n $transaction->rollback();\n }\n }",
"public function save_all() {\n\t\t$this->save_api();\n\t\t$this->save_field_map();\n\t\t$this->save_import();\n\t\t$this->save_requirement_set();\n\t}",
"public function testCustomSave() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$dbh->Query(\"insert into customer_labels(name) values('Test r1');\");\r\n\t\t$dbh->Query(\"insert into customer_labels(name) values('Test r2');\");\r\n\r\n\t\t$result = $dbh->Query(\"select id from customer_labels limit 2\");\r\n\t\t$g1 = $dbh->GetValue($result, 0, \"id\");\r\n\t\t$g2 = $dbh->GetValue($result, 1, \"id\");\r\n\r\n\t\t// Test mValue\r\n\t\t$obj = new CAntObject($dbh, \"customer\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"my test\");\r\n\t\t$obj->setMValue(\"groups\", $g1);\r\n\t\t$obj->setMValue(\"groups\", $g2);\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->removeMValue(\"groups\", $g2);\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t// Make sure mvalues reload and that we are not using too many queries to load the object\r\n\t\t// TODO: work on the dacl to only allow one query when loading an object\r\n\t\t$statBefore = $dbh->statNumQueries;\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->setValue(\"name\", \"Test Assoc\");\r\n\t\t$this->assertFalse($obj->getMValueExists(\"groups\", $g2));\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$this->assertTrue(($dbh->statNumQueries-$statBefore)<=2); // Loading an object should never take more than 2 queries\r\n\t\t//echo \"<pre>Num Queries: \".($dbh->statNumQueries-$statBefore).\"</pre>\";\r\n\r\n\t\t// Test object_multi\r\n\t\t$cont = new CAntObject($dbh, \"contact_personal\", null, $this->user);\r\n\t\t$cont->setValue(\"first_name\", \"Test Personal Contact\");\r\n\t\t$contactId = $cont->save();\r\n\t\t$this->assertTrue($contactId > 0);\r\n\t\t$obj->debug = true;\r\n\t\t$obj->setMValue(\"associations\", \"contact_personal:$contactId\");\r\n\t\t$cid = $obj->save(false);\r\n\t\tunset($obj);\r\n\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")!=false);\r\n \r\n // Test remove the mvalue\r\n $obj->removeMValue(\"associations\", \"contact_personal:$contactId\");\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertFalse($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")==false);\r\n unset($obj);\r\n \r\n // Test remove all mvalues\r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $obj->setMValue(\"associations\", \"contact_personal:$contactId\");\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertTrue($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")!=false); // Make sure the mvalue was set\r\n $obj->removeMValues(\"associations\"); // now remove the mvalues\r\n $obj->save(false);\r\n unset($obj);\r\n \r\n $obj = new CAntObject($dbh, \"customer\", $cid);\r\n $this->assertFalse($obj->getMValueExists(\"associations\", \"contact_personal:$contactId\")==false);\r\n\r\n\t\t// Test object (with no type)\r\n\t\t$com = new CAntObject($dbh, \"comment\", null);\r\n\t\t$com->setValue(\"obj_reference\", \"contact_personal:$cid\");\r\n\t\t$comid = $com->save(false);\r\n\t\tunset($com);\r\n\t\t$com = new CAntObject($dbh, \"comment\", $comid);\r\n\t\t$this->assertEquals($com->getValue(\"obj_reference\"), \"contact_personal:$cid\");\r\n\t\t$com->removeHard();\r\n\t\t\r\n\t\t// Cleanup\r\n\t\t$cont->removeHard();\r\n\t\t$obj->removeHard();\r\n\r\n\t\t$dbh->Query(\"delete from customer_labels where name='Test r1';\");\r\n\t\t$dbh->Query(\"delete from customer_labels where name='Test r2';\");\r\n\t}",
"public function testQuarantineUpsert()\n {\n\n }",
"function testSave() {\n\t\t$this->conn->exec(\"DELETE FROM useraccount WHERE email = '[email protected]'\");\n\t\t$useraccount = new UserAccount();\n\t\t\n\t\t$data = array(\n\t\t\t\"firstname\" => \"John\",\n\t\t\t\"lastname\" => \"Doe\",\n\t\t\t\"othername\" => \"\",\n\t\t\t\"email\" => \"[email protected]\",\n\t\t\t\"phonenumber\" => \"0782698451\",\n\t\t\t\"phonenumber2\" => \"\",\n\t\t\t\"password\" => \"5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8\",\n\t\t\t\"notes\" => \"xxx\",\n\t\t\t\"securityquestion\" => \"\",\n\t\t\t\"securityanswer\" => \"\",\n\t\t\t\"changepassword\" => \"Y\",\n\t\t\t\"activationkey\" => \"\",\n\t\t\t\"isactive\" => \"Y\",\n\t\t\t\"nextpasswordchangedate\" => date('Y-m-d', strtotime(\" + \".$this->config->password->daystoexpire.\" days\")),\n\t\t\t\"lastlogindate\" => \"\",\n\t\t\t\"loginretries\" => \"\",\n\t\t\t\"createdby\" => \"1\",\n\t\t\t\"usergroups_groupid\" => array(\"2\")\n\t\t\n\t\t);\n\t\t\n\t\t$useraccount->processPost($data);\t\t\n\t\t# check that there are no errors in the object. Fail if error in process post\n\t\t$this->assertEquals(\"\", $useraccount->getErrorStackAsString());\n\t\t\n\t\t$useraccount->save();\n\t\t\n\t\t# check that there are no errors and that the ID is a number\n\t\t$this->assertEquals(\"\", $useraccount->getErrorStackAsString());\n\t\t\n\t\t# load the saved user account data\n\t\t$query = \"SELECT u.*, GROUP_CONCAT(g.id) as usergroups FROM useraccount u, aclusergroup acg, aclgroup g WHERE u.id = '\".$useraccount->getID().\"' AND acg.userid = u.id AND acg.groupid = g.id GROUP BY u.id\";\n\t\t$saved_useraccount = $this->conn->fetchRow($query);\n\t\t\n\t\t$saved_useraccount['usergroups_groupid'] = explode(\",\" ,$saved_useraccount['usergroups']);\n\t\t# set the password to the hashed value\n\t\t$data['password'] = sha1($data['password']);\n\t\t$this->compareAcutalandExpectedDataArrays($data, $saved_useraccount);\n\t\t\t\t\n\t\t# cleanup\n\t\t$this->conn->exec(\"DELETE FROM useraccount WHERE id = '\".$useraccount->getID().\"' OR email = '[email protected]'\");\t\t\n\t}",
"function Copy(&$data){\n // -- get storage\n $storageName = $this->listSettings->GetItem(\"MAIN\", \"TABLE\");\n $this->Kernel->ImportClass(\"data.\" . $storageName, $storageName);\n $Storage = new $storageName($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $storageName));\n\n //return;\n //-- get copy field name\n if ($this->listSettings->HasItem(\"MAIN\", \"COPY_NAME_FIELD\")) {\n $_name_field = $this->listSettings->GetItem(\"MAIN\", \"COPY_NAME_FIELD\");\n }\n else {\n $_name_field = TableHelper::GetFirstNotKeyColumn($Storage);\n }\n\n $this->copy_Storage = $Storage;\n // insert loop\n foreach ($data as $i => $item_id) {\n //get record\n $record = $Storage->Get(array(\n $this->key_field => $item_id));\n //get copy records count\n $_count = $Storage->GetCount(array(\n $_name_field => $record[$_name_field] . \" (%)\"));\n\n $_count ++;\n $record[$_name_field] = $record[$_name_field] . \" ($_count)\";\n //insert record\n\n\n $Storage->Insert($record);\n\n // get ID of inserted record\n $insert_id = $Storage->getInsertId();\n // get priority column\n if ($this->listSettings->HasItem(\"Main\", \"COPY_NAME_FIELD\")) {\n $priority_column = $this->listSettings->GetItem(\"Main\", \"COPY_NAME_FIELD\");\n }\n elseif ($Storage->HasColumn(\"_priority\")) {\n $priority_column = \"_priority\";\n }\n\n if (strlen($priority_column)) { // if priority column exists\n $priority_data = array(\n $this->key_field => $insert_id ,\n $priority_column => $insert_id);\n if (count($unique_fields)) { // if unique fields is found\n foreach ($unique_fields as $i => $ufield) {\n if ($ufield != $_name_field)\n $priority_data[$ufield] = $record[$ufield] . \" (\" . $insert_id . \")\";\n }\n }\n // update priority and unique field\n $Storage->Update($priority_data);\n }\n\n if ($this->listSettings->HasItem(\"MAIN\", \"USE_SUB_CATEGORIES\")) {\n $use_sub_categories = $this->listSettings->GetItem(\"MAIN\", \"USE_SUB_CATEGORIES\");\n }\n else {\n $use_sub_categories = false;\n }\n\n //--if library use subcategories\n if ($use_sub_categories) {\n $message = \"\";\n $sub_categories_count = $this->listSettings->GetItem(\"MAIN\", \"SUB_CATEGORIES_COUNT\");\n // subcategories loop\n for ($i = 0; $i < sizeof($sub_categories_count); $i ++) {\n // get library settings\n $library = $this->listSettings->GetItem(\"sub_category_\" . $i, \"APPLY_LIBRARY\");\n $link_field = $this->listSettings->GetItem(\"sub_category_\" . $i, \"LINK_FIELD\");\n // get subcategory library config\n $sub_listSettings = Engine::getLibrary($this->Kernel, $library, \"sub_ListSettings_\" . $library);\n\n //-- get subcategory storage\n $sub_table = $sub_listSettings->GetItem(\"MAIN\", \"TABLE\");\n $this->Kernel->ImportClass(\"data.\" . strtolower($sub_table), $sub_table);\n $sub_Storage = new $sub_table($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"database\", $sub_table));\n\n //--get subcategory items\n $list = $sub_Storage->GetList(array(\n $link_field => $item_id));\n\n //-- get priority column\n $priority_column = \"\";\n if ($sub_listSettings->HasItem(\"Main\", \"COPY_NAME_FIELD\")) {\n $priority_column = $sub_listSettings->GetItem(\"Main\", \"COPY_NAME_FIELD\");\n }\n elseif ($sub_Storage->HasColumn(\"_priority\")) {\n $priority_column = \"_priority\";\n }\n //--get unique columns\n $unique_fields = array();\n if ($sub_listSettings->HasItem(\"MAIN\", \"UNIQUE_FIELDS\")) {\n $unique_fields = explode(\",\", $sub_listSettings->GetItem(\"MAIN\", \"UNIQUE_FIELDS\"));\n }\n // get subcategory key field\n $sub_keyfields = $sub_Storage->getKeyColumns();\n $sub_keyfield = $sub_keyfields[0][\"name\"];\n\n if ($list->RecordCount != 0) {\n while ($sub_item = $list->Read()) {\n $sub_item[$link_field] = $insert_id;\n\n // insert subcategory\n $sub_Storage->Insert($sub_item);\n\n //get inserted subcategory ID\n $sub_list = $sub_Storage->GetList(array(), array(\n $sub_keyfield => 0), 1, 0);\n $sub_item = $sub_list->Read();\n $sub_insert_id = $sub_item[$sub_keyfield];\n if (strlen($priority_column)) { // if priority column exists\n $priority_data = array(\n $sub_keyfield => $sub_insert_id ,\n $priority_column => $sub_insert_id);\n if (count($unique_fields)) { // if unique fields is found\n foreach ($unique_fields as $i => $ufield) {\n if ($ufield != $_name_field)\n $priority_data[$ufield] = $sub_item[$ufield] . \" (\" . $sub_insert_id . \")\";\n }\n }\n // update priority and unique fields\n $sub_Storage->Update($priority_data);\n }\n }\n }\n } // for\n }\n $this->OnAfterCopy($item_id, $insert_id);\n }\n }",
"public function testSaveQuoteData()\n {\n $session = $this->currentSession->getCurrentSessionId();\n $saveCart = $this->callAPISaveCart();\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => self::RESOURCE_PATH . 'saveQuoteData?session='.$session.'',\n 'httpMethod' => RestRequest::HTTP_METHOD_POST,\n ]\n ];\n\n $requestData = [\n 'customer_id' => '',\n 'quote_id' => $saveCart['quote_init']['quote_id'],\n 'quote_data' => [\n 'webpos_cart_discount_value' => '10.00',\n 'webpos_cart_discount_type' => '$',\n 'webpos_cart_discount_name' => ''\n ],\n 'currency_id' => 'USD',\n 'till_id' => 'null',\n 'store_id' => '1',\n ];\n\n $results = $this->_webApiCall($serviceInfo, $requestData);\n\n // Dump the result to check \"How does it look like?\"\n // \\Zend_Debug::dump($results);\n\n $this->assertNotNull($results);$this->assertNotNull($results);\n // Get the key constraint for API testSaveQuoteData. Call From Folder Constraint\n $keys = $this->checkout->SaveQuoteData();\n\n foreach ($keys['items'][0] as $key) {\n self::assertContains(\n $key,\n array_keys($results['items'][0]),\n $key . \" key is not in found in result['items'][0]'s keys\"\n );\n }\n foreach ($keys['shipping'][0] as $key) {\n self::assertContains(\n $key,\n array_keys($results['shipping'][0]),\n $key . \" key is not in found in result['shipping'][0]'s keys\"\n );\n }\n foreach ($keys['payment'][0] as $key) {\n self::assertContains(\n $key,\n array_keys($results['payment'][0]),\n $key . \" key is not in found in result['payment'][0]'s keys\"\n );\n }\n foreach ($keys['quote_init'] as $key) {\n self::assertContains(\n $key,\n array_keys($results['quote_init']),\n $key . \" key is not in found in result['quote_init']'s keys\"\n );\n }\n foreach ($keys['totals'][0] as $key) {\n self::assertContains(\n $key,\n array_keys($results['totals'][0]),\n $key . \" key is not in found in result['totals'][0]'s keys\"\n );\n }\n }",
"public function test_save_1() {\n $course = $this->getDataGenerator()->create_course();\n $module = $this->getDataGenerator()->create_module('talkpoint', array(\n 'course' => $course->id,\n ));\n $data = array(\n 'instanceid' => $module->id,\n 'userid' => 2,\n 'title' => 'Talkpoint 001',\n 'uploadedfile' => 'foo.mp4',\n 'mediatype' => 'file',\n 'closed' => 0,\n );\n $data = $this->_cut->save($data, time());\n $this->assertArrayHasKey('id', $data);\n }",
"public function testProfileUpsert()\n {\n\n }",
"abstract public function prepareToStore();",
"function persistAll() ;",
"public function test_save_2() {\n global $DB;\n $times = array(\n mktime(9, 0, 0, 11, 5, 2013),\n );\n $course = $this->getDataGenerator()->create_course();\n $module = $this->getDataGenerator()->create_module('talkpoint', array(\n 'course' => $course->id,\n ));\n $this->loadDataSet($this->createArrayDataSet(array(\n 'talkpoint_talkpoint' => array(\n array('id', 'instanceid', 'userid', 'title', 'uploadedfile', 'nimbbguid', 'mediatype', 'closed', 'timecreated', 'timemodified'),\n array(1, $module->id, 2, 'Talkpoint 004', 'foo.mp4', null, 'file', 0, $times[0], $times[0]),\n ),\n )));\n $data = array(\n 'instanceid' => $module->id,\n 'id' => 1,\n 'userid' => 2,\n 'title' => 'Talkpoint 004a',\n 'uploadedfile' => 'bar.mp4',\n 'nimbbguid' => '',\n 'mediatype' => 'file',\n 'closed' => 0,\n );\n $data = $this->_cut->save($data, time());\n $this->assertGreaterThan($times[0], (integer)$DB->get_field('talkpoint_talkpoint', 'timemodified', array('id' => $data['id'])));\n $this->assertEquals('bar.mp4', $DB->get_field('talkpoint_talkpoint', 'uploadedfile', array('id' => 1)));\n }",
"public function testQuarantineUpdateAll()\n {\n\n }",
"public function testSavedExisting() \r\n\t{\r\n\t\t$dbh = $this->dbh;\r\n\r\n\t\t$cust = CAntObject::factory($dbh, \"customer\", null, $this->user);\r\n\t\t$grpd = $cust->addGroupingEntry(\"groups\", \"Unit Test Group\", \"e3e3e3\");\r\n\t\t$statd = $cust->addGroupingEntry(\"status_id\", \"Unit Test Status\", \"e3e3e3\");\r\n\t\t\r\n\t\t$g1 = $grpd['id'];\r\n\t\t$s1 = $statd['id'];\r\n\r\n\t\t// Manually insert a customer\r\n\t\t$result = $dbh->Query(\"insert into customers(name, status_id) values('big unit test', '$s1');select currval('customers_id_seq') as id;\");\r\n\t\t$cid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t\r\n\t\tif ($dbh->GetNumberRows($result))\r\n\t\t{\r\n\t\t\t$cid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t\t$dbh->Query(\"insert into customer_label_mem(customer_id, label_id) VALUES('$cid', '$g1');\");\r\n\t\t}\r\n\t\t\r\n\t\t// Save customer groups using CAntObject\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$obj->setValue(\"name\", \"testSavedExisting\");\r\n\t\t$savedId = $obj->save(); \r\n\t\t$this->assertEquals($savedId, $cid);\r\n\t\tunset($obj);\r\n\t\t\r\n\t\t// Open and make sure the object has a value, then save it\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$this->assertEquals($obj->getForeignValue(\"groups\"), \"Unit Test Group\");\r\n\t\t$this->assertEquals($obj->getValue(\"status_id\"), $s1);\r\n\t\t$this->assertEquals($obj->getForeignValue(\"status_id\"), \"Unit Test Status\");\r\n\t\t$obj->save();\r\n\t\tunset($obj);\r\n\r\n\t\t// Open again and make sure the object has a value for groups\r\n\t\t$obj = new CAntObject($dbh, \"customer\", $cid, $this->user);\r\n\t\t$this->assertTrue($obj->getMValueExists(\"groups\", $g1));\r\n\t\t$obj->save();\r\n\r\n\r\n\t\t// Now test with object references both with and with subtypes\r\n\t\t$act = CAntObject::factory($dbh, \"activity\", null, $this->user);\r\n\r\n\t\t// Manually insert an activity\r\n\t\t$result = $dbh->Query(\"insert into objects_activity_act(name, user_id) values('big unit test', '\".$this->user->id.\"');\r\n\t\t\t\t\t\t\t\tselect currval('objects_id_seq') as id;\");\r\n\t\t$aid = $dbh->GetValue($result, 0, \"id\");\r\n\t\t$field = $act->def->getField('obj_reference');\r\n\t\t$fieldUser = $act->def->getField('user_id');\r\n\t\t$dbh->Query(\"insert into object_associations(type_id, object_id, assoc_type_id, assoc_object_id, field_id) \r\n\t\t\t\t\t\tVALUES('\".$act->object_type_id.\"', '$aid', '\".$obj->object_type_id.\"', \r\n\t\t\t\t\t\t'$cid', '\".$field->id.\"');\");\r\n\t\t$dbh->Query(\"insert into object_associations(type_id, object_id, assoc_type_id, assoc_object_id, field_id) \r\n\t\t\t\t\t\tVALUES('\".$act->object_type_id.\"', '$aid', '\".$this->user->userObj->object_type_id.\"', \r\n\t\t\t\t\t\t'\".$this->user->id.\"', '\".$fieldUser->id.\"');\");\r\n\r\n\t\t$obj2 = new CAntObject($dbh, \"activity\", null, $this->user);\r\n $obj2->id = $aid;\r\n $obj2->load();\r\n\t\t$this->assertEquals($obj2->getValue(\"obj_reference\"), \"customer:$cid\");\r\n\t\t$this->assertEquals($obj2->getForeignValue(\"obj_reference\"), \"testSavedExisting\");\r\n\t\t$this->assertEquals($obj2->getValue(\"user_id\"), $this->user->id);\r\n\t\t$this->assertEquals($obj2->getForeignValue(\"user_id\"), $this->user->name);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->deleteGroupingEntry(\"groups\", $grpd['id']);\r\n\t\t$obj->deleteGroupingEntry(\"status_id\", $statd['id']);\r\n\t\t$obj->removeHard();\r\n\r\n\t\t$act->removeHard();\r\n\t}",
"function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}",
"function saveClientData($data) {\n if ($data['quota'] == -1)\n \t$data['quota'] = 100000;\n\n // check if user with this subid exists. if so, update.\n $currentDate = date('Y-m-d H:i:s');\n $subid = $data['subid'];\n $email = $data['email'];\n $quota = $data['quota'];\n $status = $data['status'];\n\n $sql = \"SELECT clientid,clientid_hash,tenant,quota,quota_reset_dayinmonth,status \n\t\t\tfrom client where subid = '$subid' limit 1\";\n $result = mysql_query($sql);\n if ($result) {\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $clientid = $row['clientid'];\n $clientid_hash = $row['clientid_hash'];\n $mytenant = $row['tenant'];\n $myquota = $row['quota'];\n $myquota_reset_dayinmonth = $row['quota_reset_dayinmonth'];\n $mystatus = $row['status'];\n }\n $ret = array();\n\n // dispatch\n if (empty($clientid)) {\n $action = 'insert';\n } elseif ($data['tenant'] != $mytenant) {\n $action = 'ignore';\n } else {\n $action = 'update';\n }\n\n $change = \"\"; // $change defines the transaction more business-wise. it is a comma-separated list of keywords\n // execute, save data\n if ($action == 'insert') {\n if ($status == 1) {\n $change .= \"create,test,\";\n } elseif ($status == 6) {\n $change .= \"create,subscribe,\";\n } else {\n $change .= \"create,\";\n }\n $data['createddate'] = $currentDate;\n $data['modifydate'] = $currentDate;\n $data['used_quota'] = 0;\n // always set reset_day_in_month on create - use contract_enddate if provided and create date if not\n if (isset($data['contract_enddate']) && ($data['contract_enddate'] != '')) {\n $contract_enddate = $data['contract_enddate'];\n $da = date_parse($data['contract_enddate']);\n $quota_reset_dayinmonth = $da['day']; //echo \"dayinmomtn: $quota_reset_dayinmonth\";\t\t\t\n } else {\n $da = date_parse($currentDate);\n $quota_reset_dayinmonth = $da['day'];\n }\n unset($data['contract_enddate']); // remove this value as it is not stored in table client\n $data['quota_reset_dayinmonth'] = $quota_reset_dayinmonth;\n $this->db->insert('client', $data);\n $id = $this->db->insert_id();\n // if clientid_hash is not provided, create and set it\n if ($data['clientid_hash'] == '') {\n $this->db->set('clientid_hash', md5($id));\n $this->db->where('clientid', $id);\n $this->db->update('client');\n $clientid_hash = md5($id);\n } else {\n $clientid_hash = $data['clientid_hash'];\n }\n $ret['statuscode'] = \"200\";\n $ret['clientid_hash'] = $clientid_hash;\n\n // After inserting the new client, the next method creates the corresponding entry into the api_client table\n require_once APPPATH . 'models/userapi.php';\n $userapi = new userapi();\n $userapi->saveApiClient($id);\n }\n if ($action == 'update') {\n // always set reset_day_in_month on create - use contract_enddate if provided and create date if not\n if (isset($data['contract_enddate']) && ($data['contract_enddate'] != '')) {\n $contract_enddate = $data['contract_enddate'];\n $da = date_parse($data['contract_enddate']);\n $quota_reset_dayinmonth = $da['day'];\n $data['quota_reset_dayinmonth'] = $quota_reset_dayinmonth;\n }\n unset($data['contract_enddate']); // remove this value as it is not stored in table client\n\n $data['modifydate'] = $currentDate;\n //echo \"quota: $quota myquota: $myquota status: $status mystatus: $mystatus day: $quota_reset_dayinmonth mysday: $myquota_reset_dayinmonth\";\n // check for modifications in the values compared to current values and derive a business-wise description \n // of this transaction for storage in the history-table (see below)\n if (($mystatus == 1) && ($status == 6)) {\n $data['used_quota'] = 0;\n $change .= \"subscribe,\";\n }\n if (($mystatus == 6) && ($status == 2)) {\n $change .= \"cancel,\";\n }\n if (($mystatus == 1) && ($status == 2)) {\n $change .= \"cancel,\";\n }\n if (($mystatus == 2) && ($status == 6)) {\n $change .= \"subscribe,\";\n }\n if (($mystatus == 2) && ($status == 1)) {\n $change .= \"test,\";\n }\n if ($mystatus == $status) {\n if ($quota > $myquota)\n $change .= \"upgrade,\";\n if ($quota < $myquota)\n $change .= \"downgrade,\";\n echo \"quota_reset_dayinmonth $quota_reset_dayinmonth\";\n if (isset($quota_reset_dayinmonth) && ($quota_reset_dayinmonth != '') && ($quota_reset_dayinmonth != $myquota_reset_dayinmonth))\n $change .= \"periodshift,\";\n }\n $this->db->where('clientid', $clientid);\n $this->db->update('client', $data);\n apch_delete(\"cs_\" . $clientid_hash); // cached in getclientstatus\n $ret['statuscode'] = \"200\";\n $ret['clientid_hash'] = $clientid_hash;\n\n // make a DB request to retrieve wether changes have been made with the update or not\n $sql = \"SELECT clientid,clientid_hash,tenant,quota,quota_reset_dayinmonth,status \n\t\t\t\tfrom client where subid = '$subid' limit 1\";\n $result = mysql_query($sql);\n if ($result) {\n $row = mysql_fetch_array($result, MYSQL_ASSOC);\n $newquota = $row['quota'];\n $newquota_reset_dayinmonth = $row['quota_reset_dayinmonth'];\n $newstatus = $row['status'];\n\n if (($newquota != $myquota) || ($newquota_reset_dayinmonth != $myquota_reset_dayinmonth) || ($newstatus != $mystatus)) {\n $updatechange = true;\n }\n }\n }\n if ($action == 'ignore') {\n $ret['statuscode'] = \"401\";\n }\n\n // save an entry in the history table if changes have been made\n if (($action == 'insert') ||\n (($action == 'update') && (isset($updatechange) && ($updatechange)))) {\n $history = array();\n $sql = \"SELECT clientid from client where subid = '$subid'\";\n $result = mysql_query($sql);\n $clientid = mysql_result($result, 0, 0);\n $history['modifydate'] = $data['modifydate'];\n $history['subid'] = $data['subid'];\n $history['quota'] = $data['quota'];\n $history['account_collectionid'] = $data['account_collectionid'];\n $history['status'] = $data['status'];\n $history['userplan'] = $data['userplan'];\n $history['clientid'] = $clientid;\n if ($contract_enddate != \"\")\n $history['contract_enddate'] = $contract_enddate;\n $history['change'] = $change;\n $this->db->insert('et_clientdata_history', $history);\n }\n //echo $change;\n return $ret;\n }",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }",
"private function saveClone()\n {\n // Save new clone data\n $this->log(\"Cloning: {$this->options->clone}'s clone job's data is not in database, generating data\");\n\n $this->options->existingClones[$this->options->clone] = [\n \"directoryName\" => $this->options->cloneDirectoryName,\n \"path\" => trailingslashit($this->options->destinationDir),\n \"url\" => $this->getDestinationUrl(),\n \"number\" => $this->options->cloneNumber,\n \"version\" => WPStaging::getVersion(),\n \"status\" => \"unfinished or broken (?)\",\n \"prefix\" => $this->options->prefix,\n \"datetime\" => time(),\n \"databaseUser\" => $this->options->databaseUser,\n \"databasePassword\" => $this->options->databasePassword,\n \"databaseDatabase\" => $this->options->databaseDatabase,\n \"databaseServer\" => $this->options->databaseServer,\n \"databasePrefix\" => $this->options->databasePrefix,\n \"emailsAllowed\" => (bool)$this->options->emailsAllowed,\n \"uploadsSymlinked\" => (bool)$this->options->uploadsSymlinked,\n \"ownerId\" => $this->options->ownerId,\n ];\n\n if (update_option(\"wpstg_existing_clones_beta\", $this->options->existingClones) === false) {\n $this->log(\"Cloning: Failed to save {$this->options->clone}'s clone job data to database'\");\n return false;\n }\n\n return true;\n }",
"function testSaveAllHabtm() {\n\t\t$this->loadFixtures('Article', 'Tag', 'Comment', 'User');\n\t\t$data = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => 1, 'title' => 'RRticle Has and belongs to Many Tags'\n\t\t\t),\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t1, 2\n\t\t\t\t)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\tarray('comment' => 'Article comment', 'user_id' => 1),\n\t\t\t),\n\t\t);\n\t\t$Article =& new Article();\n\t\t$result = $Article->saveAll($data);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $Article->read();\n\t\t$this->assertEqual(count($result['Tag']), 2);\n\t\t$this->assertEqual($result['Tag'][0]['tag'], 'tag1');\n\t\t$this->assertEqual(count($result['Comment']), 1);\n\t\t$this->assertEqual(count($result['Comment'][0]['comment']['Article comment']), 1);\n\t}",
"public function testCompanyManagementBackupsIdPatch()\n {\n\n }",
"public function testCopyPrepareDataEmpties() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(array()),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(null),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(false),\n\t\t\tarray()\n\t\t);\n\t}",
"private function saveData() {\n\n $dbConnection = dbconn::getConnectionBuild()->getConnection();\n date_default_timezone_set (\"America/Chicago\");\n\n if ($this->propertyId == 0) {\n // Insert a new row.\n $sqlStmt = \"INSERT INTO property (customer_id, tenant_first_name, tenant_last_name, address, city, \";\n $sqlStmt .= \"state, zip, phone, email, notes, created_by, last_modified_by, last_modified) \";\n $sqlStmt .= \"VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) \";\n\n $stmtObj = $dbConnection->prepare($sqlStmt);\n if ($dbConnection->error) {\n echo $dbConnection->error;\n exit();\n }\n\n $currentDate = date('Y-m-d H:i:s');\n $stmtObj->bind_param(\"isssssssssiis\", $this->customerId, $this->firstName, $this->lastName, $this->address, $this->city,\n $this->state, $this->zip, $this->phone, $this->email, $this->notes, $this->employeeId,\n $this->employeeId, $currentDate);\n $stmtObj->execute();\n if ($dbConnection->error) {\n echo $dbConnection->error;\n exit();\n }\n $this->propertyId = $dbConnection->insert_id;\n } else {\n // Update existing row.\n $sqlStmt = \"UPDATE property SET customer_id = ?, tenant_first_name = ?, tenant_last_name = ?, address = ?, city = ?, \";\n $sqlStmt .= \"state = ?, zip = ?, phone = ?, email = ?, notes = ?, last_modified_by = ?, last_modified = ? \";\n $sqlStmt .= \"WHERE id = ? \";\n\n $currentDate = date('Y-m-d H:i:s');\n\n $stmtObj = $dbConnection->prepare($sqlStmt);\n $stmtObj->bind_param(\"isssssssssisi\", $this->customerId, $this->firstName, $this->lastName, $this->address, $this->city,\n $this->state, $this->zip, $this->phone, $this->email, $this->notes, $this->employeeId,\n $currentDate, $this->propertyId);\n $stmtObj->execute();\n }\n\n $this->statusMessage = \"Save successful: \" . date(\"h:i:s a\");\n\n }",
"public function test_Incremental_Backup_Restore(){\n\t\tzbase_setup::reset_zbase_vbucketmigrator(TEST_HOST_1,TEST_HOST_2);\n\t\tflushctl_commands::set_flushctl_parameters(TEST_HOST_1, \"chk_max_items\", 100);\n\t\t$this->assertTrue(Data_generation::add_keys(2000, 100, 1, \"testvalue\"), \"adding keys failed\");\n\t\t// Ensure that keys are replicated to the slave\n\t\tsleep(30);\n\t\t$curr_items = stats_functions::get_all_stats(TEST_HOST_1, \"curr_items\");\n\t\t$this->assertEquals($curr_items ,2000 , \"All keys not replicated to slave\");\n\t\t// Take incremental backup using backup daemon\n\t\tbackup_tools_functions::clear_backup_data(TEST_HOST_2);\n\t\tbackup_tools_functions::clear_temp_backup_data(TEST_HOST_2);\n\t\tzbase_backup_setup::start_backup_daemon(TEST_HOST_2);\n\t\t$this->assertTrue(backup_tools_functions::verify_zbase_backup_upload(), \"Failed to upload the backup files to Storage Server\");\n\t\t// Kill vbucket migrator between master and slave\n\t\tvbucketmigrator_function::kill_vbucketmigrator(TEST_HOST_1);\n\t\tzbase_setup::memcached_service(TEST_HOST_2, \"stop\");\n\t\tremote_function::remote_execution(TEST_HOST_2,\"sudo rm -rf /data_*/zbase/*\");\n\t\tzbase_setup::memcached_service(TEST_HOST_2, \"start\");\n\t\t// Perform restore\n\t\tmb_restore_commands::restore_server(TEST_HOST_2);\n\t\t//Attempt get on all keys\n\t\t$this->assertTrue(Data_generation::verify_added_keys(TEST_HOST_2, 2000, \"testvalue\", 1), \"verifying keys failed\");\n\t\t// The below step causes SERVER ERROR\n\t\t//$this->assertTrue(Data_generation::verify_added_keys(TEST_HOST_2, 1, \"testvalue\", 2001), \"verifying keys failed\");\n\t}",
"public function testCopyWithInjectionData() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$customSettings = array(\n\t\t\t'merge' => array(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'title' => 'INJECT changed this',\n\t\t\t\t\t'published' => 'X',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'insert' => array(\n\t\t\t\t'Comment.{n}.user_id' => 0,\n\t\t\t\t'Comment.{n}.comment' => 'INJECT changed via Hash::insert()',\n\t\t\t),\n\t\t);\n\t\t$result = $this->Article->copy(1, $customSettings);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 1\n\t\t\t)\n\t\t));\n\n\t\t$expected = $this->expectedFromFixtures[0];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 4\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\n\t\t// Inject changed expectations via Hash::merge()\n\t\t$expected['Article']['title'] = $customSettings['merge']['Article']['title'];\n\t\t$expected['Article']['published'] = $customSettings['merge']['Article']['published'];\n\t\t// Inject changed expectations via Hash::insert()\n\t\tforeach ($expected['Comment'] as $i => $data) {\n\t\t\t$expected['Comment'][$i]['user_id'] = $customSettings['insert']['Comment.{n}.user_id'];\n\t\t\t$expected['Comment'][$i]['comment'] = $customSettings['insert']['Comment.{n}.comment'];\n\t\t}\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testSaveShouldWorkAndBumpTimestampAndTheDirtyFlagShouldWork()\n\t{\n\t\t$result = cms_orm('test_orm_table')->find();\n\t\t$old_timestamp = $result->modified_date->timestamp();\n\t\t$result->save();\n\t\t$result = cms_orm('test_orm_table')->find();\n\t\t$this->assertEqual($old_timestamp, $result->modified_date->timestamp());\n\t\t\n\t\t#Once with\n\t\t$old_timestamp = $result->modified_date->timestamp();\n\t\t$result->test_field = 'test10';\n\t\t$result->save();\n\t\t$result = cms_orm('test_orm_table')->find();\n\t\t$this->assertNotEqual($old_timestamp, $result->modified_date->timestamp());\n\t\t$this->assertEqual('test10', $result->test_field);\n\t}",
"public function testCompanyManagementBackupsPost()\n {\n\n }",
"public function testSave()\n {\n // save to cache\n $saveSearchCriteria = $this->searchCriteriaBuilder\n ->setContextName('cloud')\n ->setEntityName('customer')\n ->setFieldList(['id', 'name'])\n ->setIdName('id')\n ->build();\n\n $data = [['id' => 50, 'name' => 'Sergii']];\n\n $actualSave = $this->cacheManager->save($saveSearchCriteria, $data);\n $this->assertTrue($actualSave);\n }"
]
| [
"0.61600053",
"0.5877042",
"0.5843016",
"0.5842591",
"0.5706419",
"0.5634975",
"0.5545934",
"0.54903823",
"0.54721963",
"0.5439293",
"0.54146487",
"0.54098153",
"0.54088813",
"0.53955954",
"0.5390611",
"0.53743476",
"0.53576314",
"0.53431207",
"0.5329731",
"0.5325298",
"0.53235924",
"0.5319687",
"0.52825594",
"0.5280051",
"0.52779436",
"0.5261297",
"0.5244465",
"0.52311796",
"0.5229363",
"0.52198684"
]
| 0.6518445 | 0 |
test copy on fixture Article1 | public function testCopy1() {
$initialCounts = array(
'Article' => $this->Article->find('count'),
'User' => $this->Article->User->find('count'),
'Featured' => $this->Article->Featured->find('count'),
'Comment' => $this->Article->Comment->find('count'),
'Tag' => $this->Article->Tag->find('count'),
);
$result = $this->Article->copy(1);
$this->assertTrue($result);
$newId = $this->Article->id;
$this->assertTrue(is_numeric($newId));
// orig is unchanged
$result = $this->Article->find('first', array(
'contain' => $this->settings['containArticle'],
'conditions' => array(
'Article.id' => 1
)
));
$expected = $this->expectedFromFixtures[0];
$this->assertEquals($expected, $result);
// see how many records were created
$this->assertEquals(
$this->Article->find('count'),
$initialCounts['Article'] + 1
);
$this->assertEquals(
$this->Article->User->find('count'),
$initialCounts['User']
);
$this->assertEquals(
$this->Article->Featured->find('count'),
$initialCounts['Featured'] + 1
);
$this->assertEquals(
$this->Article->Comment->find('count'),
$initialCounts['Comment'] + 4
);
// should not have made any more HABTM targets
// should only have made more join records
$this->assertEquals(
$this->Article->Tag->find('count'),
$initialCounts['Tag']
);
// new record
$result = $this->Article->find('first', array(
'contain' => $this->settings['containArticle'],
'conditions' => array(
'Article.id' => $newId
)
));
$this->_assertArticleAfterCopy($result, $expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCopy2() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(2);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 2\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[1];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 2\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testCopy3() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(3);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 3\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[2];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopyWithInjectionData() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$customSettings = array(\n\t\t\t'merge' => array(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'title' => 'INJECT changed this',\n\t\t\t\t\t'published' => 'X',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'insert' => array(\n\t\t\t\t'Comment.{n}.user_id' => 0,\n\t\t\t\t'Comment.{n}.comment' => 'INJECT changed via Hash::insert()',\n\t\t\t),\n\t\t);\n\t\t$result = $this->Article->copy(1, $customSettings);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 1\n\t\t\t)\n\t\t));\n\n\t\t$expected = $this->expectedFromFixtures[0];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 4\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\n\t\t// Inject changed expectations via Hash::merge()\n\t\t$expected['Article']['title'] = $customSettings['merge']['Article']['title'];\n\t\t$expected['Article']['published'] = $customSettings['merge']['Article']['published'];\n\t\t// Inject changed expectations via Hash::insert()\n\t\tforeach ($expected['Comment'] as $i => $data) {\n\t\t\t$expected['Comment'][$i]['user_id'] = $customSettings['insert']['Comment.{n}.user_id'];\n\t\t\t$expected['Comment'][$i]['comment'] = $customSettings['insert']['Comment.{n}.comment'];\n\t\t}\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testArticleClone()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $clonedArticle = clone $article;\n $this->assertFalse($article === $clonedArticle);\n $this->assertFalse($article->getDocument() === $clonedArticle->getDocument());\n $this->assertEquals($article->toArray(), $clonedArticle->toArray());\n }",
"public function testCopyPrepareData1() {\n\t\t$data = $this->expectedFromFixtures[1];\n\t\t$result = $this->Article->copyPrepareData($data);\n\t\t$expected = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => '3',\n\t\t\t\t'title' => 'Second Article',\n\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t'published' => 'Y',\n\t\t\t\t'updated' => '2007-03-18 10:43:31',\n\t\t\t),\n\t\t\t// strips User (belongsTo)\n\t\t\t'Featured' => array(\n\t\t\t\t'category_id' => '1',\n\t\t\t\t'published_date' => '2007-03-31 10:39:23',\n\t\t\t\t'end_date' => '2007-05-15 10:39:23',\n\t\t\t\t'updated' => '2007-03-18 10:41:31',\n\t\t\t\t// strips ArticleFeatured (belongsTo)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:55:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t\t1 => array(\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:57:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t),\n\t\t\t// HABTM switched to just the primary keys for Joins\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t0 => '1',\n\t\t\t\t\t1 => '3',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testCopySaveAll() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\t\t$before = $this->Article->copyFindData(1);\n\t\t$save = $before;\n\t\tunset($save['Tag']);\n\t\t$saved = $this->Article->copySaveAll($save);\n\t\t$this->assertTrue($saved);\n\n\t\t$id = $this->Article->id;\n\t\t$this->assertEquals($id, 1);\n\n\t\t$after = $this->Article->copyFindData(1);\n\t\t$this->assertEquals($before, $after);\n\n\t\t$this->assertEquals(\n\t\t\tarray(\n\t\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t\t),\n\t\t\t$initialCounts\n\t\t);\n\t}",
"function getCopyOfArticle() {\n\t\t$newArticle = new PolarBear_Article($this->id);\n\t\t$newArticle->prepareForCopy();\n\t\t$newArticle->save();\n\t\treturn $newArticle;\n\t}",
"function test_entity_blog_create(string $name) {\n run_test($name)\n ->prepare(function($p) {})\n ->test(function($p) {\n // Run target function\n $status = entity_blog_create(...array_values($p));\n\n // Status must be true\n assert_equal(TRUE, $status, 'entity_blog_create($p) should return true');\n\n // Checks newly inserted data to db\n $stmt = read('SELECT * FROM blog WHERE title = ?', 's', $p, $id, $title, $content, $filename, $type, $created_at);\n\n // Should return at least 1 value\n assert_equal(TRUE, $stmt->fetch(), 'There should be at least one row');\n\n // Should be equal to inserted title\n assert_equal($p['title'], $title, 'Should be equal to inserted title');\n assert_equal($p['content'], $content, 'Should be equal to inserted content');\n assert_equal($p['filename'], $filename, 'Should be equal to inserted filename');\n assert_equal($p['type'], $type, 'Should be equal to inserted type');\n\n // Closes the statement\n $stmt->close();\n })\n ->dataset([\n 'Dataset 1: Government News' => [\n 'title' => 'Government News',\n 'content' => 'Well, nice content',\n 'type' => 'Government',\n 'filename' => ''\n ],\n 'Dataset 2: Food News' => [\n 'title' => 'Food News',\n 'content' => 'I\\'m hungry.',\n 'type' => 'Food',\n 'filename' => ''\n ],\n 'Dataset 3: Sports News' => [\n 'title' => 'Sports News',\n 'content' => 'Let\\'s play.. Uh...',\n 'type' => 'Sports',\n 'filename' => ''\n ]\n ])\n ->cleanup(function($p){\n\n // Removes the created data\n write('DELETE FROM blog WHERE title = ?', 's', ...array_values($p));\n })\n ->run();\n}",
"private function insertArticle()\n {\n $this->testArticleId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $this->testArticleParentId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n\n //copy from original article parent and variant\n $articleParent = oxNew('oxarticle');\n $articleParent->disableLazyLoading();\n $articleParent->load(self::SOURCE_ARTICLE_PARENT_ID);\n $articleParent->setId($this->testArticleParentId);\n $articleParent->oxarticles__oxartnum = new oxField('666-T', oxField::T_RAW);\n $articleParent->save();\n\n $article = oxNew('oxarticle');\n $article->disableLazyLoading();\n $article->load(self::SOURCE_ARTICLE_ID);\n $article->setId($this->testArticleId);\n $article->oxarticles__oxparentid = new oxField($this->testArticleParentId, oxField::T_RAW);\n $article->oxarticles__oxprice = new oxField('10.0', oxField::T_RAW);\n $article->oxarticles__oxartnum = new oxField('666-T-V', oxField::T_RAW);\n $article->oxarticles__oxactive = new oxField('1', oxField::T_RAW);\n $article->save();\n\n }",
"public abstract function copy(EntityManager $em);",
"public function setUp()\n {\n $this->fixtures('articles');\n }",
"public function testLoad(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $result = $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n }",
"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 }",
"public function testArticleFromJson()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $this->assertEquals($articleData, $article->toArray());\n }",
"function test_addCopies()\n {\n //Arrange\n $title = \"Gardening with Phil\";\n $genre = \"Informational/How-To\";\n $test_book = new Book($title, $genre);\n $test_book->save();\n\n //Act\n $test_book->addCopies(1);\n\n //Assert\n $result = $test_book->getCopies();\n $this->assertEquals(2, count($result));\n }",
"public function testSavePartialFields() {\n\t\t$this->loadFixtures('Audit', 'AuditDelta', 'AuditableTranslate', 'AuditableTranslatedItem');\n\n\t\t$TestModel = new AuditableTranslatedItem();\n\t\t$TestModel->locale = 'spa';\n\t\t$data = array(\n\t\t\t'slug' => 'fourth_translated',\n\t\t\t'title' => 'Leyenda #4',\n\t\t);\n\t\t$TestModel->create($data);\n\t\t$TestModel->save();\n\t\t$result = $TestModel->read();\n\t\t$expected = array(\n\t\t\t'AuditableTranslatedItem' => array(\n\t\t\t\t'id' => $TestModel->id,\n\t\t\t\t'auditable_translated_article_id' => null,\n\t\t\t\t'locale' => 'spa',\n\t\t\t\t'content' => '',\n\t\t\t) + $data\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testLoad()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n }",
"public function testLoadDulicateFixtures(): void\n {\n $this->expectException(UnexpectedValueException::class);\n $this->expectExceptionMessage('Found duplicate fixture `core.Articles`');\n (new FixtureHelper())->loadFixtures(['core.Articles','core.Articles']);\n }",
"public function testCopyPrepareDataEmpties() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(array()),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(null),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(false),\n\t\t\tarray()\n\t\t);\n\t}",
"public function test_prepare_item() {}",
"function testResetOfExistsOnCreate() {\n\t\t$this->loadFixtures('Article');\n\t\t$Article =& new Article();\n\t\t$Article->id = 1;\n\t\t$Article->saveField('title', 'Reset me');\n\t\t$Article->delete();\n\t\t$Article->id = 1;\n\t\t$this->assertFalse($Article->exists());\n\n\t\t$Article->create();\n\t\t$this->assertFalse($Article->exists());\n\t\t$Article->id = 2;\n\t\t$Article->saveField('title', 'Staying alive');\n\t\t$result = $Article->read(null, 2);\n\t\t$this->assertEqual($result['Article']['title'], 'Staying alive');\n\t}",
"abstract protected function getFixtures();",
"public function setUp()\n {\n\n parent::setUp();\n\n $coll1 = $this->_collection('Collection 1');\n $coll2 = $this->_collection('Collection 2');\n\n $this->item1 = $this->_collitem('Item 1', $coll1);\n $this->item2 = $this->_collitem('Item 2', $coll1);\n $this->item3 = $this->_collitem('Item 3', $coll2);\n $this->item4 = $this->_collitem('Item 4', $coll2);\n\n }",
"public function testCopyCopiesStorageProperly()\n {\n $data = 'contents';\n mkdir(self::$temp.DS.'text');\n file_put_contents(self::$temp.DS.'text'.DS.'foo.txt', $data);\n\n Storage::copy(self::$temp.DS.'text'.DS.'foo.txt', self::$temp.DS.'text'.DS.'foo2.txt');\n\n $this->assertTrue(is_file(self::$temp.DS.'text'.DS.'foo2.txt'));\n $this->assertTrue($data === file_get_contents(self::$temp.DS.'text'.DS.'foo2.txt'));\n }",
"public function testGetDuplicateItemSubCategoryById()\n {\n }",
"function copy_article($newlyPlanId,$plan_id){\n \n {//Plan_Article Block\n \n $queryPlanArticle = \"SELECT * FROM plan_article WHERE status = 1 AND plan_id = '{$plan_id}' \" ;\n $resultPlanArticle = $this->execute_query($queryPlanArticle);\n \n if($this->num_rows($resultPlanArticle)!= 0)\n {\n while($row = $this->fetch_array($resultPlanArticle))\n { \n \n $insertArr = array(\n 'plan_id'=> $newlyPlanId,\n 'article_id' => $row['article_id'], \n 'creation_date' => date('Y-m-d H:i:s',time()), \n 'status'=> $row['status'] \n );\n \n $result = $this->insert('plan_article',$insertArr);\n \n }\n }\n }\n }",
"public function testFixtureLoadOnDemand(): void\n {\n $this->loadFixtures('Categories');\n }",
"public function testExample1()\n {\n // Gọi hàm tạo\n $document = $this->DocumentRepository->create($this->document);\n // Kiểm tra xem kết quả trả về có là thể hiện của lớp document hay không\n $this->assertInstanceOf(Document::class, $document);\n // Kiểm tra data trả về\n $this->assertEquals($this->document['title'], $document->title);\n $this->assertEquals($this->document['content'], $document->content);\n $this->assertEquals($this->document['slug'], $document->slug);\n $this->assertEquals($this->document['subject_id'], $document->subject_id);\n // Kiểm tra dữ liệu có tồn tại trong cơ sở dữ liệu hay không\n $this->assertDatabaseHas('documents', $this->document);\n }",
"public function testBasicTest()\n {\n //$this->assertTrue(true);\n\n // Given I have two records in the database that are posts.\n\n // and each one is posted a month apart\n\n $first = factory(Article::class)->create();\n\n $second = factory(Article::class)->create([\n\n 'created_at' => \\Carbon\\Carbon::now()->subMonth(),\n ]);\n\n //when I fetch the archives\n $posts = Article::archives();\n\n //then the response should be the proper format.\n\n $this->assertCount(2, $posts);\n\n }"
]
| [
"0.7488092",
"0.74649763",
"0.7424462",
"0.7237116",
"0.7174169",
"0.68186146",
"0.6648159",
"0.5915793",
"0.5911748",
"0.588351",
"0.5869303",
"0.5725212",
"0.5721222",
"0.5717875",
"0.5715972",
"0.56216025",
"0.5583707",
"0.5543757",
"0.5533995",
"0.55053824",
"0.55052525",
"0.54533887",
"0.5433948",
"0.54281557",
"0.5427652",
"0.54165256",
"0.54011077",
"0.5400469",
"0.5396692",
"0.53841984"
]
| 0.7604872 | 0 |
test copy on fixture Article2 | public function testCopy2() {
$initialCounts = array(
'Article' => $this->Article->find('count'),
'User' => $this->Article->User->find('count'),
'Featured' => $this->Article->Featured->find('count'),
'Comment' => $this->Article->Comment->find('count'),
'Tag' => $this->Article->Tag->find('count'),
);
$result = $this->Article->copy(2);
$this->assertTrue($result);
$newId = $this->Article->id;
$this->assertTrue(is_numeric($newId));
// orig is unchanged
$result = $this->Article->find('first', array(
'contain' => $this->settings['containArticle'],
'conditions' => array(
'Article.id' => 2
)
));
$expected = $this->expectedFromFixtures[1];
$this->assertEquals($expected, $result);
// see how many records were created
$this->assertEquals(
$this->Article->find('count'),
$initialCounts['Article'] + 1
);
$this->assertEquals(
$this->Article->User->find('count'),
$initialCounts['User']
);
$this->assertEquals(
$this->Article->Featured->find('count'),
$initialCounts['Featured'] + 1
);
$this->assertEquals(
$this->Article->Comment->find('count'),
$initialCounts['Comment'] + 2
);
// should not have made any more HABTM targets
// should only have made more join records
$this->assertEquals(
$this->Article->Tag->find('count'),
$initialCounts['Tag']
);
// new record
$result = $this->Article->find('first', array(
'contain' => $this->settings['containArticle'],
'conditions' => array(
'Article.id' => $newId
)
));
$this->_assertArticleAfterCopy($result, $expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testCopy1() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(1);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 1\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[0];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 4\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopy3() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(3);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 3\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[2];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopyWithInjectionData() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$customSettings = array(\n\t\t\t'merge' => array(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'title' => 'INJECT changed this',\n\t\t\t\t\t'published' => 'X',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'insert' => array(\n\t\t\t\t'Comment.{n}.user_id' => 0,\n\t\t\t\t'Comment.{n}.comment' => 'INJECT changed via Hash::insert()',\n\t\t\t),\n\t\t);\n\t\t$result = $this->Article->copy(1, $customSettings);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 1\n\t\t\t)\n\t\t));\n\n\t\t$expected = $this->expectedFromFixtures[0];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 4\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\n\t\t// Inject changed expectations via Hash::merge()\n\t\t$expected['Article']['title'] = $customSettings['merge']['Article']['title'];\n\t\t$expected['Article']['published'] = $customSettings['merge']['Article']['published'];\n\t\t// Inject changed expectations via Hash::insert()\n\t\tforeach ($expected['Comment'] as $i => $data) {\n\t\t\t$expected['Comment'][$i]['user_id'] = $customSettings['insert']['Comment.{n}.user_id'];\n\t\t\t$expected['Comment'][$i]['comment'] = $customSettings['insert']['Comment.{n}.comment'];\n\t\t}\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testArticleClone()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $clonedArticle = clone $article;\n $this->assertFalse($article === $clonedArticle);\n $this->assertFalse($article->getDocument() === $clonedArticle->getDocument());\n $this->assertEquals($article->toArray(), $clonedArticle->toArray());\n }",
"public function testCopyPrepareData1() {\n\t\t$data = $this->expectedFromFixtures[1];\n\t\t$result = $this->Article->copyPrepareData($data);\n\t\t$expected = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => '3',\n\t\t\t\t'title' => 'Second Article',\n\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t'published' => 'Y',\n\t\t\t\t'updated' => '2007-03-18 10:43:31',\n\t\t\t),\n\t\t\t// strips User (belongsTo)\n\t\t\t'Featured' => array(\n\t\t\t\t'category_id' => '1',\n\t\t\t\t'published_date' => '2007-03-31 10:39:23',\n\t\t\t\t'end_date' => '2007-05-15 10:39:23',\n\t\t\t\t'updated' => '2007-03-18 10:41:31',\n\t\t\t\t// strips ArticleFeatured (belongsTo)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:55:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t\t1 => array(\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:57:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t),\n\t\t\t// HABTM switched to just the primary keys for Joins\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t0 => '1',\n\t\t\t\t\t1 => '3',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testCopySaveAll() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\t\t$before = $this->Article->copyFindData(1);\n\t\t$save = $before;\n\t\tunset($save['Tag']);\n\t\t$saved = $this->Article->copySaveAll($save);\n\t\t$this->assertTrue($saved);\n\n\t\t$id = $this->Article->id;\n\t\t$this->assertEquals($id, 1);\n\n\t\t$after = $this->Article->copyFindData(1);\n\t\t$this->assertEquals($before, $after);\n\n\t\t$this->assertEquals(\n\t\t\tarray(\n\t\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t\t),\n\t\t\t$initialCounts\n\t\t);\n\t}",
"function getCopyOfArticle() {\n\t\t$newArticle = new PolarBear_Article($this->id);\n\t\t$newArticle->prepareForCopy();\n\t\t$newArticle->save();\n\t\treturn $newArticle;\n\t}",
"public function testLoad(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $result = $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n }",
"function test_entity_blog_create(string $name) {\n run_test($name)\n ->prepare(function($p) {})\n ->test(function($p) {\n // Run target function\n $status = entity_blog_create(...array_values($p));\n\n // Status must be true\n assert_equal(TRUE, $status, 'entity_blog_create($p) should return true');\n\n // Checks newly inserted data to db\n $stmt = read('SELECT * FROM blog WHERE title = ?', 's', $p, $id, $title, $content, $filename, $type, $created_at);\n\n // Should return at least 1 value\n assert_equal(TRUE, $stmt->fetch(), 'There should be at least one row');\n\n // Should be equal to inserted title\n assert_equal($p['title'], $title, 'Should be equal to inserted title');\n assert_equal($p['content'], $content, 'Should be equal to inserted content');\n assert_equal($p['filename'], $filename, 'Should be equal to inserted filename');\n assert_equal($p['type'], $type, 'Should be equal to inserted type');\n\n // Closes the statement\n $stmt->close();\n })\n ->dataset([\n 'Dataset 1: Government News' => [\n 'title' => 'Government News',\n 'content' => 'Well, nice content',\n 'type' => 'Government',\n 'filename' => ''\n ],\n 'Dataset 2: Food News' => [\n 'title' => 'Food News',\n 'content' => 'I\\'m hungry.',\n 'type' => 'Food',\n 'filename' => ''\n ],\n 'Dataset 3: Sports News' => [\n 'title' => 'Sports News',\n 'content' => 'Let\\'s play.. Uh...',\n 'type' => 'Sports',\n 'filename' => ''\n ]\n ])\n ->cleanup(function($p){\n\n // Removes the created data\n write('DELETE FROM blog WHERE title = ?', 's', ...array_values($p));\n })\n ->run();\n}",
"public abstract function copy(EntityManager $em);",
"private function insertArticle()\n {\n $this->testArticleId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $this->testArticleParentId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n\n //copy from original article parent and variant\n $articleParent = oxNew('oxarticle');\n $articleParent->disableLazyLoading();\n $articleParent->load(self::SOURCE_ARTICLE_PARENT_ID);\n $articleParent->setId($this->testArticleParentId);\n $articleParent->oxarticles__oxartnum = new oxField('666-T', oxField::T_RAW);\n $articleParent->save();\n\n $article = oxNew('oxarticle');\n $article->disableLazyLoading();\n $article->load(self::SOURCE_ARTICLE_ID);\n $article->setId($this->testArticleId);\n $article->oxarticles__oxparentid = new oxField($this->testArticleParentId, oxField::T_RAW);\n $article->oxarticles__oxprice = new oxField('10.0', oxField::T_RAW);\n $article->oxarticles__oxartnum = new oxField('666-T-V', oxField::T_RAW);\n $article->oxarticles__oxactive = new oxField('1', oxField::T_RAW);\n $article->save();\n\n }",
"public function testLoad()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n }",
"public function testSavePartialFields() {\n\t\t$this->loadFixtures('Audit', 'AuditDelta', 'AuditableTranslate', 'AuditableTranslatedItem');\n\n\t\t$TestModel = new AuditableTranslatedItem();\n\t\t$TestModel->locale = 'spa';\n\t\t$data = array(\n\t\t\t'slug' => 'fourth_translated',\n\t\t\t'title' => 'Leyenda #4',\n\t\t);\n\t\t$TestModel->create($data);\n\t\t$TestModel->save();\n\t\t$result = $TestModel->read();\n\t\t$expected = array(\n\t\t\t'AuditableTranslatedItem' => array(\n\t\t\t\t'id' => $TestModel->id,\n\t\t\t\t'auditable_translated_article_id' => null,\n\t\t\t\t'locale' => 'spa',\n\t\t\t\t'content' => '',\n\t\t\t) + $data\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"function test_addCopies()\n {\n //Arrange\n $title = \"Gardening with Phil\";\n $genre = \"Informational/How-To\";\n $test_book = new Book($title, $genre);\n $test_book->save();\n\n //Act\n $test_book->addCopies(1);\n\n //Assert\n $result = $test_book->getCopies();\n $this->assertEquals(2, count($result));\n }",
"public function testArticleFromJson()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $this->assertEquals($articleData, $article->toArray());\n }",
"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 }",
"public function testGetDuplicateItemSubCategoryById()\n {\n }",
"public function testTransaction2()\n {\n $this->assertCount(1, $this->app['orm.em']->getRepository('Entities\\Version')->findAll());\n }",
"public function testCopyCopiesStorageProperly()\n {\n $data = 'contents';\n mkdir(self::$temp.DS.'text');\n file_put_contents(self::$temp.DS.'text'.DS.'foo.txt', $data);\n\n Storage::copy(self::$temp.DS.'text'.DS.'foo.txt', self::$temp.DS.'text'.DS.'foo2.txt');\n\n $this->assertTrue(is_file(self::$temp.DS.'text'.DS.'foo2.txt'));\n $this->assertTrue($data === file_get_contents(self::$temp.DS.'text'.DS.'foo2.txt'));\n }",
"public function test_prepare_item() {}",
"public function setUp()\n {\n $this->fixtures('articles');\n }",
"public function testBasicTest()\n {\n //$this->assertTrue(true);\n\n // Given I have two records in the database that are posts.\n\n // and each one is posted a month apart\n\n $first = factory(Article::class)->create();\n\n $second = factory(Article::class)->create([\n\n 'created_at' => \\Carbon\\Carbon::now()->subMonth(),\n ]);\n\n //when I fetch the archives\n $posts = Article::archives();\n\n //then the response should be the proper format.\n\n $this->assertCount(2, $posts);\n\n }",
"public function testLoadDulicateFixtures(): void\n {\n $this->expectException(UnexpectedValueException::class);\n $this->expectExceptionMessage('Found duplicate fixture `core.Articles`');\n (new FixtureHelper())->loadFixtures(['core.Articles','core.Articles']);\n }",
"abstract protected function getFixtures();",
"function testResetOfExistsOnCreate() {\n\t\t$this->loadFixtures('Article');\n\t\t$Article =& new Article();\n\t\t$Article->id = 1;\n\t\t$Article->saveField('title', 'Reset me');\n\t\t$Article->delete();\n\t\t$Article->id = 1;\n\t\t$this->assertFalse($Article->exists());\n\n\t\t$Article->create();\n\t\t$this->assertFalse($Article->exists());\n\t\t$Article->id = 2;\n\t\t$Article->saveField('title', 'Staying alive');\n\t\t$result = $Article->read(null, 2);\n\t\t$this->assertEqual($result['Article']['title'], 'Staying alive');\n\t}",
"public function testGettingContent()\n {\n $this->assertEquals('foo', $this->revision->getContent());\n }",
"public function testTransformerPageToSnapshot(): void\n {\n $this->snapshotManager->method('create')->willReturn(new SonataPageSnapshot());\n $this->snapshotManager->method('getClass')->willReturn(SonataPageSnapshot::class);\n\n $datetime = new \\DateTime();\n\n $site = new SonataPageSite();\n\n $block1 = new SonataPageBlock();\n $block1->setId('block123');\n $block1->setName('block1');\n $block1->setType('type');\n $block1->setPosition(0);\n $block1->setCreatedAt($datetime);\n $block1->setUpdatedAt($datetime);\n\n $block2 = new SonataPageBlock();\n $block2->setId('block234');\n $block2->setName('block2');\n $block2->setType('type');\n $block2->setPosition(0);\n $block2->setCreatedAt($datetime);\n $block2->setUpdatedAt($datetime);\n if (method_exists($block1, 'addChild')) {\n $block1->addChild($block2);\n } else {\n $block1->addChildren($block2);\n }\n\n $parentPage = new SonataPagePage();\n $parentPage->setId('page_parent');\n $parentPage->setName('Page Parent');\n $parentPage->setUrl('/get-parent');\n $parentPage->setSite($site);\n $parentPage->setCreatedAt($datetime);\n $parentPage->setUpdatedAt($datetime);\n\n $page = new SonataPagePage();\n $page->setId('page_child');\n $page->setName('Page Child');\n $page->setTitle('Page Child Title');\n $page->setUrl('/get-child');\n $page->setSite($site);\n $page->setCreatedAt($datetime);\n $page->setUpdatedAt($datetime);\n if (method_exists($page, 'addBlock')) {\n $page->addBlock($block1);\n $page->addBlock($block2);\n } else {\n $page->addBlocks($block1);\n $page->addBlocks($block2);\n }\n if (method_exists($parentPage, 'addChild')) {\n $parentPage->addChild($page);\n } else {\n $parentPage->addChildren($page);\n }\n\n $snapshot = $this->transformer->create($page);\n static::assertSame($page->getUrl(), $snapshot->getUrl());\n static::assertSame($page->getName(), $snapshot->getName());\n\n static::assertSame($this->getTestContent($datetime), $snapshot->getContent());\n }",
"public function testSetupArticleFeatured() {\n\t\t$result = $this->Article->find('all', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t));\n\t\t//echo var_export($result);\n\t\t$expected = $this->expectedFromFixtures;\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function setUp()\n {\n\n parent::setUp();\n\n $coll1 = $this->_collection('Collection 1');\n $coll2 = $this->_collection('Collection 2');\n\n $this->item1 = $this->_collitem('Item 1', $coll1);\n $this->item2 = $this->_collitem('Item 2', $coll1);\n $this->item3 = $this->_collitem('Item 3', $coll2);\n $this->item4 = $this->_collitem('Item 4', $coll2);\n\n }"
]
| [
"0.7389393",
"0.73755574",
"0.72835815",
"0.71231437",
"0.70570964",
"0.6766371",
"0.6547261",
"0.58367443",
"0.5819692",
"0.5781461",
"0.5774522",
"0.5640452",
"0.5633137",
"0.5627331",
"0.56246525",
"0.55584735",
"0.55425805",
"0.5486102",
"0.54831076",
"0.5456526",
"0.5455102",
"0.5416653",
"0.53836274",
"0.5340078",
"0.53264844",
"0.5326165",
"0.5322783",
"0.53207624",
"0.53016806",
"0.5298966"
]
| 0.7594901 | 0 |
test copy on fixture Article3 | public function testCopy3() {
$initialCounts = array(
'Article' => $this->Article->find('count'),
'User' => $this->Article->User->find('count'),
'Featured' => $this->Article->Featured->find('count'),
'Comment' => $this->Article->Comment->find('count'),
'Tag' => $this->Article->Tag->find('count'),
);
$result = $this->Article->copy(3);
$this->assertTrue($result);
$newId = $this->Article->id;
$this->assertTrue(is_numeric($newId));
// orig is unchanged
$result = $this->Article->find('first', array(
'contain' => $this->settings['containArticle'],
'conditions' => array(
'Article.id' => 3
)
));
$expected = $this->expectedFromFixtures[2];
$this->assertEquals($expected, $result);
// see how many records were created
$this->assertEquals(
$this->Article->find('count'),
$initialCounts['Article'] + 1
);
$this->assertEquals(
$this->Article->User->find('count'),
$initialCounts['User']
);
$this->assertEquals(
$this->Article->Featured->find('count'),
$initialCounts['Featured']
);
$this->assertEquals(
$this->Article->Comment->find('count'),
$initialCounts['Comment']
);
$this->assertEquals(
$this->Article->Tag->find('count'),
$initialCounts['Tag']
);
$this->_assertArticleAfterCopy($result, $expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testCopy1() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(1);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 1\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[0];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 4\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testArticleClone()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $clonedArticle = clone $article;\n $this->assertFalse($article === $clonedArticle);\n $this->assertFalse($article->getDocument() === $clonedArticle->getDocument());\n $this->assertEquals($article->toArray(), $clonedArticle->toArray());\n }",
"public function testCopy2() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(2);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 2\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[1];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 2\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopyWithInjectionData() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$customSettings = array(\n\t\t\t'merge' => array(\n\t\t\t\t'Article' => array(\n\t\t\t\t\t'title' => 'INJECT changed this',\n\t\t\t\t\t'published' => 'X',\n\t\t\t\t)\n\t\t\t),\n\t\t\t'insert' => array(\n\t\t\t\t'Comment.{n}.user_id' => 0,\n\t\t\t\t'Comment.{n}.comment' => 'INJECT changed via Hash::insert()',\n\t\t\t),\n\t\t);\n\t\t$result = $this->Article->copy(1, $customSettings);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 1\n\t\t\t)\n\t\t));\n\n\t\t$expected = $this->expectedFromFixtures[0];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 4\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\n\t\t// Inject changed expectations via Hash::merge()\n\t\t$expected['Article']['title'] = $customSettings['merge']['Article']['title'];\n\t\t$expected['Article']['published'] = $customSettings['merge']['Article']['published'];\n\t\t// Inject changed expectations via Hash::insert()\n\t\tforeach ($expected['Comment'] as $i => $data) {\n\t\t\t$expected['Comment'][$i]['user_id'] = $customSettings['insert']['Comment.{n}.user_id'];\n\t\t\t$expected['Comment'][$i]['comment'] = $customSettings['insert']['Comment.{n}.comment'];\n\t\t}\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopyPrepareData1() {\n\t\t$data = $this->expectedFromFixtures[1];\n\t\t$result = $this->Article->copyPrepareData($data);\n\t\t$expected = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => '3',\n\t\t\t\t'title' => 'Second Article',\n\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t'published' => 'Y',\n\t\t\t\t'updated' => '2007-03-18 10:43:31',\n\t\t\t),\n\t\t\t// strips User (belongsTo)\n\t\t\t'Featured' => array(\n\t\t\t\t'category_id' => '1',\n\t\t\t\t'published_date' => '2007-03-31 10:39:23',\n\t\t\t\t'end_date' => '2007-05-15 10:39:23',\n\t\t\t\t'updated' => '2007-03-18 10:41:31',\n\t\t\t\t// strips ArticleFeatured (belongsTo)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:55:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t\t1 => array(\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:57:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t),\n\t\t\t// HABTM switched to just the primary keys for Joins\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t0 => '1',\n\t\t\t\t\t1 => '3',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testCopySaveAll() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\t\t$before = $this->Article->copyFindData(1);\n\t\t$save = $before;\n\t\tunset($save['Tag']);\n\t\t$saved = $this->Article->copySaveAll($save);\n\t\t$this->assertTrue($saved);\n\n\t\t$id = $this->Article->id;\n\t\t$this->assertEquals($id, 1);\n\n\t\t$after = $this->Article->copyFindData(1);\n\t\t$this->assertEquals($before, $after);\n\n\t\t$this->assertEquals(\n\t\t\tarray(\n\t\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t\t),\n\t\t\t$initialCounts\n\t\t);\n\t}",
"public function testArticleFromJson()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $this->assertEquals($articleData, $article->toArray());\n }",
"function test_entity_blog_create(string $name) {\n run_test($name)\n ->prepare(function($p) {})\n ->test(function($p) {\n // Run target function\n $status = entity_blog_create(...array_values($p));\n\n // Status must be true\n assert_equal(TRUE, $status, 'entity_blog_create($p) should return true');\n\n // Checks newly inserted data to db\n $stmt = read('SELECT * FROM blog WHERE title = ?', 's', $p, $id, $title, $content, $filename, $type, $created_at);\n\n // Should return at least 1 value\n assert_equal(TRUE, $stmt->fetch(), 'There should be at least one row');\n\n // Should be equal to inserted title\n assert_equal($p['title'], $title, 'Should be equal to inserted title');\n assert_equal($p['content'], $content, 'Should be equal to inserted content');\n assert_equal($p['filename'], $filename, 'Should be equal to inserted filename');\n assert_equal($p['type'], $type, 'Should be equal to inserted type');\n\n // Closes the statement\n $stmt->close();\n })\n ->dataset([\n 'Dataset 1: Government News' => [\n 'title' => 'Government News',\n 'content' => 'Well, nice content',\n 'type' => 'Government',\n 'filename' => ''\n ],\n 'Dataset 2: Food News' => [\n 'title' => 'Food News',\n 'content' => 'I\\'m hungry.',\n 'type' => 'Food',\n 'filename' => ''\n ],\n 'Dataset 3: Sports News' => [\n 'title' => 'Sports News',\n 'content' => 'Let\\'s play.. Uh...',\n 'type' => 'Sports',\n 'filename' => ''\n ]\n ])\n ->cleanup(function($p){\n\n // Removes the created data\n write('DELETE FROM blog WHERE title = ?', 's', ...array_values($p));\n })\n ->run();\n}",
"private function insertArticle()\n {\n $this->testArticleId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $this->testArticleParentId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n\n //copy from original article parent and variant\n $articleParent = oxNew('oxarticle');\n $articleParent->disableLazyLoading();\n $articleParent->load(self::SOURCE_ARTICLE_PARENT_ID);\n $articleParent->setId($this->testArticleParentId);\n $articleParent->oxarticles__oxartnum = new oxField('666-T', oxField::T_RAW);\n $articleParent->save();\n\n $article = oxNew('oxarticle');\n $article->disableLazyLoading();\n $article->load(self::SOURCE_ARTICLE_ID);\n $article->setId($this->testArticleId);\n $article->oxarticles__oxparentid = new oxField($this->testArticleParentId, oxField::T_RAW);\n $article->oxarticles__oxprice = new oxField('10.0', oxField::T_RAW);\n $article->oxarticles__oxartnum = new oxField('666-T-V', oxField::T_RAW);\n $article->oxarticles__oxactive = new oxField('1', oxField::T_RAW);\n $article->save();\n\n }",
"function getCopyOfArticle() {\n\t\t$newArticle = new PolarBear_Article($this->id);\n\t\t$newArticle->prepareForCopy();\n\t\t$newArticle->save();\n\t\treturn $newArticle;\n\t}",
"public function testLoad(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $result = $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n }",
"public function testSavePartialFields() {\n\t\t$this->loadFixtures('Audit', 'AuditDelta', 'AuditableTranslate', 'AuditableTranslatedItem');\n\n\t\t$TestModel = new AuditableTranslatedItem();\n\t\t$TestModel->locale = 'spa';\n\t\t$data = array(\n\t\t\t'slug' => 'fourth_translated',\n\t\t\t'title' => 'Leyenda #4',\n\t\t);\n\t\t$TestModel->create($data);\n\t\t$TestModel->save();\n\t\t$result = $TestModel->read();\n\t\t$expected = array(\n\t\t\t'AuditableTranslatedItem' => array(\n\t\t\t\t'id' => $TestModel->id,\n\t\t\t\t'auditable_translated_article_id' => null,\n\t\t\t\t'locale' => 'spa',\n\t\t\t\t'content' => '',\n\t\t\t) + $data\n\t\t);\n\t\t$this->assertEquals($expected, $result);\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 }",
"public function test_prepare_item() {}",
"public function testCopyCopiesStorageProperly()\n {\n $data = 'contents';\n mkdir(self::$temp.DS.'text');\n file_put_contents(self::$temp.DS.'text'.DS.'foo.txt', $data);\n\n Storage::copy(self::$temp.DS.'text'.DS.'foo.txt', self::$temp.DS.'text'.DS.'foo2.txt');\n\n $this->assertTrue(is_file(self::$temp.DS.'text'.DS.'foo2.txt'));\n $this->assertTrue($data === file_get_contents(self::$temp.DS.'text'.DS.'foo2.txt'));\n }",
"public function setUp()\n {\n $this->fixtures('articles');\n }",
"function test_addCopies()\n {\n //Arrange\n $title = \"Gardening with Phil\";\n $genre = \"Informational/How-To\";\n $test_book = new Book($title, $genre);\n $test_book->save();\n\n //Act\n $test_book->addCopies(1);\n\n //Assert\n $result = $test_book->getCopies();\n $this->assertEquals(2, count($result));\n }",
"public function testLoad()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n }",
"public function testGettingContent()\n {\n $this->assertEquals('foo', $this->revision->getContent());\n }",
"public function setUp()\n {\n\n parent::setUp();\n\n $coll1 = $this->_collection('Collection 1');\n $coll2 = $this->_collection('Collection 2');\n\n $this->item1 = $this->_collitem('Item 1', $coll1);\n $this->item2 = $this->_collitem('Item 2', $coll1);\n $this->item3 = $this->_collitem('Item 3', $coll2);\n $this->item4 = $this->_collitem('Item 4', $coll2);\n\n }",
"public abstract function copy(EntityManager $em);",
"public function createContentAndCopyDraftPage() {}",
"public function testFixtureLoadOnDemand(): void\n {\n $this->loadFixtures('Categories');\n }",
"public function testGetDuplicateItemSubCategoryById()\n {\n }",
"public function testEditTemplate()\n {\n\n }",
"public function testAddItemSubCategoryFileByURL()\n {\n }",
"public function testCopyPrepareDataEmpties() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(array()),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(null),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(false),\n\t\t\tarray()\n\t\t);\n\t}",
"public function testSetupArticleFeatured() {\n\t\t$result = $this->Article->find('all', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t));\n\t\t//echo var_export($result);\n\t\t$expected = $this->expectedFromFixtures;\n\t\t$this->assertEquals($expected, $result);\n\t}",
"function test_entity_blog_list_by_type(string $name) {\n run_test($name)\n ->prepare(function($p) {\n\n // Create new blog titles\n foreach($p['expected'] as $item) {\n\n // Create blog entry\n write('INSERT INTO blog SET title = ?, type = ?, created_at = NOW()', 'ss', $item, $p['filter']);\n }\n })\n ->test(function($p) {\n\n // Run target function\n $stmt = entity_blog_list_by_type($p['filter'], $id, $title, $content, $filename, $type, $created_at);\n\n foreach ($p['expected'] as $expected_title) {\n\n // Fetches from statement\n assert_equal(TRUE, $stmt->fetch(), \"Fetching $expected_title\");\n\n // Validates\n assert_equal($expected_title, $title, \"We should get $title\");\n }\n })\n ->dataset([\n 'Dataset 1: Government News' => [\n 'filter' => 'Government',\n 'expected' => ['Covid19 Response', 'Humanitarian Services', 'Important Announcement']\n ],\n 'Dataset 2: Sports News' => [\n 'filter' => 'Sports',\n 'expected' => ['DotA2', 'MLBB', 'Eh']\n ]\n ])\n ->cleanup(function($p) {\n\n // Performing cleanup\n foreach($p['expected'] as $item) {\n\n // Removes the created data\n write('DELETE FROM blog WHERE title = ? AND type = ?', 'ss', $item, $p['filter']);\n }\n })\n ->run();\n}"
]
| [
"0.73687994",
"0.72565126",
"0.72072726",
"0.7184059",
"0.71356136",
"0.6550596",
"0.649621",
"0.5953306",
"0.5945408",
"0.5931184",
"0.5865924",
"0.58236563",
"0.5816622",
"0.5815398",
"0.57637817",
"0.5664685",
"0.5642018",
"0.55607677",
"0.55345607",
"0.55343264",
"0.549774",
"0.5486608",
"0.5486461",
"0.5483621",
"0.5449348",
"0.54483056",
"0.5411605",
"0.5411122",
"0.53876925",
"0.53751"
]
| 0.7643349 | 0 |
test copy on fixture Article1 with inject data to overwrite after prep. | public function testCopyWithInjectionData() {
$initialCounts = array(
'Article' => $this->Article->find('count'),
'User' => $this->Article->User->find('count'),
'Featured' => $this->Article->Featured->find('count'),
'Comment' => $this->Article->Comment->find('count'),
'Tag' => $this->Article->Tag->find('count'),
);
$customSettings = array(
'merge' => array(
'Article' => array(
'title' => 'INJECT changed this',
'published' => 'X',
)
),
'insert' => array(
'Comment.{n}.user_id' => 0,
'Comment.{n}.comment' => 'INJECT changed via Hash::insert()',
),
);
$result = $this->Article->copy(1, $customSettings);
$this->assertTrue($result);
$newId = $this->Article->id;
$this->assertTrue(is_numeric($newId));
// orig is unchanged
$result = $this->Article->find('first', array(
'contain' => $this->settings['containArticle'],
'conditions' => array(
'Article.id' => 1
)
));
$expected = $this->expectedFromFixtures[0];
$this->assertEquals($expected, $result);
// see how many records were created
$this->assertEquals(
$this->Article->find('count'),
$initialCounts['Article'] + 1
);
$this->assertEquals(
$this->Article->User->find('count'),
$initialCounts['User']
);
$this->assertEquals(
$this->Article->Featured->find('count'),
$initialCounts['Featured'] + 1
);
$this->assertEquals(
$this->Article->Comment->find('count'),
$initialCounts['Comment'] + 4
);
// should not have made any more HABTM targets
// should only have made more join records
$this->assertEquals(
$this->Article->Tag->find('count'),
$initialCounts['Tag']
);
// new record
$result = $this->Article->find('first', array(
'contain' => $this->settings['containArticle'],
'conditions' => array(
'Article.id' => $newId
)
));
// Inject changed expectations via Hash::merge()
$expected['Article']['title'] = $customSettings['merge']['Article']['title'];
$expected['Article']['published'] = $customSettings['merge']['Article']['published'];
// Inject changed expectations via Hash::insert()
foreach ($expected['Comment'] as $i => $data) {
$expected['Comment'][$i]['user_id'] = $customSettings['insert']['Comment.{n}.user_id'];
$expected['Comment'][$i]['comment'] = $customSettings['insert']['Comment.{n}.comment'];
}
$this->_assertArticleAfterCopy($result, $expected);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCopy1() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(1);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 1\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[0];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 4\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopy3() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(3);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 3\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[2];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopy2() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\n\t\t$result = $this->Article->copy(2);\n\t\t$this->assertTrue($result);\n\n\t\t$newId = $this->Article->id;\n\t\t$this->assertTrue(is_numeric($newId));\n\n\t\t// orig is unchanged\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => 2\n\t\t\t)\n\t\t));\n\t\t$expected = $this->expectedFromFixtures[1];\n\t\t$this->assertEquals($expected, $result);\n\n\t\t// see how many records were created\n\t\t$this->assertEquals(\n\t\t\t$this->Article->find('count'),\n\t\t\t$initialCounts['Article'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->User->find('count'),\n\t\t\t$initialCounts['User']\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Featured->find('count'),\n\t\t\t$initialCounts['Featured'] + 1\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Comment->find('count'),\n\t\t\t$initialCounts['Comment'] + 2\n\t\t);\n\t\t// should not have made any more HABTM targets\n\t\t// should only have made more join records\n\t\t$this->assertEquals(\n\t\t\t$this->Article->Tag->find('count'),\n\t\t\t$initialCounts['Tag']\n\t\t);\n\n\t\t// new record\n\t\t$result = $this->Article->find('first', array(\n\t\t\t'contain' => $this->settings['containArticle'],\n\t\t\t'conditions' => array(\n\t\t\t\t'Article.id' => $newId\n\t\t\t)\n\t\t));\n\t\t$this->_assertArticleAfterCopy($result, $expected);\n\t}",
"public function testCopyFindData() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyFindData(1),\n\t\t\t$this->expectedFromFixtures[0]\n\t\t);\n\t}",
"public function testCopyPrepareData1() {\n\t\t$data = $this->expectedFromFixtures[1];\n\t\t$result = $this->Article->copyPrepareData($data);\n\t\t$expected = array(\n\t\t\t'Article' => array(\n\t\t\t\t'user_id' => '3',\n\t\t\t\t'title' => 'Second Article',\n\t\t\t\t'body' => 'Second Article Body',\n\t\t\t\t'published' => 'Y',\n\t\t\t\t'updated' => '2007-03-18 10:43:31',\n\t\t\t),\n\t\t\t// strips User (belongsTo)\n\t\t\t'Featured' => array(\n\t\t\t\t'category_id' => '1',\n\t\t\t\t'published_date' => '2007-03-31 10:39:23',\n\t\t\t\t'end_date' => '2007-05-15 10:39:23',\n\t\t\t\t'updated' => '2007-03-18 10:41:31',\n\t\t\t\t// strips ArticleFeatured (belongsTo)\n\t\t\t),\n\t\t\t'Comment' => array(\n\t\t\t\t0 => array(\n\t\t\t\t\t'user_id' => '1',\n\t\t\t\t\t'comment' => 'First Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:55:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t\t1 => array(\n\t\t\t\t\t'user_id' => '2',\n\t\t\t\t\t'comment' => 'Second Comment for Second Article',\n\t\t\t\t\t'published' => 'Y',\n\t\t\t\t\t'updated' => '2007-03-18 10:57:31',\n\t\t\t\t\t// strips User (belongsTo)\n\t\t\t\t),\n\t\t\t),\n\t\t\t// HABTM switched to just the primary keys for Joins\n\t\t\t'Tag' => array(\n\t\t\t\t'Tag' => array(\n\t\t\t\t\t0 => '1',\n\t\t\t\t\t1 => '3',\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"public function testCopySaveAll() {\n\t\t$initialCounts = array(\n\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t);\n\t\t$before = $this->Article->copyFindData(1);\n\t\t$save = $before;\n\t\tunset($save['Tag']);\n\t\t$saved = $this->Article->copySaveAll($save);\n\t\t$this->assertTrue($saved);\n\n\t\t$id = $this->Article->id;\n\t\t$this->assertEquals($id, 1);\n\n\t\t$after = $this->Article->copyFindData(1);\n\t\t$this->assertEquals($before, $after);\n\n\t\t$this->assertEquals(\n\t\t\tarray(\n\t\t\t\t'Article' => $this->Article->find('count'),\n\t\t\t\t'User' => $this->Article->User->find('count'),\n\t\t\t\t'Featured' => $this->Article->Featured->find('count'),\n\t\t\t\t'Comment' => $this->Article->Comment->find('count'),\n\t\t\t\t'Tag' => $this->Article->Tag->find('count'),\n\t\t\t),\n\t\t\t$initialCounts\n\t\t);\n\t}",
"public function testArticleClone()\n {\n $articlePath = realpath(__DIR__.'/../fixture/article.json');\n $articleData = json_decode(file_get_contents($articlePath), true);\n $article = Article::fromFile($articlePath);\n $clonedArticle = clone $article;\n $this->assertFalse($article === $clonedArticle);\n $this->assertFalse($article->getDocument() === $clonedArticle->getDocument());\n $this->assertEquals($article->toArray(), $clonedArticle->toArray());\n }",
"public function testCopyPrepareDataEmpties() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(array()),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(null),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(false),\n\t\t\tarray()\n\t\t);\n\t}",
"protected function postFixtureSetup()\n {\n }",
"public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }",
"public function setUp()\n {\n $this->fixtures('articles');\n }",
"function test_entity_blog_create(string $name) {\n run_test($name)\n ->prepare(function($p) {})\n ->test(function($p) {\n // Run target function\n $status = entity_blog_create(...array_values($p));\n\n // Status must be true\n assert_equal(TRUE, $status, 'entity_blog_create($p) should return true');\n\n // Checks newly inserted data to db\n $stmt = read('SELECT * FROM blog WHERE title = ?', 's', $p, $id, $title, $content, $filename, $type, $created_at);\n\n // Should return at least 1 value\n assert_equal(TRUE, $stmt->fetch(), 'There should be at least one row');\n\n // Should be equal to inserted title\n assert_equal($p['title'], $title, 'Should be equal to inserted title');\n assert_equal($p['content'], $content, 'Should be equal to inserted content');\n assert_equal($p['filename'], $filename, 'Should be equal to inserted filename');\n assert_equal($p['type'], $type, 'Should be equal to inserted type');\n\n // Closes the statement\n $stmt->close();\n })\n ->dataset([\n 'Dataset 1: Government News' => [\n 'title' => 'Government News',\n 'content' => 'Well, nice content',\n 'type' => 'Government',\n 'filename' => ''\n ],\n 'Dataset 2: Food News' => [\n 'title' => 'Food News',\n 'content' => 'I\\'m hungry.',\n 'type' => 'Food',\n 'filename' => ''\n ],\n 'Dataset 3: Sports News' => [\n 'title' => 'Sports News',\n 'content' => 'Let\\'s play.. Uh...',\n 'type' => 'Sports',\n 'filename' => ''\n ]\n ])\n ->cleanup(function($p){\n\n // Removes the created data\n write('DELETE FROM blog WHERE title = ?', 's', ...array_values($p));\n })\n ->run();\n}",
"private function insertArticle()\n {\n $this->testArticleId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $this->testArticleParentId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n\n //copy from original article parent and variant\n $articleParent = oxNew('oxarticle');\n $articleParent->disableLazyLoading();\n $articleParent->load(self::SOURCE_ARTICLE_PARENT_ID);\n $articleParent->setId($this->testArticleParentId);\n $articleParent->oxarticles__oxartnum = new oxField('666-T', oxField::T_RAW);\n $articleParent->save();\n\n $article = oxNew('oxarticle');\n $article->disableLazyLoading();\n $article->load(self::SOURCE_ARTICLE_ID);\n $article->setId($this->testArticleId);\n $article->oxarticles__oxparentid = new oxField($this->testArticleParentId, oxField::T_RAW);\n $article->oxarticles__oxprice = new oxField('10.0', oxField::T_RAW);\n $article->oxarticles__oxartnum = new oxField('666-T-V', oxField::T_RAW);\n $article->oxarticles__oxactive = new oxField('1', oxField::T_RAW);\n $article->save();\n\n }",
"public function setUp()\n {\n\n parent::setUp();\n\n $coll1 = $this->_collection('Collection 1');\n $coll2 = $this->_collection('Collection 2');\n\n $this->item1 = $this->_collitem('Item 1', $coll1);\n $this->item2 = $this->_collitem('Item 2', $coll1);\n $this->item3 = $this->_collitem('Item 3', $coll2);\n $this->item4 = $this->_collitem('Item 4', $coll2);\n\n }",
"function prepare() {\n\t\t\tcopy( \\Rum::config()->fixtures . '/Address Book.csv', __ROOT__ . '/app/data/Address Book.csv' );\n\t\t}",
"public abstract function copy(EntityManager $em);",
"public function setUp()\n {\n $this->reloadSchema();\n $this->reloadDataFixtures();\n }",
"public function testPreSave()\n {\n $this->todo('stub');\n }",
"protected function setupTestEntities() {\n // Create 4 entities with name1 and 3 entities with name2.\n $entity_1 = [\n 'name' => 'name1',\n ];\n\n $this->storage->create($entity_1)->save();\n $this->storage->create($entity_1)->save();\n $this->storage->create($entity_1)->save();\n $this->storage->create($entity_1)->save();\n\n $entity_2 = [\n 'name' => 'name2',\n ];\n $this->storage->create($entity_2)->save();\n $this->storage->create($entity_2)->save();\n $this->storage->create($entity_2)->save();\n }",
"function prepareForCopy() {\n\t\t$this->id = null;\n\t}",
"public function test_prepare_item() {}",
"protected function postFixtureRestore()\n {\n }",
"public function testDuplicate()\n {\n $this->duplicate(\n array_merge(\n $this->_createData1(),\n $this->_createData2()\n ),\n array_merge(\n $this->_expectData1(),\n $this->_expectData2()\n )\n );\n }",
"public function setUp()\n {\n $this->data = array(\n 'folder_name_1' => array(\n 'src' => 'source_1',\n 'dst' => 'destination_1',\n ),\n 'folder_name_2' => array(\n 'src' => 'source_2',\n 'dst' => 'destination_2',\n 'client' => 'test'\n )\n );\n }",
"public function testSavePartialFields() {\n\t\t$this->loadFixtures('Audit', 'AuditDelta', 'AuditableTranslate', 'AuditableTranslatedItem');\n\n\t\t$TestModel = new AuditableTranslatedItem();\n\t\t$TestModel->locale = 'spa';\n\t\t$data = array(\n\t\t\t'slug' => 'fourth_translated',\n\t\t\t'title' => 'Leyenda #4',\n\t\t);\n\t\t$TestModel->create($data);\n\t\t$TestModel->save();\n\t\t$result = $TestModel->read();\n\t\t$expected = array(\n\t\t\t'AuditableTranslatedItem' => array(\n\t\t\t\t'id' => $TestModel->id,\n\t\t\t\t'auditable_translated_article_id' => null,\n\t\t\t\t'locale' => 'spa',\n\t\t\t\t'content' => '',\n\t\t\t) + $data\n\t\t);\n\t\t$this->assertEquals($expected, $result);\n\t}",
"protected function setUp()\n {\n $this->post = Post::find(21); // it' a page with the custom fields\n }",
"public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }",
"public function testFixtureLoadOnDemand(): void\n {\n $this->loadFixtures('Categories');\n }",
"protected function setUp()\n {\n $this->fixture = new Parameter();\n }",
"public function setUp()\n {\n parent::setUp();\n\n $this->origBackend = Image::get_backend();\n\n if ($this->skipTest) {\n return;\n }\n\n if (!file_exists(ASSETS_PATH)) {\n mkdir(ASSETS_PATH);\n }\n\n // Create a test folders for each of the fixture references\n $folderIDs = $this->allFixtureIDs('Folder');\n\n foreach ($folderIDs as $folderID) {\n $folder = DataObject::get_by_id('Folder', $folderID);\n\n if (!file_exists(BASE_PATH.\"/$folder->Filename\")) {\n mkdir(BASE_PATH.\"/$folder->Filename\");\n }\n }\n\n // Copy test images for each of the fixture references\n $imageIDs = $this->allFixtureIDs('Image');\n foreach ($imageIDs as $imageID) {\n $image = DataObject::get_by_id('Image', $imageID);\n $filePath = BASE_PATH.\"/$image->Filename\";\n $sourcePath = str_replace('assets/ImageTest/', FOCUSPOINT_DIR.'/tests/', $filePath);\n if (!file_exists($filePath)) {\n if (!copy($sourcePath, $filePath)) {\n user_error('Failed to copy test images', E_USER_ERROR);\n }\n }\n }\n }"
]
| [
"0.731894",
"0.7237588",
"0.72327346",
"0.71472204",
"0.7109629",
"0.6540737",
"0.62214464",
"0.60960394",
"0.5796203",
"0.57861286",
"0.5766648",
"0.5766092",
"0.5717578",
"0.5695552",
"0.56586224",
"0.5654588",
"0.5651942",
"0.549845",
"0.54883534",
"0.5466568",
"0.545417",
"0.54361904",
"0.5432885",
"0.54270303",
"0.5403567",
"0.53981525",
"0.5377842",
"0.5368261",
"0.53604865",
"0.53479326"
]
| 0.7775594 | 0 |
Do actions in admin (general) | public function admin_action() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function admin_page_action() {\n\n\t\tif ( $this->is_admin_request_for_users_forget() ) {\n\t\t\t$this->users_forget();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_send_email() ) {\n\t\t\t$this->users_send_email();\n\t\t}\n\n\t\tif ( $this->is_admin_request_for_users_remove() ) {\n\t\t\t$this->users_remove_from_list();\n\t\t}\n\n\t\t/* Default settings page */\n\t\t$this->add_view_option( 'data', $this->get_all_requested_users_data( $confirmed_only = true ) );\n\n\t}",
"protected function executeAdminCommand() {}",
"protected function executeAdminCommand() {}",
"protected function executeAdminCommand() {}",
"public function controlActions(){\n // Check if the tables are created.\n $this->mode = 'admin';\n $this->object = new $this->type();\n $this->titlePage = __((string)$this->object->info->info->form->title);\n $this->layout = (string)$this->object->info->info->form->layout;\n $this->menuInside = $this->menuInside();\n $ui = new NavigationAdmin_Ui($this);\n switch ($this->action) {\n default:\n header('Location: '.url($this->type.'/listAdmin', true));\n exit();\n break;\n case 'listAdmin':\n /**\n * This is the main action for the BackEnd. If we are in DEBUG mode\n * it will create the table automatically.\n */\n $this->checkLoginAdmin();\n $this->content = $this->listAdmin();\n return $ui->render();\n break;\n case 'insertView':\n /**\n * This is the action that shows the form to insert a record in the BackEnd.\n */\n $this->checkLoginAdmin();\n $this->content = $this->insertView();\n return $ui->render();\n break;\n case 'insert':\n /**\n * This is the action that inserts a record in the BackEnd.\n * If the insertion is successful it shows a form to check the record,\n * if not it creates a form with the errors to correct.\n */\n $this->checkLoginAdmin();\n $insert = $this->insert();\n if ($insert['success']=='1') {\n header('Location: '.url($this->type.'/insertCheck/'.$insert['id'], true));\n exit();\n } else {\n $this->messageError = __('errorsForm');\n $this->content = $insert['html'];\n return $ui->render();\n }\n break;\n case 'modifyView':\n case 'modifyViewCheck':\n case 'insertCheck':\n /**\n * This is the action that shows the form to check a record insertion.\n */\n $this->checkLoginAdmin();\n $this->message = ($this->action=='insertCheck' || $this->action=='modifyViewCheck') ? __('savedForm') : '';\n $this->content = $this->modifyView();\n return $ui->render();\n break;\n case 'modifyViewNested':\n /**\n * This is the action that shows the form to modify a record.\n */\n $this->checkLoginAdmin();\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n $this->content = $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modifyNested', true),\n 'class'=>'formAdmin formAdminModify',\n 'nested'=>true),\n array()));\n return $ui->render();\n break;\n case 'modify':\n case 'modifyNested':\n /**\n * This is the action that updates a record when updating it.\n */\n $this->checkLoginAdmin();\n $nested = ($this->action == 'modifyNested') ? true : false;\n $modify = $this->modify($nested);\n if ($modify['success']=='1') {\n if (isset($this->values['submit-saveCheck'])) {\n header('Location: '.url($this->type.'/modifyViewCheck/'.$modify['id'], true));\n } else {\n header('Location: '.url($this->type.'/listAdmin', true));\n }\n exit();\n } else {\n $this->messageError = __('errorsForm');\n $this->content = $modify['html'];\n return $ui->render();\n }\n break;\n case 'delete':\n /**\n * This is the action that deletes a record.\n */\n $this->checkLoginAdmin();\n if ($this->id != '') {\n $type = new $this->type();\n $object = $type->readObject($this->id);\n $object->delete();\n }\n header('Location: '.url($this->type.'/listAdmin', true));\n exit();\n break;\n case 'sortSave':\n /**\n * This is the action that saves the order of a list of records.\n * It is used when sorting using the BackEnd.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n $object = new $this->type();\n $newOrder = (isset($this->values['newOrder'])) ? $this->values['newOrder'] : array();\n $object->updateOrder($newOrder);\n break;\n case 'sortList':\n /**\n * This is the action that changes the order of the list.\n */\n $this->checkLoginAdmin();\n $object = new $this->type();\n $info = explode('_', $this->id);\n if (isset($info[1]) && $object->attributeInfo($info[1])!='') {\n $orderType = ($info[0]=='asc') ? 'asc' : 'des';\n Session::set('ord_'.$this->type, $orderType.'_'.$info[1]);\n }\n header('Location: '.url($this->type, true));\n exit();\n break;\n case 'addSimple':\n /**\n * This is the action that adds a simple record.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n $formObject = $this->type.'_Form';\n $form = new $formObject();\n return $form->createFormFieldMultiple();\n break;\n case 'multiple-delete':\n /**\n * This is the action that deletes multiple records at once.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n if (isset($this->values['list-ids'])) {\n $type = new $this->type();\n foreach ($this->values['list-ids'] as $id) {\n $object = $type->readObject($id);\n $object->delete();\n }\n }\n break;\n case 'multiple-activate':\n case 'multiple-deactivate':\n /**\n * This is the action that activates or deactivates multiple records at once.\n * It just works on records that have an attribute named \"active\",\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n if (isset($this->values['list-ids'])) {\n $primary = (string)$this->object->info->info->sql->primary;\n $where = '';\n foreach ($this->values['list-ids'] as $id) {\n $where .= $primary.'=\"'.$id.'\" OR ';\n }\n $where = substr($where, 0, -4);\n $active = ($this->action == 'multiple-activate') ? '1' : '0';\n $query = 'UPDATE '.Db::prefixTable($this->type).' SET active=\"'.$active.'\" WHERE '.$where;\n Db::execute($query);\n }\n break;\n case 'autocomplete':\n /**\n * This is the action that returns a json string with the records that match a search string.\n * It is used for the autocomplete text input.\n */\n $this->mode = 'json';\n $autocomplete = (isset($_GET['term'])) ? $_GET['term'] : '';\n if ($autocomplete!='') {\n $where = '';\n $concat = '';\n $items = explode('_', $this->id);\n foreach ($items as $itemIns) {\n $item = $this->object->attributeInfo($itemIns);\n $name = (string)$item->name;\n if (is_object($item) && $name!='') {\n $concat .= $name.',\" \",';\n $where .= $name.' LIKE \"%'.$autocomplete.'%\" OR ';\n }\n }\n $where = substr($where, 0, -4);\n $concat = 'CONCAT('.substr($concat, 0, -5).')';\n if ($where!='') {\n $query = 'SELECT '.(string)$this->object->info->info->sql->primary.' as idItem, \n '.$concat.' as infoItem\n FROM '.Db::prefixTable($this->type).'\n WHERE '.$where.'\n ORDER BY '.$name.' LIMIT 20';\n $results = array();\n $resultsAll = Db::returnAll($query);\n foreach ($resultsAll as $result) {\n $resultsIns = array();\n $resultsIns['id'] = $result['idItem'];\n $resultsIns['value'] = $result['infoItem'];\n $resultsIns['label'] = $result['infoItem'];\n array_push($results, $resultsIns);\n }\n return json_encode($results); \n }\n }\n break;\n case 'search':\n /**\n * This is the action that does the default \"search\" on a content object.\n */\n $this->checkLoginAdmin();\n if ($this->id != '') {\n $this->content = $this->listAdmin();\n return $ui->render();\n } else {\n if (isset($this->values['search']) && $this->values['search']!='') {\n $searchString = urlencode(html_entity_decode($this->values['search']));\n header('Location: '.url($this->type.'/search/'.$searchString, true));\n } else {\n header('Location: '.url($this->type.'/listAdmin', true));\n } \n }\n break;\n case 'export-json':\n /**\n * This is the action that exports the complete list of objects in JSON format.\n */\n $this->mode = 'ajax';\n $query = 'SELECT * FROM '.Db::prefixTable($this->type);\n $items = Db::returnAll($query);\n $file = $this->type.'.json';\n $options = array('content'=>json_encode($items), 'contentType'=>'application/json');\n File::download($file, $options);\n return '';\n break;\n }\n }",
"function mod_core_admin() {\n\t\tglobal $NeptuneCore;\n\t\tglobal $NeptuneSQL;\n\t\tglobal $NeptuneAdmin;\n\t\t\n\t\tif (!isset($NeptuneCore)) {\n\t\t\t$NeptuneCore = new NeptuneCore();\n\t\t}\t\n\t\tif (!isset($NeptuneSQL)) {\n\t\t\t$NeptuneSQL = new NeptuneSQL();\n\t\t}\t\n\t\tif (!isset($NeptuneAdmin)) {\n\t\t\t$NeptuneAdmin = new NeptuneAdmin();\n\t\t}\t\n\t\t\n\t\t\n\t\tif (neptune_get_permissions() >= 3) {\n\t\t\t$query = $NeptuneCore->var_get(\"system\",\"query\");\n\t\t\tif (@isset($query[1]) && @isset($query[2])) {\n\t\t\t\t$AdminFunction = \"acp_\" . $query[1] . \"_\" . $query[2];\n\t\t\t\t\n\t\t\t\t$AdminFunction();\n\t\t\t} else {\n\t\t\t\t$NeptuneAdmin->run();\n\t\t\t}\n\t\t} else {\n\t\t\t$NeptuneCore->title($NeptuneCore->var_get(\"locale\",\"accessdenied\"));\n\t\t\t$NeptuneCore->neptune_echo(\"<p>\" . $NeptuneCore->var_get(\"locale\",\"nopermission\") . \"</p>\");\n\t\t\t\n\t\t\theader(\"HTTP/1.1 403 Forbidden\");\n\t\t}\n\t}",
"public function\n\t\tdo_actions()\n\t{\n\t}",
"public function actionAdmin()\n\t{ \n\t\t$this->render('review_admin');\n\t}",
"function action_admin(&$handler)\n {\n // Access control\n if (!$this->allowed(\"any_project\"))\n {\n $user = getUser();\n $this->addFilter(\"project.coordinator=\".$user[\"id\"]);\n }\n return $handler->action_admin();\n }",
"function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}",
"public function admin_page()\n {\n }",
"public function admin_page()\n {\n }",
"function xanthia_admin_main()\n{\n\t/** Security check - important to do this as early as possible to avoid\n\t* potential security holes or just too much wasted processing. For the\n\t* main function we want to check that the user has at least edit privilege\n\t* for some item within this component, or else they won't be able to do\n\t* anything and so we refuse access altogether. The lowest level of access\n\t* for administration depends on the particular module, but it is generally\n\t* either 'edit' or 'delete'\n\t*/\n if (!pnSecAuthAction(0, 'Xanthia::', '::', ACCESS_EDIT)) {\n return pnVarPrepHTMLDisplay(_MODULENOAUTH);\n }\n // Load user API\n\tif (!pnModAPILoad('Xanthia','user')) {\t \n pnSessionSetVar('errormsg', pnVarPrepHTMLDisplay(_XA_APILOADFAILED));\n pnRedirect(pnModURL('Xanthia', 'admin', 'view'));\n return true;\n\t}\n // Return the Admin View Function\n\t//return xanthia_adminmenu();\n\treturn xanthia_admin_view();\n}",
"public function actionAdmin() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$this->setCurrentNode($this->currentContent->node);\n\t\t\t$content = new FormContent();\n\t\t\t$content->targetContentId = $this->currentContent->contentId;\n\t\t\t$content->selected = false;\n\n\t\t\t$contentCriteriaBuilder = new CriteriaBuilder('content');\n\t\t\t$contentCriteriaBuilder->filterBy('contentId', $this->currentContent->contentId);\n\n\t\t\t$this->render('admin', array(\n\t\t\t\t'breadcrumb' => $this->buildBreadcrumb($this->currentContent->contentId),\n\t\t\t\t'mainMenu' => $this->buildMainMenu(2, 4),\n\t\t\t\t'content'=>$content,\n\t\t\t\t'sourceContent'=>$this->currentContent,\n\t\t\t\t'node' => $this->currentNode,\n\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false))\n\t\t\t));\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function admin()\n {\n $this->view->books = $this->help->getBookList();\n $this->view->title = $this->lang->help->common;\n $this->display();\n }",
"private function actions()\n {\n }",
"public function action_index()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\t// Make sure the administrator has a valid session...\n\t\tvalidateSession();\n\n\t\t// Load the language and templates....\n\t\tTxt::load('Admin');\n\t\ttheme()->getTemplates()->load('Admin');\n\t\tloadCSSFile('admin.css');\n\t\tloadJavascriptFile('admin.js', array(), 'admin_script');\n\n\t\t// The Admin functions require Jquery UI ....\n\t\t$modSettings['jquery_include_ui'] = true;\n\n\t\t// No indexing evil stuff.\n\t\t$context['robot_no_index'] = true;\n\n\t\t// Need these to do much\n\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\n\t\t// Actually create the menu!\n\t\t$admin_include_data = $this->loadMenu();\n\t\t$this->buildLinktree($admin_include_data);\n\n\t\tcallMenu($admin_include_data);\n\t}",
"public function actionAdmin()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->layout = 'admin';\n\n\t\t$this->render('admin');\n\t}",
"protected function processAdminCommand()\n\t{\n\t\tif(isset($_POST['command'], $_POST['id']) && $_POST['command']==='delete')\n\t\t{\n\t\t\t$this->loadarticles($_POST['id'])->delete();\n\t\t\t// reload the current page to avoid duplicated delete actions\n\t\t\t$this->refresh();\n\t\t}\n\t}",
"public function run()\n {\n $editAdmin = new Permission();\n $editAdmin->name = 'edit-admin';\n $editAdmin->display_name = 'Edit admin';\n $editAdmin->description = 'create\\delete\\edit admin';\n $editAdmin->save();\n }",
"public function admin()\n {\n $this->template_admin->displayad('admin');\n }",
"protected function processAdminCommand()\n {\n if(isset($_POST['command'], $_POST['id']) && $_POST['command']==='delete')\n {\n $this->loadPost($_POST['id'])->delete();\n // reload the current page to avoid duplicated delete actions\n $this->refresh();\n }\n }",
"private function process_adminpanel_actions() {\n\n\t\tif(is_admin()) {\n\t\t\t\n\t\t\trequire_once($this->get_plugin_path() . 'settings-panel.php');\n\t\t\t\n\t\t\t// the settings page has detected an error and asked to abort\n\t\t\tif( isset($_POST['wpudisable']) && check_ajax_referer( 'wp-united-disable') ) {\n\t\t\t\t$this->ajax_auto_disable();\n\t\t\t}\t\n\n\t\t\t// the user wants to manually disable\n\t\t\tif( isset($_POST['wpudisableman']) && check_ajax_referer( 'wp-united-disable') ) {\n\t\t\t\t$this->ajax_manual_disable();\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t\t$this->extras->admin_load_actions();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"function applicants_admin_actions() {\n //add_menu_page(\"Applicants\", \"Applicants\", 5, \"Applicants\", \"applicants_admin\");\n\tadd_menu_page( 'Applicants', 'Applicants', 'manage_options', 'applicants', 'applicants_admin', '', 27 );\n}",
"public function addActions() {\n\t\t\tadd_action( 'load-toplevel_page_' . Muut::SLUG, array( $this, 'saveSettings' ) );\n\t\t\tadd_action( 'admin_notices', array( $this, 'prepareAdminNotices' ), 9 );\n\t\t\tadd_action( 'admin_notices', array( $this, 'maybeShowReviewRequestNotice' ), 8 );\n\t\t\tadd_action( 'admin_print_scripts', array( $this, 'printJsFieldNames') );\n\t\t}",
"public function actions();",
"function handleAdministration() {\n if (! isset ($_POST[\"adminaction\"])) { // no administration needed\n return;\n }\n\n if (! $_SESSION[\"isadmin\"]) { // user is not admin\n showFrame(\"Příklady může upravovat pouze administrátor!\", false);\n return;\n }\n\n switch ($_POST[\"adminaction\"]) {\n case \"addproblem\":\n addProblem();\n break;\n\n case \"saveproblem\":\n saveProblem();\n break;\n\n case \"deleteproblem\":\n if (! isset ($_POST[\"deletecheck\"])) { // misclick protection\n showFrame(\"Při mazání musí být zaškrtnuto políčko <b>Smazat</b>.\", false);\n return;\n }\n deleteProblem();\n break;\n\n default:\n showFrame(\"Neplatná hodnota položky <b>adminaction</b>\", false);\n return;\n }\n}",
"public function showAdminAction()\n {\n header (\"location: admin.php?route=adminAccueil\");\n }",
"function bit_admin_page() {\n\t//Creates admin page\n}",
"public function register_admin_page_and_actions() {\n\t\t\tif ( ! current_user_can( 'manage_options' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_action( 'woocommerce_order_action_omise_charge_capture', array( Omise_Hooks::get_instance(), 'charge_capture' ) );\n\t\t\tadd_action( 'admin_post_omise_create_transfer', array( $this, 'create_transfer' ) );\n\t\t\tadd_action( 'admin_post_nopriv_omise_create_transfer', array( $this, 'no_op' ) );\n\t\t\tadd_action( 'admin_menu', array( $this, 'add_dashboard_omise_menu' ) );\n\t\t}"
]
| [
"0.7486889",
"0.74639404",
"0.74639404",
"0.74639404",
"0.7403594",
"0.7384273",
"0.7312174",
"0.72075444",
"0.7111299",
"0.70919883",
"0.7080682",
"0.7080682",
"0.70685196",
"0.7060694",
"0.7055712",
"0.7054082",
"0.7036679",
"0.7033978",
"0.6991749",
"0.6977186",
"0.6931085",
"0.6875028",
"0.6868544",
"0.68526393",
"0.68477005",
"0.68284655",
"0.6825193",
"0.68163025",
"0.6803904",
"0.68007994"
]
| 0.8185939 | 1 |
Do actions on current admin page | protected function admin_page_action() {
if ( $this->is_admin_request_for_users_forget() ) {
$this->users_forget();
}
if ( $this->is_admin_request_for_users_send_email() ) {
$this->users_send_email();
}
if ( $this->is_admin_request_for_users_remove() ) {
$this->users_remove_from_list();
}
/* Default settings page */
$this->add_view_option( 'data', $this->get_all_requested_users_data( $confirmed_only = true ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function admin_action() {\n\t}",
"public function admin_action() {\n\t}",
"public function admin_page()\n {\n }",
"public function admin_page()\n {\n }",
"public function admin_page()\n {\n echo $this->return_admin_page();\n }",
"function admin()\n{\n global $app;\n\n $app->render('admin.html', [\n 'page' => mkPage(getMessageString('admin'), 0, 1),\n 'isadmin' => is_admin()]);\n}",
"public static function adminPage(){\n\t\tif(!self::isAdmin()){\n\t\t\theader(\"Location: index.php\");\n\t\t\texit;\n\t\t}\n\t}",
"protected function admin_page_action() {\n\n\t\tif ( $this->is_request_consents_log() ) {\n\t\t\t$this->download_consents_log();\n\t\t}\n\n\t}",
"public function showAdminAction()\n {\n header (\"location: admin.php?route=adminAccueil\");\n }",
"public function admin()\n {\n $this->template_admin->displayad('admin');\n }",
"function bit_admin_page() {\n\t//Creates admin page\n}",
"public function admin_page()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n echo $this->return_admin_page();\n }",
"public function show_admin_page() {\n\t\t$this->view->render();\n\t}",
"public function action_index()\n\t{\n\t\tglobal $context, $modSettings;\n\n\t\t// Make sure the administrator has a valid session...\n\t\tvalidateSession();\n\n\t\t// Load the language and templates....\n\t\tTxt::load('Admin');\n\t\ttheme()->getTemplates()->load('Admin');\n\t\tloadCSSFile('admin.css');\n\t\tloadJavascriptFile('admin.js', array(), 'admin_script');\n\n\t\t// The Admin functions require Jquery UI ....\n\t\t$modSettings['jquery_include_ui'] = true;\n\n\t\t// No indexing evil stuff.\n\t\t$context['robot_no_index'] = true;\n\n\t\t// Need these to do much\n\t\trequire_once(SUBSDIR . '/Admin.subs.php');\n\n\t\t// Actually create the menu!\n\t\t$admin_include_data = $this->loadMenu();\n\t\t$this->buildLinktree($admin_include_data);\n\n\t\tcallMenu($admin_include_data);\n\t}",
"static function adminMenuPage()\n {\n // Include the view for this menu page.\n include PROJECTEN_PLUGIN_ADMIN_VIEWS_DIR . '/admin_main.php';\n }",
"protected function adminAction()\n {\n $this->requestCallback();\n\n $url = \\add_query_arg(\n [self::NOTICE => 1],\n \\remove_query_arg(\n [RestDispatch::QUERY_CACHE_DELETE, RestDispatch::QUERY_CACHE_REFRESH],\n \\wp_get_referer()\n )\n );\n \\wp_safe_redirect($url);\n exit;\n }",
"function applicants_admin_actions() {\n //add_menu_page(\"Applicants\", \"Applicants\", 5, \"Applicants\", \"applicants_admin\");\n\tadd_menu_page( 'Applicants', 'Applicants', 'manage_options', 'applicants', 'applicants_admin', '', 27 );\n}",
"function printAdminPage() {\n require ('adminPage.php');\n adminPage($this);\n }",
"public function actionAdmin()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->layout = 'admin';\n\n\t\t$this->render('admin');\n\t}",
"function admin_page() {\n\t\t$this->maybe_authorize();\n?>\n\t\t<div class=\"wrap ghupdate-admin\">\n\n\t\t\t<div class=\"head-wrap\">\n\t\t\t\t<?php screen_icon( 'plugins' ); ?>\n\t\t\t\t<h2><?php _e( 'Setup GitHub Updates' , 'github_plugin_updater' ); ?></h2>\n\t\t\t</div>\n\n\t\t\t<div class=\"postbox-container primary\">\n\t\t\t\t<form method=\"post\" id=\"ghupdate\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\tsettings_errors();\n\t\tsettings_fields( 'ghupdate' ); // includes nonce\n\t\tdo_settings_sections( 'github-updater' );\n?>\n\t\t\t\t</form>\n\t\t\t</div>\n\n\t\t</div>\n\t\t<?php\n\t}",
"public function admin_menu(): void {\n\t\tif ( is_plugin_active_for_network( plugin_basename( WP_SENTRY_PLUGIN_FILE ) ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tadd_management_page(\n\t\t\t'WP Sentry test',\n\t\t\t'WP Sentry test',\n\t\t\t'activate_plugins',\n\t\t\tself::ADMIN_PAGE_SLUG,\n\t\t\t[ $this, 'render_admin_page' ]\n\t\t);\n\t}",
"function mmf_admin() {\n\t\tinclude('mmf_admin_page.php');\n\t}",
"private function process_frontend_actions() {\n\t\t\n\t\tif(is_admin()) {\n\t\t\treturn;\n\t\t}\n\n\t\tif($this->is_working() && is_object($this->extras)) {\n\t\t\t$this->extras->page_load_actions();\n\t\t}\n\n\t\n\t}",
"public function adminPanel() {\n $posts = $this->postManager->getPosts();\n $comments = $this->commentManager->getFlaggedComments();\n $view = new View(\"Administration\");\n $view->generate(array('posts' => $posts, 'comments' => $comments));\n }",
"public function controlActions(){\n // Check if the tables are created.\n $this->mode = 'admin';\n $this->object = new $this->type();\n $this->titlePage = __((string)$this->object->info->info->form->title);\n $this->layout = (string)$this->object->info->info->form->layout;\n $this->menuInside = $this->menuInside();\n $ui = new NavigationAdmin_Ui($this);\n switch ($this->action) {\n default:\n header('Location: '.url($this->type.'/listAdmin', true));\n exit();\n break;\n case 'listAdmin':\n /**\n * This is the main action for the BackEnd. If we are in DEBUG mode\n * it will create the table automatically.\n */\n $this->checkLoginAdmin();\n $this->content = $this->listAdmin();\n return $ui->render();\n break;\n case 'insertView':\n /**\n * This is the action that shows the form to insert a record in the BackEnd.\n */\n $this->checkLoginAdmin();\n $this->content = $this->insertView();\n return $ui->render();\n break;\n case 'insert':\n /**\n * This is the action that inserts a record in the BackEnd.\n * If the insertion is successful it shows a form to check the record,\n * if not it creates a form with the errors to correct.\n */\n $this->checkLoginAdmin();\n $insert = $this->insert();\n if ($insert['success']=='1') {\n header('Location: '.url($this->type.'/insertCheck/'.$insert['id'], true));\n exit();\n } else {\n $this->messageError = __('errorsForm');\n $this->content = $insert['html'];\n return $ui->render();\n }\n break;\n case 'modifyView':\n case 'modifyViewCheck':\n case 'insertCheck':\n /**\n * This is the action that shows the form to check a record insertion.\n */\n $this->checkLoginAdmin();\n $this->message = ($this->action=='insertCheck' || $this->action=='modifyViewCheck') ? __('savedForm') : '';\n $this->content = $this->modifyView();\n return $ui->render();\n break;\n case 'modifyViewNested':\n /**\n * This is the action that shows the form to modify a record.\n */\n $this->checkLoginAdmin();\n $this->object = $this->object->readObject($this->id);\n $uiObjectName = $this->type.'_Ui';\n $uiObject = new $uiObjectName($this->object);\n $values = array_merge($this->object->valuesArray(), $this->values);\n $this->content = $uiObject->renderForm(array_merge(\n array('values'=>$values,\n 'action'=>url($this->type.'/modifyNested', true),\n 'class'=>'formAdmin formAdminModify',\n 'nested'=>true),\n array()));\n return $ui->render();\n break;\n case 'modify':\n case 'modifyNested':\n /**\n * This is the action that updates a record when updating it.\n */\n $this->checkLoginAdmin();\n $nested = ($this->action == 'modifyNested') ? true : false;\n $modify = $this->modify($nested);\n if ($modify['success']=='1') {\n if (isset($this->values['submit-saveCheck'])) {\n header('Location: '.url($this->type.'/modifyViewCheck/'.$modify['id'], true));\n } else {\n header('Location: '.url($this->type.'/listAdmin', true));\n }\n exit();\n } else {\n $this->messageError = __('errorsForm');\n $this->content = $modify['html'];\n return $ui->render();\n }\n break;\n case 'delete':\n /**\n * This is the action that deletes a record.\n */\n $this->checkLoginAdmin();\n if ($this->id != '') {\n $type = new $this->type();\n $object = $type->readObject($this->id);\n $object->delete();\n }\n header('Location: '.url($this->type.'/listAdmin', true));\n exit();\n break;\n case 'sortSave':\n /**\n * This is the action that saves the order of a list of records.\n * It is used when sorting using the BackEnd.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n $object = new $this->type();\n $newOrder = (isset($this->values['newOrder'])) ? $this->values['newOrder'] : array();\n $object->updateOrder($newOrder);\n break;\n case 'sortList':\n /**\n * This is the action that changes the order of the list.\n */\n $this->checkLoginAdmin();\n $object = new $this->type();\n $info = explode('_', $this->id);\n if (isset($info[1]) && $object->attributeInfo($info[1])!='') {\n $orderType = ($info[0]=='asc') ? 'asc' : 'des';\n Session::set('ord_'.$this->type, $orderType.'_'.$info[1]);\n }\n header('Location: '.url($this->type, true));\n exit();\n break;\n case 'addSimple':\n /**\n * This is the action that adds a simple record.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n $formObject = $this->type.'_Form';\n $form = new $formObject();\n return $form->createFormFieldMultiple();\n break;\n case 'multiple-delete':\n /**\n * This is the action that deletes multiple records at once.\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n if (isset($this->values['list-ids'])) {\n $type = new $this->type();\n foreach ($this->values['list-ids'] as $id) {\n $object = $type->readObject($id);\n $object->delete();\n }\n }\n break;\n case 'multiple-activate':\n case 'multiple-deactivate':\n /**\n * This is the action that activates or deactivates multiple records at once.\n * It just works on records that have an attribute named \"active\",\n */\n $this->checkLoginAdmin();\n $this->mode = 'ajax';\n if (isset($this->values['list-ids'])) {\n $primary = (string)$this->object->info->info->sql->primary;\n $where = '';\n foreach ($this->values['list-ids'] as $id) {\n $where .= $primary.'=\"'.$id.'\" OR ';\n }\n $where = substr($where, 0, -4);\n $active = ($this->action == 'multiple-activate') ? '1' : '0';\n $query = 'UPDATE '.Db::prefixTable($this->type).' SET active=\"'.$active.'\" WHERE '.$where;\n Db::execute($query);\n }\n break;\n case 'autocomplete':\n /**\n * This is the action that returns a json string with the records that match a search string.\n * It is used for the autocomplete text input.\n */\n $this->mode = 'json';\n $autocomplete = (isset($_GET['term'])) ? $_GET['term'] : '';\n if ($autocomplete!='') {\n $where = '';\n $concat = '';\n $items = explode('_', $this->id);\n foreach ($items as $itemIns) {\n $item = $this->object->attributeInfo($itemIns);\n $name = (string)$item->name;\n if (is_object($item) && $name!='') {\n $concat .= $name.',\" \",';\n $where .= $name.' LIKE \"%'.$autocomplete.'%\" OR ';\n }\n }\n $where = substr($where, 0, -4);\n $concat = 'CONCAT('.substr($concat, 0, -5).')';\n if ($where!='') {\n $query = 'SELECT '.(string)$this->object->info->info->sql->primary.' as idItem, \n '.$concat.' as infoItem\n FROM '.Db::prefixTable($this->type).'\n WHERE '.$where.'\n ORDER BY '.$name.' LIMIT 20';\n $results = array();\n $resultsAll = Db::returnAll($query);\n foreach ($resultsAll as $result) {\n $resultsIns = array();\n $resultsIns['id'] = $result['idItem'];\n $resultsIns['value'] = $result['infoItem'];\n $resultsIns['label'] = $result['infoItem'];\n array_push($results, $resultsIns);\n }\n return json_encode($results); \n }\n }\n break;\n case 'search':\n /**\n * This is the action that does the default \"search\" on a content object.\n */\n $this->checkLoginAdmin();\n if ($this->id != '') {\n $this->content = $this->listAdmin();\n return $ui->render();\n } else {\n if (isset($this->values['search']) && $this->values['search']!='') {\n $searchString = urlencode(html_entity_decode($this->values['search']));\n header('Location: '.url($this->type.'/search/'.$searchString, true));\n } else {\n header('Location: '.url($this->type.'/listAdmin', true));\n } \n }\n break;\n case 'export-json':\n /**\n * This is the action that exports the complete list of objects in JSON format.\n */\n $this->mode = 'ajax';\n $query = 'SELECT * FROM '.Db::prefixTable($this->type);\n $items = Db::returnAll($query);\n $file = $this->type.'.json';\n $options = array('content'=>json_encode($items), 'contentType'=>'application/json');\n File::download($file, $options);\n return '';\n break;\n }\n }",
"public function actionAdmin() {\n\t\ttry {\n\t\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.structure.controllers');\n\t\t\t$this->setCurrentNode($this->currentContent->node);\n\t\t\t$content = new FormContent();\n\t\t\t$content->targetContentId = $this->currentContent->contentId;\n\t\t\t$content->selected = false;\n\n\t\t\t$contentCriteriaBuilder = new CriteriaBuilder('content');\n\t\t\t$contentCriteriaBuilder->filterBy('contentId', $this->currentContent->contentId);\n\n\t\t\t$this->render('admin', array(\n\t\t\t\t'breadcrumb' => $this->buildBreadcrumb($this->currentContent->contentId),\n\t\t\t\t'mainMenu' => $this->buildMainMenu(2, 4),\n\t\t\t\t'content'=>$content,\n\t\t\t\t'sourceContent'=>$this->currentContent,\n\t\t\t\t'node' => $this->currentNode,\n\t\t\t\t'contentsDataProvider' => $contentCriteriaBuilder->getActiveDataProvider(array('pagination' => false))\n\t\t\t));\n\t\t} catch(\\Exception $e) {\n\t\t\t\\Yii::log('Error in '.__METHOD__.'():'.$e->getMessage(), \\CLogger::LEVEL_ERROR, 'sweelix.yii1.admin.structure.controllers');\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function onWpAdminMenu() {\n\t}",
"public function actionAdmin()\n\t{ \n\t\t$this->render('review_admin');\n\t}",
"function admin_menu() {\n\t\t// The designation of add_MANAGEMENT_page causes the menu item to be listed under the Tools menu!\n\t\tadd_management_page('Revitalize Orders Output', 'Revitalize Orders', 'edit_posts', basename(__FILE__), array(&$this, 'page_handler'));\n\t}",
"public function admin(){\n $data = array('page_title' => \"Admin home\");\n $this->view->load_admin('home/admin/admin_view', $data);\n }"
]
| [
"0.7926917",
"0.7926917",
"0.7726415",
"0.7726415",
"0.75909704",
"0.7350135",
"0.73453164",
"0.7267171",
"0.7241369",
"0.7193779",
"0.71916485",
"0.71876395",
"0.7171077",
"0.7147655",
"0.7136436",
"0.7100959",
"0.7098184",
"0.70682746",
"0.7062668",
"0.7031725",
"0.7013843",
"0.6993499",
"0.6964934",
"0.69626397",
"0.6953181",
"0.69435465",
"0.69369644",
"0.69241834",
"0.691544",
"0.69062227"
]
| 0.8042913 | 0 |
Update options for legacy structure | public function legacy_update() {
/* Request data was moved from controller option to requests option in v1.1 */
// get legacy requests data
$legacy_requests = $this->get_option( 'requests', array() );
// something to update
if ( $legacy_requests && is_array( $legacy_requests ) ) {
// new requests structure
$requests = get_option( $this->get_requests_option_key(), array() );
// merge requests
$requests = array_merge( $legacy_requests, $requests );
// fill new structure with data
update_option( $this->get_requests_option_key(), $requests );
}
// destroy old structure data
if ( $legacy_requests ) {
$options = get_option( $this->get_id(), array() );
unset( $options['requests'] );
update_option( $this->get_id(), $options );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateOptions()\r\n {\r\n if ($_SERVER['REQUEST_METHOD'] !== 'POST')\r\n return;\r\n\r\n update_option('ohs_newsletter_sendgrid_api', $_POST['ohs_newsletter_sendgrid_api']);\r\n update_option('ohs_newsletter_sendgrid_list', $_POST['ohs_newsletter_sendgrid_list']);\r\n update_option('ohs_newsletter_redirect', $_POST['ohs_newsletter_redirect']);\r\n }",
"public function updateOptions(array $options);",
"public function options_update() {\n\t\tregister_setting( $this->plugin_name, $this->plugin_name, array($this, 'validate', 'default' => array( \"url_nerd_instance\" => \"\", \"category_weight\" => \"0.04\", \"entity_weight\" => \"0.7\" ) ) );\n\t}",
"function deprecated_options() {\n\t \tif (empty($this->wpt_style_options)) {\n\t\t \t$this->wpt_style_options = get_option( 'theatre' );\n\t \t}\n\t \tif (empty($this->wpt_tickets_options)) {\n\t\t \t$this->wpt_tickets_options = get_option( 'theatre' );\n\t \t}\n \t}",
"public function update_options() {\n include $this->migrations_file;\n\n // default settings to use for updating options\n $settings_defaults = array(\n 'serialized' => false,\n 'mode' => 'update',\n 'options' => '',\n );\n\n // make the migrations\n foreach ($options_to_update as $option_name => $settings) {\n $settings = wp_parse_args($settings, $defaults);\n $option = get_option($option_name);\n $new_data = array();\n $updated_data = null;\n\n // data is serialized\n if ($settings['serialized']) {\n $old_data = maybe_unserialize($option);\n $new_data = maybe_unserialize($settings['data']);\n\n // update options\n if ($data['mode'] == 'update') {\n $updated_data = serialize(wp_parse_args($new_data, $old_data));\n }\n\n // completely replace options\n else {\n $updated_data = serialize($new_data);\n }\n }\n\n // data is int/string/bool\n else {\n $updated_data = $settings['data'];\n }\n\n if ($updated_data) {\n update_option($option_name, $updated_data);\n }\n }\n\n update_option('dkomigrate_timestamp', $this->migrations_file_mtime);\n add_action('admin_notices', array($this, 'notice_migration_successful'));\n }",
"function bf_update_options() {\r\n\tglobal $bf_options;\r\n\tupdate_option(THEME_ID . '_options', maybe_serialize($bf_options));\r\n}",
"protected function adjustOptionsValues()\n {\n $this->init();\n $this->create();\n }",
"private static function setOptions( $options ){\n\n\t\t$general_options = $options[ WPC_OPTIONS ];\n\t\t$general_options[ 'WPC_VERSION' ] = WPC_VERSION;\n\t\t$general_options_old = get_option( WPC_OPTIONS );\n\n\t\t// make sure the general app settings are kept if they had been set\n\t\tif ( isset( $general_options_old[ WPC_OPTIONS_APP_ID ] ) ){\n\t\t\t$general_options[ WPC_OPTIONS_APP_ID ] = $general_options_old[ WPC_OPTIONS_APP_ID ];\n\t\t}\n\t\tif ( isset( $general_options_old[ WPC_OPTIONS_APP_ADMINS ] ) ){\n\t\t\t$general_options[ WPC_OPTIONS_APP_ADMINS ] = $general_options_old[ WPC_OPTIONS_APP_ADMINS ];\n\t\t}\n\t\tif ( isset( $general_options_old[ WPC_OPTIONS_IMAGE_URL ] ) ){\n\t\t\t$general_options[ WPC_OPTIONS_IMAGE_URL ] = $general_options_old[ WPC_OPTIONS_IMAGE_URL ];\n\t\t}\n\t\tif ( isset( $general_options_old[ WPC_OPTIONS_DESCRIPTION ] ) ){\n\t\t\t$general_options[ WPC_OPTIONS_DESCRIPTION ] = $general_options_old[ WPC_OPTIONS_DESCRIPTION ];\n\t\t}\n\n\t\tupdate_option( WPC_OPTIONS, $general_options );\n\t\tupdate_option( WPC_OPTIONS_COMMENTS, $options[ WPC_OPTIONS_COMMENTS ] );\n\t\tupdate_option( WPC_OPTIONS_LIKE_BUTTON, $options[ WPC_OPTIONS_LIKE_BUTTON ] );\n\n\t}",
"function update_all_module_options($mod_name, $new_options) {\n if (is_array($new_options)) {\n $new_options = (object) $new_options;\n }\n $this->modules->$mod_name->options = $new_options;\n $this->$mod_name->module = $this->modules->$mod_name;\n return update_option($this->clientele_prefix . $mod_name . '_options', (array) $this->modules->$mod_name->options);\n }",
"function update_options() {\n\t\tif ( get_current_blog_id() !== $this->options_blog_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\tupdate_option( $this->option_name, $this->options );\n\t}",
"function wpmantis_update_options()\n{\n\t$options = get_option('wp_mantis_options');\n\n\t$options['mantis_user'] = $_REQUEST['mantis_user'];\n\t$options['mantis_password'] = $_REQUEST['mantis_password'];\n\t$options['mantis_soap_url'] = $_REQUEST['mantis_soap_url'];\n\t$options['mantis_base_url'] = $_REQUEST['mantis_base_url'];\n\t$options['mantis_max_desc_lenght'] = $_REQUEST['mantis_max_desc_lenght'];\n\t$options['mantis_enable_pagination'] = isset($_REQUEST['mantis_enable_pagination']);\n\t$options['mantis_bugs_per_page'] = $_REQUEST['mantis_bugs_per_page'];\n\t$options['mantis_colors'] = $_REQUEST['color'];\n\t\n\t//Check to see that the base URL ends with a trailing slash if not, add it\n\tif (substr($options['mantis_base_url'], -1, 1) != '/') { $options['mantis_base_url'] .= '/'; }\n\n\tupdate_option('wp_mantis_options', $options);\n\n\t?>\n\t<div id=\"message\" class=\"updated fade\">\n\t<p><?php _e('Options saved.', 'wp-mantis'); ?></p>\n\t</div>\n\t<?php\n}",
"public static function init_update()\n {\n\n $used_infos = EPFLQuota::get_usage_on_disk();\n\n /* If option is not in database, */\n if(!($current_usage = get_option(self::OPTION_USAGE)))\n {\n /* We create data to add it to db */\n $current_usage = [self::OPTION_USAGE_VERSION => self::CURRENT_DATA_VERSION,\n self::OPTION_USAGE_USED => $used_infos[self::OPTION_USAGE_USED],\n self::OPTION_USAGE_NB_FILES => $used_infos[self::OPTION_USAGE_NB_FILES],\n self::OPTION_USAGE_LIMIT => self::DEFAULT_LIMIT];\n }\n else /* Option exists in DB */\n {\n\n /* TODO: if data structure changes in the future, you will have to check for existing version and update it as needed */\n\n /* We update used size */\n $current_usage[self::OPTION_USAGE_USED] = $used_infos[self::OPTION_USAGE_USED];\n $current_usage[self::OPTION_USAGE_NB_FILES] = $used_infos[self::OPTION_USAGE_NB_FILES];\n }\n\n /* Setting information in DB */\n EPFLQuota::set_current_usage($current_usage);\n\n }",
"public static function getOldVersionOptions(){\n\n\t\t$options = WordpressConnect::getDefaultOptions();\n\n\t\t// general options\n\t\t$language = get_option( WPC_OPTIONS_LANGUAGE );\n\t\tif ( $language !== FALSE ){\n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_LANGUAGE ] = $language; \n\t\t\tdelete_option( WPC_OPTIONS_LANGUAGE ); \n\t\t}\n\n\t\t$app_id = get_option( WPC_OPTIONS_APP_ID );\n\t\tif ( $app_id !== FALSE ){ \n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_APP_ID ] = $app_id;\n\t\t\tdelete_option( WPC_OPTIONS_APP_ID ); \n\t\t}\n\n\t\t$app_admins = get_option( WPC_OPTIONS_APP_ADMINS );\n\t\tif ( $app_admins !== FALSE ){ \n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_APP_ADMINS ] = $app_admins;\n\t\t\tdelete_option( WPC_OPTIONS_APP_ADMINS ); \n\t\t}\n\n\t\t$image = get_option( WPC_OPTIONS_IMAGE_URL );\n\t\tif ( $image !== FALSE ){ \n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_IMAGE_URL ] = $image;\n\t\t\tdelete_option( WPC_OPTIONS_IMAGE_URL ); \n\t\t}\n\n\t\t$description = get_option( WPC_OPTIONS_DESCRIPTION );\n\t\tif ( $description !== FALSE ){\n\t\t\t$options[ WPC_OPTIONS ][ WPC_OPTIONS_DESCRIPTION ] = $description;\n\t\t\tdelete_option( WPC_OPTIONS_DESCRIPTION ); \n\t\t}\n\n\t\t// comments\n\n\t\t$comments_number = get_option( WPC_OPTIONS_COMMENTS_NUMBER );\n\t\tif ( $comments_number !== FALSE && is_int( $comments_number ) ){\n\t\t\t$options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_COMMENTS_NUMBER ] = $comments_number;\n\t\t\tdelete_option( WPC_OPTIONS_COMMENTS_NUMBER );\n\t\t}\n\n\t\t$comments_width = get_option( WPC_OPTIONS_COMMENTS_WIDTH );\n\t\tif ( $comments_width !== FALSE && is_int( $comments_width ) ){\n\t\t\t$options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_COMMENTS_WIDTH ] = $comments_width;\n\t\t\tdelete_option( WPC_OPTIONS_COMMENTS_WIDTH );\n\t\t}\n\n\t\t$comments_display_homepage = get_option( WPC_OPTIONS_COMMENTS_SHOW_ON_HOMEPAGE );\n\t\tif ( $comments_display_homepage !== FALSE && !empty( $comments_display_homepage ) ){\n\t\t\t$options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_DISPLAY_HOMEPAGE ] = 'on';\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_DISPLAY_HOMEPAGE ] = ''; }\n\t\tdelete_option( WPC_OPTIONS_COMMENTS_SHOW_ON_HOMEPAGE );\n\n\t\t$comments_display_categories = get_option( WPC_OPTIONS_COMMENTS_SHOW_ON_CATEGORIES );\n\t\tif ( $comments_display_homepage !== FALSE && !empty( $comments_display_homepage ) ){\n\t\t\t$options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_DISPLAY_CATEGORIES ] = 'on';\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_COMMENTS ][ WPC_OPTIONS_DISPLAY_CATEGORIES ] = ''; }\n\t\tdelete_option( WPC_OPTIONS_COMMENTS_SHOW_ON_CATEGORIES );\n\t\t\n\t\t// like button\n\n\t\t$like_layout = get_option( WPC_OPTIONS_LIKE_BUTTON_LAYOUT );\n\t\tif ( $like_layout !== FALSE ){ \n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_LAYOUT ] = $like_layout; \n\t\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_LAYOUT );\n\t\t}\n\n\t\t$like_width = get_option( WPC_OPTIONS_LIKE_BUTTON_WIDTH );\n\t\tif ( $like_width !== FALSE && is_int( $like_width ) ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_COMMENTS_WIDTH ] = $like_width;\n\t\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_WIDTH );\n\t\t}\n\n\t\t$like_show_faces = get_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_FACES );\n\t\tif ( $like_show_faces !== FALSE && !empty( $like_show_faces ) ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_FACES ] = WPC_OPTION_ENABLED;\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_FACES ] = WPC_OPTION_DISABLED; }\n\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_FACES );\n\t\t\n\t\t$like_verb = get_option( WPC_OPTIONS_LIKE_BUTTON_VERB );\n\t\tif ( $like_verb !== FALSE ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_VERB ] = $like_verb;\n\t\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_VERB );\n\t\t}\n\n\t\t$like_font = get_option( WPC_OPTIONS_LIKE_BUTTON_FONT );\n\t\tif ( $like_font !== FALSE ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_LIKE_BUTTON_FONT ] = $like_font;\n\t\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_FONT );\n\t\t}\n\n\t\t$like_display_homepage = get_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_ON_HOMEPAGE );\n\t\tif ( $like_display_homepage !== FALSE && !empty( $like_display_homepage ) ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_DISPLAY_HOMEPAGE ] = 'on';\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_DISPLAY_HOMEPAGE ] = ''; }\n\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_ON_HOMEPAGE );\n\n\n\t\t$like_display_categories = get_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_ON_CATEGORIES );\n\t\tif ( $like_display_categories !== FALSE && !empty( $like_display_categories ) ){\n\t\t\t$options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_DISPLAY_CATEGORIES ] = 'on';\n\t\t}\n\t\telse { $options[ WPC_OPTIONS_LIKE_BUTTON ][ WPC_OPTIONS_DISPLAY_CATEGORIES ] = ''; }\n\t\tdelete_option( WPC_OPTIONS_LIKE_BUTTON_SHOW_ON_CATEGORIES );\n\t\t\n\t\treturn $options;\n\n\t}",
"function handleOptions ()\n\t{\n\t\t$default_options = $this->default_options;\n\n\t\t// Get options from WP options\n\t\t$options_from_table = get_option( $this->db_options_name_core );\n\n\t\tif ( empty( $options_from_table ) ) {\n\t\t\t$options_from_table = $this->default_options; // New installation\n\t\t} else {\n\n\t\t\t// As of version 2.2 I changed the way I store the default options.\n\t\t\t// I need to upgrade the options before setting the options but we don't update the version yet.\n\t\t\tif ( ! $options_from_table['general'] ) {\n\t\t\t\t$this->upgradeDefaultOptions_2_2();\n\t\t\t\t$options_from_table = get_option( $this->db_options_name_core ); // Get the new options\n\t\t\t}\n\n\t\t\t// Update default options by getting not empty values from options table\n\t\t\tforeach ( $default_options as $section_key => $section_array ) {\n\t\t\t\tforeach ( $section_array as $name => $value ) {\n\n\t\t\t\t\tif ( isset( $options_from_table[$section_key][$name] ) && (! is_null( $options_from_table[$section_key][$name] )) ) {\n\t\t\t\t\t\tif ( is_int( $value ) ) {\n\t\t\t\t\t\t\t$default_options[$section_key][$name] = ( int ) $options_from_table[$section_key][$name];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$default_options[$section_key][$name] = $options_from_table[$section_key][$name];\n\t\t\t\t\t\t\tif ( 'associated_id' == $name ) {\n\t\t\t\t\t\t\t\tif ( 'blogavirtualh-20' == $options_from_table[$section_key][$name] )\n\t\t\t\t\t\t\t\t\t$default_options[$section_key][$name] = 'avh-amazon-20';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If a newer version is running do upgrades if neccesary and update the database.\n\t\t\tif ( $this->version > $options_from_table['general']['version'] ) {\n\t\t\t\t// Starting with version 2.1 I switched to a new way of storing the widget options in the database. We need to convert these.\n\t\t\t\tif ( $options_from_table['general']['version'] < '2.1' ) {\n\t\t\t\t\t$this->upgradeWidgetOptions_2_1();\n\t\t\t\t}\n\n\t\t\t\tif ( $options_from_table['general']['version'] < '2.4' ) {\n\t\t\t\t\t$this->doRemoveCacheFolder();\n\t\t\t\t}\n\t\t\t\tif ( $options_from_table['general']['version'] < '3.0' ) {\n\t\t\t\t\t$this->upgradeWidgetSettings_3_0();\n\t\t\t\t}\n\n\t\t\t\t// Write the new default options and the proper version to the database\n\t\t\t\t$default_options['general']['version'] = $this->version;\n\t\t\t\tupdate_option( $this->db_options_name_core, $default_options );\n\t\t\t}\n\t\t}\n\t\t// Set the class property for options\n\t\t$this->options = $default_options;\n\t}",
"static public function change_gform_options()\n {\n update_option( 'rg_gforms_disable_css', '1' );\n \tupdate_option( 'rg_gforms_enable_html5', '1' );\n }",
"public function mergeOld()\n\t{\n\t\t$AWD_options = $this->wpdb->get_results(\"SELECT option_name,option_value FROM \".$this->wpdb->options.\" WHERE option_name LIKE '%\".$this->prefix.\"%'\",'OBJECT');\n\t\t$new_options = array();\n\t\t//if we got options here, we need to transfert it in a new array and store it with new way\n\t\tif(count($AWD_options) > 0){\n\t\t\tforeach($AWD_options as $options=>$object){\n\t\t\t\t$option_name = str_ireplace($this->prefix,\"\",$object->option_name);\n\t\t\t\t$new_options[$option_name] = $object->option_value;\n\t\t\t\t//remove all old options form the table options\n\t\t\t\tdelete_option($object->option_name);\n\t\t\t}\n\t\t\tupdate_option($this->filterName,$new_options);\n\t\t}\n\t}",
"public function setOptions()\n\t{\n\t\tupdate_option($this->optionVar, serialize($this->options));\n\t}",
"function updateOptions($optionsArray) {\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_siteicon_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_housekeeping_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_split_room_report_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_unpaid_deposit_report_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_group_bookings_report_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_guest_comments_report_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_bedcounts_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_manual_charge_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_generate_payment_link_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_payment_history_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_payment_history_inv_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_process_refunds_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_refund_history_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_report_settings_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_job_history_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_job_scheduler_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_blacklist_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_online_checkin_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_redirect_to_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_view_log_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_log_directory');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_log_directory_url');\n $this->setOptionIfNotEmpty($optionsArray, 'hbo_run_processor_cmd');\n }",
"static function update_options($options){\n\t \tupdate_option('link_rewriter_options', $options);\n\t }",
"function do_update_options()\r\n{\r\n global $request;\r\n\r\n // User pressed the cancel button\r\n if (isset($request[\"cancelButton\"])) {\r\n header(\"Location: \" . get_base_url() . \"/account/main.php\");\r\n }\r\n\r\n // Check session\r\n check_nagios_session_protector();\r\n\r\n $errmsg = array();\r\n $errors = 0;\r\n\r\n // Get setting values\r\n $settings = grab_request_var(\"settings\", array());\r\n\r\n // Fix checkboxes\r\n $settings[\"enabled\"] = checkbox_binary(grab_array_var($settings, \"enabled\", \"\"));\r\n\r\n // Make sure we have requirements\r\n if (in_demo_mode() == true) {\r\n $errmsg[$errors++] = _(\"Changes are disabled while in demo mode.\");\r\n }\r\n\r\n // Handle errors\r\n if ($errors > 0) {\r\n show_options(true, $errmsg);\r\n }\r\n\r\n // Update options\r\n set_user_meta(0, \"helpsystem_component_options\", serialize($settings), false);\r\n set_user_meta(0, \"helpsystem_component_options_configured\", 1, false);\r\n\r\n show_options(false, _(\"Settings updated.\"));\r\n}",
"public function applyOptions(): void\n {\n if ($this->hasEndpoint()) {\n $this->withOptions(['endpoint' => $this->endpoint]);\n }\n\n $this->setProp('value', $this->attribute);\n $this->setProp('entities', $this->options(), false);\n }",
"function update_option($option, $value, $autoload = \\null)\n {\n }",
"function scs_update_option($data)\n\t{\n\t\treturn update_option(basename(dirname(__FILE__)), $data);\n\t}",
"public function maybe_update_api_urls_options_names() {\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.11', '<' ) ) {\n return;\n }\n\n $old_to_new_option_pair_array = array(\n 'laterpay_api_sandbox_url' => 'laterpay_sandbox_backend_api_url',\n 'laterpay_api_sandbox_web_url' => 'laterpay_sandbox_dialog_api_url',\n 'laterpay_api_live_url' => 'laterpay_live_backend_api_url',\n 'laterpay_api_live_web_url' => 'laterpay_live_dialog_api_url',\n );\n\n foreach ( $old_to_new_option_pair_array as $old_option_name => $new_option_name ) {\n $old_option_value = get_option( $old_option_name );\n\n if ( $old_option_value !== false ) {\n delete_option( $old_option_name );\n add_option( $new_option_name, $old_option_value );\n }\n }\n }",
"protected function setOptions()\n {\n if (in_array('options', $this->with)) {\n $options = Arr::get($this->field, 'options', []);\n\n if(!$options) {\n $newOptions = Arr::get($this->field, 'settings.advanced_options', []);\n\n if(\n !$newOptions\n && Arr::get($this->field,'element') == 'multi_payment_component'\n && Arr::get($this->field,'attributes.type') != 'single'\n ) {\n $pricingOptions = Arr::get($this->field, 'settings.pricing_options', []);\n foreach ($pricingOptions as $pricingOption) {\n $newOptions[] = [\n 'value' => $pricingOption['label'],\n 'label' => $pricingOption['label']\n ];\n }\n }\n\n $options = [];\n if($newOptions) {\n foreach ($newOptions as $option) {\n $value = sanitize_text_field($option['value']);\n $options[$value] = sanitize_text_field($option['label']);\n }\n }\n }\n $this->result[$this->attribute]['options'] = $options;\n }\n return $this;\n }",
"function upgrade_230_options_table()\n {\n }",
"function modify_js_options( $options ) {\n // Addon Options Cleaned Up A Bit (lowest pri)\n //\n if ( $this->slplus->is_CheckTrue( $this->addon->options['hide_bubble'] ) ) {\n\t $this->slplus->SmartOptions->bubblelayout->value = '';\n }\n\n // Options From URL Passing (Second Highest Priority)\n //\n $new_options = array();\n if ( ! empty( $_REQUEST['address'] ) && $this->is_address_passed_by_URL() ) {\n $new_options['immediately_show_locations'] = '1';\n $new_options['use_sensor'] = false;\n }\n\n // Widget Options (Highest Pri)\n //\n $widget_options = array();\n if ( $this->addon->widget->is_initial_widget_search( $_REQUEST ) ) {\n $widget_options = array(\n 'disable_initial_directory' => false ,\n 'immediately_show_locations' => '1' ,\n 'map_initial_display' => 'map',\n 'use_sensor' => false\n );\n\n // Discrete State Output - recenter map\n //\n if ( isset( $_REQUEST['slp_widget']['state'] ) && ! empty( $_REQUEST['slp_widget']['state'] ) ) {\n $widget_options['map_center'] = $_REQUEST['slp_widget']['state'];\n }\n\n // Set Radius\n //\n if ( ( isset( $_REQUEST['widget_address'] ) ) && isset( $_REQUEST['radius'] ) ) {\n $widget_options['initial_radius'] = $_REQUEST['radius'];\n }\n }\n\n if ( empty( $this->addon->options['map_region'] ) ) {\n $this->attribute_special_processing( 'map_region' );\n }\n\n // Lowest Priority On Left: current options (slplus->options), then addon options, then attribute settings, then URL passing stuff, then our widget needs\n $all_options = array_merge( $options, $this->addon->options , $this->attribute_js_options, $new_options , $widget_options );\n\n // Only keep original options that were changed or \"for our JS\" settings\n\t //\n\t // NOTE: None of the SmartOptions should appear here\n\t //\n\t $for_our_js = array(\n\t \t'address_autocomplete',\n\t \t'disable_initial_directory',\n\t 'selector_behavior',\n\t );\n\t foreach ( $all_options as $key => $value ) {\n\t \tif ( array_key_exists( $key , $options ) || in_array( $key , $for_our_js ) ) {\n\t \t\t$options[ $key ] = $all_options[ $key ]; // overwrite\n\t\t }\n\t }\n\n return $options;\n }",
"public function set_options_filter() {\n\t\t/**\n\t\t * Filter the plugin options.\n\t\t *\n\t\t * @since 10.0.0\n\t\t *\n\t\t * @return array\n\t\t */\n\t\t$config = apply_filters( 'gu_set_options', [] );\n\n\t\t/**\n\t\t * Filter the plugin options.\n\t\t *\n\t\t * @return null|array\n\t\t */\n\t\t$config = empty( $config ) ? apply_filters_deprecated( 'github_updater_set_options', [ [] ], '6.1.0', 'gu_set_options' ) : $config;\n\n\t\tforeach ( array_keys( self::$git_servers ) as $git ) {\n\t\t\tunset( $config[ \"{$git}_access_token\" ], $config[ \"{$git}_enterprise_token\" ] );\n\t\t}\n\n\t\tif ( ! empty( $config ) ) {\n\t\t\t$config = $this->sanitize( $config );\n\t\t\tself::$options = array_merge( get_site_option( 'git_updater' ), $config );\n\t\t\tupdate_site_option( 'git_updater', self::$options );\n\t\t}\n\t}",
"function wpjsfsp_update_option( $key = '', $value = false ) {\n\treturn \\WPJSFSP\\Options::update( $key, $value );\n}",
"protected function initOptions()\n {\n }"
]
| [
"0.68978524",
"0.68635905",
"0.6691343",
"0.6675348",
"0.6663317",
"0.6609386",
"0.6582127",
"0.65119",
"0.65049523",
"0.6502211",
"0.643481",
"0.6413635",
"0.64121443",
"0.6408836",
"0.6392399",
"0.6253419",
"0.62283903",
"0.6214556",
"0.6213354",
"0.6210913",
"0.62062806",
"0.61985976",
"0.61849594",
"0.6179859",
"0.61773705",
"0.61403185",
"0.6136563",
"0.612507",
"0.6119689",
"0.61156577"
]
| 0.7214786 | 0 |
Indique si ce nom de fichier est un fichier de description | public static function est_fichier_description($nom) {
return substr($nom, -strlen('.bigup.json')) == '.bigup.json';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasFileDescription()\n {\n return $this->file_description !== null;\n }",
"public function hasFileName(){\n return $this->_has(3);\n }",
"public function hasFileName() {\n return $this->_has(2);\n }",
"public static function ecrire_description_fichier($chemin, $description) {\n\t\t$cache = self::chemin_description($chemin);\n\t\t$json = json_encode($description, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);\n\t\tif (json_last_error()) {\n\t\t\treturn false;\n\t\t}\n\t\tecrire_fichier($cache, $json);\n\t\treturn true;\n\t}",
"public function isFile();",
"function get_file_description($file)\n {\n }",
"protected function isFile() {}",
"function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}",
"public function isFile()\n {\n return ( $this->fileStructure->type == self::IS_FILE );\n }",
"public function isFile() : bool;",
"public function isFile(): bool;",
"function file_tester($file){\n if (htmlentities($file['filename']['type']) == 'text/plain')\n return true;\n else {\n echo \"Please submit correct file type (.txt)\";\n return false;\n }\n}",
"function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}",
"function file_source_can_be_displayed($filename) {\n return in_array(get_file_extension($filename), get_displayable_file_types());\n }",
"public function hasFilename()\n {\n return $this->filename !== null;\n }",
"public function hasFilename()\n {\n return $this->filename !== null;\n }",
"public function hasFile(string $name): bool {}",
"public function extens(){\n $this->typefl = pathinfo($this->filename, PATHINFO_EXTENSION);\n\n if(!in_array($this->typefl, $this->type)){\n echo \"Wrong extension!!!\";\n return false;\n }\n else{\n return true;\n }\n }",
"public function hasFiles(): bool\n {\n return $this->type != 'menu_links';\n }",
"public function has_description(){\n\t\treturn 0 < strlen($this->_description);\n\t}",
"protected function exibirListagem($controle){\n\t\treturn is_file($controle['caminho']);\n\t}",
"public function isFileNameType() {\r\n return $this->config['filenametype'];\r\n }",
"function testFileName(): void\n {\n $this->assertTrue(FileValidator::isName(\"docu.doc\"));\n $this->assertTrue(FileValidator::isName(\"docu\"));\n $this->assertFalse(FileValidator::isName(\"doc?u\"));\n }",
"function checkIfSubclassIsInFile($pathToXML, $name){\n $name = basename($name);\n $name = preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $name);\n $found=false;\n $title=\"\";\n $titleLang=\"\";\n $handle = fopen($pathToXML, 'r');\n if($handle){\n while (!feof($handle)){\n $buffer = fgets($handle);\n $type=$this->checkType($buffer);\n $uri=\"\";\n if($type=='nClass'){\n $uri=$this->get_string_between($buffer, '=\"', '\"]');\n $uri=basename($uri);\n $uri = preg_replace(\"/[^a-zA-Z0-9]+/\", \"\", $uri);\n if(strcmp($uri, $name)==0){\n $found=true;\n }\n }\n if($type==\"title\" && $found==true){\n if($titleLang==\"en\" || $titleLang==\"\"){\n if(strpos($buffer, '\"fr\"')){\n $titleLang=\"fr\";\n }else{\n $titleLang=\"en\";\n }\n $title=$this->get_string_between($buffer, ']', '[/');\n }\n }\n\n if($type==\"eoc\" && $found==true && $title==\"\"){\n return \"fail\";\n }\n\n if($type=='eoc' && $found==true && $title!==\"\"){\n return $title;\n }\n }\n }\n fclose($handle);\n return \"fail\";\n }",
"function ui_description() {\n return t('Extend Linkit with file support (Managed files).');\n }",
"public function canStoreDescription();",
"function filenameCheck($str) {\n return (strpos($str, \".csv\") !== FALSE);\n }",
"public function hasDescription(){\n return $this->_has(1);\n }",
"public function is_file($file);",
"public function hasFiles($name = null);"
]
| [
"0.7414546",
"0.659131",
"0.6568115",
"0.6428953",
"0.64202887",
"0.63629323",
"0.6277681",
"0.62150294",
"0.6159206",
"0.6155827",
"0.6110255",
"0.6109654",
"0.6107383",
"0.60845995",
"0.60788864",
"0.60788864",
"0.60056955",
"0.599629",
"0.59542656",
"0.5934283",
"0.58710456",
"0.58281803",
"0.58251494",
"0.58052784",
"0.58015984",
"0.5789309",
"0.57878697",
"0.57793766",
"0.57711625",
"0.57353103"
]
| 0.77840835 | 0 |
Customizer functionality for the Header Section. | function shop_isle_header_controls_customize_register( $wp_customize ) {
/* Header */
$wp_customize->add_section(
'shop_isle_header_section',
array(
'title' => __( 'Header', 'shop-isle' ),
'priority' => 40,
)
);
$wp_customize->get_control( 'header_image' )->section = 'shop_isle_header_section';
$wp_customize->get_control( 'header_image' )->priority = '2';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_section_header($wp_customize, $panel_id) {\n $wp_customize->add_section( 'fyt_header' , [\n 'title' => 'Header',\n 'panel' => $panel_id,\n ]);\n\n /* Binome pour CHANGER LE NOM DANS LE HEADER */\n // Déclaration du paramètre 'setting'\n $wp_customize->add_setting( 'fyt_header_title', [] );\n // un élément de formulaire permettant d'attribuer une valeur au setting\n $wp_customize->add_control( 'fyt_header_title', array(\n 'type' => 'text',\n 'section' => 'fyt_header',\n 'label' => 'Titre dans le header',\n // 'description' => 'Select a title for the posts'\n ) );\n /* Fin du parametrage du binome */\n\n\n /* Binome pour selectionner LA COULEUR DE FOND DU HEADER */\n // Déclaration du paramètre 'setting'\n $wp_customize->add_setting( 'fyt_header_background_color',\n array(\n 'default' => '#FFA500',\n // 'sanitize_callback' => 'sanitize_hex_color',\n ) );\n // un élément de formulaire permettant d'attribuer une valeur au setting\n $wp_customize->add_control(\n new WP_Customize_Color_Control(\n $wp_customize,\n 'fyt_header_background_color',\n array(\n 'label' => 'Background color du header',\n 'section' => 'fyt_header',\n 'settings' => 'fyt_header_background_color',\n )\n )\n );\n/* Fin du parametrage du binome */\n\n\n}",
"function customize() {\n\t\t// Render callback function.\n\t\t$fn = array( $this, 'render' );\n\t\t$config = array(\n\t\t\tarray(\n\t\t\t\t'name' => $this->section,\n\t\t\t\t'type' => 'section',\n\t\t\t\t'panel' => $this->panel,\n\t\t\t\t'priority' => $this->priority,\n\t\t\t\t'title' => $this->label,\n\t\t\t),\n\n\t\t\tarray(\n\t\t\t\t'name' => $this->name,\n\t\t\t\t'type' => 'textarea',\n\t\t\t\t'section' => $this->section,\n\t\t\t\t'selector' => '.builder-header-' . $this->id . '-item',\n\t\t\t\t'render_callback' => $fn,\n\t\t\t\t'theme_supports' => '',\n\t\t\t\t'default' => __( 'Add custom text here or remove it', 'customify' ),\n\t\t\t\t'title' => __( 'HTML', 'customify' ),\n\t\t\t\t'description' => __( 'Arbitrary HTML code.', 'customify' ),\n\t\t\t),\n\n\t\t\tarray(\n\t\t\t\t'name' => $this->name . '_typo',\n\t\t\t\t'type' => 'typography',\n\t\t\t\t'section' => $this->section,\n\t\t\t\t'selector' => '.builder-header-' . $this->id . '-item.item--html p, .builder-header-' . $this->id . '-item.item--html',\n\t\t\t\t'css_format' => 'typography',\n\t\t\t\t'title' => __( 'Typography Setting', 'customify' ),\n\t\t\t),\n\n\t\t);\n\n\t\t// Item Layout.\n\t\treturn array_merge( $config, customify_header_layout_settings( $this->id, $this->section ) );\n\t}",
"function the_custom_header_markup()\n {\n }",
"function core_admin_header_style() {\r\n }",
"function get_custom_header()\n {\n }",
"function amply_default_header_header1_elements_outer_section( $wp_customize ) {\n\t$wp_customize->add_section(\n\t\t'amply_default_header_header1_elements_outer_section',\n\t\tarray(\n\t\t\t'title' => esc_html__( 'Header 1 Elements', 'amply' ),\n\t\t\t'priority' => 0,\n\t\t\t'type' => 'outer',\n\t\t)\n\t);\n}",
"public function gismo_custom_header_section() {\n\t\t\n\t\t\t$screens = array( 'page', 'post' );\n\t\t\t\n\t\t\tif($this->settings['layout']['page_title'] == 'custom'){\n\t\t\t\t\n\t\t\t\tforeach ( $screens as $screen ) {\n\n\t\t\t\t\tadd_meta_box(\n\n\t\t\t\t\t\t'custom_header_section_id',\n\n\t\t\t\t\t\t__( 'Custom Header Section', 'custom_header_section_textdomain' ),\n\n\t\t\t\t\t\tarray($this,'gismo_custom_header_section_callback'),\n\n\t\t\t\t\t\t$screen\n\n\t\t\t\t\t);\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}",
"function register_header( $wp_customize ) {\n\t$wp_customize->add_panel( 'header', array(\n\t\t'title' => esc_html__( 'Đầu trang', 'phoenixdigi' ),\n\t\t'priority' => 10,\n\t) );\n\n\t$wp_customize->add_section( 'header_template', array(\n\t\t'title' => esc_html__( 'Mẫu giao diện', 'phoenixdigi' ),\n\t\t'panel' => 'header',\n\t) );\n\n\t$wp_customize->add_setting( 'header_template' , array(\n\t\t'default' => 0,\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$library_ids = get_posts( array(\n\t\t'post_type' => 'elementor_library',\n\t\t'fields' => 'ids',\n\t\t// 'meta_key' => 'elementor_library_type',\n\t\t// 'meta_value' => 'header',\n\t\t'posts_per_page' => -1\n\t));\n\n\t$templates = array(\n\t\t'0' => esc_html__( 'Không chọn', 'phoenixdigi' ),\n\t);\n\n\tif ( $library_ids ) {\n\t\tforeach ( $library_ids as $id ) {\n\t\t\t$templates[ $id ] = get_the_title( $id );\n\t\t}\n\t}\n\n\t$wp_customize->add_control( 'header_template', array(\n\t\t'type' => 'select',\n\t\t'label' => esc_html__( 'Mẫu giao diện', 'phoenixdigi' ),\n\t\t'description' => esc_html__( 'Chọn mẫu giao diện cho Header.', 'phoenixdigi' ),\n\t\t'choices' => $templates,\n\t\t'section' => 'header_template',\n\t) );\n\n\t$wp_customize->add_section( 'header_script', array(\n\t\t'title' => esc_html__( 'Nhúng mã Script', 'phoenixdigi' ),\n\t\t'panel' => 'header',\n\t) );\n\n\t// Header script.\n\t$wp_customize->add_setting( 'header_script' , array(\n\t\t'default' => pdvn_get_option_default( 'banner_right' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'header_script', array(\n\t\t'type' => 'textarea',\n\t\t'label' => esc_html__( 'Header script', 'phoenixdigi' ),\n\t\t'description' => esc_html__( 'Nhúng mã Script xuống sau thẻ <head> ví dụ mã Google Analytics.', 'phoenixdigi' ),\n\t\t'section' => 'header_script',\n\t) );\n\n\t// Allow print header script.\n\t$wp_customize->add_setting( 'header_script_on_off' , array(\n\t\t'default' => pdvn_get_option_default( 'header_script_on_off' ),\n\t\t'sanitize_callback' => 'Phoenixdigi\\sanitize_value',\n\t) );\n\n\t$wp_customize->add_control( 'header_script_on_off', array(\n\t\t'type' => 'checkbox',\n\t\t'label' => esc_html__( 'Cho phép nhúng Header script', 'phoenixdigi' ),\n\t\t'section' => 'header_script',\n\t) );\n}",
"function header_customizer_settings($wp_customize) {\n$wp_customize->add_panel( 'header_panel', array(\n 'priority' => 900,\n\t'capability' => 'edit_theme_options',\n\t'theme_supports' => '',\n\t'title' => __('Header Settings', 'ben-theme'),\n\t'description' => __('Several header settings', 'ben-theme')\n) );\n\n/*\n// Adds the Header Logo section\n$wp_customize->add_section( 'header_logo_section', array(\n\t\t'title' => __('Header Logo', 'rre-theme'),\n\t\t'panel' => 'header_panel'\n) );\n\n\t// Add the Header Logo\n\t$wp_customize->add_setting('header_logo_setting');\n\n\t$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'header_logo_control',\n\tarray(\n\t'label' => __('Upload Header Logo'),\n\t'section' => 'header_logo_section',\n\t'settings' => 'header_logo_setting',\n\t) ) );\n\n// Adds the Share Price link\n$wp_customize->add_section( 'share_price_link', array(\n\t\t'title' => __('Share Price Link', 'rre-theme'),\n\t\t'panel' => 'header_panel'\n) );\n\n\t// Get in Touch Link\n\t$wp_customize->add_setting('share_price_link_setting');\n\n\t\t$wp_customize->add_control( 'share_price_link_control', array(\n\t\t 'label' => __( 'Add the Share Price Link' ),\n\t\t 'type' => 'url',\n\t\t 'section' => 'share_price_link',\n\t\t 'settings' => 'share_price_link_setting'\n\t\t) );\n*/\n}",
"function scaffold_custom_header_setup() {\n\tadd_theme_support( 'custom-header', apply_filters( 'scaffold_custom_header_args', array(\n\t\t'default-image' => '',\n\t\t'default-text-color' => '000000',\n\t\t'width' => 1000,\n\t\t'height' => 250,\n\t\t'flex-height' => true,\n\t\t'flex-width' => true,\n\t\t'wp-head-callback' => 'scaffold_header_style',\n\t) ) );\n}",
"function faculty_settings_header() {\n faculty_setting_line(faculty_add_size_setting('header_image_height', __('Header Height', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_title_area_width', __('Header Title Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_size_setting('header_widget_area_width', __('Header Widget Area Width', FACULTY_DOMAIN), 2));\n faculty_setting_line(faculty_add_background_color_setting('header_background_color', __('Background', FACULTY_DOMAIN)));\n do_action('faculty_settings_header');\n faculty_setting_line(faculty_add_note(sprintf(__('Save your settings before customizing your <a href=\"%s\">header</a>.', FACULTY_DOMAIN), admin_url('themes.php?page=custom-header'))));\n}",
"function _h_add_header_footer_customizer($wpc) {\n $setting_args = [\n 'type' => 'option',\n 'transport' => 'postMessage',\n 'default' => '',\n ];\n\n $editor_settings = [\n 'codemirror' => ['mode' => 'htmlmixed'],\n ];\n\n // Add section\n $wpc->add_section('h_code_section', [\n 'title' => __('Head & Footer Code'),\n 'description' => __('Add custom code for Head and Footer area'),\n ]);\n\n // Add options\n $wpc->add_setting('h[head_code]', $setting_args);\n $wpc->add_setting('h[footer_code]', $setting_args);\n\n // Add control\n $wpc->add_control(new WP_Customize_Code_Editor_Control($wpc, 'h[head_code]', [\n 'label' => __( 'HEAD code' ),\n 'editor_settings' => $editor_settings,\n 'section' => 'h_code_section',\n 'settings' => 'h[head_code]',\n ]));\n\n $wpc->add_control(new WP_Customize_Code_Editor_Control($wpc, 'h[footer_code]', [\n 'label' => __( 'FOOTER code' ),\n 'editor_settings' => $editor_settings,\n 'section' => 'h_code_section',\n 'settings' => 'h[footer_code]',\n ]));\n}",
"function get_custom_header_markup()\n {\n }",
"function additionalHeaderStuff() {\n return;\n }",
"public function format_for_header()\n {\n }",
"public function enableCustomHeader() \n\t{\n\t\t\n\t\t$custom_header_defaults = array(\n\t\t\t'default-image' => '',//get_stylesheet_directory_uri().'/images/logo.png',\n\t\t\t'random-default' => false,\n\t\t\t'width' => '',\n\t\t\t'height' => '',\n\t\t\t'flex-height' => false,\n\t\t\t'flex-width' => false,\n\t\t\t'default-text-color' => '',\n\t\t\t'header-text' => true,\n\t\t\t'uploads' => true,\n\t\t\t'wp-head-callback' => '',\n\t\t\t'admin-head-callback' => '',\n\t\t\t'admin-preview-callback' => '',\n\t\t);\n\t\tadd_theme_support( 'custom-header', $custom_header_defaults );\n\t}",
"function add_admin_header() {\n }",
"public function addHeader()\n {\n }",
"public function header() {\n\t\tRequirements::clear();\n\n\t\t$templates = ['Grasenhiller\\WkHtmlToX\\PdfHeader'];\n\t\t$data = $this->getHeaderFooterVariables();\n\n\t\tif (isset($data['template']) && $data['template']) {\n\t\t\t$templates[] = $data['template'];\n\t\t}\n\n\t\t$this->extend('updateHeader', $templates, $data);\n\n\t\treturn $this\n\t\t\t->customise($data)\n\t\t\t->renderWith(array_reverse($templates));\n\t}",
"function mytheme_customize_register( $wp_customize ) {\r\n\t$wp_customize->add_section( 'mytheme_new_section_name' , array(\r\n \t'title' => __( 'Visible Section Name', 'mytheme' ),\r\n \t'priority' => 30,\r\n\t) );\r\n}",
"function praise_custom_header_setup() {\n\tadd_theme_support( 'custom-header', apply_filters( 'praise_custom_header_args', array(\n\t\t'default-image'\t\t\t\t\t=> get_stylesheet_directory_uri() . '/assets/images/header.jpg',\n\t\t'default-text-color'\t\t => 'ffffff',\n\t\t'width'\t\t\t\t\t\t\t\t\t=> 1500,\n\t\t'height'\t\t\t\t\t\t\t\t => 300,\n\t\t'flex-height'\t\t\t\t\t\t=> true,\n\t\t'wp-head-callback'\t\t\t => 'praise_header_style'\n\t) ) );\n}",
"public function add_header() {\n }",
"function Header(){\n\t\t}",
"function wp_admin_headers()\n {\n }",
"function gutenberg_block_header_area() {\n\tgutenberg_block_template_part( 'header' );\n}",
"public function hookHeader()\n {\n $this->context->controller->addCSS($this->_path.'/views/css/front.css');\n }",
"function wpex_has_custom_header() {\n\treturn apply_filters( 'wpex_has_custom_header', wpex_header_builder_id() );\n}",
"function MyPenandPantry_Header_bckgrnd_callout($wp_customize){\n\t$wp_customize->add_section('MyPP_Header_Bckgrnd_callout_section',array(\n\t\t'title' => 'Header'\n\t));\n\n\t$wp_customize->add_setting('MyPP_Header_back_image');\n\n\t$wp_customize->add_control(new WP_Customize_Cropped_Image_Control($wp_customize,'\n\t\tMyPP_Header_bckgrnd_image_control',array(\n\t\t\t'label' => 'Image',\n\t\t\t'section' => 'MyPP_Header_Bckgrnd_callout_section',\n\t\t\t'settings' => 'MyPP_Header_back_image',\n\t\t\t'width'=> 920,\n\t\t\t'height'=> 210\n\t)));\n}",
"function _custom_logo_header_styles()\n {\n }",
"public function Header(){\n\n }"
]
| [
"0.7096875",
"0.6507847",
"0.64159447",
"0.6404864",
"0.63637716",
"0.63597125",
"0.6346859",
"0.6346601",
"0.6320988",
"0.6319455",
"0.6310909",
"0.6249318",
"0.6195561",
"0.61895996",
"0.61673135",
"0.6136929",
"0.6123261",
"0.60879594",
"0.6081348",
"0.60723346",
"0.60710764",
"0.6059945",
"0.603876",
"0.60303444",
"0.6029156",
"0.6014644",
"0.6014338",
"0.6004099",
"0.59889174",
"0.5973529"
]
| 0.6990709 | 1 |
Transform a value into a new value. | public function transform($value); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function transform($value)\n {\n return $value;\n }",
"public abstract function makeValue($value);",
"public function reverseTransform($value)\n {\n return $value;\n }",
"public function applyValue($value);",
"public function resolveTransformedValue($value)\n {\n return transform($value, $this->transformCallback ?? function ($value) {\n return $value;\n });\n }",
"protected function transform($value)\n {\n if (null === $this->valueTransformer) {\n return null === $value ? '' : $value;\n }\n return $this->valueTransformer->transform($value);\n }",
"public function transform($value, $field, $source, $destination);",
"public function convertToDrupalValue($value);",
"abstract public function convertFromRawValue($value);",
"protected function normalize($value)\n {\n if (null === $this->normalizationTransformer) {\n return $value;\n }\n return $this->normalizationTransformer->transform($value);\n }",
"public function reverseConvert ($value)\n {\n return $value;\n }",
"protected function prepareValue($value)\n\t{\n\t\treturn $value;\n\t}",
"protected function _convertValue ($value) {\n switch ($value) {\n case 'null':\n # Null value\n $value = null;\n break;\n\n case 'true':\n # Boolean\n $value = true;\n break;\n\n case 'false':\n # Boolean\n $value = false;\n break;\n\n default:\n if (is_numeric ($value)) {\n\n # Number\n if (preg_match ('/^-?[1-9][0-9]*$/', $value)) {\n\n # Regular 10-base integer\n $value = intval ($value, 10);\n\n } else if (preg_match ('/^-?0[0-7]*$/', $value)) {\n\n # 8-base integer\n $value = intval ($value, 8);\n\n } else if (preg_match ('/^-?0x[0-9a-z]*$/i', $value)) {\n\n # 16-base integer\n $value = intval ($value, 16);\n\n } else {\n\n # Floating point number\n $value = $value + 0;\n\n }\n\n } else {\n\n # String\n /*NOP*/;\n\n }\n }\n return $value;\n }",
"public function transform($transformationType, $value);",
"protected function transform($key, $value)\n {\n // abi_r('Data');abi_r(\"$key, $value\");\n\n if ( !is_string($value) )\n \treturn $value;\n\n if ( !$this->stub_in_array($key, $this->check_with_stub) ) \n {\n return $value;\n }\n\n if ( strpos($value, '.') !== false )\n \t$value = str_replace(',', '', $value);\n\n $new_value = $value;\n\n if ( strpos($value, ',') !== false )\n {\n \t$parts = explode(',', $value.',0');\t// Allways two parts minimum!\n \t\t\n \t\t$new_value = $parts[0].'.'.$parts[1];\t// No others \"dots\" here\n \t}\n\n return $new_value;\n }",
"protected function transform($key, $value)\n {\n if (in_array($key, $this->except, true)) {\n return $value;\n }\n\n preg_match('/[1-9]\\d*(\\,\\d+)?/', $value, $matches);\n\n if (count($matches) == 1) {\n $value = str_replace(',', '.', $value);\n\n return $value;\n }\n\n return $value;\n }",
"public function TransformForStorage($Value) {\n\n $this->TransError= false;\n $Lang= $this->GetOption('Lang');\n $LocalService= $this->GetService('Localization');\n return $LocalService->UnFormatNumber($Value, $Lang);\n }",
"function modify($value, $callback)\n {\n $callback($value);\n return $value;\n }",
"public function make($value);",
"protected function reverseTransform($value)\n {\n if (null === $this->valueTransformer) {\n return '' === $value ? null : $value;\n }\n return $this->valueTransformer->reverseTransform($value, $this->data);\n }",
"public function apply($value);",
"public function convert($value): string;",
"public function convertToPHPValue($value);",
"public function withValue($value);",
"public function mapValue($fromValue, $context = null)\n {\n $this->log($fromValue);\n $toValue = $fromValue;\n return parent::mapValue($toValue, $context);\n }",
"abstract public function cast($value);",
"public function __invoke($value)\n {\n return $value;\n }",
"public function __invoke($value)\n {\n return $value;\n }",
"private static function ConvertNodeValueToObject($value)\n\t{\n\t\tif (is_numeric($value)) {\n\t\t\tif (strcmp(strval(intval($value)), $value) === 0) {\n\t\t\t\treturn intval($value);\n\t\t\t} elseif (strcmp(sprintf('%.0f', floatval($value)), $value) === 0) {\n\t\t\t\treturn floatval($value);\n\t\t\t} else {\n\t\t\t\treturn $value;\n\t\t\t}\n\t\t} elseif (strtolower($value) == 'true' || strtolower($value) == 'false') {\n\t\t\treturn filter_var($value, FILTER_VALIDATE_BOOLEAN);\n\t\t} else {\n\t\t\treturn $value;\n\t\t}\n\t}",
"public function process($value);"
]
| [
"0.76919055",
"0.71436626",
"0.7032699",
"0.68936855",
"0.68236136",
"0.66617703",
"0.65414864",
"0.6372796",
"0.62883735",
"0.6284587",
"0.62570184",
"0.6251964",
"0.6237856",
"0.6204011",
"0.6111922",
"0.6107107",
"0.60954946",
"0.6095296",
"0.605177",
"0.6002355",
"0.5942552",
"0.58555454",
"0.5796917",
"0.571364",
"0.57025445",
"0.5693297",
"0.5673701",
"0.5673701",
"0.5665394",
"0.5654936"
]
| 0.8038884 | 0 |
This method adds the passed object with the passed key to the TreeMap. | public function add($key, $object)
{
if (is_null($key)) {
throw new NullPointerException('Passed key is null');
}
// check if a primitive datatype is passed
if (is_integer($key) || is_string($key) || is_double($key) || is_bool($key)) {
// add the passed object to the internal array
$this->items[$key] = $object;
// sort the instance
$this->sort();
// return the instance
return $this;
}
// check if an object is passed
if (is_object($key)) {
if ($key instanceof String) {
$newKey = $key->stringValue();
} elseif ($key instanceof Float) {
$newKey = $key->floatValue();
} elseif ($key instanceof Integer) {
$newKey = $key->intValue();
} elseif ($key instanceof Boolean) {
$newKey = $key->booleanValue();
} elseif (method_exists($key, '__toString')) {
$newKey = $key->__toString();
} else {
throw new InvalidKeyException('Passed key has to be a primitve datatype or has to implement the __toString() method');
}
// add the passed object to the internal array
$this->items[$newKey] = $object;
// sort the instance
$this->sort();
// return the instance
return $this;
}
throw new InvalidKeyException('Passed key has to be a primitve datatype or has to implement the __toString() method');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add($obj, $key = NULL) {\n try{\n if ($key == NULL) {\n $this->Items[] = $obj;\n } else {\n $this->Items[$key] = $obj;\n }\n }catch(Exception $e){\n throw $e;\n }\n }",
"public function addToGroup(GroupInterface $group, $object, $key = null)\n\t{\n\t\t$group->addMember(\n\t\t\tnew Node(\n\t\t\t\t$this->getObjectName($object), \n\t\t\t\t$object\n\t\t\t),\n\t\t\t$key !== null ? $key : spl_object_hash($object)\n\t\t);\n\t}",
"public function createAndStoreObject($object, $key) {\n\t\trequire_once($object . '.class.php');\n\t\t$this->objects[$key] = new $object($this);\n\t}",
"public function add($key, $value)\n\t{\n\t\tif ($key === null) {\n\t\t\t$this->_d[] = $value;\n\t\t} else {\n\t\t\t$this->_d[$key] = $value;\n\t\t}\n\t}",
"protected function pushKey($key, $value)\n {\n $this->items[$key] = $this->set($value);\n }",
"public function addItem($key, $value);",
"public function addKeyValue($key, $value)\n {\n if(is_object($value) && !method_exists($value, '__toString'))\n {\n $value = get_class($value);\n }\n $this->values[$key] = (string) $value;\n }",
"public function createAndStoreObject($object,$key)\n\t{\n\t\trequire_once($object.'.class.php');// This line includes the required class definition, only once!\n\t\t$this->objects[$key]=new $object($this);//This line creates an object of the concerned class type, and stores it in the objects array\n\t\t//For example: $this->objects['url']=new urlprocessor($this); will create an object of type urlprocessor. $this is the reference to the registry BECAUSE MOST OBJECTS REQUIRE ACCESS TO THE REGISTRY AND THIS INCLUDES OBJECTS WITHIN THE REGISTRY ITSELF!\n\t}",
"public function set($key, $object)\n {\n $this->items[$key] = $object;\n }",
"public function addItem($obj, $key)\n {\n if ($this->keyExists($key)) {\n throw new KeyAlreadyInUse(\n \"Key: \" . $key . ' is already in use; unique key required'\n );\n }\n $this->items[$key] = $obj;\n }",
"public function addAt($key, $value);",
"private function addKey($key)\n {\n $keys = $this->getKeys();\n\n // Don't add duplicate keys into our store\n if (!in_array($key, $keys)) {\n $keys[] = $key;\n }\n\n $this->saveKeys($keys);\n }",
"public function setObject($object, $key = null) {\r\n if($key) {\r\n $this->objects[$key] = $object;\r\n }\r\n else {\r\n $this->objects[] = $object;\r\n }\r\n }",
"public function Add($key, $value)\n {\n $this->Remove($key);\n $this->_keyValPairs[$key] = $value;\n }",
"public function add($key, $value)\n\t{\n\t\tif ($this->hasKey($key))\n\t\t{\n\t\t\tthrow new \\Exception('Element '.$key.' already exists in Map');\n\t\t}\n\n\t\t$this->set($key, $value);\n\t}",
"public function add($id, $object)\n \t{\n \t\tif (isset($this->_map[$id]) == 0) {\n \t\t\t$this->_map[$id] = array();\n \t\t}\n\n\t\tif (array_search($object, $this->_map[$id]) !== false) {\n\t\t\treturn false;\n\t\t}\n\n\t\tarray_push($this->_map[$id], $object);\n\t\treturn true;\n\t}",
"public function add(string $key, mixed $item): self;",
"public function add(string $key, $element): void;",
"public function add($key, $value)\n {\n $this->storage[$key] = $value;\n }",
"public function add($object): void;",
"public function add_field(string $key, $value, string $type = null, string $order = null, \\WPGraphQL\\Data\\Cursor\\PostObjectCursor $object_cursor = null)\n {\n }",
"public function storeObject( $object, $key )\r\n\t{\r\n\t\tif( strpos( $object, 'database' ) !== false )\r\n\t\t{\r\n\t\t\t$object_a = str_replace( '.database', 'database', $object);\r\n\t\t\t$object = str_replace( '.database', '', $object);\r\n\t\t\trequire_once('databaseobjects/' . $object . '.database.class.php');\r\n\t\t\t$object = $object_a;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\trequire_once('objects/' . $object . '.class.php');\r\n\t\t}\r\n\t\t\r\n\t\tself::$objects[ $key ] = new $object( self::$instance );\r\n\t}",
"public function setObjectForKey($key, $object)\n {\n $this->setObjectForKeyWithLifeTimePathAndDomain($key, $object, '_');\n }",
"public static function add(&$object, $key, $value) {\n\t\t\t$qarray = \\uri\\generate::query_array($object);\n\t\t\tif (!isset($qarray[$key])) {\n\t\t\t\t$qarray[$key] = $value;\n\t\t\t\t\\uri\\actions::modify($object, 'replace', 'QUERY', self::build_query($qarray));\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\treturn FALSE;\n\t\t}",
"public function addKey( $key, $value )\n {\n /** @var $client \\Memcached */\n $client = $this->getClient();\n $client->add( $key, $value );\n }",
"public function add_value($key, $value){\r\n\t\t$this->_entries[$key] = array('v', $value);\r\n\t}",
"public function add(GroupObject $object) : Group;",
"public function add($key, $value) \r\n {\r\n if(is_null($key)) \r\n {\r\n throw new ArgumentNullException(\"key is null.\");\r\n }\r\n \r\n if($this->containsKey($key)) \r\n {\r\n throw new ArgumentException(\"An element with the same key already exists in the System.Collections.Hashtable.\");\r\n }\r\n\r\n $this->elements[$key] = $value;\r\n }",
"public abstract function saveObject($objKey, $obj);",
"public static function addInstanceToPool($obj, $key = null)\n {\n if (Propel::isInstancePoolingEnabled()) {\n if ($key === null) {\n $key = serialize(array((string) $obj->getAtccode(), (string) $obj->getDddaantal(), (string) $obj->getDddeenheid(), (string) $obj->getDddtoedieningsweg()));\n } // if key === null\n GsDailyDefinedDosePeer::$instances[$key] = $obj;\n }\n }"
]
| [
"0.61861044",
"0.6036819",
"0.5951588",
"0.58392864",
"0.58137244",
"0.5812236",
"0.5743079",
"0.57395625",
"0.5711058",
"0.57081485",
"0.5639575",
"0.5635063",
"0.5608207",
"0.54742885",
"0.5403366",
"0.5400525",
"0.5399464",
"0.53864676",
"0.52914095",
"0.5286838",
"0.5274298",
"0.52449846",
"0.52306026",
"0.5201983",
"0.51964164",
"0.51920086",
"0.5166942",
"0.51625866",
"0.51493084",
"0.51483595"
]
| 0.612658 | 1 |
Sorts the instance with the given comparator or the PHP ksort() funktion. | protected function sort()
{
// if no comparator is passed sort the internal array
// by its keys, else use the comparator
if ($this->comparator == null) {
return ksort($this->items);
} else {
return CollectionUtils::sort($this, $this->comparator);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sort(callable $comparator = null);",
"public function usort($comparator) {\n uasort($this->_hash, array($comparator, 'compare'));\n }",
"public function comparator();",
"public function sortStrategy();",
"abstract protected function setUpComparator();",
"public function sort($callback = null, $sorter = null)\n {\n if (!$sorter) {\n $sorter = $callback === null ? 'sort' : 'usort';\n }\n if (!is_callable($sorter)) {\n throw new InvalidArgumentException(\"The passed parameter is not a valid sort function.\");\n }\n $callback === null ? $sorter($this->_data) : $sorter($this->_data, $callback);\n return $this;\n }",
"public function sorted(Comparator $comparator)\n {\n $array = $this->toArray();\n Arrays::sort($array, $comparator);\n return self::of($array);\n }",
"public function asort() {}",
"public function sort($sortOrderBy, $sortDirection = SolrInputDocument::SORT_ASC) {}",
"public function sort();",
"public function sort(callable $comparer): void\n {\n usort($this->entities, $comparer);\n }",
"public function sort($options = []) {\n\t\tif ($options instanceof Closure) {\n\t\t\t$options = array('callback' => $options);\n\n\t\t} else if (is_bool($options)) {\n\t\t\t$options = array('reverse' => $options);\n\t\t}\n\n\t\t$options = $options + array(\n\t\t\t'reverse' => false,\n\t\t\t'preserve' => true,\n\t\t\t'flags' => SORT_REGULAR,\n\t\t\t'callback' => null,\n\t\t\t'on' => 'values'\n\t\t);\n\n\t\t$flags = $options['flags'];\n\t\t$preserve = $options['preserve'];\n\n\t\t// Sort by callback\n\t\tif ($options['callback'] instanceof Closure) {\n\n\t\t\t// Sort keys by callback\n\t\t\tif ($options['on'] === 'keys') {\n\t\t\t\tuksort($this->_value, $options['callback']);\n\n\t\t\t// Sort values by callback\n\t\t\t} else {\n\t\t\t\tif ($preserve) {\n\t\t\t\t\tuasort($this->_value, $options['callback']);\n\t\t\t\t} else {\n\t\t\t\t\tusort($this->_value, $options['callback']);\n\t\t\t\t}\n\t\t\t}\n\n\t\t// Sort regular\n\t\t} else {\n\n\t\t\t// Sort by keys\n\t\t\tif ($options['on'] === 'keys') {\n\t\t\t\tksort($this->_value, $flags);\n\n\t\t\t// Sort by values\n\t\t\t} else {\n\t\t\t\tif ($preserve) {\n\t\t\t\t\tasort($this->_value, $flags);\n\t\t\t\t} else {\n\t\t\t\t\tsort($this->_value, $flags);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Reverse it\n\t\tif ($options['reverse']) {\n\t\t\t$this->_value = array_reverse($this->_value, $preserve);\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function ksort()\n {\n }",
"public function sorted(callable $comparator = null): Sequence;",
"public function sort(\\Closure $callback);",
"public function sortByKey(ComparerInterface $comparer = null)\n {\n if ($comparer === null) {\n $comparer = $this->getDefaultComparer();\n }\n ukort($this->array, array($comparer, 'compare'));\n }",
"function ksort(array &$array, $sort_flags = null)\n {\n }",
"public function sort(ComparerInterface $comparer = null)\n {\n if ($comparer === null) {\n $comparer = $this->getDefaultComparer();\n }\n usort($this->array, array($comparer, 'compare'));\n }",
"public function asort()\n {\n }",
"public function getSorting();",
"public static function arrSortObjsByKey($key, $order = 'DESC') {\n\treturn function($a, $b) use ($key, $order) {\n\t\t// Swap order if necessary\n\t\tif ($order == 'DESC') {\n \t \t\tlist($a, $b) = array($b, $a);\n \t\t} \n \t\t// Check data type\n \t\tif (is_numeric($a->$key)) {\n \t\t\treturn $a->$key - $b->$key; // compare numeric\n \t\t} else {\n \t\t\treturn strnatcasecmp($a->$key, $b->$key); // compare string\n \t\t}\n\t};\n}",
"public function comparator()\n {\n return $this->comparator;\n }",
"function customcert_perform_asort(&$fields) {\n if (class_exists('core_collator')) {\n core_collator::asort($fields);\n } else {\n collatorlib::asort($fields);\n }\n}",
"abstract public function prepareSort();",
"public function getComparator()\n {\n return $this->comparator;\n }",
"public function applySort($criteria, $sort, $key) : void;",
"function krsort(array &$array, $sort_flags = null)\n {\n }",
"public function sortBy(string $key);",
"public function sort()\n {\n foreach (array_keys($this->betTypes) as $type) {\n ksort($this->betTypes[$type]);\n }\n }",
"public function sort(/* variable arguments */) {\n $this->sort = func_get_args();\n return $this;\n }"
]
| [
"0.74544084",
"0.677944",
"0.64906245",
"0.6238799",
"0.61312497",
"0.60998285",
"0.60936975",
"0.6085205",
"0.60024697",
"0.5918563",
"0.5868349",
"0.58029675",
"0.5782805",
"0.5737489",
"0.57366985",
"0.5723376",
"0.57149905",
"0.5698046",
"0.56963724",
"0.56430876",
"0.56210613",
"0.5596944",
"0.55964804",
"0.5584556",
"0.5577196",
"0.55703634",
"0.55608374",
"0.5552948",
"0.5548836",
"0.5505751"
]
| 0.70246184 | 1 |
This method Returns a new TreeMap initialized with the passed array. | public static function fromArray($array)
{
// check if the passed object is an array and set it
if (is_array($array)) {
return new TreeMap($this->comparator, $array);
}
// throw an exception if the passed object is not an array
throw ClassCastException('Passed object is not an array');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ConversToObject($array){\r\n\t\t\t$td = new TuyenDi();\r\n\t\t\t$td->MaChuyen = $array[\"MaChuyen\"];\r\n\t\t\t$td->TenTuyen = $array[\"TenTuyen\"];\t\t\t\r\n\t\t\t$td->GioDi = $array[\"GioDi\"];\r\n\t\t\t$td->LoaiXe = $array[\"LoaiXe\"];\r\n\t\t\t$td->SoGhe = $array[\"SoGhe\"];\r\n\t\t\t$td->GiaVe = $array[\"GiaVe\"];\r\n\t\t\treturn $td;\r\n\t\t}",
"function mapArray($array){\n\treturn new ArrayMapper($array);\n}",
"public static function setMapOrder( $array ){\n\t\tself::$mapOrder = $array;\n\t}",
"function arrayToTree($a) {\n if (!empty($a) && !empty($a[0])) {\n $T = new Tree();\n $T->x = $a[0];\n $T->l = arrayToTree($a[1]);\n $T->r = arrayToTree($a[2]);\n return $T;\n }\n return null;\n}",
"public static function instance(array $array) : Arr {\n return new Arr($array);\n }",
"public static function makeFromSimpleArray($array)\n {\n $dataTable = new Piwik_DataTable();\n $dataTable->addRowsFromSimpleArray($array);\n return $dataTable;\n }",
"protected static function array_to_object($array){\n\t\t\n\t\t$object = new stdClass;\n\n\t\tforeach($array as $key => &$value) {\n\n\t\t\tif(is_array($value)){\n\n\t\t\t\t$object->{$key} = static::array_to_object($value);\n\n\t\t\t}else{\n\n\t\t\t\t$object->{$key} = $value;\n\t\t\t}\n\n\t\t\tunset($key, $value);\n\t\t}\n\n\t\treturn $object;\n\t}",
"protected function fromArray(array $nodeArray)\n {\n\n $node = $this->nodeCreator->makeNode();\n\n $node->id = $nodeArray['id'];\n $node->setPath($nodeArray['path']);\n $node->setMenuTitle($nodeArray['menu_title']);\n $node->setTitle($nodeArray['title']);\n $node->setContent($nodeArray['content']);\n $node->parent_id = 'parent-id-'.$nodeArray['id'];\n $node->route_name = $nodeArray['routeName'];\n\n return $node;\n\n }",
"protected function _tree($array)\n {\n $root = [\n \"children\" => []\n ];\n $current =& $root;\n\n foreach ($array as $i => $node) {\n $result = $this->_tag($node);\n\n if ($result) {\n $tag = $result[\"tag\"] ?? \"\";\n $arguments = $result[\"arguments\"] ?? \"\";\n\n if ($tag) {\n if (!$result[\"closer\"]) {\n $last = ArrayMethods::last($current[\"children\"]);\n\n if ($result[\"isolated\"] && is_string($last)) {\n array_pop($current[\"children\"]);\n }\n\n $current[\"children\"][] = [\n \"index\" => $i,\n \"parent\" => &$current,\n \"children\" => [],\n \"raw\" => $result[\"source\"],\n \"tag\" => $tag,\n \"arguments\" => $arguments,\n \"delimiter\" => $result[\"delimiter\"],\n \"number\" => sizeof($current[\"children\"])\n ];\n $current =& $current[\"children\"][sizeof($current[\"children\"]) - 1];\n }\n elseif (isset($current[\"tag\"]) && $result[\"tag\"] == $current[\"tag\"]) {\n $start = $current[\"index\"] + 1;\n $length = $i - $start;\n $current[\"source\"] = implode(\" \", array_slice($array, $start, $length));\n $current =& $current[\"parent\"];\n }\n } else {\n $current[\"children\"][] = [\n \"index\" => $i,\n \"parent\" => &$current,\n \"children\" => [],\n \"raw\" => $result[\"source\"],\n \"tag\" => $tag,\n \"arguments\" => $arguments,\n \"delimiter\" => $result[\"delimiter\"],\n \"number\" => sizeof($current[\"children\"])\n ];\n }\n } else {\n $current[\"children\"][] = $node;\n }\n }\n\n return $root;\n }",
"public function packingCreate(array $array);",
"public function arrayToObject($array): static;",
"public static function fromArray(array $array)\n {\n return new static($array);\n }",
"private function tree_create_nestedset_from_array($ns_array, &$ns, &$left = 1, $level = 0) {\n $order = 0;\n foreach ($ns_array as $title=>$node) {\n $ns_element = array();\n $ns_element[\"ID_KAT\"] = $node[\"id\"];\n $ns_element[\"LFT\"] = $left++;\n $ns_element[\"LEVEL\"] = $level;\n $ns_element[\"ORDER_FIELD\"] = ($order+=10);\n $ns_id = array_push($ns, $ns_element);\n if (!empty($node[\"childs\"])) {\n // Unterknoten vorhanden\n $nestedset_childs = $this->tree_create_nestedset_from_array($node[\"childs\"], $ns, $left, $level + 1);\n }\n $ns[$ns_id-1][\"RGT\"] = $left++;\n }\n }",
"public static function fromArray(array $array): static\n {\n return new self(Iterators::forArray($array));\n }",
"static public function fromArray($anArray) {\n\t\t$theClassName = get_called_class();\n\t\t$o = new $theClassName();\n\t\treturn $o->setDataFrom($anArray);\n\t}",
"public function init_from_array($array)\n { \n foreach($array as $key => $val)\n { \n $this->set($key,$val);\n }\n }",
"public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n if ( $this->$key instanceof PersistentCollection ) {\n \n $value = new ArrayCollection(\n array_unique(array_merge($this->$key->toArray(), $value->toArray()), \\SORT_REGULAR)\n );\n \n }\n \n $this->$key = $value; \n }\n \n //return $this;\n }",
"public function fromArray($array) {\n \n foreach ( $array as $key => $value ) {\n \n if ( $this->$key instanceof PersistentCollection ) {\n \n $value = new ArrayCollection(\n array_unique(array_merge($this->$key->toArray(), $value->toArray()), \\SORT_REGULAR)\n );\n \n }\n \n $this->$key = $value; \n }\n \n //return $this;\n }",
"function a_t($array)\r\n{\r\n $r=array();\r\n foreach($array as $k1=>$ia) {\r\n foreach($ia as $k2=>$v) {\r\n $r[$k2][$k1]=$v;\r\n }\r\n }\r\n return $r;\r\n}",
"public function concat(array $array) {\n\t\treturn new Map(Hash::merge($this->_value, $array));\n\t}",
"public static function array2object($array) {\r\r\n \r\r\n\t\tif (is_array($array)) {\r\r\n\t\t\t$obj = new StdClass();\r\r\n\t \r\r\n\t\t\tforeach ($array as $key => $val){\r\r\n\t\t\t\t$obj->$key = $val;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n \telse { $obj = $array; }\r\r\n\t\t\r\r\n \t\treturn $obj;\r\r\n\t}",
"public static function toObject(array $array, $class = 'stdClass')\n {\n \t$obj = new $class;\n \n \tforeach ($array as $k => $v)\n \t{\n \t\tif (is_array($v))\n \t\t{\n \t\t\t$obj->$k = self::toObject($v, $class);\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$obj->$k = $v;\n \t\t}\n \t}\n \n \treturn $obj;\n }",
"static public function array_to_object(array $array){\n \t# Iterate through our array looking for array values.\n \t# If found recurvisely call itself.\n \t$obj = new stdClass();\n \tforeach($array as $key => $value){\n \t if(is_array($value)){\n \t \t$obj->$key = self::array_to_object($value);\n \t }else{\n \t \t$obj->$key = $value;\n \t }\n \t}\n \t\n \t# Typecast to (object) will automatically convert array -> stdClass\n \treturn $obj;\n }",
"public function buildTree($arr)\n\t{\n\t\t$count = count($arr);\n\t\tif(!$count) return array();\n\n\t\t$first = $arr[0];\n\t\t$entryLevel = $first->level;\n\t\t$tree = new stdClass();\n\t\t$tree->type = $first->type;\n\t\t$tree->content = null;\n\t\t$tree->parent = null;\n\t\t$tree->key = 'root';\n\t\t$tree->level = $entryLevel - 1;\n\t\t$tree->children = array();\n\t\t$lastNode = $tree;\n\t\t// store the relations\n\t\t$parentList = array();\n\t\tforeach($arr as $key => $val){\n\t\t\t$level = $val->level;\n\t\t\t$lastLevel = $lastNode->level;\n\t\t\tif($level > $lastLevel){\n\t\t\t\t$lastNode->children[] = $val;\n\t\t\t\t$parentList[$key] = $lastNode;\n\t\t\t\t$lastNode = $val;\n\t\t\t} elseif($level < $lastLevel) { \n\t\t\t\t// look for the node has same level \n\t\t\t\twhile($level < $lastNode->level){\n\t\t\t\t\t$lastNode = $parentList[$lastNode->key];\n\t\t\t\t}\n\t\t\t\t$parent = $parentList[$lastNode->key];\n\t\t\t\t$parent->children[] = $val;\n\t\t\t\t$parentList[$key] = $parent;\n\t\t\t\t$lastNode = $val;\n\t\t\t} else { // $level == $lastLevel\n\t\t\t\t$parent = $parentList[$lastNode->key];\n\t\t\t\t$parent->children[] = $val;\n\t\t\t\t$parentList[$key] = $parent;\n\t\t\t\t$lastNode = $val;\n\t\t\t}\n\t\t}\n\t\treturn $tree;\n\t}",
"public static function fromArray($array) {\n\t\t$revision = new self();\n\t\t$revision->setData($array);\n\t\treturn $revision;\n\t}",
"public static function toObject( array $array )\n {\n\n $object = new \\stdClass();\n\n foreach( $array as $key=>$value )\n {\n\n if( isset( $object->$key ) == false )\n {\n\n $object->$key = $value;\n }\n }\n\n return $object;\n }",
"public function __new(array $arr) \n {\n if (is_array($arr)) {\n foreach ($arr as $key => $value)\n {\n $this->__add($key, $value);\n }\n }\n }",
"public static function __set_state(array $array)\n {\n return new self(...array_values($array));\n }",
"public static function toObject(array $array);",
"public function __construct(array $array) {\n $this->data = $array;\n foreach($array as $language => $row) {\n $this->translations[$language] = $row->translation;\n }\n \n $language = $_SESSION[\"lang\"];\n \n if(isset($this->translations[$language])) {\n $this->current = $this->translations[$language];\n } else {\n $this->current = current($this->translations);\n }\n }"
]
| [
"0.57344115",
"0.5599776",
"0.5565655",
"0.53689283",
"0.5339808",
"0.5173007",
"0.5151045",
"0.51465106",
"0.5140942",
"0.5130003",
"0.5128311",
"0.51256335",
"0.51170504",
"0.50997406",
"0.50540257",
"0.5026104",
"0.50108314",
"0.50108314",
"0.50008065",
"0.49914068",
"0.49749368",
"0.4933247",
"0.49331546",
"0.4925874",
"0.4905679",
"0.49001962",
"0.48989236",
"0.48941436",
"0.48842227",
"0.48841354"
]
| 0.74881804 | 0 |
This method returns the comparator passed with the constructor. | public function comparator()
{
return $this->comparator;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getComparator()\n {\n return $this->comparator;\n }",
"public function comparator();",
"public function getCmp()\n {\n return $this->cmp;\n }",
"public function getComparatorFor($expected, $actual);",
"public static function callback()\n\t{\n\t return new InvokableComparator(new static);\n\t}",
"public function getComparison();",
"function make_comparer() {\n $criteria = func_get_args();\n foreach ($criteria as $index => $criterion) {\n $criteria[$index] = is_array($criterion) ? array_pad($criterion, 3, null) : array($criterion, SORT_ASC, null);\n }\n\n return function($first, $second) use (&$criteria) {\n foreach ($criteria as $criterion) {\n // How will we compare this round?\n list($column, $sortOrder, $projection) = $criterion;\n $sortOrder = $sortOrder === SORT_DESC ? -1 : 1;\n\n // If a projection was defined project the values now\n if ($projection) {\n $lhs = call_user_func($projection, $first[$column]);\n $rhs = call_user_func($projection, $second[$column]);\n } else {\n $lhs = $first[$column];\n $rhs = $second[$column];\n }\n\n // Do the actual comparison; do not return if equal\n if ($lhs < $rhs) {\n return -1 * $sortOrder;\n } else if ($lhs > $rhs) {\n return 1 * $sortOrder;\n }\n }\n\n return 0; // tiebreakers exhausted, so $first == $second\n };\n }",
"abstract protected function setUpComparator();",
"public function getCmp2()\n {\n return $this->cmp2;\n }",
"public static function create(Comparator $comparator, ?string $keyType = null, ?string $valueType = null);",
"function comparator($object1, $object2) {\n\t\t\treturn $object1->amount < $object2->amount; \n\t\t}",
"public function __construct()\n {\n $this->register(new TypeComparator);\n $this->register(new StrictScalarComparator());\n $this->register(new NumericComparator);\n $this->register(new DoubleComparator);\n $this->register(new ArrayComparator);\n $this->register(new ResourceComparator);\n $this->register(new ObjectComparator);\n $this->register(new ExceptionComparator);\n $this->register(new SplObjectStorageComparator);\n $this->register(new DOMNodeComparator);\n $this->register(new DateTimeComparator);\n }",
"public static function create() : ComparisonResult\n {\n return new static();\n }",
"public function sorted(Comparator $comparator)\n {\n $array = $this->toArray();\n Arrays::sort($array, $comparator);\n return self::of($array);\n }",
"public static function create( $spec=0, $comparisonCallback=null )\r\n {\r\n $self = self::getInstance();\r\n $factory = $self->getFactoryMethod( $spec );\r\n \r\n if (is_callable($factory)) {\r\n return is_callable($comparisonCallback)\r\n ? call_user_func_array( $factory, array($comparisonCallback) )\r\n : call_user_func_array( $factory, array() );\r\n }\r\n \r\n require_once dirname(__FILE__).'/CUnknownSorterException.php'; \r\n throw new CUnknownSorterException( $spec );\r\n }",
"public function getCcmp()\n {\n return $this->ccmp;\n }",
"public function onInitSortingComponent()\n {\n return new Sorting();\n }",
"public function getConstructor() {}",
"function comparator($elem1,$elem2) {\n\n\tif ($elem1->getId() == $elem2->getId()) \n\t\treturn 0;\n\telse \n\t\tif ($elem1->getId() > $elem2->getId())\n\t\t\treturn 1;\n\t\telse\n\t\t\treturn -1;\n\n}",
"public function getCustomConstructor(): callable;",
"public function get_compare($query)\n {\n }",
"protected function maxCompare()\n {\n if(! $this->isEmpty()) {\n\n if(is_null($this->maxComparator)) {\n $this->maxComparator = $this->first();\n }\n\n foreach($this->items as $comparator) {\n if($comparator->getPoints() > $this->maxComparator->getPoints()) {\n $this->maxComparator = $comparator;\n }\n }\n\n return $this->maxComparator;\n }\n }",
"function make_comparer() {\n // Normalize criteria up front so that the comparer finds everything tidy\n $criteria = func_get_args();\n foreach ($criteria as $index => $criterion) {\n $criteria[$index] = is_array($criterion)\n ? array_pad($criterion, 3, null)\n : array($criterion, SORT_ASC, null);\n }\n\n return function($first, $second) use (&$criteria) {\n foreach ($criteria as $criterion) {\n // How will we compare this round?\n list($column, $sortOrder, $projection) = $criterion;\n $sortOrder = $sortOrder === SORT_DESC ? -1 : 1;\n\n // If a projection was defined project the values now\n if ($projection) {\n $lhs = call_user_func($projection, $first[$column]);\n $rhs = call_user_func($projection, $second[$column]);\n }\n else {\n $lhs = $first[$column];\n $rhs = $second[$column];\n }\n\n // Do the actual comparison; do not return if equal\n if ($lhs < $rhs) {\n return -1 * $sortOrder;\n }\n else if ($lhs > $rhs) {\n return 1 * $sortOrder;\n }\n }\n\n return 0; // tiebreakers exhausted, so $first == $second\n };\n}",
"public function get_compare( $query ) {\r\n\t\tif ( ! empty( $query['compare'] ) && in_array( $query['compare'], array( '=', '!=', '>', '>=', '<', '<=', 'IN', 'NOT IN', 'BETWEEN', 'NOT BETWEEN' ) ) )\r\n\t\t\treturn strtoupper( $query['compare'] );\r\n\r\n\t\treturn $this->compare;\r\n\t}",
"protected function createComparerObjects() : array {\r\n return [\r\n $this->createInstance(3),\r\n $this->createInstance(2),\r\n $this->createInstance(4),\r\n $this->createInstance(1),\r\n ];\r\n }",
"protected function _getComparisonType($filter) {\n $comp = null;\n\n if (isset($filter['comp_type'])) {\n $comp = $filter['comp_type'];\n }\n elseif ($filter['_config']['type'] == 'text') {\n $comp = self::COMPARISON_LIKE;\n }\n elseif ($filter['_config']['type'] == 'multiple_select') {\n $comp = self::COMPARISON_IN;\n }\n else {\n $comp = self::COMPARISON_EQUAL;\n }\n\n return $comp;\n }",
"static public function getInstance($id){\n\t\t$sql = 'CALL comparison_get(:comparison_id)';\n\t\t$params = array(':comparison_id' => $id);\n\t\t$result = DatabaseHandler::getRow($sql, $params);\n\t\t\n\t\tif(!empty($result)){\n\t\t\t$sql = 'CALL comparison_product_get(:comparison_id)';\n\t\t\t$items_result = DatabaseHandler::getAll($sql, $params);\n\t\t\t\n\t\t\t$details = array();\n\t\t\tforeach($items_result as $detail){\n\t\t\t\t$product = Product::getInstance((int)$detail['product_id']);\n\t\t\t\t$details[] = new ComparisonDetail($product, (int)$detail['physical'], (int)$detail['system']);\n\t\t\t}\n\t\t\t\n\t\t\t$user = UserAccount::getInstance($result['user_account_username']);\n\t\t\t\n\t\t\treturn new Comparison($id, $result['created_date'], $user, $result['reason'],\n\t\t\t\t\t(boolean)$result['general'], $details, (int)$result['physical_total'],\n\t\t\t\t\t(int)$result['system_total']);\n\t\t}\n\t\telse\n\t\t\treturn NULL;\n\t}",
"function getAdvComparator($comparator,$value,$datatype = '')\n\t{\n\n\t\tglobal $adb;\n\t\tif($comparator == \"e\")\n\t\t{\n\t\t\tif(trim($value) == \"NULL\")\n\t\t\t{\n\t\t\t\t$rtvalue = \" is NULL\";\n\t\t\t}elseif(trim($value) != \"\")\n\t\t\t{\n\t\t\t\t$rtvalue = \" = \".$adb->quote($value);\n\t\t\t}elseif(trim($value) == \"\" && $datatype == \"V\")\n\t\t\t{\n\t\t\t\t$rtvalue = \" = \".$adb->quote($value);\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$rtvalue = \" is NULL\";\n\t\t\t}\n\t\t}\n\t\tif($comparator == \"n\")\n\t\t{\n\t\t\tif(trim($value) == \"NULL\")\n\t\t\t{\n\t\t\t\t$rtvalue = \" is NOT NULL\";\n\t\t\t}elseif(trim($value) != \"\")\n\t\t\t{\n\t\t\t\t$rtvalue = \" <> \".$adb->quote($value);\n\t\t\t}elseif(trim($value) == \"\" && $datatype == \"V\")\n\t\t\t{\n\t\t\t\t$rtvalue = \" <> \".$adb->quote($value);\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$rtvalue = \" is NOT NULL\";\n\t\t\t}\n\t\t}\n\t\tif($comparator == \"s\")\n\t\t{\n\t\t\t$rtvalue = \" like \".$adb->quote($value.\"%\");\n\t\t}\n\t\tif($comparator == \"c\")\n\t\t{\n\t\t\t$rtvalue = \" like \".$adb->quote(\"%\".$value.\"%\");\n\t\t}\n\t\tif($comparator == \"k\")\n\t\t{\n\t\t\t$rtvalue = \" not like \".$adb->quote(\"%\".$value.\"%\");\n\t\t}\n\t\tif($comparator == \"l\")\n\t\t{\n\t\t\t$rtvalue = \" < \".$adb->quote($value);\n\t\t}\n\t\tif($comparator == \"g\")\n\t\t{\n\t\t\t$rtvalue = \" > \".$adb->quote($value);\n\t\t}\n\t\tif($comparator == \"m\")\n\t\t{\n\t\t\t$rtvalue = \" <= \".$adb->quote($value);\n\t\t}\n\t\tif($comparator == \"h\")\n\t\t{\n\t\t\t$rtvalue = \" >= \".$adb->quote($value);\n\t\t}\n\n\t\treturn $rtvalue;\n\t}",
"public function sorted(Closure $compare): self\n {\n $intervals = $this->periods;\n usort($intervals, $compare);\n if ($intervals === $this->periods) {\n return $this;\n }\n\n return new self(...$intervals);\n }",
"public function buildPkeyCriteria()\n {\n $criteria = new Criteria(OperationPrimesPeer::DATABASE_NAME);\n $criteria->add(OperationPrimesPeer::OP_PRIME_ID, $this->op_prime_id);\n\n return $criteria;\n }"
]
| [
"0.73907256",
"0.72358835",
"0.6369107",
"0.60180527",
"0.60024786",
"0.5669116",
"0.5622229",
"0.5519566",
"0.55067605",
"0.54807746",
"0.5367999",
"0.5366918",
"0.5302451",
"0.5294692",
"0.5263487",
"0.5236973",
"0.516078",
"0.50414115",
"0.50383973",
"0.50260854",
"0.5024065",
"0.50031716",
"0.49636835",
"0.49626225",
"0.49387988",
"0.4898591",
"0.4814239",
"0.48064333",
"0.47714436",
"0.47652155"
]
| 0.77266926 | 0 |
function for getting data to breeding_tbl | function getBreeding($id){
$crud = new CRUD();
$crud->connect();
$crud->sql("select * from breeding_tbl where breeding_id='{$id}'");
$r = $crud->getResult();
foreach($r as $rs){
return $rs['breeding_id'];
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ddl_breeds()\r\n\t {\r\n\t $link = $this->connect();\r\n\t $search = \"SELECT breed_id,breed_name FROM pig_breeds\";\r\n\t $resultq = mysqli_query($link, $search);\r\n\t $breed = array();\r\n\t $breedArr = array();\r\n\t while ($row = mysqli_fetch_row($resultq)) {\r\n\t $breed['brid'] = $row[0];\r\n\t $breed['brname'] = $row[1];\r\n\t $breedArr[] = $breed;\r\n\t }\r\n\t return $breedArr;\r\n\t }",
"function getBreed($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from pigs_tbl where pig_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['breed'];\n\n\t}\n\t$crud->disconnect();\n}",
"function babies_data ($bgalb_id = 0)\n\t{\n\t\t$temp_return = array();\n\n\t\tif ($bgalb_id) {\n\t\t\t$sql = sprintf(\"SELECT * FROM %s \n\t\t\t\t\t\t\tWHERE bgalb_id='%d'\",\n\t\t\t\t$this->db_praefix.\"ecard_data\",\n\t\t\t\t$bgalb_id\n\t\t\t);\n\t\t\t$temp_return = $this->db->get_row($sql, ARRAY_A);\n\t\t}\n\n\t\treturn $temp_return;\n\t}",
"public function getBreed($conn, $id)\n{\n $sql = \"SELECT breed_name, pet_id, species_name\n FROM Breed\n WHERE pet_id = :id\";\n\n\n $stmt = $conn->prepare($sql);\n\n $stmt->bindValue(':id', $id, PDO::PARAM_INT);\n\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n}",
"public function readTable()\n {\n $sql = \"SELECT Cubans.Id, FirstName, LastName, Gender, YearOfBirth, \n `Name`, IsInGroup FROM Cubans\n JOIN Genre ON Cubans.IdGenre=Genre.id\";\n $statement = $this->connect->prepare($sql);\n $statement->execute();\n return $statement->fetchAll();\n }",
"function galerien_data($bgalg_id = 0)\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s\n\t\t\t\t\t\tWHERE bgalg_id='%d'\",\n\t\t\t$this->db_praefix.\"ecard_galerien\",\n\t\t\t$bgalg_id\n\t\t);\n\t\t$temp_return = $this->db->get_row($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}",
"public function getBreed($br_id)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"SELECT breed_id,breed_name\r\n\t\t\t\t\t\tFROM pig_breeds \r\n\t\t\t\t\t\twhere breed_id = '\".$br_id.\"'\";\r\n\t\t\t\t$result = mysqli_query($link, $query) or die(mysqli_error($link));\r\n\t\t\t\t$breed = array();\r\n\t\t\t\t$arr_breed = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($result)) {\r\n\t\t\t\t\t\t$breed['breed_id'] = $row[0];\r\n\t\t\t\t\t\t$breed['breed_name'] = $row[1];\r\n\t\t\t\t\t\t$arr_breed[] = $breed;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $arr_breed;\r\n\t\t}",
"function getData($id,$field='ben_id')\n\t{\n\t\t$sql=\"select \n\t\t `ben_id` `id`, `ben_name` `name`, `ben_detail` `detail`, `ben_modified` `modified`, `ben_created` `created`, `ben_status` `status`, `ben_howto` `howto`,ben_pos pos\n\t\tfrom {$this->table} where {$field}='$id'\";\n\t\tif($field=='ben_id'){\n\t\t\t$data=dbFetchOne($sql);\n\t\t}else{ \n\t\t\t$result=dbQuery($sql,1);\n\t\t\t$data=array();\n\t\t\t$i=0;\n\t\t\tforeach ($result->result_array() as $row){\n\t\t\t\t$data[]=$row;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"public function Individualgetdata();",
"function getFarrowedID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from breeding_tbl where breeding_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['breeding_id'];\n\n\t}\n\t$crud->disconnect();\n}",
"public function get_data();",
"public function getDataWithTypeDb() {}",
"function allinea_db(){\n\t\tif ($this->attributes['BYTB']!='' ) $this->fields_value_bytb($this->attributes['BYTB']);\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\n\t\t\t\t$ret[$i]=\"{$key} NUMBER\";\n\t\t\t\t$i++;\n\t\t\t\t$ret[$i]=\"D_{$key} VARCHAR2(200 CHAR)\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t\telse return ;\n\t}",
"public function getTableData()\n\t{\n\t}",
"function __list_fields_data($dbname,$table_name){\n $DB1=$this->__connect($dbname,$table_name);\n $fields = $DB1->list_fields($table_name);\n $fields_data = $DB1->field_data($table_name);\n\n $sql = \"describe $table_name\";\n $result = mysql_query($sql);\n //$sql=$this->db->query('sql');\n\n //convert to object\n //needs thinking\n while($data = mysql_fetch_array($result))\n {\n //echo_array($data);break;\n $d->name[$data['Field']]=array('name'=>$data['Field'],\n 'type'=>$data['Type'],\n 'null'=>$data['Null'],\n 'key'=>$data['Key'],\n 'default'=>$data['Default'],\n 'extra'=>$data['Extra']\n );\n \n \n \n }\n //echo'TEST';\n //echo_array($d);break;\n // print_r($result);\n\n return($d);\n }",
"function getAllDataValues() {\n\t\t$conn = Doctrine_Manager::connection(); \n\t\t$resultvalues = $conn->fetchAll(\"SELECT * FROM lookuptypevalue WHERE lookuptypeid = '\".$this->getID().\"' order by lookupvaluedescription asc \");\n\t\treturn $resultvalues;\t\n\t}",
"private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}",
"function newskomentar_listdata($tbl_newskomentar){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_newskomentar\");\n\t\treturn $sql;\n}",
"function bookingstatus_listdata( $tbl_bookingstatus ){\n\t\t$sql = mysql_query(\"SELECT * FROM $tbl_bookingstatus\");\n\t\treturn $sql;\n}",
"function einstellungen_data ()\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE bgalset_id='1'\",\n\t\t\t$this->db_praefix.\"ecard_einstellungen\"\n\t\t);\n\t\t$temp_return = $this->db->get_row($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}",
"protected function _readTable() {}",
"protected function _readTable() {}",
"function eateries(){\n $sql= $this->chk(\n \"SELECT \n eatery.name,\n eatery.description,\n eatery.rate\n FROM \n eatery \"\n );\n // \n $eateries= $this->sqlData($sql);\n echo ($eateries);\n }",
"public function getLeaderboardTableData()\n {\n $data = [];\n $categories = ['bohurts','profights', 'sword_shield', 'sword_buckler', 'longswords', 'polearm', 'triathlon'];\n foreach ($categories as $category){\n $data[$category] = (array)$this->fighter->getMaxPointsPerCategory($category);\n $data[$category]['category'] = $category;\n }\n\n $data = array_map(function($data){\n return[\n 'id' => $data['id'],\n 'club' => $data['club'],\n 'image' => $data['image'],\n 'fb_image' => $data['facebook_picture'],\n 'created_at' => $data['created_at'],\n 'name' => $data['name'],\n 'max_points' => $data['max_points'],\n 'category' => ucfirst(str_replace('_',' ',$data['category']))\n ];\n },$data);\n\n $data['The Rock'] = $this->fighter->getBestBohurtStandingRatio();\n $data['The Rock']->fb_picture = $data['The Rock']->facebook_picture;\n unset($data['The Rock']->facebook_picture);\n $data['The Rock']->max_points = substr($data['The Rock']->max_points,0,2).' %';\n $data['The Rock']->category = 'The Rock';\n\n return $this->respond($data);\n }",
"function db_dispense($table,$data){\n\t$db=R::dispense($table);\n\tforeach ($data as $key => $value) {\n\t\t$db->$key=$value;\n\t}\n\tR::store( $db );\n}",
"public function dataTable();",
"abstract function getdata();",
"function get_row_data($table,$field_name,$id)\r\n\t{\t\r\n\t\t$sql_query=\"SELECT * FROM $table WHERE `id`='\".$id.\"'\";\r\n\t\t$res_query=hb_mysql_query($sql_query);\r\n\t\t$rows_query=hb_mysql_fetch_array($res_query);\r\n\t\t\r\n\t\t$get_field_name=$rows_query[$field_name];\r\n\t\t\r\n\t\treturn $get_field_name;\r\n\t}",
"public function tabel_data()\n {\n $tampil = $this->koneksi()->prepare(\"SELECT id FROM tb_users\");\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $user_id_array [] = $data['id'];\n }\n }\n\n $tampil = $this->koneksi()->prepare(\"SELECT id FROM tb_lbb\");\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $lbb_id_array [] = $data['id'];\n }\n }\n\n foreach ($user_id_array as $user_id){\n foreach ($lbb_id_array as $lbb_id){\n $rating = \"0\";\n $tampil = $this->koneksi()->prepare(\"SELECT rating FROM tb_rating WHERE user_id=:user_id AND lbb_id=:lbb_id\");\n $tampil->bindParam(':user_id', $user_id);\n $tampil->bindParam(':lbb_id', $lbb_id);\n $tampil->execute();\n $tampil->setFetchMode(PDO::FETCH_ASSOC);\n if (count($tampil)>0){\n while ($data=$tampil->fetch(PDO::FETCH_ORI_NEXT)){\n $rating = $data['rating'];\n }\n }\n $tabel_data [$user_id] [$lbb_id] = $rating;\n }\n }\n\n return $tabel_data;\n }",
"public function adj_test($parameter){\n // print_r($parameter);\n $storedProcedure='adj_get_brand_name';\n $this -> dbmodel = new DBModel();\n $retrieval = $this -> dbmodel -> call_dbFunction($storedProcedure, $parameter);\n \n $i=0;\n $data=array();\n while($row=mysql_fetch_array($retrieval)){\n $data[$i]['id'] = $row['id'];\n $data[$i]['b_category_name'] = $row['b_category_name'];\n \n $i++;\n }\n $retrieval = $this -> dbmodel -> make_result($data);\n \n return $retrieval;\n }"
]
| [
"0.68739825",
"0.6673474",
"0.6610672",
"0.63664937",
"0.62537706",
"0.623122",
"0.61836594",
"0.6111871",
"0.5942564",
"0.59090644",
"0.59056383",
"0.58723015",
"0.5851881",
"0.5846248",
"0.5838267",
"0.57877654",
"0.57877517",
"0.57706916",
"0.5767982",
"0.575514",
"0.5743161",
"0.57429224",
"0.573704",
"0.57220256",
"0.5711737",
"0.57069653",
"0.5690832",
"0.5689132",
"0.5677407",
"0.56557286"
]
| 0.6853257 | 1 |
function for getting breed | function getBreed($id){
$crud = new CRUD();
$crud->connect();
$crud->sql("select * from pigs_tbl where pig_id='{$id}'");
$r = $crud->getResult();
foreach($r as $rs){
return $rs['breed'];
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBreed($br_id)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"SELECT breed_id,breed_name\r\n\t\t\t\t\t\tFROM pig_breeds \r\n\t\t\t\t\t\twhere breed_id = '\".$br_id.\"'\";\r\n\t\t\t\t$result = mysqli_query($link, $query) or die(mysqli_error($link));\r\n\t\t\t\t$breed = array();\r\n\t\t\t\t$arr_breed = array();\r\n\t\t\t\twhile ($row = mysqli_fetch_row($result)) {\r\n\t\t\t\t\t\t$breed['breed_id'] = $row[0];\r\n\t\t\t\t\t\t$breed['breed_name'] = $row[1];\r\n\t\t\t\t\t\t$arr_breed[] = $breed;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn $arr_breed;\r\n\t\t}",
"function getBreeding($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from breeding_tbl where breeding_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['breeding_id'];\n\n\t}\n\t$crud->disconnect();\n}",
"public function canineBreed()\n {\n $breed = array_rand($this->lists['breeds']);\n\n return $this->lists['breeds'][$breed];\n }",
"public function show($id)\n {\n return Breed::find($id);\n }",
"public function index()\n {\n return Breed::all();\n }",
"public function ddl_breeds()\r\n\t {\r\n\t $link = $this->connect();\r\n\t $search = \"SELECT breed_id,breed_name FROM pig_breeds\";\r\n\t $resultq = mysqli_query($link, $search);\r\n\t $breed = array();\r\n\t $breedArr = array();\r\n\t while ($row = mysqli_fetch_row($resultq)) {\r\n\t $breed['brid'] = $row[0];\r\n\t $breed['brname'] = $row[1];\r\n\t $breedArr[] = $breed;\r\n\t }\r\n\t return $breedArr;\r\n\t }",
"public function getBreed($conn, $id)\n{\n $sql = \"SELECT breed_name, pet_id, species_name\n FROM Breed\n WHERE pet_id = :id\";\n\n\n $stmt = $conn->prepare($sql);\n\n $stmt->bindValue(':id', $id, PDO::PARAM_INT);\n\n $stmt->execute();\n\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n}",
"public function show($id)\n {\n $breed = Breed::with('breedgroup')->find($id);\n \n return view('breed.show')->with([\n 'breed' => $breed\n ]);\n }",
"function getFarrowedID($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from breeding_tbl where breeding_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['breeding_id'];\n\n\t}\n\t$crud->disconnect();\n}",
"public function isAnimalAvailableForBreeding() {\n return $this->animal->breeding_status;\n }",
"public function getDog()\n {\n return $this->dog;\n }",
"public function addBreed($breed_name,$user)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$q = \"SELECT max(breed_id)\r\n\t\t\t\t\tFROM pig_breeds\";\r\n\t\t\t\t$r = mysqli_query($link, $q);\r\n\t\t\t\t$ro = mysqli_fetch_row($r);\r\n\t\t\t\t$max = $ro[0] + 1;\r\n\t\t\t\t$query = \"INSERT INTO pig_breeds(breed_id,breed_name) \r\n\t\t\t\t\t\tVALUES('\" . $max . \"','\" . $breed_name . \"');\";\r\n\t\t\t\tif ($result = mysqli_query( $link, $query )) {\r\n\t\t \t$data = array(\"success\"=>\"true\",\r\n\t\t \"newId\"=> $link->insert_id);\r\n\t \t\t\t$this->userTransactionEdit($user,$max,\"breed\",0,$breed_name,1,0);\r\n\t\t\t }else {\r\n\t\t\t $data = array(\"success\"=>\"false\",\r\n\t\t\t \"error\"=>mysqli_error($link));\r\n\t\t\t }\r\n\t\t\t return $data;\r\n\t\t}",
"function getIDAnimal($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from pigs_tbl where pig_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['date_born'];\n\n\t}\n\t$crud->disconnect();\n}",
"public function getSpecies();",
"public function getAllBreeds(){\n\t\treturn $this->getBreedsFromGET(self::GET_STRING_ALL_BREEDS);\n\t}",
"public function getDressBrandForFemaleBaseOnSizeChart(){ \n \n $query = $this->getEntityManager()\n ->createQuery(\"SELECT b FROM LoveThatFitAdminBundle:Brand b\n JOIN b.sizechart sc\n WHERE\n sc.gender='F'\n AND sc.target='dress'\n GROUP BY b.id\");\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }",
"public function show($id)\n {\n $breeds = Breed::find($id);\n return view('breeds.show', compact('breeds'));\n }",
"public function animalBreedingLimitation() {\n return $this->animal->breeding_limitation;\n }",
"public function getBrandById($brandeditid){\n\t\t\t \t$brandeditid = mysqli_real_escape_string($this->db->link,$brandeditid);\n\t\t\t \t$query = \"SELECT * FROM tbl_brand WHERE brandId = '$brandeditid' \";\n\t\t\t \t$result = $this->db->select($query);\n\t\t\t \treturn $result;\n\n\t\t\t }",
"function fn_get_brands($feature_id, $lang_code = CART_LANGUAGE)\n{\n\t//var_dump($feature_id);\n $params['feature_id']=$feature_id;\n\t$params['feature_type']=\"E\";\n $params['get_images'] = true;\n\t\n list($brands, $search) = fn_get_product_feature_variants($params,0, DESCR_SL);\n\t\n return array($brands, $params);\n}",
"public function index()\n {\n $dogbreeds = Breed::with('breedgroup')\n ->join('breedgroups', 'breeds.breedgroup_id', '=', 'breedgroups.id')\n ->where('breedgroups.species', 'Dog')\n ->orderBy('breedgroups.displayorder', 'asc')\n ->orderBy('breeds.breedname', 'asc')\n ->get(array('breeds.*', 'breeds.id as breed_id', 'breedgroups.*'));\n \n $catbreeds = Breed::with('breedgroup')\n ->join('breedgroups', 'breeds.breedgroup_id', '=', 'breedgroups.id')\n ->where('breedgroups.species', 'Cat')\n ->orderBy('breedgroups.displayorder', 'asc')\n ->orderBy('breeds.breedname', 'asc')\n ->get(array('breeds.*', 'breeds.id as breed_id', 'breedgroups.*'));\n \n return view('breed.list')->with([\n 'dogbreeds' => $dogbreeds,\n 'catbreeds' => $catbreeds\n ]);\n }",
"public function getAllSubBreeds($subBreed){\n\t\treturn $this->getBreedsFromGET(\"https://dog.ceo/api/breed/\".$subBreed.\"/list\");\n\t}",
"public function index()\n {\n $breeds = Breed::all();\n return view ('breeds.index',compact('breeds',));\n }",
"public function getGenre() {}",
"public function dog($id)\n {\n return $this->get($id, static::TYPE_DOG);\n }",
"public function getCarBrands();",
"function get_brand($id) {\n return $this->db->get_where('brands', array('id' => $id))->row_array();\n }",
"public function getAnimal()\n {\n return $this->animal;\n }",
"function getHeart_girth($id){\n\t$crud = new CRUD();\n\t$crud->connect();\n\n\t$crud->sql(\"select * from pigs_tbl where pig_id='{$id}'\");\n\t$r = $crud->getResult();\n\tforeach($r as $rs){\n\t\treturn $rs['heart_girth'];\n\n\t}\n\t$crud->disconnect();\n}",
"function get_by_gender() {\n return $this->mysqli->query(\"SELECT * FROM `product_variations` JOIN `products` on `product_variations`.`product_id` = `products`.`product_id` WHERE 1 ORDER BY `gender`, `price` ASC\");\n }"
]
| [
"0.73124474",
"0.7265752",
"0.6927521",
"0.682067",
"0.66108483",
"0.6586534",
"0.6554759",
"0.58211887",
"0.581475",
"0.5766591",
"0.57521087",
"0.573814",
"0.5723436",
"0.5714515",
"0.5712818",
"0.5646485",
"0.56441396",
"0.5618611",
"0.5615069",
"0.5611813",
"0.5597474",
"0.5572844",
"0.55717623",
"0.55304545",
"0.5508033",
"0.5507204",
"0.5499831",
"0.54479605",
"0.5441221",
"0.54136795"
]
| 0.78360516 | 0 |
function TO GET THE ID OF PIG | function getPigID($id){
$crud = new CRUD();
$crud->connect();
$crud->sql("select * from pigs_tbl where pig_id='{$id}'");
$r = $crud->getResult();
foreach($r as $rs){
return $rs['pig_id'];
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPId();",
"public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }",
"function getID();",
"function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}",
"public function id()\n\t{\n\t\treturn $this->SqueezePlyrID ;\n\t}",
"function getImageId();",
"function id():string {return $this->_p['_id'];}",
"public function let_id_pg(){\n\t\t\treturn (int)$this->ipg_id;\n\t\t}",
"public static function id(){\n return self::info('id');\n }",
"function getId();",
"public function get_id();",
"public function get_id();",
"public function getID();",
"public function getID();",
"public function getID();",
"function getPid() ;",
"static function id()\n\t{\n\t\treturn self::data('id');\n\t}",
"public function getPageId() {}",
"public function getPageId() {}",
"public function get_id()\n {\n }",
"public function getID(): string;",
"function getID() {\n\t\treturn $this->data_array['id'];\n\t}",
"public function getId()\n\t{\n\t\treturn $this->get('templateid');\n\t}",
"public static function getID() {\r\n return 1;\r\n }",
"abstract public function get_id();",
"function getID() {\n\t\treturn $this->data_array['artifact_id'];\n\t}",
"public function getID() : string;",
"public function getIDPID(): string {\n\t\treturn 'idp_' . elgg_get_friendly_title($this->getDisplayName());\n\t}",
"public function getIdVit(){\n\t\treturn ($this->id);\n\t}",
"public function getid() {\n\t\treturn $this->id;\n\t}"
]
| [
"0.7117901",
"0.6996781",
"0.6957659",
"0.6863566",
"0.68566597",
"0.6730368",
"0.6710833",
"0.667156",
"0.6670742",
"0.6645418",
"0.66373956",
"0.66373956",
"0.66277885",
"0.66277885",
"0.66277885",
"0.6518915",
"0.65174544",
"0.65096563",
"0.6506898",
"0.6498894",
"0.6491024",
"0.64758414",
"0.6467557",
"0.64536816",
"0.6444661",
"0.64425427",
"0.6440858",
"0.641636",
"0.6359433",
"0.63448226"
]
| 0.74589133 | 0 |
this is to find the maximum number among the batch number | function getMaxBatch(){
$crud = new CRUD();
$crud->connect();
$crud->sql("SELECT MAX(batch_no) from breeding_tbl");
$r = $crud->getResult();
foreach($r as $rs){
return $rs['MAX(batch_no)'];
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLastBatchNumber()\n {\n global $wpdb;\n\n $max = $wpdb->get_results(\n \"SELECT MAX(`batch`) as max FROM {$wpdb->prefix}exolnet_migration as em\",\n 'ARRAY_A'\n );\n\n return absint($max[0]['max']) ?? 0;\n }",
"public function getMaxNumber()\n {\n return $this->maxNumber;\n }",
"public function getLastBatchNo()\n {\n $query = \"SELECT max(BatchNumber) AS BatchNumber FROM voucherbatch\";\n $sql = Yii::app()->db->createCommand($query);\n $result = $sql->queryRow();\n \n if($result['BatchNumber'] > 0)\n return $result['BatchNumber'] + 1;\n else\n return 1;\n }",
"abstract public function maxMax(): int;",
"static function maxint() {\n /* assumes largest integer is of form 2^n - 1 */\n $to_test = pow(2, 16);\n while (1) {\n $last = $to_test;\n $to_test = 2 * $to_test;\n if (($to_test < $last) || (!is_int($to_test))) {\n return($last + ($last - 1));\n }\n }\n }",
"public function maxNumber(): int\n {\n try {\n return (int) $this->createQueryBuilder('b')\n ->select('max(b.number) as maxi')\n ->getQuery()\n ->getSingleScalarResult()\n ;\n } catch (NonUniqueResultException $exception) {\n //this should not be reached.\n return 0;\n } catch (NoResultException $exception) {\n return 0;\n }\n }",
"public function getMax(): int;",
"function exibeAtualMax(){\n $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n return $nmax= ($this->numpage + $nmin)-1;\n }",
"protected function get_max_batch_size()\n {\n }",
"public function getBatch()\n\t{\n\t\tif (! is_int(self::$batch))\n\t\t{\n\t\t\t$batch = $this->db->table($this->table)\n\t\t\t\t->selectMax('batch')\n\t\t\t\t->get()->getResultObject();\n\t\t\t$batch = empty($batch) ? 0 : (int) reset($batch)->batch;\n\n\t\t\tself::$batch = $batch + 1;\n\t\t}\n\n\t\treturn self::$batch;\n\t}",
"public function getMaxValue();",
"public function getMaxValue();",
"function max() { return $this->max; }",
"abstract protected function getMaxParameter(): int;",
"public function GetMaxCount ();",
"function arr_max($int_arr){\r\n\t\t\t\r\n\t\t\t$max = $int_arr[0];\t\t\r\n\t\t\t\r\n\t\t\tfor ($i=0; $i < count($int_arr); $i++){\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif ( $int_arr[$i] > $max ) {\t\t\t\t\t\r\n\t\t\t\t\t$max = $int_arr[$i];\r\n\t\t\t\r\n\t\t\t\t}//end if\r\n\t\t\t\r\n\t\t\t}//end for\r\n\t\t\r\n\t\t\treturn $max;\r\n\t\t\t\r\n\t\t}",
"function getMax() { return $this->readMaxValue(); }",
"public function maxSortingNumber(){\n $result = $this->repo->maxSortingNumber();\n return $result;\n }",
"function find_max_index($arr) \n {\n $max = $arr[0]; \n for ($i = 1, $len = count($arr); $i < $len; $i++) {\n\n $max = ($arr[$i] > $max) ? $arr[$i] : $max;\n } \n return $max;\n }",
"protected function _getMax()\n {\n $max = 0;\n if (!empty($this->_tagsArray)) {\n $p_size = 0;\n foreach ($this->_tagsArray as $cKey => $cVal) {\n $c_size = $cVal['size'];\n if ($c_size > $p_size) {\n $max = $c_size;\n $p_size = $c_size;\n }\n }\n }\n return $max;\n }",
"public function getMax();",
"public function getMaxBatchSize() \n {\n return $this->_fields['MaxBatchSize']['FieldValue'];\n }",
"public function getMaxcount()\n {\n return $this->maxCount;\n }",
"public function getMax() {\n return $this->max;\n }",
"public function getMax()\n {\n return $this->_maxValue;\n }",
"protected function max_value() {\n $max = 0;\n foreach ($this->data_collections as $data_collection) {\n foreach ($data_collection->get_items() as $item) {\n if ($max < $item->get_value()) {\n $max = $item->get_value();\n }\n }\n }\n return $max;\n }",
"function findMax($arr, $n) \n{ \n\t$mi = 0; \n\tfor ($i = 0; $i < $n; ++$i) \n\t\tif ($arr[$i] > $arr[$mi]) \n\t\t\t\t$mi = $i; \n\treturn $mi; \n}",
"private static function getMaxId () {\n return Dao::queryValue(\"select max(id) from medicines where id < 10000000\");\n }",
"public function getMaximum()\n {\n return $this->max;\n }",
"function getMax($key, $array) {\r\n // Declare $maxValue\r\n $cardMax = 0;\r\n $maxValue = 0;\r\n /* Loop through the array, starting at the given\r\n index and ending at the last element in the\r\n array.*/\r\n for ($i = $key; $i > -1; $i--) {\r\n /* it will add the probability score for each index\r\n included in the loop*/\r\n $cardMax = $array[$i][3];\r\n $maxValue = $maxValue + $cardMax;\r\n }\r\n // and returns the max value for the key\r\n return $maxValue;\r\n }"
]
| [
"0.73679274",
"0.71389556",
"0.70501614",
"0.6962275",
"0.6829131",
"0.6803963",
"0.6694386",
"0.6682911",
"0.6640332",
"0.6611159",
"0.65868235",
"0.65868235",
"0.6570471",
"0.6507647",
"0.6471011",
"0.6470322",
"0.6440547",
"0.6422641",
"0.63864946",
"0.6385789",
"0.63829315",
"0.63757724",
"0.63579184",
"0.63542944",
"0.63442373",
"0.6344094",
"0.6342869",
"0.6323842",
"0.6313935",
"0.63134056"
]
| 0.76522136 | 0 |
chart for counting hair type | function gethair_type1($id){
$crud = new CRUD();
$crud->connect();
$crud -> sql("select *, COUNT(hair_type) from pigs_tbl where hair_type='1' ");
$r = $crud->getResult();
foreach($r as $rs){
return $rs['COUNT(hair_type)'];
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getChartType();",
"public static function statsticsPigeonsYear()\n\t{\n\t\t$pigeonTable=Pigeon::getTableSchema();\n\t\t$query = (new Query())->select([\"COUNT(*) as count\", \"year\", \"sex\"])->from($pigeonTable->name)->where(['IDuser'=>Yii::$app->user->getId()])->groupBy('year, sex');\n\t\t$command = $query->createCommand();\n\t\t$rows = $command->queryAll();\n\t\t$year=[]; $maleCount=[]; $femaleCount=[]; $unknownCount=[];\t\t\n\t\tforeach($rows as $value)\n\t\t{\n\t\t\t$year[$value[\"year\"]]=$value[\"year\"];\n\t\t\t$femaleCount[$value[\"year\"]]=empty($femaleCount[$value[\"year\"]])?0:$femaleCount[$value[\"year\"]];\n\t\t\t$maleCount[$value[\"year\"]]=empty($maleCount[$value[\"year\"]])?0:$maleCount[$value[\"year\"]];\n\t\t\t$unknownCount[$value[\"year\"]]=empty($unknownCount[$value[\"year\"]])?0:$unknownCount[$value[\"year\"]];\n\t\t\tif($value[\"sex\"]==Pigeon::MALE_PIGEON)\n\t\t\t{\n\t\t\t\t$maleCount[$value[\"year\"]]=$value[\"count\"];\n\t\t\t}\n\t\t\t\n\t\t\tif($value[\"sex\"]==Pigeon::FEMALE_PIGEON)\n\t\t\t{\n\t\t\t\t$femaleCount[$value[\"year\"]]=$value[\"count\"];\n\t\t\t}\n\t\t\t\n\t\t\tif($value[\"sex\"]==Pigeon::UNKNOWN_SEX_PIGEON) \n\t\t\t{\n\t\t\t\t$unknownCount[$value[\"year\"]]=$value[\"count\"];\n\t\t\t}\n\t\t}\n\t\t\n\t\t /* Create and populate the pData object */ \n\t\t$MyData = new \\pData(); \n\t\t$MyData->loadPalette(Yii::getAlias(\"@common\").\"/pchart/palettes/light.color\", TRUE);\n\t\t$MyData->addPoints($maleCount,Yii::t('default', 'Male')); \n\t\t$MyData->addPoints($femaleCount,Yii::t('default', 'Female')); \n\t\t$MyData->addPoints($unknownCount,Yii::t('default', 'No sex')); \n\t\t$MyData->setAxisName(0,Yii::t('default', 'Number of pigeons')); \n\t\t$MyData->addPoints($year,\"Year\"); \n\t\t$MyData->setSerieDescription(\"Year\",Yii::t('default', 'Year')); \n\t\t$MyData->setAbscissa(\"Year\"); \n\t\t\n\t\t/* Create the pChart object */ \n\t\t$myPicture = new \\pImage(900,1000,$MyData); \n\t\t\n\t\t/* Turn of Antialiasing */ \n\t\t$myPicture->Antialias = FALSE; \n\t\t\n\t\t/* Set the default font */ \n\t\t$myPicture->setFontProperties(array(\"FontName\"=>Yii::getAlias(\"@common\").\"/pchart/fonts/verdana.ttf\",\"FontSize\"=>10)); \n\t\t\n\t\t/* Define the chart area */ \n\t\t$myPicture->setGraphArea(60,60,800,1000); \n\t\t\n\t\t/* Draw the scale */ \n\t\t$scaleSettings = array(\"GridR\"=>200,\"GridG\"=>200,\"GridB\"=>200,\"DrawSubTicks\"=>TRUE,\"CycleBackground\"=>TRUE, \"Mode\"=>SCALE_MODE_START0, \"Pos\"=>SCALE_POS_TOPBOTTOM); \n\t\t$myPicture->drawScale($scaleSettings); \n\t\t\n\t\t/* Write the chart legend */ \n\t\t$myPicture->drawLegend(480,12,array(\"Style\"=>LEGEND_NOBORDER,\"Mode\"=>LEGEND_HORIZONTAL)); \n\t\t\n\t\t\n\t\t/* Draw the chart */ \n\t\t$myPicture->drawBarChart(); \n\t\t\n\t\t/* Render the picture (choose the best way) */ \n\t\t$myPicture->autoOutput(Yii::getAlias(\"@webroot\").\"/temp/example.drawBarChartYear.png\"); \n\t}",
"protected function getChartNum()\n {\n self::$chartNum++;\n return self::$chartNum;\n }",
"public function getNumberOfHMetrics() {}",
"public function chartReport($type) {\n $array = [\n 'title' => config('variables.sensorType')[$type],\n 'chart' => [\n 'color' => config('variables.typeColor')[$type],\n 'values' => [0, 0, 0]\n ],\n 'number' => [\n 'color' => 'green',\n 'value' => $this->data[$type]['total'],\n 'unit' => config('variables.sensorUnit')[$type]\n ]\n ];\n\n return $array;\n }",
"function generateLevelBarChart($pays,$ind,$agr,$con,$it)\n {\n $MyData = new pData(); \n $MyData->addPoints($it,\"IT solution\");\n $MyData->addPoints($ind ,\"Industrie\");\n $MyData->addPoints($con,\"Construction\");\n $MyData->addPoints($agr,\"Agriculture\");\n $MyData->setAxisName(0,\"Nombre de partenaires\");\n $MyData->addPoints($pays,\"Labels\");\n $MyData->setSerieDescription(\"Labels\",\"Months\");\n $MyData->setAbscissa(\"Labels\");\n $Palette = array(\"0\"=>array(\"R\"=>46,\"G\"=>151,\"B\"=>224,\"Alpha\"=>100),\n \"1\"=>array(\"R\"=>128,\"G\"=>128,\"B\"=>128,\"Alpha\"=>100),\n \"2\"=>array(\"R\"=>204,\"G\"=>102,\"B\"=>0,\"Alpha\"=>100),\n \"3\"=>array(\"R\"=>0,\"G\"=>153,\"B\"=>0,\"Alpha\"=>100),\n );\n $MyData->setPalette(\"IT solution\",array(\"R\"=>46,\"G\"=>151,\"B\"=>224,\"Alpha\"=>100)) ; \n $MyData->setPalette(\"Industrie\",array(\"R\"=>128,\"G\"=>128,\"B\"=>128,\"Alpha\"=>100)) ; \n $MyData->setPalette(\"Construction\",array(\"R\"=>204,\"G\"=>102,\"B\"=>0,\"Alpha\"=>100)) ;\n $MyData->setPalette(\"Agriculture\",array(\"R\"=>0,\"G\"=>153,\"B\"=>0,\"Alpha\"=>100)) ;\n\n\n $myPicture = new pImage(700,230,$MyData);\n $Settings = array(\"R\"=>194, \"G\"=>92, \"B\"=>4, \"Dash\"=>1, \"DashR\"=>204, \"DashG\"=>102, \"DashB\"=>14);\n $myPicture->drawFilledRectangle(0,0,700,390,$Settings);\n /* Create the pChart object */\n $myPicture->drawGradientArea(0,0,700,230,DIRECTION_VERTICAL,array(\"StartR\"=>240,\"StartG\"=>240,\"StartB\"=>240,\"EndR\"=>180,\"EndG\"=>180,\"EndB\"=>180,\"Alpha\"=>100));\n $myPicture->drawGradientArea(0,0,700,230,DIRECTION_HORIZONTAL,array(\"StartR\"=>240,\"StartG\"=>240,\"StartB\"=>240,\"EndR\"=>180,\"EndG\"=>180,\"EndB\"=>180,\"Alpha\"=>20));\n /* Set the default font properties */\n $myPicture->setFontProperties(array(\"FontName\"=>\"../app/includes/pChart/fonts/pf_arma_five.ttf\",\"FontSize\"=>6));\n /* Draw the scale and the chart */\n $myPicture->setGraphArea(60,20,680,190);\n $myPicture->drawScale(array(\"DrawSubTicks\"=>TRUE,\"Mode\"=>SCALE_MODE_ADDALL_START0));\n $myPicture->setShadow(FALSE);\n \n\n $myPicture->drawStackedBarChart(array(\"DisplayPos\"=>LABEL_POS_INSIDE,\"DisplayValues\"=>false ,\"Rounded\"=>TRUE,\"Surrounding\"=>30));\n /* Write the chart legend */\n $myPicture->drawLegend(380,210,array(\"Style\"=>LEGEND_NOBORDER,\"Mode\"=>LEGEND_HORIZONTAL));\n /* Render the picture (choose the best way) */\n $myPicture->Render(\"assets/images/barLevelChart1.png\");\n }",
"public function makeChart($type)\n\n {\n\n switch ($type) {\n\n case 'bar':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'bar', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'pie':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'pie', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'donut': \n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'donut', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'line':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'line', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'area':\n\n $galeri = Galeri::where(DB::raw(\"(DATE_FORMAT(created_at,'%Y'))\"),date('Y')) \n\n ->get();\n\n $chart = Charts::database($galeri, 'area', 'highcharts') \n\n ->title(\"Monthly new Picture\") \n\n ->elementLabel(\"Total Picture\") \n\n ->dimensions(1000, 500) \n\n ->responsive(true) \n\n ->groupByMonth(date('Y'), true);\n\n break;\n\n\n\n case 'geo':\n\n $chart = Charts::create('geo', 'highcharts')\n\n ->title('Laravel Chart GEO')\n\n ->elementLabel('HDTuto.com Laravel GEO Chart label')\n\n ->labels(['JP', 'ID', 'RU'])\n\n ->colors(['#3D3D3D', '#985689'])\n\n ->values([5,10,20])\n\n ->dimensions(1000,500)\n\n ->responsive(true);\n\n break;\n\n\n\n default:\n\n # code...\n\n break;\n\n }\n\n return view('chart', compact('chart'));\n\n }",
"public function generateSeatChart(){\n $seatChart = array();\n foreach ($this->rows as $row){\n $seatChart[] = $row->generateSeatCharRow();\n }\n return $seatChart;\n }",
"public static function statsticsPigeonsStatus()\n\t{\n\t\t$pigeonTable=Pigeon::getTableSchema();\n\t\t$statusTable=Status::getTableSchema();\n\t\t$query = (new \\yii\\db\\Query())\n\t\t\t\t->select([\"COUNT(*) as count\", \"IDstatus\", \"status\"])\n\t\t\t\t->from($pigeonTable->name)\n\t\t\t\t->leftJoin($statusTable->name, \"$statusTable->name.ID=$pigeonTable->name.IDstatus\")\n\t\t\t\t->where([\"$pigeonTable->name.IDuser\"=>Yii::$app->user->getId()])\n\t\t\t\t->groupBy('IDstatus');\n\t\t$command = $query->createCommand();\n\t\t$rows = $command->queryAll();\n\t\tforeach($rows as $value)\n\t\t{\n\t\t\t$statusCount[$value[\"IDstatus\"]]=$value[\"count\"];\n\t\t\t$statusName[$value[\"IDstatus\"]]=$value[\"status\"]. \" (\".$value[\"count\"].\")\";\n\t\t}\n\t\t\n\t\t/* Create and populate the pData object */\n\t\t$MyData = new \\pData(); \n\t\t$MyData->loadPalette(Yii::getAlias(\"@common\").\"/pchart/palettes/light.color\", TRUE);\n\t\t$MyData->addPoints($statusCount,\"ScoreA\"); \n\t\t$MyData->setSerieDescription(\"ScoreA\",\"Application A\");\n\t\t\n\t\t/* Define the absissa serie */\n\t\t$MyData->addPoints($statusName,\"Labels\");\n\t\t$MyData->setAbscissa(\"Labels\");\n\t\t\n\t\t/* Create the pChart object */\n\t\t$myPicture = new \\pImage(500,230,$MyData);\n\t\t\n\t\t/* Set the default font properties */ \n\t\t$myPicture->setFontProperties(array(\"FontName\"=>Yii::getAlias(\"@common\").\"/pchart/fonts/verdana.ttf\",\"FontSize\"=>10,\"R\"=>80,\"G\"=>80,\"B\"=>80));\t\n\t\t\t\n\t\t/* Create the pPie object */ \n\t\t$PieChart = new \\pPie($myPicture,$MyData);\n\t\t\n\t\t/* Draw two AA pie chart */ \n\t\t$PieChart->draw2DPie(100,100,array(\"Border\"=>TRUE, \"Radius\"=>100));\n\t\t\n\t\t/* Write down the legend next to the 2nd chart*/\n\t\t$PieChart->drawPieLegend(100+150,100-80);\n\t\t\n\t\t/* Render the picture (choose the best way) */\n\t\t$myPicture->autoOutput(Yii::getAlias(\"@webroot\").\"/temp/example.drawPieLegendStatus.png\");\t\t\t\n\t}",
"public function response()\n {\n $count_households=new SampleChart;\n //Load village data\n $villages = Village::all()->sortBy(\"village_name\");\n $village_stats=Villagestat::all();\n foreach ($villages as $village) {\n $households[]=$village->households;\n $land[]=$village->land;\n foreach($village_stats as $vstat){\n if($village->id==$vstat->id){\n $rom_households[]=$vstat->rom_households_count;\n }\n }\n }\n $count_households->dataset('Households(total)', 'bar', $households)->color('#00ff00');\n $count_households->dataset('Romani households', 'bar', $rom_households)->color('#ff0000');\n return $count_households->api();\n\n }",
"function getStatistic() {\n\t\t$ret = array();\n\t\tforeach ($this->data as $entry) {\n\t\t\tif (array_key_exists($entry['entryType'], $ret)) {\n\t\t\t\t$ret[$entry['entryType']]++;\n\t\t\t} else {\n\t\t\t\t$ret[$entry['entryType']] = 1;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}",
"public function chart() {\n\n\t\t$data = array();\n\n\t\t$charts = FaceDetect::select( [ 'data', 'created_at' ] )->get( [\n\t\t\t'data',\n\t\t\t'created_at'\n\t\t] )->groupBy( function ( $date ) {\n\t\t\treturn Carbon::parse( $date->created_at )->format( 'm' );\n\t\t} )->toArray();\n\n\t\tforeach ( $charts as $key => $face ) {\n\n\t\t\tforeach ( $face as $index => $f ) {\n\t\t\t\t$date = explode( '-', Carbon::parse( $f['created_at'] )->format( 'Y-m-d' ) );\n\t\t\t\tforeach ( $f['data'] as $i => $item ) {\n\t\t\t\t\t$age [ $key ][] = $item['age'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data[] = [\n\t\t\t\t'age_max' => max( $age[ $key ] ),\n\t\t\t\t'age_min' => min( $age[ $key ] ),\n\t\t\t\t'age_avg' => intval( array_sum( [ max( $age[ $key ] ), min( $age[ $key ] ) ] ) / 2 ),\n\t\t\t\t'key' => $this->jdate_words( [ 'mm' => $this->gregorian_to_jalali( $date[0], $date[1], $date[2] )[1] ] )['mm']\n\t\t\t];\n\n\t\t}\n\n\t\treturn $data;\n\n\t}",
"public function getHistogramSerie();",
"public function handleChart()\n {\n $art = Article::where('category', 'Art')->get()->count();\n $design = Article::where('category', 'Design')->get()->count();\n $digitl = Article::where('category', 'Digitl')->get()->count();\n $computer = Article::where('category', 'Computer')->get()->count();\n $games = Article::where('category', 'Games')->get()->count();\n $study = Article::where('category', 'Study')->get()->count();\n\n $visitors = DB::table('articles')->sum('view_count');\n $hidden = Comment::where('is_visible', false)->get()->count();\n $shown = Comment::where('is_visible', true)->get()->count();\n\n \n \n\n $articleCount = DB::table('articles')->count();\n return view('dashboard', compact('visitors', 'hidden', 'shown', 'art', 'design', 'digitl', 'computer', 'games', 'study', 'articleCount'));\n }",
"public function getHairs()\n {\n return $this->hairs;\n }",
"public abstract function get_counts();",
"public function run()\n {\n $this->chart_of_accounts = [\n [\n 'code' => 1,\n 'name' => 'Assets',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 2,\n 'name' => 'Equity',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 3,\n 'name' => 'Income',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'I',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 4,\n 'name' => 'Expense',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'E',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 5,\n 'name' => 'Liabilities',\n 'parent_name' => 'COA',\n 'level' => 0,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 101,\n 'name' => 'Non Current Asset',\n 'parent_name' => 'Assets',\n 'level' => 1,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 102,\n 'name' => 'Current Asset',\n 'parent_name' => 'Assets',\n 'level' => 1,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 301,\n 'name' => 'Product Sale',\n 'parent_name' => 'Income',\n 'level' => 1,\n 'type' => 'I',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 302,\n 'name' => 'Service Income',\n 'parent_name' => 'Income',\n 'level' => 1,\n 'type' => 'I',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 401,\n 'name' => 'Default Expense',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 1,\n 'depreciation' => 1,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 402,\n 'name' => 'Material Purchase',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 403,\n 'name' => 'Employee Salary',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 404,\n 'name' => 'Machine Purchase',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 405,\n 'name' => 'Maintenance Service',\n 'parent_name' => 'Expense',\n 'level' => 1,\n 'type' => 'E',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 501,\n 'name' => 'Non Current Liabilities',\n 'parent_name' => 'Liabilities',\n 'level' => 1,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 502,\n 'name' => 'Current Liabilities',\n 'parent_name' => 'Liabilities',\n 'level' => 1,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 10101,\n 'name' => 'Inventory',\n 'parent_name' => 'Non Current Asset',\n 'level' => 1,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 10201,\n 'name' => 'Cash & Cash Equivalent',\n 'parent_name' => 'Current Asset',\n 'level' => 2,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 10202,\n 'name' => 'Account Receivable',\n 'parent_name' => 'Current Asset',\n 'level' => 2,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 50201,\n 'name' => 'Account Payable',\n 'parent_name' => 'Current Liabilities',\n 'level' => 2,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 50202,\n 'name' => 'Employee Ledger',\n 'parent_name' => 'Current Liabilities',\n 'level' => 2,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 50203,\n 'name' => 'Tax',\n 'parent_name' => 'Current Liabilities',\n 'level' => 2,\n 'type' => 'L',\n 'transaction' => 2,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020101,\n 'name' => 'Cash In Hand',\n 'parent_name' => 'Cash & Cash Equivalent',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020102,\n 'name' => 'Cash At Bank',\n 'parent_name' => 'Cash & Cash Equivalent',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020103,\n 'name' => 'Cash At Mobile Bank',\n 'parent_name' => 'Cash & Cash Equivalent',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020201,\n 'name' => 'Customer Receivable',\n 'parent_name' => 'Account Receivable',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n [\n 'code' => 1020202,\n 'name' => 'Loan Receivable',\n 'parent_name' => 'Account Receivable',\n 'level' => 3,\n 'type' => 'A',\n 'transaction' => 2,\n 'general_ledger' => 1,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n // [\n // 'code' => 5020101,\n // 'name' => 'Supplier Name',\n // 'parent_name' => 'Account Payable',\n // 'level' => 3,\n // 'type' => 'L',\n // 'transaction' => 1,\n // 'general_ledger' => 0,\n // 'customer_id' => null,\n // 'supplier_id' => null,\n // 'budget' => null,\n // 'depreciation' => null,\n // 'depreciation_rate' => 0.00,\n // 'status' => 1,\n // 'created_by' => 'SuperAdmin'\n // ],\n [\n 'code' => 10202010001,\n 'name' => '1-Walking Customer',\n 'parent_name' => 'Customer Receivable',\n 'level' => 4,\n 'type' => 'A',\n 'transaction' => 1,\n 'general_ledger' => 2,\n 'customer_id' => null,\n 'supplier_id' => null,\n 'budget' => 2,\n 'depreciation' => 2,\n 'depreciation_rate' => 0.00,\n 'status' => 1,\n 'created_by' => 'SuperAdmin'\n ],\n ];\n foreach ($this->chart_of_accounts as $account) {\n ChartOfAccount::updateOrCreate($account);\n }\n \n }",
"public function index()\n {\n $category = new Category;\n $data = collect([]);\n $label = collect([]);\n $cc = CompanyCategories::all();\n foreach($cc as $c){\n $label->push($c->name);\n $data->push($c->companies->count());\n }\n $category->labels($label);\n $category->dataset('My dataset', 'pie',$data)->options([\n 'color' => '#ff0000',\n 'backgroundColor'=>['#ff22ff','#ffee89','#f35f9f','#4aef3f','#aaeeff'],\n 'displayAxes'=>false,\n 'doughnut'=>20,\n 'displayLegend'=>false,\n ]);\n\n $data = Letter::selectRaw('month as bulan, count(month) as month')\n ->groupBy('month')\n\t\t->groupBy('year')\n ->orderBy('month')\n ->whereHas('history_last',function($query){\n $query->where(\"status_id\",\"<>\", 1);\n })\n ->get()\n\t\t->map(function($item){\n //dd($item);\n return ['month'=>$item->bulan,'jumlah'=>$item->month];\n });\n \n\t\t$mydata=[];\n\t\t\n\t\t\tfor($i=1; $i <=12; $i++) {\n\t\t\t\t$k=0;\n\t\t\t\tforeach($data as $value=>$lable) {\t\t\n\t\t\t\t\tif($i == $lable['month']){\n\t\t\t\t\t\t$k++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($k>0){\n\t\t\t\t\tarray_push($mydata,$lable['jumlah']);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tarray_push($mydata,0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t$mydata;\n\t\t//dd($mydata);\n $bar = new Category;\n $lable = collect(config('month'));\n $bar->labels(['jan','feb','mar','apr','mei','jun','jul','agt','sept','okt','nov','des']);\n $bar->dataset('Jumlah Tunggakan ' . Carbon::now()->format('Y'),'bar',$mydata)->options([\n 'backgroundColor'=>['#ff22ff','#ffee89','#3fAfff','#4aef3f','#aaeeff','#aa00FF','#ff223F','#9999ee','#F39A83','#2244AA','#AABB44','#44BBAA'],\n ]);\n\n return view('home',compact('category', 'bar'));\n }",
"public function humidityScore();",
"public function tempHumScore();",
"public function drawProgressChart() {\n $pid = $this->session->userdata('project_id');\n\n if (empty($this->chart_model->getNotFinishedCount($pid)) && empty($this->chart_model->getFinishedCount($pid)))\n $this->data['display'] = 1;\n\n $category = array();\n $category['name'] = 'Category';\n\n $series1 = array();\n $series1['name'] = 'Open Test Cases';\n\n $series2 = array();\n $series2['name'] = 'Closed Test Cases ';\n\n $category['data'][] = $this->chart_model->getProjectName($pid);\n $series1['data'][] = $this->chart_model->getNotFinishedCount($pid);\n $series2['data'][] = $this->chart_model->getFinishedCount($pid);\n\n $result = array();\n array_push($result, $category);\n array_push($result, $series1);\n array_push($result, $series2);\n\n print json_encode($result, JSON_NUMERIC_CHECK);\n\n return $result;\n }",
"public function actionChart()\n {\n $data = Account::find()->where('id_user='.Yii::$app->user->id)->all();\n $accounts = ArrayHelper::map($data, 'id', 'title');\n\n $operationsByAccount = [];\n foreach($accounts as $id_account=>$title){\n $operations = OperationController::findOperationsOfAccount($id_account);\n $operationsByAccount[$title] = $this->splitValueByMonths($operations);\n }\n\n $chart = new Chart($operationsByAccount);\n $data = $chart->data;\n\n return $this->render('chart', [\n 'data' => $data,\n ]);\n }",
"public function getHerosCount()\n {\n return $this->count(self::_HEROS);\n }",
"public function getHerosCount()\n {\n return $this->count(self::_HEROS);\n }",
"function calculate_data() {\n $this->data = array();\n $this->data['series'] = array();\n\n $series_size = 0;\n\n $series_list = $this->calculate_series_list();\n foreach($series_list as $key => $value) {\n $this->data['series'][$value] = $this->calculate_series($key);\n\n if($series_size < count($this->data['series'][$value])) {\n $series_size = count($this->data['series'][$value]);\n }\n }\n\n $this->data['labels'] = $this->calculate_labels($series_size);\n }",
"function bytesContentTypeChart($hStats) {\n\t$aVarValues = array();\n\t$aVarNames = array();\n\t$kb = formatSize($hStats['bytesHtml']);\n\tif ( $kb ) {\n\t\t$aVarValues[] = $kb;\n\t\t$aVarNames[] = \"HTML - $kb kB\";\n\t}\n\t$kb = formatSize($hStats['bytesImg']);\n\tif ( $kb ) {\n\t\t$aVarValues[] = $kb;\n\t\t$aVarNames[] = \"Images - $kb kB\";\n\t}\n\t$kb = formatSize($hStats['bytesJS']);\n\tif ( $kb ) {\n\t\t$aVarValues[] = $kb;\n\t\t$aVarNames[] = \"Scripts - $kb kB\";\n\t}\n\t$kb = formatSize($hStats['bytesCSS']);\n\tif ( $kb ) {\n\t\t$aVarValues[] = $kb;\n\t\t$aVarNames[] = \"Stylesheets - $kb kB\";\n\t}\n\t$kb = formatSize($hStats['bytesFlash']);\n\tif ( $kb ) {\n\t\t$aVarValues[] = $kb;\n\t\t$aVarNames[] = \"Flash - $kb kB\";\n\t}\n\t$kb = formatSize($hStats['bytesJson'] + $hStats['bytesOther']);\n\tif ( $kb ) {\n\t\t$aVarValues[] = $kb;\n\t\t$aVarNames[] = \"Other - $kb kB\";\n\t}\n\n\treturn pieChart(\"Average Bytes per Page by Content Type\", \"bytesperpage\", $aVarNames, $aVarValues, \"007099\", \n\t\t\t\t\t\"total \" . formatSize($hStats['bytesTotal']) . \" kB\");\n}",
"public function chartData()\n {\n // Data tanggal selama 7 hari\n foreach(range(0, 7) as $day) {\n $dates[] = Carbon::now()->subDays($day)->format('yy-m-d');\n $tanggal = array_reverse($dates);\n }\n\n // Jumlah buku yang dipinjam per hari selama 1 mingggu\n foreach($tanggal as $date){\n $chartdata = Peminjaman::select(DB::raw('DATE(tanggal_pinjam) as date'))\n ->selectRaw('count(tanggal_pinjam) as jumlah')\n ->where('tanggal_pinjam', 'like', '%'.$date.'%')\n ->orderBy('tanggal_pinjam')\n ->groupBy('date')\n ->pluck('jumlah')\n ->toArray();\n\n if($chartdata){\n $jumlah[] = $chartdata[0];\n }else {\n $jumlah[] = 0;\n }\n }\n \n return response()->json([\n 'jumlah' => $jumlah,\n 'tanggal' => $tanggal\n ]);\n }",
"public function charts()\n {\n\n $male_chart_1 = Employee::where('gender', '=', 'M')->count();\n $female_chart_1 = Employee::where('gender', '=', 'F')->count();\n\n $emp_hire_date_1 = Employee::where('hire_date', 'like', '1987%')->count();\n $emp_hire_date_2 = Employee::where('hire_date', 'like', '1988%')->count();\n $emp_hire_date_3 = Employee::where('hire_date', 'like', '1989%')->count();\n $emp_hire_date_4 = Employee::where('hire_date', 'like', '1990%')->count();\n $emp_hire_date_5 = Employee::where('hire_date', 'like', '1991%')->count();\n $emp_hire_date_6 = Employee::where('hire_date', 'like', '1992%')->count();\n $emp_hire_date_7 = Employee::where('hire_date', 'like', '1993%')->count();\n $emp_hire_date_8 = Employee::where('hire_date', 'like', '1994%')->count();\n $emp_hire_date_9 = Employee::where('hire_date', 'like', '1995%')->count();\n $emp_hire_date_10 = Employee::where('hire_date', 'like', '1996%')->count();\n $emp_hire_date_11 = Employee::where('hire_date', 'like', '1997%')->count();\n $emp_hire_date_12 = Employee::where('hire_date', 'like', '1998%')->count();\n $emp_hire_date_13 = Employee::where('hire_date', 'like', '1999%')->count();\n $emp_hire_date_14 = Employee::where('hire_date', 'like', '1986%')->count();\n $emp_hire_date_15 = Employee::where('hire_date', 'like', '1985%')->count();\n\n $emp_dep_number_1 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Customer Service')->count();\n $emp_dep_number_2 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Development')->count();\n $emp_dep_number_3 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Finance')->count();\n $emp_dep_number_4 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Human Resources')->count();\n $emp_dep_number_5 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Marketing')->count();\n $emp_dep_number_6 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Production')->count();\n $emp_dep_number_7 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Quality Management')->count();\n $emp_dep_number_8 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Research')->count();\n $emp_dep_number_9 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Sales')->count();\n\n $emp_hire_date_female_1 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1985%')->count();\n $emp_hire_date_female_2 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1986%')->count();\n $emp_hire_date_female_3 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1987%')->count();\n $emp_hire_date_female_4 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1988%')->count();\n $emp_hire_date_female_5 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1989%')->count();\n $emp_hire_date_female_6 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1990%')->count();\n $emp_hire_date_female_7 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1991%')->count();\n $emp_hire_date_female_8 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1992%')->count();\n $emp_hire_date_female_9 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1993%')->count();\n $emp_hire_date_female_10 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1994%')->count();\n $emp_hire_date_female_11 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1995%')->count();\n $emp_hire_date_female_12 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1996%')->count();\n $emp_hire_date_female_13 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1997%')->count();\n $emp_hire_date_female_14 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1998%')->count();\n $emp_hire_date_female_15 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'F')\n ->where('employees.hire_date', 'like', '1999%')->count();\n\n $emp_hire_date_male_1 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1985%')->count();\n $emp_hire_date_male_2 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1986%')->count();\n $emp_hire_date_male_3 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1987%')->count();\n $emp_hire_date_male_4 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1988%')->count();\n $emp_hire_date_male_5 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1989%')->count();\n $emp_hire_date_male_6 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1990%')->count();\n $emp_hire_date_male_7 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1991%')->count();\n $emp_hire_date_male_8 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1992%')->count();\n $emp_hire_date_male_9 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1993%')->count();\n $emp_hire_date_male_10 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1994%')->count();\n $emp_hire_date_male_11 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1995%')->count();\n $emp_hire_date_male_12 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1996%')->count();\n $emp_hire_date_male_13 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1997%')->count();\n $emp_hire_date_male_14 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1998%')->count();\n $emp_hire_date_male_15 = Employee::\n join('titles', 'titles.emp_no', '=', 'employees.emp_no')\n ->join('salaries', 'salaries.emp_no', '=', 'employees.emp_no')\n ->join('dept_emp', 'dept_emp.emp_no', '=', 'employees.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('employees.gender', '=', 'M')\n ->where('employees.hire_date', 'like', '1999%')->count();\n\n $dept_avg_salary_1 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Customer Service')->avg('salary');\n $dept_avg_salary_2 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Development')->avg('salary');\n $dept_avg_salary_3 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Finance')->avg('salary');\n $dept_avg_salary_4 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Human Resources')->avg('salary');\n $dept_avg_salary_5 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Marketing')->avg('salary');\n $dept_avg_salary_6 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Production')->avg('salary');\n $dept_avg_salary_7 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Quality Management')->avg('salary');\n $dept_avg_salary_8 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Research')->avg('salary');\n $dept_avg_salary_9 = Salary::\n join('dept_emp', 'dept_emp.emp_no', '=', 'salaries.emp_no')\n ->join('departments', 'departments.dept_no', '=', 'dept_emp.dept_no')\n ->where('departments.dept_name', '=', 'Sales')->avg('salary');\n\n\n\n\n $array = array (\n 'male' => $male_chart_1,\n 'female' => $female_chart_1,\n 'emp_hire_date_1' => $emp_hire_date_1,\n 'emp_hire_date_2' => $emp_hire_date_2,\n 'emp_hire_date_3' => $emp_hire_date_3,\n 'emp_hire_date_4' => $emp_hire_date_4,\n 'emp_hire_date_5' => $emp_hire_date_5,\n 'emp_hire_date_6' => $emp_hire_date_6,\n 'emp_hire_date_7' => $emp_hire_date_7,\n 'emp_hire_date_8' => $emp_hire_date_8,\n 'emp_hire_date_9' => $emp_hire_date_9,\n 'emp_hire_date_10' => $emp_hire_date_10,\n 'emp_hire_date_11' => $emp_hire_date_11,\n 'emp_hire_date_12' => $emp_hire_date_12,\n 'emp_hire_date_13' => $emp_hire_date_13,\n 'emp_hire_date_15' => $emp_hire_date_14,\n 'emp_hire_date_14' => $emp_hire_date_15,\n 'emp_dep_number_1' => $emp_dep_number_1,\n 'emp_dep_number_2' => $emp_dep_number_2,\n 'emp_dep_number_3' => $emp_dep_number_3,\n 'emp_dep_number_4' => $emp_dep_number_4,\n 'emp_dep_number_5' => $emp_dep_number_5,\n 'emp_dep_number_6' => $emp_dep_number_6,\n 'emp_dep_number_7' => $emp_dep_number_7,\n 'emp_dep_number_8' => $emp_dep_number_8,\n 'emp_dep_number_9' => $emp_dep_number_9,\n 'emp_hire_date_female_1' =>$emp_hire_date_female_1,\n 'emp_hire_date_female_2' =>$emp_hire_date_female_2,\n 'emp_hire_date_female_3' =>$emp_hire_date_female_3,\n 'emp_hire_date_female_4' =>$emp_hire_date_female_4,\n 'emp_hire_date_female_5' =>$emp_hire_date_female_5,\n 'emp_hire_date_female_6' =>$emp_hire_date_female_6,\n 'emp_hire_date_female_7' =>$emp_hire_date_female_7,\n 'emp_hire_date_female_8' =>$emp_hire_date_female_8,\n 'emp_hire_date_female_9' =>$emp_hire_date_female_9,\n 'emp_hire_date_female_10' =>$emp_hire_date_female_10,\n 'emp_hire_date_female_11' =>$emp_hire_date_female_11,\n 'emp_hire_date_female_12' =>$emp_hire_date_female_12,\n 'emp_hire_date_female_13' =>$emp_hire_date_female_13,\n 'emp_hire_date_female_14' =>$emp_hire_date_female_14,\n 'emp_hire_date_female_15' =>$emp_hire_date_female_15,\n 'emp_hire_date_male_1' =>$emp_hire_date_male_1,\n 'emp_hire_date_male_2' =>$emp_hire_date_male_2,\n 'emp_hire_date_male_3' =>$emp_hire_date_male_3,\n 'emp_hire_date_male_4' =>$emp_hire_date_male_4,\n 'emp_hire_date_male_5' =>$emp_hire_date_male_5,\n 'emp_hire_date_male_6' =>$emp_hire_date_male_6,\n 'emp_hire_date_male_7' =>$emp_hire_date_male_7,\n 'emp_hire_date_male_8' =>$emp_hire_date_male_8,\n 'emp_hire_date_male_9' =>$emp_hire_date_male_9,\n 'emp_hire_date_male_10' =>$emp_hire_date_male_10,\n 'emp_hire_date_male_11' =>$emp_hire_date_male_11,\n 'emp_hire_date_male_12' =>$emp_hire_date_male_12,\n 'emp_hire_date_male_13' =>$emp_hire_date_male_13,\n 'emp_hire_date_male_14' =>$emp_hire_date_male_14,\n 'emp_hire_date_male_15' =>$emp_hire_date_male_15,\n 'dept_avg_salary_1' => $dept_avg_salary_1,\n 'dept_avg_salary_2' => $dept_avg_salary_2,\n 'dept_avg_salary_3' => $dept_avg_salary_3,\n 'dept_avg_salary_4' => $dept_avg_salary_4,\n 'dept_avg_salary_5' => $dept_avg_salary_5,\n 'dept_avg_salary_6' => $dept_avg_salary_6,\n 'dept_avg_salary_7' => $dept_avg_salary_7,\n 'dept_avg_salary_8' => $dept_avg_salary_8,\n 'dept_avg_salary_9' => $dept_avg_salary_9,\n );\n //dd($male);\n //dd($employeesChart);\n return view('chart_list', ['data' => $array]);\n }",
"public function typeCounts() : array\n {\n $counts = [\n self::CATEGORICAL => 0,\n self::CONTINUOUS => 0,\n self::RESOURCE => 0,\n ];\n\n return array_replace($counts, array_count_values($this->types()));\n }",
"function seriesResistance($arr){\n $sum = array_sum($arr);\n\n if($sum <= 1 ){\n return $sum . \" ohm\";\n }\n return $sum . \" ohms\";\n}"
]
| [
"0.54819995",
"0.5434527",
"0.54248005",
"0.5398557",
"0.5346674",
"0.5335878",
"0.53230256",
"0.531596",
"0.52499646",
"0.52149147",
"0.5196234",
"0.51766735",
"0.5167368",
"0.516649",
"0.5153572",
"0.51402336",
"0.5114868",
"0.51120186",
"0.5098389",
"0.5082726",
"0.5064891",
"0.5045324",
"0.50432175",
"0.50432175",
"0.5007378",
"0.50001836",
"0.49745607",
"0.49655944",
"0.49593225",
"0.49500707"
]
| 0.5595486 | 0 |
this is for the inventory getting the number of inventory total alive | function getTotalnventory($id){
$crud = new CRUD();
$crud->connect();
$crud -> sql("select *, COUNT(mortality_status) from pigs_tbl where mortality_status='alive' ");
$r = $crud->getResult();
foreach($r as $rs){
return $rs['COUNT(mortality_status)'];
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getInventoryCount()\n {\n return $this->where('quantity', '<>', '0')->get()->fetch('quantity')->sum();\n }",
"public function numberOfEquipmentFound()\n {\n return count($this->getLoanedEquipment());\n\n }",
"public function getEquipmentingItemCount()\n {\n return $this->count(self::EQUIPMENTING_ITEM);\n }",
"function inventory_total($inventory) {\n $inventory_total = 0;\n foreach ($inventory as $product_id => $quantity) {\n $inventory_total += $quantity;\n }\n return $inventory_total;\n}",
"function total_items(){\n\t\tif(isset($_GET['add_cart'])){\n\t\t\tglobal $connection;\n\t\t\t$ip=getIp();\n\t\t\t$get_items=\"select * from cart where ip_address='$ip'\";\n\t\t\t$run_items=mysqli_query($connection,$get_items);\n\t\t\t$count_items=mysqli_num_rows($run_items); \n\t\t}else{\n\t\t\tglobal $connection;\n\t\t\t\t$ip=getIp();\n\t\t\t$get_items=\"select * from cart where ip_address='$ip'\";\n\t\t\t$run_items=mysqli_query($connection, $get_items);\n\t\t\t$count_items=mysqli_num_rows($run_items); \n\t\t\t}\n\t\t\techo $count_items;\n\t\t}",
"public function getQuantity()\n {\n $channelInventorySourceIds = $this->channel->inventory_sources->where('status', 1)->pluck('id');\n\n $qty = 0;\n\n foreach ($this->product->inventories as $inventory) {\n if (is_numeric($channelInventorySourceIds->search($inventory->inventory_source_id))) {\n $qty += $inventory->qty;\n }\n }\n\n $orderedInventory = $this->product->ordered_inventories\n ->where('channel_id', $this->channel->id)->first();\n\n if ($orderedInventory) {\n $qty -= $orderedInventory->qty;\n }\n\n return $qty;\n }",
"function totalItems() {\n if(isset($_GET['add_cart'])) {\n\n global $con;\n\n $ip = getIp();\n\n $run_items = mysqli_query($con, \"SELECT * FROM cart WHERE ip_add='$ip'\");\n\n $count_items = mysqli_num_rows($run_items);\n\n } else {\n global $con;\n\n $ip = getIp();\n\n $run_items = mysqli_query($con, \"SELECT * FROM cart WHERE ip_add='$ip'\") or die(mysqli_error($con));\n\n $count_items = mysqli_num_rows($run_items);\n\n while($get_items = mysqli_fetch_array($run_items)) {\n\n $pro_qty = $get_items['qty'];\n if($pro_qty > 1) {\n $count_items = $count_items + $pro_qty - 1;\n }\n }\n }\n\n echo $count_items;\n\n }",
"public function buildHealth(): int {\n\n if ($this->character->is_dead) {\n return 0;\n }\n\n $baseHealth = $this->character->dur + 10;\n\n foreach ($this->fetchInventory() as $slot) {\n if ($slot->equipped) {\n $percentage = $slot->item->getTotalPercentageForStat('dur');\n\n $baseHealth += $baseHealth * $percentage;\n }\n }\n\n return $baseHealth;\n }",
"public function getQuantityAvailable(): int;",
"public function count_inventory( $pBuffer = FALSE )\n\t{\n\t\ttry {\n\t\t\t$invsize = $this->steam_command(\n\t\t\t$this,\n\t\t\t\t\t\"get_size\",\n\t\t\tarray(),\n\t\t\t$pBuffer\n\t\t\t);\n\t\t} catch (steam_exception $e) { //this will happen on e.g. /home; function not allowed for this folder\n\t\t\t$invsize = sizeof($this->get_inventory());\n\t\t}\n\t\treturn $invsize;\n\t}",
"function getOverallRemain(){\n\t\t$t=0;\n\t\t$a = Item::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('status', 'delivered')->count();\n\t\t$r=intVal(intVal($dur)-intVal($sl));\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}",
"public function count_items() {\n\t\treturn SalesHistoryDetailQuery::create()->filterByOrdernumber($this->oehhnbr)->count();\n\t}",
"public function getTotal():int{\r\n\t return (int)$this->_vars['total_items']??0;\r\n\t}",
"public function getLootCount()\n {\n return $this->count(self::_LOOT);\n }",
"public function modelTotalRecord(){\n $conn = Connection::getInstance();\n // thuc hien truy van\n $query = $conn->query(\"select id from inventory\");\n // tra ve so ban ghi\n return $query->rowCount();\n }",
"public function getHpCount()\n {\n return $this->count(self::_HP);\n }",
"function total_items(){\n \n \tglobal $con; \n\t$ip = getIp(); \n\t$count_items=0;\n\tif(isloggedin()){\n\t $c_id=$_SESSION['cid'];\n\t \n\t $get_items = \"select * from cart where customer_id='$c_id'\";\n\t\t$run_items = mysqli_query($con, $get_items); \n\t\twhile($items=mysqli_fetch_array($run_items)){\n\t\t $item_qty=$items['qty'];\n\t\t \n\t\t $count_items += $item_qty;\n\t\t \n\t\t}\n\t\t\n\t}\n\telse{\n\t\t$get_items = \"select * from cart where ip_add='$ip' AND customer_id='0'\";\n\t\t$run_items = mysqli_query($con, $get_items); \n\t\twhile($items=mysqli_fetch_array($run_items)){\n\t\t $item_qty=$items['qty'];\n\t\t \n\t\t $count_items += $item_qty;\n\t\t \n\t\t}\n\t\t \n\t}\n \n\techo $count_items.\" \";\n\t}",
"function totalItems(){\n\tif (isset($_GET['addCart'])) {\n\t\tglobal $conn;\n\t\t$ipAddr=getIp();\n\n\t\t$getItems=\"SELECT * FROM cart WHERE ipAddr='$ipAddr'\";\n\t\t$runGetItems=mysqli_query($conn, $getItems);\n\n\t\t$countItems=mysqli_num_rows($runGetItems);\n\t}else{\n\n\t\tglobal $conn;\n\t\t$ipAddr=getIp();\n\n\t\t$getItems=\"SELECT * FROM cart WHERE ipAddr='$ipAddr'\";\n\t\t$runGetItems=mysqli_query($conn, $getItems);\n\n\t\t$countItems=mysqli_num_rows($runGetItems);\n\t}\n\n\techo $countItems;\n}",
"function panier_get_count() {\n global $panier;\n $resultat = 0;\n foreach ($panier as $item) {\n $resultat+= $item[PS_PANIER_ITEM_QTY];\n }\n return $resultat;\n}",
"function items() {\n\t\n if(isset($_GET['add_cart'])){\n\t\n\t global $db;\n\t \n\t $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); /* Counting how many items user has added to cart*/\n\t }\t\n\t\n\telse \n\t{\n\t global $db;\n\t \n $ip_add = getRealIpAddr();\n\t \n\t $get_items = \"SELECT * FROM cart WHERE ip_add = '$ip_add' \";\n\t \n\t $run_items = mysqli_query($db,$get_items);\n\n\t $count_items = mysqli_num_rows($run_items); \t \n\t\t\n\t\t\n\t}\n\n\t echo $count_items;\n\t}",
"function itemCount(){\n\n global $conn;\n\n $ip_add = getUserIp();\n $item_count = \"SELECT * FROM cart WHERE ip_address = '$ip_add'\";\n $run_count = mysqli_query($conn, $item_count) or die(\"item_count query failed\");\n $count = mysqli_num_rows($run_count);\n\n if($count > 0){\n echo $count;\n }else{\n echo \"0\";\n } \n }",
"function items(){\n\tif(isset($_GET['add_cart'])){\n\t\t\n\t\tglobal $db;\n\t\t\n\t $ip_add = getRealIpAddr();\n\t\t\n\t\t$get_items = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_items = mysqli_query($db,$get_items);\n\t\t\n\t\t$count_items = mysqli_num_rows($run_items);\n\t\t\n\t}\n\telse {\n\t\t\n\t\tglobal $db;\n\t\t\n\t\t$ip_add = getRealIpAddr();\n\t\t\n\t\t$get_items = \"select * from cart where ip_add='$ip_add'\";\n\t\t\n\t\t$run_items = mysqli_query($db,$get_items);\n\t\t\n\t\t$count_items = mysqli_num_rows($run_items);\n\t\t\t\t}\n\t\n\techo $count_items;\n\t\n}",
"public function getTotalAmountFromWoodItems()\n {\n $total = 0;\n // #179 - Add Wood Products if they exist to Cabinet Items.\n foreach ($this->quote->cabinets AS $cabinet)\n {\n if ($cabinet->wood_xml)\n {\n $woods = self::returnWoodArray($cabinet);\n foreach ($woods AS $wood)\n {\n\n $total += $wood['qty'] * $wood['price'];\n }\n }\n }\n return $total;\n }",
"public function getHpInfoCount()\n {\n return $this->count(self::_HP_INFO);\n }",
"function total_items(){\n\tif (isset($_GET['add_cart'])) {\n\tglobal $conn;\n\t$ip = getIp();\n\t$sql = \"SELECT * FROM cart where ip_add='$ip'\";\n\t\t$result = $conn->query($sql);\n\t\t$count_items = $result->num_rows;\n}else{\n\tglobal $conn;\n\t$ip = getIp();\n\t$sql = \"SELECT * FROM cart where ip_add='$ip'\";\n\t\t$result = $conn->query($sql);\n\t\t$count_items = $result->num_rows;\n}\necho \"$count_items\";\n}",
"function get_inventory_onhand($pcservno){\n\t$oConn = get_coneccion(\"CIA\");\n\t$lcsqlcmd = \"SELECT aradjt.cservno,\n\t\t\t\t\t sum(aradjt.nqty) as nqty\n\t\t\t\t FROM aradjm\n\t\t\t\t left outer join aradjt on aradjm.cadjno = aradjt.cadjno\n\t\t\t\t left outer join arserm on arserm.cservno = aradjt.cservno\n\t\t\t\t left outer join arcate on arcate.ccateno = aradjm.ccateno AND arcate.ctypecate = 'A'\n\t\t\t\t where arserm.lupdateonhand = true AND \n\t\t\t\t \t aradjm.lvoid = false and \n\t\t\t\t\t aradjt.cservno = '$pcservno' \n\t\t\t\t group by 1\n\t\t\t\t union all \n\t\t\t\t SELECT arinvt.cservno,\n\t\t\t\t\t\tsum(arinvt.nqty * -1) as nqty\n\t\t\t\tFROM arinvc\n\t\t\t\tLEFT OUTER JOIN arinvt on arinvc.cinvno = arinvt.cinvno\n\t\t\t\tLEFT OUTER JOIN arserm on arserm.cservno = arinvt.cservno\n\t\t\t\tleft outer join artcas on artcas.cpaycode = arinvc.cpaycode\n\t\t\t\twhere arserm.lupdateonhand = true and\n\t\t\t\t\t arinvc.lvoid = false and \n\t\t\t\t\t arinvt.cservno = '$pcservno' \n\t\t\t\tgroup by 1\n\t\t\t\";\t\n\t// determinando cuanto producto queda segun el caso \n\t$lnqty = 0;\n\t$lcresult = mysqli_query($oConn,$lcsqlcmd);\n\twhile($lnrowqty = mysqli_fetch_assoc($lcresult)){\n\t\t$lnqty += $lnrowqty[\"nqty\"];\t\n\t}\n\techo $lnqty;\n\t\n\t/*\t\n\t$lcResult = mysqli_query($oConn,$lcsqlcmd); // $oConn->query($lcSqlCmd);\n\t// convirtiendo estos datos en un array asociativo\n\t$ldata = mysqli_fetch_assoc($lcResult);\n\t// convirtiendo este array en archivo jason.\n\t$jsondata =json_encode($ldata,true);\n\t// retornando objeto json\n\techo $jsondata;\n\t*/\n}",
"function total_items(){\n\n\tif(isset($_GET['add_cart'])){\n\t\tglobal $con;\n\t\t$ip=getIp();\n\n\t\t$get_items = \"select * from cart where ip_add='$ip'\"; //this statement will get the ip address using the getip function above and match it with the database to see if any products are there corresponding to this ip\n\n\t\t$run_items = mysqli_query($con, $get_items);\n\n\t\t$count_items= mysqli_num_rows($run_items);\n\t}\n\t\telse{\n\t\t\t$ip=getIp();\n global $con;\n\t\t$get_items = \"select * from cart where ip_add='$ip'\";//the ip address will have the products that the user added into the cart and show it using this function\n\n\t\t$run_items = mysqli_query($con, $get_items);\n\n\t\t$count_items= mysqli_num_rows($run_items);\n\n\t\t}\n\t\techo $count_items;\n\n}",
"public function getTotalItems()\n {\n $total = 0;\n \n foreach ($this->items as $item) {\n $total += ($item->Quantity) ? $item->Quantity : 1;\n }\n\n return $total;\n }",
"function total(){\n\n\tif(isset($_GET['add_cart'])){\n\n\t\tglobal $con;\n\n\t\t$ip = getIp();\n\n\t\t$get_items = \"select * from cart where ip_add='$ip'\";\n\n\t\t$run_items = mysqli_query($con, $get_items);\n\n\t\t$count_items = mysqli_num_rows($run_items);\n\t\n}\n\t\telse{\n\n\t\t\tglobal $con;\n\n\t\t\t$ip = getIp();\n\n\t\t\t$get_items = \"select * from cart where ip_add='$ip'\";\n\n\t\t\t$run_items = mysqli_query($con, $get_items);\n\n\t\t\t$count_items = mysqli_num_rows($run_items);\n\t\t\t}\n\n\t\techo $count_items;\n\t}",
"public function getTargetInventoryQuantity()\n {\n return $this->targetInventoryQuantity;\n }"
]
| [
"0.75134",
"0.66749376",
"0.66028506",
"0.65532047",
"0.6393628",
"0.63694805",
"0.6328811",
"0.6265484",
"0.6256782",
"0.6253664",
"0.6193241",
"0.6181111",
"0.61423075",
"0.6136087",
"0.6123655",
"0.6093014",
"0.6070523",
"0.6057269",
"0.6054775",
"0.6042117",
"0.60411024",
"0.6032999",
"0.6015439",
"0.6013093",
"0.6010821",
"0.6009936",
"0.6001928",
"0.59950227",
"0.5991515",
"0.59741056"
]
| 0.6730798 | 1 |
this function is for inventory date | function getInventoryDate($id){
$crud = new CRUD();
$crud->connect();
$now = date('m/d/Y');
$crud->sql("select * from inventory_tbl where inventory_date='{$now}'");
$r = $crud->getResult();
foreach($r as $rs){
return $rs['inventory_date'];
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getInvdate()\n {\n return $this->invdate;\n }",
"public function getDateDebut();",
"public function get_inventory($date = NULL, $action = 'add'){\n\t\tif($date != NULL && $action != NULL) {\n\t\t\t$date = date('Y-m-d', strtotime($date)) ;\n\t\t\t$sql = \"SELECT * FROM \".PRE.\"inventory WHERE status = 1 AND inventory_date = :inventory_date AND inventory_action = :inventory_action ORDER BY id DESC\";\n\t\t\t$stmt = $this->pdo->prepare($sql);\n\t\t\t$stmt->execute(array(':inventory_date' => $date, ':inventory_action' => $action));\n\t\t} else {\n\t\t\t$sql = \"SELECT * FROM \".PRE.\"inventory WHERE status = 1 ORDER BY id DESC\";\n\t\t\t$stmt = $this->pdo->prepare($sql);\n\t\t\t$stmt->execute();\n\t\t}\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\treturn $row;\n\t}",
"public function add_product_release_date_item_meta( $items, $order ) {\n\n\n\t\tif ( self::order_contains_pre_order( $order ) ) {\n\n\t\t\t$name = get_option( 'wc_pre_orders_availability_date_cart_title_text' );\n\n\t\t\tforeach ( $items as &$item ) {\n\t\t\t\tif ( 'line_item' === $item['type'] ) {\n\t\t\t\t\t$product = get_product( $item['product_id'] );\n\t\t\t\t\t$item['item_meta'][ $name ][0] = WC_Pre_Orders_Product::get_localized_availability_date( $product );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $items;\n\t}",
"function wc_marketplace_date() {\n global $wmp;\n $wmp->output_report_date();\n }",
"public function add_inventory() {\n\t\t$values=array(\"brand_id\"=>$_POST['brand_list_id'],\"product_id\"=>$_POST['product_list_id'],\"item_name\"=>$_POST['item_name'],\"entry_date\"=>$_POST['purchase_date'],\"buy_price\"=>$_POST['product_buy_price'],\"sell_price\"=>$_POST['product_sell_price'],\"quantity\"=>$_POST['item_qty'],\"update_by\"=>isset($_SESSION['user_id']));\n\t\tif($this->insert(\"inventory\",$values)) {\t\n\t\t\t$result=$this->runQuery('getAll','select max(id) as inv_item_id from inventory');\n\t\t\techo '{\"inventoryItemList\":{\"updateFlag\":false,\"item\":'.json_encode($result).'}}';\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting inventory tbl';\n\t}",
"public function getDate();",
"public function getDate();",
"function wc_marketplace_date2() {\n global $wmp;\n $wmp->output_report_date2();\n }",
"public function getDate() {\n if($this->items!==false)\n $date = date('Y-m-d H:i:s',strtotime(@current($this->items)->created_at));\n if(strlen($date)==0)\n $date = date('Y-m-d H:i:s');\n return $date;\n }",
"private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}",
"function vads_trans_date() {\n $date = date('YmdHis');\n return $date;\n }",
"public function requestDate();",
"function get_item_date($row=NULL, $field, $placeholder=false)\n {\n $return = '';\n if ($placeholder) $return = '[%'.$field.'%]';\n\n if (isset($row->$field))\n {\n $item_date = $row->$field;\n if ($item_date != NULL_DATE) $return = date('m/d/Y h:i A',strtotime($item_date));\n }\n\n return $return;\n }",
"private function compare_with_date()\n {\n }",
"function getinventory_for_hotel($hotel_id){\n $query =\"SELECT inventory.id as id, cast(date as date) as date,(inventory.total_available - inventory.booked - inventory.blocked) as final_available, inventory.category_id, room_categories.category_name, FROM `inventory` \n INNER JOIN room_categories on room_categories.id = inventory.category_id\n WHERE inventory.hotel_id = $hotel_id and date >= CURDATE()\";\n return $this->db->query($query)->result_array();\n }",
"public function show_sales_review_date()\n {\n $query = $this->db->query(\"SELECT `date`,`product_id`,`type`,`weight`, SUM(`amount`) as amoun,SUM(`price`) as price FROM `sales` WHERE DATE(`date`)=CURDATE() GROUP BY `product_id`\");\n return $query->result();\n }",
"public function datevs($date) {\n\t\n\t\n\t\n\t\treturn $date;\n\t\n\t}",
"public static\n\n\t\t// -- Function Name : getDateOfPurchase\n\t\t// -- Params : $id\n\t\t// -- Purpose : \n\t\tfunction getDateOfPurchase($id)\n\t\t{\n\t\t\t$sql = 'SELECT * FROM '.TABLE_PREFIX.'aircraft WHERE `enabled` = 1 AND id='.$id;\n\t\t\t$basicinfo = DB::get_row($sql);\n\t\t\t$planestr = $basicinfo->name;\n\t\t\t$planestr .= ' - '. $basicinfo->registration;\n\t\t\t$stringToLocate = 'Added the aircraft \"'.$planestr.'\"';\n\t\t\t$sql2 = 'SELECT * FROM `phpvms_adminlog` WHERE message LIKE \\''. $stringToLocate.'\\'';\n\t\t\t$dateofPurchase = DB::get_row($sql2);\n\t\t\treturn $dateofPurchase;\n\t\t}",
"function out($code=\"\", $category=\"\", $qty=0, $desc=\"\", $type=INVENTORY_TYPE, $warehouse=0)\n {\n $product = $this->m_product->getdata_detail(array(\"product_variant_code\"=>$code));\n\n // $data = $this->getdata(array(\"inventory_item_code\"=>$code, \"inventory_categories\"=>$category, \"inventory_operator\"=>\"in\"),1,\"\",\"inventory_id\",\"desc\");\n $data = $this->getdata(array(\"inventory_item_code\"=>$code, \"inventory_categories\"=>$category),1,\"\",\"inventory_id\",\"desc\");\n\n if($code==\"\" || $category==\"\" || $qty==\"\" || $product->num_rows()!=1 || $data->num_rows()!=1)\n {\n die(\"parameter out inventory harus di lengkapi, item code : $code, category : $category\");\n }\n\n // jika tidak ada item ini di inventory maka tidak perlu kalkulasi stock_awal, average_nominal dll\n if($data->num_rows()==1)\n {\n $nominal_average = $data->row()->inventory_average_nominal_now_per_item;\n $stock_awal = $data->row()->inventory_total_stock_now;\n $nominal_awal = $data->row()->inventory_total_nominal_now;\n $total_qty = $data->row()->inventory_total_stock_now - $qty;\n $total_nominal = $data->row()->inventory_total_nominal_now - ($data->row()->inventory_average_nominal_now_per_item*$qty);\n }\n\n // set nama product\n if($product->row()->product_variant_type==\"\" || $product->row()->product_variant_value==\"\")\n {\n $name = $product->row()->product_name;\n }\n else {\n $name = $product->row()->product_name.\" - \".$product->row()->product_variant_type.\" - \".$product->row()->product_variant_value;\n }\n\n // set log inventory\n if($desc==\"\")\n {\n $desc = \"insert by \".$this->session->userdata('username');\n }\n\n $data_insert = array(\n \"inventory_item_code\" => $code,\n \"inventory_name\" => $name,\n \"inventory_categories\" => $category,\n \"inventory_item_type\" => $type,\n \"inventory_operator\" => \"out\",\n \"inventory_qty\" => $qty,\n \"inventory_nominal_per_item\" => $nominal_average,\n \"inventory_total_nominal\" => $nominal_average*$qty,\n \"inventory_stock_awal\" => $stock_awal,\n \"inventory_nominal_stock_awal\" => $nominal_awal,\n \"inventory_average_nominal_now_per_item\" => $nominal_average,\n \"inventory_total_stock_now\" => $total_qty,\n \"inventory_total_nominal_now\" => $total_nominal,\n \"inventory_warehouse_id\" => $warehouse,\n \"inventory_date_craeted\" => date('Y-m-d H:i:s'),\n \"inventory_log\" => $desc,\n );\n $this->db->insert('inventory', $data_insert);\n return $this->db->insert_id();\n }",
"function column_date( $item ) {\r\n\t\tglobal $post;\r\n\r\n\t\tif ( '0000-00-00 00:00:00' == $item->post_date ) {\r\n\t\t\t$h_time = __( 'Unpublished', 'media-library-assistant' );\r\n\t\t} else {\r\n\t\t\t$post = $item; // Resolve issue with \"The Events Calendar\"\r\n\t\t\t$m_time = $item->post_date;\r\n\t\t\t$time = get_post_time( 'G', true, $item, false );\r\n\r\n\t\t\tif ( ( abs( $t_diff = time() - $time ) ) < 86400 ) {\r\n\t\t\t\tif ( $t_diff < 0 ) {\r\n\t\t\t\t\t/* translators: 1: upload/last modified date and time */\r\n\t\t\t\t\t$h_time = sprintf( __( '%1$s from now', 'media-library-assistant' ), human_time_diff( $time ) );\r\n\t\t\t\t} else {\r\n\t\t\t\t\t/* translators: 1: upload/last modified date and time */\r\n\t\t\t\t\t$h_time = sprintf( __( '%1$s ago', 'media-library-assistant' ), human_time_diff( $time ) );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t/* translators: format for upload/last modified date */\r\n\t\t\t\t$h_time = mysql2date( __( 'Y/m/d', 'media-library-assistant' ), $m_time );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $h_time;\r\n\t}",
"function validar_fecha_stock($fechaStock)\n{\n //$fecha = date('d-m-Y');\n $fecha = date('d/m/Y');\n //$fecha = strftime($fecha);\n\n if ($fecha == $fechaStock) {\n return true;\n }\n\n return false;\n}",
"public function getItemAfterDate ($date) {\n\t$result = mysql_query(\"SELECT item_number, listing_start_date, listing_end_date, item_name, description, listing_user_email, TO_BASE64(item_picture) AS item_picture, TO_BASE64(item_picture_thumbnail) AS item_picture_thumbnail, item_price, category_number FROM item WHERE listing_end_date > $date ORDER BY listing_end_date ASC\");\n\tif ($result) {\n //$result = mysql_fetch_assoc($result);\n return $result;\n } else {\n $error = mysql_errno();\n return -$error;\n }\n }",
"public function day_to_condition($date){\r\n\r\n }",
"function echoDay($date, $activitiesOfTheDay)\n {\n\n $shoppingcartService = new shoppingcartService();\n\n if (count($activitiesOfTheDay) != 0) {\n $totalPriceDay = 0;\n\n // Bereken de totaalPrijs voor de dag.\n foreach ($activitiesOfTheDay as $activity) {\n if (get_class($activity) == \"activity\") {\n $activityOTD = $activity;\n } else {\n $activityOTD = $activity->getActivity();\n }\n $activityId = $activityOTD->getId();\n $amount = $shoppingcartService->getAmountByActivityId($activityId);\n $price = $activityOTD->getPrice();\n $activityId = $activityOTD->getId();\n $totalPriceActivity = $amount * $price;\n\n $totalPriceDay += $totalPriceActivity;\n }\n // Echo de labels\n echoTitles($date, $totalPriceDay);\n\n // Voor elke activiteit van de dag : echo de activiteit\n foreach ($activitiesOfTheDay as $activity) {\n\n if (get_class($activity) == \"activity\") {\n $activityOTD = $activity;\n } else {\n $activityOTD = $activity->getActivity();\n }\n\n // Haal alle informatie op voor de activiteit.\n $price = $activityOTD->getPrice();\n $activityId = $activityOTD->getId();\n $amount = $shoppingcartService->getAmountByActivityId($activityId);\n $type = $activityOTD->getType();\n $activityId = $activityOTD->getId();\n $startTime = $activityOTD->getStartTime();\n\n $endTime = $activityOTD->getEndTime();\n\n if (get_class($activity) == \"foodactivity\") {\n $activityName = $activity->getRestaurant()->getName();\n } else if (get_class($activity) == \"jazzactivity\") {\n $activityName = $activity->getJazzband()->getName();\n } else if (get_class($activity) == \"danceActivity\") {\n $artists = $activity->getArtists();\n $artistNames = array();\n foreach ($artists as $artist) {\n $artistNames[] = $artist->getName();\n }\n $activityName = implode(\", \", $artistNames);\n } else {\n $activityName = $activity->getType();\n }\n\n $shoppingcartService = new shoppingcartService();\n $amount = $shoppingcartService->getAmountByActivityId($activityId);\n\n // echo de activiteit naar HTML\n cartElement($activityId, $activityName, $type, date(\"Y-m-d\"), $startTime->format('H:i'), $endTime->format('H:i'), $price, $amount);\n }\n\n //return de totale prijs van de dag\n return $totalPriceDay;\n }\n return 0;\n }",
"function the_date_xml()\n {\n }",
"function getDateReserve($conn, $day, $current_month) {\n\t\t\t\t\t\n\t\t\t\t\t$current_year = date(\"y\");\n\t\t\t\t\t\n\t\t\t\t\t$select_all_dates = \"SELECT * FROM reservation WHERE confirmation = 'Confirmed'\";\n\t\t\t\t\t$q_seleect_all_dates = $conn->query($select_all_dates);\n\t\t\t\t\t\n\t\t\t\t\tif($q_seleect_all_dates->num_rows > 0) {\n\t\t\t\t\t\twhile($q_row = $q_seleect_all_dates->fetch_assoc()) {\n\t\t\t\t\t\t\t$date_reserved = strtotime($q_row['reserv_date']);\n\t\t\t\t\t\t\t$date_reserved_month = date('m',$date_reserved);\n\t\t\t\t\t\t\t$date_reserved_year = date('y',$date_reserved);\n\t\t\t\t\t\t\t$date_reserved_day = date('d',$date_reserved);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($date_reserved_month == $current_month && $date_reserved_year == $current_year) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($day == $date_reserved_day) {\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\techo \".\";\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}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\techo \"false\";\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}",
"public function bookingform($customer_id,$product_id,$date,$slot,$stime,$endtime) { \n\t\t\t\t\t\t \n\t\t\t\t\t\t\t$datafomat=str_replace(\"-\",\"/\",$date);\n\t\t\t\t\t\t $timestamp = strtotime($datafomat);\n\t\t\t\t\t\t $day = date('l', $timestamp);\n\t\t\t\t\t\t // echo $date;\n\t\t\t\t\t\t $datasfilds=explode(\"-\",$date);\n\t\t\t\t\t\t $month=$datasfilds[0];\n\t\t\t\t\t\t $list_day=$datasfilds[1];\n\t\t\t\t\t\t $year=$datasfilds[2];\n\t\t\t\t\t\t $monthchar='';\n\t\t\t\t\t\t\t\tif($month=='01'){ $monthchar='January';}\n\t\t\t\t\t\t\t\tif($month=='02'){ $monthchar='February';}\n\t\t\t\t\t\t\t\tif($month=='03'){ $monthchar='March';}\n\t\t\t\t\t\t\t\tif($month=='04'){ $monthchar='April';}\n\t\t\t\t\t\t\t\tif($month=='05'){ $monthchar='May';}\n\t\t\t\t\t\t\t\tif($month=='06'){ $monthchar='June';}\n\t\t\t\t\t\t\t\tif($month=='07'){ $monthchar='July';}\n\t\t\t\t\t\t\t\tif($month=='08'){ $monthchar='August';}\n\t\t\t\t\t\t\t\tif($month=='09'){ $monthchar='September';}\n\t\t\t\t\t\t\t\tif($month=='10'){ $monthchar='October';}\n\t\t\t\t\t\t\t\tif($month=='11'){ $monthchar='November';}\n\t\t\t\t\t\t\t\tif($month=='12'){ $monthchar='December';}\n\t \n\t\t\t\t\t\t\t\t\t \n\t\t $result='<div>\n\t<h5>You are about to request an appointment for administrator. Please review and confirm that you would like to request the following appointment: </h5>\n\t<div class=\"timeslot bookedClearFix\" style=\"padding: 21px 3px 82px 8px;background-color: beige;\">\n\t <h3>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i class=\"fa fa-calendar-o\" aria-hidden=\"true\"></i> \n\t\t\t\t\t\t\t\t\t\t\t\t\t '.$monthchar.' '.$list_day.', '.$year.' at '.$stime.' – '.$endtime.' \n\t\t\t\t\t\t\t\t\t\t\t\t\t</h3>\n\t</div>\n\t<div style=\"padding: 20px;\">\n\t<span><button style=\"background-color: #ff5501;color: white;\" type=\"button\" onclick=\"booking_add_to_cart(\\''.$date.'\\',\\''.$day.'\\',\\''.$slot.'\\',1,'.$customer_id.','.$product_id.');\">Request Booking</button></span><span></span></div>\n\t</div>'; \n\t\n/* echo $customer_id;\necho $date;\n$datvalue=str_replace(\"-\",\"/\",$date);\n\t return $result; */ \n\t return $result;\n\t}",
"function arcProduct($dt) {\n $payload = $dt;\n\n $this->sql = \"UPDATE inventory_tb SET is_Archive = 1 WHERE item_id =$dt->item_id\";\n\n $this->conn->query($this->sql);\n\n $this->data = $payload;\n\n return array(\n 'status'=>$this->status,\n 'payload'=>$this->data,\n 'prepared_by'=>'Inventory Admin',\n 'timestamp'=>date('D M j, Y h:i:s e')\n );\n }",
"function date($index)\n\t{\n\t\treturn $this->getItemTagValue($this->_isAtom ? \"updated\" : \"pubDate\" , $index);\n\t}"
]
| [
"0.63671",
"0.6075232",
"0.6049926",
"0.5807481",
"0.57964253",
"0.57712245",
"0.5708567",
"0.5708567",
"0.5668043",
"0.56515515",
"0.5604121",
"0.5602774",
"0.55956966",
"0.5584879",
"0.55392224",
"0.55116934",
"0.550453",
"0.5501902",
"0.5440842",
"0.5437907",
"0.5431193",
"0.54256016",
"0.54170585",
"0.54078484",
"0.5403238",
"0.5386907",
"0.5372239",
"0.53688174",
"0.53680557",
"0.5364257"
]
| 0.68257546 | 0 |
checking if the data is already save in morphometric table get municipality name | function checkMorphometricData($morphoid){
$crud = new CRUD();
$crud->connect();
$crud->sql("SELECT * FROM morphometric_tbl WHERE morpho_pig_id_fk='{$morphoid}'");
$r = $crud->getResult();
$row = $crud->numRows();
if($row>0){
foreach($r as $rs){
return $rs['morpho_pig_id_fk'];
}
}else{
return 0;
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIsMunicipal()\n {\n return $this->isMunicipal;\n }",
"public function crearMunicipios()\n {\n\n/**\n * Database `encuesta`\n */\n\n/* `encuesta`.`municipios` */\n$municipios = array(\n array('id' => '1','nombre' => 'Tres de Abril','url' => 'http://www.corrientesintensa.com/destino/tres-de-abril/','logo' => 'images/municipios/tres-de-abril.jpg','microrregion_id' => '4','indec_id' => '0','indec_nombre' => NULL,'departamento_id' => NULL),\n array('id' => '2','nombre' => '9 de Julio','url' => 'http://www.corrientes.gov.ar/home/9-de-julio/municipio','logo' => 'images/municipios/9_de_julio.png','microrregion_id' => '4','indec_id' => '0399','indec_nombre' => '9 de Julio (Est. Pueblo 9 de Julio)','departamento_id' => '161'),\n array('id' => '3','nombre' => 'Alvear','url' => '','logo' => 'images/municipios/alvear.jpg','microrregion_id' => '2','indec_id' => '0098','indec_nombre' => 'Alvear','departamento_id' => '056'),\n array('id' => '4','nombre' => 'Bella Vista','url' => 'http://www.bellavista.gob.ar/','logo' => 'images/municipios/bellavista.png','microrregion_id' => '4','indec_id' => '0007','indec_nombre' => 'Bella Vista','departamento_id' => '007'),\n array('id' => '5','nombre' => 'Berón de Astrada','url' => '','logo' => 'images/municipios/escudo-beron-de-estrada.png','microrregion_id' => '6','indec_id' => '0014','indec_nombre' => 'Berón de Astrada','departamento_id' => '014'),\n array('id' => '6','nombre' => 'Bonpland','url' => 'https://www.corrientes.gov.ar/home/bonpland/municipio','logo' => 'images/municipios/bonpland.png','microrregion_id' => '3','indec_id' => '0280','indec_nombre' => 'Bonpland','departamento_id' => '119'),\n array('id' => '7','nombre' => 'Caá Catí','url' => '','logo' => 'images/municipios/caa_cati.png','microrregion_id' => '6','indec_id' => '0112','indec_nombre' => 'Nuestra Señora del Rosario de Caá Catí ','departamento_id' => '063'),\n array('id' => '8','nombre' => 'Colonia Carlos Pellegrini','url' => 'http://www.corrientes.gov.ar/home/colonia-carlos-pellegrini/municipio','logo' => 'images/municipios/cnia-carlos pellegrini.png','microrregion_id' => '2','indec_id' => '0357','indec_nombre' => 'Colonia Carlos Pellegrini','departamento_id' => '147'),\n array('id' => '9','nombre' => 'Colonia Carolina','url' => '','logo' => 'images/municipios/carolina.png','microrregion_id' => '4','indec_id' => '0137','indec_nombre' => 'Colonia Carolina','departamento_id' => '070'),\n array('id' => '10','nombre' => 'Chavarría','url' => 'http://www.corrientes.gov.ar/home/chavarria/municipio','logo' => 'images/municipios/chavarria.jpg','microrregion_id' => '4','indec_id' => '0413','indec_nombre' => 'Chavarría','departamento_id' => '161'),\n array('id' => '11','nombre' => 'Colonia Libertad','url' => 'http://www.corrientes.gov.ar/home/colonia-libertad/municipio','logo' => 'images/municipios/colonia-libertad.jpg','microrregion_id' => '3','indec_id' => '0252','indec_nombre' => 'Colonia Libertad','departamento_id' => '112'),\n array('id' => '12','nombre' => 'Colonia Liebig','url' => 'https://www.corrientes.gov.ar/home/colonia-liebig/municipio','logo' => 'images/municipios/colonia_liebig.png','microrregion_id' => '2','indec_id' => '0161','indec_nombre' => 'Colonia Liebigs','departamento_id' => '084'),\n array('id' => '13','nombre' => 'Colonia Pando','url' => 'http://www.corrientes.gov.ar/home/colonia-pando/municipio','logo' => 'images/municipios/pando.jpg','microrregion_id' => '4','indec_id' => '0417','indec_nombre' => 'Colonia Pando','departamento_id' => '161'),\n array('id' => '14','nombre' => 'Concepción','url' => '','logo' => 'images/municipios/escudo-concepcion.png','microrregion_id' => '5','indec_id' => '0042','indec_nombre' => 'Concepción','departamento_id' => '028'),\n array('id' => '15','nombre' => 'Corrientes','url' => 'http://ciudaddecorrientes.gov.ar/','logo' => 'images/municipios/capital.png','microrregion_id' => '1','indec_id' => '0021','indec_nombre' => 'Corrientes','departamento_id' => '021'),\n array('id' => '16','nombre' => 'Cruz de los Milagros','url' => '','logo' => 'images/municipios/cruz_de_los_milagros.png','microrregion_id' => '4','indec_id' => '0189','indec_nombre' => 'Cruz de los Milagros','departamento_id' => '091'),\n array('id' => '17','nombre' => 'Curuzú Cuatiá','url' => '','logo' => 'images/municipios/curuzu_cuatia.png','microrregion_id' => '3','indec_id' => '0056','indec_nombre' => 'Curuzú Cuatiá','departamento_id' => '035'),\n array('id' => '18','nombre' => 'Empedrado','url' => '','logo' => 'images/municipios/empedrado.png','microrregion_id' => '5','indec_id' => '0077','indec_nombre' => 'Empedrado','departamento_id' => '042'),\n array('id' => '19','nombre' => 'Esquina','url' => 'http://www.esquinacorrientes.gob.ar/','logo' => 'images/municipios/esquina.jpg','microrregion_id' => '4','indec_id' => '0084','indec_nombre' => 'Esquina','departamento_id' => '049'),\n array('id' => '20','nombre' => 'Estación Torrent','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0105','indec_nombre' => 'Estación Torrent','departamento_id' => '056'),\n array('id' => '21','nombre' => 'Felipe Yofre','url' => 'https://www.corrientes.gov.ar/home/felipe-yofre/municipio','logo' => 'images/municipios/felipe-yofre.jpg','microrregion_id' => '3','indec_id' => '0231','indec_nombre' => 'Felipe Yofré','departamento_id' => '105'),\n array('id' => '22','nombre' => 'Garabí','url' => 'https://es.wikipedia.org/wiki/Garab%C3%AD_(Corrientes)','logo' => 'images/municipios/garabi.jpg','microrregion_id' => '2','indec_id' => '0441','indec_nombre' => 'José Rafael Gómez (Garabí)','departamento_id' => '168'),\n array('id' => '23','nombre' => 'Garruchos','url' => 'https://www.corrientes.gov.ar/home/garruchos/municipio','logo' => 'images/municipios/garrucho.bmp','microrregion_id' => '2','indec_id' => '0427','indec_nombre' => 'Garruchos','departamento_id' => '168'),\n array('id' => '24','nombre' => 'Gobernador Martinez','url' => '','logo' => 'images/municipios/gobernador_martinez.png','microrregion_id' => '4','indec_id' => '0196','indec_nombre' => 'Gobernador Juan E. Martínez','departamento_id' => '091'),\n array('id' => '25','nombre' => 'Gobernador V. Virasoro','url' => 'http://www.virasoro.gob.ar/','logo' => 'images/municipios/virasoro.jpg','microrregion_id' => '2','indec_id' => '0434','indec_nombre' => 'Gobernador Igr. Valentín Virasoro ','departamento_id' => '168'),\n array('id' => '26','nombre' => 'Goya','url' => '','logo' => 'images/municipios/goya.png','microrregion_id' => '4','indec_id' => '0140','indec_nombre' => 'Goya','departamento_id' => '070'),\n array('id' => '27','nombre' => 'Guaviraví','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0364','indec_nombre' => 'Guaviraví','departamento_id' => '147'),\n array('id' => '28','nombre' => 'Herliztka','url' => '','logo' => 'images/municipios/escudo-herliztka.png','microrregion_id' => '6','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '29','nombre' => 'Ita Ibaté','url' => 'http://www.corrientes.gov.ar/home/ita-ibate/municipio','logo' => 'images/municipios/itaibate.jpg','microrregion_id' => '6','indec_id' => '0119','indec_nombre' => 'Itá Ibaté','departamento_id' => '063'),\n array('id' => '30','nombre' => 'Itatí','url' => '','logo' => 'images/municipios/escudo-itati.png','microrregion_id' => '6','indec_id' => '0147','indec_nombre' => 'Itatí','departamento_id' => '077'),\n array('id' => '31','nombre' => 'Ituzaingó','url' => '','logo' => 'images/municipios/ituzaingo.jpg','microrregion_id' => '2','indec_id' => '0168','indec_nombre' => 'Ituzaingó','departamento_id' => '084'),\n array('id' => '32','nombre' => 'José Rafael Gomez','url' => '','logo' => 'images/municipios/escudo-jose-r-gomez.png','microrregion_id' => '2','indec_id' => '0441','indec_nombre' => 'José Rafael Gómez (Garabí)','departamento_id' => '168'),\n array('id' => '33','nombre' => 'Juan Pujol','url' => '','logo' => 'images/municipios/escudo-juan-pujol.png','microrregion_id' => '3','indec_id' => '0259','indec_nombre' => 'Juan Pujol','departamento_id' => '112'),\n array('id' => '34','nombre' => 'La Cruz','url' => 'http://www.lacruz.gov.ar/','logo' => 'images/municipios/la-cruz.png','microrregion_id' => '2','indec_id' => '0371','indec_nombre' => 'La Cruz','departamento_id' => '147'),\n array('id' => '35','nombre' => 'San Isidro','url' => '','logo' => 'images/municipios/escudo-san-isidro.png','microrregion_id' => '4','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '36','nombre' => 'Lomas de Vallejos','url' => 'http://www.corrientes.gov.ar/home/lomas-de-vallejos/municipio','logo' => 'images/municipios/loma-de-vallejos.jpg','microrregion_id' => '6','indec_id' => '0126','indec_nombre' => 'Lomas de Vallejos','departamento_id' => '063'),\n array('id' => '37','nombre' => 'Loreto','url' => 'https://www.corrientes.gov.ar/home/loreto/municipio','logo' => 'images/municipios/loreto.jpg','microrregion_id' => '5','indec_id' => '0385','indec_nombre' => 'Loreto','departamento_id' => '154'),\n array('id' => '38','nombre' => 'Mariano I. Loza','url' => 'http://www.corrientes.gov.ar/home/mariano-i-loza/municipio','logo' => 'images/municipios/mariano-loza.jpg','microrregion_id' => '3','indec_id' => '0238','indec_nombre' => 'Mariano I. Loza (Est. Justino Solari)','departamento_id' => '105'),\n array('id' => '39','nombre' => 'Mburucuyá','url' => 'http://www.corrientes.gov.ar/home/mburucuya/municipio','logo' => 'images/municipios/mburucuya.jpg','microrregion_id' => '5','indec_id' => '0224','indec_nombre' => 'Mburucuyá','departamento_id' => '098'),\n array('id' => '40','nombre' => 'Mercedes','url' => '','logo' => 'images/municipios/mercedes.png','microrregion_id' => '3','indec_id' => '0245','indec_nombre' => 'Mercedes','departamento_id' => '105'),\n array('id' => '41','nombre' => 'Mocoretá','url' => 'http://www.corrientes.gov.ar/home/mocoreta/municipio','logo' => 'images/municipios/mocoreta.JPG','microrregion_id' => '3','indec_id' => '0266','indec_nombre' => 'Mocoretá','departamento_id' => '112'),\n array('id' => '42','nombre' => 'Monte Caseros','url' => 'http://www.corrientes.gov.ar/home/monte-caseros/municipio','logo' => 'images/municipios/monte-caseros.gif','microrregion_id' => '3','indec_id' => '0273','indec_nombre' => 'Monte Caseros','departamento_id' => '112'),\n array('id' => '43','nombre' => 'Pago de los Deseos','url' => '','logo' => 'images/municipios/escudo-pago-de-los-deseos.png','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '44','nombre' => 'Palmar Grande','url' => '','logo' => 'images/municipios/escudo-palmar-grande.png','microrregion_id' => '6','indec_id' => '0133','indec_nombre' => 'Palmar Grande','departamento_id' => '063'),\n array('id' => '45','nombre' => 'Parada Pucheta','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '3','indec_id' => '0287','indec_nombre' => 'Parada Pucheta','departamento_id' => '119'),\n array('id' => '46','nombre' => 'Paso de la Patria','url' => '','logo' => 'images/municipios/escudo-paso-de-la-patria.png','microrregion_id' => '6','indec_id' => '0322','indec_nombre' => 'Paso de la Patria','departamento_id' => '133'),\n array('id' => '47','nombre' => 'Paso de los Libres','url' => 'http://pasodeloslibres.gob.ar/','logo' => 'images/municipios/paso-de-los-libres.jpg','microrregion_id' => '3','indec_id' => '0294','indec_nombre' => 'Paso de los Libres','departamento_id' => '119'),\n array('id' => '48','nombre' => 'Pedro R. Fernandez','url' => '','logo' => 'images/municipios/escudo-pedro-r-Fernandez.png','microrregion_id' => '4','indec_id' => '0406','indec_nombre' => 'Pedro R. Fernández (Est. Manuel F. Mantilla)','departamento_id' => '161'),\n array('id' => '49','nombre' => 'Perugorria','url' => 'http://www.corrientes.gov.ar/home/perugorria/municipio','logo' => 'images/municipios/perugorria.gif','microrregion_id' => '3','indec_id' => '0070','indec_nombre' => 'Perugorría','departamento_id' => '035'),\n array('id' => '50','nombre' => 'Pueblo Libertador','url' => '','logo' => 'images/municipios/escudo-libertador.png','microrregion_id' => '4','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '51','nombre' => 'Lavalle','url' => 'http://www.corrientes.gov.ar/home/lavalle/municipio','logo' => 'images/municipios/lavalle.jpg','microrregion_id' => '4','indec_id' => '0203','indec_nombre' => 'Lavalle','departamento_id' => '091'),\n array('id' => '52','nombre' => 'Ramada Paso','url' => '','logo' => 'images/municipios/escudo-ramada-paso.png','microrregion_id' => '6','indec_id' => '0154','indec_nombre' => 'Ramada Paso','departamento_id' => '077'),\n array('id' => '53','nombre' => 'Riachuelo','url' => 'http://www.municipioriachuelo.gov.ar/','logo' => 'images/municipios/riachuelo.jpg','microrregion_id' => '1','indec_id' => '0028','indec_nombre' => 'Riachuelo','departamento_id' => '021'),\n array('id' => '54','nombre' => 'Saladas','url' => '','logo' => 'images/municipios/escudo-saladas.png','microrregion_id' => '5','indec_id' => '0308','indec_nombre' => 'Saladas','departamento_id' => '126'),\n array('id' => '55','nombre' => 'San Antonio de Apipe','url' => 'http://www.corrientes.gov.ar/home/san-antonio/municipio','logo' => 'images/municipios/san-antonio-de-apipe.png','microrregion_id' => '2','indec_id' => '0175','indec_nombre' => 'San Antonio','departamento_id' => '084'),\n array('id' => '56','nombre' => 'San Carlos','url' => '','logo' => 'images/municipios/escudo-san-carlos.png','microrregion_id' => '2','indec_id' => '0182','indec_nombre' => 'San Carlos','departamento_id' => '084'),\n array('id' => '58','nombre' => 'San Cosme','url' => 'https://www.corrientes.gov.ar/home/san-cosme/municipio','logo' => 'images/municipios/sancosme-escudo.gif','microrregion_id' => '6','indec_id' => '0329','indec_nombre' => 'San Cosme','departamento_id' => '133'),\n array('id' => '59','nombre' => 'San Lorenzo','url' => 'http://www.corrientes.gov.ar/home/san-lorenzo/municipio','logo' => 'images/municipios/sanlorenzo.png','microrregion_id' => '5','indec_id' => '0315','indec_nombre' => 'San Lorenzo','departamento_id' => '126'),\n array('id' => '60','nombre' => 'San Luis del Palmar','url' => '','logo' => 'images/municipios/sanluisdelpalmar.png','microrregion_id' => '6','indec_id' => '0350','indec_nombre' => 'San Luis del Palmar','departamento_id' => '140'),\n array('id' => '61','nombre' => 'San Miguel','url' => 'https://www.corrientes.gov.ar/home/san-miguel/municipio','logo' => 'images/municipios/San-Miguel.jpg','microrregion_id' => '5','indec_id' => '0392','indec_nombre' => 'San Miguel','departamento_id' => '154'),\n array('id' => '62','nombre' => 'San Roque','url' => 'http://www.sanroquemunicipio.gob.ar/','logo' => 'images/municipios/san-roque.jpg','microrregion_id' => '4','indec_id' => '0420','indec_nombre' => 'San Roque','departamento_id' => '161'),\n array('id' => '63','nombre' => 'Santa Ana de los Guacaras','url' => 'http://www.santaanadelosguacaras.com/','logo' => 'images/municipios/santa-ana-escudo.png','microrregion_id' => '6','indec_id' => '0336','indec_nombre' => 'Santa Ana','departamento_id' => '133'),\n array('id' => '64','nombre' => 'Santa Lucía','url' => '','logo' => 'images/municipios/santa_lucia.png','microrregion_id' => '4','indec_id' => '0210','indec_nombre' => 'Santa Lucía','departamento_id' => '091'),\n array('id' => '65','nombre' => 'Colonia Santa Rosa','url' => 'http://www.corrientes.gov.ar/home/colonia-santa-rosa/municipio','logo' => 'images/municipios/santa-rosa.jpg','microrregion_id' => '5','indec_id' => '0035','indec_nombre' => 'Santa Rosa','departamento_id' => '028'),\n array('id' => '66','nombre' => 'Santo Tome','url' => 'http://municipalidadstome.com.ar/','logo' => 'images/municipios/santo_tome.jpg','microrregion_id' => '2','indec_id' => '0448','indec_nombre' => 'Santo Tomé','departamento_id' => '168'),\n array('id' => '67','nombre' => 'Sauce','url' => 'http://www.corrientes.gov.ar/home/sauce/municipio','logo' => 'images/municipios/sauce.jpg','microrregion_id' => '3','indec_id' => '0455','indec_nombre' => 'Sauce','departamento_id' => '175'),\n array('id' => '68','nombre' => 'Tabay','url' => '','logo' => 'images/municipios/escudo-tabay.png','microrregion_id' => '5','indec_id' => '0049','indec_nombre' => 'Tabay','departamento_id' => '028'),\n array('id' => '69','nombre' => 'Tapebicuá','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '3','indec_id' => '0301','indec_nombre' => 'Tapebicuá','departamento_id' => '119'),\n array('id' => '70','nombre' => 'Tatacua','url' => 'https://www.corrientes.gov.ar/home/tatacua/municipio','logo' => 'images/municipios/tatacua.jpg','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'nan','departamento_id' => NULL),\n array('id' => '71','nombre' => 'Villa Olivari','url' => '','logo' => 'images/municipios/municipio.jpg','microrregion_id' => '2','indec_id' => '0186','indec_nombre' => 'Villa Olivari','departamento_id' => '084'),\n array('id' => '72','nombre' => 'Yapeyú','url' => 'https://www.corrientes.gov.ar/home/yapeyu/municipio','logo' => 'images/municipios/yapeyu.jpg','microrregion_id' => '2','indec_id' => '0378','indec_nombre' => 'Yapeyú','departamento_id' => '147'),\n array('id' => '73','nombre' => 'Yatayti Calle','url' => 'http://www.corrientes.gov.ar/home/yatayti-calle/municipio','logo' => 'images/municipios/yatayti_calle.jpg','microrregion_id' => '4','indec_id' => '0217','indec_nombre' => 'Yatayti Calle','departamento_id' => NULL),\n array('id' => '75','nombre' => 'El Sombrero','url' => 'http://elsombrero.corrientes.gob.ar/','logo' => 'images/municipios/sombrero.jpg','microrregion_id' => '5','indec_id' => '0','indec_nombre' => 'El Sombrero','departamento_id' => '042')\n);\n\n\n foreach ($municipios as $key => $value)\n {\n $m = new Municipio();\n $m->construct($value);\n }\n\n\n\n\n }",
"public function municipal(){\n return $this->belongsTo('App\\Municipal', 'municipality_id');\n }",
"public function getIdByNameEspecialidad($name){//FUNCION PARA VERIFICAR LA EXISTENCIA DE UN CORREO EN TABLA MEDICO\n $objT=new especialidadDAO();\n $resul=$objT->readall();\n $act=0;\n for($i=0;$i<count($resul);$i++){\n if(strtoupper($resul[$i]['nombre']) == strtoupper($name)){\n $act=$resul[$i]['id_especialidad'];\n }\n }\n return $act; \n }",
"function nomi_sintomi($nome)\n{\n\tif ( ($nome == 'id') || ($nome == 'id_paziente') );\n\n\telse if ( $nome == 'data_inserimento') \t\n\t\treturn ('Insertion date');\n\telse if ( $nome == 'data_sintomi') \t\n\t\treturn ('Date of first clinical sign');\n\telse if ( $nome == 'crisi_epilettica') \t\n\t\treturn ('Epilepsy');\n\telse if ( $nome == 'disturbi_comportamento') \t\n\t\treturn ('Behavioral disorder');\n\telse if ( $nome == 'deficit_motorio') \t\n\t\treturn ('Motor deficit');\n\telse if ( $nome == 'deficit') \t\n\t\treturn ('Sensory deficit');\t\n\telse if ( $nome == 'cefalea') \t\n\t\treturn ('Headache');\t\t\n\telse if ( $nome == 'altro') \t\n\t\treturn ('Other');\t\n\t \n\telse\n\t\treturn ucfirst($nome);\n}",
"public function getNomAlternatif()\n {\n $this->logDebug(\" [\".__FUNCTION__.\"] /Ligne: \".__LINE__.\"/ DEBUT; \");\n\n $strNomAlter = \"\";\n \n if ($this->getId() == Budget_typeTable::RESTITUE)\n {\n $strNomAlter = libelle('msg_libelle_restitution');\n } else\n {\n $strNomAlter = libelle('msg_libelle_allocation');\n }\n\n $this->logDebug(\" [\".__FUNCTION__.\"] /Ligne: \".__LINE__.\"/ FIN; \");\n\n return $strNomAlter;\n }",
"Public Function getMentorName()\n\t{\n\t\t$Mentor = $this->_db->fetchRow('SELECT * FROM ' . $this->_mentor_to_user_table_name . ' WHERE user__id = ' . $this->id);\n\t\tif(!sizeOf($Mentor) || !$Mentor)\n\t\t\treturn false;\n\t\t$Mentor = new Mentor($Mentor->mentor__id);\n\t\treturn $Mentor->name;\n\t}",
"protected function isMorphTo()\n {\n\n\n // if (isset($this->parentEntity->system->relationsMorphs[$this->getColumnName()])) {\n // return $this->parentEntity->system->relationsMorphs[$this->getColumnName()];\n // }\n\n /**\n * Old Verifica pelo Atributo\n */\n // if ($this->className==\\Population\\Models\\Market\\Abouts\\Info::class\n // && $this->entity->code['name']!=='id'&& $this->entity->code['name']!=='text'\n // ) {\n if ($searchForeachKey = ArraySearcher::arraySearchByAttribute(\n $this->entity->code['name'],\n // $this->parentEntity->system->tables,\n $this->parentEntity->system->relations,\n 'foreignKey'\n )\n ) {\n $isMorph = false;\n $found = [];\n foreach ($searchForeachKey as $valorFound) {\n if (in_array($this->parentEntity->system->relations[$valorFound]['type'], ['MorphMany', 'MorphTo'])) {\n $isMorph = true;\n $found[] = $this->parentEntity->system->relations[$valorFound];\n }\n }\n // dd($found);\n if ($isMorph) {\n return $found[count($found)-1];\n }\n }\n // dd(\n // $this->className,\n // $this->entity->code,\n // $this->renderDatabaseData\n // );\n // }\n\n if (strpos($this->getColumnName(), 'able') !== false) {\n Log::channel('sitec-support')->warning(\n 'Problema no morph para coluna '.$this->getColumnName()\n );\n // dd(\n // $this->getColumnName(),\n // 'debug1'\n // );\n }\n \n return false;\n }",
"public function getFkSwMunicipios()\n {\n return $this->fkSwMunicipios;\n }",
"function get_province_name($provinceid)\r\r\n\t{\r\r\n\t\t$this->db->where('ID',$provinceid);\r\r\n\r\r\n\t\t$query = $this->db->get('election_reigons');\r\r\n\t\t\r\r\n\t\t// Check if Result is Greater Than Zero\r\r\n\t\tif($query->num_rows() > 0)\r\r\n\t\t{\r\r\n\t\t\treturn $query->row()->REIGONNAME;\r\r\n\t\t}\r\r\n\t}",
"function duplicateName(){\n $dup = $this->app['db']->fetchColumn('SELECT id from worlds where name=?', array($this->name));\n if($dup == $this->id || !$dup){\n return false;\n }\n $this->validation_errors[] = 'Name is a duplicate';\n return true;\n }",
"function getNombre_region()\n {\n if (!isset($this->snombre_region) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->snombre_region;\n }",
"public function getMunicipalityIdAttribute()\n {\n return $this->belongsTo(HCCities::class, 'city_id', 'id')->getResults()->municipality_id;\n }",
"public function run()\n {\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Bacacay'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Camalig'\n ]);\n\n $municipality->save();\n\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t\t'municipality' => 'Daraga'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Guinobatan'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Jovellar'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n\t\t\t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Libon'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Malilipot'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Malinao'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Manito'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Oas'\n ]);\n\n $municipality->save();\n\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Pio Duran'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Polangui'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Rapu-Rapu'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"1\",\n \t'municipality' => 'Rapu-Rapu'\n ]);\n\n $municipality->save();\n//2\n $municipality = new \\App\\Municipality([\n \t'fkmunicipality_provinces' => \"2\",\n \t'municipality' => 'Basud'\n ]);\n\n $municipality->save();\n\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Capalonga'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Daet'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Tiwi'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Jose Panganiban'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Labo'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Mercedes'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Paracale'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'San Lorenzo Ruiz'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'San Vicente'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Santa Elena'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Talisay'\n ]);\n\n $municipality->save();\n\n $municipality = new \\App\\Municipality([\n 'fkmunicipality_provinces' => \"2\",\n 'municipality' => 'Vinzons'\n ]);\n\n $municipality->save();\n\n }",
"public function prePersist()\n {\n $this->muniNomb = Utility::upperCase($this->muniNomb);\n }",
"public function operator_name_check(){\n\n $this->db->select('*');\t\t\n\t\t\t$this->db->where('telecom_name',$this->input->post('geo_operators_name'));\n\t\t\t$this->db->where('telecom_value',$this->input->post('geo_operators_value'));\n\t\t\t\n\t\t\t$query=$this->db->get('djx_telecom_circle')->num_rows();\n\t\t\t\n \n\t\t\tif($query >0)\n\t\t\t\t{\n\t\t\t\t\t$this->form_validation->set_message('operator_name_check', $this->lang->line('lang_operator_already_exists_in_country'));\n\t\t\t\t\treturn FALSE;\t\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t\treturn true;\n\t\t\n\t }",
"public function store(MunicipalityRequest $request)\n {\n $municipality=new Municipality($request->all());\n $municipality->visible=true;\n $municipality->save();\n Flash::success(\"Se ha creado una provincia \".$municipality->name.' de forma satisfactoria.')->important();\n return redirect()->route('municipality.index');\n }",
"public function getconsultaMunicipio($municipio){\n try{\n $consulta = $this->DB->query(\"select municipios.Municipio, Latitud, Longitud, tipositio.NombreSitio, \n estadooperacion.EstadoOperacion, Toneladas_por_dia, Anios_vida_util, CASE WHEN Proyecto_Ejecutivo = 1 THEN 'Si' ELSE 'No' END as Proyecto_Ejecutivo, \n CASE WHEN Cumple_Norma = 1 THEN 'Si' ELSE 'No' END as Cumple_Norma, CASE WHEN Pepena = 1 THEN 'Si' ELSE 'No' END as Pepena\n from sitios, municipios, tipositio, estadooperacion\n where sitios.Municipio = municipios.idMunicipios\n and tipositio.idTipoSitio = sitios.TipoSitio\n and estadooperacion.idEstadoOperacion = sitios.Estado_Operacion\n and municipios.idMunicipios = '$municipio'\");\n while($registro = $consulta->fetch(PDO::FETCH_ASSOC)){\n $this->puntos[] = $registro;\n }\n\n $DB = null;\n return $this->puntos;\n }\n catch(Exception $e){\n echo \"linea de error\".$e->getLine().\"<br>\";\n echo \"excepcion\".$e->getMessage();\n }\n /*\n finally{\n $DB = null;\n }*/\n }",
"function SELECT_COUNT_alunosMunicipal (){\n $sql = 'SELECT COUNT(i.`tipo_instituicao`) AS `Escolas Municipais` FROM `visita` as v INNER JOIN `agendamento_institucional` as ai on v.`agendamento_institucional_ID` = ai.`ID` INNER JOIN `professor_instituicao` as pii on ai.`professor_instituicao_ID` = pii.`ID` INNER JOIN `instituicao` AS i ON pii.`instituicao_ID` = i.`ID` WHERE i.`tipo_instituicao`= \"Municipal\"';\n $stmt = $this->dataBase->query($sql);\n $row = $stmt->fetch_assoc();\n return $row; \n }",
"function existe_ocupacion ($ocupacion){\n\t\t\t\tinclude(\"bd_conection.php\");\n\t\t\t\t$result = @mysqli_query($con, \"SELECT * FROM ocupaciones WHERE ocupacion_tipo LIKE '$ocupacion'\");\n\t\t\t\t$rowcount=mysqli_num_rows($result);\n\t\t\t\tif ($rowcount > 0){\t\n\t\t\t\t\twhile($ocupacionExist = @mysqli_fetch_assoc($result)) { \n\t\t\t\t\t\treturn $ocupacionExist['ocupacion_tipo'];\n\t\t\t\t\t}\n\t\t\t\t}else if ($ocupacion !== \"\") {\n\t\t\t\t\t@mysqli_query($con, \"INSERT INTO ocupaciones (ocupacion_tipo) VALUES ('$ocupacion')\");\t\t\t\n\t\t\t\t\treturn $ocupacion;\n\t\t\t\t}\n\t\t\t}",
"public function getOrgaName();",
"public function save(){\n $sql = \"INSERT INTO categorias VALUES (NULL,'{$this->getNombre()}') \";\n $save = $this ->db->query($sql);\n\n $result = false;\n if($save){\n $result=true;\n }\n return $result;\n }",
"private function getName ()\n\t\t{\t\n\t\t\t$dbs = new DB ( $this->config['database'] );\n\t\t\t$search = $dbs->query(\"SELECT * FROM tbl_vpn_org WHERE org_id = \" . trim($this->c) );\n\t\t\tif ( count($search) ) {\n\t\t\t\t// Convert result to human code \n\t\t\t\t$this->result['data']['id'] = $search[0]['org_id'];\n\t\t\t\t$this->result['data']['name'] = $search[0]['org_name'];\n\t\t\t\t$this->result['data']['description'] = $search[0]['org_desc'];\n\t\t\t} else \n\t\t\t\t$this->result['data']['result'] = \"Not found\";\n\t\t\n\t\t\t$dbs->CloseConnection ();\t\n\t\t\treturn;\n\t\t}",
"function getName(){\r\n\t\t// Jesli nie zostaly pobrane dane o koalicji - pobiera je\r\n\t\tif(gettype($this->coalition) == 'boolean' && $this->coalition == false){\r\n\t\t\t$query = \"SELECT koalicja FROM \". TBL_KINGDOM\r\n\t\t\t.\" WHERE nazwa='{$this->kingdom}'\";\r\n\t\t\tif($result = mysql_query($query)){\r\n\t\t\t\t$row = mysql_fetch_array($result, MYSQL_ASSOC);\r\n\t\t\t\t$this->coalition = $row['koalicja'];\r\n\t\t\t\treturn $this->coalition;\r\n\t\t\t}else{\r\n\t\t\t\t$this->coalition = NULL;\r\n\t\t\t\treturn NULL;\r\n\t\t\t}\r\n\t\t\t// Zwraca pobrane wczesniej dane\r\n\t\t}else{\r\n\t\t\treturn $this->coalition;\r\n\t\t}\r\n\t}",
"public function message()\n {\n return 'Town already exist.';\n }",
"function alta_unidad_m(){\n\t\t$u= new Unidad_medida();\n\t\t$u->fecha_alta=date(\"Y-m-d\");\n\t\t$u->estatus_general_id=1;\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$related = $u->from_array($_POST);\n\n\t\t// save with the related objects\n\t\tif($u->save($related))\n\t\t{\n\t\t\techo \"<html> <script>alert(\\\"Se han registrado los datos de la Unidad de Medida.\\\"); window.location='\".base_url().\"index.php/inicio/acceso/\".$GLOBALS['ruta'].\"/menu';</script></html>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}",
"function getManufacturerTitle() {\n \tif ($this->getManufacturerUid()) {\n \t\treturn $this->conn_db->getManufacturerTitle($this->getManufacturerUid());\n \t}\n \t\n }",
"function tipo_locazione($id_tipo_locazione=\"\"){\n\t$db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\tif ($id_tipo_locazione==\"all\") {\n\t\treturn \"Tutti gli Immobili\";\n\t}\n\t$q=\"select * from tipo_locazione where id_tipo_locazione = $id_tipo_locazione\";\n\t$r=$db->query($q);\n\tif (!$r) {\n\t\treturn \"Dato Assente\";\n\t}else{\n\t\t$ro= mysql_fetch_array($r);\n\t\treturn $ro['nome'];\n\t}\n}",
"function db_type_name_exists()\r\n {\r\n $toReturn = false;\r\n $dbmgr = new DB_Mgr(\"sites\");\r\n $stmt = \"SELECT count(*) FROM SI_PHONE_TYPE WHERE name = '\" . $this->name . \"'\";\r\n $dbmgr->query($stmt);\r\n $row = $dbmgr->get_a_row();\r\n $num = $row[0];\r\n return($num);\r\n }",
"public function actualizarMunicipios()\n\t\t{\n\t\t\t$this->load->model(\"modpersona\");\n\t\t\t$dpto=$this->input->post(\"id\");\n\t\t\t$mpio=$this->modpersona->consultarMpio($dpto);\n\t\t\techo '<option value=\"\">Seleccione el municipio</option>';\n \t\t\tfor($i=0;$i<count($mpio);$i++)\n \t\t\t{\n \t\t\t\techo '<option value=\"'.$mpio[$i][\"VALOR_MINIMO\"].'\">'.$mpio[$i][\"DESCRIPCION\"].'</option>';\n \t\t\t}\n\t\t}"
]
| [
"0.5966779",
"0.5415385",
"0.5380273",
"0.53679115",
"0.5355658",
"0.53159714",
"0.528754",
"0.5276754",
"0.5242135",
"0.52236277",
"0.5190846",
"0.5182884",
"0.51537097",
"0.5146161",
"0.5137235",
"0.5133886",
"0.508949",
"0.5079182",
"0.50714743",
"0.5068348",
"0.5063812",
"0.5046992",
"0.5043179",
"0.50274384",
"0.49922466",
"0.4987104",
"0.49849734",
"0.4938449",
"0.49219954",
"0.49107617"
]
| 0.5508657 | 1 |
transfering to count the current native pig already have by the farmers | function getCountOfTransferedNativePig($id){
$crud = new CRUD();
$crud->connect();
$crud -> sql("SELECT *, COUNT(farmer_id_fk) FROM pigs_tbl WHERE farmer_id_fk='{$id}'");
$r = $crud->getResult();
foreach($r as $rs){
return $rs['COUNT(farmer_id_fk)'];
}
$crud->disconnect();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function countGame()\n {\n }",
"function count(){}",
"function count() ;",
"abstract public function countCardsInLocations(): array;",
"function panier_get_count() {\n global $panier;\n $resultat = 0;\n foreach ($panier as $item) {\n $resultat+= $item[PS_PANIER_ITEM_QTY];\n }\n return $resultat;\n}",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"abstract public function count();",
"public function countFarmers()\n\t{\n\t\t$farmer = \"select id from users_roles where name = 'Farmer' \";\n\t\t$f = DB::query($farmer)->execute()->as_array();\n\t\t$f_id = @$f[0]['id']; \n\t\t\n\t\t//got it, lets proceed\n\t\tif(!is_null($f_id)){\n\t\t\t\n\t\t\t//lets count number of users subscribed to the farmer role\n\t\t\t$pple = \"select count(distinct(user_id)) as tmpvar from users_user_roles\nwhere role_id = $f_id \";\n\n\t\t\t$tmp \t= DB::query($pple)->execute()->as_array();\n\t\t\t$fcount = @$tmp[0]['tmpvar'];\n\t\t\treturn $fcount;\n\t\t}\n\t\treturn 0;\n\t}",
"public abstract function count();",
"public abstract function count();",
"function count()\n {\n }",
"public function _count();",
"public abstract function get_counts();",
"function getMasteriesCount()\r\n {\r\n global $postDataJSON;\r\n \r\n\r\n \r\n foreach ($postDataJSON['participants'] as $id => $player)\r\n {\r\n global $playerMasteriesCount;\r\n\t\t\t\t\t\tglobal $playerMasteriesInsight;\r\n \r\n $offenseCount = 0;\r\n $defenseCount = 0;\r\n $utilityCount = 0;\r\n \r\n\t\t\t\t\t\t$insight = false;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n foreach ($player['masteries'] as $index => $mastery)\r\n {\r\n if ((((int)$mastery['masteryId']) % 1000) < 200)\r\n {\r\n $offenseCount += $mastery['rank'];\r\n }\r\n else if ((((int)$mastery['masteryId']) % 1000) < 300)\r\n {\r\n $defenseCount += $mastery['rank'];\r\n } \r\n else \r\n {\r\n $utilityCount += $mastery['rank'];\r\n } \r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif (((int)$mastery['masteryId']) == 6241) {\r\n\t\t\t\t\t\t\t\t$insight = true;\r\n\t\t\t\t\t\t\t}\r\n }\r\n \r\n array_push($playerMasteriesCount, \"$offenseCount / $utilityCount / $defenseCount\");\r\n\t\t\t\t\t\tarray_push($playerMasteriesInsight, $insight);\r\n\t\t\t\t\t\t\r\n }\r\n \r\n\r\n\r\n\r\n }",
"function count();",
"function countAll() ;",
"function getTotalGrantsApplied() {\n\t\treturn $this->getMovieCount();\n\t}",
"public function countGame() {\r\n\t\t$sql = new Sql();\r\n\t\t$result = $sql->Select(\"SELECT COUNT(*) as count FROM jogo\");\r\n\t\tif(count($result) > 0) {\r\n\t\t\t\r\n\t\t\t$count = ($result[0]['count']) / 16;\r\n\t\t\treturn ceil($count);\r\n\t\t}\r\n\t}",
"public abstract function count(): int;",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();"
]
| [
"0.5919756",
"0.5908145",
"0.5903814",
"0.58745927",
"0.5842177",
"0.5776844",
"0.5776844",
"0.5776844",
"0.5776844",
"0.5738072",
"0.5720962",
"0.5720962",
"0.57145834",
"0.5687324",
"0.56303847",
"0.5570571",
"0.55036575",
"0.54835993",
"0.54662436",
"0.54659647",
"0.54614854",
"0.54599905",
"0.54599905",
"0.54599905",
"0.54599905",
"0.54599905",
"0.54599905",
"0.54599905",
"0.54599905",
"0.54599905"
]
| 0.6599024 | 0 |
Get a list of readonly properties, so that __set magic accessor could throw an exception if a property is readonly | protected function _getReadonlyProperties()
{
return array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getReadOnlyFields();",
"public function getProperties() {\n $modifiable_properties = [];\n $fields = $this->getFields();\n foreach (Framework::instance()->entityProperties($this->getEntity()) as $property => $info) {\n if (!in_array($property, array_keys($fields)) && $this->filter($property)) {\n $this->addModifier($modifiable_properties, 'property', $property);\n }\n }\n return $modifiable_properties;\n }",
"protected function getReflectedProperties()\n {\n if (is_null($this->_ReflectedPropertiesCache)) {\n $this->_ReflectedPropertiesCache = array();\n\n $refectionClass = new ReflectionClass($this);\n $propertiesArray = $refectionClass->getProperties();\n if (is_array($propertiesArray) and count($propertiesArray) > 0) {\n while (list(, $property) = each($propertiesArray)) {\n $refectionProperty = new ReflectionProperty($property->class, $property->name);\n if ($refectionProperty->isPublic() || $refectionProperty->isProtected()) {\n $this->_ReflectedPropertiesCache[] = $property->name;\n }\n }\n }\n }\n\n return $this->_ReflectedPropertiesCache;\n }",
"public function getProperties($public = true)\n {\n $vars = get_object_vars($this);\n\n if ($public) {\n foreach ($vars as $key => $value) {\n if ('_' == substr($key, 0, 1)) {\n unset($vars[$key]);\n }\n }\n }\n\n return $vars;\n }",
"public function getExposedProperties(): array;",
"abstract protected function getDirectGetters();",
"function getProperties($public = true) {\n\t\t$vars = get_object_vars ( $this );\n\n\t\tif ($public) {\n\t\t\tforeach ( $vars as $key => $value ) {\n\t\t\t\tif ('_' == substr ( $key, 0, 1 )) {\n\t\t\t\t\tunset ( $vars [$key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $vars;\n\t}",
"protected function getPublicProperties() {\n\t\t$getPublicProperties = function($obj) { return get_object_vars($obj); };\n\t\treturn $getPublicProperties($this);\n\t}",
"public function properties()\r\n {\r\n $props = $this->class->getProperties();\r\n \r\n sort( $props );\r\n \r\n foreach ( $props as $key => $property )\r\n {\r\n // Only show public properties, because Reflection can't get the private ones\n if ( $property->isPublic() )\r\n {\r\n $props[$key] = new Docs_Property( $this->class->name, $property->name );\r\n }\r\n else\r\n {\r\n unset( $props[$key] );\r\n }\r\n }\r\n \r\n return $props;\r\n }",
"function getReadOnly() { return $this->_readonly; }",
"public function listInvalidProperties();",
"public function get_readonly() {\n return $this->readonly;\n }",
"public function getReadOnlyFlag() {}",
"public function getIsReadOnly()\n {\n if (array_key_exists(\"isReadOnly\", $this->_propDict)) {\n return $this->_propDict[\"isReadOnly\"];\n } else {\n return null;\n }\n }",
"public static function getProperties() : array {\r\n return self::$properties;\r\n }",
"abstract protected function properties();",
"public function getFillableProperties(): array;",
"public function isReadonly() : bool {\n return (bool) ($this->flags & Class_::MODIFIER_READONLY);\n }",
"abstract protected function getProperties();",
"public function properties() : array\n {\n return array_keys($this->_properties);\n }",
"public function populatableProperties() : array;",
"public function getReadonly() {\n\t\treturn $this->readonly;\n\t}",
"public function isReadOnly() {}",
"public function isReadOnly() {}",
"public function isReadOnly() {}",
"public function isReadonly()\n {\n return false;\n }",
"private function visibleProperties() : array\n {\n $properties = array_keys($this->_properties);\n $properties = array_merge($properties, $this->_virtual);\n\n return array_diff($properties, $this->_hidden);\n }",
"public function getAllProperties(): array\n {\n return get_object_vars($this);\n }",
"public function isReadOnly();",
"public function isReadOnly();"
]
| [
"0.72041833",
"0.7175304",
"0.6345248",
"0.62817764",
"0.62761015",
"0.6251292",
"0.6242607",
"0.6162329",
"0.614344",
"0.61332357",
"0.61320484",
"0.6095716",
"0.6085419",
"0.6044297",
"0.60346293",
"0.60303825",
"0.6025138",
"0.6021359",
"0.6013129",
"0.60040426",
"0.5975164",
"0.59639734",
"0.5958395",
"0.5958395",
"0.5957711",
"0.5945451",
"0.59396577",
"0.5938862",
"0.5938793",
"0.5938793"
]
| 0.8139082 | 0 |
Build notifications on entity update | public function notificationsOnUpdate(NotificationBuilder $builder)
{
//$date=new \DateTime('now', new \DateTimeZone('Africa/Tunis'));
return $builder;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }",
"public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }",
"function notify()\n {\n foreach ($this->observers as $obKey => $obValue) {\n $obValue->update($this);\n }\n }",
"public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }",
"public function after_update() {}",
"public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}",
"public function notify()\n {\n foreach ($this->storage as $obs){\n $obs->update($this);\n }\n }",
"public function showUpdateNotification(){\n\t\techo $this->getUpdateNotification();\n\t}",
"public function update($notification);",
"protected function updateEntity($entity)\n {\n $enviarCorreo_publicado = false;\n $em = $this->getDoctrine()->getManager();\n $uow = $em->getUnitOfWork();\n $uow->computeChangeSets();\n $changeSet = $uow->getEntityChangeSet($entity);\n \n if ($changeSet) {\n if (array_key_exists(\"publicado\", $changeSet)) {\n if ($changeSet['publicado'][1] == true) {\n $enviarCorreo_publicado = true;\n }\n } \n }\n \n //verificio si se modificaron los comentarios\n $modificacion_comentarios=$entity->getComentarios()->isDirty(); \n $nuevos_comentarios=[];\n if($modificacion_comentarios){\n $nuevos_comentarios=$entity->getComentarios()->getInsertDiff();\n }\n \n \n parent::updateEntity($entity);\n \n\n // obtengo ahora el mail de soporte\n $soporte_mail = $this->getDoctrine()\n ->getRepository(Contenido::class)\n ->findOneByCodigo('soporte_mail');\n\n if ($soporte_mail) {\n $soporte_mail = $soporte_mail->getTexto();\n } else {\n $soporte_mail = '';\n }\n\n // obtengo ahora el nro de telefono del soporte \n $soporte_tel = $this->getDoctrine()\n ->getRepository(Contenido::class)\n ->findOneByCodigo('soporte_tel');\n if ($soporte_tel) {\n $soporte_tel = $soporte_tel->getTexto();\n } else {\n $soporte_tel = '';\n }\n\n\n if ($modificacion_comentarios) {\n //obtengo los nuevos comentarios\n \n //obtengo los usuarios y los colaboradores para notificarles de los comentarios\n $usuario=$entity->getUser();\n $colaboradores=[];\n if ($entity->getOng()) {\n $colaboradores=$entity->getOng()->getColaborators();\n }\n \n $usuarios=$colaboradores;\n $usuarios[]=$usuario;\n\n foreach ($usuarios as $user) {\n $message = (new \\Swift_Message('Nuevo comentario de noticia'))\n ->setFrom('[email protected]')\n ->setSubject('Nuevo comentario de noticia : '.$entity->getTitulo())\n ->setTo($user->getEmail())\n ->setBody(\n $this->renderView(\n 'mails/comentario_entrada.html.twig',\n array(\n 'soporte_tel' => $soporte_tel, \n 'soporte_mail'=> $soporte_mail,\n 'entrada'=>$entity,\n 'tipo'=>1,\n 'nuevos_comentarios'=>$nuevos_comentarios\n )\n ),\n 'text/html'\n );\n \n $this->get('mailer')->send($message);\n }\n }\n\n if ($enviarCorreo_publicado) {\n \n \n $usuarios=$this->getDoctrine()\n ->getRepository(User::class)\n ->findBy(['enabled'=>1]);\n \n // Envio correo\n foreach ($usuarios as $usuario) {\n \n $message = (new \\Swift_Message('Nueva noticia'))\n ->setFrom('[email protected]')\n ->setSubject('Nueva noticia: '.$entity->getTitulo())\n ->setTo($usuario->getEmail())\n ->setBody(\n $this->renderView(\n 'mails/nueva_entrada.html.twig',\n array(\n 'soporte_tel' => $soporte_tel, \n 'soporte_mail'=> $soporte_mail,\n 'tipo'=>1,\n 'entrada'=>$entity\n )\n ),\n 'text/html'\n );\n \n $this->get('mailer')->send($message);\n }\n }\n }",
"function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }",
"public function getUpdated();",
"public function getUpdated();",
"public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}",
"public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }",
"public function notify()\n {\n foreach ($this->observers as $value) {\n $value->update($this);\n }\n }",
"public function notify()\r\n {\r\n foreach( $this->observers as $observer )\r\n $observer->update( $this );\r\n\r\n }",
"public function notify()\n\t{\n\t\tforeach ($this->observers as $obs)\n\t\t{\n\t\t\t$obs->update($this);\n\t\t}\n\t}",
"function before_update() {}",
"public function notify()\n {\n foreach($this->_storage AS $observer) {\n $observer->update($this);\n }\n }",
"public function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update();\n }\n }",
"public function afterUpdate(&$id, \\stdClass $data, Entity $entity) { }",
"public function notify()\n {\n foreach ($this->_observers as $observer) {\n $observer->update($this);\n }\n }",
"public function refreshUpdated() {\n $this->setUpdated(new \\DateTime(\"now\"));\n}",
"public function notificationsAction()\n {\n $callback = function ($msg) {\n //check the db before running anything\n if (!$this->isDbConnected('db')) {\n return ;\n }\n\n if ($this->di->has('dblocal')) {\n if (!$this->isDbConnected('dblocal')) {\n return ;\n }\n }\n\n //we get the data from our event trigger and unserialize\n $notification = unserialize($msg->body);\n\n //overwrite the user who is running this process\n if ($notification['from'] instanceof Users) {\n $this->di->setShared('userData', $notification['from']);\n }\n\n if (!$notification['to'] instanceof Users) {\n echo 'Attribute TO has to be a User' . PHP_EOL;\n return;\n }\n\n if (!class_exists($notification['notification'])) {\n echo 'Attribute notification has to be a Notificatoin' . PHP_EOL;\n return;\n }\n $notificationClass = $notification['notification'];\n\n if (!$notification['entity'] instanceof Model) {\n echo 'Attribute entity has to be a Model' . PHP_EOL;\n return;\n }\n\n $user = $notification['to'];\n\n //instance notification and pass the entity\n $notification = new $notification['notification']($notification['entity']);\n //disable the queue so we process it now\n $notification->disableQueue();\n\n //run notify for the specifiy user\n $user->notify($notification);\n\n $this->log->info(\n \"Notification ({$notificationClass}) sent to {$user->email} - Process ID \" . $msg->delivery_info['consumer_tag']\n );\n };\n\n Queue::process(QUEUE::NOTIFICATIONS, $callback);\n }",
"function after_update() {}",
"public function onUpdate();",
"public function onUpdate();",
"public function onUpdate();",
"function notify_modifications($new, $updates) {\n\tif (count($new) > 0) {\n\t\techo \"<p><b>New terms created:</b></p><ul>\";\n\t\tfor ($c = 0; $c < count($new); $c++) {\n\t\t\techo \"<li>\" . $new[$c][\"Id\"] . \": \" . $new[$c][\"Name\"] . \"</li>\";\t\n\t\t}\n\t\techo \"</ul>\";\n\t}\n\tif (count($updates) > 0) {\n\t\techo \"<p><b>The following terms were modified:</b></p><ul>\";\n\t\tfor ($u = 0; $u < count($updates); $u++) {\n\t\t\techo \"<li>\" . $updates[$u][\"id\"] . \": \" . $updates[$u][\"name\"] . \"</li>\";\n\t\t}\n\t\techo \"</ul>\";\n\t}\n}"
]
| [
"0.61516434",
"0.61056226",
"0.59833634",
"0.59751785",
"0.59266293",
"0.5911882",
"0.58911955",
"0.588817",
"0.58685094",
"0.5853094",
"0.5848839",
"0.58475834",
"0.58475834",
"0.5810197",
"0.5790469",
"0.57888824",
"0.5776381",
"0.5741014",
"0.5740769",
"0.57054645",
"0.57007253",
"0.56986874",
"0.5675981",
"0.56758124",
"0.5645015",
"0.564161",
"0.5637806",
"0.5637806",
"0.5637806",
"0.56301993"
]
| 0.62035394 | 0 |
Path where a word list for a given locale lives. | protected function getWordListPath(): string
{
return __DIR__ . "/../data/{$this->locale}.txt";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBooksPath($locale);",
"function getWhatsNewArticlesPath($locale);",
"function getReleasesPath($locale);",
"function sti_get_localization_directory()\r\n\t{\r\n\t\treturn \"localization\";\r\n\t}",
"function sti_get_localization_directory()\n\t{\n\t\treturn \"localization\";\n\t}",
"protected function getLanguagePath()\n {\n return $this->resourcePath('lang');\n }",
"private function getLocalesDirectory()\r\n {\r\n // Get path from config\r\n return config('transeditor.language_file_path');\r\n }",
"public function wp_lang_dir()\n {\n }",
"function getVideosPath($locale);",
"public static function langPath(){\n return \\Illuminate\\Foundation\\Application::langPath();\n }",
"protected function getLocalLangFileName() {}",
"protected function getPath()\n\t{\n\t\tif ($this->path === null)\n\t\t{\n\t\t\t$client = $this->getClient();\n\t\t\t$this->path = LanguageHelper::getLanguagePath($client->path);\n\t\t}\n\n\t\treturn $this->path;\n\t}",
"protected function paths()\n {\n return [\n base_path('lit/resources/lang/'),\n ];\n }",
"private static function path($lang)\n\t{\n\t\t$path = $GLOBALS['__APPDIR'] . '/lang/'.strtolower($lang);\n\t\treturn $path;\n\t}",
"function getResourcesLangPath($module)\n {\n return \"$module->path/{$this->localizationSettings->moduleLangPath}\";\n }",
"public static function getLanguageDir() {\n return public_path(self::LANGUAGE_DIR);\n }",
"private function formatStopWordsPath()\n {\n if (empty(self::STOP_WORD_FILE)) {\n throw new Exception('The stopwords file path has not been set in the script');\n }\n\n if (basename(getcwd()) === basename(__DIR__)) {\n return '../' . self::STOP_WORD_FILE;\n }\n\n return self::STOP_WORD_FILE;\n }",
"public static function siteTextDomain()\n {\n $langCode = Languages::getCurrentLanguage();\n return DirPaths::siteLocale().\n $langCode.\n \\DIRECTORY_SEPARATOR.\n $langCode.\n FileExts::DOT_MO;\n }",
"protected function get_paths()\n {\n\n return array(\n WP_LANG_DIR . '/' . $this->textdomain . '-' . get_locale() . '.mo',\n Kirki::$path . '/languages/' . $this->textdomain . '-' . get_locale() . '.mo',\n );\n\n }",
"public function languagePath($path = '')\n\t{\n\t\treturn $this['path.language'];\n\t}",
"public static function sitesSharedTextDomain()\n {\n $langCode = Languages::getCurrentLanguage();\n return DirPaths::sitesSharedLocale().\n $langCode.\n \\DIRECTORY_SEPARATOR.\n $langCode.\n FileExts::DOT_MO;\n }",
"public static function getTranslationFolderPath(): string\n {\n return self::$translationFolderPath;\n }",
"public function getSystemDirectoryPath() {\n return Mage::getBaseDir('var') . '/smartling/localization_files';\n }",
"function _get_path_to_translation_from_lang_dir($domain)\n {\n }",
"public static function LanguageFolder()\n {\n return dirname(dirname(__DIR__)).DIRECTORY_SEPARATOR.Configuration::getApplicationFolder().DIRECTORY_SEPARATOR.'Language';\n }",
"public function getThemeLanguageDir()\n {\n return $this->paths->getThemeLanguageDir();\n }",
"private function articlePath($locale, $project = false)\r\n {\r\n $projectId = PROJECT_DIRNAME . DS . $this->_helper->getProject() . DS;\r\n if(!$project){\r\n $projectId = '';\r\n }\r\n\r\n $path = PATH . DS .\r\n PRODUCT_DIRNAME . DS .\r\n $this->_helper->getProduct() . DS .\r\n $projectId .\r\n SECTIONS_DIRNAME . DS .\r\n $this->getSectionId() . DS.\r\n $locale . DS .\r\n $this->getArticleId() . '.php';\r\n\r\n $this->_currentArticle = $path;\r\n\r\n return $path;\r\n }",
"public static function getTranslationFileDirectory() {\n return PIMCORE_PLUGINS_PATH.\"/PimTools/texts\";\n }",
"public function getWordListFile()\n {\n return $this->wordListFile;\n }",
"protected function getWordListFromDisk(): string\n {\n return file_get_contents($this->getWordListPath());\n }"
]
| [
"0.6922755",
"0.6762844",
"0.67006016",
"0.6591839",
"0.6556236",
"0.65126604",
"0.64544886",
"0.62423617",
"0.61989456",
"0.61464024",
"0.60720664",
"0.60499775",
"0.6026974",
"0.5955511",
"0.59446484",
"0.5919494",
"0.59168524",
"0.5909257",
"0.5904541",
"0.5897232",
"0.58293706",
"0.58100057",
"0.57712865",
"0.5681695",
"0.5674755",
"0.566504",
"0.56644017",
"0.5646175",
"0.56455976",
"0.56242967"
]
| 0.8324939 | 0 |
Retrieve the word list from disk. | protected function getWordListFromDisk(): string
{
return file_get_contents($this->getWordListPath());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getWordList(): array\n {\n return explode(\"\\n\", trim($this->getWordListFromDisk()));\n }",
"public function WordCollection()\n {\n $myWords = parent::WordCollection();\n\n if(!$myWords->loadedFromFile())\n {\n // English Words\n $myWords->addText(\"en-us\", \"TITLE\", \"Module Login\");\n\n // Portuguese Words\n $myWords->addText(\"pt-br\", \"TITLE\", \"Módulo de Login\");\n }\n\n return $myWords;\n }",
"public function getWordListFile()\n {\n return $this->wordListFile;\n }",
"public function getWordList()\n {\n return $this->wordList;\n }",
"public function getAllWords(){\n $handle = fopen(\"assets/en-US.dic\", \"r\");\n $words = [];\n $i=0;\n if ($handle) {\n while (($line = fgets($handle)) !== false) {\n $line = trim(preg_replace('/\\s\\s+/', ' ', $line));\n $line = strtolower($line);\n $yy = strpos($line, \"'\");\n if(!is_numeric($yy) && strlen($line) < 15 && strlen($line) > 2){\n $words[] = $line;\n }\n }\n fclose($handle);\n return ['status'=>1, 'message'=>'Success', 'body'=>$words];\n } else {\n return ['status'=>0, 'message'=>'Error', 'body'=>'Unable to read dictionary file!'];\n }\n }",
"public function readFileByWord() {\r\n\t\tif ($this->exists) {\r\n\t\t\t$filecontents = file_get_contents ( $this->filename );\r\n\t\t\t$words = preg_split ( '/[\\s]+/', $filecontents, - 1, PREG_SPLIT_NO_EMPTY );\r\n\t\t\treturn $words;\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function getDocuments();",
"static function get_words_of_list($list_id) {\n global $con;\n $sql = \"SELECT `id`, `list`, `language1`, `language2` FROM `word` WHERE `list` = \".$list_id.\" AND `status` = 1 ORDER BY `id` DESC\";\n $query = mysqli_query($con, $sql);\n $output = array();\n while ($row = mysqli_fetch_assoc($query)) {\n array_push($output, new Word($row['id'], $row['list'], $row['language1'], $row['language2']));\n }\n return $output;\n }",
"public function getWordFile()\n {\n $word = new Word(\n $this->getNavn() . ' oppdatert ' . date('d-m-Y') . ' kl '. date('Hi') . ' - ' . $this->getArrangement()->getNavn(),\n $this->getRenderData(),\n $this->getConfig(),\n $this->getWordFormatter()\n );\n return $word->writeToFile();\n }",
"public function get_names() {\n return String_util::get_lines(Text_file::read($this->_storage_path));\n }",
"public function getWords(): array\n {\n return $this->getWordList();\n }",
"function getWords() {\r\r\n\t\t$arr = array();\r\r\n\t\tif ($this->table != '' && $this->field != '') {\r\r\n\t\t\t$sql = 'SELECT '.KT_escapeFieldName($this->field).' AS myfield FROM '.$this->table; \r\r\n\t\t\t$rs = $this->tNG->connection->Execute($sql);\r\r\n\t\t\tif ($this->tNG->connection->errorMsg()!='') {\r\r\n\t\t\t\t$this->error = new tNG_error('BADWORDS_SQL_ERROR', array(), array($this->tNG->connection->errorMsg(), $sql));\r\r\n\t\t\t\treturn $arr;\r\r\n\t\t\t}\r\r\n\t\t\twhile (!$rs->EOF) {\r\r\n\t\t\t\t$arr[] = trim($rs->Fields('myfield'));\r\r\n\t\t\t\t$rs->MoveNext();\r\r\n\t\t\t}\r\r\n\t\t\t$rs->Close();\r\r\n\t\t} else {\r\r\n\t\t\t$file = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'tNG_ChkForbiddenWords.txt';\r\r\n\t\t \tif (!file_exists($file)) {\r\r\n\t\t \t\t$this->error = new tNG_error('BADWORDS_FILE_ERROR', array(), array($file));\r\r\n\t\t \treturn $arr;\r\r\n\t\t \t}\r\r\n\t\t \tif ($fd = @fopen($file, 'rb')) {\r\r\n\t\t\t\twhile (!feof ($fd)) {\r\r\n\t\t \t\t\t$tmp = fgets($fd, 4096);\r\r\n\t\t \t\t\t$tmp = addcslashes($tmp, '/.()[]{}|^$');\r\r\n\t\t \t\t\tif (trim($tmp) != '') {\r\r\n\t\t \t\t\t\t$arrTmp = explode(',', $tmp);\r\r\n\t\t \t\t\tforeach ($arrTmp as $k => $v) {\r\r\n\t\t \t\t\t\t$arr[] = trim($v);\r\r\n\t\t \t\t \t}\r\r\n\t\t \t\t}\r\r\n\t\t \t}\r\r\n\t\t \tfclose ($fd);\r\r\n\t\t \t} else {\r\r\n\t\t \t$this->error = new tNG_error('BADWORDS_FILE_ERROR', array(), array($file));\r\r\n\t\t\t\treturn $arr;\r\r\n\t\t \t}\r\r\n\t\t}\r\r\n\t\treturn $arr;\r\r\n\t}",
"protected function getWordListPath(): string\n {\n return __DIR__ . \"/../data/{$this->locale}.txt\";\n }",
"public function getManuals()\n\t{\n\t\treturn $this->getDirectories($this->storagePath);\n\t}",
"function read_file_list() {\n // read from file\n $listFile = fopen(\"images/filelist.txt\", \"r\");\n $list = fread($listFile, filesize(\"images/filelist.txt\"));\n fclose($listFile);\n\n // convert to array\n $list = explode(\"\\n\", $list);\n return $list;\n}",
"public function getList($path);",
"public function getWords()\n {\n return $this->_model->getWords();\n }",
"public function getBlackWordListFromDB(){\n\t\t$sql = \" SELECT find \"\n\t\t\t.\" FROM bbs_words \";\n\t\t$dbw = Sw_Db_Wrapper::getInstance();\n\t\t$data = $dbw->getFlatCached(\"club\", $sql, 10 * 10,\"BlackWordList\");\n\t\tif (count($data) > 0){\n\t\t\t$this->mem->set(\"BlackWordList\", $data, 1800);\n\t\t\t$this->bwl = $data;\n\t\t}\n\t}",
"public function getList() {\n\t\treturn Cgn_Module_Manager_File::getListStatic();\n\t}",
"abstract public function getDocuments();",
"static function get_word_list($user_id, $word_list_id, $log) {\n global $con;\n \n $sql = \"\n\t\tSELECT `list`.`id`, `list`.`name`, `list`.`creator`, `list`.`comment`, `list`.`language1`, `list`.`language2`, `list`.`creation_time`\n\t\tFROM `list`, `share`\n\t\tWHERE (`list`.`creator` = '\".$user_id.\"' OR `share`.`user` = '\".$user_id.\"' AND `share`.`list` = '\".$word_list_id.\"') AND \n `list`.`id` = '\".$word_list_id.\"' AND \n `list`.`active` = 1 AND `share`.`permissions` <> 0\";\n $query = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($query)) {\n $list = new WordList(\n $row['id'],\n $row['name'],\n SimpleUser::get_by_id($row['creator']),\n $row['comment'],\n $row['language1'],\n $row['language2'],\n $row['creation_time'], null);\n $list->load_words(true, $user_id, \"ASC\");\n $list->load_sharing_information($user_id);\n $list->set_labels(WordList::get_labels_of_list($user_id, $word_list_id));\n\n\n // log the list access inside the loop to make sure it is only logged if the user has actually access to the list\n if ($log === true) {\n self::add_list_usage($user_id, $word_list_id);\n }\n\n return $list;\n }\n return NULL;\n }",
"private function getWordFromDb($word)\n {\n $retrievedRecord = array();\n\n try {\n //Connect to the database and open connections\n\n $connectionString = 'sqlite:' . __DIR__ . '/../words.sqlite3';\n \n //echo \"CONNECTION: $connectionString\\n\";\n\n $dbHandler = new PDO($connectionString);\n // Set errormode to exceptions\n $dbHandler->setAttribute(\n PDO::ATTR_ERRMODE, \n PDO::ERRMODE_EXCEPTION\n );\n\n // Select all data from memory db messages table \n $statement = $dbHandler->prepare(\n \"SELECT * FROM words WHERE lower(words.asciiword) = ?\"\n );\n\n $wordToCheck = $this->collateWord(mb_strtolower($word, 'UTF-8'));\n if ($statement->execute(array($wordToCheck))) {\n while ($row = $statement->fetch()) {\n //echo \"Id: \" . $row['id'] . \"\\n\";\n //echo \"Word: \" . $row['word'] . \"\\n\";\n //echo \"Flags: \" . $row['flags'] . \"\\n\";\n //echo \"\\n\";\n $retrievedRecord = $row;\n }\n }\n\n //Close db connections\n $dbHandler = null;\n }\n catch(PDOException $e) {\n // Print PDOException message\n echo $e->getMessage() . \"\\n\";\n }\n \n return $retrievedRecord;\n }",
"public function getLocalMirrorListFile() {}",
"function readWebFile($path){\n\t//echo $path.\"<BR>\";\n\t\n\t$handle=fopen($path, \"r\");\n\t$contents=file_get_contents($path);\n\t$contents=strtolower(strip_tags($contents));\n\t$contents=preg_replace(\"/\\t|\\r|\\n|\\,|\\.|\\?|\\;|\\:|\\'|\\/|\\~|\\!|\\%|\\(|\\)|\\\"|\\-/\", \" \", $contents);\n\t$arr=explode(\" \", $contents);\n\t$arr2=array_count_values($arr);\n\tksort($arr2);\n\tforeach ($arr2 as $key => $value) {\n\t\tif(!empty($key)){\n\t\t\t$queryWord=\"select * from words where word='$key'\";\n\t\t\t$resWord=mysql_query($queryWord);\n\t\t\tif(isset($resWord) && (mysql_num_rows($resWord) == 0)){\n\t\t\t\t//echo \"no related data, so add one!\".\"<BR>\";\n\t\t\t\t$queryNum=\"select * from words\";\n\t\t\t\t$res1=mysql_query($queryNum);\n\t\t\t\t$id=mysql_num_rows($res1)+1;\n\t\t\t\t\n\t\t\t\t$insertWord=\"insert into words (word_id,word) values ('$id','$key')\"; \n\t\t\t\tif(!mysql_query($insertWord)){\n\t\t\t\t\tdie('Error: '.mysql_error());\n\t\t\t\t}\n\t\t\t\t//echo \"1 record added to words table\".\"<BR>\";\n\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"already have word \".$key.\" in words table.\".\"<BR>\";\n\t\t\t}\n\t\t\t$row1=mysql_fetch_row(mysql_query(\"select file_id from files where file_url='$path' or file_name='$path'\"));\n\t\t\t$file_id=$row1[0];\n\t\t\t$row2=mysql_fetch_row(mysql_query(\"select word_id from words where word='$key'\"));\n\t\t\t$word_id=$row2[0];\n\t\t\t$queryCount=\"select * from file_word where file_id='$file_id' and word_id='$word_id'\";\n\t\t\t$resCount=mysql_query($queryCount);\n\t\t\tif(isset($resCount) && (mysql_num_rows($resCount) == 0)){\n\t\t\t\t//echo \"no related data, so add one!\".\"<BR>\";\n\t\t\t\t\n\t\t\t\t$insertCount=\"insert into file_word (file_id,word_id,count) values ('$file_id','$word_id','$value')\"; \n\t\t\t\tif(!mysql_query($insertCount)){\n\t\t\t\t\tdie('Error: '.mysql_error());\n\t\t\t\t}\n\t\t\t\t//echo \"1 record added to words table\".\"<BR>\";\n\n\t\t\t\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"already have this record in file_word table.\".\"<BR>\";\n\t\t\t}\n\t\t}\n\t\t\n\t}\t\n\tfclose($handle);\n}",
"public function getDocs()\n {\n\n\t\t$rootPath = 'modules/Mediasharex/docs';\n $docs = FileUtil::getFiles($rootPath, true, true, false, false);\n\t\treturn $docs;\n\t}",
"public function index()\n\t{\n\t\t$words = $this->word->get();\n\n\t\treturn view('words.index', compact('words'));\n\t}",
"public function words()\n {\n return self::create('',$this->provider->words()); \n }",
"public function index()\n {\n $words = Word::orderBy('id', 'desc')->paginate(5);\n return view('admin.words.index')->withWords($words);\n }",
"public function getWordsFromFile($fileName)\n\t{\n\t\t$words = array();\n foreach($this->words as $word){\n\t\t\tif($word->occurredInFile($fileName)){\n\t\t\t\tarray_push($words, $word);\n\t\t\t}\n\t\t}\n\t\treturn $words;\n\t}",
"function generateWordFile($wordFile){\n #Intialization\n define(\"PAULS_SITE_MAX_PAGE\", 30); //Define a constant on how many pages Paul's site has\n $urls = [];\n $allWords = [];\n\n #Create an array with all page urls\n for($i = 0; $i < PAULS_SITE_MAX_PAGE; $i++){\n if($i % 2 == 0){\n $urls[] = \"http://www.paulnoll.com/Books/Clear-English/words-\". sprintf('%02d', $i + 1) . \"-\" . sprintf('%02d', $i + 2) . \"-hundred.html\";\n }\n }\n\n $pattern = '~<li>(.*?)</li>~s'; //Declare the pattern. All words are in between a html <li></li> tag\n\n #Loop through all the pages and dump all the words to pwWords array\n foreach($urls as $url) {\n $wordPage = file_get_contents($url);\n preg_match_all ($pattern, $wordPage, $allWords);\n foreach($allWords[0] as $word){\n $pwWords[] = trim(strip_tags($word));\n }\n }\n\n #Now create a JSON string from the words retrieved\n $jsonString = \"{\";\n $i = 0;\n foreach($pwWords as $pwWord){\n //$pwWord = trim(str_replace(\"<\\li>\",\"\",str_replace(\"<li>\",\"\",$pwWord)));\n if($i < count($pwWords)-1){\n $jsonString = $jsonString . '\"' . $i . '\":' . '\"' . $pwWord . '\",';\n } else{\n $jsonString = $jsonString . '\"' . $i . '\":' . '\"' . $pwWord . '\"';\n }\n $i++;\n }\n $jsonString = $jsonString . \"}\";\n\n #Save the JSON string in the \"words.json\" file in the \"data\" folder\n file_put_contents($wordFile, $jsonString);\n\n /*ALternate way opening and saving the data in a new file*/\n /*-------------------------------------------------------*/\n //$myfile = fopen($wordFile, \"w\") or die(\"Unable to open file!\");\n //fwrite($myfile, $jsonString);\n //fclose($myfile);\n }"
]
| [
"0.69176173",
"0.66145486",
"0.65375847",
"0.63882345",
"0.63167757",
"0.6135977",
"0.5889868",
"0.5860068",
"0.5858281",
"0.5843811",
"0.58419174",
"0.5788018",
"0.571278",
"0.5690639",
"0.56740594",
"0.56730014",
"0.5651706",
"0.55365473",
"0.5531475",
"0.55249983",
"0.5488471",
"0.54716134",
"0.5465224",
"0.54573745",
"0.54478586",
"0.5416858",
"0.54121363",
"0.53976953",
"0.5361675",
"0.5361523"
]
| 0.83318174 | 0 |
Show the form for creating a new Uom. | public function create()
{
return view('uoms.create');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n //\n return View::make('admin.form_int_mun');\n }",
"public function create()\n {\n //\n return view('admin.lunbotu.create');\n }",
"public function create()\n {\n return view('admin.createform');\n }",
"public function create()\n {\n //\n $pagename = 'Form Input Akun';\n return view('admin.akun.create', compact('pagename'));\n }",
"public function create()\n {\n //\n return view('layouts.unit_types.form', ['type' => 'create']);\n }",
"public function create()\n {\n return view('admin.pages.forms.pengirim');\n }",
"public function create()\n {\n $mobil = new Mobil();\n return view('mobil.form', compact('mobil'));\n }",
"public function create()\n {\n $this->generateParams();\n return view('backend.pages.user._form', compact('gender', 'type', 'city'));\n }",
"public function create()\n {\n return view('admin.tamu.create');\n }",
"public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}",
"public function create()\n {\n return view ('forms.create');\n }",
"public function newform()\n {\n return view('firma.unos');\n }",
"public function create()\n {\n $asesores = Asesor::all();\n return view('admin.unification.form-add', compact('asesores'));\n }",
"public function create()\n {\n return view('dusun.add');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create ()\n {\n return view('forms.create');\n }",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"public function create()\n {\n return view('users.forms.create');\n }",
"public function create()\n\t{\n\t\t$data[\"supir\"] = $this->getData(\"user/supir/role\");\n\t\t$data[\"kenek\"] = $this->getData(\"user/kenek/role\");\n\t\treturn view(\"penjualan.form\", $data);\n\t}",
"public function create()\n\t{\n\t\treturn View::make('userCardio.create');\n\t}",
"public function create()\n {\n return view(\"users.usersform\");\n }",
"public function create()\n {\n return view('academia.alunos.create');\n }",
"public function create()\n {\n return view('admin.forms.create');\n }",
"public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }",
"public function showUserCreationForm()\n {\n return view('admin.user_create');\n }",
"public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }",
"public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }",
"public function create()\n\t{\n\t\treturn view('faith.form');\n\t}",
"public function create()\n {\n return view('oxigenos.create');\n }"
]
| [
"0.7486583",
"0.7328785",
"0.7307161",
"0.7306137",
"0.7305139",
"0.7277005",
"0.72725666",
"0.7254481",
"0.7237555",
"0.72364783",
"0.7232689",
"0.72312933",
"0.7226471",
"0.7219735",
"0.7215726",
"0.7215726",
"0.7200558",
"0.7192736",
"0.7186334",
"0.7184103",
"0.71835434",
"0.71759486",
"0.7164865",
"0.7160521",
"0.71595013",
"0.7140968",
"0.7133014",
"0.7127612",
"0.7116023",
"0.71055114"
]
| 0.78876215 | 0 |
Store a newly created Uom in storage. | public function store(CreateUomRequest $request)
{
$input = $request->all();
$uom = $this->uomRepository->store($input);
Flash::message('Uom saved successfully.');
return redirect(route('admin.uoms.index'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function persist()\n {\n $uid = $this->getIdentifier() == 0 ? 'NEW' . rand(100000, 999999) : $this->getIdentifier();\n $data = [\n trim(static::$storageTableName) => [\n $uid => $this->getPersistableDataArray()\n ]\n ];\n // New records always must have a pid\n if ($this->getIdentifier() == 0) {\n $data[trim(static::$storageTableName)][$uid]['pid'] = 0;\n }\n /** @var \\TYPO3\\CMS\\Core\\DataHandling\\DataHandler $tce */\n $tce = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\DataHandling\\DataHandler::class);\n $tce->start($data, []);\n $tce->process_datamap();\n }",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store() {\n\t\t//\n\t}",
"public function store() {\n\t\t//\n\t}",
"public function store() {\n\t\t//\n\t}",
"public function store()\n {\n if( $this->isPersistent() )\n {\n $this->update();\n }\n else\n {\n $this->insert();\n }\n }",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
]
| [
"0.67476815",
"0.66269046",
"0.66269046",
"0.66269046",
"0.6626812",
"0.6587882",
"0.65840906",
"0.65840906",
"0.65840906",
"0.6548752",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033",
"0.6546033"
]
| 0.6723814 | 1 |
User list page function, displays a list of all registered users on the website | public function userList() {
/** @var User[] $users */
$users = $this->entityManager->getRepository("Entity\\User")->findAll(); // Retrieve all User objects registered in database
echo $this->twig->render('admin/lists/users.html.twig', ['users' => $users]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}",
"public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}",
"public function index()\n {\n $this->user_list();\n }",
"function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }",
"public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }",
"public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }",
"public function user_list()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('User_Profiles', 'up');\n\t\t\t$data['users'] = $this->up->get_all_users();\n\t\t\t$this->load->view('user_list-admin',$data);\n\t\t}",
"public function index()\n {\n $this->userlist();\n }",
"public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }",
"public function all_londontec_users(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/viewusers';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'londontec LMS users lists',\n\t\t\t'userslist' => $this->setting_model->Get_All('londontec_users'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}",
"public function _list()\n\t{\n\t\t_root::getRequest()->setAction('list');\n\t\t$tUsers = model_user::getInstance()->findAll();\n\n\t\t$oView = new _view('users::list');\n\t\t$oView->tUsers = $tUsers;\n\t\t$oView->showGroup = true;\n\t\t$oView->title = 'Tous les utilisateurs';\n\n\t\t$this->oLayout->add('work', $oView);\n\t}",
"public function showListAction() {\n $users = $this->getDoctrine()\n ->getRepository(User::class)\n ->findAll();\n return $this->render(':Security\\User:users.html.twig', [\n 'users' => $users\n ]);\n }",
"public function listUser() {\n\t\t$users = new Model_Users();\n\t\t$listeUsers = $users->listUsers();\n\t\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/ecommerce/views/admin/users/liste_users.php\");\n\t}",
"public function list_user()\n\t{\n\t\tcheck_access_level_superuser();\n\t\t$data = [\n\t\t\t'list_user' => $this->user_m->get_cabang(),\n\t\t\t'list_cabang' => $this->data_m->get('tb_cabang')\n\t\t];\n\t\t$this->template->load('template2', 'user/list_user', $data);\n\t}",
"function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}",
"public function showUsers()\n {\n $userRepo = $this->getDoctrine()->getRepository(User::class);\n $users = $userRepo->getUsersOrderByAsc();\n\n return $this->render('admin/list-of-users.html.twig', [\n 'users' => $users\n ]);\n }",
"public function index() \n {\n $users = $this->userRepo->listUser();\n return view('backend.pages.user.list', compact('users'));\n }",
"public function admin_user_list() {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array('User.created' => 'desc' ),\n 'conditions' => array('User.status' => 1),\n );\n $data = $this->paginate('User');\n $this->set('user', $data);\n $this->render('/Users/user_list');\n }",
"public function index()\n {\n $users = $this->userService->getUserWithPaginate();\n return view('admin.user.list', compact('users'));\n }",
"function admin_get_users()\n{\n global $app;\n\n $users = $app->bbs->users();\n $app->render('admin_users.html', [\n 'page' => mkPage(getMessageString('admin_users'), 0, 2),\n 'users' => $users,\n 'isadmin' => is_admin()]);\n}",
"public function usersListAction()\n\t{\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\n\t\t$users = $em->getRepository('McmsUserBundle:User')->findAll();\n\n\t\treturn array('users' => $users);\n\t}",
"function loadUsersListPage()\n {\n $this->get('/usuarios')\n ->assertStatus(200)\n ->assertSee('Listado de usuarios')\n ->assertSee('Javier')\n ->assertSee('Francisco');\n }",
"public function list_page_content () {\n // Check permissions\n if ( ! current_user_can( 'list_users' ) ) {\n return;\n }\n\n // Main listing query\n $this->list_query_users();\n\n // Set urls for column sorting links.\n $sort_link_username = $this->sort_link( 'user_name', $this->orderby, $this->order );\n $sort_link_displayname = $this->sort_link( 'display_name', $this->orderby, $this->order );\n\n // Include template\n include CTAL_PATH.'/admin/templates/users-page.php';\n }",
"public function allUsers()\n\t{\n\t\t$data['users'] = $this->MainModel->selectAll('users', 'first_name');\n\t\t$this->load->view('layout/header');\n\t\t$this->load->view('layout/sidebar');\n\t\t$this->load->view('template/all-users', $data);\n\t\t$this->load->view('layout/footer');\n\t}",
"public function getUsers()\n {\n $title = \"Users\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the users from db\n $users = $this->di->get(\"user\")->getAllUsers();\n\n $data = [\n //\"items\" => $book->findAll(),\n \"users\" => $users,\n ];\n\n $view->add(\"pages/users\", $data);\n //$view->add(\"blocks/footer\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }",
"public function listUsers()\n {\n $users = $this->apiHeaderNav();\n return view('user.userListAll',['data'=>$users]);\n }",
"public function indexAction()\n {\n // Get a query of listing all users from user service\n $pages = $this->get('app.user.service')->getUsers();\n \n // Get pagination\n $pagination = $this->get('app.service')->paginate($pages);\n \n // Render and return the view\n return $this->render(\n '::admin/user/users.html.twig',\n array(\n 'pagination' => $pagination\n )\n );\n }",
"public function index()\n {\n $users = $this->userService::getAll();\n\n return view('admin.pages.users')->with(compact('users'));\n }",
"public function getUsersList()\n {\n }",
"public function listAction()\n {\n $users = $this->container->get( 'wg.openid.user_manager' )->findUsers();\n return $this->container->get('templating')->renderResponse(\n 'WGOpenIdUserBundle:Profile:list.html.twig', array(\n 'users' => $users,\n ));\n }"
]
| [
"0.82374775",
"0.81811094",
"0.8169369",
"0.8139594",
"0.8113109",
"0.8097507",
"0.8094495",
"0.8008773",
"0.7997303",
"0.79674405",
"0.79447997",
"0.7912159",
"0.78353816",
"0.7813688",
"0.7807168",
"0.7768849",
"0.77245307",
"0.7711625",
"0.7659861",
"0.7649208",
"0.7648848",
"0.7646062",
"0.7645591",
"0.76439786",
"0.76378196",
"0.76137704",
"0.7608444",
"0.76020235",
"0.7596173",
"0.75953037"
]
| 0.8338395 | 0 |
Applies one or more text styles to the output. Valid styles are 'bold', 'italic', 'underline', 'strike', and null (to reset the styles). | public function stylize (string ...$styles) : Output
{
$Output = &$this->Output;
$codes = [];
if ( empty($styles) ) {
$styles = [null];
}
foreach ($styles as $style) {
$codes[] = match ($style) {
'bold' => self::_BOLD_STYLE,
'italic' => self::_ITALIC_STYLE,
'underline' => self::_UNDERLINE_STYLE,
'blink' => self::_BLINK_STYLE,
'strike' => self::_STRIKE_STYLE,
default => self::_DEFAULT_STYLE
};
}
// @ Wrap style codes
$wrapped = self::wrap(...$codes);
// @ Output style
$Output->write($wrapped);
// @ Try to keep the last defined colors?
if (! $codes[0] && $this->color) {
$Output->write($this->color);
}
return $Output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function do_text_text_style($showLearning, $mode_trans, $textsize, $ann_exists): void\n{\n $displaystattrans = (int)getSettingWithDefault('set-display-text-frame-term-translation');\n $pseudo_element = ($mode_trans<3) ? 'after' : 'before';\n $data_trans = $ann_exists ? 'data_ann' : 'data_trans';\n $stat_arr = array(1, 2, 3, 4, 5, 98, 99);\n $ruby = $mode_trans==2 || $mode_trans==4;\n\n echo '<style>';\n if ($showLearning) {\n foreach ($stat_arr as $value) {\n if (checkStatusRange($value, $displaystattrans)) {\n echo '.wsty.status', $value, ':', \n $pseudo_element, ',.tword.content', $value, ':', \n $pseudo_element,'{content: attr(',$data_trans,');}';\n echo '.tword.content', $value,':', \n $pseudo_element,'{color:rgba(0,0,0,0)}',\"\\n\"; \n }\n }\n }\n if ($ruby) {\n echo '.wsty {', \n ($mode_trans==4?'margin-top: 0.2em;':'margin-bottom: 0.2em;'),\n 'text-align: center;\n display: inline-block;',\n ($mode_trans==2?'vertical-align: top;':''),\n '}',\"\\n\";\n \n echo '.wsty:', $pseudo_element, \n '{\n display: block !important;',\n ($mode_trans==2?'margin-top: -0.05em;':'margin-bottom: -0.15em;'),\n '}',\"\\n\"; \n }\n $ann_textsize = array(100 => 50, 150 => 50, 200 => 40, 250 => 25);\n echo '.tword:', $pseudo_element, \n ',.wsty:', $pseudo_element, \n '{', \n ($ruby?'text-align: center;':''), \n 'font-size:' . $ann_textsize[$textsize] . '%;', \n ($mode_trans==1 ? 'margin-left: 0.2em;':''), \n ($mode_trans==3 ? 'margin-right: 0.2em;':''), \n ($ann_exists ? '' : '\n overflow: hidden; \n white-space: nowrap;\n text-overflow: ellipsis;\n display: inline-block;\n vertical-align: -25%;'),\n '}';\n \n echo '.hide {'.\n 'display:none !important;\n }';\n echo '.tword:',\n $pseudo_element, ($ruby?',.word:':',.wsty:'),\n $pseudo_element, '{max-width:15em;}';\n echo '</style>';\n}",
"public function setDefaultTextStyle($style) {\n $this->stdout()->setDefaultTextStyle($style);\n return $this;\n }",
"public function applyStyles($styles)\n {\n if (empty($styles)) {\n return null;\n }\n $return = '';\n foreach ($styles as $key => $value) {\n /* If background is defined, and color is not, try to find a suitable contrast */\n if (array_key_exists('background', $styles) && !array_key_exists('color', $styles)) {\n if (isset($config['color_function'])) {\n if ($config['color_function'] == '50') {\n $color = $this->getContrast50($styles['background']);\n } elseif ($config['color_function'] == 'YIQ') {\n $color = $this->getContrastYIQ($styles['background']);\n }\n } else {\n $color = $this->getContrast50($styles['background']);\n }\n $return .= 'color: ' . $color . ';';\n }\n $return .= $key . ': ' . $value . ';';\n }\n return $return;\n }",
"function renderStyle($styles) {\n $str = \"\";\n foreach($styles as $style) {\n \n switch($style['Name']) {\n case 'fontFamily':\n $str .= strtolower(preg_replace('/(?<=\\\\w)(?=[A-Z])/',\"-$1\", $style['Name']));\n $str .= \":\";\n $str .= $this->renderFont($style['Value']);\n $str .= \";\";\n break;\n case 'border':\n $str .= $this->renderBorder($style);\n break;\n case 'margin':\n case 'padding':\n $str .= $this->renderSide($style);\n break;\n default:\n $str .= strtolower(preg_replace('/(?<=\\\\w)(?=[A-Z])/',\"-$1\", $style['Name']));\n $str .= \":\";\n $str .= $style['Value'];\n $str .= \";\";\n break;\n } \n \n }\n return $str;\n }",
"public function apply($text)\n {\n $setCodes = [];\n $unsetCodes = [];\n\n if ($this->foreground !== null) {\n $setCodes[] = $this->char.$this->foreground['set'];\n $unsetCodes[] = $this->foreground['unset'];\n }\n\n if ($this->background !== null) {\n $setCodes[] = ($this->background === null ? $this->char : '').$this->background['set'];\n $unsetCodes[] = $this->background['unset'];\n }\n\n if (count($this->options)) {\n foreach ($this->options as $option) {\n $setCodes[] = $option['set'];\n $unsetCodes[] = $option['unset'];\n }\n\n return sprintf(\"%s%s\\x0F\", implode('', $setCodes), $text);\n }\n\n if (count($setCodes) === 0) {\n return $text;\n }\n\n return sprintf(\"%s%s\\x03\", implode(',', $setCodes), $text);\n }",
"public static function renderStyle( array $styleOptions = array() );",
"protected function setStyles()\n {\n $this->getOutput()->getFormatter()->setStyle(\n 'h1',\n new OutputFormatterStyle('red', 'white', ['bold'])\n );\n $this->getOutput()->getFormatter()->setStyle(\n 'h2',\n new OutputFormatterStyle('red', 'default', ['bold'])\n );\n\n // low\n $this->getOutput()->getFormatter()->setStyle(\n 'h100',\n new OutputFormatterStyle('green', 'default', ['bold'])\n );\n $this->getOutput()->getFormatter()->setStyle(\n 'h101',\n new OutputFormatterStyle('green', 'default')\n );\n //mid\n $this->getOutput()->getFormatter()->setStyle(\n 'h200',\n new OutputFormatterStyle('yellow', 'default', ['bold'])\n );\n $this->getOutput()->getFormatter()->setStyle(\n 'h201',\n new OutputFormatterStyle('yellow', 'default')\n );\n // high\n $this->getOutput()->getFormatter()->setStyle(\n 'h300',\n new OutputFormatterStyle('white', 'red', ['bold'])\n );\n $this->getOutput()->getFormatter()->setStyle(\n 'h301',\n new OutputFormatterStyle('red', 'default', ['bold'])\n );\n }",
"protected function setupStyles()\n {\n $style = new OutputFormatterStyle('yellow', 'black', ['bold']);\n $this->output->getFormatter()->setStyle('important', $style);\n\n $style = new OutputFormatterStyle('cyan', 'black', ['bold']);\n $this->output->getFormatter()->setStyle('code', $style);\n }",
"function SimpleText($text, $style=\"\") {\n\t\tif (false) {\n\t\t\t/*\n\t\t\t * FIXME: this is fundamentally broken, because\n\t\t\t * it creates a new CCE connection for every\n\t\t\t * SimpleText object created\n\t\t\t */\n\t\t\tinclude(\"uifc/Stylist.php\");\n\t\t\tinclude(\"ServerScriptHelper.php\");\n\t\t\t$crackaddict = new ServerScriptHelper();\n\t\t\t$stylist = $crackaddict->getStylist();\n\t\t\t$this->style = $stylist->getStyle(\"SimpleText\"); // try this\n\t\t\t\n\t\t\tif($this->style->getPropertyNumber()) { \n\t\t\t\t$this->style = $stylist->getStyle(\"Page\"); // default\n\t\t\t}\n\t\t\t\t\n\t\t} else {\n\t\t\t$this->style = $style;\n\t\t}\t\t\n\t\t$this->text = $text;\n\t}",
"function style ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('tstyle');\n return $rc->newInstanceArgs( $arguments ); \n}",
"function fontStyles()\r\n {\r\n /*\r\n if ($this->_control!=null)\r\n {\r\n if ($this->_control->ParentFont)\r\n {\r\n $parent=$this->_control->Parent;\r\n if ($parent!=null) return($parent->Font->readFontString());\r\n }\r\n }\r\n */\r\n\r\n $textalign=\"\";\r\n switch($this->_align)\r\n {\r\n case taLeft: $textalign=\"text-align: left;\"; break;\r\n case taRight: $textalign=\"text-align: right;\"; break;\r\n case taCenter: $textalign=\"text-align: center;\"; break;\r\n case taJustify: $textalign=\"text-align: justify;\"; break;\r\n }\r\n\r\n $fontstyle=\"\";\r\n switch($this->_style)\r\n {\r\n case fsNormal: $fontstyle=\"font-style: normal;\"; break;\r\n case fsItalic: $fontstyle=\"font-style: italic;\"; break;\r\n case fsOblique: $fontstyle=\"font-style: oblique;\"; break;\r\n }\r\n\r\n // changed to fix RAID#282144\r\n $fontvariant=\"\";\r\n switch($this->_variant)\r\n {\r\n case vaNormal: $fontvariant=\"font-variant: normal;\"; break;\r\n case vaSmallCaps: $fontvariant=\"font-variant: small-caps;\"; break;\r\n }\r\n\r\n $texttransform=\"\";\r\n switch($this->_case)\r\n {\r\n case caCapitalize: $texttransform=\"text-transform: capitalize;\"; break;\r\n case caUpperCase: $texttransform=\"text-transform: uppercase;\"; break;\r\n case caLowerCase: $texttransform=\"text-transform: lowercase;\"; break;\r\n case caNone: $texttransform=\"text-transform: none;\"; break;\r\n }\r\n\r\n $color=\"\";\r\n if ($this->_color!=\"\") $color=\"color: $this->_color;\";\r\n\r\n $lineheight=\"\";\r\n if ($this->_lineheight!=\"\") $lineheight=\"line-height: $this->_lineheight;\";\r\n\r\n $fontweight=\"\";\r\n if ($this->_weight!=\"\") $fontweight=\"font-weight: $this->_weight;\";\r\n\r\n return \" $color$fontweight$textalign$fontstyle$lineheight$fontvariant$texttransform \";\r\n }",
"public function colorize($text, $style) {\n return $this->stdout()->colorize($text, $style);\n }",
"function prepareStyle($showLearning, $mode_trans, $textsize, $ann_exists): void\n{\n do_text_text_style($showLearning, $mode_trans, $textsize, $ann_exists);\n}",
"private function appendStyles(array $styles): void\n {\n if (empty($styles)) {\n return;\n }\n\n $string = '';\n $prependSemicolon = false;\n foreach ($styles as $key => $value) {\n if ($prependSemicolon) {\n $string .= '; ';\n }\n $prependSemicolon = true;\n $string .= $key . ': ' . $value;\n }\n\n $this->appendAttribute('style', $string);\n }",
"public function SetStyles($output)\n {\n $this->output = $output;\n if ($output == 'html') {\n define('EOL', '<br>');\n define('RED', '</span><span style=\"color:red\">');\n define('WHT', '</span><span style=\"color:white\">');\n define('GRN', '</span><span style=\"color:lime\">');\n echo START;\n echo \"<h1 style=\\\"display:block\\\">Queue Filler Cron<i style=\\\"float:right\\\">\".date('Y-m-d H:i:s').\"</i></h1>\";\n echo \"<span>\";\n } else {\n define('EOL', \"\\n\");\n define('RED', \"\\033[1;31m\");\n define('WHT', \"\\033[0m\");\n define('GRN', \"\\033[0;32m\");\n echo EOL;\n }\n }",
"function updateFontStyle($p_text_id, $p_font_style) {\n $con = open_connection();\n mysqli_query($con, \"UPDATE text SET font_style = '\". $p_font_style .\"' WHERE text_id = '\". $p_text_id .\"'\");\n mysqli_close($con);\n }",
"public function output($font) {\n \t\tglobal $wp_styles;\n \t\tif ( !empty( $font['font-family'] ) && !empty( $font['font-backup'] ) ) {\n \t\t$font['font-family'] = str_replace( ', '.$font['font-backup'], '', $font['font-family'] );\n \t\t}\n\n \t$style = '';\n \tif (!empty($font)) {\n \t\tforeach( $font as $key=>$value) {\n \t\tif ($key == 'font-options') {\n \t\tcontinue;\n \t\t}\n \t\t\tif (empty($value) && in_array($key, array('font-weight', 'font-style'))) {\n \t\t\t$value = \"normal\";\n \t\t\t}\n \t\t\tif ( $key == \"google\" || $key == \"subsets\" || $key == \"font-backup\" || empty( $value ) ) {\n \t\t\tcontinue;\n \t\t\t}\n \t\t\t$style .= $key.':'.$value.';';\n \t\t}\n \t}\n\n \tif ( !empty( $style ) ) {\n \t\tif ( !empty( $this->field['output'] ) && is_array( $this->field['output'] ) ) {\n \t\t\t$keys = implode(\",\", $this->field['output']);\n \t\t\t$this->parent->outputCSS .= $keys . \"{\" . $style . '}';\n \t\t}\n\n \t\tif ( !empty( $this->field['compiler'] ) && is_array( $this->field['compiler'] ) ) {\n \t\t\t$keys = implode(\",\", $this->field['compiler']);\n \t\t\t$this->parent->compilerCSS .= $keys . \"{\" . $style . '}';\n \t\t}\n \t}\n\t\t\treturn $style;\n\t\t}",
"public function setStyles(array $styles)\n {\n foreach ($styles as $style) {\n if (isset($style['type']) && isset($style['css'])) {\n $this->_styles[$style['type']] = iPhorm::parseCss($style['css']);\n }\n }\n }",
"private function buildText($textRunNode) {\n\t\t// populate the text, do we need this?\t\t\n // $this->text = (string)$node->children(\"a\", TRUE)->t;\n // echo \" --- style \" .\n\n foreach($textRunNode->children(\"a\", TRUE) as $childNode) {\n\t if($childNode->getName() === \"t\") {\n\t // we have text\n\t $this->text = (string)$childNode; \n\t\t\t} else if($childNode->getName() === \"rPr\") {\n\t\t\t\t// we have properties\n\t\t\t $attributes = $childNode->attributes();\n\t\t\t if((string)$attributes->b === '1') {\n\t\t\t $this->isBolded = true;\n\t\t }\n\t\t\t if((string)$attributes->i === '1') {\n\t $this->isItalics = true;\n\t\t }\n\t\t\t if((string)$attributes->u === 'sng') {\n\t\t\t $this->isUnderlined = true;\n\t\t\t $this->underlineType = Text::ONE_LINE;\n\t\t\t }\n\t\t\t if((string)$attributes->u === 'dbl') {\n\t\t\t $this->isUnderlined = true;\n\t\t\t $this->underlineType = Text::TWO_LINES;\n\t\t\t }\n\t\t\t if((string)$attributes->strike === 'sngStrike') {\n\t\t\t\t $this->Strikethrough = true;\n\t\t\t }\n\t\t\t if(isset($attributes->lang)) {\n\t\t\t $this->language = (string)$attributes->lang;\n\t\t\t }\n\t\t\t foreach($childNode->children(\"a\", TRUE) as $node2) {\n\t\t\t if((string)$node2->getName() === \"solidFill\") {\n\t\t\t $this->fillStyle = Text::SOLID;\n\t\t\t\t\t\t \n\t foreach($node2->children(\"a\", TRUE) as $node3) {\n\t $attr = $node3->attributes();\n\t \n\t if($node3->getName() === \"schemeClr\") {\n\t echo \"Scheme colour: \" . $attr->val . \" \";\n\t // TODO: insert logic to handle colours from scheme\n\t // ideally the actual colour should be added from\n\t // the theme, but that means processing the \n\t // \n\t\t\t\t\t\t\t} else if($node3->getName() === \"srgbClr\") {\n\t\t\t $this->colour = (string)$attr->val;\n\t\t\t\t\t\t\t}\n\t }\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }\n\t}",
"function addStyleTags($text) {\n\t// variables used to execute this task\n\t$tag_content_start = 0;\n\t$tag_end = 0;\n\t$strs_final = array(\"color_coded\" => \"\", \"style\" => \"\");\n\t$str_temp = \"\";\n\t$re_key_word = \"/(@[\\w\\t ]+)\\(/i\";\n\t$re_selector = \"/([\\w\\*\\.\\#\\t: ]+)(\\s?[\\{,])/i\";\n\t$re_property = \"/([\\{;\\(]\\s*)([\\w-]+)(\\s*:)/i\";\n\t$re_value = \"/:([^:;]*)([;)])/i\";\n\t$re_value_units = \"/(\\d)(px|%|rem|em|vh|vw|s|ms)/i\";\n\n\t// loop while there are style tags to process\n\twhile (preg_match(\"/\\<style[^\\<]*\\>/i\", $text, $regex_matches, PREG_OFFSET_CAPTURE) !== false && !empty($regex_matches)) {\n\t\t// get the index of the character after this opening tag\n\t\t$tag_content_start = $regex_matches[0][1] + strlen($regex_matches[0][0]);\n\n\t\t// add the text between the last processed tag and the start of this style tag\n\t\t$strs_final[\"color_coded\"] .= substr($text, 0, $regex_matches[0][1]);\n\n\t\t// find the index of the next closing style tag\n\t\t$tag_end = strpos($text, \"</style>\", $tag_content_start);\n\n\t\t// check if a closing style tag was found\n\t\tif ($tag_end === false) {\n\t\t\t// it wasn't\n\t\t\t// assume the tag goes to the end of the text\n\t\t\t$tag_end = strlen($text);\n\t\t}\n\n\t\t// get the text inside this style tag\n\t\t$str_temp = substr($text, $tag_content_start, $tag_end - $tag_content_start);\n\n\t\t// store this tag's content without any color coding tags\n\t\t$strs_final[\"style\"] .= $str_temp;\n\n\t\t// add the keyword spans\n\t\t$str_temp = preg_replace($re_key_word, \"<span class='css_keyword'>$1</span>(\", $str_temp);\n\n\t\t// add the selector spans\n\t\t$str_temp = preg_replace($re_selector, \"<span class='css_selector'>$1</span>$2\", $str_temp);\n\n\t\t// remove any selector span tags that might have been placed inside the property:value area\n\t\t$str_temp = preg_replace_callback(\"/\\{([^{}]+)<span class='css_selector'>([^{}]+)<\\/span>([^{}]+)\\}/i\", function($regex_matches) {\n\t\t\treturn(preg_replace(\"/<span class='css_selector'\\s*>([^\\/]+)<\\/span>/i\", \"$1\", $regex_matches[0]));\n\t\t}, $str_temp);\n\n\t\t// add the property spans\n\t\t$str_temp = preg_replace($re_property, \"$1<span class='css_property'>$2</span>$3\", $str_temp);\n\n\t\t// add the value spans\n\t\t$str_temp = preg_replace($re_value, \":<span class='css_value'>$1</span>$2\", $str_temp);\n\n\t\t// add the units spans\n\t\t$str_temp = preg_replace($re_value_units, \"$1<span class='css_units'>$2</span>\", $str_temp);\n\n\t\t// store this tag's content with the color coding tags\n\t\t$strs_final[\"color_coded\"] .= $str_temp;\n\n\t\t// remove this tag's content from the text to process\n\t\t$text = substr($text, $tag_end + 8);\n\t}\n\n\t// add any text after the last processed style tag to the final string\n\t$strs_final[\"color_coded\"] .= $text;\n\n\t// return the processed strings\n\treturn($strs_final);\n}",
"public function getDefaultTextStyle() {\n return $this->stdout()->getDefaultTextStyle();\n }",
"public function setStyle($style) {}",
"public function appendStyles()\n {\n return '';\n }",
"public function apply(string $colorName, $text) : string;",
"public function setDefaultErrorTextStyle($style) {\n $this->stderr()->setDefaultTextStyle($style);\n return $this; \n }",
"public function fontSet()\n {\n $family = strtolower($this->value['font-family']);\n\n $b = ($this->value['font-bold'] ? 'B' : '');\n $i = ($this->value['font-italic'] ? 'I' : '');\n $u = ($this->value['font-underline'] ? 'U' : '');\n $d = ($this->value['font-linethrough'] ? 'D' : '');\n $o = ($this->value['font-overline'] ? 'O' : '');\n\n // font style\n $style = $b.$i;\n\n if ($this->_defaultFont) {\n if($family=='arial')\n $family='helvetica';\n elseif($family=='symbol' || $family=='zapfdingbats')\n $style='';\n\n $fontkey = $family.$style;\n if (!$this->_pdf->isLoadedFont($fontkey))\n $family = $this->_defaultFont;\n }\n\n if($family=='arial')\n $family='helvetica';\n elseif($family=='symbol' || $family=='zapfdingbats')\n $style='';\n\n // complete style\n $style.= $u.$d.$o;\n\n // size : mm => pt\n $size = $this->value['font-size'];\n $size = 72 * $size / 25.4;\n\n // apply the font\n $this->_pdf->SetFont($family, $style, $this->value['mini-size']*$size);\n $this->_pdf->setTextColorArray($this->value['color']);\n if ($this->value['background']['color'])\n $this->_pdf->setFillColorArray($this->value['background']['color']);\n else\n $this->_pdf->setFillColor(255);\n }",
"public function setStyle(String $style)\n {\n if (in_array($style, ['primary', 'danger'])) {\n $this->style = $style;\n } elseif ($style == 'default') {\n $this->style = null;\n }\n return $this;\n }",
"public function style($string) {\n return \"<strong>\" . $string . \"</strong>\";\n }",
"public static function text($text = null, $style = null, $color = null)\n {\n return static::createWithSource(new TextSource($text, $style, $color));\n }",
"function remove_word_styles() {\r\n\t\t$this->code = preg_replace('/<style[^<>]*?>(.*?)<\\/style>/is', '<style type=\"text/css\"></style>', $this->code);\r\n\t}"
]
| [
"0.61601704",
"0.61560905",
"0.6113723",
"0.6086507",
"0.5918613",
"0.58628136",
"0.5840936",
"0.5811188",
"0.5749304",
"0.57180846",
"0.56483656",
"0.55993533",
"0.55909353",
"0.55675346",
"0.5551399",
"0.55283445",
"0.5432544",
"0.53658706",
"0.5360427",
"0.5344593",
"0.53205526",
"0.5316315",
"0.5305653",
"0.5285939",
"0.52490914",
"0.5249077",
"0.5222219",
"0.52091753",
"0.5193697",
"0.5186875"
]
| 0.7178893 | 0 |
Delete characters and/or lines at the current cursor position. Characteres: will be shifting in space characters, from the right edge of the screen. Lines: deletes lines from the buffer, starting with the row the cursor is on. | public function delete (? int $characters = null, ? int $lines = null) : Output
{
$Output = &$this->Output;
if ($characters > 0) {
$Output->escape($characters . self::_TEXT_DELETE_CHARACTER);
}
if ($lines > 0) {
$Output->escape($lines . self::_TEXT_DELETE_LINE);
}
return $Output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clearLine();",
"public function erase (int $characters = 1) : Output\n {\n return $this->Output->escape($characters . self::_TEXT_ERASE_CHARACTER);\n }",
"public function _deleted($lines)\n\t{\n\t\tforeach ($lines as $line)\n\t\t{\n\t\t\t$this->i++;\n\t\t\techo \"\\t\\t\".'<tr>'.\"\\n\";\n\t\t\techo \"\\t\\t\\t\".'<th>'.$this->i.'</th>'.\"\\n\";\n\t\t\techo $this->deletedLine(htmlspecialchars ($line), 3) . $this->emptyLine();\n\t\t\techo \"\\t\\t\".'</tr>'.\"\\n\";\n\t\t}\n\t}",
"private function clear()\n {\n if (!$this->lines) {\n return;\n }\n\n echo sprintf(\"\\033[%sA\", $this->lines);\n\n $this->lines = 0;\n }",
"function endLineCharDelete()\n {\n $newArray = [];\n $array = $this->prepMethods;\n for ($i = 0; $i < count($array); $i++) {\n $new_element = str_replace($this->endLinePHP, $this->endLineSwift, $array[$i]);\n array_push($newArray, $new_element);\n }\n $this->prepMethods = $newArray;\n }",
"public function eraseLines(int $count): void\n {\n $clear = '';\n for ($i = 0; $i < $count; $i++) {\n $clear .= \"\\e[2K\".($i < $count - 1 ? \"\\e[{$count}A\" : '');\n }\n\n if ($count) {\n $clear .= \"\\e[G\";\n }\n\n static::writeDirectly($clear);\n }",
"public function removeLines($start, $numLines=1) {\r\n $arr = $this->toArray();\r\n array_splice($arr, $start, $numLines);\r\n $this->contents = implode(\"\\n\", $arr);\r\n }",
"private function _deleteLine(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n $line = $tokens[$stackPtr]['line'];\n\n $phpcsFile->fixer->beginChangeset();\n\n for ($i = $stackPtr; $tokens[$i]['line'] === $line; $i--) {\n $phpcsFile->fixer->replaceToken($i, '');\n }\n\n for ($i = $stackPtr; $tokens[$i]['line'] === $line; $i++) {\n $phpcsFile->fixer->replaceToken($i, '');\n }\n\n $phpcsFile->fixer->endChangeset();\n\n }",
"function EliminarEspaciosInncesarios($str, $bControlTabReturn=false)\n{\n if( $bControlTabReturn ){\n $str = preg_replace('/[\\n\\r\\t]+/', '', $str);\n }\n return preg_replace('/\\s{2,}/', ' ', $str);\n}",
"function user_removeChr($content,$conf) {\r\n\t//$content = str_replace('\\r', '2', $content);\r\n\t$content = str_replace(chr(13), '/', $content);\r\n\t$content = str_replace(chr(10), '', $content);\r\n\treturn $content;\r\n}",
"public function trim (bool $left = false, bool $right = false) : Output\n {\n $Output = &$this->Output;\n\n if ($right && $left) {\n $Output->escape(self::_TEXT_ERASE_IN_LINE_2);\n } else if ($right) {\n $Output->escape(self::_TEXT_ERASE_IN_LINE_0);\n } else if ($left) {\n $Output->escape(self::_TEXT_ERASE_IN_LINE_1);\n }\n\n return $Output;\n }",
"public function clearSelection();",
"public function clear_buffer() {\n\t\tself::$core_display->buffer = '';\n\t}",
"public function unsetCursor(): void\n {\n $this->cursor = [];\n }",
"public function unsetCursor(): void\n {\n $this->cursor = [];\n }",
"protected function deleteNewLines()\r\n {\r\n if (isset($this->data['event'])) {\r\n $this->data['event'] = str_replace(\"\\r\", '', $this->data['event']);\r\n $this->data['event'] = str_replace(\"\\n\", '', $this->data['event']);\r\n }\r\n }",
"private function delete_existing_lines(){\n\n\t\tLine::where('event_id', '=', $this->event->id)->delete();\n\n\t}",
"private function RemoveWhiteSpace() {\n\t\twhile (in_array($this->ReadChar(), $this->whiteSpace));\n\t\t$this->ReturnCharToFile(1);\n\t}",
"public function delete() {\n\t\t$canvas = $this->original->getCanvas();\n\t\timagefilledrectangle($this->original->getImage(), $this->x, $this->y, $this->x+$this->getWidth()-1, $this->y+$this->getHeight()-1, imagecolorallocate($this->original->getImage(), $canvas['r'], $canvas['g'], $canvas['b']));\n\t}",
"function space_delete($str, $charL = null) {\r\n if ($charL == null) {\r\n $charL = array(\" \", \"\\t\", \"\\n\", \"\\0\", \"\\x0B\");\r\n }\r\n $rta = str_replace($charL, \"\", $str);\r\n\r\n return $rta;\r\n}",
"private function _deleteExtraLines()\n {\n foreach ($this->_currentLines as $lineId => $lineModel) {\n if (in_array($lineId, $this->_newLineIds) === true) {\n continue;\n }\n\n $lineModel->delete();\n unset($this->_currentLines[$lineId]);\n }\n\n return $this;\n }",
"public function setDeleteNewLines()\r\n {\r\n $this->deleteNewLinesFlag = true;\r\n $this->deleteNewLines();\r\n }",
"private function blank(): void\n {\n $width = $this->getRenderWidth();\n $height = $this->getRenderHeight();\n\n for ($h = 0; $h <= $this->height && $h < $height; ++$h) {\n $this->cli->jump($this->pos['x'], $this->pos['y'] + $h);\n $this->cli->write(str_repeat(' ', $width));\n }\n }",
"function DrawCharacters() {\n// $log = new LOG();\n// $log->err(strlen($this->sCode));\n for ($i = 0; $i < $this->iNumChars; $i++) {\n // select random font\n $sCurrentFont = $this->aFonts[array_rand($this->aFonts)];\n\n // select random colour\n if ($this->bUseColour) {\n $iTextColour = imagecolorallocate($this->oImage, rand(0, 100), rand(0, 100), rand(0, 100));\n } else {\n $iRandColour = rand(0, 100);\n $iTextColour = imagecolorallocate($this->oImage, $iRandColour, $iRandColour, $iRandColour);\n }\n\n // select random font size\n $iFontSize = rand($this->iMinFontSize, $this->iMaxFontSize);\n\n // select random angle\n $iAngle = rand(-30, 30);\n if ($this->chinese) {\n $code = $this->sCode[$i * 3] . $this->sCode[$i * 3 + 1] . $this->sCode[$i * 3 + 2];\n } else\n $code = $this->sCode[$i];\n\n\n // get dimensions of character in selected font and text size\n $aCharDetails = imageftbbox($iFontSize, $iAngle, $sCurrentFont, $code, array());\n\n // calculate character starting cochrinates\n $iX = $this->iSpacing / 8 + $i * $this->iSpacing;\n $iCharHeight = $aCharDetails[2] - $aCharDetails[5];\n $iY = $this->iHeight / 2 + $iCharHeight / 4;\n\n // write text to image\n imagefttext($this->oImage, $iFontSize, $iAngle, $iX, $iY, $iTextColour, $sCurrentFont, $code, array());\n }\n }",
"protected function delete_space($start, $size = 2)\n {\n $sql = \"UPDATE $this->_table_name\n SET\n $this->left_column = ($this->left_column - $size)\n WHERE\n $this->left_column >= $start\n AND $this->scope_column = $this->scope\n \";\n $this->_db->exec($sql);\n\n $sql = \"UPDATE $this->_table_name\n SET\n $this->right_column = ($this->right_column - $size)\n WHERE\n $this->right_column >= $start\n AND $this->scope_column = $this->scope\n \";\n $this->_db->exec($sql);\n }",
"public function eraseDown(): void\n {\n static::writeDirectly(\"\\e[J\");\n }",
"function deleteCharacter($id) {\n try {\n $this->perform_query_one_param(\"DELETE FROM characters WHERE characters.id = ?\", \"i\", strval($id));\n $this->perform_query_one_param(\"DELETE FROM activity WHERE activity.idCharacter = ?\", \"i\", strval($id)); \n } catch(Exception $ex) {\n $this->print_error_message(\"Unable to delete Character\");\n }\n }",
"public function clean() {\n $this->data = \"\";\n $this->currentRow = 1;\n $this->curPosition = 0;\n }",
"public function executePositionedStringInsertionTrimsCorrectCharactersDataProvider() {}",
"public function clear (bool $up = false, bool $down = false) : Output\n {\n $Output = &$this->Output;\n\n match (true) {\n ($up && !$down) => $Output->escape(self::_TEXT_ERASE_IN_DISPLAY_1),\n (!$up && $down) => $Output->escape(self::_TEXT_ERASE_IN_DISPLAY_0),\n default => $Output->escape(self::_TEXT_ERASE_IN_DISPLAY_2)\n };\n\n return $Output;\n }"
]
| [
"0.58472025",
"0.57808334",
"0.5737781",
"0.5698064",
"0.55308497",
"0.5294813",
"0.5210183",
"0.5112843",
"0.50494677",
"0.49556282",
"0.49427956",
"0.4926008",
"0.4879296",
"0.48187613",
"0.48187613",
"0.47989497",
"0.47949356",
"0.4790141",
"0.4771508",
"0.4743017",
"0.468301",
"0.46623915",
"0.4646037",
"0.46226424",
"0.4548823",
"0.45411676",
"0.45387158",
"0.45371038",
"0.4516446",
"0.44939774"
]
| 0.6602976 | 0 |
Inserts lines and/or spaces at the cursor position. Lines: the line the cursor is on, and lines below it, will be shifted downwards. Spaces: insert spaces at the current cursor position, shifting all existing text to the right. | public function insert (? int $lines = null, ? int $spaces = null) : Output
{
$Output = &$this->Output;
if ($lines > 0) {
$Output->escape($lines . self::_TEXT_INSERT_LINE);
}
if ($spaces > 0) {
$Output->escape($spaces . self::_TEXT_INSERT_CHARACTER);
}
return $Output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function moveToNextLineAndShowText($text, $wordSpacing = null, $charSpacing = null) {}",
"public function moveToNextLineAndShowText($text, $wordSpacing = null, $charSpacing = null) {}",
"private function positionAfterWhitespace()\n {\n }",
"public function updateEditotPosition()\n {\n $this->format->shiftCurrentXposition($this->shape->getWidth() + ($this->shape->getBorderWidth() / 2));\n }",
"public function justifyText() {\n $positions = array();\n for ($i = 0; $i < count($this->textToPrint); $i++) { // do this for each line of text\n\n $lineByLine = str_word_count($this->textToPrint[$i],1,self::CHARLIST);\n\n for ($j = 0; $j < count($lineByLine)-1; $j++) { // pad all words but last with trailing whitespace\n $lineByLine[$j] = $lineByLine[$j]. \" \";\n }\n $whiteSpaces = count($lineByLine) - 1; \n \n // this wasn't getting calculated correctly if there were multiple spaces, such as after a period in a sentence\n $localLength = 0;\n foreach ($lineByLine as $key => $value) {\n $localLength += strlen($value);\n }\n $spacesNeeded = $this->width - $localLength;\n \n if ($whiteSpaces > 0) { // dont' do this for a line containing only one word.\n \n $middle = (int) (($whiteSpaces+1)/2); // need to find middle of array\n $whereToInsert = $middle;\n $lkey = 1;\n $rkey = 1;\n $linc = 2;\n $rinc = 2;\n $rinit = $rkey;\n $linit = $lkey;\n\n if ($whiteSpaces % 2 == 0) { // if there are an even number of whitespaces, then we don't have a true middle, start at the right\n $side = \"right\";\n } else {\n $side = \"middle\";\n }\n\n while ($spacesNeeded > 0) {\n \n // insert to middle, then increment keys\n if ($side == \"middle\") {\n array_splice( $lineByLine, $whereToInsert, 0, \" \" );\n $lkey++;\n $rkey++;\n }\n \n if($side == \"right\") {\n $whereToInsert = $middle+$rkey;\n if ($whereToInsert >= count($lineByLine)) { // reached the end of array -- need to reset right side\n $rkey = $rinit;\n $whereToInsert = $middle+$rkey;\n }\n array_splice( $lineByLine, $whereToInsert, 0, \" \" );\n $rkey+=$rinc;\n } else if ($side == \"left\") {\n $whereToInsert = $middle-$lkey;\n if ($whereToInsert <= 0) { //reached the end of array -- need to reset left side\n $lkey = $linit;\n $whereToInsert = $middle-$lkey;\n }\n array_splice( $lineByLine, $whereToInsert, 0, \" \" );\n $lkey+=$linc;\n }\n \n $middle = (int) (count($lineByLine)/2);\n $side = ($side == \"right\" ? \"left\" : \"right\");\n $spacesNeeded--;\n }\n $this->textToPrint[$i] = implode(\"\", $lineByLine);\n }\n }\n }",
"public function newLine() {\n\t\t$this->_section=0;\n\t\t$this->_lineNumber++;\n\t\t$this->_text[$this->_lineNumber]=array();\n\t\t$this->_text[$this->_lineNumber][0]['text']='';\n\t\t$this->_text[$this->_lineNumber][0]['encoding']='';\n\t\t$this->_text[$this->_lineNumber][0]['font']=$this->_font;\n\t\t$this->_text[$this->_lineNumber][0]['fontSize']=$this->_fontSize;\n\t\t$this->_text[$this->_lineNumber][0]['width']=0;\n\n\t\t\n\t\t$this->_initializeLine();\n\t\t\n\t\t$this->_text[$this->_lineNumber]['alignment']=$this->_text[$this->_lineNumber-1]['alignment'];\n\t\t//add the last cell's height to the auto height if we have an auto-height box.\n\t\tif ($this->isAutoHeight()) {\n\t\t\t$this->_autoHeight+=$this->_text[$this->_lineNumber-1]['height'];\n\t\t}\n\t}",
"public function indentLines($startLine, $endLine);",
"public function moveToStartOfNextLine() {}",
"public function moveToStartOfNextLine() {}",
"public function moveToNextLine($x, $y, $setLeading = false) {}",
"public function moveToNextLine($x, $y, $setLeading = false) {}",
"function insertNewline($str, $times)\n{\n for ($k = 0; $k < $times; $k++) {\n $str .= PHP_EOL;\n }\n return $str;\n}",
"public function appendOneLine($text) {\n if (strpos($text, \" \") === 0 && ($this->hOffset == 0 || in_array($this->current[\"char\"], array(\"&\", \"$\")))) {\n $text = substr($text, 1);\n }\n\n $this->currentPage->beginText();\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n\n // If a the text content can't be appended (either there is no whitespaces,\n // either the is not enough space in the line)\n if ($nbCarac === 0) {\n $isEnoughSpaceOnNextLine = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n if ($isEnoughSpaceOnNextLine) {\n $this->currentPage->endText();\n return $text;\n } else {\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), false);\n }\n }\n\n $isLastLine = ($nbCarac == strlen($text));\n\n $textToAppend = substr($text, 0, $nbCarac);\n $text = substr($text, $nbCarac);\n\n // Append text (in a new page if needed)\n if ($this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset) < self::VMARGIN) {\n $this->currentPage->endText();\n $this->current[\"pages\"][] = $this->currentPage;\n $this->nextPage();\n $this->currentPage->beginText();\n }\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n if ($textToAppend)\n $this->current[\"char\"] = $textToAppend{strlen($textToAppend)-1};\n\n $this->hOffset += $this->currentPage->getTextWidth($textToAppend);\n\n $this->currentPage->endText();\n $this->current[\"charOffset\"] = $this->vOffset;\n\n return ($isLastLine ? null : $text);\n }",
"public function appendText($text) {\n// if ($this->vOffset > $this->current[\"charOffset\"] + 3*LINE_SPACING + 3*$this->currentFontSize)\n// $this->vOffset = $this->current[\"charOffset\"] + 3*LINE_SPACING + 3*$this->currentFontSize;\n if ($this->appendToBuffer) {\n array_push($this->buffer, array(\n \"text\" => $text,\n \"font\" => $this->currentFont,\n \"size\" => $this->currentFontSize,\n \"color\" => $this->currentFontColor\n ));\n return;\n }\n\n $this->currentPage->beginText();\n do {\n // Clear the whitespace if it begins the line or if last char is a special char\n if (strpos($text, \" \") === 0 && ($this->hOffset == 0 || in_array($this->current[\"char\"], array(\"&\", \"$\")))) {\n $text = substr($text, 1);\n }\n\n // Number of chars allowed in the current line\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n\n // If a the text content can't be appended (either there is no whitespaces,\n // either the is not enough space in the line)\n if ($nbCarac === 0) {\n $isEnoughSpaceOnNextLine = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), true);\n if ($isEnoughSpaceOnNextLine) {\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n $isLastLine = false;\n continue;\n } else {\n $nbCarac = $this->currentFont->measureText($text,\n ($this->PAGE_WIDTH - 2*self::HMARGIN - $this->hOffset - $this->permanentLeftSpacing - $this->permanentRightSpacing),\n $this->currentFontSize, $this->currentPage->getCharSpace(),\n $this->currentPage->getWordSpace(), false);\n }\n }\n $isLastLine = ($nbCarac == strlen($text));\n\n $textToAppend = substr($text, 0, $nbCarac);\n $text = substr($text, $nbCarac);\n\n // Append text (in a new page if needed) with align\n if ($this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset) < self::VMARGIN) {\n $this->currentPage->endText();\n $this->current[\"pages\"][] = $this->currentPage;\n $this->nextPage();\n $this->currentPage->beginText();\n }\n if ($this->current[\"align\"] == \"center\") {\n $spacing = $this->PAGE_WIDTH - 2*self::HMARGIN -\n $this->permanentLeftSpacing - $this->permanentRightSpacing - $this->currentPage->getTextWidth($textToAppend);\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing + $spacing/2,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n } elseif ($this->current[\"align\"] == \"right\") {\n $spacing = $this->PAGE_WIDTH - 2*self::HMARGIN -\n $this->permanentLeftSpacing - $this->permanentRightSpacing - $this->currentPage->getTextWidth($textToAppend);\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing + $spacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n } else { // left\n $this->currentPage->textOut(self::HMARGIN + $this->hOffset + $this->permanentLeftSpacing,\n $this->PAGE_HEIGHT - (self::VMARGIN + $this->vOffset), $textToAppend);\n }\n if ($textToAppend)\n $this->current[\"char\"] = $textToAppend{strlen($textToAppend)-1};\n\n // Offsets for next line\n if (!$isLastLine) {\n $this->vOffset += $this->currentFontSize + self::LINE_SPACING;\n $this->hOffset = 0;\n } else {\n $this->hOffset += $this->currentPage->getTextWidth($textToAppend);\n }\n\n }\n while(!$isLastLine); // While it remains chars to append\n $this->currentPage->endText();\n $this->current[\"charOffset\"] = $this->vOffset;\n }",
"function moveLeft()\n {\n $this->position--;\n if ($this->position < 0) {\n $this->position++;\n array_unshift($this->line, '_');\n }\n }",
"public function println($text) {\n $this->check_bounds();\n ncurses_mvaddstr($this->offset++, 0, $text);\n }",
"function insert()\n\t{\n\t\t$this->edit(true);\n\t}",
"function insert_with_markers($filename, $marker, $insertion)\n {\n }",
"protected function new_line()\n {\n }",
"function InsertDocBlock($file, $doc, $type, $code=\"\", $line=0) {\n\t\t// Read file...\n\t\t$source = @file_get_contents($file);\n\t\tif (!$source) die(\"ERR3\"); // error 3 => can't read file\n\t\t\n\t\t// Split the code in an array\n\t\t$lines = preg_split(\"/((\\r?\\n)|(\\n?\\r))/\", $source);\n\t\t\n\t\t// Figure out line number\n\t\t// Make sure the retained line contains the same code as previously, otherwise we may have a problem\n\t\tif ($type != BLOCK_PAGE) {\n\t\t\t$linenumber = intval($line);\t\t\n\t\t\tif (trim($lines[$linenumber-1]) != trim($code) ) die(\"ERR1\");\t\t\t\n\t\t\t// Figure out indent\n\t\t\tif ( preg_match('@^([\\t\\040]*).*$@', $lines[$linenumber-1], $matches) ) {\n\t\t\t\t$doc->indent = $matches[1];\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t// For the page block, we have to find the first open tag and insert after\n\t\t\t$tokens = token_get_all($source);\n\t\t\t$found = false;\n\t\t\tforeach($tokens as $token) {\n\t\t\t\tif ($token[0] == T_OPEN_TAG) {\n\t\t\t\t\t$found = true;\n\t\t\t\t\t$linenumber = intval($token[2])+1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$found) die(\"ERR4\");\n\t\t}\n\t\t\n\t\t// Which line breaks does the source use?\n\t\t$lbtype = \"\\n\";\n\t\tif (substr_count($source,\"\\r\\n\") > 0) $lbtype = \"\\r\\n\";\n\n\t\t// Insert docblock\n\t\tarray_splice($lines, $linenumber-1, 0, $lbtype.@implode($lbtype,$doc->Output( isUtf8($source) )) );\n\t\t\t\t\n\t\t// final source\n\t\t$source = implode($lbtype, $lines);\n\t\t//rename($file,$file.\".bak\");\n\t\tfile_put_contents($file, $source);\n\t}",
"private function add_new_line() {\n\n\t\t$this->fields[] = array( 'newline' => true );\n\n\t}",
"function spaces() {\n return str_pad('', $this->currentIndention, ' ', STR_PAD_LEFT);\n }",
"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 }",
"private function blank(): void\n {\n $width = $this->getRenderWidth();\n $height = $this->getRenderHeight();\n\n for ($h = 0; $h <= $this->height && $h < $height; ++$h) {\n $this->cli->jump($this->pos['x'], $this->pos['y'] + $h);\n $this->cli->write(str_repeat(' ', $width));\n }\n }",
"public function printTrailSpace()\n {\n fwrite($this->handle, self::TRAIL_SPACE);\n }",
"public function addInsertBlocks() {\n foreach ($this->_explodedBody as $key => $paragraph) {\n if (isset($this->_inserts[$key])) {\n $this->_body = str_replace($paragraph . '</p>', $paragraph . $this->_explodeTag . $this->_inserts[$key], $this->_body);\n }\n else {\n $this->_body = str_replace($paragraph . '</p>', $paragraph . $this->_explodeTag, $this->_body);\n }\n }\n\n $this->_insertedBody = $this->_body;\n\n }",
"public function presetEditorPosition()\n {\n $editor = $this->format;\n\n $editor->shiftCurrentXposition($this->shape->getBorderWidth() / 2);\n\n // if there is no space left on the right of the convas to shift to,\n // we update the y axis to shift down to the next line\n if ($editor->getWidth() - $editor->getCurrentXposition() < $this->shape->getWidth(true)\n && $editor->getHeight() - $editor->getCurrentYposition() >= $this->shape->getHeight(true)) {\n\n $editor->shiftCurrentYposition($editor->biggestYpostion());\n $editor->resetCurrentXposition($this->shape->getBorderWidth() / 2);\n\n }\n }",
"public function nextLine($spacing = 1.0);",
"public function newLinesWritten();",
"public function indent(): void\n {\n $this->indent++;\n }"
]
| [
"0.59233415",
"0.59233415",
"0.5596534",
"0.5422676",
"0.5383099",
"0.5324168",
"0.52883613",
"0.5238468",
"0.5238468",
"0.5125833",
"0.5125833",
"0.51254",
"0.5014711",
"0.4990595",
"0.49498305",
"0.49454698",
"0.4927734",
"0.49049994",
"0.49031174",
"0.47949058",
"0.47896513",
"0.47562492",
"0.4734161",
"0.46829292",
"0.46726915",
"0.4660101",
"0.4655913",
"0.46517706",
"0.46506655",
"0.46501666"
]
| 0.61315787 | 0 |
Trims the current line of the screen, removing all characters to the right and/or left of the cursor position. | public function trim (bool $left = false, bool $right = false) : Output
{
$Output = &$this->Output;
if ($right && $left) {
$Output->escape(self::_TEXT_ERASE_IN_LINE_2);
} else if ($right) {
$Output->escape(self::_TEXT_ERASE_IN_LINE_0);
} else if ($left) {
$Output->escape(self::_TEXT_ERASE_IN_LINE_1);
}
return $Output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clearLine();",
"private function clear()\n {\n if (!$this->lines) {\n return;\n }\n\n echo sprintf(\"\\033[%sA\", $this->lines);\n\n $this->lines = 0;\n }",
"function squish(){\n\t\t$out = $this->trim();\n\t\treturn $out->gsub('/\\s+/',' ');\n\t}",
"function clearTrim($trim)\n\t{\n\t\t$trim1 = trim($trim,'m');\n\t\techo \"Chuỗi { $trim } sau khi xóa bỏ m : \".$trim1.\"<br>\";\n\t\t$trim2 = strrev($trim);\n\t\t$trim2 = ltrim($trim2,'m');\n\t\techo \"Chuỗi sau khi đảo ngược và dùng ltrim xóa m : $trim2\";\n\t}",
"private function RemoveWhiteSpace() {\n\t\twhile (in_array($this->ReadChar(), $this->whiteSpace));\n\t\t$this->ReturnCharToFile(1);\n\t}",
"public function unsetCursor(): void\n {\n $this->cursor = [];\n }",
"public function unsetCursor(): void\n {\n $this->cursor = [];\n }",
"public function clear(int $line = -1): void\n {\n $this->clearLine($line);\n }",
"public function clearBeginningOfLine(): void\n {\n if (!$this->canClearBeginningOfLine()) {\n throw new \\RuntimeException('Clear beginning of line is unavailable.');\n }\n\n $this->output->write($this->configuration->get('clr_bol'));\n }",
"public function trimWhitespace() {\r\n $arr = $this->toArray();\r\n $newContents = \"\";\r\n foreach($arr as $line) {\r\n $newLine = preg_replace('/\\s\\s+/', ' ', trim($line)).\"\\n\";\r\n if ($newLine != \"\\n\") $newContents .= $newLine;\r\n }\r\n $this->contents = $newContents;\r\n }",
"public function trimSpaces() {\r\n $this->contents = preg_replace('/ {2,}/', ' ', trim($this->contents));\r\n }",
"private function _deleteLine(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n $tokens = $phpcsFile->getTokens();\n $line = $tokens[$stackPtr]['line'];\n\n $phpcsFile->fixer->beginChangeset();\n\n for ($i = $stackPtr; $tokens[$i]['line'] === $line; $i--) {\n $phpcsFile->fixer->replaceToken($i, '');\n }\n\n for ($i = $stackPtr; $tokens[$i]['line'] === $line; $i++) {\n $phpcsFile->fixer->replaceToken($i, '');\n }\n\n $phpcsFile->fixer->endChangeset();\n\n }",
"public function clearSelection();",
"public function clear_buffer() {\n\t\tself::$core_display->buffer = '';\n\t}",
"public function eraseln() {\n $this->stdout->eraseln();\n return $this;\n }",
"public function clear (bool $up = false, bool $down = false) : Output\n {\n $Output = &$this->Output;\n\n match (true) {\n ($up && !$down) => $Output->escape(self::_TEXT_ERASE_IN_DISPLAY_1),\n (!$up && $down) => $Output->escape(self::_TEXT_ERASE_IN_DISPLAY_0),\n default => $Output->escape(self::_TEXT_ERASE_IN_DISPLAY_2)\n };\n\n return $Output;\n }",
"public function clean() {\n $this->data = \"\";\n $this->currentRow = 1;\n $this->curPosition = 0;\n }",
"function lineTrim($line, $length, $trim_suffix = \"...\", &$clipping_occured = false) {\n $tmpstr = wordwrap ( trim($line), $length , '%%%%!#!%%%%');\n $lines = explode(\"%%%%!#!%%%%\", $tmpstr, 2);\n $ret = $lines[0];\n if ($clipping_occured = (count($lines) > 1)) {\n $ret .= $trim_suffix;\n }\n return $ret;\n}",
"private function stripIndent($line, $indent = -1) {\n\t//--\n\tif($indent == -1) {\n\t\t$indent = strlen($line) - strlen(ltrim($line));\n\t} //end if\n\t//--\n\treturn substr($line, $indent);\n\t//--\n}",
"public function eraseDown(): void\n {\n static::writeDirectly(\"\\e[J\");\n }",
"public function restorecursor() {\n $this->stdout->restorecursor();\n return $this;\n }",
"protected function skipSpaces() : void\n {\n while($this->pos < strlen($this->src)\n && $this->isSpace($this->src[$this->pos]))\n {\n $this->pos++;\n }\n }",
"public function cursorback() {\n $this->stdout->cursorback();\n return $this;\n }",
"public function previous(): void\n {\n if ($this->cursor > 0) {\n $this->cursor--;\n }\n }",
"function EliminarEspaciosInncesarios($str, $bControlTabReturn=false)\n{\n if( $bControlTabReturn ){\n $str = preg_replace('/[\\n\\r\\t]+/', '', $str);\n }\n return preg_replace('/\\s{2,}/', ' ', $str);\n}",
"public function stripAnsi()\n {\n $this->string = \\preg_replace(\"/\\033\\[[;0-9]*\\m/Us\", '', $this->string);\n\n return $this;\n }",
"function undo()\n {\n $this->document->eraseLast();\n }",
"public function clearScreen()\n {\n if (stristr(PHP_OS, \"linux\")) echo \"\\e[1;1H \\n\";\n elseif(stristr(PHP_OS, \"win\")) echo $this->fakeClearScreenForWindows;\n }",
"private function blank(): void\n {\n $width = $this->getRenderWidth();\n $height = $this->getRenderHeight();\n\n for ($h = 0; $h <= $this->height && $h < $height; ++$h) {\n $this->cli->jump($this->pos['x'], $this->pos['y'] + $h);\n $this->cli->write(str_repeat(' ', $width));\n }\n }",
"public function reset() {\n\t\t\t$this->p = 0;\n\t\t\t$this->line = 1;\n\t\t\t$this->charPositionInLine = 0;\n\t\t\t$this->markDepth = 0;\n\t\t}"
]
| [
"0.6367309",
"0.5695127",
"0.56042486",
"0.54053193",
"0.53832996",
"0.5369608",
"0.5369608",
"0.53406376",
"0.5332802",
"0.5326232",
"0.5174364",
"0.5141033",
"0.51280105",
"0.51026183",
"0.50989646",
"0.507562",
"0.5066021",
"0.50443554",
"0.503585",
"0.49981695",
"0.49849218",
"0.49492604",
"0.4928091",
"0.49186575",
"0.49080193",
"0.4902511",
"0.48948056",
"0.4880388",
"0.48765856",
"0.4873482"
]
| 0.59953344 | 1 |
SELECT FROM CCA WHERE featured ='1' | public function get_featured_cca_list()
{
$this->db->from('cca');
$this->db->where('featured','1');
$query = $this->db->get();
return $query->result();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_featured_products()\n\t{\n\t\t$this->db->select('product.*, category.category_name, brand.brand_name')->from('product, category, brand')->where(\"product.product_status = 1 AND product.category_id = category.category_id AND product.brand_id = brand.brand_id AND product.featured = 1 AND product.product_balance > 0\")->order_by(\"created\", 'DESC');\n\t\t$query = $this->db->get('',8);\n\t\t\n\t\treturn $query;\n\t}",
"function featuredItems()\n{\n \treturn query(\"SELECT titel, beschrijving, b.bodBedrag\n \t\t\t\tfrom tblVoorwerp v\n \t\t\t\tinner join (select voorwerpNummer, max(bodBedrag) as bodBedrag\n \t\t\t\tfrom tblBod\n \t\t\t\tgroup by voorwerpNummer) b on v.voorwerpNummer=b.voorwerpNummer\n where v.voorwerpNummer in (select top 5 v.voorwerpNummer\n \t\t\t\tfrom tblVoorwerp v\n \t\t\t\tinner join (select voorwerpNummer, max(bodBedrag) as bodBedrag\n \t\t\t\tfrom tblBod\n \t\t\t\tgroup by voorwerpNummer) b on v.voorwerpNummer=b.voorwerpNummer\n \t\t\t\torder by startPrijs/bodBedrag*100 desc)\");\n}",
"public function getFeaturedProduct(){\n\t\t$sql = \"SELECT * FROM tbl_product WHERE type = '1' ORDER BY pid DESC LIMIT 4\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}",
"public function getFeatured() {\r\n\t\t$ftable = Engine_Api::_() -> getDbtable('features', 'ynblog');\r\n\t\t$fName = $ftable -> info('name');\r\n\t\t$select = $ftable -> select() -> from($fName) -> where(\"blog_id = ?\", $this -> blog_id);\r\n\t\t$features = $ftable -> fetchAll($select);\r\n\t\tif (count($features) <= 0)\r\n\t\t\treturn false;\r\n\t\telse {\r\n\t\t\tif ($features[0] -> blog_good == '1')\r\n\t\t\t\treturn true;\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function fetch_featured($s_where=null,$order_by,$i_start=null,$i_limit=null)\r\n {}",
"function get_random_featured_collection()\n{\n return get_db()->getTable('Collection')->findRandomFeatured();\n}",
"function get_featured_travelinfo() {\n $sql = \"SELECT * FROM news WHERE parentid='' AND featured='1' ORDER BY id DESC LIMIT 7\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }",
"function findFeaturedProducts($count) {\n $sql = \"select * from product where is_featured=1 order by entered_date limit $count\";\n $command = $this->db->prepare($sql);\n $command->execute();\n $result = $command->fetchAll();\n $command->closeCursor();\n return $result;\n }",
"function otm_get_featured_posts() {\n\n\t$my_query = new WP_Query( array( \n\t\t'meta_key' \t\t\t\t=> 'is_featured',\n\t\t'post_type'\t\t\t\t=> 'post',\n\t\t'meta_value'\t\t\t=> true,\n\t\t'numberposts' \t\t=> 3\n\t) );\n\n\t// If our query has posts\n\tif ( $my_query->have_posts() ) :\n\t\treturn true;\n\t\twp_reset_query();\n\telse :\n\t\twp_reset_query();\n\t\treturn;\n\tendif;\n}",
"public function getFeaturedProducts(): Collection\n\t{\n\t\treturn $this->db->filter(fn (Product $product) => $product->isFeatured);\n\t}",
"public function featured()\r\n\t{\r\n\t\t$this->batchScraper->featured();\r\n\t}",
"function cpc_is_featured( $userID, $featuredtype ){\n\tif( get_user_meta( $userID, 'active_membership_pack' ) == array( $featuredtype ) ){\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function get_featured_sites() {\n $this->db->select(\"site.site_ref, site.remarks\");\n $this->db->join(\"site\", \"site.site_ref = featured.site_ref\");\n $res = $this->db->get(\"featured\");\n if ($res) {\n return $res->result_array();\n }\n return false;\n }",
"function getFeaturedCourses(){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name, author, image FROM Course ORDER BY popularity LIMIT 3\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\t}",
"function is_featured() {\n\t\tif (get_post_meta($this->id, 'featured', true)=='yes') return true;\n\t\treturn false;\n\t}",
"function tutsplus_featured_query() {\n\t\n\t//query parameters\n\t$args = array(\n\t\t'posts_per_page' => 1,\n\t\t'orderby' => 'rand',\n\t\t'category_name' => 'featured'\n\t);\n\t\n\t//the query\n\t$query = new WP_Query( $args );\n\t\n\t//the loop\n\tif( $query->have_posts() ) {\n\t\t\n\t\techo '<aside class=\"featured-post container\">';\n\t\t\n\t\t\twhile( $query->have_posts() ) {\n\t\t\t\t$query->the_post();\n\t\t\t\t\n\t\t\t\techo '<h3>Featured Post - <a href=\"' . get_the_permalink() . ' \">' . get_the_title() . '</a></h3>';\n\t\t\t\t\n\t\t\t\tif( has_post_thumbnail() ) {\n\t\t\t\t\t\n\t\t\t\t\techo '<a href=\"' . get_the_permalink() . ' \">';\n\t\t\t\t\t\tthe_post_thumbnail( 'medium', array(\n\t\t\t\t\t\t\t'class' => 'alignleft'\n\t\t\t\t\t\t));\n\t\t\t\t\techo '</a>';\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tthe_excerpt();\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\techo'</aside>';\n\t\t\n\t\twp_reset_postdata();\n\t\t\n\t}\n\t\n}",
"public function featured()\n {\n if($this->isFeatured())\n {\n $featuredObj = FeaturedCompany::where('company_id', $this->id)->first();\n return $featuredObj;\n }\n return false;\n }",
"public function getIsFeatured()\n\t{\n\t\treturn $this->is_featured;\n\t}",
"function get_featured_slider() {\n $sql = \"SELECT * FROM slider WHERE publish='1'\";\n $res = $this->mysqli->query($sql);\n $data = array();\n while ($row = $res->fetch_array(MYSQLI_ASSOC)) {\n $data[] = $row;\n }\n return $data;\n }",
"public function featured_all($cat_type_id)\n\t{\n\t\t// $featuredExperiences = $this->ExecuteQuery($sel_featuredExp);\n\t\t// return $featuredExperiences;\n\t}",
"public function updateFeatured()\n {\n $s = App::make('Lib\\Services\\Scraping\\Scraper');\n $s->featured();\n\n $fet = $this->where('featured', 1)->limit(8)->orderBy('created_at', 'asc')->get();\n\n return $fet;\n }",
"function is_item_featured() {\n\t\tif (get_post_meta($this->id, '_apptivo_featured', true)=='yes') return true;\n\t\treturn false;\n\t}",
"function otm_show_featured_posts() {\n\n\t$my_query = new WP_Query( array( \n\t\t'meta_key' \t\t\t\t=> 'is_featured',\n\t\t'post_type'\t\t\t\t=> 'post',\n\t\t'meta_value'\t\t\t=> true,\n\t\t'numberposts' \t\t=> 3\n\t) );\n\n\t// If our query has posts\n\tif ( $my_query->have_posts() ) :\n\t\twhile ( $my_query->have_posts() ) : $my_query->the_post();\n\n\t\t\t// Get specific template-part\n\t\t\tget_template_part( 'template-parts/post/content-featured' );\n\n\t\tendwhile;\n\tendif;\n\n\twp_reset_query();\n}",
"function tep_is_set_faq_category($cid,$site_id){\n return tep_db_fetch_array(tep_db_query(\"select * from\n \".TABLE_FAQ_CATEGORIES_DESCRIPTION.\" where faq_category_id = '\".$cid.\"' \n and site_id='\".$site_id.\"'\n order by site_id DESC \"));\n }",
"function aggiornaFaveFeatured(){\n\t \n\tglobal $wpdb;\n\t$metas = array();\n\t$key = '_id_cometa';\n\t\n if( !empty( $key ) ){\n\t\t\n\t\t$qry = $wpdb->prepare( \n\t\t\t\t\"SELECT post_id, meta_value \n\t\t\t\tFROM {$wpdb->postmeta} \n\t\t\t\tWHERE meta_key = '%s'\", \n\t\t\t\t$key\n\t\t\t);\n\n\t\t$res = $wpdb->get_results( $qry );\n\t\t\n\t\tif($res){\n\t\t\t\n\t\t\t\n\t\t\tforeach ( $res as $r ) {\n\t\t\t\t$post_id = $r->post_id;\n\t\t\t\t\n\t\t\t\t// recupero se c'è valore fave_featured\n\t\t\t\t$featured = get_post_meta( $post_id, 'fave_featured', true );\n\t\t\t\t\n\t\t\t\tif($featured == ''){\n\t\t\t\t\t\n\t\t\t\t\t$result = add_post_meta($post_id, 'fave_featured', '0');\n\t\t\t\t\t\n\t\t\t\t\t$msg = $post_id.\" non aveva fave_featured, ora l'ho inserito. Result: \";\n\t\t\t\t\t$msg .= var_export($result, true);\n\t\t\t\t\tcc_import_immobili_error_log($msg);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t}\t \n\t \n }",
"public function index()\n {\n return new FeaturedCollection(FeaturedResource::collection((Product::where('featured', '=', 1)->take(15)->get())));\n }",
"function detial_view_sql($c_id)\n\t{\n\t\t$view_detial=mysqli_query($this->con,\"select * from categories where c_id='$c_id' and status=1\");\n\t\treturn $view_detial;\n\t}",
"public function getfeaturedCities(){\n\t\t $featuredTestimonial = array();\n\t\t $tData = $this->find('all',array('conditions'=>array('CmsCity.is_display'=>1),\n\t\t\t\t\t\t\t\t\t\t\t'fields'=>array('CmsCity.*'),\n\t\t\t\t\t\t\t\t));\n\t\t if(isset($tData) && !empty($tData)){\n\t\t\t\tforeach($tData as $key=>$testiData){\n\t\t\t\t\tif(isset($testiData['CmsCity']['image']))\n\t\t\t\t\t\t$testiData['CmsCity']['image'] = (!empty($testiData['CmsCity']['image'])) ? Router::url('/'.CMS_IMAGE_URL.$testiData['CmsCity']['image'],true) : \"\";\n\t\t\t\t\t$featuredTestimonial[] = $testiData;\n\t\t\t\t}\t\n\t\t\t}\n\t\treturn $featuredTestimonial;\t\n\t}",
"public function get_featured_product($conditions = array()) {\n $this->db->select(array('product.product_id', 'product.name', 'product.url_slug', 'product.description', 'product.price', 'product.image', 'product_category.name as category_name', 'product.product_category_id', 'product.product_type_id', 'product_category.url_slug as product_category_url_slug'));\n $this->db->from('product');\n $this->db->join('product_category', 'product_category.product_category_id = product.product_category_id');\n $this->db->where(array('product.status' => 1, 'product.deleted' => 0, 'product_category.status' => 1, 'product_category.deleted' => 0));\n\n if (!empty($conditions)) {\n $this->db->where($conditions);\n }\n\n $this->db->order_by('product_category.name');\n $this->db->order_by('product.name');\n\n return $this->db->get()->result_array();\n }",
"function ridizain_get_featured_posts() {\r\n\t/**\r\n\t * Filter the featured posts to return in Ridizain.\r\n\t *\r\n\t * @since Ridizain 1.0\r\n\t *\r\n\t * @param array|bool $posts Array of featured posts, otherwise false.\r\n\t */\r\n\treturn apply_filters( 'ridizain_get_featured_posts', array() );\r\n}"
]
| [
"0.6166313",
"0.60886997",
"0.6069739",
"0.59516597",
"0.593999",
"0.59057987",
"0.57637095",
"0.57562125",
"0.5681371",
"0.5654479",
"0.5650602",
"0.56500375",
"0.5624769",
"0.561986",
"0.557438",
"0.5572703",
"0.5545052",
"0.5535902",
"0.55215394",
"0.55013186",
"0.5474342",
"0.54717153",
"0.5424015",
"0.54076654",
"0.53921396",
"0.5307584",
"0.53002304",
"0.52938294",
"0.5282595",
"0.52222353"
]
| 0.71273214 | 0 |
SELECT FROM cca WHERE ccaID = $ccaID | public function get_specific_cca($ccaID)
{
$this->db->select('*');
$this->db->from('cca');
$this->db->where('ccaID', $ccaID);
$query = $this->db->get();
return $query->row();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ifx_getsqlca($result_id)\n{\n}",
"function checkName($aname)\n{\n $dbc = connect_to_db( \"GSC\" ); \n\n $query = \"SELECT cid FROM Customer WHERE name= '\" . $aname . \"'\";\n $result = perform_query($dbc, $query);\n $row = mysqli_fetch_array( $result, MYSQLI_ASSOC );\n\n return ($row);\n \n}",
"function get_court_by_court_id($court_id)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `courts` WHERE `court_id`='$court_id'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}",
"function read_in_cf($cf,$cfs)\n\t{\n\t\t// reads in a list of distinct clan names from the clans table\n\t\t// or family names from the families table \n\t\t// and returns them into an array\n\t\t// $cf will either be \"clan\" or \"family\"\n\t\t// $cfs will be the plural of same\n\t\t\n\t\t// echo \"reading in $cf .......<br>\";\t\n\t\t$query = \"SELECT DISTINCT {$cf}_id, {$cf}_name FROM $cfs\";\n\t\t$result=do_query($query);\n\t\treturn ($result);\n\t}",
"public function getSac(){\n return $this->db->get('sac')->result();\n }",
"function getCustAct($db_link){\n\t\t$sql_custact = \"SELECT * FROM customer LEFT JOIN custsex ON custsex.custsex_id = customer.custsex_id WHERE cust_id != 0 AND cust_active = 1 ORDER BY cust_id\";\n\t\t$query_custact = mysqli_query($db_link, $sql_custact);\n\t\tcheckSQL($db_link, $query_custact, $db_link);\n\n\t\treturn $query_custact;\n\t}",
"function cicleinscription_get_recordsextractions_by_cicle($cicleinscriptionid){\n\tglobal $DB;\n\t\n\t$sql = \"SELECT Concat(u.firstname, ' ', u.lastname) as userfullname,\n\t\t \to.name as organ,\n\t\t\tu.username,\n\t\t\tu.email,\n\t\t\tu.city,\n\t\t\tu.department,\n\t\t\tu.phone1,\n\t\t\tu.aim,\n\t\t\tu.address,\n\t\t c.fullname as course,\n\t\t c.shortname,\n\t\t u.city as city,\n\t\t u.id as userid\n\t\tFROM\n\t\t {ci_prematriculation} AS ci\n\t\tINNER JOIN\n\t\t {user} u\n\t\t ON ci.username = u.username\n\t\tINNER JOIN\n\t\t\t{ci_organ} o\n\t\tON ci.organid = o.id\n\t\tINNER JOIN\n\t\t\t{course} c\n\t\tON ci.course_prematriculationid = c.id\n\t\tWHERE\n\t\t ci.cicleinscriptionid = ?\n\t\tAND ci.status_prematriculationid = 1;\";\n\t\t\n\t\t$rs = $DB->get_records_sql($sql, array($cicleinscriptionid));\n\t\t\n\t\treturn $rs;\n}",
"function getTheBai_ctc($user_id){\n\tglobal $db;\n\t$sql = \"SELECT the_bai_1, the_bai_2, the_bai_3 FROM wg_plus WHERE user_id=$user_id\";\n\t$db->setQuery($sql);\n\t$db->loadObject($rs);\n\treturn $rs;\n}",
"function viewOneCategory( $category_id )\r\n{\r\n $db = dbconnect();\r\n \r\n $stmt = $db->prepare(\"SELECT * FROM categories where category_id = :category_id\");\r\n \r\n $binds = array ( \"category_id\" => $category_id);\r\n \r\n $results = array();\r\n \r\n if \r\n // function used to pull one particular record from table\r\n ($stmt->execute($binds) && $stmt->rowCount() > 0) {\r\n $results = $stmt->fetch(PDO::FETCH_ASSOC);\r\n }\r\n return $results;\r\n}",
"function getCourse($cid)\n {\n $db = Database::getInstance();\n $mysqli = $db->getConnection();\n\n $query = \"SELECT * FROM courses where cid='\".$cid.\"'\";\n $stmt = $mysqli->query($query);\n\n return $stmt;\n \n }",
"public function getComparedData($csid){\n\t\t$sql = \"SELECT * FROM tbl_compare WHERE csId ='$csid'\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}",
"function get_court_by_court_name($court_name)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `courts` WHERE `court_name`='$court_name'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}",
"public function checkCompareData($csid){\n\t\t$sql = \"SELECT * FROM tbl_compare WHERE csId = '$csid'\";\n\t\t$result = $this->db->select($sql);\n\t\treturn $result;\n\t}",
"function getCustomer($db_link, $custID){\n\t\t$sql_cust = \"SELECT * FROM customer LEFT JOIN custsex ON customer.custsex_id = custsex.custsex_id LEFT JOIN custmarried ON customer.custmarried_id = custmarried.custmarried_id LEFT JOIN custsick ON customer.custsick_id = custsick.custsick_id LEFT JOIN user ON customer.user_id = user.user_id WHERE cust_id = '$custID'\";\n\t\t$query_cust = mysqli_query($db_link, $sql_cust);\n\t\tcheckSQL($db_link, $query_cust, $db_link);\n\t\t$result_cust = mysqli_fetch_assoc($query_cust);\n\n\t\treturn $result_cust;\n\t}",
"function getcatt(){\r\n\tglobal $con;\r\n\t$categories = $con->prepare(\"SELECT * FROM categories ORDER BY ID ASC\");\r\n\t$categories->execute();\t\r\n\t$cats = $categories->fetchAll();\r\n\treturn $cats;\r\n\r\n}",
"function get_contacts_by_category($employeeID) {\r\n $db = Database::getDB();\r\n $query = 'SELECT * FROM contact\r\n WHERE contact.employeeID = :employeeID\r\n ORDER BY contactID';\r\n $statement = $db->prepare($query);\r\n $statement->bindValue(':employeeID', $employeeID);\r\n $statement->execute();\r\n $contact = $statement->fetchAll();\r\n $statement->closeCursor();\r\n return $contact;\r\n}",
"function getAllRegCrs(){\n global $db;\n // select all\n $query = 'SELECT * FROM `reg_courses`\n ORDER BY `reg_courses`.`regID`';\n $statement = $db->prepare($query);\n $statement->execute();\n $crs = $statement->fetchAll();\n $statement->closeCursor();\n return $crs;\n}",
"public function getcoursesByid_course ($id_course){\n $sqlQuery = \" SELECT * \";\n $sqlQuery .= \" FROM courses \";\n $sqlQuery .= \" WHERE id_course= $id_course \";\n $result = $this -> getDbManager () -> executeSelectQuery ( $sqlQuery );\n return ( $result );\n }",
"function getCustInact($db_link){\n\t\t$sql_custinact = \"SELECT * FROM customer LEFT JOIN custsex ON custsex.custsex_id = customer.custsex_id WHERE cust_id != 0 AND cust_active != 1 ORDER BY cust_id\";\n\t\t$query_custinact = mysqli_query($db_link, $sql_custinact);\n\t\tcheckSQL($db_link, $query_custinact, $db_link);\n\n\t\treturn $query_custinact;\n\t}",
"public function checkCitatbCasos()\n {\n $sql = \"SELECT cs.id_cita FROM citas c INNER JOIN casos cs ON c.id = cs.id_cita INNER JOIN detalle_solicitud d ON c.id_detalle = d.id_detalle WHERE d.id_detalle = ?\";\n $params = array($this->id_detalle);\n return Database::getRow($sql, $params);\n }",
"function searchIS4C($member) {\n\n\tglobal $dbConn2;\n\n\t$is4cMembers = array();\n\t$sel = \"SELECT CardNo, personNum, FirstName, LastName FROM custdata where CardNo = ${member};\";\n\t$rslt = $dbConn2->query(\"$sel\");\n\tif ( $dbConn2->errno ) {\n\t\t$msg = sprintf(\"Error: DQL failed: %s\\n\", $dbConn2->error);\n\t\t$is4cMembers[] = array($msg);\n\t\treturn($is4cMembers);\n\t}\n\t// What is $rslt if 0 rows? Does it exist?\n\t//$n = 0;\n\twhile ( $row = $dbConn2->fetch_row($rslt) ) {\n\t\t//$n++;\n\t\t$is4cMembers[] = array($row[CardNo], $row[personNum], $row[FirstName], $row[LastName]);\n\t}\n\treturn($is4cMembers);\n\n// searchIS4C\n}",
"public function get_all_courses_record() {\n $slct_query =\"SELECT * FROM courses WHERE course_deleted='0'\";\n $slct_exe =mysqli_query($GLOBALS['con'],$slct_query) or die(mysqli_error($GLOBALS['con']));\n return $slct_exe; //returning all the courses records\n }",
"function getAllKontakt($id) {\n $rechte=berechtigung(\"cp_\");\n $sql=\"select * from contacts where cp_cv_id=$id and $rechte order by cp_name,cp_givenname\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n return $rs;\n}",
"function cons_benef($ced)\r\n\t{\r\n\t \t$sql=\"SELECT * FROM slc_benef WHERE ced_benf=\".$ced;\r\n\t\t$result=mysql_query($sql,$this->conexion);\r\n\t\t//echo $sql;\r\n\t\tif ($result) \r\n\t\t\t return $result;\r\n\t\telse\r\n\t\t\t return false;\r\n\t}",
"function getCcInfoByCustId($customerid) {\n $query = \"SELECT * FROM `creditcards` WHERE CustomerId='\".$customerid.\"'\";\n $result = Database::selectQuery($query);\n if($result == null) {\n return null;\n } else {\n return $result[0];\n }\n }",
"function getCourse($course_id){\n\t$sql = \"select * from course_details where course_id='$course_id'\";\n\t$result = DBConnection::execQery($sql);\n\treturn $result;\n\n}",
"function GetCats() {\n include '../components/link.php';\n$acp_categories = $link -> prepare('SELECT * from categories');\n$acp_categories -> execute();\n$acp_categories -> store_result();\n$acp_categories -> bind_result($id, $name);\nreturn $acp_categories->affected_rows;\n}",
"public function show_once($id_cs)\n\t{\n\t\t$this->db->where('id_cs', $id_cs);\n\t\t$this->db->where('course.id_user = user.id_user');\n\t\t$query = $this->db->get('course, user');\n\t\treturn $query->result_array();\n\t}",
"function cons_contacto($ced)\r\n\t{\r\n\t \t$sql=\"SELECT * FROM slc_contacto WHERE ced_paciente=\".$ced;\r\n\t\t$result=mysql_query($sql,$this->conexion);\r\n\t\t//echo $sql;\r\n\t\tif ($result) \r\n\t\t\t return $result;\r\n\t\telse\r\n\t\t\t return false;\r\n\t}",
"function cicleinscription_get_recordsopencoursesextractions_by_cicle($cicleinscriptionid){\n\tglobal $DB;\n\t\n\t$sql = \"SELECT Concat(u.firstname, ' ', u.lastname) as userfullname,\n\t\t\tc.id as courseid,\n\t\t\tc.fullname as course,\n\t\t\tc.shortname,\n\t\t\to.name as organ,\n\t\t\tu.username,\n\t\t\tu.email,\n\t\t\tdp.civilstate,\n\t\t\tdp.sex,\n\t\t\tdp.datebirth,\n\t\t\tdp.race,\n\t\t\tdp.rolefamily,\n\t\t\tdp.schooling,\n\t\t\tdp.incomefamily,\n\t\t\tdp.howdid,\n\t\t\tdp.deficient,\n\t\t\tdp.deficiency,\n\t\t\tdp.region,\n\t\t\tdp.state,\n\t\t\tu.city,\n\t\t\tu.id as userid\n\t\tFROM\n\t\t {ci_prematriculation} ci\n\t\tINNER JOIN\n\t\t {user} u\n\t\t ON ci.username = u.username\n\t\tINNER JOIN\n\t\t\t{ci_organ} o\n\t\tON ci.organid = o.id\n\t\tINNER JOIN\n\t\t\t{course} c\n\t\tON ci.course_prematriculationid = c.id\n\t\tINNER JOIN \n\t\t\t{ci_data_participant} dp\n\t\tON u.id = dp.userid\n\t\tWHERE\n\t\t ci.cicleinscriptionid = ?\n\t\tAND ci.status_prematriculationid = 1;\";\n\t\n\t$rs = $DB->get_records_sql($sql, array($cicleinscriptionid));\n\t\n\treturn $rs;\n}"
]
| [
"0.63530797",
"0.612125",
"0.6099165",
"0.5993583",
"0.59318066",
"0.58986944",
"0.5860849",
"0.5852334",
"0.57987505",
"0.57799196",
"0.5759198",
"0.5739767",
"0.5737093",
"0.57346624",
"0.5724474",
"0.57207036",
"0.57191926",
"0.5716363",
"0.5676144",
"0.56757706",
"0.56615645",
"0.56586856",
"0.56342417",
"0.5613351",
"0.5604805",
"0.55978113",
"0.5584543",
"0.55680394",
"0.5552587",
"0.55327034"
]
| 0.6919532 | 0 |
Enhance this object by wrapping it in an extender object. | public function extend($extender_name); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function extend()\n\t{\n\t\t$extensions = func_get_args();\n\n\t\tforeach ( $extensions as $extension )\n\t\t{\n\t\t\tif ( $extension instanceof self )\n\t\t\t\t$this->data = array_merge_recursive( $this->data, $extension->data );\n\t\t\telse\n\t\t\t\t$this->data = array_merge_recursive( $this->data, _A($extension)->data );\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function extend($name, $extender)\n {\n $this->extends[$name][] = $extender;\n }",
"function DahzExtender() {\r\n\treturn DahzExtender::instance();\r\n}",
"public function decorate();",
"abstract public function decorate();",
"public function extend(Builder $builder)\n {\n $this->{\"add{$this->extension}\"}($builder);\n }",
"public function extend($value)\n {\n $this->attributes['extend'] = $value;\n\n return $this;\n }",
"private function initializeExtbuilder() {\n $this->codeGenerator = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_CodeGenerator');\n $this->classParser = t3lib_div::makeInstance('Tx_ExtensionBuilder_Utility_ClassParser');\n\t\t$this->roundTripService = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_RoundTrip');\n\t\t$this->classBuilder = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_ClassBuilder');\n\t\t$this->templateParser =t3lib_div::makeInstance('Tx_Fluid_Core_Parser_TemplateParser');\n\t\t$this->codeGenerator = t3lib_div::makeInstance('Tx_ExtensionBuilder_Service_CodeGenerator');\n\t\t$this->codeGenerator->setSettings(array(\n\t\t\t\t'codeTemplateRootPath' => PATH_typo3conf.'ext/extension_builder/Resources/Private/CodeTemplates/Extbase/',\n ));\n\n if (class_exists('Tx_Extbase_Object_ObjectManager')) {\n\t\t\t$this->objectManager = t3lib_div::makeInstance('Tx_Extbase_Object_ObjectManager');\n\t\t\t$this->codeGenerator->injectObjectManager($this->objectManager);\n\t\t\t$this->templateParser->injectObjectManager($this->objectManager);\n\t\t}\n\n\t\t$this->roundTripService->injectClassParser($this->classParser);\n\t\t$this->classBuilder->injectRoundtripService($this->roundTripService);\n\t\t$this->codeGenerator->injectTemplateParser($this->templateParser);\n\t\t$this->codeGenerator->injectClassBuilder($this->classBuilder);\n }",
"public function extend(string $name): Extend {\r\n\r\n $extend = new Extend();\r\n $this -> extendCollection[$name] = $extend;\r\n\r\n return $extend;\r\n }",
"public function setExtendables()\n {\n $this->extend('foo', function() {\n return [$this->getUserAgent(), $this->getRemoteAddr()];\n });\n }",
"public function extendData() {\n }",
"function setExt($inExt) {\n\t\tif ( $inExt !== $this->_Ext ) {\n\t\t\t$this->_Ext = $inExt;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function extend(Builder $builder)\n {\n foreach ($this->extensions as $extension) {\n $this->{\"add{$extension}\"}($builder);\n }\n }",
"public function extend($value)\n {\n $this->args = array_merge($this->args, ['extend' => $value]);\n\n return $this;\n }",
"public function extend(Builder $builder)\n {\n foreach ( $this->extensions as $extension ) {\n $this->{\"add{$extension}\"}($builder);\n }\n }",
"public function decorate()\n {\n foreach ($this->_decorators AS $decorator)\n {\n $decorator->run($this);\n }\n }",
"function add_extension() {\n\n require_once( dirname( __FILE__ ) . '/LFAPPS_Comments_Extension.php' );\n $this->ext = new LFAPPS_Comments_Extension();\n }",
"public static function extend(callable $compiler)\n {\n }",
"public function extendProduct($product, $extender) \n\t{\n\t\t$this->load->model('catalog/product');\n\t\t$this->load->model('catalog/category');\n\t\t\n\t\t$languageId = $this->config->get('config_language_id');\t\t\n\t\t$productId = $product['product_id'];\n\t\t\n\t\t// Move description fields in sub array\t\n\t\t$descriptionFields = $this->getTableFields('product_description');\n\t\tunset($descriptionFields['product_id']);\t\t\n\t\t\n\t\t$product['product_description'] = array(\n\t\t\t$languageId => array(),\n\t\t);\n\t\tforeach ($descriptionFields as $key => $value) {\n\t\t\tif (array_key_exists($key, $product)) {\n\t\t\t\t$product['product_description'][$languageId][$key] = $product[$key];\n\t\t\t\tunset($product[$key]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Update manufacturer\n\t\tif (array_key_exists('manufacturer_id', $extender)) {\n\t\t\t$product['manufacturer_id'] = $this->addManufacturer($extender['manufacturer_id']);\n\t\t}\n\t\t\n\t\t// Update SEO url\n\t\tif (array_key_exists('keyword', $extender)) {\n\t\t\t$product['keyword'] = $extender['keyword'];\n\t\t}\n\t\t\n\t\t// Update image\n\t\tif (array_key_exists('image', $extender)) {\n\t\t\t$product['image'] = $this->addImage($extender['image']);\n\t\t} elseif (!empty($this->imageFileTpl)) {\n\t\t\t$values = array_values($product);\n\t\t\t$image = str_replace($this->imageTplPlaceholders, $values, $this->imageFileTpl);\n\t\t\t\n\t\t\t$product['image'] = $this->addImage($image);\n\t\t}\n\t\t\n\t\t// Status\n\t\t$product['status'] = array_key_exists('status', $extender) \n\t\t\t? $extender['status']\n\t\t\t: $this->productStatus;\n\t\t\n\t\t// Category processing\n\t\tif (array_key_exists('store_id', $extender)) {\n\t\t\t$product['product_store'] = array($extender['store_id']);\n\t\t} else {\n\t\t\t$product['product_store'] = array(0);\n\t\t}\n\t\t\n\t\t// Set store\n\t\tif (array_key_exists('category_id', $extender)) {\n\t\t\t$product['product_category'] = $this->addCategory($extender['category_id']);\n\t\t}\n\t\t\n\t\t//$product = array_merge($product, array('product_category' => $this->model_catalog_product->getProductCategories($productId)));\t\t\n\t\t//$product = array_merge($product, array('product_image' => $this->model_catalog_product->getProductImages($productId)));\n\t\t\n\t\t//$product = array_merge($product, array('product_attribute' => $this->model_catalog_product->getProductAttributes($productId)));\n\t\t//$product = array_merge($product, array('product_discount' => $this->model_catalog_product->getProductDiscounts($productId)));\n\t\t//$product = array_merge($product, array('product_filter' => $this->model_catalog_product->getProductFilters($productId)));\n\t\t//$product = array_merge($product, array('product_option' => $this->model_catalog_product->getProductOptions($productId)));\n\t\t//$product = array_merge($product, array('product_related' => $this->model_catalog_product->getProductRelated($productId)));\n\t\t//$product = array_merge($product, array('product_reward' => $this->model_catalog_product->getProductRewards($productId)));\n\t\t//$product = array_merge($product, array('product_special' => $this->model_catalog_product->getProductSpecials($productId)));\n\t\t//$product = array_merge($product, array('product_download' => $this->model_catalog_product->getProductDownloads($productId)));\n\t\t//$product = array_merge($product, array('product_layout' => $this->model_catalog_product->getProductLayouts($productId)));\n\t\t//$product = array_merge($product, array('product_store' => $this->model_catalog_product->getProductStores($productId)));\n\t\n\t\treturn $product;\n\t}",
"private function mergeExtra()\n {\n if (method_exists($this, 'extra')) {\n $this->extra = $this->extra();\n }\n }",
"public function __construct()\n {\n $this->extendableConstruct();\n }",
"public function extension() {}",
"public function hookAddTwigExtension()\n {\n Craft::import('plugins.scrawl.twigextensions.MarkdownTwigExtension');\n return new MarkdownTwigExtension();\n }",
"public function addTwigExtension()\n {\n Craft::import('plugins.texteffect.twigextensions.TextEffectTwigExtension');\n \n return new TextEffectTwigExtension();\n }",
"public function extension();",
"protected function makeWrapper()\n {\n parent::makeWrapper();\n }",
"private function getExtensionsObject()\n {\n if(!is_object($this->extObj) && !($this->extObj instanceof Extensions)) {\n $this->extObj = GeneralUtility::makeInstance('PITS\\\\Snowbabel\\\\Record\\\\Extensions', $this->confObj);\n }\n }",
"public function extend()\n {\n if (!$this->isExtendable) {\n return false;\n }\n\n $this->extendedDate = Carbon::today()->endOfDay();\n $this->nextBillingDate = $this->extendedDate->addDays($this->getExtendableDays());\n $this->trialEndsAt = null;\n $this->markAsActive();\n\n $this->package->activate($this->host, $this->plan);\n\n return $this;\n }",
"protected static function getFacadeAccessor()\n {\n return 'extend';\n }",
"public function extend($parent)\n {\n $child = $this->getScript();\n\n // child views cannot extend themselves\n if ($parent === $child) {\n Exception::toss('Child view cannot extend itself.');\n }\n\n // if the child has already extended a parent, don't do anything\n if (in_array($child, $this->extendStack)) {\n return $this;\n }\n\n // the extend stack makes sure that extend doesn't trigger recursion\n $this->extendStack[] = $child;\n\n // set the parent\n $this->parentScript = $parent;\n\n return $this;\n }"
]
| [
"0.6708897",
"0.633996",
"0.6223745",
"0.597959",
"0.5937366",
"0.57418674",
"0.56937104",
"0.5652944",
"0.56441414",
"0.5619508",
"0.561725",
"0.55715454",
"0.5482291",
"0.54800904",
"0.54714656",
"0.5434461",
"0.5406895",
"0.5332271",
"0.53035057",
"0.5200498",
"0.5186161",
"0.5180206",
"0.5131118",
"0.5124222",
"0.5118721",
"0.5114412",
"0.51137537",
"0.5100873",
"0.5078818",
"0.50717413"
]
| 0.7288679 | 0 |
Checks if a key is exists in the store. Magic method: called when asking isset() on a key. | public function __isset($key)
{
return (array_key_exists($key, $this->_store));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function exist($key);",
"public static function exist($key) ;",
"public function has($key) : bool;",
"public function hasValueForKey($key) {\n\t\treturn array_key_exists($key, $this->store);\n\t}",
"public function isset($key): bool;",
"public function exists($key);",
"public function exists($key): bool;",
"public function issetKey(string $key) : bool;",
"public function __isset($key)\n {\n return array_key_exists($key, $this->storage);\n }",
"public function keyExists(string $key): bool;",
"public function has(string $key): bool {}",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function has($key);",
"public function hasKey()\n {\n return isset($this->key);\n }"
]
| [
"0.80526525",
"0.794354",
"0.791346",
"0.7909075",
"0.7886536",
"0.78786284",
"0.7871578",
"0.7800489",
"0.7787481",
"0.7784834",
"0.7769935",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.7759327",
"0.773399"
]
| 0.805725 | 0 |
for each entry in mongo:global.userports, do job records exists, if not, remove | function userports_clear_db() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function task_userpruning($task)\n{\n\tglobal $db, $lang, $mybb, $cache;\n\t\n\tif($mybb->settings['enablepruning'] != 1)\n\t{\n\t\treturn;\n\t}\n\t\n\t// Are we pruning by posts?\n\tif($mybb->settings['enableprunebyposts'] == 1)\n\t{\n\t\t$in_usergroups = array();\n\t\t$users = array();\n\t\t\n\t\t$usergroups = $cache->read(\"usergroups\");\n\t\tforeach($usergroups as $gid => $usergroup)\n\t\t{\n\t\t\t// Exclude admin, moderators, super moderators, banned\n\t\t\tif($usergroup['canmodcp'] == 1 || $usergroup['cancp'] == 1 || $usergroup['issupermod'] == 1 || $usergroup['isbannedgroup'] == 1)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$in_usergroups[] = $gid;\n\t\t}\n\t\t\n\t\t// If we're not pruning unactivated users, then remove them from the criteria\n\t\tif($mybb->settings['pruneunactived'] == 0)\n\t\t{\n\t\t\t$key = array_search('5', $in_usergroups);\n\t\t\tunset($in_usergroups[$key]);\n\t\t}\n\t\t\n\t\t$regdate = TIME_NOW-(intval($mybb->settings['dayspruneregistered'])*24*60*60);\n\t\t$query = $db->simple_select(\"users\", \"uid\", \"regdate <= \".intval($regdate).\" AND postnum <= \".intval($mybb->settings['prunepostcount']).\" AND usergroup IN(\".$db->escape_string(implode(',', $in_usergroups)).\")\");\n\t\twhile($user = $db->fetch_array($query))\n\t\t{\n\t\t\t$users[$user['uid']] = $user['uid'];\n\t\t}\n\t}\n\t\n\t// Are we pruning unactivated users?\n\tif($mybb->settings['pruneunactived'] == 1)\n\t{\n\t\t$regdate = TIME_NOW-(intval($mybb->settings['dayspruneunactivated'])*24*60*60);\n\t\t$query = $db->simple_select(\"users\", \"uid\", \"regdate <= \".intval($regdate).\" AND usergroup='5'\");\n\t\twhile($user = $db->fetch_array($query))\n\t\t{\n\t\t\t$users[$user['uid']] = $user['uid'];\n\t\t}\n\t}\n\t\n\tif(!empty($users))\n\t{\n\t\t$uid_list = $db->escape_string(implode(',', $users));\n\t\t\n\t\t// Delete the user\n\t\t$db->delete_query(\"userfields\", \"ufid IN({$uid_list})\");\n\t\t$db->delete_query(\"privatemessages\", \"uid IN({$uid_list})\");\n\t\t$db->delete_query(\"events\", \"uid IN({$uid_list})\");\n\t\t$db->delete_query(\"moderators\", \"id IN({$uid_list}) AND isgroup='0'\");\n\t\t$db->delete_query(\"forumsubscriptions\", \"uid IN({$uid_list})\");\n\t\t$db->delete_query(\"threadsubscriptions\", \"uid IN({$uid_list})\");\n\t\t$db->delete_query(\"sessions\", \"uid IN({$uid_list})\");\n\t\t$db->delete_query(\"banned\", \"uid IN({$uid_list})\");\n\t\t$db->delete_query(\"threadratings\", \"uid IN({$uid_list})\");\n\t\t$db->delete_query(\"joinrequests\", \"uid IN({$uid_list})\");\n\t\t$db->delete_query(\"awaitingactivation\", \"uid IN({$uid_list})\");\n\t\t$query = $db->delete_query(\"users\", \"uid IN({$uid_list})\");\n\t\t$num_deleted = $db->affected_rows($query);\n\n\t\t// Remove any of the user(s) uploaded avatars\n\t\t$query = $db->simple_select(\"users\", \"avatar\", \"uid IN ({$uid_list}) AND avatartype = 'upload'\");\n\t\tif($db->num_rows($query))\n\t\t{\n\t\t\twhile($avatar = $db->fetch_field($query, \"avatar\"))\n\t\t\t{\n\t\t\t\t$avatar = substr($avatar, 2, -20);\n\t\t\t\t@unlink(MYBB_ROOT.$avatar);\n\t\t\t}\n\t\t}\n\n\t\t// Are we removing the posts/threads of a user?\n\t\tif($mybb->settings['prunethreads'] == 1)\n\t\t{\n\t\t\trequire_once MYBB_ROOT.\"inc/class_moderation.php\";\n\t\t\t$moderation = new Moderation();\n\n\t\t\t// Threads\n\t\t\t$query = $db->simple_select(\"threads\", \"tid\", \"uid IN({$uid_list})\");\n\t\t\twhile($thread = $db->fetch_array($query))\n\t\t\t{\n\t\t\t\t$moderation->delete_thread($thread['tid']);\n\t\t\t}\n\n\t\t\t// Posts\n\t\t\t$query = $db->simple_select(\"posts\", \"pid\", \"uid IN({$uid_list})\");\n\t\t\twhile($post = $db->fetch_array($query))\n\t\t\t{\n\t\t\t\t$moderation->delete_post($post['pid']);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// We're just updating the UID\n\t\t\t$db->update_query(\"posts\", array('uid' => 0), \"uid IN({$uid_list})\");\n\t\t}\n\n\t\t// Update forum stats\n\t\tupdate_stats(array('numusers' => '-'.intval($num_deleted)));\n\t\t\n\t\t$cache->update_moderators();\n\t\t$cache->update_banned();\n\t}\n\t\n\tadd_task_log($task, $lang->task_userpruning_ran);\n}",
"public function cleanUpUserInvitesTable(){\n\t\t\n\t\tif (Cache::has( env('ENVIRONMENT') .'_'. 'is_cron_cleanUpUserInvitesTable')) {\n \t\t\n \t\t$cron = Cache::get( env('ENVIRONMENT') .'_'. 'is_cron_cleanUpUserInvitesTable');\n\n \t\tif ($cron == 'in_progress') {\n \t\t\treturn \"a cron is already running\";\n \t\t}\n \t}\n\n \tCache::put( env('ENVIRONMENT') .'_'. 'is_cron_cleanUpUserInvitesTable', 'in_progress', 10);\n\n\t\t$rbe = new RoleBaseEmail;\n\t\t$qry = DB::connection('bk')->table('users_invites')\n\t\t\t\t\t\t\t\t ->where('source', '!=', 'Mobile App')\n\t\t\t\t\t\t\t\t ->where('is_dup', 0)\n\t\t\t\t\t\t\t\t ->groupBy('invite_email')\n\t\t\t\t\t\t\t\t ->having('cnt', '>', 1)\n\t\t\t\t\t\t\t\t ->orderBy('cnt', 'DESC')\n\t\t\t\t\t\t\t\t ->select(DB::raw(\"count(invite_email) as cnt\"), 'invite_email as email')\n\t\t\t\t\t\t\t\t ->orderBy(DB::raw(\"RAND()\"))\n\t\t\t\t\t\t\t\t ->take(1000)\n\t\t\t\t\t\t\t\t ->get();\n\n\t\tforeach ($qry as $key) {\n\t\t\t$is_role_base = $rbe->isRoleBase($key->email);\n\t\t\tif ($is_role_base) {\n\t\t\t\tUsersInvite::where('invite_email', $key->email)->delete();\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$inner = UsersInvite::where('invite_email', $key->email)->get();\n\n\t\t\t$check = false;\n\t\t\tforeach ($inner as $k) {\n\t\t\t\tif (!isset($temp_k)) {\n\t\t\t\t\t$temp_k = $k;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$ac = AdClick::on('bk')->where('user_invite_id', $k->id)->first();\n\t\t\t\tif (!isset($ac)) {\n\t\t\t\t\t$k->is_dup = 1;\n\t\t\t\t\t$k->save();\n\t\t\t\t}elseif(!$check){\n\t\t\t\t\t$temp_k->is_dup = 1;\n\t\t\t\t\t$temp_k->save();\n\n\t\t\t\t\t$temp_k = $k;\n\t\t\t\t\t$check = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tCache::put( env('ENVIRONMENT') .'_'. 'is_cron_cleanUpUserInvitesTable', 'done', 10);\n\n\t\treturn \"success\";\n\t}",
"function removeUnusedTasks(){\n\tglobal $vc;\n\treturn mysqli_query($vc,\"DELETE FROM VolunteerTask WHERE TaskID NOT IN(SELECT DISTINCT TaskID FROM volunteerlog);\")!=false;\n}",
"public function remove()\n {\n// campaign name for every board that was contained in the booking with NULL\n// NOT WORKING - the problem are the querries that use foreach on variables containing sql query results\n\n if (empty($_POST)) {\n $_POST = json_decode(file_get_contents(\"php://input\"), true);\n }\n\n// dd($_POST);\n// App::get('database')->delete('posts', $_GET['id']);\n// ['íd' => 12]\n\n\n $boards = App::get('database')->getOneByField('boards', ['çampaign_name', $_POST['name']]);\n if (is_array($boards) || is_object($boards)) {\n foreach ($boards as $board){\n App::get('database')->update('boards', [\n 'id' => $board['id'],\n 'campaign_name' => NULL,\n ]);\n }\n }\n\n App::get('database')->delete('campaigns', $_POST['id']);\n\n $bookings = App::get('database')->getOneByField('bookings', ['çampaign_id', $_POST['id']]);\n foreach ((array)$bookings as $booking){\n App::get('database')->delete('bookings', $booking);\n }\n\n\n\n\n\n}",
"public static function schedule_cleanup_temp_users() {\n\t\tglobal $wpdb;\n\t\t$query = $wpdb->prepare(\n\t\t\t\"\n\t\t\tSELECT user_id\n\t\t\tFROM {$wpdb->prefix}learnpress_user_items c\n\t\t\tINNER JOIN {$wpdb->prefix}learnpress_user_itemmeta d ON c.user_item_id = d.learnpress_user_item_id AND d.meta_key = %s\n\t\t\tINNER JOIN {$wpdb->prefix}learnpress_user_itemmeta e ON c.user_item_id = e.learnpress_user_item_id AND e.meta_key = %s AND e.meta_value < TIMESTAMPADD(SECOND, %d, NOW())\n\t\t\",\n\t\t\t'temp_user_id',\n\t\t\t'temp_user_time',\n\t\t\tself::$_guest_transient\n\t\t);\n\n\t\tif ( $uids = $wpdb->get_col( $query ) ) {\n\t\t\t$query = $wpdb->prepare(\n\t\t\t\t\"\n\t\t\t\tDELETE a.*, b.*\n\t\t\t\tFROM {$wpdb->prefix}learnpress_user_items a\n\t\t\t\tINNER JOIN {$wpdb->prefix}learnpress_user_itemmeta b\n\t\t\t\tWHERE %d\n\t\t\t\tAND a.user_item_id = b.learnpress_user_item_id\n\t\t\t\tAND a.user_id IN (\" . join( ',', $uids ) . ')\n\t\t\t',\n\t\t\t\t1\n\t\t\t);\n\t\t\t$wpdb->query( $query );\n\t\t}\n\t}",
"private function fetchUidsToCheck() {\n // We want to query Drupal accounts, which are LDAP associated where a DN\n // is present. The lastUidChecked is used to process only a limited number\n // of batches in the cron run and each user is only checked if the time\n // configured for checking has lapsed.\n $lastUidChecked = $this->state->get('ldap_user_cron_last_uid_checked', 1);\n\n $query = $this->entityTypeManager->getStorage('user')->getQuery()\n ->exists('ldap_user_current_dn')\n ->exists('ldap_user_puid_property')\n ->exists('ldap_user_puid_sid')\n ->exists('ldap_user_puid')\n ->condition('uid', $lastUidChecked, '>')\n ->condition('status', 1)\n ->sort('uid', 'ASC')\n ->range(0, $this->configLdapUser->get('orphanedCheckQty'));\n\n $group = $query->orConditionGroup();\n $group->notExists('ldap_user_last_checked');\n\n switch ($this->configLdapUser->get('orphanedAccountCheckInterval')) {\n case 'always':\n $group->condition('ldap_user_last_checked', time(), '<');\n break;\n\n case 'daily':\n $group->condition('ldap_user_last_checked', strtotime('today'), '<');\n break;\n\n case 'weekly':\n default:\n $group->condition('ldap_user_last_checked', strtotime('today - 7 days'), '<');\n break;\n\n case 'monthly':\n $group->condition('ldap_user_last_checked', strtotime('today - 30 days'), '<');\n break;\n }\n $query->condition($group);\n $uids = $query->execute();\n\n if (count($uids) < $this->configLdapUser->get('orphanedCheckQty')) {\n $this->state->set('ldap_user_cron_last_uid_checked', 1);\n }\n else {\n $this->state->set('ldap_user_cron_last_uid_checked', max($uids));\n }\n\n return $uids;\n }",
"public function execute()\n {\n $date = (new \\DateTime('-1 week'))->format(DateTime::DATETIME_PHP_FORMAT);\n $jobs = $this->collectionFactory->create()\n ->addFieldToFilter('scheduled_at', [\n 'or' => [\n ['date' => true, 'to' => $date],\n ['null' => true],\n ]\n ])\n ->addFieldToFilter('created_at', [\n ['date' => true, 'to' => $date]\n ])\n ->setOrder('created_at', 'ASC')\n ->setPageSize(250);\n\n $itemsToRemove = $jobs->count() - 50;\n\n foreach ($jobs as $job) {\n if ($itemsToRemove-- < 0) {\n break;\n }\n\n $job->delete();\n }\n }",
"public function runExists() {\r\n $db = static::getDB();\r\n $stmt = $db->query(\r\n \"SELECT * FROM runboard \"\r\n . \"WHERE fromStore='$this->fromStore' \"\r\n . \"AND toStore='$this->toStore' \"\r\n . \"AND category='$this->category' \"\r\n . \"AND item='$this->item' \"\r\n );\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n \r\n return $results;\r\n }",
"public function existenceCheck() {\n\t\t$packages = $this->Package->find('all', array(\n\t\t\t'contain' => array('Maintainer' => array('id', 'username')),\n\t\t\t'fields' => array('id', 'name'),\n\t\t\t'order' => array('Package.id ASC')\n\t\t));\n\n\t\t$jobs = array();\n\t\t$this->out(sprintf(__('* %d records to process'), count($packages)));\n\t\tforeach ($packages as $package) {\n\t\t\t$jobs[] = new PackageExistsJob($package);\n\t\t}\n\n\t\tif (!empty($jobs)) {\n\t\t\t$this->CakeDjjob->bulkEnqueue($jobs, 'default');\n\t\t}\n\n\t\t$this->out(sprintf(__('* Enqueued %d jobs'), count($jobs)));\n\t}",
"function addRemovePortsUser($smarty, $module_name, $local_templates_dir, $pDB, $arrConf)\n{\n $pACL = new paloACL($arrConf['elastix_dsn']['acl']);\n $id_user = getParameter('id_user');\n $userlist = $pACL->getUsers();\n $cbo_users = array();\n foreach ($userlist as $userinfo) {\n \t$cbo_users[$userinfo[0]] = $userinfo[1].' - '.$userinfo[2];\n }\n \n // Verificar si el usuario existe\n if (!is_null($id_user)) {\n \tif (!isset($cbo_users[$id_user])) {\n Header(\"Location: ?menu=$module_name\");\n \t\treturn NULL;\n \t}\n } else {\n \t$id_user = $userlist[0][0];\n }\n \n $ps = new paloSantoPortService($pDB);\n $pk = new paloSantoPortKnockUsers($pDB);\n\n // Construir lista de puertos autorizados\n $userauth = $pk->listAuthorizationsForUser($id_user);\n $portauths = array();\n if (is_array($userauth)) foreach ($userauth as $auth) {\n $portauths[$auth['id_port']] = $auth['id'];\n }\n\n $portlist = $ps->ObtainPuertos($ps->ObtainNumPuertos('', ''), 0, '', '');\n $listaIdPuertos = array();\n foreach ($portlist as $portinfo) $listaIdPuertos[] = $portinfo['id'];\n \n if (isset($_POST['apply']) && is_array($_POST['auth_port'])) {\n \t// Se requiere aplicar lista de cambios\n $listaNuevosPuertos = array_keys($_POST['auth_port']);\n $bReglasBorradas = FALSE;\n \n // Borrar la autorización de todos los puertos que ya no aparecen\n $bExito = TRUE;\n foreach ($portauths as $id_port => $id_auth) {\n \tif (!in_array($id_port, $listaNuevosPuertos)) {\n \t\tif (!$pk->deleteAuthorization($id_auth)) {\n $smarty->assign(\"mb_title\", _tr(\"ERROR\"));\n $smarty->assign(\"mb_message\", $pk->errMsg);\n \t\t\t$bExito = FALSE;\n break;\n \t\t} else {\n \t\t\tunset($portauths[$id_port]);\n $bReglasBorradas = TRUE;\n \t\t}\n \t}\n }\n if (!$bExito) break;\n \n // Ingresar la autorización de los puertos nuevos\n foreach ($listaNuevosPuertos as $id_port) {\n \tif (in_array($id_port, $listaIdPuertos) && !isset($portauths[$id_port])) {\n \t\t$id_nueva_auth = $pk->insertAuthorization($id_user, $id_port);\n if (is_null($id_nueva_auth)) {\n $smarty->assign(\"mb_title\", _tr(\"ERROR\"));\n $smarty->assign(\"mb_message\", $pk->errMsg);\n $bExito = FALSE;\n break;\n \t\t} else {\n \t\t\t$portauths[$id_port] = $id_nueva_auth;\n \t\t}\n \t}\n }\n \n if ($bExito) {\n if ($bReglasBorradas) {\n // Ejecutar iptables para revocar las reglas del usuario\n require_once \"modules/sec_rules/libs/paloSantoRules.class.php\";\n $pr = new paloSantoRules($pDB);\n $pr->activateRules();\n }\n \tHeader(\"Location: ?menu=$module_name\");\n return NULL;\n }\n }\n \n $data = array();\n if (is_array($portlist)) { \n foreach($portlist as $portinfo){\n $id_port = $portinfo['id'];\n \n $protocol_details = '';\n switch ($portinfo['protocol']) {\n case 'TCP':\n case 'UDP':\n $protocol_details = ((stripos($portinfo['details'], ':') === false ) \n ? _tr('Port') : _tr('Ports')).\n ' '.$portinfo['details'];\n break;\n case 'ICMP':\n $arr = explode(':', $portinfo['details']);\n if(isset($arr[1]))\n $protocol_details = _tr('Type').\": \".$arr[0].\" \"._tr('Code').\": \".$arr[1];\n break;\n default:\n $protocol_details = _tr('Protocol Number').': '.$portinfo['details'];\n break;\n }\n $data[] = array(\n \"<input type=\\\"checkbox\\\" name=\\\"auth_port[$id_port]\\\" \".\n (isset($portauths[$id_port]) ? 'checked=\"checked\"' : '').' />',\n htmlentities($portinfo['name'], ENT_COMPAT, 'UTF-8'),\n htmlentities($portinfo['protocol'], ENT_COMPAT, 'UTF-8'),\n $protocol_details,\n );\n }\n }\n\n $oGrid = new paloSantoGrid($smarty);\n $oGrid->setTitle(_tr('Add/remove ports for user'));\n $oGrid->setColumns(array('', _tr('Port'), _tr('Protocol'), _tr('Details')));\n $oGrid->addSubmitAction('apply', _tr('Apply changes'), \"modules/$module_name/images/Check.png\");\n $oGrid->addComboAction('id_user', _tr('User'), $cbo_users, $id_user, 'refresh', 'submit();');\n\t\n // Construcción de la vista de puertos autorizados\n $oGrid->pagingShow(false);\n $url = array(\n \"menu\" => $module_name,\n ); \n $oGrid->setURL($url);\n $oGrid->setData($data);\n return $oGrid->fetchGrid();\n}",
"function purgeUsers() {\r\n\t\t$query = ' delete from #__rubriestav_user where idjusers not in (select id from #__users) ';\r\n\t\t$this->_db->setQuery ( $query );\r\n\t\tif (! $this->_db->query ()) {\r\n\t\t\t$this->setError ( $this->_db->getErrorMsg () );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"function remove_existing(){\n $db = DB::connect(DB_CONNECTION_STRING);\n \n $sql = \"delete from user \n where postcode = \" . $db->quote($this->postcode) . \"\n and email = \" . $db->quote($this->email) .\"\n and user_id <> \" . $db->quote($this->user_id);\n $db->query($sql); \n }",
"function _cleanup_all_stats () {\n\t\tif (!$this->STATS_ENABLED || !$this->ENABLE_REFRESH_STATS) {\n\t\t\treturn false;\n\t\t}\n\t\tdb()->query(\"TRUNCATE TABLE \".db('user_stats').\"\");\n\t}",
"public function purge()\n {\n //modify query\n $query = $this->getConnection()->newQuery();\n $query = $query->delete($this->getTable());\n\n //these are the potential workers that exist, base on name of PHP executable.\n $phpExeName = \"php.exe\";\n $cmd = __(\"tasklist | find \\\"{0}\\\" 2>&1\", $phpExeName);\n exec($cmd, $out, $ret);\n $string = implode(\" \", $out);\n $string = str_replace(\" 0 \", \"\", $string);\n preg_match_all('!\\d+\\.*\\d*!', $string, $phpCleanedList);\n $phpCleanedList = $phpCleanedList[0];\n\n //clean out workers that are past termination date\n $timeObjCurrent = new FrozenTime();\n\n //create query\n $query = $query->where(\n [\n 'OR' => [\n ['termination_date <=' => $timeObjCurrent->format(\"Y-m-d H:i:s\")],\n ['pid NOT IN' => $phpCleanedList]\n ]\n ]\n );\n\n try {\n $result = $query->rowCountAndClose();\n } catch (\\Throwable $exception) {\n $result = 0;\n }\n\n return $result;\n }",
"public static function prune_tracks() { \n\n\t\t// This prue is always run clears data for playlists that don't have tmp_playlist anymore\n\t\t$sql = \"DELETE FROM tmp_playlist_data USING tmp_playlist_data \" . \n\t\t\t\"LEFT JOIN tmp_playlist ON tmp_playlist_data.tmp_playlist=tmp_playlist.id \" . \n\t\t\t\"WHERE tmp_playlist.id IS NULL\";\n\t\t$db_results = Dba::query($sql);\n\n\t}",
"public static function cleanUp(){\n\t\t$teamSetModule = BeanFactory::newBean('TeamSetModules');\n\t\t//maintain a list of the team set ids we would like to remove\n\t\t$setsToRemove = array();\n\t\t$setsToKeep = array();\n\n $conn = DBManagerFactory::getConnection();\n\n $query = 'SELECT team_set_id, module_table_name FROM team_sets_modules WHERE team_sets_modules.deleted = 0';\n $stmt = $conn->executeQuery($query);\n\n while (($tsmRow = $stmt->fetch())) {\n\t\t\t//pull off the team_set_id and module and run a query to see if we find if the module is still using this team_set\n\t\t\t//of course we have to be careful not to remove a set before we have gone through all of the modules containing that\n\t\t\t//set otherwise.\n\t\t\t$module_table_name = $tsmRow['module_table_name'];\n\t\t\t$team_set_id = $tsmRow['team_set_id'];\n\t\t\t//if we have a user_preferences table then we do not need to check the db.\n\t\t\t$pos = strpos($module_table_name, 'user_preferences');\n\t\t\tif ($pos !== false) {\n\t\t\t\t$tokens = explode('-', $module_table_name);\n\t\t\t\tif(count($tokens) >= 3){\n\t\t\t\t\t//we did find that this team_set was going to be removed from user_preferences\n $query = 'SELECT contents FROM user_preferences WHERE category = ? AND deleted = 0';\n $prefStmt = $conn->executeQuery($query, array($tokens[1]));\n\n while (($userPrefRow = $prefStmt->fetch())) {\n\t\t\t\t\t\t$prefs = unserialize(base64_decode($userPrefRow['contents']));\n\t\t\t\t\t\t$team_set_id = SugarArray::staticGet($prefs, implode('.', array_slice($tokens, 2)));\n\t\t\t\t\t\tif(!empty($team_set_id)){\n\t\t\t\t\t\t\t//this is the team set id that is being used in user preferences we have to be sure to not remove it.\n\t\t\t\t\t\t\t$setsToKeep[$team_set_id] = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}//end while\n\t\t\t\t}//fi\n\t\t\t}else{\n $moduleRecordsExist = self::doesRecordWithTeamSetExist($module_table_name, $team_set_id);\n \n if ($moduleRecordsExist) {\n $setsToKeep[$team_set_id] = true;\n } else {\n $setsToRemove[$team_set_id] = true;\n }\n\t\t\t}\n\t\t}\n\n\t\t//compute the difference between the sets that have been designated to remain and those set to remove\n\t\t$arrayDiff = array_diff_key($setsToRemove, $setsToKeep);\n\n\t\t//now we have our list of team_set_ids we would like to remove, let's go ahead and do it and remember\n\t\t//to update the TeamSetModule table.\n\t\tforeach($arrayDiff as $team_set_id => $key){\n //1) remove from team_sets_teams\n $conn->delete('team_sets_teams', array(\n 'team_set_id' => $team_set_id,\n ));\n\n //2) remove from team_sets\n $conn->delete('team_sets', array(\n 'id' => $team_set_id,\n ));\n\n //3) remove from team_sets_modules\n $conn->delete($teamSetModule->table_name, array(\n 'team_set_id' => $team_set_id,\n ));\n\t\t}\n\n\t\t//clear out the cache\n\t\tself::flushBackendCache();\n\t}",
"function cleanUpOrphanedSubscriptions() {\n $existing_user_ids = DB::executeFirstColumn(\"SELECT id FROM \" . TABLE_PREFIX . \"users\");\n if (is_foreachable($existing_user_ids)) {\n try {\n DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"subscriptions WHERE user_id NOT IN (?)\", $existing_user_ids);\n } catch (Exception $e) {\n return $e->getMessage();\n } // try\n } // if - actually, else should die('your aC is WRONG!')\n\n return true;\n }",
"public function dellogbyapp() {\n \t\ttry \n \t\t{\n \t\t\t// select mongoDB collection\n \t\t\t$app_collection = \t$this->mongo_db->db->used;\n\t\t\t// preparing data\n \t\t\t$prepare_data \t= \tarray(\n \t\t\t\t'use_appid' \t=> \t$this->use_appid\n \t\t\t\t);\n\t\t\t// delete to database\n \t\t\t$app_collection->remove($prepare_data);\n \t\t\treturn true;\n \t\t} \n \t\tcatch (Exception $e) \n \t\t{\n \t\t\treturn false;\n \t\t}\n \t}",
"public function purgeDataCache() \r\n\t{\r\n\t\tglobal $status;\r\n\t\t// If project is not archive/inactive status, then return false\r\n\t\tif ($status <= 1) return false;\r\n\t\t// Remove all records in mapping_records table\r\n\t\t$sql = \"delete from redcap_ddp_records where project_id = \" . $this->project_id;\r\n\t\treturn (db_query($sql));\r\n\t}",
"function cleanOnline(){\nglobal $XUSER, $SERVER, $ROOMS;\n$q = DoQuery(\"SELECT * FROM $SERVER[TBL_PREFIX]online\");\nwhile($row = Do_Fetch_Row($q)){\nif($row[4] <= $SERVER['EXP_ONLINE']){\nforceexit($row[3],$row[1]);\nDoQuery(\"DELETE FROM $SERVER[TBL_PREFIX]online WHERE id=$row[0]\");\n}\n}\n}",
"public static function prune_playlists() { \n\n\t\t/* Just delete if no matching session row */\n\t\t$sql = \"DELETE FROM `tmp_playlist` USING `tmp_playlist` \" . \n\t\t\t\"LEFT JOIN session ON session.id=tmp_playlist.session \" . \n\t\t\t\"WHERE session.id IS NULL AND tmp_playlist.type != 'vote'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\treturn true;\n\n\t}",
"public function run() {\n DB::table('users')->delete();\n\n $users = array(\n ['id' => '109301', \"last_name\" => \"fernandez\", \"first_name\" => \"wilhelm\", \"password\" => Hash::make(\"pawie2062\"), \"department\" => \"purchasing\", \"job_title\" => \"manager\"],\n ['id' => '109302', \"last_name\" => \"martinez\", \"first_name\" => \"edward\", \"password\" => Hash::make(\"pawie2062\"), \"department\" => \"sales\", \"job_title\" => \"manager\"],\n ['id' => '109303', \"last_name\" => \"kau\", \"first_name\" => \"janine\", \"password\" => Hash::make(\"pawie2062\"), \"department\" => \"production\", \"job_title\" => \"manager\"],\n ['id' => '109304', \"last_name\" => \"untalan\", \"first_name\" => \"kier\", \"password\" => Hash::make(\"pawie2062\"), \"department\" => \"billing\", \"job_title\" => \"manager\"],\n ['id' => '109305', \"last_name\" => \"espenesin\", \"first_name\" => \"espenesin\", \"password\" => Hash::make(\"pawie2062\"), \"department\" => \"delivery\", \"job_title\" => \"manager\"],\n ['id' => '109306', \"last_name\" => \"martinez\", \"first_name\" => \"wilhelm\", \"password\" => Hash::make(\"pawie2062\"), \"department\" => \"admin\", \"job_title\" => \"staff\"],\n ['id' => '109307', \"last_name\" => \"kenny\", \"first_name\" => \"rogers\", \"password\" => Hash::make(\"pawie2062\"), \"department\" => \"warehousing\", \"job_title\" => \"staff\"],\n ['id' => '109308', \"last_name\" => \"mcdonald\", \"first_name\" => \"ronald\", \"password\" => Hash::make(\"pawie2062\"), \"department\" => \"management\", \"job_title\" => \"manager\"]\n );\n\n // Uncomment the below to run the seeder\n DB::table('users')->insert($users);\n }",
"function db_backend_prune($db)\n\t{\n\t\t$sql = '\n\t\t\tDELETE FROM\n\t\t\t\tpastes\n\t\t\tWHERE\n\t\t\t\tttl != -1 AND\n\t\t\t\tttl != -100 AND\n\t\t\t\t(EXTRACT(EPOCH FROM now()) - added ) > ttl\n\t\t\t';\n\n\t\t$res = pg_query($db, $sql) or die(\"Failed to execute query '$sql'\");\n\n\t\treturn pg_affected_rows($res);\n\t}",
"function mrbsDelEntry($user, $id, $series, $all)\n{\n\tglobal $tbl_entry, $tbl_repeat;\n\n\t$repeat_id = sql_query1(\"SELECT repeat_id FROM $tbl_entry WHERE id=$id\");\n\tif ($repeat_id < 0)\n\t\treturn 0;\n\t\n\t$sql = \"SELECT create_by, id, entry_type FROM $tbl_entry WHERE \";\n\t\n\tif($series)\n\t\t$sql .= \"repeat_id=$repeat_id\";\n\telse\n\t\t$sql .= \"id=$id\";\n\t\n\t$res = sql_query($sql);\n\t\n\t$removed = 0;\n\t\n\tfor ($i = 0; ($row = sql_row($res, $i)); $i++)\n\t{\n\t\tif(!getWritable($row[0], $user))\n\t\t\tcontinue;\n\t\t\n\t\tif($series && $row[2] == 2 && !$all)\n\t\t\tcontinue;\n\t\t\n\t\tif (sql_command(\"DELETE FROM $tbl_entry WHERE id=\" . $row[1]) > 0)\n\t\t\t$removed++;\n\t}\n\t\n\tif ($repeat_id > 0 &&\n sql_query1(\"SELECT count(*) FROM $tbl_entry WHERE repeat_id=$repeat_id\") == 0)\n\t\tsql_command(\"DELETE FROM $tbl_repeat WHERE id=$repeat_id\");\n\t\n\treturn $removed > 0;\n}",
"function poll_map_function(&$data, $maps) {\n static $poll_user_record_map = array();\n\n $uid_map = $maps[0];\n $poll_map = $maps[1];\n\n $uid = $data['user_id'];\n $pid = $data['pid'];\n unset($data['user_id']);\n unset($data['pid']);\n\n // If user doesnt exist in target, skip this record\n if (!isset($uid_map[$uid]) or !isset($poll_map[$pid])) {\n return false;\n }\n\n $uid = $uid_map[$uid];\n $pid = $poll_map[$pid];\n if (isset($poll_user_record_map[$uid][$pid])) {\n $data['poll_user_record_id'] = $poll_user_record_map[$uid][$pid];\n } else {\n $pum_id = Database::get()->query('INSERT INTO poll_user_record\n SET pid = ?d, uid = ?d', $pid, $uid)->lastInsertID;\n $poll_user_record_map[$uid][$pid] = $pum_id;\n }\n return true;\n}",
"function removeUser( $name ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['users'] as $key => $user) {\n if ($name == $user['name'] || $name == $user['email']) {\n unset($d['users'][$key]);\n $found = true;\n }\n }\n if ($found) {\n audit( \"removeUser done\", $name );\n saveDB( $d );\n }\n }",
"public function clearCOMEndusers()\n {\n $this->collCOMEndusers = null; // important to set this to NULL since that means it is uninitialized\n }",
"private function removeExpiredCarpools()\n {\n $this->db->query(CaronaDAO::QUERY_SET_EXPIRED_CARPOOLS);\n\n $this->db->execute();\n error_log(\"Erro: \" . $this->db->getError());\n\n }",
"public function dellogbyfunc() {\n \t\ttry {\n \t\t\t// select mongoDB collection\n \t\t\t$func_collection \t= \t$this->mongo_db->db->used;\n\t\t\t// preparing data\n \t\t\t$prepare_data \t\t= \tarray(\n \t\t\t\t'use_funcid' \t=> \t$this->use_funcid\n \t\t\t\t);\n\t\t\t// delete to database\n \t\t\t$func_collection->remove($prepare_data);\n \t\t\treturn true;\n \t\t} \n \t\tcatch (Exception $e) \n \t\t{\n \t\t\treturn false;\n \t\t}\n \t}",
"function do_remove_assign_user() {\r\n foreach(array(\"stream_id\",\"userid\") as $i)\r\n $$i=$this->input->post($i);\r\n $this->db->query(\"delete from `m_stream_users` where `stream_id`=? and `user_id`=?\",array($stream_id,$userid));\r\n }"
]
| [
"0.5591352",
"0.5409953",
"0.5217706",
"0.5136757",
"0.51057947",
"0.5058188",
"0.501881",
"0.5016441",
"0.50147295",
"0.50093883",
"0.49996528",
"0.49853158",
"0.49346995",
"0.49308184",
"0.49252576",
"0.49002358",
"0.48571712",
"0.4852627",
"0.4843813",
"0.48405898",
"0.48141912",
"0.48049372",
"0.47966313",
"0.4753565",
"0.47344428",
"0.4725447",
"0.47185054",
"0.47091085",
"0.4689427",
"0.46873394"
]
| 0.57251126 | 0 |
Creates a new BugReport model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new BugReport();
$uploadForm = new UploadForm();
$model->reporter_id = Yii::$app->user->id;
$model->status = '1';
if ($model->load(Yii::$app->request->post()) && $model->save()) {
Yii::$app->session->setFlash('success', 'Yeah! It is! Bug №' . $model->bug_id . ' was added successfully!');
return $this->redirect(['bug-report/index', 'id' => $model->project_id]);
}
return $this->render('create', [
'model' => $model,
'uploadForm' => $uploadForm,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new QuestionReported();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new ReportTrackingHistory();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->tbs_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}",
"public function actionCreate()\n {\n $model = new RefJkel();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n return view('bug.create');\n }",
"public function actionCreate()\n {\n $model = new Tickets();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n\t $model=new ReportFinancial;\n\t\n\t // Uncomment the following line if AJAX validation is needed\n\t // $this->performAjaxValidation($model);\n\t \n// \t $store = array(91, 104, 105, 106, 112, 115, 120, 121, 122, 124, 147);\n// \t for($i=2; $i <300; $i++){\n// \t $model=new ReportFinancial;\n// \t $model->store_id = $store[array_rand($store)];\n// \t $model->order_id = $i;\n// \t $model->value = rand(100, 10000);\n// \t $model->charge = rand(100, 10000);\n// \t $model->date = date('Y-m-d',rand(time() - 12*30*24*60*60, time()));\n// \t $model->status = rand(0, 1);\n// \t $model->save();\n// \t }\n\t\n\t if(isset($_POST['ReportFinancial']))\n\t {\n\t $model->attributes=$_POST['ReportFinancial'];\n\t if($model->save())\n\t $this->redirect(array('index'));\n\t }\n\t\n\t $this->render('create',array(\n\t 'model'=>$model,\n\t ));\n\t}",
"public function actionCreate()\n {\n $model = new IssueAssign();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function store(BugReportRequest $request)\n {\n $bug = new Bug();\n\n $bug->level = $request->input('level');\n $bug->title = $request->input('title');\n $bug->page = $request->input('page');\n $bug->detail = $request->input('detail', 'NULL');\n\n $bug->save();\n\n return redirect()->route('bug.list');\n }",
"public\n function actionCreate()\n {\n $model = new Phforum();\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 actionCreate()\n {\n $model = new Submission();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->AssignmentSubmissionID]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Comment;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Comment']))\n\t\t{\n $model->attributes=$_POST['Comment'];\n\t\t\n \n if($model->save()){\n $dataProvider=new CActiveDataProvider('Comment');\n\t\t\t$this->redirect(array('index'),array(\n 'dataProvider'=>$dataProvider,\n 'updated'=>'1',\n 'message'=>\"Comentario introducido\"\n ));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate()\n {\n \t /** @var ActiveRecord $model */\n \t $modelClass = static::modelClass();\n \t $model = new $modelClass();\n\n\t$viewFolder = '/';\n\t$viewName = 'create';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\t\n\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t$this->processData($model, 'create');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }",
"public function actionCreate()\n {\n $model = new Contact();\n $model->user_id = $this->user->id;\n $model->scenario = 'form';\n\n if (Yii::$app->request->isPost && ($postData = Yii::$app->request->post()) && $model->load($postData)) {\n if ($model->save()) {\n return $this->redirect([\n 'view',\n 'id' => $model->id,\n ]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new Test();\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 actionCreate($id)\n {\n $model = new Reporte();\n $model->reportador_id = Yii::$app->user->id;\n $model->reportado_id = Publicacion::findOne($id)->usuario->id;\n $model->publicacion_id = $id;\n\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 actionCreate()\n {\n $model = new PreForumBoard();\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 actionCreate()\n\t{\n\t\t$model = new Post;\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save())\n\t\t{\n\t\t\treturn $this->redirect(['site/index']);\n\t\t}\n\t\t\n\t\techo $this->render('create', array(\n\t\t\t'model' => $model\n\t\t));\n\t}",
"public function actionCreate() {\n $model = new Comment;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Comment'])) {\n $model->attributes = $_POST['Comment'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function actionCreate()\n {\n $model = new Notification();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->notification_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new Surveys();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->validate() == TRUE) {\n // print_r($model);\n $model->save();\n Yii::$app->session->setFlash('success', \"Poll Created Succsesfully\");\n\n return $this->redirect('create');\n } else {\n $sessions = Yii::$app->session->set(\"Error\", \"Error when creating Survey\");\n }\n //print_r($model);\n //return $this->redirect(['view', 'id' => $model->survey_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Clearanceentries();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect([\n 'view', \n 'Clear By ID' => $model['Clear By ID'], \n 'Clearance Level Code' => $model['Clearance Level Code'], \n 'Department' => $model->Department, \n 'Student ID' => $model['Student ID']\n ]);\n } else {\n return $this->render('create', [ 'model' => $model ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new Survey();\n\n Yii::$app->gon->send('saveSurveyUrl', '/survey/save-new');\n Yii::$app->gon->send('afterSaveSurveyRedirectUrl', \\Yii::$app->request->referrer);\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 actionCreate() {\n $model = new ReserveCarReport();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->year = $model->year - 543;\n $model->created_by = Yii::$app->user->id;\n $del = ReserveCarReport::findOne(['month' => $model->month, 'year' => $model->year]);\n if ($del)\n $del->delete();\n\n $model->data = $this->getData($model->month, $model->year);\n if ($model->save()) {\n return $this->redirect(['view', 'month' => $model->month, 'year' => $model->year]);\n } else {\n print_r($model->getErrors());\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $this->layout = 'headbar';\n $model = new ContactOne();\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $dataProvider = new ActiveDataProvider([\n 'query' => ContactOne::find(),\n 'pagination' => [\n 'pageSize' => 20,\n ],\n ]);\n //return $this->redirect(['view', 'id' => $model->id]);\n\n return $this->render('view',[\n 'dataProvider' => $dataProvider,\n ]);\n\n\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate()\n {\n $model = new ActivityDetail();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate() {\n $model = new Test();\n\n if ($model->load(Yii::$app->request->post())) {\n $this->dateformat($model, $_POST['Test']);\n $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 actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function create()\n\t{\n\t\tif(Request::ajax())\n\t\t{\n\t\t\treturn $this->_ajax_denied();\n\t\t}\n\t\tif(!Report::canCreate())\n\t\t{\n\t\t\treturn $this->_access_denied();\n\t\t}\n\t\treturn View::make('reports.create');\n\t}"
]
| [
"0.73946154",
"0.7058551",
"0.6842847",
"0.66859794",
"0.66469496",
"0.65679896",
"0.6557802",
"0.65491813",
"0.654231",
"0.6530833",
"0.65050274",
"0.64974046",
"0.64725286",
"0.6394386",
"0.63594764",
"0.63456786",
"0.6344738",
"0.631504",
"0.63115364",
"0.63036555",
"0.6294744",
"0.6289005",
"0.6280526",
"0.62805015",
"0.6278906",
"0.6264605",
"0.6263188",
"0.6255087",
"0.62438965",
"0.62166375"
]
| 0.83399117 | 0 |
Updates an existing BugReport model. If update is successful, the browser will be redirected to the 'view' page. | public function actionUpdate($id)
{
$model = $this->findModel($id);
$bug_report = $this->findModel($id);
$uploadForm = new UploadForm();
if (Yii::$app->request->isPost && $uploadForm->validate())
{
$uploadForm->files = UploadedFile::getInstances($uploadForm, 'files');
if ($uploadForm->upload($bug_report->bug_id))
{
if ($model->load(Yii::$app->request->post()) && $model->save())
{
Yii::$app->session->setFlash('success', 'Yeah! It is! Bug №' . $model->bug_id . ' was updated successfully!');
return $this->redirect(['bug-report/view', 'id' => $model->bug_id]);
}
}
}
return $this->render('update', [
'model' => $model,
'uploadForm' => $uploadForm,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionUpdate($id)\n\t{\n\t $model=$this->loadModel('ReportFinancial',$id);\n\t\n\t // Uncomment the following line if AJAX validation is needed\n\t // $this->performAjaxValidation($model);\n\t\n\t if(isset($_POST['ReportFinancial']))\n\t {\n\t $model->attributes=$_POST['ReportFinancial'];\n\t if($model->save())\n\t $this->redirect(array('index'));\n\t }\n\t\n\t $this->render('update',array(\n\t 'model'=>$model,\n\t ));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Magazine_Issue_Id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function update($id)\n\t{\n\t\t$report = Report::findOrFail($id);\n\t\tReport::setRules('update');\n\t\t$data = Input::all();\n\t\tif(!$report->canUpdate())\n\t\t{\n\t\t\treturn $this->_access_denied();\n\t\t}\n\t\tif(!$report->update($data)) {\n\t\t\treturn $this->_validation_error($report);\n\t\t}\n\t\tif(Request::ajax())\n\t\t{\n\t\t\treturn $report;\n\t\t}\n\t\tSession::remove('_old_input');\n\t\treturn Redirect::action('ReportsController@edit', $id)\n ->with('notification:success', $this->updated_message);\n }",
"public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }",
"public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }",
"public function actionUpdate($id)\n {\n\tif(Yii::$app->user->can('update-card'))\n\t{ \n\t\t$model = $this->findModel($id);\n\t /* return $this->redirect(Url::toRoute(['reportico/mode/execute',\n\t\t\t\t\t\t\t 'project' => 'GlobalPOS', \n\t\t\t\t\t\t\t 'new_reportico_window' => 1,\n\t\t\t\t\t\t\t 'report' => 'KartHareketleri',\n\t\t\t\t\t\t\t\t\t\t\t'target_format'=>'HTML',\n\t\t\t\t\t\t\t\t\t\t\t'MANUAL_KartNo'=>$id,\n\t\t\t\t\t\t\t\t\t\t\t'MANUAL_DateRange_FROMDATE'=>$model->reportStartDate,\n\t\t\t\t\t\t\t\t\t\t\t'MANUAL_DateRange_TODATE'=>$repFinDate]));\n\n\t\n\t\t*/\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t return $this->redirect(['view', 'id' => $model->ID]);\n\t\t} else {\n\t\t return $this->render('update', [\n\t\t 'model' => $model,\n\t\t ]);\n\t\t}\n\t} else throw new ForbiddenHttpException;\n }",
"public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }",
"public function actionUpdate($id)\n\t{\n\t\ttry{\n\t\t\t$model=$this->loadModel($id);\n\t\n\t\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\t// $this->performAjaxValidation($model);\n\t\n\t\t\tif(isset($_POST['Story']))\n\t\t\t{\n\t $model->size_id = $_POST['Story']['size_id'];\n\t $model->sstory_id = $_POST['Story']['sstory_id'];\n\t $model->weight = $_POST['Story']['weight'];\n\t $model->number = $_POST['Story']['number'];\n\t $model->cstory_id = $_POST['Story']['cstory_id'];\n\t $model->description = $_POST['Story']['description'];\n\t $model->modified_in = new CDbExpression('NOW()');\n\t if(!$model->save()){\n\t $transaccion->rollback();\n\t throw new Exception(\"Error al guardar la historia.\".var_dump($model->errors));\n\t }\n\t \n\t $project = $model->pbacklogs[0]->project;\n\t Historical::record(\"Se editó la historia número \".$model->number.\" - \".$model->description.\" - al proyecto \".$project->key.\" - \".$project->name.\".\", \"Story\", $model->id);\n\t $this->redirect(array('project/productbacklog/'.$project->id));\n\t\t\t}\n\t\n\t\t\t$this->render('update',array(\n\t\t\t\t'model'=>$model,\n\t\t\t 'project'=>$model->pbacklogs[0]->project\n\t\t\t));\n\t\t}catch(Exception $e){\n throw new CHttpException(\"de sistema \", $e -> getMessage());\n }\n\t}",
"public function actionUpdate($id)\n {\n $this -> layout = 'blankLayout';\n\n $model = $this->findModel($id);\n\n $model->updated_date = date('Y-m-d H:i:s');\n $model->updated_by = Yii::$app->user->getId(); \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', \"Saved successful\");\n return $this->redirect(Yii::$app->request->referrer);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'update', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}",
"public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view','id' => $model->weid \n\t\t\t] );\n\t\t} else {\n\t\t\treturn $this->render ( 'update', [ \n\t\t\t\t\t'model' => $model \n\t\t\t] );\n\t\t}\n\t}",
"function update_reports($report_id,$params)\r\n {\r\n $this->db->where('report_id',$report_id);\r\n $this->db->update('reports',$params);\r\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['index']);\n }\n else\n {\n //var_dump($model);\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\t\t//print_r(\"update mode\");exit;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n // return $this->redirect(['view', 'id' => $model->id]);\r\n\t\t return $this->redirect(['index']);\r\n }\r\n\r\n return $this->renderAjax('update', [\r\n 'model' => $model,\r\n ]);\r\n }",
"public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->RA_NUM]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $officeCode0 = Offices::find()->all();\n $officeCode0 = ArrayHelper::map($officeCode0,'officeCode','city');\n\n $reportsTo0 = Employees::find()->all();\n $reportsTo0 = ArrayHelper::map($reportsTo0,'reportsTo','firstName');\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->employeeNumber]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'officeCode0' => $officeCode0,\n 'reportsTo0' => $reportsTo0,\n ]);\n }",
"public function actionUpdate($id)\n { \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ref]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()))\n {\n if($model->save())\n return $this->redirect(['view', 'id' => $model->id]);\n else\n var_dump($model->errors); die;\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n\n // p($id);die;\n $model = $this->findModel($id);\n // p($model);die;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $this->layout = 'headbar';\n $model = $this->findModel($id);\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('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n\n {\n\n $model = $this->findModel($id);\n\n\t\t\t\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n\t\t\t\n\n\t\t\tYii::$app->session->setFlash('orders', 'Orders has been updated successfully');\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('update', [\n\n 'model' => $model,\n\n ]);\n\n }\n\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->No_]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function updated(Reports $report)\n {\n\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n $this->layout=\"main\";\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->U_ID]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->kamar_id]);\n // }\n if ($model->load(Yii::$app->request->post())) {\n // Yii::$app->creator->update($model);\n $model->updated_by = Yii::$app->user->identity->username;\n \t $model->updated_date = date(\"Y-m-d\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->kamar_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }"
]
| [
"0.6617921",
"0.6515263",
"0.64337975",
"0.6311418",
"0.6290112",
"0.6205369",
"0.6197445",
"0.61800593",
"0.615928",
"0.6155176",
"0.613179",
"0.61228496",
"0.61156154",
"0.61069065",
"0.6106174",
"0.6081668",
"0.606253",
"0.60460377",
"0.60413337",
"0.60381097",
"0.60375994",
"0.6035126",
"0.6032276",
"0.60178053",
"0.60162437",
"0.6015725",
"0.6003543",
"0.5989428",
"0.59777576",
"0.59723186"
]
| 0.7187363 | 0 |
Finds the BugReport model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = BugReport::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function findModel($id)\n {\n$model = Reports::findOne($id);\n\t\tif ((isset(Yii::$app->params['ADMIN_CLIENT_ID']) and Yii::$app->user->identity->clientID == Yii::$app->params['ADMIN_CLIENT_ID']))\n\t\t{\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\n }",
"protected function findModel($id)\n {\n if (($model = Reports::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n if (($model = MeBackToOfficeReport::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Report::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"protected function findModel($id)\n {\n if (($model = Reporte::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($key)\n {\n if (($model = NotificationsTemplate::find()->andWhere(['key'=>$key])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = LibraryMagazineIssue::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }",
"private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"protected function findModel($id)\n {\n if (($model = ReporteFalla::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=Report::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"protected function findModel($id)\n {\n if (($model = WorksystemContentinfo::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = ReportTrackingHistory::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = IssueAssign::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = QuestionReported::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = Problem::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($ClearByID, $ClearanceLevelCode, $Department, $StudentID)\n {\n if (($model = Clearanceentries::findOne(['Clear By ID' => $ClearByID, 'Clearance Level Code' => $ClearanceLevelCode, 'Department' => $Department, 'Student ID' => $StudentID])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }",
"public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}",
"public function loadModel($id)\n {\n $model = IdeaHeap::model()->findByPk($id);\n\n if ($model === null)\n throw new CHttpException(404);\n return $model;\n }",
"public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }",
"protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}",
"public abstract function find($primary_key, $model);",
"protected function findModel($id)\n {\n if (($model = CompPrep::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id) {\n\t\tif (($model = Notification::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t}\n\n\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t}",
"public function loadModel($id)\n {\n if (($model = Reviews::model()->findByPk($id)) === null) {\n throw new CHttpException(\n 404,\n Yii::t($this->aliasModule, 'Requested page was not found!')\n );\n }\n \n return $model;\n }"
]
| [
"0.67475986",
"0.668901",
"0.66734743",
"0.6667737",
"0.66208297",
"0.6587959",
"0.65289116",
"0.648645",
"0.6485622",
"0.6446085",
"0.64413816",
"0.6437186",
"0.64110476",
"0.63890487",
"0.6385785",
"0.6358107",
"0.6308788",
"0.6292978",
"0.6273828",
"0.6273196",
"0.6251056",
"0.62360513",
"0.6232451",
"0.62295735",
"0.62270015",
"0.6222552",
"0.6218693",
"0.6212019",
"0.621047",
"0.6205696"
]
| 0.72126985 | 0 |
Transform data given by github api into User model | public function transform($data): User
{
if (empty($data)) {
throw new EmptyDataException();
}
$user = new User();
$user->setLogin($this->getArrayValue('login', $data));
$user->setName($this->getArrayValue('name', $data));
$user->setUrl($this->getArrayValue('html_url', $data));
$user->setCompany($this->getArrayValue('company', $data));
$user->setNumOfRepos($this->getArrayValue('public_repos', $data));
$user->setNumOfFollowers($this->getArrayValue('followers', $data));
$user->setNumOfFollowing($this->getArrayValue('following', $data));
$user->setCreatedAt($this->getArrayValue('created_at', $data));
$user->setUpdatedAt($this->getArrayValue('updated_at', $data));
return $user;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function map($data)\n {\n return new User($data['id'], $data['name']);\n }",
"public function transformUsers() {\n $saUsers = $this->kalturaUser->getAll();\n foreach ($saUsers as $key => $saUser){\n /**\n * @var $saUser KalturaUser\n */\n $dwUser = new DwUser();\n $dwUser->setId(\n $this->anonymize->anonymizeUser($saUser->getKalturaUserId())\n );\n $dwUser->setType(\n $this->typeOfUser($saUser->getKalturaUserId())\n );\n $dwUser->setCreatedAt($saUser->created_at);\n $dwUser->setUpdatedAt($saUser->updated_at);\n try{\n $dwUser->save();\n } catch (Exception $e) {\n var_dump($e->getMessage());\n die;\n }\n };\n }",
"public function githubUser(){\n\n\t\tif( ! Session::has('github_access_token') )\n\t\t\treturn Response::make('Unauthorized GitHub access.', 401);\n\n\t\t$token = Session::get('github_access_token');\n\n\t\t$ch = curl_init('https://api.github.com/user');\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array( \"Authorization: token $token\" ));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, 'SWAMP');\n\t\t$response = curl_exec($ch);\n\n\t\t$github_user = json_decode( $response, true );\n\t\t$github_user['email'] = array_key_exists( 'email', $github_user ) ? $github_user['email'] : '';\n\n\t\t$user = array(\n\t\t\t'user_external_id' \t=> $github_user['id'],\n\t\t\t'username' \t\t\t=> $github_user['login'],\n\t\t\t'email' \t\t\t=> $github_user['email']\n\t\t);\n\n\t\treturn $user;\n\t}",
"public function transformItem($data, $api = null) \n\t{\n\t\t$transformer = new UserTransformer();\n\n\t\treturn new User($transformer->transform($data), $api);\n\t}",
"public function toUser($data){\n\t\t\t$this->email=$data['email'];\n\t\t\t$this->password=$data['password'];\n\t\t\t$this->nombre=$data['nombre'];\n\t\t\t$this->apellido=$data['apellido'];\n\t\t}",
"protected function buildUser($userData)\n {\n $user = new User();\n $user->setId($userData['id']);\n $user->setFirstName($userData['first_name']);\n $user->setLastName($userData['last_name']);\n $user->setPassword($userData['password']);\n $user->setPhone($userData['phone']);\n $user->setMail($userData['mail']);\n $user->setBirthdate(($userData['birthdate']) ? $userData['birthdate'] : null);\n $user->setAddressStreet1($userData['address_street_1']);\n $user->setAddressStreet2($userData['address_street_2']);\n $user->setCity($userData['city']);\n $user->setZip($userData['zip']);\n $user->setGender($userData['gender']);\n $user->setPhoto($userData['photo']);\n $user->setSponsor((string)$userData['sponsor_id']);\n $user->setComment($userData['comment']);\n $user->setFailedLogins($userData['failed_logins']);\n $user->setLastSeen(($userData['last_seen']) ? date('c', strtotime($userData['last_seen'])) : null);\n $user->setLastIP($userData['last_ip']);\n $user->setCreatedAt(date('c', strtotime($userData['created_at'])));\n $user->setDeletedAt(($userData['deleted_at']) ? date('c', strtotime($userData['deleted_at'])) : null);\n $user->setUserLevel(($userData['user_level']) ? $userData['user_level'] : '0');\n\n return $user;\n }",
"public static function toUser($data)\n {\n $user = new ForumUser();\n $user->setId((int) Parse::clean($data->id));\n $user->setName(Parse::clean($data->name));\n $user->setEmail(Parse::clean(crypt(\n $data->email,\n $GLOBALS['database']['crypt_salt']\n )));\n $user->setRole(Parse::clean($data->title));\n $user->setRegistered(Parse::clean($data->registered));\n $user->setBanned($data->banned === 't' ? 1:0);\n\n return $user;\n }",
"static function fromVCard($user_data, &$imported_users) {\n $is_new = array_var($user_data, 'is_new') == 'true'; // check whether it's a new user\n\n $password = null;\n\n // create an instance of User class appropriately\n if($is_new) {\n $user = Users::getUserInstance();\n } else {\n $user = Users::findByEmail(array_var($user_data, 'old_email'));\n } // if\n\n $user->setFirstName(array_var($user_data, 'first_name'));\n $user->setLastName(array_var($user_data, 'last_name'));\n $user->setEmail(array_var($user_data, 'email'));\n\n if($is_new) {\n $password = Authentication::getPasswordPolicy()->generatePassword();\n\n $user->setPassword($password);\n $user->setState(STATE_VISIBLE);\n\n if(array_var($user_data, 'updated_on')) {\n $user->setUpdatedOn(DateTimeValue::makeFromString(array_var($user_data, 'updated_on')));\n $user->setUpdatedBy(Authentication::getLoggedUser());\n } // if\n } // if\n\n // Collect imported users for updating object list\n $imported_users[] = array(\n 'is_new' => $is_new,\n 'user' => $user,\n 'password' => $password\n );\n\n return $user;\n }",
"public function hydrateUser (User $user, array $data) {\n $user->setLastNameUser(\"$data[nom]\");\n $user->setFirstNameUser(\"$data[prenom]\");\n $user->setEmailUser(\"$data[email]\");\n $user->setPasswordUser(\"$data[mdp]\");\n $user->setActivateUser(\"$data[actif]\");\n $user->setVisionUser(\"$data[malvoyant]\");\n $user->setStatusUser(\"$data[id_statuts]\");\n $user->setTeamUser(\"$data[id_equipes]\");\n $user->setLanguageUser(\"$data[id_langues]\");\n return $user;\n }",
"abstract protected function mapUserToObject(array $user): User;",
"public static function user() {\n // $userInfo = $oauth2->userinfo->get();\n $userInfo = json_decode(json_encode(['email' => '@', 'gender' => null, 'name' => 'test', 'picture' => 'f']));\n return User::fromGoogleUser($userInfo);\n \n }",
"function getUserArray()\n {\n $userRP = new UserRepository();\n $users = $userRP->getAllUsers();\n $modifedUserList = [];\n foreach ($users as $user) {\n $obj = new User();\n $obj->userFromJson($user[3]);\n $user[1] = $obj;\n $modifedUserList[] = $user;\n }\n return $modifedUserList;\n }",
"public function convert()\n\t{\n\t\tif (isset($this->fb_data['id'])) \n\t\t{\n\t\t\t$this->user->set_facebook_id($this->fb_data['id'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['first_name']))\n\t\t{\n\t\t\t$this->user->set_first_name($this->fb_data['first_name'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['last_name'])) \n\t\t{\n\t\t\t$this->user->set_last_name($this->fb_data['last_name'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['birthday'])) \n\t\t{\n\t\t\t$this->user->set_birthday( (int) strtotime($this->fb_data['birthday']), TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['gender'])) \n\t\t{\n\t\t\t$this->user->set_gender(substr($this->fb_data['gender'], 0, 1), TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['email']))\n\t\t{\n\t\t\t$this->user->set_email($this->fb_data['email'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['timezone']))\n\t\t{\n\t\t\t$this->user->set_timezone( (int) $this->fb_data['timezone'], TRUE);\n\t\t}\n\t\tif (isset($this->fb_data['locale'])) \n\t\t{\n\t\t\t$this->user->set_country_code(substr($this->fb_data['locale'], -2), TRUE);\n\t\t}\n\t\treturn($this);\n\t}",
"public function formatUser()\n {\n if (! $this->user) {\n return [];\n } else {\n return [\n 'uniqueid' => $this->user->user_id,\n 'name' => $this->user->username,\n 'email' => $this->user->email,\n 'photourl' => $this->user->avatar_img_url,\n 'roles' => $this->getMappedRoles(),\n ];\n }\n }",
"public function getUser(): User;",
"public function convert() {\n $this->user->convert();\n }",
"public function getDataForMakeUserMethod(): array\n {\n return [\n 0 => [\n 0 => [\n 'User' => [\n 'toArray' => [\n 'id' => 7,\n 'password' => 3,\n 'name' => 'Bertrand Stracke',\n 'age' => 1,\n 'nickname' => 'http://www.pouros.com/cum-sit-reiciendis-fugiat-fugit-qui-voluptas-quisquam.html',\n 'createdAt' => '2020-03-16T10:44:21+00:00',\n 'updatedAt' => '2020-03-16T09:09:05+00:00',\n ],\n 'sameValueAs' => true,\n 'toNative' => [\n 'id' => 7,\n 'password' => 3,\n 'name' => 'Bertrand Stracke',\n 'age' => 1,\n 'nickname' => 'http://www.pouros.com/cum-sit-reiciendis-fugiat-fugit-qui-voluptas-quisquam.html',\n 'createdAt' => '2020-03-16T10:44:21+00:00',\n 'updatedAt' => '2020-03-16T09:09:05+00:00',\n ],\n 'getId' => [\n 'sameValueAs' => true,\n 'toNative' => 7,\n 'inc' => [\n 'sameValueAs' => true,\n 'toNative' => 2,\n ],\n 'decr' => [\n 'sameValueAs' => true,\n 'toNative' => 2,\n ],\n ],\n\n 'getPassword' => [\n 'sameValueAs' => false,\n 'toNative' => 3,\n 'inc' => [\n 'sameValueAs' => true,\n 'toNative' => 2,\n ],\n 'decr' => [\n 'sameValueAs' => true,\n 'toNative' => 3,\n ],\n ],\n 'getName' => [\n 'toNative' => 'Bertrand Stracke',\n 'sameValueAs' => false,\n 'isEmpty' => false,\n ],\n 'getAge' => [\n 'isActive' => true,\n 'sameValueAs' => true,\n 'toNative' => 5,\n 'inc' => [\n 'sameValueAs' => true,\n 'toNative' => 6,\n ],\n 'decr' => [\n 'sameValueAs' => true,\n 'toNative' => 4,\n ],\n ],\n 'getNickname' => [\n 'toNative' => 'http://www.pouros.com/cum-sit-reiciendis-fugiat-fugit-qui-voluptas-quisquam.html',\n 'sameValueAs' => false,\n 'isEmpty' => false,\n ],\n 'getCreatedAt' => [\n 'toNative' => [\n 'getTimestamp' => '2020-03-16T10:44:21+00:00',\n ],\n ],\n 'getUpdatedAt' => [\n 'toNative' => [\n 'getTimestamp' => '2020-03-16T09:09:05+00:00',\n ],\n 'sameValueAs' => true,\n 'getDate' => [\n 'toNative' => [\n 'getTimestamp' => '08:05:09',\n ],\n ],\n 'getTime' => [\n 'toNative' => [\n 'getTimestamp' => '21:16:27',\n ],\n ],\n 'toNativeDateTime' => [\n 'getTimestamp' => '13:19:08',\n ],\n ],\n 'serialize' => [\n 0 => 'voluptatum',\n 1 => 'maiores',\n 2 => 'dolorum',\n ],\n ],\n ],\n 1 => [\n 'makeUser' => 0,\n ],\n ],\n ];\n }",
"private function normalizeUser($raw)\n {\n $user = array();\n $user['id'] = strval($raw->Name);\n foreach($raw->Attribute as $item)\n {\n $name = (string)$item->Name;\n $value = (string)$item->Value;\n $user[$name] = $value;\n }\n return $user;\n }",
"public function data_user()\n {\n return new Data\\User;\n }",
"protected function buildDomainObject($row) {\n $user = new User();\n $user->setId($row['user_id']);\n $user->setEmail($row['user_email']);\n $user->setLastname($row['user_lastname']);\n $user->setFirstname($row['user_firstname']);\n $user->setPassword($row['user_password']);\n $user->setSalt($row['user_salt']);\n $user->setAddress($row['user_address']);\n $user->setTown($row['user_town']);\n $user->setZipcode($row['user_zipcode']);\n $user->setRole($row['user_role']);\n return $user;\n }",
"function openid_resp_to_user( &$resp )\n{\n $tmp_users = array();\n $user = new stdClass;\n $sreg_resp = Auth_OpenID_SRegResponse::fromSuccessResponse($resp);\n $sreg = $sreg_resp->contents();\n\n if (defined('ADD_AX_SUPPORT'))\n {\n $ax_resp = new Auth_OpenID_AX_FetchResponse();\n $ax = $ax_resp->fromSuccessResponse($resp);\n }\n\n // We'll attempt to use the user's nickname to set their username\n if ( (isset($sreg['nickname']) && !empty($sreg['nickname']) &&\n !($tmp_users['username'] = get_records('user', 'username', addslashes($sreg['nickname'])))) ||\n (defined('USE_EMAIL_FOR_USERNAME') && isset($sreg['email']) && !empty($sreg['email'])\n && !($tmp_users['username_email'] = get_records('user', 'username', $sreg['email'])))\n ) {\n $user->username = addslashes((isset($sreg['nickname']) && !empty($sreg['nickname'])) ? $sreg['nickname'] : $sreg['email']);\n } else\n if (defined('ADD_AX_SUPPORT')\n && ((($nickname = get_ax_data(AX_SCHEMA_NICKNAME, $ax))\n && !($tmp_users['username'] = get_records('user', 'username', addslashes($nickname))))\n || (defined('USE_EMAIL_FOR_USERNAME')\n && ($useremail = get_ax_data(AX_SCHEMA_EMAIL, $ax))\n && !($tmp_users['username_email'] = get_records('user', 'username', $useremail)))\n ) )\n { // better to fall-back to email? may show-up in various display blocks\n $user->username = addslashes($nickname ? $nickname : $useremail);\n }\n // Otherwise, we'll use their openid url - last resort!\n else {\n $user->username = openid_normalize_url_as_username($resp->identity_url);\n }\n\n // SREG fullname\n if (isset($sreg['fullname']) && !empty($sreg['fullname'])) {\n $name = openid_parse_full_name($sreg['fullname']);\n $user->firstname = addslashes($name['first']);\n $user->lastname = addslashes($name['last']);\n } else if (defined('ADD_AX_SUPPORT') && (get_ax_data(AX_SCHEMA_FULLNAME, $ax) || get_ax_data(AX_SCHEMA_LASTNAME, $ax)) ) {\n if (get_ax_data(AX_SCHEMA_LASTNAME, $ax)) {\n $user->firstname = addslashes(get_ax_data(AX_SCHEMA_FIRSTNAME, $ax));\n $user->lastname = addslashes(get_ax_data(AX_SCHEMA_LASTNAME, $ax));\n } else { // fullname\n $name = openid_parse_full_name(get_ax_data(AX_SCHEMA_FULLNAME, $ax));\n $user->firstname = addslashes($name['first']);\n $user->lastname = addslashes($name['last']);\n }\n }\n\n if (!empty($user->lastname)) {\n $tmp_users['fullname'] = get_records_select('user', \"firstname = '\".$user->firstname.\"' AND lastname = '\".$user->lastname.\"'\");\n }\n\n // SREG email\n if (!empty($sreg['email']) && !($tmp_users['email'] = get_records('user', 'email', $sreg['email']))) {\n $user->email = addslashes($sreg['email']);\n } else if (defined('ADD_AX_SUPPORT') && ($useremail = get_ax_data(AX_SCHEMA_EMAIL, $ax))\n && !($tmp_users['email'] = get_records('user', 'email', $useremail)) ) {\n $user->email = addslashes($useremail);\n }\n\n // SREG country\n $country = '';\n if (isset($sreg['country']) && !empty($sreg['country'])) {\n $country = $sreg['country'];\n }\n else if (defined('ADD_AX_SUPPORT') && get_ax_data(AX_SCHEMA_COUNTRY, $ax)) {\n $country = get_ax_data(AX_SCHEMA_COUNTRY, $ax);\n }\n\n if (!empty($country)) {\n $country_code = strtoupper($country);\n $countries = get_list_of_countries();\n\n if (strlen($country) != 2 || !isset($countries[$country_code])) {\n $countries_keys = array_keys($countries);\n $countries_vals = array_values($countries);\n $country_code = array_search($country, $countries_vals);\n\n if ($country_code > 0) {\n $country_code = $countries_keys[$country_code];\n } else {\n $country_code = '';\n }\n }\n\n if (!empty($country_code)) {\n $user->country = $country_code;\n }\n }\n\n /* We're currently not attempting to get language and timezone values\n // SREG language\n if (isset($sreg['language']) && !empty($sreg['language'])) {\n }\n\n // SREG timezone\n if (isset($sreg['timezone']) && !empty($sreg['timezone'])) {\n }\n */\n\n $config = get_config('auth/openid');\n //error_log(\"/auth/openid/locallib.php::auth/openid::config=...\");\n //err_dump($config);\n\n //error_log(\"/auth/openid/locallib.php::openid_resp_to_user() - check for user matching ...\");\n //err_dump($user);\n\n // Map OpenID fields to whether field MUST be unique\n // TBD: make unique fields configurable im OpenID: auth_config_users.html\n // Keys must match keys in tmp_users[] array - set above.\n $openid_fields = array('email' => 1, // Email field must be unique\n 'fullname' => 0, // ok duplicate fullnames\n 'username' => 0, // ok dup username w/OpenID\n // creates unique username\n 'username_email' => 1 // TBD: No dup username as OpenID email\n );\n foreach($openid_fields as $openid_field => $field_unique) {\n $match_array = str_word_count($config->auth_openid_match_fields, 1, '_');\n $num = !empty($match_array) // && in_array($openid_field, $match_array)\n ? 1 : 0;\n if ($field_unique && !empty($tmp_users[$openid_field]) &&\n count($tmp_users[$openid_field]) > $num)\n {\n //error_log(\"/auth/openid/locallib.php::openid_resp_to_user() - multiple matches on count(tmp_users[{$openid_field}])=\".count($tmp_users[$openid_field]).\" ...\");\n //err_dump($tmp_users[$openid_field]);\n //error_log(\"> match_array=...\");\n //err_dump($match_array);\n return false;\n }\n }\n $matching_user = null;\n // check tmp_users[] matches for valid existing user,\n // return false if conflicts between matching fields\n if (!empty($config->auth_openid_match_fields)) {\n $openid_match_fields = explode(',', $config->auth_openid_match_fields);\n foreach ($openid_match_fields as $match_field) {\n $match_field = trim($match_field);\n if (!empty($tmp_users[$match_field]) &&\n count($tmp_users[$match_field]) == 1)\n {\n if (!$matching_user) {\n $matching_user = reset($tmp_users[$match_field]);\n } else if ($openid_fields[$match_field] &&\n $matching_user->id != reset($tmp_users[$match_field])->id)\n { // unique field matches different user!\n return false;\n }\n }\n }\n }\n if (!empty($matching_user)) {\n merge_user_fields($matching_user, $user);\n //error_log( \"openid_resp_to_user() - merged matching user: \");\n //err_dump($matching_user);\n return $matching_user;\n }\n return $user;\n}",
"function pilau_get_user_with_meta( $id ) {\n\t\t$user = get_userdata( $id );\n\t\tif ( $user ) {\n\t\t\t$user = $user->data;\n\t\t\t$user_meta = get_user_meta( $id );\n\t\t\tforeach ( $user_meta as $user_meta_key => $user_meta_value ) {\n\t\t\t\t$user->{$user_meta_key} = maybe_unserialize( $user_meta_value[0] );\n\t\t\t}\n\t\t}\n\t\treturn $user;\n\t}",
"protected function getUserModel() {\n return new User();\n }",
"static function constructUserFromDB($id){\n $userDetails = getCurrentUserDB($id);\n $userName = $userDetails[1];\n $userEmail = $userDetails[2];\n $userJapanSkill = $userDetails[3]; \n $userEnglishSkill = $userDetails[4];\n $userImageRef = $userDetails[5];\n $userCustomInfo = $userDetails[6];\n $isOrganiser = $userDetails[7];\n $userCreated = $userDetails[8];\n $user = new User($id, $userName, $userEmail, $userJapanSkill, $userEnglishSkill); \n $user->isOrganiser = $isOrganiser;\n $user->userCustomInfo = $userCustomInfo;\n \n if (strlen($userImageRef) > 2) {\n $user->userImageRef = $userImageRef;\n } else {\n $user->userImageRef = \"profiledefault.jpg\";\n }\n \n $user->userCreated = $userCreated;\n return $user;\n }",
"public static function mapFromResult(array $data)\n {\n $formData = [];\n\n if (isset($data['id'])) {\n $formData['id'] = $data['id'];\n $formData['version'] = $data['version'];\n\n $formData['userLoginSecurity']['loginId'] = $data['loginId'];\n $formData['userLoginSecurity']['lastLoggedInOn'] = $data['lastLoggedInOn'];\n $formData['userLoginSecurity']['accountDisabled'] = $data['accountDisabled'];\n\n if (!empty($data['disabledDate'])) {\n $formData['userLoginSecurity']['disabledDate'] = $data['disabledDate'];\n }\n\n if (!empty($data['createdOn'])) {\n $formData['userLoginSecurity']['createdOn'] = $data['createdOn'];\n }\n\n $formData['userLoginSecurity']['locked']\n = !empty($data['lockedOn'])\n ? sprintf(\n 'Yes on %s',\n (new \\DateTime($data['lockedOn']))->format(\\DATETIMESEC_FORMAT)\n )\n : 'No';\n\n if (!empty($data['latestPasswordResetEvent'])) {\n $formData['userLoginSecurity']['passwordLastReset'] = sprintf(\n '%s on %s',\n $data['latestPasswordResetEvent']['eventData'],\n DateTimeHelper::format($data['latestPasswordResetEvent']['eventDatetime'], \\DATETIMESEC_FORMAT)\n );\n }\n\n $formData['userType']['id'] = $data['id'];\n $formData['userType']['userType'] = $data['userType'];\n\n // get the first role from the list (it should be only one)\n $formData['userType']['role']\n = !empty($data['roles']) ? array_shift($data['roles'])['role'] : null;\n\n switch ($data['userType']) {\n case 'internal':\n $formData['userType']['team'] = $data['team']['id'];\n $formData['userSettings']['osType'] = $data['osType'];\n break;\n case 'transport-manager':\n $formData['userType']['currentTransportManager'] = $data['transportManager']['id'];\n\n if (!empty($data['transportManager']['homeCd']['person']['familyName'])) {\n $formData['userType']['currentTransportManagerName']\n = $data['transportManager']['homeCd']['person']['forename']\n .' '.$data['transportManager']['homeCd']['person']['familyName'];\n }\n break;\n case 'partner':\n $formData['userType']['partnerContactDetails'] = $data['partnerContactDetails']['id'];\n break;\n case 'local-authority':\n $formData['userType']['localAuthority'] = $data['localAuthority']['id'];\n break;\n }\n\n $formData['userPersonal']['forename'] = $data['contactDetails']['person']['forename'];\n $formData['userPersonal']['familyName'] = $data['contactDetails']['person']['familyName'];\n $formData['userPersonal']['birthDate'] = $data['contactDetails']['person']['birthDate'];\n\n if (!empty($data['contactDetails']['phoneContacts'])) {\n $formData['userContactDetails']\n = self::mapPhoneFieldsFromResult($data['contactDetails']['phoneContacts']);\n }\n $formData['userContactDetails']['emailAddress'] = $data['contactDetails']['emailAddress'];\n $formData['userContactDetails']['emailConfirm'] = $data['contactDetails']['emailAddress'];\n\n $formData['address'] = $data['contactDetails']['address'];\n\n $formData['userSettings']['translateToWelsh'] = $data['translateToWelsh'];\n }\n\n return $formData;\n }",
"public function mapToEntity(array $data)\n {\n $identity = new Paysera_WalletApi_Entity_User_Identity();\n\n if (isset($data['name'])) {\n $identity->setName($data['name']);\n }\n\n if (isset($data['surname'])) {\n $identity->setSurname($data['surname']);\n }\n\n if (isset($data['nationality'])) {\n $identity->setNationality($data['nationality']);\n }\n\n if (isset($data['code'])) {\n $identity->setCode($data['code']);\n }\n\n return $identity;\n }",
"protected function mapUserToObject(array $user)\n {\n return (new User)->setRaw($user)->map([\n 'id' => $user['CharacterID'],\n 'name' => $user['CharacterName'],\n 'owner_hash' => $user['CharacterOwnerHash'],\n 'avatar' => 'https://image.eveonline.com/Character/' . $user['CharacterID'] . '_128.jpg',\n ]);\n }",
"public static function createUser($data)\r\n\t{\r\n\t\treturn new User($data);\r\n\t}",
"protected function mapUserToObject(array $user)\n {\n return (new User())->setRaw($user)->map([\n 'id' => $user['data']['id'],\n 'nickname' => $user['data']['username'],\n 'name' => $user['data']['name'],\n 'email' => $user['data']['email'],\n 'avatar' => $user['data']['picture'],\n ]);\n }",
"public static function user_from_row($row) {\r\n $result = new User(UserService::get_key($row,\"UserId\"),UserService::get_key($row,\"Email\"),UserService::get_key($row,\"UserType\"));\r\n $result->set_first_name(UserService::get_key($row,\"FirstName\"));\r\n $result->set_last_name(UserService::get_key($row,\"LastName\"));\r\n $result->set_home_phone(UserService::get_key($row,\"HomePhone\"));\r\n $result->set_mobile_phone(UserService::get_key($row,\"MobilePhone\"));\r\n $result->set_address_1(UserService::get_key($row,\"Address1\"));\r\n $result->set_address_2(UserService::get_key($row,\"Address2\"));\r\n $result->set_city(UserService::get_key($row,\"City\"));\r\n $result->set_state(UserService::get_key($row,\"State\"));\r\n $result->set_zip(UserService::get_key($row,\"ZipCode\"));\r\n $result->set_organization_id(UserService::get_key($row,\"OrganizationId\"));\r\n return $result;\r\n }"
]
| [
"0.63042516",
"0.630159",
"0.6164133",
"0.6163404",
"0.6128718",
"0.5994691",
"0.5985183",
"0.5972674",
"0.5839575",
"0.5836916",
"0.5829285",
"0.5823249",
"0.57975006",
"0.5796828",
"0.57466435",
"0.5726406",
"0.5675782",
"0.5675687",
"0.566079",
"0.5651487",
"0.56509715",
"0.56501925",
"0.5619059",
"0.5590067",
"0.5557374",
"0.5554063",
"0.55312467",
"0.5523095",
"0.5522399",
"0.55200213"
]
| 0.7067845 | 0 |
Get accounts A generator function yielding one AccountModel per ID in $accountIds | public function getAccounts()
{
foreach ($this->accountIds as $id) {
// Use a generator to save on memory/resources
// load accounts from DB one at a time only when required
yield (new AccountModel())->load($id);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getAllAccounts(){\n\t\t$stmt = Dbh::connect()->query(\"SELECT * FROM accounts\");\n\t\t$accounts = array();\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){\n $accounts[] = new Account($row['account_id'], $row['email'], $row['first_name'], $row['last_name'], $row['account_type'], $row['password']);\n }\n return $accounts;\n\t}",
"public function accounts()\n {\n $accounts = $this->morphToMany(\n Config::get('laraccount.models.account'),\n 'user',\n Config::get('laraccount.tables.account_user'),\n Config::get('laraccount.foreign_keys.user'),\n Config::get('laraccount.foreign_keys.account')\n );\n return $accounts;\n }",
"public function getAccounts();",
"function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }",
"function getAccounts() {\n $stmt = $this->pdo->query('SELECT * FROM get_accounts()');\n $accounts = [];\n while ($row = $stmt->fetch()) {\n $accounts[] = [\n 'id' => $row['id'],\n 'first_name' => $row['first_name'],\n 'last_name' => $row['last_name'],\n 'plan' => $row['plan'],\n 'effective_date' => $row['effective_date']\n ];\n }\n return $accounts;\n }",
"public function getAccounts(){\n $accounts = [];\n foreach ($this->data['Items'] as $account) {\n $newAccount = [];\n $newAccount['accounting_id'] = IndexSanityCheckHelper::indexSanityCheck('UID', $account);\n $newAccount['code'] = IndexSanityCheckHelper::indexSanityCheck('DisplayID', $account);\n $newAccount['name'] = IndexSanityCheckHelper::indexSanityCheck('Name', $account);\n $newAccount['description'] = IndexSanityCheckHelper::indexSanityCheck('Description', $account);\n $newAccount['type'] = IndexSanityCheckHelper::indexSanityCheck('Type', $account);\n\n if (array_key_exists('Type', $account)) {\n if ($account['Type']) {\n $newAccount['is_bank_account'] = ($account['Type'] === 'Bank');\n }\n }\n\n if (array_key_exists('BankingDetails', $account)) {\n if ($account['BankingDetails']) {\n $newAccount['bank_account_number'] = IndexSanityCheckHelper::indexSanityCheck('BankAccountNumber', $account['BankingDetails']);\n }\n }\n\n if (array_key_exists('TaxCode', $account)) {\n if ($account['TaxCode']) {\n $newAccount['tax_type'] = IndexSanityCheckHelper::indexSanityCheck('Code', $account['TaxCode']);\n }\n }\n array_push($accounts, $newAccount);\n }\n\n return $accounts;\n }",
"public function accounts()\n {\n return $this->hasMany(Account::class, 'account_id');\n }",
"public function getLoginAccounts()\n\t{\n\t\t$conditions = '';\n\t\t$params = [];\n\n\t\t$records = Social_LoginAccountRecord::model()->findAll($conditions, $params);\n\n\t\tif ($records)\n\t\t{\n\t\t\treturn Social_LoginAccountModel::populateModels($records);\n\t\t}\n\t}",
"public function getCandidates()\n {\n foreach ($this->candidates as $id) {\n $this->numOfCandidates++;\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new CandidateModel())->load($id);\n }\n }",
"public function getAccountnumbers()\n {\n return $this->hasMany(AccountNumber::className(), ['company_id' => 'id']);\n }",
"public function getCandidates()\n {\n foreach ($this->cand_ids as $id) {\n // Use a generator to save on memory/resources\n // load accounts from DB one at a time only when required\n yield (new CandidateModel())->load($id);\n }\n }",
"public function all()\n {\n $accounts = $this->walletAccounts()->get()\n ->tap(function ($accounts) use (&$totalAvailablePrice) {\n $totalAvailablePrice = $accounts->sum('available_price');\n })\n ->each(function ($account) use ($totalAvailablePrice) {\n $divisor = $totalAvailablePrice > 0 ? $totalAvailablePrice : 1;\n $quota = ceil(($account->available_price * 100) / $divisor);\n $account->setAttribute('available_price_quota', $quota);\n });\n\n return WalletAccountResource::collection($accounts);\n }",
"public function accounts()\n {\n return $this->belongsToMany(Account::class);\n }",
"public function getAccounts($criteria = null, PropelPDO $con = null)\n {\n $partial = $this->collAccountsPartial && !$this->isNew();\n if (null === $this->collAccounts || null !== $criteria || $partial) {\n if ($this->isNew() && null === $this->collAccounts) {\n // return empty collection\n $this->initAccounts();\n } else {\n $collAccounts = AccountQuery::create(null, $criteria)\n ->filterByYear($this)\n ->find($con);\n if (null !== $criteria) {\n if (false !== $this->collAccountsPartial && count($collAccounts)) {\n $this->initAccounts(false);\n\n foreach ($collAccounts as $obj) {\n if (false == $this->collAccounts->contains($obj)) {\n $this->collAccounts->append($obj);\n }\n }\n\n $this->collAccountsPartial = true;\n }\n\n $collAccounts->getInternalIterator()->rewind();\n\n return $collAccounts;\n }\n\n if ($partial && $this->collAccounts) {\n foreach ($this->collAccounts as $obj) {\n if ($obj->isNew()) {\n $collAccounts[] = $obj;\n }\n }\n }\n\n $this->collAccounts = $collAccounts;\n $this->collAccountsPartial = false;\n }\n }\n\n return $this->collAccounts;\n }",
"public function accounts()\n {\n return $this->hasMany(Account::class);\n }",
"public function accounts()\n {\n return $this->hasMany(Account::class);\n }",
"public function getAccounts()\n {\n return $this->accounts;\n }",
"public function getPlayers(array $accounts): Collection;",
"public function findAll(GoogleAccount $account);",
"public function accounts()\n {\n return $this->belongsToMany('App\\Models\\Account');\n }",
"public function getAccounts()\n\t{\n\t\treturn $this->accounts; \n\n\t}",
"Public Function getAllAccounts()\n\t{\n\t\t$Output = array();\n\t\tforeach($this->GetAllAccountsAdwords() as $Adwords)\n\t\t\t$Output[] = $Adwords;\n\t\tforeach($this->GetAllAccountsYahoo() as $Yahoo)\n\t\t\t$Output[] = $Yahoo;\n\t\tforeach($this->GetAllAccountsMSN() as $MSN)\n\t\t\t$Output[] = $MSN;\n\t\t\t\n\t\treturn $Output;\n\t}",
"private function recordGenerator($results) {\n\n if(empty($results['results'])) {\n return [];\n }\n\n for($i = 0; $i < count($results['results']); $i++) {\n yield $results['results'][$i]['id'];\n }\n }",
"public function listAccountIds() //*\n\t{\n\t$this->errorLogging->logInfo(__CLASS__, __METHOD__, \"Called.\");\n\t\n\t$userGroup = $_SESSION[\"usergroup\"];\n\n\t$select_array = array(\n\t\"table\" => 'accounts', \n\t\"where\" => 'WHERE', \n\t\"columns\" => array(\n\t\"account_pk\",\n\t\"account_name\",),\n\t\"returns\" => array(\n\t\"accountPK\",\n\t\"accountName\"),\n\t\"conditions\" => array(\n\t\tarray(\n\t\t\"column\" => \"user_group\",\n\t\t\"operator\" => \"=\",\n\t\t\"value\" => \"$userGroup\",\n\t\t\"concat\" => \"\")\n\t),\n\t\"endingQuery\" => \"\"\n\t);\n\t\n\t$returnedArray = $this->dbConnection->ConstructSelect($select_array); //errors handled by dbase class\n\t$this->responseClass->apiResponse($returnedArray);\n\treturn true;\n\t}",
"public function getAccounts()\n {\n }",
"public static function accounts() {\n\t\t\treturn self::get('accounts');\n\t\t}",
"public function listAccounts()\n {\n return $this->execute('listaccts', []);\n }",
"public function run()\n {\n $minRecords = 6;\n $maxRecords = 20;\n\n factory(Account::class, rand($minRecords, $maxRecords))->create()->each(function($recordAccount) {\n $except = AccountTableSeeder::getChildAccountRecordsId($recordAccount);\n array_push($except, $recordAccount->id);\n\n if(($id = AccountTableSeeder::randomAccountId($except))) {\n $recordAccount->account_id = $id;\n $recordAccount->save();\n }\n }\n });\n }",
"public function accounts()\n {\n return $this->get('ach/relationships');\n }",
"public function get_accounts(){\n $items = array();\n if( ! $this->is_connect() ){\n return array();\n }\n //$this->new_request( \"GET\", \"/accounts\" );//$this->is_connect() hace la petición de las cuentas\n $response = json_decode( $this->ironman->get_response_body(), true );\n $accounts = isset( $response['accounts'] ) ? $response['accounts'] : array();\n foreach( $accounts as $account ){\n $items[$account['id']] = $account['name'];\n }\n return $items;\n }"
]
| [
"0.63143754",
"0.61916775",
"0.61846083",
"0.6021778",
"0.59819824",
"0.58274096",
"0.5820963",
"0.57787776",
"0.5728413",
"0.5727941",
"0.56759113",
"0.5653643",
"0.5649148",
"0.56410867",
"0.558694",
"0.558694",
"0.55752176",
"0.55677533",
"0.5511817",
"0.54952097",
"0.54801327",
"0.54418224",
"0.54345864",
"0.54311377",
"0.54167217",
"0.54166067",
"0.53057474",
"0.5303416",
"0.5296732",
"0.52763194"
]
| 0.83268064 | 0 |
data scrape the settings of a tune in order to extend related data get the tune settings, out of the set of the tunes, get the first id $id = 1209; the function | function setTuneRelate($id){
// url
$url = "https://thesession.org/tunes/".$id."?format=json";
// put in the curl function
$ch = curl_init($url);
// create an array for the data to be pulled into
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json;', 'Content-Type: application/json'));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// save response to variable
$response = curl_exec($ch);
if(empty($response)) {
$error = curl_error($ch);
//$error now contains the error thrown when curl_exec failed to execute
echo $error;
} else {
//prints out the JSON for the new tunes for the session API
// $res = json_decode(html_entity_decode($response), true);
// return JSON object;
return $response;
// print a break...
// get as string...
// $res = json_decode($response, true);
// var_dump($res['settings']);
// now that I know that the $res variable holds an array that was decoded from JSON, now a loop would be helpful to get...
// specific parameters...will attempt
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_single_settings($id){ \r\n\t $query = $this->db->where('id',$id);\r\n\t $query = $this->db->get('system_settings');\r\n\t $result = $query->row();\r\n\t return $result; \r\n\t}",
"public function get_setting($id)\n {\n }",
"public function getSettings($erps_id = 0)\t\r\n\t{ \r\n return parent::getSettings();\t\r\n \r\n\t}",
"function get_settings($hash_id = null)\r\n\t{\r\n\r\n\t}",
"public function get_setting($id){\n\t\t$this->db->select('*')\n\t\t->from('settings')\n\t\t->where('setting_id = ', $id)\n\t\t->limit(1);\n\t\treturn $this->db->get()->result();\n\t}",
"public function getSettingsedit(){\n\n $allSettings = GeneralSetting::all();\n\n //$item = GeneralSetting::find($id);\n if($allSettings != null){\n $settingsArray = array();\n foreach ($allSettings as $setting_item) {\n\n $refl4 = new ReflectionObject($setting_item);\n $prop4 = $refl4->getProperty('attributes');\n $prop4->setAccessible(true);\n $item = $prop4->getValue($setting_item);\n\n $item_type = $item['type'];\n if($item_type == 'max_exam_time'){\n $time_string = $item['value'];\n $timeArray = explode(\":\",$time_string);\n $time_min= $timeArray[0]*60+$timeArray[1];\n\n $item['time_min'] = $time_min;\n }\n array_push($settingsArray,$item);\n\n } \n /* echo \"<pre>\";\n print_r($settingsArray);exit;*/\n \n $this->layout->content = View::make('admin.settingEdit')->with('settings',$settingsArray);\n }else{\n return Redirect::to('admin/settings')->with('message', 'No such settings exist!'); \n }\n }",
"protected function get_settings($more = array()){\n\n $settings = array(\n \tarray(\n \t\t\t'type' => \"textfield\",\n \t\t\t'heading' => __(\"Limit : \", 'alothemes'),\n 'description' => __('Number of posts to show.', 'alothemes'),\n \t\t\t'param_name' => \"number\",\n \t\t\t'value' => \"12\",\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n \t),\n array(\n 'type' => \"dropdown\",\n 'heading' => __('Timer :', 'alothemes'),\n 'description' => __('Countdown time.', 'alothemes'),\n 'param_name' => 'timer',\n 'value' => $this->bool(),\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"dropdown\",\n 'heading' => __('Slide :', 'alothemes'),\n 'description' => __('Use Slider or Grid.', 'alothemes'),\n 'param_name' => 'slide',\n 'value' => $this->bool($type =\"\", $defaut = 1),\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"dropdown\",\n 'heading' => __('Slider Vertical :', 'alothemes'),\n 'param_name' => 'vertical',\n 'value' => $this->bool($type =\"tf\", $defaut = 0),\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"dropdown\",\n 'heading' => __('Infinite :', 'alothemes'),\n 'param_name' => 'infinite',\n 'value' => $this->bool($type =\"tf\", $defaut = 1),\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"dropdown\",\n 'heading' => __('Auto Play :', 'alothemes'),\n 'param_name' => 'autoplay',\n 'value' => $this->bool($type =\"tf\", $defaut = 1),\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"dropdown\",\n 'heading' => __('Arrows :', 'alothemes'),\n 'param_name' => 'arrows',\n 'value' => $this->bool($type =\"tf\", $defaut = 1),\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"dropdown\",\n 'heading' => __('Dots :', 'alothemes'),\n 'param_name' => 'dots',\n 'value' => $this->bool($type =\"tf\", $defaut = 0),\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"dropdown\",\n 'heading' => __('Rows :', 'alothemes'),\n 'description' => __('Use Slider or Grid.', 'alothemes'),\n 'param_name' => 'rows',\n 'value' => $this->get_rows(),\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"textfield\",\n 'heading' => __(\"Speed <span style='color:red;'>*</span> :\", 'alothemes'),\n 'param_name' => \"speed\",\n 'value' => \"300\",\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"textfield\",\n 'heading' => __(\"AutoPlay Speed <span style='color:red;'>*</span> :\", 'alothemes'),\n 'param_name' => \"autoplay-speed\",\n 'value' => \"3000\",\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n array(\n 'type' => \"textfield\",\n 'heading' => __(\"Padding <span style='color:red;'>*</span> :\", 'alothemes'),\n 'param_name' => \"padding\",\n 'value' => \"15\",\n 'group' => __( 'Settings', 'alothemes' ),\n 'save_always' => true,\n ),\n\n // array(\n // 'type' => 'css_editor',\n // 'param_name' => 'css',\n // 'group' => __( 'Design options', 'alothemes' ),\n // 'admin_label' => false,\n // ),\n );\n if($more) $settings = $more;\n return $settings;\n }",
"function get_setting($id)\n {\n return $this->db->get_where('tbl_setting', array('id'=>$id))->row_array();\n }",
"abstract public function get_settings();",
"public function getRecordById($id) {\n $Acceleratedrewards = $this->find('first', array(\n 'conditions' => array('TierSetting.id' => $id),\n 'fields' => array('TierSetting.*')\n ));\n return $Acceleratedrewards;\n }",
"private function get_settings()\r\n\t{\r\n\t\tlist ($this->path, $this->webpath, $this->maxwidth, $this->maxheight, $this->type, $this->size, $this->preview_width, $this->preview_cols, $this->tablestyle, $this->picstyle) = $this->elements->get_element(0, \"show\", 0, 0);\r\n\t}",
"private function getSettings() {\n\t\t$code = (version_compare(VERSION, '3.0', '<') ? '' : $this->type . '_') . $this->name;\n\t\t\n\t\t$settings = array();\n\t\t$settings_query = $this->db->query(\"SELECT * FROM \" . DB_PREFIX . \"setting WHERE `code` = '\" . $this->db->escape($code) . \"' ORDER BY `key` ASC\");\n\t\t\n\t\tforeach ($settings_query->rows as $setting) {\n\t\t\t$value = $setting['value'];\n\t\t\tif ($setting['serialized']) {\n\t\t\t\t$value = (version_compare(VERSION, '2.1', '<')) ? unserialize($setting['value']) : json_decode($setting['value'], true);\n\t\t\t}\n\t\t\t$split_key = preg_split('/_(\\d+)_?/', str_replace($code . '_', '', $setting['key']), -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);\n\t\t\t\n\t\t\t\tif (count($split_key) == 1)\t$settings[$split_key[0]] = $value;\n\t\t\telseif (count($split_key) == 2)\t$settings[$split_key[0]][$split_key[1]] = $value;\n\t\t\telseif (count($split_key) == 3)\t$settings[$split_key[0]][$split_key[1]][$split_key[2]] = $value;\n\t\t\telseif (count($split_key) == 4)\t$settings[$split_key[0]][$split_key[1]][$split_key[2]][$split_key[3]] = $value;\n\t\t\telse \t\t\t\t\t\t\t$settings[$split_key[0]][$split_key[1]][$split_key[2]][$split_key[3]][$split_key[4]] = $value;\n\t\t}\n\t\t\n\t\treturn $settings;\n\t}",
"function get_common_range_details($id) {\r\n\t\t$i = $id;\r\n\t\t$path = array();\r\n\t\t\r\n\t\twhile ($i != 0) {\r\n\t\t\t$db = $this->db->query(\"SELECT id, parent FROM wp_structure WHERE id = $i\");\r\n\t\t\t$x = $db->result_array();\r\n\t\t\t$i = $x[0]['parent'];\r\n\t\t\t$path[] = $x[0]['id'];\r\n\t\t}\r\n\t\t$path = array_reverse($path);\r\n\t\t\r\n\t\t/*\r\n\t\t * It is projectors\r\n\t\t * So change the parent ID\r\n\t\t */\r\n\t\tif (isset($path[1]) && $path[1] == 73) {\r\n\t\t\t$id = 1562;\r\n\t\t}\r\n\t\t\r\n\t\t//echo '<!-- ' . print_r($path, true) . \"\\n $id \\n\" . ' -->';\r\n\t\t\r\n\t\t$result = array();\r\n\t\t\r\n\t\t// get folders case studies and white papers\r\n\t\t$fcws = $this->db->query(\"SELECT * FROM `wp_structure`, `wp_folder`\r\n\t\t\t\t\t\t\t\t\tWHERE `id` = `link` AND `online` = 1 AND `parent` = '{$id}'\r\n\t\t\t\t\t\t\t\t\tORDER BY `position`\");\r\n\t\tif ($fcws->num_rows() > 0) {\r\n\t\t\t$result['folders'] = $fcws->result_array();\r\n\t\t} else {\r\n\t\t\t$result['folders'] = false;\r\n\t\t}\r\n\t\t\r\n\t\t// get articles FAQ's and Warranty\r\n\t\t$fcws = $this->db->query(\"SELECT * FROM `wp_structure`, `wp_article`\r\n\t\t\t\t\t\t\t\t\tWHERE `id` = `link` AND `online` = 1 AND `parent` = '{$id}'\r\n\t\t\t\t\t\t\t\t\tORDER BY `position`\");\r\n\t\tif ($fcws->num_rows() > 0) {\r\n\t\t\t$result['articles'] = $fcws->result_array();\r\n\t\t} else {\r\n\t\t\t$result['articles'] = false;\r\n\t\t}\r\n\t\t\r\n\t\tif ($result['articles'] == false && $result['folders'] == false) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn $result;\r\n\t\t}\r\n\t\t\r\n\t}",
"function getSettings() { \r\n\tglobal $mysql;\r\n\t$settings = $mysql->query(\"SELECT recaptcha_sitekey,recaptcha_secretkey,g_analytics,avg_pow_time FROM system WHERE id='1'\")->fetch_assoc();\r\n\t$pow_time_parts = explode('|',$settings['avg_pow_time']);\r\n\t$avgPOW_desktop = explode(':',$pow_time_parts[0]);\r\n\t$avgPOW_mobile = explode(':',$pow_time_parts[1]);\r\n\t$settings['pow-desktop'] = round(($avgPOW_desktop[1] / 60000),2); \r\n\t$settings['pow-mobile'] = round(($avgPOW_mobile[1] / 60000),2);\r\n\treturn $settings;\r\n}",
"public function settings_data() {\t\t\t\t## getting settings data function starts\n\t\t\treturn $this->get_settingsdata();\n\t\t}",
"public function get_admin_setting($tablename,$id=1)\n{\n\tif(!empty($tablename) and !empty($id))\n\t{\n\t$this->sql = \"SELECT * FROM \".$tablename.\" WHERE setting_id='\".$id.\"'\";\n\t$this->exe = $this->db->query($this->sql);\n\treturn $this->exe->result_array();\n\t}\n}",
"function defaultSettings($dsetting=\"\") {\n\t\tglobal $wpdb;\n\t\t$top10 = array(\t\"toplimit\"=>\"10\",\t//new in 1.8.3 - top stats list size\n\t\t\t\t\"topsearch\"=>\"1\",\n\t\t\t\t\"topreferrer\"=>\"1\",\n\t\t\t\t\"toprequest\"=>\"1\",\n\t\t\t\t\"topbrowser\"=>\"1\",\n\t\t\t\t\"topos\"=>\"1\",\n\t\t\t\t\"toplocale\"=>\"0\",\n\t\t\t\t\"topvisitor\"=>\"0\",\n\t\t\t\t\"toppostid\"=>\"0\",\t//new in v1.8.3 - top article by post-id\n\t\t\t\t\"topreferrer_exclude\"=>\"\",\n\t\t\t\t\"top_nospider\"=>\"0\");\t//new in v1.8.3 - exclude spiders from top stats\n\t\t$defaults = array(\n\t\t\t'wassup_active'\t\t=>\"1\",\n\t\t\t'wassup_loggedin'\t=>\"1\",\n\t\t\t'wassup_admin'\t\t=>\"1\",\n\t\t\t'wassup_spider'\t\t=>\"1\",\n\t\t\t'wassup_attack'\t\t=>\"1\",\n\t\t\t'wassup_hack'\t\t=>\"1\",\n\t\t\t'wassup_spamcheck'\t=>\"1\",\n \t\t'wassup_spam'\t\t=>\"1\",\n \t\t'wassup_refspam'\t=>\"1\",\n\t\t\t'wassup_exclude'\t=>\"\",\n\t\t\t'wassup_exclude_url'\t=>\"\",\n\t\t\t'wassup_exclude_user'\t=>\"\",\n\t\t\t'wassup_cache'\t\t=>\"1\",\n\t\t\t'wassup_chart'\t\t=>\"1\",\n\t\t\t'wassup_chart_type'\t=>\"2\",\n\t\t\t'delete_auto'\t\t=>\"never\",\n \t\t'delete_filter'\t\t=>\"\",\n\t\t\t'wassup_remind_mb'\t=>\"0\",\n\t\t\t'wassup_remind_flag'\t=>\"0\",\n\t\t\t'wassup_refresh'\t=>\"3\",\n\t\t\t'wassup_userlevel'\t=>\"8\",\n\t\t\t'wassup_screen_res'\t=>\"800\",\n\t\t\t'wassup_default_type'\t=>\"everything\",\n\t\t\t'wassup_default_spy_type'=>\"everything\",\n\t\t\t'wassup_default_limit'\t=>\"10\",\n\t\t\t'wassup_dashboard_chart'=>\"0\",\n\t\t\t'wassup_geoip_map'\t=>\"0\",\n\t\t\t'wassup_googlemaps_key'\t=>\"\",\n\t\t\t'wassup_spy_speed'\t=>\"5000\",\n\t\t\t'wassup_time_format'\t=>\"24\",\n\t\t\t'wassup_time_period'\t=>\"1\",\n\t\t\t'wassup_widget_title'\t=>\"Visitors Online\",\n\t\t\t'wassup_widget_ulclass'\t=>\"links\",\n\t\t\t'wassup_widget_loggedin'=>\"1\",\n\t\t\t'wassup_widget_comauth'\t=>\"1\",\n\t\t\t'wassup_widget_search'\t=>\"1\",\n\t\t\t'wassup_widget_searchlimit' =>\"5\",\n\t\t\t'wassup_widget_ref'\t=>\"1\",\n\t\t\t'wassup_widget_reflimit'=>\"5\",\n\t\t\t'wassup_widget_topbr'\t=>\"1\",\n\t\t\t'wassup_widget_topbrlimit'=>\"5\",\n\t\t\t'wassup_widget_topos'\t=>\"1\",\n\t\t\t'wassup_widget_toposlimit'=>\"5\",\n\t\t\t'wassup_widget_chars'\t=>\"18\",\n\t\t\t'wassup_alert_message'\t=>\"\",\n\t\t\t'wassup_uninstall'\t=>\"0\",\n\t\t\t'wassup_optimize'\t=>current_time('timestamp'),\n\t\t\t'wassup_top10'\t=>esc_attr(serialize($top10)),\n//\t\t\t\t\t\"topsearch\"=>\"1\", - moved\n//\t\t\t\t\t\"topreferrer\"=>\"1\", - moved\n//\t\t\t\t\t\"toprequest\"=>\"1\", - moved\n//\t\t\t\t\t\"topbrowser\"=>\"1\", - moved\n//\t\t\t\t\t\"topos\"=>\"1\", - moved\n//\t\t\t\t\t\"toplocale\"=>\"0\", - moved\n//\t\t\t\t\t\"topvisitor\"=>\"0\", - moved\n//\t\t\t\t\t\"topfeed\"=>\"0\", - moved\n//\t\t\t\t\t\"topcrawler\"=>\"0\", - moved\n//\t\t\t\t\t\"topreferrer_exclude\"=>\"\"))), - moved\n\t\t\t'whash' \t=>$this->get_wp_hash(),\n\t\t\t'wassup_version'=>\"\",\n\t\t\t'wassup_table' =>$wpdb->prefix . \"wassup\",\n\t\t\t'wassup_dbengine'=>$this->getMySQLsetting(\"engine\"));\n\n\t\t//never discard google maps api key with \"reset-to-default\"\n\t\tif (!empty($this->wassup_googlemaps_key)) {\n\t\t\t$defaults['wassup_googlemaps_key']= $this->wassup_googlemaps_key;\n\t\t}\n\t\t//never discard wassup_version' or 'wassup_table' with \"reset-to-default\"\n\t\tif (!empty($this->wassup_version)) {\n\t\t\t$defaults['wassup_version']= $this->wassup_version;\n\t\t}\n\t\tif (!empty($this->wassup_table)) {\n\t\t\t$defaults['wassup_table']= $this->wassup_table;\n\t\t}\n\t\t//New in 1.8.3: return a single default value when function argument given\n\t\tif (!empty($dsetting)) {\n\t\t\tif ($dsetting == \"top10\" || $dsetting == \"wassup_top10\" || $dsetting == \"top_stats\") {\n\t\t\t\treturn ($top10);\n\t\t\t} elseif (!empty($defaults[$dsetting])) {\n\t\t\t\treturn ($defaults[$dsetting]);\n\t\t\t} else {\n\t\t\t\treturn (null);\n\t\t\t}\n\t\t} else { \n\t\t\treturn($defaults);\n\t\t};\n\t}",
"public function get_blog_settings_data()\n\t{\n\t\t$result = $this->db->from(\"blog_settings\")->limit(1)->get();\n\t\treturn $result;\n\t}",
"public function get_blog_settings_data()\n\t{\n\t\t$result = $this->db->from(\"blog_settings\")->limit(1)->get();\n\t\treturn $result;\n\t}",
"public static function getCustomSettings($id)\n\t{\n\t\t$customSettings = (array) FrontendModel::getDB()->getRecords(\n\t\t\t'SELECT pi.title, pi.db_title, pi.datatype, pi.values FROM profiles_info AS pi'\n\t\t);\n\n\t\t// get the data for the given user\n\t\tforeach($customSettings as &$customSetting) $customSetting['value'] = FrontendProfilesModel::getSetting($id, $customSetting['db_title']);\n\n\t\treturn $customSettings;\n\t}",
"function getSetting($zeile)\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT $zeile FROM \".PREFIX.\"_modul_shop LIMIT 1\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\t\treturn $row->$zeile;\r\n\t}",
"function getInfomationOnThisPage($crawler,$db,$batchId) {\n\t\t$title=\"\";\n\t\t$link=\"\";\n\t\t$cid=\"\";\n\t\t$price=\"\";\n\t\t$odo=\"\";\n\n\t\t// Get title\n\t\t$info = $crawler->filter('.result-item')->each(function ($node) {\n\t\t\t$info=array();\n\n\t\t\t/* Title & Link */\n\t\t\t$tmp=$node->filter(\"h2 a\")->each(function($node_1){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['title'] = trim(preg_replace(\"/<span.*span>/s\",\"\",$node_1->html()));\n\t\t\t $tmp['link'] = \"http://www.carsales.com.au\".$node_1->attr(\"href\");\n\t\t\t $tmp['cid'] = $node_1->attr('recordid');\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\t\t\t/* Price */\n\t\t\t$tmp=$node->filter(\".additional-information .price a\")->each(function($node_2){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['price'] = $node_2->attr('data-price');\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\t\t\t/* Odometer */\n\t\t\t$tmp = $node->filter(\".vehicle-features .item-odometer\")->each(function($node_2){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['odo'] = preg_replace(array(\"/<i.*i>/\",\"/,/\",\"/ km$/\"),array(\"\",\"\",\"\"),$node_2->html());\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\n\t\t\treturn $info;\n\n\t\t});\n\n\t\t$sqls=array();\n\t\tforeach ($info AS $i) {\n\t\t\t$title=isset($i['title'])?$db->real_escape_string($i['title']):\"\";\n\t\t\t$link=isset($i['link'])?$db->real_escape_string($i['link']):\"\";\n\t\t\t$cid=isset($i['cid'])?$db->real_escape_string($i['cid']):\"\";\n\t\t\t$price=isset($i['price'])?$db->real_escape_string($i['price']):\"\";\n\t\t\t$odo=isset($i['odo'])?$db->real_escape_string($i['odo']):\"\";\n\n\t\t\t$sqls[]=\"('$cid','$title','$price','$odo','$batchId','$link')\";\n\t\t}\n\t\t$db->query(\"INSERT INTO subaru_outback (record_id,title,price,odometer,batch_id,link) VALUES \".implode(\",\",$sqls));\n\n\t}",
"abstract public function getSettings();",
"public function getSettings() {\n $scenario = \\Drupal::installProfile();\n if ($scenario === 'dfs_obio_acm') {\n $scenario = 'dfs_obio';\n }\n return \\Drupal::config('as_lift.settings.' . $scenario);\n }",
"private function getSettings()\n\t\t{\n\t\t\tforeach($this->settings as $key => $val) {\n\t\t\t\t$this->settings[$key] = !empty(get_option($this->tag.$key)) ? get_option($this->tag.$key) : '';\n\t\t\t}\n\t\t}",
"public function get_allSettings(): string\n {\n // $settings is a bin;\n // $json is a bin;\n // $res is a bin;\n // $sep is a str;\n // $name is a str;\n // $item is a str;\n // $t_type is a str;\n // $id is a str;\n // $url is a str;\n // $file_data is a str;\n // $file_data_bin is a bin;\n // $temp_data_bin is a bin;\n // $ext_settings is a str;\n $filelist = []; // strArr;\n $templist = []; // strArr;\n\n $settings = $this->_download('api.json');\n if (strlen($settings) == 0) {\n return $settings;\n }\n $ext_settings = ', \"extras\":[';\n $templist = $this->get_functionIds('Temperature');\n $sep = '';\n foreach ( $templist as $each) {\n if (intVal($this->get_firmwareRelease()) > 9000) {\n $url = sprintf('api/%s/sensorType',$each);\n $t_type = $this->_download($url);\n if ($t_type == 'RES_NTC' || $t_type == 'RES_LINEAR') {\n $id = substr($each, 11, strlen($each) - 11);\n if ($id == '') {\n $id = '1';\n }\n $temp_data_bin = $this->_download(sprintf('extra.json?page=%s', $id));\n if (strlen($temp_data_bin) > 0) {\n $item = sprintf('%s{\"fid\":\"%s\", \"json\":%s}'.\"\\n\".'', $sep, $each, $temp_data_bin);\n $ext_settings = $ext_settings . $item;\n $sep = ',';\n }\n }\n }\n }\n $ext_settings = $ext_settings . '],'.\"\\n\".'\"files\":[';\n if ($this->hasFunction('files')) {\n $json = $this->_download('files.json?a=dir&f=');\n if (strlen($json) == 0) {\n return $json;\n }\n $filelist = $this->_json_get_array($json);\n $sep = '';\n foreach ( $filelist as $each) {\n $name = $this->_json_get_key($each, 'name');\n if ((strlen($name) > 0) && !($name == 'startupConf.json')) {\n $file_data_bin = $this->_download($this->_escapeAttr($name));\n $file_data = YAPI::_bytesToHexStr($file_data_bin);\n $item = sprintf('%s{\"name\":\"%s\", \"data\":\"%s\"}'.\"\\n\".'', $sep, $name, $file_data);\n $ext_settings = $ext_settings . $item;\n $sep = ',';\n }\n }\n }\n $res = '{ \"api\":' . $settings . $ext_settings . ']}';\n return $res;\n }",
"public static function getSettings($id)\n\t{\n\t\t// get settings\n\t\t$settings = (array) FrontendModel::getDB()->getPairs(\n\t\t\t'SELECT ps.name, ps.value\n\t\t\t FROM profiles_settings AS ps\n\t\t\t WHERE ps.profile_id = ?',\n\t\t\t(int) $id\n\t\t);\n\n\t\t// unserialize values\n\t\tforeach($settings as $key => &$value) $value = unserialize($value);\n\n\t\t// return\n\t\treturn $settings;\n\t}",
"public function initVarfromXml() {\n if ((array) $this->xml_data) {\n foreach ($this->xml_data->xpath('//page_group') as $item) {\n foreach ($item->children() as $child) {\n $seq = 0;\n if (!empty($child['seq'])) {\n $seq = (string) $child['seq'];\n }\n if ($seq < 99) {\n\n if ($child['type'] == 'IE') {\n foreach ($child->xpath('input') as $value) {\n $tp = 0;\n if (empty($value->value)) {\n $datav = (string) $value->default;\n } else {\n $datav = (string) $value->value;\n }\n if (strtolower($value->type) == 'number')\n $tp = 1;\n if (empty($this->sccpvalues[(string) $value->name])) {\n $this->sccpvalues[(string) $value->name] = array('keyword' => (string) $value->name, 'data' => $datav, 'type' => $tp, 'seq' => $seq);\n// $this->sccpvalues[] = array('keyword' => (string)$value->name, 'data' =>(string)$value->default, 'type'=> '0');\n }\n }\n }\n if ($child['type'] == 'IS' || $child['type'] == 'IED') {\n if (empty($child->value)) {\n $datav = (string) $child->default;\n } else {\n $datav = (string) $child->value;\n }\n if (empty($this->sccpvalues[(string) $child->name])) {\n $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);\n// $this->sccpvalues[] = array('keyword' => (string)$child->name, 'data' =>(string)$child-> default,'type'=>'0');\n }\n }\n if ($child['type'] == 'SLD' || $child['type'] == 'SLS' || $child['type'] == 'SLT' || $child['type'] == 'SL' || $child['type'] == 'SLM' || $child['type'] == 'SLZ' || $child['type'] == 'SLZN' || $child['type'] == 'SLA') {\n if (empty($child->value)) {\n $datav = (string) $child->default;\n } else {\n $datav = (string) $child->value;\n }\n if (empty($this->sccpvalues[(string) $child->name])) {\n $this->sccpvalues[(string) $child->name] = array('keyword' => (string) $child->name, 'data' => $datav, 'type' => '2', 'seq' => $seq);\n }\n }\n }\n }\n }\n }\n }",
"public function run()\n {\n $settings = [\n [\n 'var' => 'perpage',\n 'type' => 'string',\n 'value' => '9',\n ],\n [\n 'var' => 'phone_number',\n 'type' => 'string',\n 'value' => '+7 (495) <span class=\"mod-bold\">123-45-67</span>',\n ],\n [\n 'var' => 'email_support',\n 'type' => 'string',\n 'value' => '[email protected]',\n ],\n [\n 'var' => 'email_order',\n 'type' => 'string',\n 'value' => '[email protected]',\n ],\n [\n 'var' => 'address',\n 'type' => 'string',\n 'value' => 'г. Москва, ул. Пушкина, д. Колотушкина',\n ],\n [\n 'var' => 'schedule',\n 'type' => 'array',\n 'value' => '{\"start_workday\":\"9:00\",\"end_workday\":\"19:00\",\"start_weekend\":\"10:00\",\"end_weekend\":\"17:00\"}',\n ],\n [\n 'var' => 'shop_name',\n 'type' => 'string',\n 'value' => 'Интернет-магазин «Fit2U»',\n ],\n [\n 'var' => 'company_name',\n 'type' => 'string',\n 'value' => 'Твой Фитнес имидж',\n ],\n [\n 'var' => 'retailcrm_url',\n 'type' => 'string',\n 'value' => 'https://fit2u.retailcrm.ru',\n ],\n [\n 'var' => 'top_menu_count_in_row',\n 'type' => 'string',\n 'value' => '8',\n ],\n ];\n //усли значение не задано то устанавливаем, а если задано, то уже кто-то настроил\n foreach ($settings as $setting) {\n $row = Setting::firstOrNew([\n 'var' => $setting['var'],\n ]);\n if(!isset($row->value) or !isset($row->type)) {\n $row->type = $setting['type'];\n $row->value = $setting['value'];\n $row->save();\n }\n }\n }",
"public function loadSettings($erps_id = 0)\r\n\t{\r\n\t}"
]
| [
"0.54206604",
"0.52210534",
"0.51415306",
"0.51335907",
"0.51104474",
"0.5079452",
"0.5006843",
"0.49942496",
"0.4981436",
"0.49761337",
"0.4937761",
"0.4935941",
"0.4928943",
"0.49158722",
"0.48983085",
"0.48779774",
"0.485837",
"0.48562458",
"0.48562458",
"0.48549885",
"0.48503527",
"0.48434034",
"0.48338634",
"0.48300683",
"0.48269847",
"0.4817571",
"0.47913763",
"0.47875592",
"0.47869948",
"0.47852063"
]
| 0.6417392 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.