query
stringlengths
11
3.13k
ru_query
stringlengths
9
3.91k
document
stringlengths
18
71k
metadata
dict
negatives
listlengths
0
100
negative_scores
listlengths
0
100
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Remove an entry from the crontab Descriptions $line The line number of the crontab entry you wish to remove, as reported by listcron.
Удалить запись из crontab Описание $line Номер строки crontab, которую вы хотите удалить, как он отображается в listcron.
public function remove_cron($line){ $input=array( 'module' => 'Cron', 'function' => 'remove_line', 'line' => $line ); $query=$this->build_query($input); $raw=$this->query($query); $ob=json_decode($raw, false); return $status=$ob->cpanelresult->data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pt_remove() {\n\t\t$this->_clean_cron_array();\n\t}", "public function removeLine($lineNum) {\n\t\t\tunset($this->data[$lineNum]);\n\t\t}", "public function deleteLine($line) {\n\t\t$input = $this->_parseLine($line);\n\t\t$entries = $this->_entryFind($input);\n\t\t$status = FALSE;\n\t\tforeach ($entri...
[ "0.63604987", "0.6337621", "0.6281895", "0.62445503", "0.5976755", "0.578511", "0.5626423", "0.55599165", "0.5553531", "0.553523", "0.5530211", "0.54418385", "0.54222286", "0.5421537", "0.541243", "0.5411419", "0.53727037", "0.5369022", "0.5366404", "0.5353817", "0.53301907",...
0.82968134
0
Edit Crontab entry Descriptions $command The command, script, or program you wish for your cronjob to execute. $day The day on which you would like this crontab entry to run. $hour The hour at which you would like this crontab entry to run. $minute The minute at which you would like this crontab entry to run. $month The month you would like this crontab entry to run. $weekday The weekday on which you would like this crontab entry to run. $linekey The linekey for the entry to be edited, as reported by listcron.
Редактировать запись Crontab Описания $command Команда, скрипт или программа, которую вы хотите, чтобы ваш cronjob выполнял. $day День, когда вы хотите, чтобы эта запись crontab выполнялась. $hour Час, когда вы хотите, чтобы эта запись crontab выполнялась. $minute Минута, когда вы хотите, чтобы эта запись crontab выполнялась. $month Месяц, когда вы хотите, чтобы эта запись crontab выполнялась. $weekday День недели, когда вы хотите, чтобы эта запись crontab выполнялась. $linekey Linekey для записи, которую нужно отредактировать, как это отображается в listcron.
public function edit_cron($command, $day, $hour, $minute, $month, $weekday, $linekey){ $input=array( 'module' => 'Cron', 'function' => 'add_line', 'command' => $command, 'day' => $day, 'hour' => $hour, 'minute' => $minute, 'month' => $month, 'weekday' => $weekday, 'linekey' => $linekey ); $query=$this->build_query($input); $raw=$this->query($query); $ob=json_decode($raw, false); return $status=$ob->cpanelresult->data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editCommand($minute,$hour,$monthday,$month,$weekday,$command) {\n\t\t$input = $this->_entryDefault();\n\t\t$input['minute'] = $minute;\n\t\t$input['hour'] = $hour;\n\t\t$input['monthday'] = $monthday;\n\t\t$input['month'] = $month;\n\t\t$input['weekday'] = $weekday;\n\t\t$input['command'] = $comman...
[ "0.69037044", "0.67305404", "0.59818774", "0.5774636", "0.5661748", "0.56006527", "0.55592483", "0.55591965", "0.548477", "0.54737085", "0.53480047", "0.53363067", "0.5329637", "0.52896446", "0.5236117", "0.5228887", "0.5181047", "0.51529676", "0.5119732", "0.5104534", "0.509...
0.8135299
0
Sets the default data formater instance used by all collectors subclassing this class
Устанавливает экземпляр форматера данных по умолчанию, используемый всеми сборщиками, наследующими эту класс
public static function setDefaultDataFormatter(DataFormatterInterface $formater) { self::$defaultDataFormatter = $formater; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getDefaultDataFormatter()\n {\n if (self::$defaultDataFormatter === null) {\n self::$defaultDataFormatter = new DataFormatter();\n }\n return self::$defaultDataFormatter;\n }", "public static function getDefaultDataFormatter()\n {\n if (self:...
[ "0.7100221", "0.7100221", "0.6017634", "0.5990944", "0.5984193", "0.5984193", "0.5978896", "0.59140164", "0.591184", "0.588705", "0.5882016", "0.583293", "0.5778218", "0.57397765", "0.57282215", "0.5712732", "0.5696587", "0.5676376", "0.56733173", "0.5670508", "0.5666011", ...
0.76794136
0
Returns the default data formater
Возвращает форматирование данных по умолчанию
public static function getDefaultDataFormatter() { if (self::$defaultDataFormatter === null) { self::$defaultDataFormatter = new DataFormatter(); } return self::$defaultDataFormatter; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getDataFormat() {\r\n //TODO: ??\r\n return \"\"; // $this->DataFormats->Text;\r\n }", "public function getDefaultDataFormat()\n {\n if ($this->defaultMimeType) {\n return $this->getDataFormatForMimeType($this->defaultMimeType);\n }\n }", "publ...
[ "0.7731159", "0.76342195", "0.75141805", "0.7511005", "0.74824685", "0.74718416", "0.74632055", "0.7376578", "0.73553145", "0.73372895", "0.7315615", "0.7255983", "0.71901333", "0.7186317", "0.71856266", "0.71210164", "0.70647043", "0.70647043", "0.70647043", "0.70647043", "0...
0.81695217
0
Sets the data formater instance used by this collector
Устанавливает экземпляр форматера данных, используемый этим сборщиком
public function setDataFormatter(DataFormatterInterface $formater) { $this->dataFormater = $formater; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setDefaultDataFormatter(DataFormatterInterface $formater)\n {\n self::$defaultDataFormatter = $formater;\n }", "public static function setDefaultDataFormatter(DataFormatterInterface $formater)\n {\n self::$defaultDataFormatter = $formater;\n }", "public function...
[ "0.6970183", "0.6970183", "0.65426916", "0.6073922", "0.5772324", "0.56653756", "0.56312984", "0.56308067", "0.5617194", "0.5617194", "0.5524056", "0.55150217", "0.54941404", "0.54479", "0.54346526", "0.5419458", "0.5412384", "0.5348778", "0.5347369", "0.5346497", "0.5345944"...
0.7202916
0
Returns the default variable dumper
Возвращает дефолтный дампер переменных
public static function getDefaultVarDumper() { if (self::$defaultVarDumper === null) { self::$defaultVarDumper = new DebugBarVarDumper(); } return self::$defaultVarDumper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVarDumper()\n {\n if ($this->varDumper === null) {\n $this->varDumper = self::getDefaultVarDumper();\n }\n return $this->varDumper;\n }", "public function varDumpFormatter(): VarDumpFormatterInterface;", "public function getVarDumpFormatter(): VarDumpFor...
[ "0.71653026", "0.6722976", "0.63790554", "0.63215816", "0.62080896", "0.61746174", "0.60214627", "0.6005887", "0.599377", "0.59058535", "0.58474195", "0.5806549", "0.57994264", "0.5765675", "0.5748658", "0.5723674", "0.57234466", "0.5718989", "0.5705175", "0.5705175", "0.5691...
0.7964654
0
Get the email address of the customer.
Получите адрес электронной почты клиента.
public function getCustomerEmail() { return $this->customerEmail; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCustomerEmail()\n {\n return $this->customerEmail;\n }", "public function getCustomer_email()\n {\n return $this->customer_email;\n }", "public function getCustomerEmail();", "protected function _getCustomerEmail()\n {\n return Mage::getSingleton('custom...
[ "0.8716196", "0.8625715", "0.86080927", "0.8373476", "0.83675563", "0.83227885", "0.8023444", "0.7854105", "0.78303564", "0.7788121", "0.77859896", "0.7781224", "0.7779023", "0.776001", "0.7691473", "0.7673048", "0.76584184", "0.76512164", "0.76216805", "0.76216805", "0.76157...
0.8626536
1
Set a track id. Order tracking id generated by the merchant. Max length 50 characters.
Установите идентификатор трека. Идентификатор отслеживания заказа, сгенерированный поставщиком услуг. Максимальная длина 50 символов.
public function setTrackId($trackId) { $this->trackId = $trackId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setTrackingId($value)\n {\n $this->_fields['TrackingId']['FieldValue'] = $value;\n return $this;\n }", "public function setTracking(int $orderId, Tracking $tracking): void;", "public function getTrackId()\n {\n return $this->track_id;\n }", "function setId($va...
[ "0.65960586", "0.6485994", "0.61331654", "0.61190593", "0.60933566", "0.59722674", "0.59593785", "0.58495325", "0.57995427", "0.5780681", "0.5779666", "0.57139724", "0.5709635", "0.5701734", "0.56981766", "0.5680297", "0.56688756", "0.5645242", "0.5633356", "0.56324303", "0.5...
0.70198953
0
Set the reason code.
Задайте код причины.
public function setReasonCode($reasonCode) { $this->reasonCode = $reasonCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setReasonCode($code);", "public function setReason($reason);", "public function setReason(string $reason): void\n {\n $this->reason = $reason;\n }", "public function getReasonCode() {\n return $this->reasonCode;\n }", "public function getReasonCode()\n {\n return ...
[ "0.8230594", "0.7073509", "0.6984813", "0.6937635", "0.6839082", "0.6839082", "0.6839082", "0.6787069", "0.6736127", "0.6736127", "0.6728256", "0.66874707", "0.66874707", "0.6631845", "0.6615625", "0.66006887", "0.6476051", "0.64559466", "0.6421098", "0.637736", "0.6334987", ...
0.72637343
1
Set the customer name.
Установите имя клиента.
public function setCustomerName($customerName) { $this->customerName = $customerName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setName() {\n\t\t$this->name = self::$factory->getCustomerName($this->id);\n\t}", "public function setCustomerName($name)\n\t{\n\t\t\treturn $this->set('CustomerRef FullName', $name);\n\t}", "public function setCustName( $value ) {\n\t\t$value = strval( $value );\n\t\t\n\t\tif( $value != null &...
[ "0.8378217", "0.7792436", "0.7780882", "0.695569", "0.6939777", "0.692845", "0.69099283", "0.68539983", "0.6851301", "0.6832905", "0.6832438", "0.68313783", "0.6818947", "0.681801", "0.6816227", "0.67969614", "0.67914784", "0.67855054", "0.6778437", "0.67765564", "0.67765564"...
0.8185245
1
Set the email address of the customer.
Задайте электронный адрес клиента.
public function setCustomerEmail($customerEmail) { $this->customerEmail = $customerEmail; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCustomerEmail($email);", "public function setEmail()\n\t{\n\t\t$this->email=$email;\n\t}", "public function setEmail(string $value) { return $this->set('email', $value); }", "public function setCustomerSenderEmail($customerSenderEmail);", "public function setEmail(?string $value): void {...
[ "0.81067914", "0.7663893", "0.7539224", "0.7523339", "0.7456627", "0.7456627", "0.74509305", "0.7426865", "0.7411121", "0.7395864", "0.7379693", "0.7373152", "0.7365303", "0.7365036", "0.73438543", "0.7302781", "0.72939044", "0.72939044", "0.7291498", "0.7285526", "0.7285075"...
0.77068293
1
Set cash out operations data.
Задайте данные операций вывода наличных.
private function setCashOutData() { $this->data = Filter::filterData($this->getData(), 'operation_type', 'cash_out'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cashOut()\n {\n $this->setCashOutData();\n $this->naturalCashOut();\n $this->legalCashOut();\n }", "private function legalCashOut()\n {\n $legal_data = Filter::filterData($this->data, 'client_type', 'legal');\n\n foreach ($legal_data as $index => $opera...
[ "0.6037448", "0.580447", "0.5479992", "0.5298256", "0.51608276", "0.515396", "0.49876976", "0.49534583", "0.49131903", "0.4908095", "0.48948875", "0.4871183", "0.48643404", "0.48542127", "0.4836407", "0.4822605", "0.47968373", "0.47865742", "0.47778973", "0.47717404", "0.4737...
0.8281614
0
Set commission results for legal cash out operations.
Установите результаты комиссии для операций с выводом денежных средств в законном порядке.
private function legalCashOut() { $legal_data = Filter::filterData($this->data, 'client_type', 'legal'); foreach ($legal_data as $index => $operation) { try { $operation_data = new Operation($index, $operation); $commission = Commission::getLegalCashOutCommission($operation_data->getAmount(), $operation_data->getCurrency()); } catch (\Exception $e) { $commission = $e->getMessage(); } Results::setResult($index, $commission); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cashOut()\n {\n $this->setCashOutData();\n $this->naturalCashOut();\n $this->legalCashOut();\n }", "private function setCashOutData()\n {\n $this->data = Filter::filterData($this->getData(), 'operation_type', 'cash_out');\n }", "private function naturalCa...
[ "0.63228464", "0.6321103", "0.58372784", "0.55567336", "0.5140038", "0.5121526", "0.5071486", "0.50579506", "0.49832857", "0.49812695", "0.49025083", "0.48208424", "0.48112345", "0.48056132", "0.47814777", "0.47790733", "0.47329417", "0.47210073", "0.4688771", "0.46803224", "...
0.7447194
0
Run all cash out methods.
Запустить все методы вывода средств.
public function cashOut() { $this->setCashOutData(); $this->naturalCashOut(); $this->legalCashOut(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run() {\n\t Environment::set($this->env);\n\t $start = time();\n\t $this->_expiredEvents();\n\t $this->_purchases();\n\t $end = time();\n\t $finish = $end - $start;\n\t $this->out(\"It took \". $finish . \"secs to finish\");\n\t}", "public function run()\n {\n facto...
[ "0.6041298", "0.6009188", "0.5960256", "0.5874034", "0.58593374", "0.5859193", "0.567937", "0.5647585", "0.55636084", "0.5561706", "0.5547211", "0.55455196", "0.5545329", "0.55368406", "0.55298", "0.55295193", "0.5513126", "0.55063426", "0.55054957", "0.5502932", "0.5501055",...
0.72881156
0
Lists all Responsables models.
Перечисляет все модели Responsables.
public function actionIndex() { $searchModel = new ResponsablesSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResponsibilities();", "public function model()\n {\n return Responsability::class;\n }", "public function getAll()\n {\n return\n DB::table('responsibilities')\n ->select(\n 'responsibilities.id',\n 'respo...
[ "0.6494711", "0.63935155", "0.63227195", "0.6317332", "0.61386204", "0.60425925", "0.5992085", "0.5941682", "0.5823248", "0.5823248", "0.58144146", "0.58144146", "0.5801133", "0.57242495", "0.572123", "0.57186663", "0.5688088", "0.56791294", "0.56791294", "0.56791294", "0.567...
0.7290114
0
Creates a new Responsables model. If creation is successful, the browser will be redirected to the 'view' page.
Создает новый объект модели Responsables. Если создание успешно, браузер будет перенаправлен на страницу просмотра.
public function actionCreate() { $model = new Responsables(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->cod]); } else { return $this->render('create', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('Responsables/create');\n }", "public function actionCreate()\n {\n $model = new Answers();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\...
[ "0.7021273", "0.6597461", "0.6496368", "0.63458115", "0.63439125", "0.6304967", "0.62859577", "0.62817556", "0.6278128", "0.6239353", "0.6234467", "0.622082", "0.6205047", "0.6178645", "0.6170654", "0.6156311", "0.6144716", "0.6143746", "0.61422044", "0.6128647", "0.6128403",...
0.8302689
0
function getArticles() allow to display 3 article on the front page with a limit of 200 characters.
Функция getArticles() позволяет отобразить 3 статьи на главной странице с ограничением в 200 символов.
function getArticles() { $db = $this->getDb(); $req = $db->prepare('SELECT articles.id, titre, left(contenu,400)contenu200, contenu, date, username FROM articles INNER JOIN user ON id_user = user.id ORDER BY date DESC LIMIT 3 '); $req->execute(); $articles=[]; while($data = $req->fetch()){ $articles[] = $data; } $req->closeCursor(); return $articles; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function article_list( $limit = 5, $page = 0 ) {\n\n\t$docs = get_article_data();\n\n\t// reduce list to just list of content from specified page\n\t$docs = array_slice( $docs, ( $page * $limit ), $limit );\n\n\tif ( $doc_list ) {\n\t\techo '<ul>';\n\t\tforeach( $doc_list as $d ) {\n?>\n\t<li><a href=\"<?php echo ...
[ "0.7526631", "0.7417341", "0.73735464", "0.73160285", "0.7272129", "0.72487426", "0.7195797", "0.7176046", "0.70653224", "0.7045251", "0.70282173", "0.6949898", "0.6935949", "0.6931756", "0.6906103", "0.68687034", "0.68669736", "0.68187916", "0.67997336", "0.6789595", "0.6717...
0.7634107
0
Get the cake id
Получить идентификатор торта
public function getCakeId() { return $this->_cakeId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getChocolateyId()\n {\n return ChocolateyId::find($this->attributes['mail']);\n }", "public function get_id();", "public function get_id();", "public function get_id();", "public function get_id();", "protected function id()\n {\n return $this->get('id');\n }", ...
[ "0.7101246", "0.70928055", "0.70928055", "0.70928055", "0.70928055", "0.6946209", "0.6789405", "0.6785083", "0.6699401", "0.6690085", "0.6690085", "0.6684603", "0.66639024", "0.66639024", "0.66639024", "0.6662475", "0.6631091", "0.6620582", "0.66205716", "0.66194165", "0.6614...
0.8635391
0
Get the cake info
Получить информацию о торте
public function getCakeInfo() { $data = $this->_db->fetchRow('SELECT * FROM `cake` WHERE `cake_id` = ?', $this->getCakeId()); $data['min_price'] = $this->getMinPrice(); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_info();", "public function getInfo() {}", "public function getInfo();", "public function getInfo();", "public function getInfo();", "public function getInfo();", "public function getInfo();", "function getCakesInformation() {\n\t\t/*$this->equipment=$this->em->getTags('models\\Ent...
[ "0.62728053", "0.62541306", "0.62267935", "0.62267935", "0.62267935", "0.62267935", "0.62267935", "0.6151071", "0.6095564", "0.60763067", "0.58802676", "0.58781236", "0.5868778", "0.58551866", "0.5850622", "0.5845388", "0.5835504", "0.5805977", "0.5771918", "0.574715", "0.572...
0.7290626
0
Get the minimum sponge price of a cake
Получить минимальную цену сponжа для торта
public function getMinPrice() { return (float) $this->_db->fetchOne('SELECT MIN(`sponge_price`) FROM `cake_prices` WHERE `cake_id` = ?', $this->getCakeId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCheapestWine() {\n global $pdo;\n\n $sql = \"SELECT MIN(i.`cost`) AS \\\"min\\\"\n FROM `inventory` as i\n WHERE i.`on_hand` > 0\";\n\n $statement = $pdo->prepare($sql);\n $statement->execute();\n\n return $statement->fetch(PDO::FETCH_NUM...
[ "0.7162569", "0.69751453", "0.69642615", "0.6952512", "0.68714315", "0.6721253", "0.6712325", "0.6629997", "0.66013587", "0.65981287", "0.6506723", "0.64579916", "0.63950664", "0.63426715", "0.63355166", "0.6333499", "0.63192284", "0.62868005", "0.62526494", "0.6240151", "0.6...
0.81575227
0
Get All (excluding Cupcake) prices
Получить все (исключая Кэйк) цены
public function getAllPrices() { return $this->_db->fetchAll('SELECT `cake_prices`.`sponge_price` as `sponge`, `cake_prices`.`fruit_price` as `fruit` FROM `cake_prices` WHERE `cake_id` = ?', $this->getCakeId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_all_prices() {\n\t\t$this->headers = $this->all_headers;\n\n\t\treturn $this->http_call( 'pricing/all/' );\n\t}", "public function getPrices(): Collection;", "public function getPriceList()\n {\n return $this->API_AG_GET_CENIK();\n }", "public function prices()\n {\n ...
[ "0.7703406", "0.72767293", "0.7124073", "0.70679075", "0.6997386", "0.69909173", "0.6870254", "0.6761124", "0.6735307", "0.66427666", "0.6635674", "0.6633717", "0.6624983", "0.6591442", "0.658379", "0.65718436", "0.65664333", "0.6555626", "0.65487546", "0.64697117", "0.643499...
0.7524559
1
Get the cake sizes
Получить размеры торта
public function getSizes() { if (is_null($this->getCakeId())) throw new Exception('Cake Id not set'); return $this->_db->fetchPairs('SELECT `cake_sizes`.`size`, `cake_sizes`.`size` FROM `cake_prices` JOIN `cake_sizes` USING (`size_id`) WHERE `cake_id` = ?', $this->getCakeId()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function sizes();", "public function getSizes()\n\t{\n\t\treturn $this->sizes;\n\t}", "function sizes()\n {\n $sizes = array('sm' => 300);\n return $sizes;\n }", "public function actionGetSize()\n {\n $post = Yii::$app->request->post();\n if (isset($post['depdrop_p...
[ "0.7215453", "0.7208177", "0.67897546", "0.65551037", "0.6518795", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", "0.65065765", ...
0.73756504
0
Get the cake flavours
Получить вкуса торта
public function getAllFlavours() { return array( 'Classic Vanilla' => 'Classic Vanilla', 'Indulgent Chocolate' => 'Indulgent Chocolate', 'Espresso Coffee' => 'Espresso Coffee', 'Lemon Zest' => 'Lemon Zest', 'Orange Zest' => 'Orange Zest', 'Banana' => 'Banana', 'Red Velvet' => 'Red Velvet' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function flavors()\n{\n $array = array(\n \"grasshopper\" => \"The Grasshopper\",\n \"maple\" => \"Whiskey Maple Bacon\",\n \"carrot\" => \"Carrot Walnut\",\n \"caramel\" =>\"Salted Caramel Cupcake\",\n \"velvet\" => \"Red Velvet\",\n \"lemon\" ...
[ "0.59487945", "0.5923765", "0.5859627", "0.58051586", "0.5508007", "0.54566884", "0.53675574", "0.5358384", "0.5349784", "0.53118086", "0.5310258", "0.5305412", "0.52732104", "0.5252213", "0.5250429", "0.52314556", "0.51874113", "0.5174513", "0.51649195", "0.51535827", "0.514...
0.7627144
0
Get the cake fillings
Получить начинку для торта
public function getAllFillings() { $hasFruit = (boolean) $this->_db->fetchOne('SELECT COUNT(*) FROM `cake_prices` WHERE `sponge_price` > 0 AND `fruit_price` > 0 AND `cake_id` = ?', array($this->getCakeId())); if ($hasFruit) return array( 'Sponge' => 'Sponge', 'Fruit' => 'Fruit' ); else return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllButterCreamFilling()\n\t{\n\t\treturn array(\n\t\t\t'Vanilla' => 'Vanilla',\n\t\t\t'Chocolate' => 'Chocolate',\n\t\t\t'Espresso Coffee' => 'Espresso Coffee',\n\t\t\t'Mocha' => 'Mocha',\n\t\t\t'Orange' => 'Orange',\n\t\t\t'Chocolate and Orange Zest' => 'Chocolate and Orange Zest',\n\t\t\t'Lemo...
[ "0.6136994", "0.59546745", "0.57780707", "0.56975514", "0.5665868", "0.5573023", "0.5479779", "0.54333436", "0.53967696", "0.5348552", "0.5334363", "0.5309141", "0.52888614", "0.5178305", "0.5164935", "0.51518023", "0.51365453", "0.51356304", "0.5134667", "0.51291215", "0.510...
0.7125909
0
Get the buttercream fillings
Получить крем-филлинг для бабочки
public function getAllButterCreamFilling() { return array( 'Vanilla' => 'Vanilla', 'Chocolate' => 'Chocolate', 'Espresso Coffee' => 'Espresso Coffee', 'Mocha' => 'Mocha', 'Orange' => 'Orange', 'Chocolate and Orange Zest' => 'Chocolate and Orange Zest', 'Lemon' => 'Lemon', 'Coconut' => 'Coconut' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllFillings()\n\t{\n\t\t$hasFruit = (boolean) $this->_db->fetchOne('SELECT COUNT(*) FROM `cake_prices` WHERE `sponge_price` > 0 AND `fruit_price` > 0 AND `cake_id` = ?', array($this->getCakeId()));\n\t\tif ($hasFruit)\n\t\t\treturn array(\n\t\t\t\t'Sponge' => 'Sponge',\n\t\t\t\t'Fruit' => 'Fruit...
[ "0.6877459", "0.56674635", "0.565912", "0.56540173", "0.5530678", "0.54379344", "0.5410612", "0.5327743", "0.5309935", "0.53008175", "0.5190099", "0.518821", "0.51592255", "0.5151374", "0.51500595", "0.51488876", "0.5133128", "0.5113216", "0.5112549", "0.51049197", "0.5102222...
0.7532152
0
Show all the invalid properties with reasons.
Показать все недействительные свойства с причинами.
public function listInvalidProperties();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listInvalidProperties()\n {\n \n \n $invalidProperties = [];\n \n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ...
[ "0.78878975", "0.78861266", "0.7885083", "0.784229", "0.780055", "0.780055", "0.780055", "0.780055", "0.780055", "0.780055", "0.780055", "0.780055", "0.7784993", "0.7781625", "0.7781625", "0.7781625", "0.7781625", "0.7781625", "0.7781625", "0.7781625", "0.7781625", "0.77816...
0.7954126
1
Returns an array of bundles to register.
Возвращает массив пакетов для регистрации.
public function registerBundles() { $instances = []; foreach ($this->bundlesToRegister as $className) { $instances[] = new $className(); } return $instances; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function registerBundles()\n {\n $bundles = [];\n\n // Add framework bundles\n foreach ($this->standardBundles as $standardBundleClassRef) {\n $bundles[] = new $standardBundleClassRef;\n }\n\n // Add plugin specific bundles\n foreach ($this->pluginBund...
[ "0.76843786", "0.75968957", "0.74513686", "0.74513686", "0.73589057", "0.73392826", "0.72432613", "0.72243", "0.7179978", "0.71687454", "0.7115436", "0.7112292", "0.70055455", "0.6940337", "0.693399", "0.6899775", "0.6856655", "0.6856081", "0.68436694", "0.67838836", "0.67759...
0.8546189
0
Update the effective current default version to boot. If the version does not exist, it is set to INVALID. Function returns whether the currently selected version is actually installed locally.
Обновите эффективный текущий версионный дефолт для запуска. Если версия не существует, она устанавливается в INVALID. Функция возвращает, действительно ли выбранная версия установлена локально.
public static function updateCurrentBootSetting() { $default = Property::get(self::PROPERTY_DEFAULT_BOOT); if ($default === false) return false; $slashes = substr_count($default, '/'); if ($slashes === 2) { // Specific version $ver = Database::queryFirst('SELECT versionid, installed FROM minilinux_version WHERE versionid = :versionid', ['versionid' => $default]); } elseif ($slashes === 1) { // Latest from branch $ver = Database::queryFirst('SELECT versionid, installed FROM minilinux_version WHERE branchid = :branchid AND installed = 1 ORDER BY dateline DESC', ['branchid' => $default]); } else { // Unknown return false; } // Determine state if ($ver === false) { // Doesn't exist Property::set(self::PROPERTY_DEFAULT_BOOT_EFFECTIVE, self::INVALID); return false; } Property::set(self::PROPERTY_DEFAULT_BOOT_EFFECTIVE, $ver['versionid']); return $ver['installed'] != 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function plugin_fusinvinventory_needUpdate() {\n $version = \"2.3.0\";\n include (GLPI_ROOT . \"/plugins/fusinvinventory/install/update.php\");\n $version_detected = pluginFusinvinventoryGetCurrentVersion($version);\n if ((isset($version_detected)) AND ($version_detected != $version)) {\n return 1;\n ...
[ "0.6303701", "0.6262967", "0.62564766", "0.6173638", "0.608753", "0.6047358", "0.60265356", "0.59596276", "0.5911071", "0.5890338", "0.58690727", "0.58690727", "0.58690727", "0.5840714", "0.57841396", "0.57841396", "0.57841396", "0.57841396", "0.57841396", "0.5783165", "0.577...
0.78879607
0
Get the MARC record for this holding object.
Получите запись MARC для этого объекта хранения.
public function getRecord() { return $this->init()->_marc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRecord()\n {\n return $this->_record;\n }", "public function getRecord() {\n return $this->Record;\n }", "public function getRecord()\n {\n return $this->record;\n }", "public function getRecord()\n {\n return $this->_content;\n }", "publi...
[ "0.6571312", "0.65651995", "0.655664", "0.646575", "0.64251465", "0.6370275", "0.6285541", "0.6274402", "0.6120168", "0.6119308", "0.6005091", "0.59143436", "0.5860308", "0.5840645", "0.580186", "0.57730603", "0.57362103", "0.5724078", "0.5724078", "0.57235605", "0.56700534",...
0.8334428
0
Set the fee percentage.
Установите процентную ставку комиссии.
public function setFeePercentage($feePercentage) { $this->fee_percentage = (float) $feePercentage; return $this->save(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setFeePercentAttribute($input)\n {\n $this->attributes['fee_percent'] = $input ? $input : null;\n }", "public function setFeePercentage($transactionId, $feePercentage) {\n $modelName = $this->getModelNamePrefixed('AccUserCustomPayment');\n $relationalFieldName = $this->...
[ "0.7543214", "0.6946806", "0.69353586", "0.68617886", "0.6780773", "0.6611599", "0.6556769", "0.65316117", "0.6489566", "0.6447752", "0.6439336", "0.6392166", "0.6306955", "0.6296425", "0.62299496", "0.61566395", "0.6147137", "0.6102522", "0.6102522", "0.6024505", "0.5970466"...
0.76955056
0
/data para el grid: Vcliente
/data для сетки: Vcliente
public function getVcliente(){ $aColumns = array( 'chk','nombrecompleto','tipo_persona','telefono','numerodocumento','7' ); //para la ordenacion y pintado en html /* * Ordenando, se verifica por que columna se ordenara */ $sOrder = ""; for ( $i=0 ; $i<intval( $this->_iSortingCols ) ; $i++ ){ if ( Formulario::getParam( 'bSortable_'.intval(Formulario::getParam('iSortCol_'.$i)) ) == "true" ){ $sOrder .= " ".$aColumns[ intval( Formulario::getParam('iSortCol_'.$i) ) ]." ". (Formulario::getParam('sSortDir_'.$i)==='asc' ? 'asc' : 'desc') .","; } } $sOrder = substr_replace( $sOrder, "", -1 ); $query = "call sp_ventaClienteGrid(:iDisplayStart,:iDisplayLength,:sOrder,:sSearch);"; $parms = array( ':iDisplayStart' => $this->_iDisplayStart, ':iDisplayLength' => $this->_iDisplayLength, ':sOrder' => $sOrder, ':sSearch' => $this->_sSearch, ); $data = $this->queryAll($query,$parms); return $data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clientes(){\r\n // $dados = $catabagulho->get('catabagulho');\r\n\r\n // $this->view('Clientes',$dados);\r\n\r\n $this->view('Clientes');\r\n }", "function getdata(){\n\t\t$grid = $this->jqdatagrid;\n\n\t\t// CREA EL WHERE PARA LA BUSQUEDA EN EL ENCABEZADO\n\t\t$mWHE...
[ "0.66286385", "0.6425809", "0.6295488", "0.6271975", "0.62523526", "0.6233862", "0.6164835", "0.61084026", "0.6101304", "0.6088844", "0.6067078", "0.60585696", "0.60277337", "0.6014671", "0.60096395", "0.6007095", "0.5994128", "0.5977766", "0.5971462", "0.5969681", "0.5964238...
0.7565468
0
get customer SQL RowID by their Paype customer id
получить SQL RowID клиента по их Paype customer id
private function getCustomerRowId($customer) { // first by Paype customer_id then email to get cases where customer_id was updated $query = mssql_query('select RowID as id from Clientcard where card="' . $customer->customer_id . '" or Mail="' . $customer->email . '"'); $result = mssql_fetch_object($query); if(empty($result->id)) { //paypeLog('can not find customer in mssql to update'); return 0; } return $result->id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRowID()\n {\n $row= parent::row(\"SELECT * FROM usuario WHERE indicador = :indicador\", array(\"indicador\"=>\"$this->indicator\"));\n return $row;\n }", "private function getCustomerId()\n {\n $query = $this->db->query(\"SELECT customer_id FROM api_customer_acces...
[ "0.672976", "0.67052656", "0.6634728", "0.6634728", "0.6634728", "0.6634728", "0.6634728", "0.6634728", "0.6493995", "0.646101", "0.6353001", "0.62233555", "0.62130094", "0.61625844", "0.61625844", "0.61625844", "0.6151803", "0.6142712", "0.61365366", "0.61365366", "0.6136536...
0.7170968
0
Map the raw user array to a Socialite User instance.
Преобразуйте массив пользователей в сыром виде в экземпляр пользователя Socialite.
abstract protected function mapUserToObject(array $user);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function mapUserToObject(array $user)\n\t{\n\t\treturn (new User)->setRaw($user)->map([\n\t\t\t'provider_id' => $user['id'],\n\t\t\t'first_name' => $user['fname'],\n\t\t\t'last_name' => $user['lname'],\n\t\t\t'email' => $user['email'],\n\t\t\t'provider_name' => 'staffconnect',\n\t\t\t'provider_...
[ "0.750099", "0.7239471", "0.72068995", "0.71961266", "0.71505576", "0.69540536", "0.64494437", "0.62584686", "0.6226247", "0.6215725", "0.61602986", "0.60920644", "0.606404", "0.6041082", "0.60152465", "0.5971368", "0.59531367", "0.5918052", "0.59169906", "0.59157985", "0.580...
0.75923395
0
Determine if the current request / session has a mismatching "state".
Определите, есть ли несоответствие "состояния" в текущем запросе / сессии.
protected function hasInvalidState() { if ($this->isStateless()) { return false; } $state = $this->request->getSession()->get('state'); return !(strlen($state) > 0 && $this->request->get('state') === $state); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function hasInvalidState()\n {\n $state = array_get($this->input, 'state');\n \n return ! ($state === $this->session->get($this->package('dot') . '.state'));\n }", "protected function hasInvalidState()\n {\n return ! ($this->c['request']->all('state') === $this->sto...
[ "0.73603207", "0.72486883", "0.64639133", "0.6214225", "0.611955", "0.6001174", "0.59660244", "0.59627473", "0.5957455", "0.59244126", "0.5905106", "0.5862804", "0.58589536", "0.58575636", "0.58464867", "0.5838637", "0.5832125", "0.58260584", "0.5819428", "0.58177584", "0.580...
0.7573509
0
Get the access token response for the given code.
Получить ответ с токеном доступа для заданного кода.
public function getAccessTokenResponse($code) { $http = $this->getHttp(); $params = $this->getTokenFields($code); $response = $http->accept('application/json')->post($this->getTokenUrl(), $params); return $http->parseJson($response->getBody()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAccessTokenResponse($code)\n {\n $response = $this->getHttpClient()->post($this->getTokenUrl(), [\n 'headers' => ['Accept' => 'application/json'],\n 'form_params' => $this->getTokenFields($code),\n ]);\n\n $responseBody = json_decode($response->getBo...
[ "0.86762094", "0.8618482", "0.8399633", "0.83041096", "0.80584466", "0.80539143", "0.8045491", "0.80431646", "0.80302334", "0.8001009", "0.7979048", "0.7957361", "0.7941553", "0.7841483", "0.78278965", "0.78123116", "0.7799773", "0.77955264", "0.7791747", "0.7713027", "0.7640...
0.87082213
0
Get the code from the request.
Получите код из запроса.
protected function getCode() { return $this->request->get('code'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCodeFromRequest(){\r\n $this->code = $_GET[self::RESPONSE_TYPE_PARAM];\r\n return $this->code;\r\n }", "protected function getCode()\n {\n return $this->c['request']->all(static::TOKEN_REQUEST);\n }", "protected function getCode()\n {\n return array_ge...
[ "0.82489794", "0.8123001", "0.79279876", "0.781791", "0.72221416", "0.72194886", "0.7191786", "0.71301717", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248", "0.706248"...
0.87471193
0
Determine if the provider is operating as stateless.
Определите, работает ли провайдер в состоянииless режиме.
protected function isStateless() { return $this->stateless; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function usesState()\n {\n return !$this->stateless;\n }", "public function setAsStateless()\n {\n $this->isStateless = true;\n }", "public function getIsActive()\n {\n return ArrayHelper::getValue($this->_pool, \"$this->hostname:$this->port\", false) !== false;\n ...
[ "0.7267228", "0.6222698", "0.5935825", "0.5923693", "0.58585733", "0.58259547", "0.58021325", "0.57825816", "0.577617", "0.57668793", "0.57668793", "0.57493806", "0.5744533", "0.57398593", "0.57398593", "0.57398593", "0.57398593", "0.57398593", "0.57398593", "0.57398593", "0....
0.7900281
0
Set broker configuration service to broker info configuration
Установите службу конфигурации брокера в конфигурацию информации о брокере
public function setBrokerConfigurationService(BrokerConfigurationService $brokerConfigurationService): void { $this->brokerConfigurationService = $brokerConfigurationService; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function configure(){\n// $broker = BrokerFactory::getBroker($this->brokerType, $pamelContext, $this->from);\n// $broker->from()->process($this->processor)->to($this->to);\n }", "protected function setupBroker()\n {\n $this->endpoint = mconfig('finance.mpesa.endpoint');\n ...
[ "0.69190174", "0.6688995", "0.65327245", "0.64367735", "0.6325133", "0.61320496", "0.61015874", "0.5971474", "0.59296733", "0.58770216", "0.5843018", "0.5808474", "0.577083", "0.5767479", "0.57503456", "0.5674206", "0.5674206", "0.55750763", "0.5572146", "0.55263984", "0.5507...
0.70806175
1
Used to generate unique wallet number by client id
Используется для генерации уникального номера кошелька по идентификатору клиента
public static function generateWalletNumber( int $clientId ): int { $eWalletNumber = self::$eWalletNumberPrefix . self::generateRandomNumberByUniqueId( $clientId ); return LuhnAlgorithm::create( $eWalletNumber ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createPaymentUniqueId()\n {\n return Random::getAlphanumericString(32);\n }", "private function __genClientId() {\n return uniqid('mqttx_');\n }", "private function generateClientIdentificationNumber() : string {\n return generateUUIDVersion5(env('APP_URL'));\n ...
[ "0.744121", "0.74276805", "0.7346653", "0.7190271", "0.7167464", "0.7116946", "0.70683354", "0.70608944", "0.7015393", "0.6996458", "0.6989479", "0.6956989", "0.69246596", "0.6914593", "0.6905067", "0.6905067", "0.6889506", "0.6884507", "0.6875819", "0.6862859", "0.6857447", ...
0.77243865
0
Record any rank changes
Записывать любые изменения ранга
private function recordGrandCompanyRankChange() { $this->io->text('---> '. __METHOD__); $old = $this->old->grandcompany->{$this->currentGrandCompanyId}; $new = $this->new->grandcompany->{$this->currentGrandCompanyId}; // check for diff, so simple if ($old != $new) { $this->addGrandCompanyEvent( $this->currentGrandCompanyId, $old, $new ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateRanks(){\n\t\t$weights = Configure::read('Weight.class');\n\t\t$fields = array('id', 'rank', 'weight_type', 'retired');\n\t\tforeach($weights as $key => $weight){\n /*MUST HAVE BEEN ON CRACK WHEN I WROTE THIS*/\n\t\t\t/*$count = 1;\n\t\t\t$boxers = $this->find('all', array('conditi...
[ "0.6249817", "0.61603785", "0.6147248", "0.60795844", "0.60300815", "0.59853464", "0.59656626", "0.5922244", "0.58955777", "0.587671", "0.57533544", "0.5735105", "0.5641177", "0.55941874", "0.55828875", "0.5525579", "0.5475375", "0.54637414", "0.54571885", "0.54509884", "0.54...
0.7399324
0
Retrieves applications using various filters
Получает приложения с использованием различных фильтров
private static function get_applications(array $filters, $extend = true) { $applications = array(); $storage = new midgard_query_storage('com_meego_devprogram_application'); $q = new midgard_query_select($storage); if ( count($filters) > 1 || (count($filters) == 1 && ! array_key_exists('status', $filters))) { $qc = new midgard_query_constraint_group('AND'); } foreach ($filters as $filter => $value) { switch ($filter) { case 'creator': // check if creator guid is valid if (mgd_is_guid($value)) { $constraint = new midgard_query_constraint( new midgard_query_property('metadata.creator'), '=', new midgard_query_value($value) ); } break; case 'program': case 'status': if ($value) { $constraint = new midgard_query_constraint( new midgard_query_property($filter), '=', new midgard_query_value($value) ); } break; } // set the constraint if (is_a($qc, 'midgard_query_constraint_group')) { $qc->add_constraint($constraint); } else { $qc = $constraint; } } if (! array_key_exists('status', $filters)) { // if status was not set explicitly then include all but cancelled applications $constraint = new midgard_query_constraint( new midgard_query_property('status'), '<', new midgard_query_value(CMD_APPLICATION_CANCELLED) ); // set the constraint if (count($filters) >= 1) { if (! is_a($qc, 'midgard_query_constraint_group')) { $qc = new midgard_query_constraint_group('AND'); } $qc->add_constraint($constraint); } else { $qc = $constraint; } } $q->set_constraint($qc); $q->execute(); // does not seem to work // @bug: $q->toggle_read_only(false); $objects = $q->list_objects(); foreach ($objects as $object) { if ($extend) { $applications[] = self::extend_application($object); } else { $applications[] = $object; } } return $applications; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getApplicationsFilter($params)\n\t{\n\t\t// *************************\n\t\t// * User inclusions Filter 0\n\t\t// * DO NOT DELETE OR CHANGE THOSE COMMENTS\n\t\t// *************************\n\n\t\t// ... (Add additional operations here) ...\n\t\tif (empty($params['title'])\n\t\t\t&& empty($params['up...
[ "0.73226935", "0.7137385", "0.7032066", "0.70055914", "0.69629586", "0.6946631", "0.6918236", "0.690884", "0.68997264", "0.68995214", "0.6861881", "0.6818788", "0.66865015", "0.6614569", "0.6611133", "0.6574307", "0.6530541", "0.65050817", "0.65047884", "0.644804", "0.6395051...
0.7776914
0
constructs an instance of this class from a Payload obtained from the Feeligo SDK, and saves the action to the SE4 activity feed. The payload is assumed to be of the correct type `user_sent_gift_to_user`
создает экземпляр этого класса на основе Payload, полученного из SDK Feeligo, и сохраняет действие в поток активности SE4. Предполагается, что payload имеет правильный тип `user_sent_gift_to_user`
public function create ($payload) { // find or create the actiontype and get an adapter for it $selector = new Feeligo_Model_Selector_UserSentGiftToUserActionTypes(); $action_type = $selector->find_or_create($payload); if ($action_type === null) return null; // build the action $se_action = $this->table()->addActivity( // sender (($s = $payload->adapter_sender()) !== null ? $s->user() : null), // recipient (($r = $payload->adapter_recipient()) !== null ? $r->user() : null), // action type $action_type->type(), // action body $this->_body_from_payload($payload), // params $params = null ); // gift attachment to display the picture of the gift and the message if ($se_action !== null) { // build Feeligo_Model_Gift $giftsTable = Engine_Api::_()->getDbtable('gifts', 'feeligo'); $gift = $giftsTable->createRow(); // set Feeligo_Model_Gift properties $gift->name = $payload->gift()->name; $gift->message = $payload->gift()->message; $gift->medium_url = $payload->medium_url('medium', '60x72'); // save the Feeligo_Model_Gift $gift->save(); // attach Feeligo_Model_Gift to action $se_action->attach($gift); } // return an instance of this class wrapping the SE4 action if ($se_action !== null) { return new Feeligo_Model_Adapter_Action($se_action); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create ($payload) {\n // at the moment, only the `user_sent_gift_to_user` type is supported\n if ($payload->name() == 'user_sent_gift_to_user') {\n $selector = new Feeligo_Model_Selector_UserSentGiftToUserActions();\n return $selector->create($payload);\n }\n return null;\n }...
[ "0.640523", "0.53067976", "0.51411074", "0.51114434", "0.5037182", "0.49993715", "0.49916935", "0.49916235", "0.49290502", "0.49274945", "0.49039924", "0.4893684", "0.47315457", "0.47227693", "0.4708615", "0.4684299", "0.46712497", "0.46431535", "0.46303153", "0.46285897", "0...
0.729184
0
Test to ensure that the current PageObject represents a model's values Uses $object>getCamelMapKey() and $this>setCamelMapKey() to make the translation. If specific map keys do not match this get/set pattern, list them in $this>modelSkip and make sure to implement the comparison in your class's assertEqualsModel() method.
Тест для обеспечения того, чтобы текущий PageObject представлял значения модели. Используется $object->getCamelMapKey() и $this->setCamelMapKey() для перевода. Если конкретные ключи карты не соответствуют этому шаблону get/set, перечислите их в $this->modelSkip и убедитесь, что реализовали сравнение в методе assertEqualsModel() вашего класса.
public function assertEqualsModel($object, $message = '') { foreach ($this->map as $field => $locator) { if (!in_array($field, $this->modelSkip)) { // Get the value from the PageObject $value = self::getByField($this, $field); // Get the value from the model $object $expect = self::getByField($object, $field); // If what is passed is an object, convert to a string using // __toString if (is_object($expect)) { $expect = (string) $expect; } $this->se->assertEquals($expect, $value, $message . ' (' . $field . ')'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGetObjectsPropertyValues()\n {\n $objects = ['one' => new \\stdClass(), 'two' => new \\stdClass(), 'three' => new \\stdClass()];\n $objects['one']->value = 145;\n $objects['two']->title = 'miscellaneous';\n $objects['three']->value = 'very good';\n $objects...
[ "0.5499922", "0.5216225", "0.5173052", "0.51176304", "0.51055735", "0.50730664", "0.50258076", "0.50121737", "0.4978315", "0.49697497", "0.49657544", "0.49384728", "0.48844123", "0.4878345", "0.48771632", "0.48660433", "0.4861385", "0.48485222", "0.4840916", "0.47978336", "0....
0.7204362
0
Convert a field name to camel case for usage in the getter and setter.
Преобразуйте имя поля в стиль camelCase для использования в getter и setter.
protected static function getCamelField($field) { return str_replace(' ', '', ucwords(str_replace('_', ' ', $field))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCamelCase($field)\n {\n return preg_replace_callback('#\\_([a-z])#', function ($matches) {\n if (isset($matches[1])) {\n return strtoupper($matches[1]);\n }\n }, $field);\n }", "public function fieldToName($field)\n\t{\n\t\t// di lowerca...
[ "0.75884235", "0.7587629", "0.7392353", "0.69869524", "0.69647086", "0.67807454", "0.6759853", "0.66661674", "0.6653719", "0.6616719", "0.65707856", "0.65461457", "0.6545912", "0.65392965", "0.65194035", "0.6498292", "0.64443463", "0.64144534", "0.64095455", "0.6364385", "0.6...
0.78792536
0
The function add product data to session.
Функция добавляет данные продукта в сессию.
function lb_add_product_data_to_session() { if ( ! isset( $_GET['add_to_cart'] ) ) { return; } $product_id = esc_html( $_GET['add_to_cart'] ); $flag = false; if ( isset( $_SESSION['cart'] ) ) { foreach ( $_SESSION['cart'] as $key => $product ) { if ( $product_id === $product['product_id'] ) { $_SESSION['cart'][ $key ]['product_count'] += 1; $flag = true; } } } if ( ! $flag ) { $add_product = array( 'product_id' => $product_id, 'product_count' => 1, ); $_SESSION['cart'][] = $add_product; } if ( 'single_product' === $_GET['action'] ) { lb_redirect( '?action=' . esc_html( $_GET['action'] ) . '&id=' . esc_html( $_GET['id'] ) ); } else { lb_redirect( '?action=' . esc_html( $_GET['action'] ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToCart(){\n\t\t\tarray_push($_SESSION[\"allProducts\"], $_SESSION[\"singleProduct\"]);\n\t\t}", "public function saveInSession() \n {\n $_SESSION['cart'] = $this->products;\n }", "function add($product) {\n\t\t// load the cart\n\t\t$cart = session('cart');\n\t\t\n\t\t// append the new ...
[ "0.7517207", "0.7504487", "0.7434629", "0.7302374", "0.7104496", "0.70903534", "0.70720124", "0.7008384", "0.70003265", "0.6979994", "0.6968703", "0.69669145", "0.69526356", "0.69035214", "0.68847203", "0.6882752", "0.6822258", "0.67860466", "0.6768273", "0.6753079", "0.67362...
0.81111956
0
The function delete product data to session.
Функция удаляет данные продукта из сессии.
function lb_delete_product_data_from_session() { if ( ! isset( $_GET['delete_from_cart'] ) ) { return; } $product_id = esc_html( $_GET['delete_from_cart'] ); foreach ( $_SESSION['cart'] as $key => $product ) { if ( $product_id === $product['product_id'] ) { unset( $_SESSION['cart'][ $key ] ); } } if ( 'single_product' === $_GET['action'] ) { lb_redirect( '?action=' . esc_html( $_GET['action'] ) . '&id=' . esc_html( $_GET['id'] ) ); } else { lb_redirect( '?action=' . esc_html( $_GET['action'] ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function DeleteSessionFromProductsSection(){\n\n session()->forget('pos');\n }", "public function delete() \n {\n Session::delete('products');\n Session::delete('orderActive');\n\n header(\"Location: /cart\");\n die();\n }", "public function actionDeleteproduc...
[ "0.78800863", "0.7676253", "0.7418475", "0.7367726", "0.7291519", "0.7278297", "0.7207258", "0.71701", "0.7154634", "0.7120102", "0.7100028", "0.7078566", "0.7019286", "0.7013899", "0.7003582", "0.6991878", "0.69903046", "0.69729835", "0.6968259", "0.696723", "0.694997", "0...
0.795539
0
The function add product count on view cart page.
Функция добавления количества товара на странице корзины.
function lb_add_product_count_in_session_on_view_cart() { if ( ! isset( $_POST['update_cart'] ) || empty( $_POST['add_product_count'] ) ) { return; } $products_count = $_POST['add_product_count']; foreach ( $products_count as $key => $value ) { foreach ( $_SESSION['cart'] as &$product ) { if ( $product['product_id'] === (string) $key ) { $product['product_count'] = lb_get_count_product_in_cart( (string) $key ) + $value; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lb_add_product_count_in_session() {\n\tif ( ! isset( $_POST['add_to_cart'] ) ) {\n\t\treturn;\n\t}\n\n\t$add_count = esc_html( $_POST['add_product_count'] );\n\t$product_id = esc_html( $_POST['add_to_cart'] );\n\t$flag = false;\n\n\tif ( empty( $_SESSION['cart'] ) ) {\n\t\t$add_product = array(\n\t...
[ "0.76243025", "0.76232743", "0.7508664", "0.7462759", "0.7423504", "0.7291411", "0.7198311", "0.7169258", "0.715697", "0.71357304", "0.71224755", "0.70902526", "0.7070621", "0.70628184", "0.70557415", "0.7038508", "0.7012738", "0.69758767", "0.69559246", "0.69441015", "0.6929...
0.82449096
0
The function return count product in cart by id.
Функция возвращает количество товара в корзине по id.
function lb_get_count_product_in_cart( $id ) { if ( ! $_SESSION['cart'] ) { return 0; } $count = 0; foreach ( $_SESSION['cart'] as $product ) { if ( $id === $product['product_id'] ) { $count = $product['product_count']; } } return $count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function count_product(){\r\r\n\t\treturn count($this->current_cart);\r\r\n\t}", "static function cartCount(){\n //get user id\n $userId = Session::get('customer')->id;\n\n //get Count where user id matches $userId\n return Cart::where('user_id', $userId)->count();\n }", "fu...
[ "0.76852363", "0.7591241", "0.74125504", "0.7330161", "0.7309709", "0.7302945", "0.7255768", "0.717375", "0.7162164", "0.7137811", "0.71342766", "0.7109387", "0.70419335", "0.7029097", "0.7028848", "0.7028483", "0.7013709", "0.70033056", "0.69791216", "0.6969915", "0.6940243"...
0.85524184
0
Set a cookie with the current time of day
Установите cookie с текущим временем суток
function add_Cookie() { setcookie("last_visit_time", date("r"), time()+60*60*24*30, "/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setCookieTime(){\n $this->cookieExpireTime = time()+250;\n }", "private function setExpirationDate( $day ) {\n $this->cookieExpire = time() + ($day * 24 * 60 * 60);\n }", "private function setCookie() {\n setcookie(\"user_id\", $this->id, time() + (7 * 24 * 60 * 6...
[ "0.72575885", "0.6985397", "0.6978149", "0.67352134", "0.66883564", "0.65810156", "0.65527403", "0.6533528", "0.6518516", "0.64984185", "0.6492384", "0.6332576", "0.6326015", "0.62778795", "0.6270574", "0.62437224", "0.6242689", "0.6227591", "0.62219805", "0.6210957", "0.6174...
0.7033307
1
si los caracteres $mini de $i son numericos, entonces $mini=0
если символы $mini из $i являются числовыми, тогда $mini=0
function testnumorfnc1() { $this->mini=$this->mini-1; if($this->i+$this->mini <= strlen($this->cadena)) { do { if(ord(substr($this->cadena,$this->i-1+$this->mini,1)) < 48 or ord(substr($this->cadena,$this->i-1+$this->mini,1)) > 57 and ord(substr($this->cadena,$this->i-1+$this->mini,1)) <> 202) { break; } else { $this->mini=$this->mini-1; } } while ($this->mini >= 0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testnum()\n\t{\n\t\t/*\n\t\tTestNum:\n 'if the mini% characters from i% are numeric, then mini%=0\n mini% = mini% - 1\n If i% + mini% <= Len(chaine$) Then\n Do While mini% >= 0\n If Asc(Mid$(chaine$, i% + mini%, 1)) < 48 Or Asc(Mid$(chaine$, i% + mini%, 1)) > 57 Then Exit Do\n mini% = mini...
[ "0.7233602", "0.60883707", "0.60494757", "0.5939228", "0.58192325", "0.57478166", "0.5708242", "0.56411564", "0.56233644", "0.56154364", "0.55419046", "0.55388963", "0.5517296", "0.55164564", "0.55047727", "0.5501789", "0.5477554", "0.5472631", "0.5465366", "0.54553384", "0.5...
0.71462584
1
si los caracteres de $mini son numericos, entonces $mini=0
если символы $mini являются числовыми, то $mini=0
function testnum() { /* TestNum: 'if the mini% characters from i% are numeric, then mini%=0 mini% = mini% - 1 If i% + mini% <= Len(chaine$) Then Do While mini% >= 0 If Asc(Mid$(chaine$, i% + mini%, 1)) < 48 Or Asc(Mid$(chaine$, i% + mini%, 1)) > 57 Then Exit Do mini% = mini% - 1 Loop End If Return */ $this->mini=$this->mini-1; if($this->i-1 + $this->mini <= strlen($this->cadena)) { do { //If Asc(Mid$(chaine$, i% + mini%, 1)) < 48 Or Asc(Mid$(chaine$, i% + mini%, 1)) > 57 Then Exit Do if(ord(substr($this->cadena,$this->i-1+$this->mini,1)) < 48 or ord(substr($this->cadena,$this->i-1+$this->mini,1)) > 57) { break; } $this->mini=$this->mini-1; } while ($this->mini >= 0); } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testnumorfnc1()\n\t{\n\t\t$this->mini=$this->mini-1;\n\t\tif($this->i+$this->mini <= strlen($this->cadena))\n\t\t{\n\n\t\t\tdo\n\t\t\t{\n\t\t\t\tif(ord(substr($this->cadena,$this->i-1+$this->mini,1)) < 48 or ord(substr($this->cadena,$this->i-1+$this->mini,1)) > 57 and ord(substr($this->cadena,$this->i-1+$...
[ "0.7164935", "0.6286974", "0.5798422", "0.5652413", "0.56501895", "0.5648812", "0.56028444", "0.5563165", "0.55571645", "0.5549037", "0.5516139", "0.5511793", "0.5500415", "0.54902595", "0.54795635", "0.5471219", "0.544451", "0.5424509", "0.5419577", "0.5405562", "0.5396872",...
0.71623755
1
Create a cache item for a request.
Создайте элемент кэша для запроса.
protected function createCacheItem(RequestInterface $request) { $key = sha1($this->generator->generate($request)); return $this->pool->getItem($key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createCache();", "public function createItem($key, $value = null, $ttl = null)\n {\n $item = new CacheItem($this, $key);\n if($value !== null)\n {\n $item->set($value, $ttl);\n }\n return $item;\n }", "protected function createCacheItem($key)\n {\n $factory = $th...
[ "0.6788083", "0.6621718", "0.6402061", "0.6341115", "0.62605757", "0.619369", "0.5977138", "0.5974321", "0.5889199", "0.5877127", "0.58006376", "0.57980216", "0.5773475", "0.57281977", "0.5723925", "0.56786495", "0.5672939", "0.56530905", "0.5652517", "0.56216127", "0.557399"...
0.73991096
0
Testing the base input rules.
Тестирование базовых правил ввода.
public function testInputRules() { // Regex $input = new Input('inputRules'); $input->rules('regex:/^.+\/+$/'); $this->assertEquals('^.+\/+$', $input->get('pattern')); // Accepted. $input = new Input('inputRules'); $input->rules('accepted'); $this->assertEquals('required', $input->get('required')); // Active URL. $input = new Input('inputRules'); $input->rules('active_url'); $input->value('umflint.edu'); $this->assertEquals(true, checkdnsrr($input->get('value'), 'ANY')); // After date. $input = new Input('inputRules'); $input->rules('after:2016-09-20'); $this->assertEquals('2016-09-20', $input->get('min')); // Alpha. $input = new Input('inputRules'); $input->rules('alpha'); $this->assertEquals('[a-zA-Z]+', $input->get('pattern')); // Alpha dash. $input = new Input('inputRules'); $input->rules('alpha_dash'); $this->assertEquals('[a-zA-Z0-9_\-]+', $input->get('pattern')); // Alpha num. $input = new Input('inputRules'); $input->rules('alpha_num'); $this->assertEquals('[a-zA-Z0-9]+', $input->get('pattern')); // Before date. $input = new Input('inputRules'); $input->rules('before:2016-09-15'); $this->assertEquals('2016-09-15', $input->get('max')); // Between. $input = new Input('inputRules'); $input->rules('between:2,5'); $this->assertEquals('2', $input->get('minlength')); $this->assertEquals('5', $input->get('maxlength')); // Boolean. $input = new Input('inputRules'); $input->rules('boolean'); $this->assertEquals('0|1', $input->get('pattern')); // Digit. $input = new Input('inputRules'); $input->rules('digits:5'); $this->assertEquals('\d{5}', $input->get('pattern')); // Digits between. $input = new Input('inputRules'); $input->rules('digits_between:0,9'); $this->assertEquals('\d{0,9}', $input->get('pattern')); // Image. $input = new Input('inputRules'); $input->rules('image'); $this->assertEquals('image/*', $input->get('accept')); // In. $input = new Input('inputRules'); $input->rules('in:foo,bar'); $this->assertEquals('foo|bar', $input->get('pattern')); // Not in. $input = new Input('inputRules'); $input->rules('not_in:foo,bar'); $this->assertEquals('(?:(?!^foo$|^bar$).)*', $input->get('pattern')); // Integer. $input = new Input('inputRules'); $input->rules('integer'); $this->assertEquals('\d+', $input->get('pattern')); // Max value. $input = new Input('inputRules'); $input->rules('max:500'); $this->assertEquals('500', $input->get('maxlength')); // Min. $input = new Input('inputRules'); $input->rules('min:256'); $this->assertEquals('256', $input->get('minlength')); // Mimes. $input = new Input('inputRules'); $input->rules('mimes:jpeg,bmp,gif,png'); $this->assertEquals('.jpeg, .bmp, .gif, .png', $input->get('accept')); // Numeric. $input = new Input('inputRules'); $input->rules('numeric'); $this->assertEquals('[-+]?[0-9]*[.,]?[0-9]+', $input->get('pattern')); // Required. $input = new Input('inputRules'); $input->rules('required'); $this->assertEquals('required', $input->get('required')); // Size. $input = new Input('inputRules'); $input->rules('size:500'); $this->assertEquals('.{500}', $input->get('pattern')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "abstract public function rules();", "...
[ "0.70430934", "0.69580793", "0.69580793", "0.69580793", "0.69580793", "0.69580793", "0.69580793", "0.69580793", "0.69580793", "0.69580793", "0.69580793", "0.69580793", "0.670575", "0.64983314", "0.64976823", "0.6417076", "0.63760597", "0.63760597", "0.63760597", "0.63318425", ...
0.76307476
0
Cleanly close the socket and clear buffer contents.
Чисто закройте сокет и очистите содержимое буфера.
public function close(): void { $this->socket->close(); $this->buffer = false; $this->id = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function close(): void\n {\n if ($this->socket) {\n \\fclose($this->socket);\n }\n\n $this->free();\n }", "private function close()\n {\n // Safe disconnection\n if ($this->socket)\n {\n @socket_close($this->socket);\n }\n ...
[ "0.773937", "0.771036", "0.765034", "0.75609285", "0.7550483", "0.7550269", "0.74575204", "0.74508417", "0.7442132", "0.73848027", "0.7379893", "0.72072816", "0.71400785", "0.71047306", "0.70539826", "0.7042693", "0.694991", "0.69405913", "0.6898408", "0.6896665", "0.68880606...
0.788836
0
Tests a simple business request
Проверяет простой бизнес-запрос
public function testBusinessRequestIsCorrect() { // This request is returned as a JSON object $request = \Ebanx\Ebanx::doRequest($this->bizParams); $params = json_decode($request['params']['request_body'], true); $this->assertEquals('POST', $request['method']); $this->assertEquals('https://api.ebanxpay.com/ws/direct', $request['action']); $this->assertEquals(true, $request['decode'], true); $this->assertEquals($this->bizParams['mode'], $params['mode']); $this->assertEquals($this->bizParams['operation'], $params['operation']); $this->assertEquals($this->bizParams['payment']['person_type'], $params['payment']['person_type']); $this->assertEquals($this->bizParams['payment']['merchant_payment_code'], $params['payment']['merchant_payment_code']); $this->assertEquals($this->bizParams['payment']['amount_total'], $params['payment']['amount_total']); $this->assertEquals($this->bizParams['payment']['currency_code'], $params['payment']['currency_code']); $this->assertEquals($this->bizParams['payment']['name'], $params['payment']['name']); $this->assertEquals($this->bizParams['payment']['email'], $params['payment']['email']); $this->assertEquals($this->bizParams['payment']['document'], $params['payment']['document']); $this->assertEquals($this->bizParams['payment']['address'], $params['payment']['address']); $this->assertEquals($this->bizParams['payment']['street_number'], $params['payment']['street_number']); $this->assertEquals($this->bizParams['payment']['street_complement'], $params['payment']['street_complement']); $this->assertEquals($this->bizParams['payment']['city'], $params['payment']['city']); $this->assertEquals($this->bizParams['payment']['state'], $params['payment']['state']); $this->assertEquals($this->bizParams['payment']['zipcode'], $params['payment']['zipcode']); $this->assertEquals($this->bizParams['payment']['country'], $params['payment']['country']); $this->assertEquals($this->bizParams['payment']['phone_number'], $params['payment']['phone_number']); $this->assertEquals($this->bizParams['payment']['payment_type_code'], $params['payment']['payment_type_code']); $this->assertEquals($this->bizParams['payment']['responsible']['name'], $params['payment']['responsible']['name']); $this->assertEquals($this->bizParams['payment']['responsible']['document'], $params['payment']['responsible']['document']); $this->assertEquals($this->bizParams['payment']['responsible']['birth_date'], $params['payment']['responsible']['birth_date']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testGet()\n {\n /*$this->request->setMethod('GET');\n $this->request->getPost()->set('chave', 'valor');\n\n $result = $this->controller->dispatch($this->request);\n $response = $this->controller->getResponse();\n \n $this->assertEquals(200, $response->getStat...
[ "0.7199565", "0.70271635", "0.7020614", "0.7003322", "0.69944036", "0.6932148", "0.6889213", "0.68884915", "0.68861395", "0.6878977", "0.6877086", "0.6875712", "0.6875388", "0.6856207", "0.68547523", "0.6845495", "0.68136543", "0.6807706", "0.67699724", "0.6768599", "0.675970...
0.71031785
1
/++++++++ operations ++++++++ return type: void param address: string The email address. The constructor builds an Email object and validates the provided email address.
/++++++++ операции ++++++++ тип возвращаемого значения: void параметр address: string Электронный адрес. Конструктор создает объект Email и проверяет предоставленный электронный адрес.
function Email($address) {//_9_5_1_5e60209_1150903445781_525839_590 $this->address = $address; $this->validate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setEmail(string $address): self;", "public function __construct($emailAddress)\n {\n $this->emailAddress = $emailAddress;\n }", "public function __construct($email)\n {\n $this->email = $email;\n $this->validate();\n }", "public function __construct(Email $ema...
[ "0.7412863", "0.71493196", "0.7144659", "0.70445764", "0.69930005", "0.6937455", "0.69340754", "0.6896415", "0.689357", "0.68916345", "0.68676037", "0.68563473", "0.68563473", "0.682452", "0.67607814", "0.67177", "0.6693798", "0.6693798", "0.6672467", "0.6659934", "0.66235", ...
0.7689955
0
_9_5_1_5e60209_1150903445781_525839_590 return type: void This method validates the email address stored in the 'address attribute and stores the result in the 'valid' attribute. POST: 'valid' is set.
_9_5_1_5e60209_1150903445781_525839_590 тип возвращаемого значения: void Этот метод проверяет адрес электронной почты, хранящийся в атрибуте 'address', и сохраняет результат в атрибут 'valid'. POST: 'valid' устанавливается.
function validate() {//_9_5_1_5e60209_1150903709640_35795_595 $this->address = trim(strtolower($this->address)); // eregi is case insensitive, but we want lower case anyway if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $this->address) === false) { Email::dump("Address ".$this->address." is invalid!"); $this->valid = false; } else { Email::dump("Address ".$this->address." is valid."); $this->valid = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate()\n {\n $result = StaticValidator::execute(\n $this->email,\n 'EmailAddress',\n array('allow' => Hostname::ALLOW_DNS)\n );\n \n if ($result === false) {\n $this->email = 'No valid email';\n }\n }", "publ...
[ "0.72994643", "0.7000966", "0.6912085", "0.6848818", "0.6662965", "0.6633182", "0.66145486", "0.6559192", "0.6542667", "0.6505656", "0.64955866", "0.6489193", "0.6439909", "0.6391067", "0.63564515", "0.6337947", "0.6336753", "0.6333194", "0.6331242", "0.63193005", "0.631915",...
0.7718032
0
Show the form for creating a new Huella.
Показать форму для создания новой Huella.
public function create() { return view('huellas.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCreateForm(){\n return view('admin.Ebuletin.create');\n }", "public function create()\n {\n /*show create form maybe not nessesary*/\n }", "public function create()\n {\n //TODO : Tampilkan Form Create Mahasiswa\n return view('mahasiswa.create');\n }", ...
[ "0.76867884", "0.7667199", "0.7638027", "0.76098096", "0.76029706", "0.7566094", "0.75559443", "0.7454933", "0.7447273", "0.74423224", "0.74296916", "0.7421007", "0.7419843", "0.74129176", "0.7411221", "0.7410704", "0.74097043", "0.74092704", "0.7406268", "0.7405344", "0.7395...
0.76849335
1
Store a newly created Huella in storage.
Храните новую созданную Huella в хранилище.
public function store(CreateHuellaRequest $request) { $input = $request->all(); $huella = $this->huellaRepository->create($input); Flash::success('Huella saved successfully.'); return redirect(route('huellas.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\r\n\t\t{\r\n\t\t\t//\r\n\t\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()\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...
[ "0.67636615", "0.672805", "0.672805", "0.672805", "0.672805", "0.672805", "0.672805", "0.6704392", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.66614205", "0.666142...
0.727892
0
Get upload dir, if has been not defined. If we are in wordpress, then use the wpcontent directory. If not, use script path and url
Получить каталог для загрузки, если он не определен. Если мы находимся в WordPress, используйте каталог wpcontent. Если нет, используйте путь и URL скрипта
private static function getUploadDir() { if( self::$upload_dir == null && function_exists('wp_upload_dir') ) { self::$upload_dir = wp_upload_dir(); self::$upload_dir['basedir'] .= '/freshizer'; self::$upload_dir['baseurl'] .='/freshizer'; } else if ( self::$upload_dir == null && !function_exists('wp_upload_dir') ) { $script_dir = realpath(dirname(__FILE__)); $script_url = 'http://'.$_SERVER['SERVER_NAME'] . str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', $script_dir); self::$upload_dir['basedir'] = $script_dir.'/freshizer'; self::$upload_dir['baseurl'] = $script_url.'/freshizer'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_get_upload_dir()\n{\n}", "function get_base_upload_path() {\t\n\t\tif ( defined( 'UPLOADS' ) && ! ( is_multisite() && get_site_option( 'ms_files_rewriting' ) ) ) {\n\t\t\treturn ABSPATH . UPLOADS;\n\t\t}\n\n\t\t$upload_path = trim( get_option( 'upload_path' ) );\n\n\t\tif ( empty( $upload_path ) || '...
[ "0.7895308", "0.7855336", "0.7787277", "0.7705648", "0.75571996", "0.74731386", "0.7471607", "0.7439351", "0.7402474", "0.73851603", "0.7334305", "0.73196566", "0.7303968", "0.7280399", "0.7278857", "0.727097", "0.7267812", "0.7261667", "0.725032", "0.7243869", "0.7227607", ...
0.815443
0
List all the images in the cache folder, and delete the expired images.
Перечислить все изображения в папке кэша и удалить истекшие изображения.
public static function deleteCache() { if( self::$enable_caching == false ) return; // default timeout is one day :) $timeout = self::$caching_interval; // get all images in the folder and delete the expired images :) $list_of_images = self::readCacheFolder(); foreach($list_of_images as $one_image ) { if ( getimagesize( $one_image['path']) === false ) continue; $expiring_time = $one_image['time'] + $timeout; // we have to delete this shit :) if( $expiring_time < time() ) { unlink( $one_image['path'] ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function clearCache() {\n\t\tif( self::$enable_caching == false ) return;\n\t\t// default timeout is one day :)\n\t\t$timeout = self::$caching_interval;\n\t\t\t\t\n\t\t// get all images in the folder and delete the expired images :)\t\t\n\t\t$list_of_images = self::readCacheFolder();\n\t\tforeach(...
[ "0.7969672", "0.7294437", "0.72404957", "0.71086895", "0.70455873", "0.70299137", "0.6958669", "0.6877591", "0.66871953", "0.66665083", "0.66003156", "0.66000634", "0.6587102", "0.65817964", "0.65254843", "0.6514239", "0.64705086", "0.64705086", "0.6469998", "0.64636374", "0....
0.80963105
0
This function will return a GUID
Эта функция вернёт GUID
public function getGUID() { if (function_exists('com_create_guid') === true) { return trim(com_create_guid(), '{}'); } return sprintf('%04X%04X-%04X-%04X-%04X-%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getGUID(){\n if (function_exists('com_create_guid')){\n return com_create_guid();\n } else {\n $charId = strtoupper(md5(uniqid(rand(), true)));\n $hyphen = chr(45);\n $uuid = substr($charId, 0, 8).$hyphen\n .substr($charId, 8...
[ "0.85508746", "0.8518852", "0.85036975", "0.84540683", "0.8426033", "0.8411666", "0.84111345", "0.8385375", "0.8385197", "0.83819324", "0.8281942", "0.8273312", "0.82511896", "0.82157147", "0.8202082", "0.8177981", "0.81492585", "0.8144916", "0.81344235", "0.8132385", "0.8132...
0.854302
1
Returns the process to run the given command with arguments.
Возвращает процесс для выполнения заданной команды с аргументами.
public function createProcess(string $command, iterable $arguments): Process;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getProcess(array $command)\n {\n return (new Process($command, $this->workingPath))->setTimeout(null);\n }", "protected function getProcess() {\n return with(new Process('', $this->workingPath))->setTimeout(null);\n }", "private function getProcessExecutor()\n {\n\n...
[ "0.7209931", "0.6753429", "0.66708446", "0.6623977", "0.65909386", "0.65736943", "0.65540797", "0.65148896", "0.6412181", "0.64077246", "0.6407081", "0.6378559", "0.63368994", "0.63368994", "0.63214207", "0.62327605", "0.62126976", "0.6199742", "0.61686134", "0.61413634", "0....
0.70416266
1
Calculate new due date for new recurrence task
Вычислить новую дату окончания для новой повторяющейся задачи
public function calculateRecurringTaskDueDate(array &$values) { if (! empty($values['date_due']) && $values['recurrence_factor'] != 0) { if ($values['recurrence_basedate'] == TaskModel::RECURRING_BASEDATE_TRIGGERDATE) { $values['date_due'] = time(); } $factor = abs($values['recurrence_factor']); $subtract = $values['recurrence_factor'] < 0; switch ($values['recurrence_timeframe']) { case TaskModel::RECURRING_TIMEFRAME_MONTHS: $interval = 'P' . $factor . 'M'; break; case TaskModel::RECURRING_TIMEFRAME_YEARS: $interval = 'P' . $factor . 'Y'; break; default: $interval = 'P' . $factor . 'D'; } $date_due = new DateTime(); $date_due->setTimestamp($values['date_due']); $subtract ? $date_due->sub(new DateInterval($interval)) : $date_due->add(new DateInterval($interval)); $values['date_due'] = $date_due->getTimestamp(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trialProductsCalcDate($relid) {\n\n // get free period value\n $days = trialProductsGetFreePeriod($relid);\n\n $date = new \\DateTime();\n\n // calc next duedate\n $date->modify('+' . $days . ' days');\n\n $date = $date->format('Y-m-d');\n\n return $date;\n\n}", "public function get...
[ "0.689371", "0.6722914", "0.65030366", "0.63937587", "0.63810617", "0.63060457", "0.62667054", "0.62074465", "0.62074465", "0.61493206", "0.6135707", "0.61277974", "0.61189836", "0.6097956", "0.6083598", "0.6052847", "0.60474217", "0.60200125", "0.5995531", "0.5987177", "0.59...
0.70352936
0
This doesn't perform any assertions as per the documentation for assertFormElementPostcodeSearch() in AbstractFormValidationTestCase
Это не выполняет никаких проверок, как указано в документации для assertFormElementPostcodeSearch() в AbstractFormValidationTestCase
public function testSearchPostcode() { $this->assertFormElementPostcodeSearch(['address', 'searchPostcode']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testCustomerPincodeCheckPost()\n {\n }", "public function testPostcode0()\n{\n\n $actual = $this->address->postcode();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function test_search() {\n\t\t$input1 = '<input type=\"s...
[ "0.65347195", "0.6144299", "0.60930896", "0.599636", "0.59472656", "0.5911378", "0.5874367", "0.57740164", "0.57057613", "0.5686019", "0.5669753", "0.564724", "0.564724", "0.5632343", "0.56107897", "0.5580701", "0.5578193", "0.556536", "0.5562843", "0.5560514", "0.55505466", ...
0.84231794
0
Prints pagenav if more than 1 page exists
Печатает pagenav, если существует более одной страницы
function show_pagenav() { if (getTotalPages()!= 1) {?> <div id="pagenav"> <?php printPageListWithNav("« prev", "next »"); ?> </div> <?php } else if (getTotalPages() == 1) {?> <div id="pagenav"></div> <?php }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function suffusion_show_page_nav() {\r\n\tglobal $wp_query;\r\n\treturn ($wp_query->max_num_pages > 1);\r\n}", "protected function currentPageHasSubPages() {}", "public function hasPages() {}", "function show_page_nav() {\n global $wp_query;\n return ($wp_query->max_num_pages > 1);\n}", "public funct...
[ "0.6897228", "0.68527585", "0.6836813", "0.68005216", "0.6793138", "0.67144585", "0.6700753", "0.6629271", "0.6560772", "0.65592766", "0.63883007", "0.6383505", "0.6373776", "0.62832725", "0.62827945", "0.62711596", "0.6243529", "0.61665815", "0.6066222", "0.6051546", "0.6034...
0.73887813
0
Tests that a valid refresh token can find a user. That it update the refresh token
Тесты, проверяющие, что действительный токен обновления может найти пользователя. То, что он обновляет токен обновления
public function testValidRefreshTokenFound() { $user = new User(); $this->userService ->shouldReceive('findUserByValidRefreshToken') ->once() ->with('refresh_token') ->andReturn($user); $this->userService->shouldReceive('updateUserRefreshToken')->once()->with($user); $this->refreshTokenProvider->loadUserByUsername('refresh_token'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateRefreshToken()\n {\n $this->assertTrue($this->config->updateRefreshToken());\n }", "public function testRefreshUserValidUserReturns()\n {\n $user = new User();\n $user->setEmail('bluemoo@gmail.com');\n $this->userService->shouldReceive('findUserByEma...
[ "0.73564947", "0.73320097", "0.70422983", "0.69623184", "0.6800151", "0.6736805", "0.6716535", "0.666775", "0.66623956", "0.6549866", "0.6487053", "0.6403382", "0.63794166", "0.6362666", "0.6361239", "0.63602006", "0.6350425", "0.62835807", "0.62780476", "0.6239299", "0.62227...
0.8268239
0
test that if a valid refresh token is not found a UsernameNotFoundException is thrown
тестирование того, что если не найден действительный токен обновления, выбрасывается исключение UsernameNotFoundException
public function testRefreshTokenNotFound() { $this->expectException(UsernameNotFoundException::class); $this->userService ->shouldReceive('findUserByValidRefreshToken') ->once() ->with('refresh_token') ->andReturn(null); $this->refreshTokenProvider->loadUserByUsername('refresh_token'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testValidRefreshTokenFound()\n {\n $user = new User();\n $this->userService\n ->shouldReceive('findUserByValidRefreshToken')\n ->once()\n ->with('refresh_token')\n ->andReturn($user);\n $this->userService->shouldReceive('updateUser...
[ "0.75409764", "0.7340275", "0.68871105", "0.6785296", "0.6686852", "0.66732436", "0.66080326", "0.6524378", "0.6494367", "0.6484088", "0.6465304", "0.6453294", "0.6443191", "0.63533574", "0.63497084", "0.6342717", "0.63211304", "0.62892866", "0.6236277", "0.6233815", "0.61975...
0.8443244
0
Returns taxonomy meta field for ordering menu
Возвращает мета-поле таксономии для сортировки меню
function idocs_tax_meta_menu_order(){ global $IDOCS; return $IDOCS->get_tax_meta_order(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_nav_menu_taxonomy_meta_boxes()\n{\n}", "function get_sort_field() {\n if ($this->subfield) {\n return $this->subfield->get_sort_field();\n } else {\n return parent::get_sort_field();\n }\n }", "function onepix_change_term_order( $orderby, $args, $taxono...
[ "0.65580344", "0.64462113", "0.6268693", "0.617142", "0.6171225", "0.61032516", "0.6091076", "0.606744", "0.60245925", "0.6009283", "0.5984588", "0.5962203", "0.59574515", "0.5954766", "0.59446675", "0.59443027", "0.5933545", "0.5910005", "0.5893351", "0.5892604", "0.58765554...
0.75552064
0
Add breadcrumb on doc pages
Добавить хлебные крошки на страницы документации
function idocs_breadcrumb( $before = '<div class="idocs-breadcrumbs">', $after = '</div>' ){ // if isn't post type document, return if( !is_singular( idocs_post_type() ) ){ return false; } global $post; $parents = get_ancestors( $post->ID, idocs_post_type() ); $template = '<a href="%1$s" title="%2$s">%2$s</a>'; $links = array( 0 => sprintf( $template, get_bloginfo('url'), __('Home', 'idocs') ) ); if( $parents && is_array($parents) ){ $terms = wp_get_post_terms( $parents[0], idocs_taxonomy() ); if( $terms && !is_wp_error( $terms ) ){ $cats = get_ancestors( $terms[0]->term_id, idocs_taxonomy() ); if( $cats ){ $cats = array_reverse( $cats ); foreach( $cats as $cat ){ $term = get_term($cat, idocs_taxonomy()); $links[] = sprintf( $template, get_term_link( $term ), $term->name ); } } $links[] = sprintf( $template, get_term_link( $terms[0] ), $terms[0]->name ); } $parents = array_reverse($parents); foreach( $parents as $doc_id ){ $links[] = sprintf( $template, get_permalink( $doc_id ), get_the_title( $doc_id ) ); } }else{ $terms = wp_get_post_terms( $post->ID, idocs_taxonomy() ); if( $terms && !is_wp_error( $terms ) ){ $cats = get_ancestors( $terms[0]->term_id, idocs_taxonomy() ); if( $cats ){ $cats = array_reverse( $cats ); foreach( $cats as $cat ){ $term = get_term($cat, idocs_taxonomy()); $links[] = sprintf( $template, get_term_link( $term ), $term->name ); } } $links[] = sprintf( $template, get_term_link( $terms[0] ), $terms[0]->name ); } } $links[] = $post->post_title; $html = $before. implode(' / ', $links) . $after. "\n"; return $html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function breadcrumb() {}", "public function AddBreadcrumbs()\n\t{\n\t\t// Handle reverse Breadcrumbs\n\t\t$crumbs = array();\n\t\t$page = $this->page;\n\t\t\n\t\twhile($page->details['parentid'])\n\t\t{\t\n\t\t\t$page = new PageContent($page->details['parentid']);\n\t\t\t$crumbs[] = array('title' =...
[ "0.79270977", "0.7347341", "0.7120657", "0.6988759", "0.6965498", "0.6907012", "0.68795526", "0.6823138", "0.6808225", "0.6808076", "0.67745465", "0.67555845", "0.6740939", "0.673905", "0.67211705", "0.6680767", "0.6666164", "0.66366017", "0.6629177", "0.6616987", "0.65860975...
0.7435428
1
Delete all users given in input. return Response
Удалить всех пользователей, указанных вводом. вернуть Ответ
public function destroyAll() { if ( ! Input::has('users')) return; $ids = []; foreach(Input::get('users') as $k => $user) { $ids[] = $user['id']; } if ($deleted = User::destroy($ids)) { return response(trans('app.deleted', ['number' => $deleted])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function bulkDestroy()\n {\n request()->validate([\n 'ids' => 'required|array',\n 'ids' => 'required|exists:users,id', \n ]);\n\n //Delete Photos\n $users = User::whereIn('id', request()->input('ids'));\n foreach ($users->get() ?: [] as $user) {\n ...
[ "0.770321", "0.7596887", "0.747543", "0.73588455", "0.73392016", "0.7286746", "0.7274836", "0.72672004", "0.72662634", "0.72520435", "0.7249496", "0.7170076", "0.7158678", "0.7137322", "0.71364343", "0.713196", "0.71238357", "0.71110845", "0.71088034", "0.7081044", "0.7064569...
0.8425288
1
Updates a content object id for a given publication with the given attributes
Обновляет идентификатор объекта содержимого для заданной публикации с заданными атрибутами
public static function update_content_object_publication_id($publication_attr) { $publication = self::retrieve_by_id(ContentObjectPublication::class_name(), $publication_attr->get_id()); $publication->set_content_object_id($publication_attr->get_content_object_id()); return $publication->update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function update( Content $object );", "public function updatePublishedById($id, $published);", "public function updated(Publication $publication)\n {\n //\n }", "public function updated(Publication $publication)\n {\n //\n }", "public function update(Request $request, $id...
[ "0.6182234", "0.6038127", "0.5916122", "0.5916122", "0.5910429", "0.5882242", "0.5776475", "0.576428", "0.5750139", "0.5686963", "0.5674993", "0.5674319", "0.5617638", "0.5570943", "0.55436325", "0.55265045", "0.5520568", "0.551728", "0.55101943", "0.55101943", "0.5505007", ...
0.7164364
0
Delete the content object publications for given content object id
Удалить объект публикаций для заданного идентификатора объекта контента
public static function delete_content_object_publications($object_id) { $condition = new EqualityCondition( new PropertyConditionVariable( ContentObjectPublication::class_name(), ContentObjectPublication::PROPERTY_CONTENT_OBJECT_ID), new StaticConditionVariable($object_id)); $publications = self::retrieves( ContentObjectPublication::class_name(), new DataClassRetrievesParameters($condition)); while ($publication = $publications->next_result()) { if (! $publication->delete()) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_Publications($id){\r\n\t\t$search_by_userid = new myEuroCINPublication();\r\n\t\t$search_by_userid->publisher = $id;\r\n\t\t$result = $search_by_userid->find();\r\n\t\r\n\t\tforeach($result as $publication) :\n\t\t\t$search_comments_publi = new Comment();\n\t\t\t$search_comments_publi->pred1 = 'com...
[ "0.77441245", "0.6865373", "0.66472226", "0.6591346", "0.6575152", "0.6508939", "0.6423148", "0.64115655", "0.6374571", "0.6327975", "0.63071996", "0.63005954", "0.6238586", "0.62283045", "0.6207444", "0.620219", "0.6188355", "0.6182479", "0.6176012", "0.6167272", "0.61359096...
0.7248065
1
ContentObjectPublication Helper Functionality Returns the joins for the content object publication with the content object table
Помощь функциональности ContentObjectPublication Возвращает соединения для публикации объекта содержимого с таблицей объекта содержимого
protected static function get_content_object_publication_joins() { $joins = array(); $joins[] = new Join( ContentObject::class_name(), new EqualityCondition( new PropertyConditionVariable( ContentObjectPublication::class_name(), ContentObjectPublication::PROPERTY_CONTENT_OBJECT_ID), new PropertyConditionVariable(ContentObject::class_name(), ContentObject::PROPERTY_ID))); return new Joins($joins); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ...
[ "0.6107872", "0.6030237", "0.57727754", "0.5676004", "0.567498", "0.5664357", "0.5657191", "0.56122154", "0.55579776", "0.555733", "0.5543232", "0.5512527", "0.5474061", "0.54418534", "0.5438231", "0.5424704", "0.54029334", "0.53999925", "0.53978825", "0.5394184", "0.53885293...
0.82044446
0
Creates a publication attributes object from a given record
Создает объект атрибутов публикации из заданного записи
protected static function create_publication_attributes_from_record($record) { $attributes = new \Chamilo\Core\Repository\Publication\Storage\DataClass\Attributes(); $attributes->set_id($record[ContentObjectPublication::PROPERTY_ID]); $attributes->set_publisher_id($record[ContentObjectPublication::PROPERTY_PUBLISHER_ID]); $attributes->set_date($record[ContentObjectPublication::PROPERTY_PUBLICATION_DATE]); $attributes->set_application('Chamilo\Application\Weblcms'); $course = \Chamilo\Application\Weblcms\Course\Storage\DataManager::retrieve_by_id( \Chamilo\Application\Weblcms\Course\Storage\DataClass\Course::class_name(), $record[ContentObjectPublication::PROPERTY_COURSE_ID]); $location = $course->get_title() . ' (' . $course->get_visual_code() . ') > ' . Translation::get( 'TypeName', null, 'Chamilo\Application\Weblcms\Tool\Implementation\\' . $record[ContentObjectPublication::PROPERTY_TOOL]); $attributes->set_location($location); $url = 'index.php?application=Chamilo\Application\Weblcms&amp;go=' . Manager::ACTION_VIEW_COURSE . '&course=' . $record[ContentObjectPublication::PROPERTY_COURSE_ID] . '&amp;tool=' . $record[ContentObjectPublication::PROPERTY_TOOL] . '&amp;tool_action=' . \Chamilo\Application\Weblcms\Tool\Manager::ACTION_VIEW . '&amp;' . \Chamilo\Application\Weblcms\Tool\Manager::PARAM_PUBLICATION_ID . '=' . $attributes->get_id(); $attributes->set_url($url); $attributes->set_title($record[ContentObject::PROPERTY_TITLE]); $attributes->set_content_object_id($record[ContentObjectPublication::PROPERTY_CONTENT_OBJECT_ID]); return $attributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function instantiate($record) {\n $object = new self;\n \n foreach ($record as $attribute => $value) {\n if ($object->has_attribute($attribute)) {\n $object->$attribute = $value;\n }\n }\n return $object;\n }", "private sta...
[ "0.7057682", "0.69896924", "0.69864917", "0.69816655", "0.69816655", "0.69816655", "0.69718665", "0.69071144", "0.68700475", "0.6861256", "0.6850715", "0.6812163", "0.6789603", "0.6778548", "0.6742364", "0.66980326", "0.6657573", "0.6657573", "0.662295", "0.6621103", "0.65572...
0.8443989
0
Fills the $new_publications_cache cache with given courses for given user. Ideas: In order to speed multiple calls to tool_has_new_publications(...) we use the cache $new_publications_cache. If the cache is not filled for a user and course pair yet, this function is activated automatically. Further acceleration of the code can be achieved if this function is called with a list of courses before looping over the courses starts. Why? It is more efficient to execute large queries including several 100 courses than executing small queries for each course separately. This function fills the cache for all given courses, resulting in fast execution of subsequent calls to tool_has_new_publications. Steps:
Заполняет кэш $new_publications_cache заданными курсами для заданного пользователя. Идеи: Чтобы ускорить несколько вызовов функции tool_has_new_publications(...), мы используем кэш $new_publications_cache. Если кэш для пары пользователя и курса еще не заполнен, эта функция активируется автоматически. Дальнейшее ускорение кода можно достичь, если эту функцию вызывать с списком курсов перед тем, как начать цикл по курсам. Почему? Выполнение крупных запросов, включающих несколько сотен курсов, более эффективно, чем выполнение маленьких запросов для каждого курса отдельно. Эта функция заполняет кэш для всех заданных курсов, что приводит к быстрому выполнению последующих вызовов tool_has_new_publications. Шаги:
public static function fill_new_publications_cache($user, $courses) { $weblcms_rights = WeblcmsRights::getInstance(); foreach (array_keys($courses) as $course_id) { self::$is_cached[self::create_new_publications_cache_key($user->get_id(), $course_id)] = true; } $tools_with_new_publications = DataManager::retrieve_new_publication_icon_ids( array_keys($courses), $user->get_id(), false, null, null); $identifiers = array(); $publications = array(); while ($publication = $tools_with_new_publications->next_result(false)) { $course = $courses[$publication[ContentObjectPublication::PROPERTY_COURSE_ID]]; if ($course->is_course_admin($user, false)) { $key = self::create_new_publications_cache_key( $user->get_id(), $publication[ContentObjectPublication::PROPERTY_COURSE_ID]); self::$new_publications_cache[$key][$publication[ContentObjectPublication::PROPERTY_TOOL]] = true; } else { $identifiers[] = $publication[ContentObjectPublication::PROPERTY_ID]; $publications[$publication[ContentObjectPublication::PROPERTY_ID]] = $publication; } } $entities = array(); $entities[] = CourseUserEntity::getInstance(); $entities[] = CourseGroupEntity::getInstance(null); $entities[] = CoursePlatformGroupEntity::getInstance(null); $publication_ids_with_right_view = $weblcms_rights->filter_location_identifiers_by_granted_right( Manager::context(), $user, $entities, WeblcmsRights::VIEW_RIGHT, $identifiers, WeblcmsRights::TYPE_PUBLICATION); $category_ids = array(); foreach ($publication_ids_with_right_view as $publication_id) { $category_ids[] = $publications[$publication_id][ContentObjectPublication::PROPERTY_CATEGORY_ID]; } $category_parent_ids = self::retrieve_publication_category_parent_ids_recursive($category_ids); $all_category_ids = array_merge($category_ids, array_values($category_parent_ids)); $category_visibility = self::retrieve_publication_category_visibility($all_category_ids); foreach ($publication_ids_with_right_view as $publication_id) { $publication = $publications[$publication_id]; if (ContentObjectPublicationCategory::is_recursive_visible_on_arrays( $publication[ContentObjectPublication::PROPERTY_CATEGORY_ID], $category_parent_ids, $category_visibility)) { $key = self::create_new_publications_cache_key( $user->get_id(), $publication[ContentObjectPublication::PROPERTY_COURSE_ID]); self::$new_publications_cache[$key][$publication[ContentObjectPublication::PROPERTY_TOOL]] = true; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function tool_has_new_publications($tool, User $user, Course $course)\n {\n $key = self::create_new_publications_cache_key($user->get_id(), $course->get_id());\n\n if (! isset(self::$is_cached[$key]))\n {\n // Fill cache for given course.\n self::fill_new...
[ "0.6639406", "0.62662244", "0.60873204", "0.5575039", "0.5487977", "0.54490715", "0.52806926", "0.51230955", "0.49992096", "0.4992204", "0.49359092", "0.49226642", "0.48986197", "0.4811565", "0.48094928", "0.4809019", "0.47893834", "0.4781396", "0.47706497", "0.4752873", "0.4...
0.80733234
0
Creates the key for the cache new_publications_cache.
Создает ключ для кэша new_publications_cache.
private static function create_new_publications_cache_key($user_id, $course_id) { return $user_id . '_' . $course_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create_cache_key() : void {\n\t\t// Requested API url which is used to create cache.\n\t\t$request_url = sanitize_text_field( $_SERVER['REQUEST_URI'] );\n\n\t\tif ( ! $request_url ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Parse URL to check for path and query args.\n\t\t$parsed_url = wp_parse_url( $reque...
[ "0.6617216", "0.6499168", "0.6467851", "0.6329773", "0.6269246", "0.6225512", "0.61685675", "0.61553025", "0.61552167", "0.61089164", "0.6100756", "0.6100756", "0.6088702", "0.60817194", "0.6065697", "0.6055298", "0.60349923", "0.6031148", "0.6031148", "0.6018032", "0.5981329...
0.7089535
0
\brief Creates an array of courses where the keys are course ID's and the values are course instances.
\brief Создает массив курсов, где ключами являются идентификаторы курсов, а значениями — экземпляры курсов.
public static function create_courses_array($courses) { if (! is_array($courses)) { $courses = array($courses); } $courses_with_ids = array(); foreach ($courses as $course) { $courses_with_ids[$course->get_id()] = $course; } return $courses_with_ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function GetCourses()\n\t{\t$this->courses = array();\n\t\t\n\t\tif ($id = (int)$this->id)\n\t\t{\t$where = array('courses.ccid=' . $id);\n\t\t\tif ($this->liveonly)\n\t\t\t{\t$where[] = 'live=1';\n\t\t\t}\n\t\t\t$sql = 'SELECT * FROM courses WHERE ' . implode(' AND ', $where) . ' ORDER BY starttime DESC';\...
[ "0.71638954", "0.67332", "0.6709558", "0.6458478", "0.64133173", "0.63864154", "0.6384081", "0.6374368", "0.63494873", "0.63217473", "0.63100314", "0.6304451", "0.6293315", "0.62782913", "0.62690777", "0.62481576", "0.6204174", "0.6197385", "0.61710787", "0.6157852", "0.61487...
0.70473635
1
Retrieves the visibility property of given publication categories.
Получает свойство видимости заданных категорий публикаций.
public static function retrieve_publication_category_visibility($publication_category_ids) { $condition = new InCondition( new PropertyConditionVariable( ContentObjectPublicationCategory::class_name(), ContentObjectPublicationCategory::PROPERTY_ID), $publication_category_ids); $properties = new DataClassProperties(); $properties->add( new PropertiesConditionVariable( ContentObjectPublicationCategory::class_name(), ContentObjectPublicationCategory::PROPERTY_ID)); $properties->add( new PropertiesConditionVariable( ContentObjectPublicationCategory::class_name(), ContentObjectPublicationCategory::PROPERTY_VISIBLE)); $parameters = new RecordRetrievesParameters($properties, $condition); $categories = self::records(ContentObjectPublicationCategory::class_name(), $parameters); $visibilities = array(); while ($category = $categories->next_result(false)) { $visibilities[$category[ContentObjectPublicationCategory::PROPERTY_ID]] = $category[ContentObjectPublicationCategory::PROPERTY_VISIBLE]; } return $visibilities; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVisibility();", "public function getVisibility()\n {\n return $this->getProperty(\"Visibility\");\n }", "public function get_visible()\n {\n return $this->get_default_property(self::PROPERTY_VISIBLE);\n }", "public function getVisibility()\n {\n return $...
[ "0.5695155", "0.56670433", "0.555402", "0.5491317", "0.5491317", "0.5491317", "0.54909927", "0.54308563", "0.5416825", "0.5388873", "0.5352676", "0.5340288", "0.53241736", "0.53102183", "0.5305771", "0.5280337", "0.5265961", "0.5253172", "0.5251424", "0.52474684", "0.5241326"...
0.7569986
0
Returns an array mapping child publication category ID's onto parent ID's. Idea: Retrieve the childparent relation of publication categories with as few queries as possible and store them in the memory. The function ContentObjectPublicationCategory::is_recursive_visible_on_arrays(...) will loop over the childparent tree, which is much faster than the recursive function calls to ContentObjectPublicationCategory::is_recursive_visible(...). This function actually retrieves the publication category tree levelbylevel starting with the leaf level, followed by parent level, then grandparents until an empty level is found. Result is a flat array mapping each ID in $publication_category_ids onto its parent ID and each parent onto its grand parent ID, etc. Result will only contain child ID's if the 'inherit' property of the location is true and the parent is not null.
Возвращает массив, сопоставляющий идентификаторы дочерних категорий публикаций с идентификаторами родительских категорий. Идея: получить связь дочерних и родительских категорий публикаций с минимальным количеством запросов и сохранить их в памяти. Функция ContentObjectPublicationCategory::is_recursive_visible_on_arrays(...) будет перебирать дерево childparent, что намного быстрее, чем рекурсивные вызовы функции ContentObjectPublicationCategory::is_recursive_visible(...). Эта функция на самом деле извлекает дерево категорий публикаций по уровням, начиная с уровня листьев, затем уровень родителей, потом дедушек и так далее, пока не будет найден пустой уровень. Результатом является плоский массив, сопоставляющий каждый идентификатор в $publication_category_ids с идентификатором родителя и каждый родитель с идентификатором дедушки и так далее. Результат будет содержать идентификаторы дочерних категорий только в том случае, если свойство 'inherit' местоположения истинно, и родитель не равен null.
public static function retrieve_publication_category_parent_ids_recursive($publication_category_ids) { $all_parent_ids = array(); $parent_ids = $publication_category_ids; while (true) { $parent_ids = self::retrieve_publication_category_parent_ids($parent_ids); if (count($parent_ids) == 0) { break; } $all_parent_ids = $all_parent_ids + $parent_ids; } return $all_parent_ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function retrieve_publication_category_parent_ids($publication_category_ids)\n {\n $conditions = array();\n $conditions[] = new InCondition(\n new PropertyConditionVariable(\n ContentObjectPublicationCategory::class_name(),\n ContentObjectPubl...
[ "0.7576176", "0.6433631", "0.62762254", "0.6263034", "0.6193972", "0.6084708", "0.60217917", "0.5958952", "0.5917979", "0.58828324", "0.58773726", "0.58754915", "0.58720934", "0.5855292", "0.58357674", "0.58070433", "0.57994914", "0.57842696", "0.57837164", "0.5761845", "0.57...
0.74744797
1
Retrieves parent ID's of given publication categories. Result contains only child ID's whose parent ID is not null.
Получает идентификаторы родительских категорий заданных публикаций. Результат содержит только идентификаторы дочерних элементов, у которых не null идентификатор родителя.
public static function retrieve_publication_category_parent_ids($publication_category_ids) { $conditions = array(); $conditions[] = new InCondition( new PropertyConditionVariable( ContentObjectPublicationCategory::class_name(), ContentObjectPublicationCategory::PROPERTY_ID), $publication_category_ids); $conditions[] = new NotCondition( new EqualityCondition( new PropertyConditionVariable( ContentObjectPublicationCategory::class_name(), ContentObjectPublicationCategory::PROPERTY_PARENT), new StaticConditionVariable(0))); $condition = new AndCondition($conditions); $properties = new DataClassProperties(); $properties->add( new PropertiesConditionVariable( ContentObjectPublicationCategory::class_name(), ContentObjectPublicationCategory::PROPERTY_ID)); $properties->add( new PropertiesConditionVariable( ContentObjectPublicationCategory::class_name(), ContentObjectPublicationCategory::PROPERTY_PARENT)); $parameters = new RecordRetrievesParameters($properties, $condition); $categories = self::records(ContentObjectPublicationCategory::class_name(), $parameters); $parent_ids = array(); while ($category = $categories->next_result(false)) { $parent_ids[$category[ContentObjectPublicationCategory::PROPERTY_ID]] = $category[ContentObjectPublicationCategory::PROPERTY_PARENT]; } return $parent_ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function retrieve_publication_category_parent_ids_recursive($publication_category_ids)\n {\n $all_parent_ids = array();\n\n $parent_ids = $publication_category_ids;\n\n while (true)\n {\n $parent_ids = self::retrieve_publication_category_parent_ids($parent_id...
[ "0.7581875", "0.691835", "0.6465205", "0.6464594", "0.63645273", "0.6338144", "0.63062954", "0.62985307", "0.6279741", "0.62401146", "0.6162559", "0.616188", "0.6080508", "0.605939", "0.59764177", "0.5919849", "0.59092474", "0.5908044", "0.59033936", "0.590038", "0.58735716",...
0.80046934
0
CourseModuleLastAccess Functionality Logs a course module last access record
Функция CourseModuleLastAccess Записывает запись о последнем доступе к модулю курса
public static function log_course_module_access($course_id, $user_id, $module_name = null, $category_id = 0) { $conditions = array(); $conditions[] = new EqualityCondition( new PropertyConditionVariable( CourseModuleLastAccess::class_name(), CourseModuleLastAccess::PROPERTY_COURSE_CODE), new StaticConditionVariable($course_id)); $conditions[] = new EqualityCondition( new PropertyConditionVariable(CourseModuleLastAccess::class_name(), CourseModuleLastAccess::PROPERTY_USER_ID), new StaticConditionVariable($user_id)); $conditions[] = new EqualityCondition( new PropertyConditionVariable( CourseModuleLastAccess::class_name(), CourseModuleLastAccess::PROPERTY_MODULE_NAME), new StaticConditionVariable($module_name)); $conditions[] = new EqualityCondition( new PropertyConditionVariable( CourseModuleLastAccess::class_name(), CourseModuleLastAccess::PROPERTY_CATEGORY_ID), new StaticConditionVariable($category_id)); $condition = new AndCondition($conditions); $course_module_last_access = self::retrieve( CourseModuleLastAccess::class_name(), new DataClassRetrieveParameters($condition)); if (! $course_module_last_access) { $course_module_last_access = new CourseModuleLastAccess(); $course_module_last_access->set_course_code($course_id); $course_module_last_access->set_user_id($user_id); $course_module_last_access->set_module_name($module_name); $course_module_last_access->set_category_id($category_id); } $course_module_last_access->set_access_date(time()); return $course_module_last_access->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function update_last_access()\n {\n }", "final public function getLastAccess()\n\t{\n\t\treturn $this->last_access;\n\t}", "abstract public function getLastLog();", "public function process_logstore_last_updated_course_module_log($data) {\n global $DB;\n // Need to have co...
[ "0.66202164", "0.6494416", "0.64268345", "0.63394064", "0.62921005", "0.62447906", "0.623685", "0.61986786", "0.6031234", "0.5988609", "0.59050715", "0.58926934", "0.588835", "0.5802448", "0.57886034", "0.5774271", "0.57521856", "0.5744846", "0.57189536", "0.57001907", "0.568...
0.7308897
0
Returns the last visit date per course (and optional for a module and / or a user)
Возвращает дату последнего посещения по курсу (и необязательно для модуля и / или пользователя)
public static function get_last_visit_date_per_course($course_id, $module_name = null, $user_id = null) { return self::get_last_visit_date($course_id, $user_id, $module_name, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get_last_visit_date($course_id, $user_id, $module_name = null, $category_id = 0)\n {\n $conditions = array();\n\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n CourseModuleLastAccess::class_name(),\n Course...
[ "0.7230917", "0.674452", "0.588778", "0.5843085", "0.57637167", "0.57502985", "0.5734076", "0.5721168", "0.5638964", "0.5534245", "0.5367068", "0.5327783", "0.5293098", "0.52769035", "0.526904", "0.5243051", "0.5242212", "0.5202034", "0.51749647", "0.5167718", "0.51574755", ...
0.7797108
0
Retrieves the course user categories from a given course type
Получает категории пользователей курса из заданного типа курса
public static function retrieve_course_user_categories_from_course_type($course_type_id, $user_id) { $conditions = array(); $conditions[] = new EqualityCondition( new PropertyConditionVariable( CourseTypeUserCategory::class_name(), CourseTypeUserCategory::PROPERTY_COURSE_TYPE_ID), new StaticConditionVariable($course_type_id)); $conditions[] = new EqualityCondition( new PropertyConditionVariable(CourseTypeUserCategory::class_name(), CourseTypeUserCategory::PROPERTY_USER_ID), new StaticConditionVariable($user_id)); $condition = new AndCondition($conditions); $properties = new DataClassProperties(); $properties->add(new PropertiesConditionVariable(CourseTypeUserCategory::class_name())); $properties->add( new PropertyConditionVariable(CourseUserCategory::class_name(), CourseUserCategory::PROPERTY_TITLE)); $join_condition = new EqualityCondition( new PropertyConditionVariable( CourseTypeUserCategory::class_name(), CourseTypeUserCategory::PROPERTY_COURSE_USER_CATEGORY_ID), new PropertyConditionVariable(CourseUserCategory::class_name(), CourseUserCategory::PROPERTY_ID)); $joins = new Joins(); $joins->add(new Join(CourseUserCategory::class_name(), $join_condition)); $order_by = array( new OrderBy( new PropertyConditionVariable( CourseTypeUserCategory::class_name(), CourseTypeUserCategory::PROPERTY_SORT))); $parameters = new RecordRetrievesParameters($properties, $condition, null, null, $order_by, $joins); return self::records(CourseTypeUserCategory::class_name(), $parameters); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategories($type)\n\t{\n\t\t$category = Category::where('type', $type)->get()->lists('category_name', 'id');\n\n\t\treturn $category;\n\t}", "private function get_course_categories() {\n global $DB;\n $category = $DB->get_field_sql(\" SELECT category.name AS Category,\n ...
[ "0.7700584", "0.7296927", "0.7289376", "0.71850544", "0.71567863", "0.6897133", "0.681747", "0.68142414", "0.6736558", "0.6697979", "0.6676367", "0.65998095", "0.64855444", "0.64668787", "0.6426573", "0.6403223", "0.63695437", "0.63090014", "0.62889105", "0.6276634", "0.62630...
0.77947384
0
Deletes all the course type user category rel course objects for a given course id
Удаляет все объекты курса типа пользователя категории курса для заданного идентификатора курса
public static function delete_course_type_user_category_rel_courses_by_course_id($course_id) { $condition = new EqualityCondition( new PropertyConditionVariable( CourseTypeUserCategoryRelCourse::class_name(), CourseTypeUserCategoryRelCourse::PROPERTY_COURSE_ID), new StaticConditionVariable($course_id)); $result_set = DataManager::retrieves( CourseTypeUserCategoryRelCourse::class_name(), new DataClassRetrievesParameters($condition)); while ($course_type_user_category_rel_course = $result_set->next_result()) { if (! $course_type_user_category_rel_course->delete()) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete_all ()\r\n\t{\r\n\t\t$cats = Category::load(null, null, $this->course_code, $this->id, null);\r\n\t\t$evals = Evaluation::load(null, null, $this->course_code, $this->id, null);\r\n\t\t$links = LinkFactory::load(null,null,null,null,$this->course_code,$this->id,null);\r\n\t\t\r\n\t\tforeach ($...
[ "0.63256586", "0.6321085", "0.6291895", "0.61192864", "0.60774076", "0.6037693", "0.601391", "0.60105973", "0.5995757", "0.5944327", "0.59276783", "0.5920333", "0.5914765", "0.5913124", "0.58888996", "0.58641046", "0.5834649", "0.5828416", "0.58250356", "0.5823122", "0.581411...
0.7127814
0
CourseTool Functionality Retrieves a course tool by a given tool name
Функционал CourseTool Получает курсовое средство по заданному имени средства
public static function retrieve_course_tool_by_name($course_tool_name) { $condition = new EqualityCondition( new PropertyConditionVariable(CourseTool::class_name(), CourseTool::PROPERTY_NAME), new StaticConditionVariable($course_tool_name)); return self::retrieve(CourseTool::class_name(), new DataClassRetrieveParameters($condition)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_tool($name)\n {\n }", "public function getToolByToolId($tool_id) {\n $sql = \"SELECT * FROM \".TABLE_PREFIX.\"tool_provider t\n WHERE t.tool_id=\".$tool_id; \n return $this->execute($sql);\n }", "protected function getTool($toolId){\n\t$tool = $GLOBALS[...
[ "0.75580466", "0.7106982", "0.6671065", "0.6569965", "0.648721", "0.6160659", "0.5982228", "0.5877753", "0.5835403", "0.58225906", "0.57921624", "0.57075256", "0.5694035", "0.563167", "0.56299025", "0.56144243", "0.5591583", "0.55369", "0.54814285", "0.5467628", "0.54478467",...
0.79570735
0
Retrieves the target course group ids of a publication
Получает идентификаторы целевых групп курсов публикации
public static function retrieve_publication_target_course_group_ids($publication_id) { $course_id = self::get_course_id_from_publication($publication_id); try { $target_entities = WeblcmsRights::getInstance()->get_target_entities( WeblcmsRights::VIEW_RIGHT, Manager::context(), $publication_id, WeblcmsRights::TYPE_PUBLICATION, $course_id, WeblcmsRights::TREE_TYPE_COURSE); } catch (Exception $exception) { error_log($exception->getMessage()); $target_entities[CourseUserEntity::ENTITY_TYPE] = false; } return $target_entities[CourseGroupEntity::ENTITY_TYPE]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_target_groups()\r\n {\r\n if (!$this->target_groups)\r\n {\r\n $condition = new EqualityCondition(PeerAssessmentPublicationGroup :: PROPERTY_PEER_ASSESSMENT_PUBLICATION, $this->get_id());\r\n $groups = $this->get_data_manager()->retrieve_peer_assessment_publicati...
[ "0.7157856", "0.69046164", "0.6420243", "0.6283753", "0.6182171", "0.59964216", "0.59792936", "0.59525126", "0.5942252", "0.5819287", "0.5786903", "0.5756618", "0.5716022", "0.5597857", "0.54973406", "0.5464848", "0.54291534", "0.5428579", "0.538078", "0.5355821", "0.53306645...
0.75598705
0
Retrieves the target platform group ids of a publication
Получает идентификаторы целевых групп платформ публикации
public static function retrieve_publication_target_platform_group_ids($publication_id) { $course_id = self::get_course_id_from_publication($publication_id); try { $target_entities = WeblcmsRights::getInstance()->get_target_entities( WeblcmsRights::VIEW_RIGHT, Manager::context(), $publication_id, WeblcmsRights::TYPE_PUBLICATION, $course_id, WeblcmsRights::TREE_TYPE_COURSE); } catch (Exception $exception) { error_log($exception->getMessage()); $target_entities[CourseUserEntity::ENTITY_TYPE] = false; } return $target_entities[CoursePlatformGroupEntity::ENTITY_TYPE]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_target_groups()\n {\n if (! isset($this->target_groups))\n {\n $this->target_groups = DataManager::retrieve_publication_target_platform_group_ids($this->get_id());\n }\n\n return $this->target_groups;\n }", "function get_target_groups()\r\n {\r\...
[ "0.6789833", "0.6758562", "0.6283884", "0.6252962", "0.6228103", "0.58924544", "0.5720176", "0.5679376", "0.5635817", "0.5381928", "0.53473586", "0.5315805", "0.53082204", "0.5307651", "0.5289132", "0.5269568", "0.52667433", "0.5252668", "0.5243813", "0.5216895", "0.5208907",...
0.75167835
0
Returns an array of users that are the targets of the given publication based on the rights structure
Возвращает массив пользователей, которые являются целевыми для заданной публикации на основе структуры прав
public static function get_publication_target_users($publication) { $target_users = array(); $publication_id = $publication->get_id(); $course_id = $publication->get_course_id(); try { // get the entities $target_entities = WeblcmsRights::getInstance()->get_target_entities( WeblcmsRights::VIEW_RIGHT, Manager::context(), $publication_id, WeblcmsRights::TYPE_PUBLICATION, $course_id, WeblcmsRights::TREE_TYPE_COURSE); } catch (Exception $exception) { error_log($exception->getMessage()); $target_entities = array(); } // check for everybody if (array_key_exists(0, $target_entities[0])) { // get all course users $target_users = \Chamilo\Application\Weblcms\Course\Storage\DataManager::retrieve_all_course_users( $course_id)->as_array(); } else { $user_ids = array(); // get all users for all entities foreach ($target_entities as $entity_type => $entity_ids) { switch ($entity_type) { case CoursePlatformGroupEntity::ENTITY_TYPE : foreach ($entity_ids as $group_id) { $group = \Chamilo\Core\Group\Storage\DataManager::retrieve_by_id( Group::class_name(), $group_id); if ($group) { $user_ids = array_merge($user_ids, $group->get_users(true, true)); } } break; case CourseUserEntity::ENTITY_TYPE : $user_ids = array_merge($user_ids, $entity_ids); break; case CourseGroupEntity::ENTITY_TYPE : foreach ($entity_ids as $course_group_id) { $course_group = CourseGroupDataManager::retrieve_by_id( CourseGroup::class_name(), $course_group_id); if ($course_group) { $courseGroupMemberIds = $course_group->get_members(true, true, false); if(is_array($courseGroupMemberIds)) { $user_ids = array_merge($user_ids, $courseGroupMemberIds); } } } break; } } } if (count($user_ids) > 0) { $users = \Chamilo\Core\User\Storage\DataManager::records( User::class_name(), new RecordRetrievesParameters( new DataClassProperties(array(new PropertiesConditionVariable(User::class_name()))), new InCondition(new PropertyConditionVariable(User::class_name(), User::PROPERTY_ID), $user_ids)))->as_array(); foreach ($users as $user) { if (! array_key_exists($user[User::PROPERTY_ID], $target_users)) { $target_users[$user[User::PROPERTY_ID]] = $user; } } } return $target_users; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_target_users()\r\n {\r\n if (!$this->target_users)\r\n {\r\n $condition = new EqualityCondition(PeerAssessmentPublicationUser :: PROPERTY_PEER_ASSESSMENT_PUBLICATION, $this->get_id());\r\n $users = $this->get_data_manager()->retrieve_peer_assessment_publication_u...
[ "0.70024323", "0.6843858", "0.6648493", "0.6275464", "0.6151753", "0.5921966", "0.58235985", "0.5760503", "0.5702716", "0.5676883", "0.55463916", "0.5539685", "0.5496938", "0.54647106", "0.5454658", "0.5437247", "0.54156226", "0.5403066", "0.53986585", "0.5382944", "0.5378901...
0.77076006
0
Introduction Functionality Helper function to retrieve an introduction publication by a given course and tool
Введение Функциональность Вспомогательная функция для получения публикации введения по заданному курсу и инструменту
public static function retrieve_introduction_publication_by_course_and_tool($course_id, $tool) { $conditions = array(); $conditions[] = new EqualityCondition( new PropertyConditionVariable( ContentObjectPublication::class_name(), ContentObjectPublication::PROPERTY_COURSE_ID), new StaticConditionVariable($course_id)); $conditions[] = new EqualityCondition( new PropertyConditionVariable( ContentObjectPublication::class_name(), ContentObjectPublication::PROPERTY_TOOL), new StaticConditionVariable($tool)); $condition = new AndCondition($conditions); return self::retrieve_introduction_publication($condition); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract function getIntro($intro, $img_url);", "public function getIntroduction() {\n\t\treturn $this->introduction;\n\t}", "public function getIntro()\n {\n return $this->intro;\n }", "public function getIntro()\n {\n return $this->intro;\n }", "public static function retrieve_i...
[ "0.6681268", "0.6073202", "0.59539104", "0.59539104", "0.5826649", "0.5809139", "0.57879347", "0.57046413", "0.56997377", "0.56876165", "0.565274", "0.5591225", "0.5539331", "0.55124027", "0.5447413", "0.54406774", "0.54368263", "0.5422902", "0.540883", "0.54066384", "0.53862...
0.7258478
0
RightsLocationLockedRight Functionality Clears the locked rights for a given location id (an optionally a given right id)
Функционал RightsLocationLockedRight очищает заблокированные права для заданного идентификатора местоположения (по желанию — для заданного идентификатора права)
public static function clear_locked_rights_for_location($location_id, $right_id = null) { return self::deletes( RightsLocationLockedRight::class_name(), self::get_rights_location_locked_right_condition($location_id, $right_id)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected static function get_rights_location_locked_right_condition($location_id, $right_id)\n {\n $conditions = array();\n\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n RightsLocationLockedRight::class_name(),\n RightsLocatio...
[ "0.6061288", "0.52920413", "0.52401507", "0.5139353", "0.51126397", "0.51126397", "0.50036156", "0.49442187", "0.48504063", "0.48016316", "0.4754403", "0.473669", "0.4720001", "0.46232444", "0.46080562", "0.45920658", "0.4574361", "0.45694724", "0.45199633", "0.44806397", "0....
0.7102651
0
Program assignment permission is handled at the actionobject level
Разрешение на назначение программы управляется на уровне объекта действия
public function can_do_action_userprogramassign() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_do_action_programuserassign() {\n return true;\n }", "abstract protected function updatePermission();", "public function permission();", "function eZObjectPermission( )\r\n {\r\n }", "public function can_do_action_programuserunassign() {\n return true;\n }", ...
[ "0.73459244", "0.65011156", "0.64600486", "0.6429173", "0.6385798", "0.6353359", "0.62662584", "0.62644666", "0.62411094", "0.62316966", "0.622", "0.6201612", "0.6181304", "0.6161406", "0.6155487", "0.6130687", "0.60646427", "0.60522664", "0.60522664", "0.60522664", "0.605226...
0.71934456
1
Program unassignment permission is handled at the actionobject level
Разрешение на снятие программы управляется на уровне объекта действия
public function can_do_action_userprogramunassign() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_do_action_programuserunassign() {\n return true;\n }", "public function action_denied() { }", "abstract function forbiddenAction();", "public function accessdeniedAction() {\n // do nothing \n }", "public function izap_revoke_edit() {\n if(get_class($this) == 'Iz...
[ "0.7379859", "0.67189944", "0.6686267", "0.6676029", "0.6557575", "0.6522217", "0.64948606", "0.6397242", "0.6254196", "0.6225757", "0.6223262", "0.61890316", "0.60948104", "0.6037533", "0.60332245", "0.59583074", "0.5954771", "0.5949673", "0.59045655", "0.58953553", "0.58719...
0.7265071
1
Program assignment permission is handled at the actionobject level
Разрешение на назначение программы управляется на уровне объекта действия
public function can_do_action_programuserassign() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_do_action_userprogramassign() {\n return true;\n }", "abstract protected function updatePermission();", "public function permission();", "function eZObjectPermission( )\r\n {\r\n }", "public function can_do_action_programuserunassign() {\n return true;\n }", ...
[ "0.71934456", "0.65011156", "0.64600486", "0.6429173", "0.6385798", "0.6353359", "0.62662584", "0.62644666", "0.62411094", "0.62316966", "0.622", "0.6201612", "0.6181304", "0.6161406", "0.6155487", "0.6130687", "0.60646427", "0.60522664", "0.60522664", "0.60522664", "0.605226...
0.73459244
0
Program unassignment permission is handled at the actionobject level
Разрешение на отмену назначения программы обрабатывается на уровне объекта действия
public function can_do_action_programuserunassign() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_do_action_userprogramunassign() {\n return true;\n }", "public function action_denied() { }", "abstract function forbiddenAction();", "public function accessdeniedAction() {\n // do nothing \n }", "public function izap_revoke_edit() {\n if(get_class($this) == 'Iz...
[ "0.7265071", "0.67189944", "0.6686267", "0.6676029", "0.6557575", "0.6522217", "0.64948606", "0.6397242", "0.6254196", "0.6225757", "0.6223262", "0.61890316", "0.60948104", "0.6037533", "0.60332245", "0.59583074", "0.5954771", "0.5949673", "0.59045655", "0.58953553", "0.58719...
0.7379859
0
Get partitioned dir by id
Получить директорию с разделением по идентификатору
public function getPartitionedDir($id) { if (is_numeric($id)) { return implode('/', str_split(sprintf('%09d', $id), 3)); } elseif (is_string($id)) { return implode('/', array_slice(str_split($id, 3), 0, 3)); } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function partition_simple($id){\n\t\treturn $this->fb->exec('storage.partition_simple', $id);\n\t}", "public static function loadDir($id) {\n\t\t$tableDirectories = new Document_Model_Directories();\n\t\t$directory = $tableDirectories->find($id)->current();\n\t\t\n\t\tif (!$directory) throw new Zend_Db_Ta...
[ "0.7125853", "0.67244667", "0.65395105", "0.6529818", "0.6451393", "0.64434725", "0.6405953", "0.62363505", "0.6209346", "0.62012786", "0.6150929", "0.6146915", "0.61331844", "0.6126024", "0.60984164", "0.6081747", "0.6074815", "0.60688174", "0.60178185", "0.6006422", "0.5998...
0.78419334
0
Set the event dispatcher instance to be used by connections.
Установите экземпляр диспетчера событий, который будет использоваться соединениями.
public function setEventDispatcher(Dispatcher $dispatcher) { $this->dispatcher = $dispatcher; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setEventDispatcher(Dispatcher $dispatcher)\n {\n static::$dispatcher = $dispatcher;\n }", "public function setEventDispatcher(EventDispatcherInterface $dispatcher = NULL)\n\t{\n\t\t$this->eventDispatcher = $dispatcher;\n\t}", "public function setEventDispatcher(EventDispatch...
[ "0.72343826", "0.7111414", "0.70422703", "0.70281786", "0.69860375", "0.697084", "0.69557893", "0.6880408", "0.6876697", "0.68455535", "0.6785438", "0.6765708", "0.67544806", "0.6651062", "0.6571795", "0.6548656", "0.64629257", "0.64069057", "0.64069057", "0.6375584", "0.6352...
0.72588605
0
Gets the ID's of the units that someone would use locally based on the passed in system type
Получает идентификаторы единиц, которые кто-либо бы использовал локально, в зависимости от переданного типа системы
function getLocalUnitIDs($system) { global $g_rb_units; $units = array(); foreach ($g_rb_units['static'] as $key) $units[] = $key; // Unit types if (isset($g_rb_units[$system]["wet"])) foreach ($g_rb_units[$system]["wet"] as $key=>$val) $units[] = $key; // Wet volume units if (isset($g_rb_units[$system]["dry"])) foreach ($g_rb_units[$system]["dry"] as $key=>$val) $units[] = $key; // Dry volume units if (isset($g_rb_units[$system]["volume"])) foreach ($g_rb_units[$system]["volume"] as $key=>$val) $units[] = $key; // volume units foreach ($g_rb_units[$system]["mass"] as $key=>$val) $units[] = $key; // Mass units $units = array_unique($units); // remove duplicates (dry/wet units could be duplicated in the units structure return $units; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocalUnits() {\n\t\tglobal $db_table_units, $alpha_sort_units, $DB_LINK, $LangUI;\n\t\t$localUnits = array();\n\t\t$unitSystem = Units::getLocalSystem();\n\t\t$localIDs = Units::getLocalUnitIDs($unitSystem);\n\t\t\n\t\t// Select all of the units from the database\n\t\t$sql = \"SELECT unit_id,unit_desc ...
[ "0.64538944", "0.6430178", "0.6285772", "0.623058", "0.5914378", "0.5825362", "0.5821878", "0.5791201", "0.5789797", "0.57348394", "0.5727367", "0.568037", "0.56755936", "0.5672207", "0.56219673", "0.5605784", "0.5603666", "0.55593705", "0.5515297", "0.5415474", "0.5405941", ...
0.7946969
0
Determines the unit system to use depending on the country the user is in. TODO: This is kind of simple logic right now, a list should be constructed for what countries use what system and this should be checked.
Определяет систему единиц, которую следует использовать в зависимости от страны, в которой находится пользователь. TODO: Сейчас логика довольно простая, должна быть построена таблица, указывающая, какие страны используют какие системы, и должна быть проверена.
function getLocalSystem() { global $SMObj; $unitSystem=""; // determine if we should be using Metric, U.S. Standard, or Imperial (mix) if ($SMObj->getUserCountry() == "us" || $SMObj->getUserCountry() == NULL) $unitSystem = "usa"; else $unitSystem = "metric"; return $unitSystem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function defaultUnits($type = false){\n $defaultUnits = array(\n 'Imperial' => array(\n 'pressure' => 'psig', \n 'vacuum' => 'psia', \n 'temperature' => 'F', \n 'specificEnthalpy' => 'btu/lbm', \n 'specificEn...
[ "0.57739675", "0.57607156", "0.5752686", "0.5605602", "0.55817", "0.5528278", "0.55107474", "0.5383727", "0.5348329", "0.5300381", "0.52949494", "0.5287499", "0.5255637", "0.5253408", "0.52242714", "0.5224107", "0.52179515", "0.5190162", "0.51371115", "0.51343805", "0.5117339...
0.7504782
0
Gets a list of units that are used locally, it is meant to filter out units that someone in a particular country would never use
Получает список единиц, которые используются локально, предназначено для отфильтровывания единиц, которые никогда не использовались бы кем-либо в определенной стране
function getLocalUnits() { global $db_table_units, $alpha_sort_units, $DB_LINK, $LangUI; $localUnits = array(); $unitSystem = Units::getLocalSystem(); $localIDs = Units::getLocalUnitIDs($unitSystem); // Select all of the units from the database $sql = "SELECT unit_id,unit_desc FROM $db_table_units"; // Sorting option if ($alpha_sort_units) $sql .=" ORDER BY unit_desc"; $rc = $DB_LINK->Execute($sql); DBUtils::checkResult($rc, NULL, $LangUI->_('There was an error selecting the unit_id'), $sql); while (!$rc->EOF) { if (in_array($rc->fields['unit_id'], $localIDs)) { $id = $rc->fields['unit_id']; $localUnits[$id] = $rc->fields['unit_desc']; } $rc->MoveNext(); } // Returns an associative array with id->desc return $localUnits; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLocalUnitIDs($system) {\n\t\tglobal $g_rb_units;\n\t\t$units = array();\n\t\tforeach ($g_rb_units['static'] as $key) $units[] = $key;\t\t// Unit types\n\t\tif (isset($g_rb_units[$system][\"wet\"])) foreach ($g_rb_units[$system][\"wet\"] as $key=>$val) $units[] = $key;\t// Wet volume units\n\t\tif (iss...
[ "0.66003275", "0.6468977", "0.6429829", "0.64178646", "0.6326583", "0.6168318", "0.60830736", "0.6068923", "0.6002617", "0.5982006", "0.59244514", "0.57722664", "0.5745365", "0.56972045", "0.56633174", "0.5658309", "0.5602198", "0.56016654", "0.5600336", "0.55433434", "0.5518...
0.7318606
0