query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
listlengths 0
30
| negative_scores
listlengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Load search values for validation
|
function LoadSearchValues() {
global $objForm;
// Load search values
// tanggal
$this->tanggal->AdvancedSearch->SearchValue = @$_GET["x_tanggal"];
if ($this->tanggal->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->tanggal->AdvancedSearch->SearchOperator = @$_GET["z_tanggal"];
// auc_number
$this->auc_number->AdvancedSearch->SearchValue = @$_GET["x_auc_number"];
if ($this->auc_number->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->auc_number->AdvancedSearch->SearchOperator = @$_GET["z_auc_number"];
// start_bid
$this->start_bid->AdvancedSearch->SearchValue = @$_GET["x_start_bid"];
if ($this->start_bid->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->start_bid->AdvancedSearch->SearchOperator = @$_GET["z_start_bid"];
// close_bid
$this->close_bid->AdvancedSearch->SearchValue = @$_GET["x_close_bid"];
if ($this->close_bid->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->close_bid->AdvancedSearch->SearchOperator = @$_GET["z_close_bid"];
// lot_number
$this->lot_number->AdvancedSearch->SearchValue = @$_GET["x_lot_number"];
if ($this->lot_number->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->lot_number->AdvancedSearch->SearchOperator = @$_GET["z_lot_number"];
// chop
$this->chop->AdvancedSearch->SearchValue = @$_GET["x_chop"];
if ($this->chop->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->chop->AdvancedSearch->SearchOperator = @$_GET["z_chop"];
// grade
$this->grade->AdvancedSearch->SearchValue = @$_GET["x_grade"];
if ($this->grade->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->grade->AdvancedSearch->SearchOperator = @$_GET["z_grade"];
// estate
$this->estate->AdvancedSearch->SearchValue = @$_GET["x_estate"];
if ($this->estate->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->estate->AdvancedSearch->SearchOperator = @$_GET["z_estate"];
// sack
$this->sack->AdvancedSearch->SearchValue = @$_GET["x_sack"];
if ($this->sack->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->sack->AdvancedSearch->SearchOperator = @$_GET["z_sack"];
// netto
$this->netto->AdvancedSearch->SearchValue = @$_GET["x_netto"];
if ($this->netto->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->netto->AdvancedSearch->SearchOperator = @$_GET["z_netto"];
// open_bid
$this->open_bid->AdvancedSearch->SearchValue = @$_GET["x_open_bid"];
if ($this->open_bid->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->open_bid->AdvancedSearch->SearchOperator = @$_GET["z_open_bid"];
// last_bid
$this->last_bid->AdvancedSearch->SearchValue = @$_GET["x_last_bid"];
if ($this->last_bid->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->last_bid->AdvancedSearch->SearchOperator = @$_GET["z_last_bid"];
// highest_bid
$this->highest_bid->AdvancedSearch->SearchValue = @$_GET["x_highest_bid"];
if ($this->highest_bid->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->highest_bid->AdvancedSearch->SearchOperator = @$_GET["z_highest_bid"];
// enter_bid
$this->enter_bid->AdvancedSearch->SearchValue = @$_GET["x_enter_bid"];
if ($this->enter_bid->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->enter_bid->AdvancedSearch->SearchOperator = @$_GET["z_enter_bid"];
// auction_status
$this->auction_status->AdvancedSearch->SearchValue = @$_GET["x_auction_status"];
if ($this->auction_status->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->auction_status->AdvancedSearch->SearchOperator = @$_GET["z_auction_status"];
// gross
$this->gross->AdvancedSearch->SearchValue = @$_GET["x_gross"];
if ($this->gross->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->gross->AdvancedSearch->SearchOperator = @$_GET["z_gross"];
// row_id
$this->row_id->AdvancedSearch->SearchValue = @$_GET["x_row_id"];
if ($this->row_id->AdvancedSearch->SearchValue <> "" && $this->Command == "") $this->Command = "search";
$this->row_id->AdvancedSearch->SearchOperator = @$_GET["z_row_id"];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function LoadSearchValues() {\n\t\tglobal $objForm;\n\n\t\t// Load search values\n\t\t// id\n\n\t\t$this->id->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_id\"]);\n\t\tif ($this->id->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->id->AdvancedSearch->SearchOperator = @$_GET[\"z_id\"];\n\n\t\t// name\n\t\t$this->name->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_name\"]);\n\t\tif ($this->name->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->name->AdvancedSearch->SearchOperator = @$_GET[\"z_name\"];\n\n\t\t// email\n\t\t$this->_email->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x__email\"]);\n\t\tif ($this->_email->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->_email->AdvancedSearch->SearchOperator = @$_GET[\"z__email\"];\n\n\t\t// companyname\n\t\t$this->companyname->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_companyname\"]);\n\t\tif ($this->companyname->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->companyname->AdvancedSearch->SearchOperator = @$_GET[\"z_companyname\"];\n\n\t\t// servicetime\n\t\t$this->servicetime->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_servicetime\"]);\n\t\tif ($this->servicetime->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->servicetime->AdvancedSearch->SearchOperator = @$_GET[\"z_servicetime\"];\n\n\t\t// country\n\t\t$this->country->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_country\"]);\n\t\tif ($this->country->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->country->AdvancedSearch->SearchOperator = @$_GET[\"z_country\"];\n\n\t\t// phone\n\t\t$this->phone->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_phone\"]);\n\t\tif ($this->phone->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->phone->AdvancedSearch->SearchOperator = @$_GET[\"z_phone\"];\n\n\t\t// skype\n\t\t$this->skype->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_skype\"]);\n\t\tif ($this->skype->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->skype->AdvancedSearch->SearchOperator = @$_GET[\"z_skype\"];\n\n\t\t// website\n\t\t$this->website->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_website\"]);\n\t\tif ($this->website->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->website->AdvancedSearch->SearchOperator = @$_GET[\"z_website\"];\n\n\t\t// linkedin\n\t\t$this->linkedin->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_linkedin\"]);\n\t\tif ($this->linkedin->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->linkedin->AdvancedSearch->SearchOperator = @$_GET[\"z_linkedin\"];\n\n\t\t// facebook\n\t\t$this->facebook->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_facebook\"]);\n\t\tif ($this->facebook->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->facebook->AdvancedSearch->SearchOperator = @$_GET[\"z_facebook\"];\n\n\t\t// twitter\n\t\t$this->twitter->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_twitter\"]);\n\t\tif ($this->twitter->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->twitter->AdvancedSearch->SearchOperator = @$_GET[\"z_twitter\"];\n\n\t\t// active_code\n\t\t$this->active_code->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_active_code\"]);\n\t\tif ($this->active_code->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->active_code->AdvancedSearch->SearchOperator = @$_GET[\"z_active_code\"];\n\n\t\t// identification\n\t\t$this->identification->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_identification\"]);\n\t\tif ($this->identification->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->identification->AdvancedSearch->SearchOperator = @$_GET[\"z_identification\"];\n\n\t\t// link_expired\n\t\t$this->link_expired->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_link_expired\"]);\n\t\tif ($this->link_expired->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->link_expired->AdvancedSearch->SearchOperator = @$_GET[\"z_link_expired\"];\n\n\t\t// isactive\n\t\t$this->isactive->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_isactive\"]);\n\t\tif ($this->isactive->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->isactive->AdvancedSearch->SearchOperator = @$_GET[\"z_isactive\"];\n\n\t\t// pio\n\t\t$this->pio->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_pio\"]);\n\t\tif ($this->pio->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->pio->AdvancedSearch->SearchOperator = @$_GET[\"z_pio\"];\n\n\t\t// google\n\t\t$this->google->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_google\"]);\n\t\tif ($this->google->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->google->AdvancedSearch->SearchOperator = @$_GET[\"z_google\"];\n\n\t\t// instagram\n\t\t$this->instagram->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_instagram\"]);\n\t\tif ($this->instagram->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->instagram->AdvancedSearch->SearchOperator = @$_GET[\"z_instagram\"];\n\n\t\t// account_type\n\t\t$this->account_type->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_account_type\"]);\n\t\tif ($this->account_type->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->account_type->AdvancedSearch->SearchOperator = @$_GET[\"z_account_type\"];\n\n\t\t// logo\n\t\t$this->logo->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_logo\"]);\n\t\tif ($this->logo->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->logo->AdvancedSearch->SearchOperator = @$_GET[\"z_logo\"];\n\n\t\t// profilepic\n\t\t$this->profilepic->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_profilepic\"]);\n\t\tif ($this->profilepic->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->profilepic->AdvancedSearch->SearchOperator = @$_GET[\"z_profilepic\"];\n\n\t\t// mailref\n\t\t$this->mailref->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_mailref\"]);\n\t\tif ($this->mailref->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->mailref->AdvancedSearch->SearchOperator = @$_GET[\"z_mailref\"];\n\n\t\t// deleted\n\t\t$this->deleted->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_deleted\"]);\n\t\tif ($this->deleted->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->deleted->AdvancedSearch->SearchOperator = @$_GET[\"z_deleted\"];\n\n\t\t// deletefeedback\n\t\t$this->deletefeedback->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_deletefeedback\"]);\n\t\tif ($this->deletefeedback->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->deletefeedback->AdvancedSearch->SearchOperator = @$_GET[\"z_deletefeedback\"];\n\n\t\t// account_id\n\t\t$this->account_id->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_account_id\"]);\n\t\tif ($this->account_id->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->account_id->AdvancedSearch->SearchOperator = @$_GET[\"z_account_id\"];\n\n\t\t// start_date\n\t\t$this->start_date->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_start_date\"]);\n\t\tif ($this->start_date->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->start_date->AdvancedSearch->SearchOperator = @$_GET[\"z_start_date\"];\n\n\t\t// end_date\n\t\t$this->end_date->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_end_date\"]);\n\t\tif ($this->end_date->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->end_date->AdvancedSearch->SearchOperator = @$_GET[\"z_end_date\"];\n\n\t\t// year_moth\n\t\t$this->year_moth->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_year_moth\"]);\n\t\tif ($this->year_moth->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->year_moth->AdvancedSearch->SearchOperator = @$_GET[\"z_year_moth\"];\n\n\t\t// registerdate\n\t\t$this->registerdate->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_registerdate\"]);\n\t\tif ($this->registerdate->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->registerdate->AdvancedSearch->SearchOperator = @$_GET[\"z_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchCondition = @$_GET[\"v_registerdate\"];\n\t\t$this->registerdate->AdvancedSearch->SearchValue2 = ew_StripSlashes(@$_GET[\"y_registerdate\"]);\n\t\tif ($this->registerdate->AdvancedSearch->SearchValue2 <> \"\") $this->Command = \"search\";\n\t\t$this->registerdate->AdvancedSearch->SearchOperator2 = @$_GET[\"w_registerdate\"];\n\n\t\t// login_type\n\t\t$this->login_type->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_login_type\"]);\n\t\tif ($this->login_type->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->login_type->AdvancedSearch->SearchOperator = @$_GET[\"z_login_type\"];\n\n\t\t// accountstatus\n\t\t$this->accountstatus->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_accountstatus\"]);\n\t\tif ($this->accountstatus->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->accountstatus->AdvancedSearch->SearchOperator = @$_GET[\"z_accountstatus\"];\n\n\t\t// ispay\n\t\t$this->ispay->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_ispay\"]);\n\t\tif ($this->ispay->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->ispay->AdvancedSearch->SearchOperator = @$_GET[\"z_ispay\"];\n\n\t\t// profilelink\n\t\t$this->profilelink->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_profilelink\"]);\n\t\tif ($this->profilelink->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->profilelink->AdvancedSearch->SearchOperator = @$_GET[\"z_profilelink\"];\n\n\t\t// source\n\t\t$this->source->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_source\"]);\n\t\tif ($this->source->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->source->AdvancedSearch->SearchOperator = @$_GET[\"z_source\"];\n\n\t\t// agree\n\t\t$this->agree->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_agree\"]);\n\t\tif ($this->agree->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->agree->AdvancedSearch->SearchOperator = @$_GET[\"z_agree\"];\n\n\t\t// balance\n\t\t$this->balance->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_balance\"]);\n\t\tif ($this->balance->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->balance->AdvancedSearch->SearchOperator = @$_GET[\"z_balance\"];\n\n\t\t// job_title\n\t\t$this->job_title->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_job_title\"]);\n\t\tif ($this->job_title->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->job_title->AdvancedSearch->SearchOperator = @$_GET[\"z_job_title\"];\n\n\t\t// projects\n\t\t$this->projects->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_projects\"]);\n\t\tif ($this->projects->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->projects->AdvancedSearch->SearchOperator = @$_GET[\"z_projects\"];\n\n\t\t// opportunities\n\t\t$this->opportunities->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_opportunities\"]);\n\t\tif ($this->opportunities->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->opportunities->AdvancedSearch->SearchOperator = @$_GET[\"z_opportunities\"];\n\n\t\t// isconsaltant\n\t\t$this->isconsaltant->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_isconsaltant\"]);\n\t\tif ($this->isconsaltant->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->isconsaltant->AdvancedSearch->SearchOperator = @$_GET[\"z_isconsaltant\"];\n\t\tif (is_array($this->isconsaltant->AdvancedSearch->SearchValue)) $this->isconsaltant->AdvancedSearch->SearchValue = implode(\",\", $this->isconsaltant->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->isconsaltant->AdvancedSearch->SearchValue2)) $this->isconsaltant->AdvancedSearch->SearchValue2 = implode(\",\", $this->isconsaltant->AdvancedSearch->SearchValue2);\n\n\t\t// isagent\n\t\t$this->isagent->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_isagent\"]);\n\t\tif ($this->isagent->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->isagent->AdvancedSearch->SearchOperator = @$_GET[\"z_isagent\"];\n\t\tif (is_array($this->isagent->AdvancedSearch->SearchValue)) $this->isagent->AdvancedSearch->SearchValue = implode(\",\", $this->isagent->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->isagent->AdvancedSearch->SearchValue2)) $this->isagent->AdvancedSearch->SearchValue2 = implode(\",\", $this->isagent->AdvancedSearch->SearchValue2);\n\n\t\t// isinvestor\n\t\t$this->isinvestor->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_isinvestor\"]);\n\t\tif ($this->isinvestor->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->isinvestor->AdvancedSearch->SearchOperator = @$_GET[\"z_isinvestor\"];\n\t\tif (is_array($this->isinvestor->AdvancedSearch->SearchValue)) $this->isinvestor->AdvancedSearch->SearchValue = implode(\",\", $this->isinvestor->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->isinvestor->AdvancedSearch->SearchValue2)) $this->isinvestor->AdvancedSearch->SearchValue2 = implode(\",\", $this->isinvestor->AdvancedSearch->SearchValue2);\n\n\t\t// isbusinessman\n\t\t$this->isbusinessman->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_isbusinessman\"]);\n\t\tif ($this->isbusinessman->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->isbusinessman->AdvancedSearch->SearchOperator = @$_GET[\"z_isbusinessman\"];\n\t\tif (is_array($this->isbusinessman->AdvancedSearch->SearchValue)) $this->isbusinessman->AdvancedSearch->SearchValue = implode(\",\", $this->isbusinessman->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->isbusinessman->AdvancedSearch->SearchValue2)) $this->isbusinessman->AdvancedSearch->SearchValue2 = implode(\",\", $this->isbusinessman->AdvancedSearch->SearchValue2);\n\n\t\t// isprovider\n\t\t$this->isprovider->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_isprovider\"]);\n\t\tif ($this->isprovider->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->isprovider->AdvancedSearch->SearchOperator = @$_GET[\"z_isprovider\"];\n\t\tif (is_array($this->isprovider->AdvancedSearch->SearchValue)) $this->isprovider->AdvancedSearch->SearchValue = implode(\",\", $this->isprovider->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->isprovider->AdvancedSearch->SearchValue2)) $this->isprovider->AdvancedSearch->SearchValue2 = implode(\",\", $this->isprovider->AdvancedSearch->SearchValue2);\n\n\t\t// isproductowner\n\t\t$this->isproductowner->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_isproductowner\"]);\n\t\tif ($this->isproductowner->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->isproductowner->AdvancedSearch->SearchOperator = @$_GET[\"z_isproductowner\"];\n\t\tif (is_array($this->isproductowner->AdvancedSearch->SearchValue)) $this->isproductowner->AdvancedSearch->SearchValue = implode(\",\", $this->isproductowner->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->isproductowner->AdvancedSearch->SearchValue2)) $this->isproductowner->AdvancedSearch->SearchValue2 = implode(\",\", $this->isproductowner->AdvancedSearch->SearchValue2);\n\n\t\t// states\n\t\t$this->states->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_states\"]);\n\t\tif ($this->states->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->states->AdvancedSearch->SearchOperator = @$_GET[\"z_states\"];\n\n\t\t// cities\n\t\t$this->cities->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_cities\"]);\n\t\tif ($this->cities->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->cities->AdvancedSearch->SearchOperator = @$_GET[\"z_cities\"];\n\n\t\t// offers\n\t\t$this->offers->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_offers\"]);\n\t\tif ($this->offers->AdvancedSearch->SearchValue <> \"\") $this->Command = \"search\";\n\t\t$this->offers->AdvancedSearch->SearchOperator = @$_GET[\"z_offers\"];\n\t}",
"function LoadSearchValues() {\n\t\tglobal $objForm;\n\n\t\t// Load search values\n\t\t// id\n\n\t\t$this->id->AdvancedSearch->SearchValue = @$_GET[\"x_id\"];\n\t\tif ($this->id->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id->AdvancedSearch->SearchOperator = @$_GET[\"z_id\"];\n\n\t\t// nombre_contacto\n\t\t$this->nombre_contacto->AdvancedSearch->SearchValue = @$_GET[\"x_nombre_contacto\"];\n\t\tif ($this->nombre_contacto->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->nombre_contacto->AdvancedSearch->SearchOperator = @$_GET[\"z_nombre_contacto\"];\n\n\t\t// name\n\t\t$this->name->AdvancedSearch->SearchValue = @$_GET[\"x_name\"];\n\t\tif ($this->name->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->name->AdvancedSearch->SearchOperator = @$_GET[\"z_name\"];\n\n\t\t// lastname\n\t\t$this->lastname->AdvancedSearch->SearchValue = @$_GET[\"x_lastname\"];\n\t\tif ($this->lastname->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->lastname->AdvancedSearch->SearchOperator = @$_GET[\"z_lastname\"];\n\n\t\t// email\n\t\t$this->_email->AdvancedSearch->SearchValue = @$_GET[\"x__email\"];\n\t\tif ($this->_email->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->_email->AdvancedSearch->SearchOperator = @$_GET[\"z__email\"];\n\n\t\t// address\n\t\t$this->address->AdvancedSearch->SearchValue = @$_GET[\"x_address\"];\n\t\tif ($this->address->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->address->AdvancedSearch->SearchOperator = @$_GET[\"z_address\"];\n\n\t\t// phone\n\t\t$this->phone->AdvancedSearch->SearchValue = @$_GET[\"x_phone\"];\n\t\tif ($this->phone->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->phone->AdvancedSearch->SearchOperator = @$_GET[\"z_phone\"];\n\n\t\t// cell\n\t\t$this->cell->AdvancedSearch->SearchValue = @$_GET[\"x_cell\"];\n\t\tif ($this->cell->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->cell->AdvancedSearch->SearchOperator = @$_GET[\"z_cell\"];\n\n\t\t// created_at\n\t\t$this->created_at->AdvancedSearch->SearchValue = @$_GET[\"x_created_at\"];\n\t\tif ($this->created_at->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->created_at->AdvancedSearch->SearchOperator = @$_GET[\"z_created_at\"];\n\n\t\t// id_sucursal\n\t\t$this->id_sucursal->AdvancedSearch->SearchValue = @$_GET[\"x_id_sucursal\"];\n\t\tif ($this->id_sucursal->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_sucursal->AdvancedSearch->SearchOperator = @$_GET[\"z_id_sucursal\"];\n\n\t\t// tipoinmueble\n\t\t$this->tipoinmueble->AdvancedSearch->SearchValue = @$_GET[\"x_tipoinmueble\"];\n\t\tif ($this->tipoinmueble->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->tipoinmueble->AdvancedSearch->SearchOperator = @$_GET[\"z_tipoinmueble\"];\n\t\tif (is_array($this->tipoinmueble->AdvancedSearch->SearchValue)) $this->tipoinmueble->AdvancedSearch->SearchValue = implode(\",\", $this->tipoinmueble->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->tipoinmueble->AdvancedSearch->SearchValue2)) $this->tipoinmueble->AdvancedSearch->SearchValue2 = implode(\",\", $this->tipoinmueble->AdvancedSearch->SearchValue2);\n\n\t\t// id_ciudad_inmueble\n\t\t$this->id_ciudad_inmueble->AdvancedSearch->SearchValue = @$_GET[\"x_id_ciudad_inmueble\"];\n\t\tif ($this->id_ciudad_inmueble->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_ciudad_inmueble->AdvancedSearch->SearchOperator = @$_GET[\"z_id_ciudad_inmueble\"];\n\n\t\t// id_provincia_inmueble\n\t\t$this->id_provincia_inmueble->AdvancedSearch->SearchValue = @$_GET[\"x_id_provincia_inmueble\"];\n\t\tif ($this->id_provincia_inmueble->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_provincia_inmueble->AdvancedSearch->SearchOperator = @$_GET[\"z_id_provincia_inmueble\"];\n\n\t\t// tipovehiculo\n\t\t$this->tipovehiculo->AdvancedSearch->SearchValue = @$_GET[\"x_tipovehiculo\"];\n\t\tif ($this->tipovehiculo->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->tipovehiculo->AdvancedSearch->SearchOperator = @$_GET[\"z_tipovehiculo\"];\n\t\tif (is_array($this->tipovehiculo->AdvancedSearch->SearchValue)) $this->tipovehiculo->AdvancedSearch->SearchValue = implode(\",\", $this->tipovehiculo->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->tipovehiculo->AdvancedSearch->SearchValue2)) $this->tipovehiculo->AdvancedSearch->SearchValue2 = implode(\",\", $this->tipovehiculo->AdvancedSearch->SearchValue2);\n\n\t\t// id_ciudad_vehiculo\n\t\t$this->id_ciudad_vehiculo->AdvancedSearch->SearchValue = @$_GET[\"x_id_ciudad_vehiculo\"];\n\t\tif ($this->id_ciudad_vehiculo->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_ciudad_vehiculo->AdvancedSearch->SearchOperator = @$_GET[\"z_id_ciudad_vehiculo\"];\n\n\t\t// id_provincia_vehiculo\n\t\t$this->id_provincia_vehiculo->AdvancedSearch->SearchValue = @$_GET[\"x_id_provincia_vehiculo\"];\n\t\tif ($this->id_provincia_vehiculo->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_provincia_vehiculo->AdvancedSearch->SearchOperator = @$_GET[\"z_id_provincia_vehiculo\"];\n\n\t\t// tipomaquinaria\n\t\t$this->tipomaquinaria->AdvancedSearch->SearchValue = @$_GET[\"x_tipomaquinaria\"];\n\t\tif ($this->tipomaquinaria->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->tipomaquinaria->AdvancedSearch->SearchOperator = @$_GET[\"z_tipomaquinaria\"];\n\t\tif (is_array($this->tipomaquinaria->AdvancedSearch->SearchValue)) $this->tipomaquinaria->AdvancedSearch->SearchValue = implode(\",\", $this->tipomaquinaria->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->tipomaquinaria->AdvancedSearch->SearchValue2)) $this->tipomaquinaria->AdvancedSearch->SearchValue2 = implode(\",\", $this->tipomaquinaria->AdvancedSearch->SearchValue2);\n\n\t\t// id_ciudad_maquinaria\n\t\t$this->id_ciudad_maquinaria->AdvancedSearch->SearchValue = @$_GET[\"x_id_ciudad_maquinaria\"];\n\t\tif ($this->id_ciudad_maquinaria->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_ciudad_maquinaria->AdvancedSearch->SearchOperator = @$_GET[\"z_id_ciudad_maquinaria\"];\n\n\t\t// id_provincia_maquinaria\n\t\t$this->id_provincia_maquinaria->AdvancedSearch->SearchValue = @$_GET[\"x_id_provincia_maquinaria\"];\n\t\tif ($this->id_provincia_maquinaria->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_provincia_maquinaria->AdvancedSearch->SearchOperator = @$_GET[\"z_id_provincia_maquinaria\"];\n\n\t\t// tipomercaderia\n\t\t$this->tipomercaderia->AdvancedSearch->SearchValue = @$_GET[\"x_tipomercaderia\"];\n\t\tif ($this->tipomercaderia->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->tipomercaderia->AdvancedSearch->SearchOperator = @$_GET[\"z_tipomercaderia\"];\n\t\tif (is_array($this->tipomercaderia->AdvancedSearch->SearchValue)) $this->tipomercaderia->AdvancedSearch->SearchValue = implode(\",\", $this->tipomercaderia->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->tipomercaderia->AdvancedSearch->SearchValue2)) $this->tipomercaderia->AdvancedSearch->SearchValue2 = implode(\",\", $this->tipomercaderia->AdvancedSearch->SearchValue2);\n\n\t\t// documento_mercaderia\n\t\t$this->documento_mercaderia->AdvancedSearch->SearchValue = @$_GET[\"x_documento_mercaderia\"];\n\t\tif ($this->documento_mercaderia->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->documento_mercaderia->AdvancedSearch->SearchOperator = @$_GET[\"z_documento_mercaderia\"];\n\n\t\t// tipoespecial\n\t\t$this->tipoespecial->AdvancedSearch->SearchValue = @$_GET[\"x_tipoespecial\"];\n\t\tif ($this->tipoespecial->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->tipoespecial->AdvancedSearch->SearchOperator = @$_GET[\"z_tipoespecial\"];\n\t\tif (is_array($this->tipoespecial->AdvancedSearch->SearchValue)) $this->tipoespecial->AdvancedSearch->SearchValue = implode(\",\", $this->tipoespecial->AdvancedSearch->SearchValue);\n\t\tif (is_array($this->tipoespecial->AdvancedSearch->SearchValue2)) $this->tipoespecial->AdvancedSearch->SearchValue2 = implode(\",\", $this->tipoespecial->AdvancedSearch->SearchValue2);\n\n\t\t// email_contacto\n\t\t$this->email_contacto->AdvancedSearch->SearchValue = @$_GET[\"x_email_contacto\"];\n\t\tif ($this->email_contacto->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->email_contacto->AdvancedSearch->SearchOperator = @$_GET[\"z_email_contacto\"];\n\t}",
"function LoadSearchValues() {\n\t\tglobal $objForm;\n\n\t\t// Load search values\n\t\t// id\n\n\t\t$this->id->AdvancedSearch->SearchValue = @$_GET[\"x_id\"];\n\t\tif ($this->id->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id->AdvancedSearch->SearchOperator = @$_GET[\"z_id\"];\n\n\t\t// fecha_tamizaje\n\t\t$this->fecha_tamizaje->AdvancedSearch->SearchValue = @$_GET[\"x_fecha_tamizaje\"];\n\t\tif ($this->fecha_tamizaje->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->fecha_tamizaje->AdvancedSearch->SearchOperator = @$_GET[\"z_fecha_tamizaje\"];\n\n\t\t// id_centro\n\t\t$this->id_centro->AdvancedSearch->SearchValue = @$_GET[\"x_id_centro\"];\n\t\tif ($this->id_centro->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_centro->AdvancedSearch->SearchOperator = @$_GET[\"z_id_centro\"];\n\n\t\t// apellidopaterno\n\t\t$this->apellidopaterno->AdvancedSearch->SearchValue = @$_GET[\"x_apellidopaterno\"];\n\t\tif ($this->apellidopaterno->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->apellidopaterno->AdvancedSearch->SearchOperator = @$_GET[\"z_apellidopaterno\"];\n\n\t\t// apellidomaterno\n\t\t$this->apellidomaterno->AdvancedSearch->SearchValue = @$_GET[\"x_apellidomaterno\"];\n\t\tif ($this->apellidomaterno->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->apellidomaterno->AdvancedSearch->SearchOperator = @$_GET[\"z_apellidomaterno\"];\n\n\t\t// nombre\n\t\t$this->nombre->AdvancedSearch->SearchValue = @$_GET[\"x_nombre\"];\n\t\tif ($this->nombre->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->nombre->AdvancedSearch->SearchOperator = @$_GET[\"z_nombre\"];\n\n\t\t// ci\n\t\t$this->ci->AdvancedSearch->SearchValue = @$_GET[\"x_ci\"];\n\t\tif ($this->ci->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->ci->AdvancedSearch->SearchOperator = @$_GET[\"z_ci\"];\n\n\t\t// fecha_nacimiento\n\t\t$this->fecha_nacimiento->AdvancedSearch->SearchValue = @$_GET[\"x_fecha_nacimiento\"];\n\t\tif ($this->fecha_nacimiento->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->fecha_nacimiento->AdvancedSearch->SearchOperator = @$_GET[\"z_fecha_nacimiento\"];\n\n\t\t// dias\n\t\t$this->dias->AdvancedSearch->SearchValue = @$_GET[\"x_dias\"];\n\t\tif ($this->dias->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->dias->AdvancedSearch->SearchOperator = @$_GET[\"z_dias\"];\n\n\t\t// semanas\n\t\t$this->semanas->AdvancedSearch->SearchValue = @$_GET[\"x_semanas\"];\n\t\tif ($this->semanas->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->semanas->AdvancedSearch->SearchOperator = @$_GET[\"z_semanas\"];\n\n\t\t// meses\n\t\t$this->meses->AdvancedSearch->SearchValue = @$_GET[\"x_meses\"];\n\t\tif ($this->meses->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->meses->AdvancedSearch->SearchOperator = @$_GET[\"z_meses\"];\n\n\t\t// sexo\n\t\t$this->sexo->AdvancedSearch->SearchValue = @$_GET[\"x_sexo\"];\n\t\tif ($this->sexo->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->sexo->AdvancedSearch->SearchOperator = @$_GET[\"z_sexo\"];\n\n\t\t// discapacidad\n\t\t$this->discapacidad->AdvancedSearch->SearchValue = @$_GET[\"x_discapacidad\"];\n\t\tif ($this->discapacidad->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->discapacidad->AdvancedSearch->SearchOperator = @$_GET[\"z_discapacidad\"];\n\n\t\t// id_tipodiscapacidad\n\t\t$this->id_tipodiscapacidad->AdvancedSearch->SearchValue = @$_GET[\"x_id_tipodiscapacidad\"];\n\t\tif ($this->id_tipodiscapacidad->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_tipodiscapacidad->AdvancedSearch->SearchOperator = @$_GET[\"z_id_tipodiscapacidad\"];\n\n\t\t// resultado\n\t\t$this->resultado->AdvancedSearch->SearchValue = @$_GET[\"x_resultado\"];\n\t\tif ($this->resultado->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->resultado->AdvancedSearch->SearchOperator = @$_GET[\"z_resultado\"];\n\n\t\t// resultadotamizaje\n\t\t$this->resultadotamizaje->AdvancedSearch->SearchValue = @$_GET[\"x_resultadotamizaje\"];\n\t\tif ($this->resultadotamizaje->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->resultadotamizaje->AdvancedSearch->SearchOperator = @$_GET[\"z_resultadotamizaje\"];\n\n\t\t// tapon\n\t\t$this->tapon->AdvancedSearch->SearchValue = @$_GET[\"x_tapon\"];\n\t\tif ($this->tapon->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->tapon->AdvancedSearch->SearchOperator = @$_GET[\"z_tapon\"];\n\n\t\t// tipo\n\t\t$this->tipo->AdvancedSearch->SearchValue = @$_GET[\"x_tipo\"];\n\t\tif ($this->tipo->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->tipo->AdvancedSearch->SearchOperator = @$_GET[\"z_tipo\"];\n\n\t\t// repetirprueba\n\t\t$this->repetirprueba->AdvancedSearch->SearchValue = @$_GET[\"x_repetirprueba\"];\n\t\tif ($this->repetirprueba->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->repetirprueba->AdvancedSearch->SearchOperator = @$_GET[\"z_repetirprueba\"];\n\n\t\t// observaciones\n\t\t$this->observaciones->AdvancedSearch->SearchValue = @$_GET[\"x_observaciones\"];\n\t\tif ($this->observaciones->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->observaciones->AdvancedSearch->SearchOperator = @$_GET[\"z_observaciones\"];\n\n\t\t// id_apoderado\n\t\t$this->id_apoderado->AdvancedSearch->SearchValue = @$_GET[\"x_id_apoderado\"];\n\t\tif ($this->id_apoderado->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_apoderado->AdvancedSearch->SearchOperator = @$_GET[\"z_id_apoderado\"];\n\n\t\t// id_referencia\n\t\t$this->id_referencia->AdvancedSearch->SearchValue = @$_GET[\"x_id_referencia\"];\n\t\tif ($this->id_referencia->AdvancedSearch->SearchValue <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->id_referencia->AdvancedSearch->SearchOperator = @$_GET[\"z_id_referencia\"];\n\t}",
"function LoadSearchValues() {\r\n\t\tglobal $objForm;\r\n\r\n\t\t// Load search values\r\n\t\t// Nama\r\n\r\n\t\t$this->Nama->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Nama\"));\r\n\t\t$this->Nama->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Nama\");\r\n\r\n\t\t// Provinsi\r\n\t\t$this->Provinsi->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Provinsi\"));\r\n\t\t$this->Provinsi->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Provinsi\");\r\n\r\n\t\t// Area\r\n\t\t$this->Area->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Area\"));\r\n\t\t$this->Area->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Area\");\r\n\r\n\t\t// CP\r\n\t\t$this->CP->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_CP\"));\r\n\t\t$this->CP->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_CP\");\r\n\r\n\t\t// Tanggal\r\n\t\t$this->Tanggal->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Tanggal\"));\r\n\t\t$this->Tanggal->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Tanggal\");\r\n\t\t$this->Tanggal->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Tanggal\");\r\n\t\t$this->Tanggal->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Tanggal\"));\r\n\t\t$this->Tanggal->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Tanggal\");\r\n\r\n\t\t// Vechicle\r\n\t\t$this->Vechicle->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Vechicle\"));\r\n\t\t$this->Vechicle->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Vechicle\");\r\n\r\n\t\t// Type\r\n\t\t$this->Type->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Type\"));\r\n\t\t$this->Type->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Type\");\r\n\r\n\t\t// Site\r\n\t\t$this->Site->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Site\"));\r\n\t\t$this->Site->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Site\");\r\n\r\n\t\t// Status\r\n\t\t$this->Status->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Status\"));\r\n\t\t$this->Status->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Status\");\r\n\r\n\t\t// visit\r\n\t\t$this->visit->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_visit\"));\r\n\t\t$this->visit->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_visit\");\r\n\t}",
"function LoadSearchValues() {\r\n\t\tglobal $objForm;\r\n\r\n\t\t// Load search values\r\n\t\t// Id_Reasignacion\r\n\r\n\t\t$this->Id_Reasignacion->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Id_Reasignacion\"));\r\n\t\t$this->Id_Reasignacion->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Id_Reasignacion\");\r\n\r\n\t\t// Titular_Original\r\n\t\t$this->Titular_Original->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Titular_Original\"));\r\n\t\t$this->Titular_Original->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Titular_Original\");\r\n\r\n\t\t// Dni\r\n\t\t$this->Dni->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Dni\"));\r\n\t\t$this->Dni->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Dni\");\r\n\r\n\t\t// NroSerie\r\n\t\t$this->NroSerie->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_NroSerie\"));\r\n\t\t$this->NroSerie->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_NroSerie\");\r\n\r\n\t\t// Nuevo_Titular\r\n\t\t$this->Nuevo_Titular->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Nuevo_Titular\"));\r\n\t\t$this->Nuevo_Titular->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Nuevo_Titular\");\r\n\r\n\t\t// Dni_Nuevo_Tit\r\n\t\t$this->Dni_Nuevo_Tit->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Dni_Nuevo_Tit\"));\r\n\t\t$this->Dni_Nuevo_Tit->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Dni_Nuevo_Tit\");\r\n\r\n\t\t// Id_Motivo_Reasig\r\n\t\t$this->Id_Motivo_Reasig->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Id_Motivo_Reasig\"));\r\n\t\t$this->Id_Motivo_Reasig->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Id_Motivo_Reasig\");\r\n\r\n\t\t// Observacion\r\n\t\t$this->Observacion->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Observacion\"));\r\n\t\t$this->Observacion->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Observacion\");\r\n\r\n\t\t// Fecha_Reasignacion\r\n\t\t$this->Fecha_Reasignacion->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Fecha_Reasignacion\"));\r\n\t\t$this->Fecha_Reasignacion->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Fecha_Reasignacion\");\r\n\r\n\t\t// Usuario\r\n\t\t$this->Usuario->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Usuario\"));\r\n\t\t$this->Usuario->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Usuario\");\r\n\r\n\t\t// Fecha_Actualizacion\r\n\t\t$this->Fecha_Actualizacion->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Fecha_Actualizacion\"));\r\n\t\t$this->Fecha_Actualizacion->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Fecha_Actualizacion\");\r\n\t}",
"function LoadSearchValues() {\n\t\tglobal $objForm, $t_tinbai_mainsite;\n\n\t\t// Load search values\n\t\t// PK_TINBAI_ID\n\n\t\t$t_tinbai_mainsite->PK_TINBAI_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_PK_TINBAI_ID\"]);\n\t\t$t_tinbai_mainsite->PK_TINBAI_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_PK_TINBAI_ID\"];\n\n\t\t// FK_CONGTY_ID\n\t\t$t_tinbai_mainsite->FK_CONGTY_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_CONGTY_ID\"]);\n\t\t$t_tinbai_mainsite->FK_CONGTY_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_CONGTY_ID\"];\n\n\t\t// FK_DMGIOITHIEU_ID\n\t\t$t_tinbai_mainsite->FK_DMGIOITHIEU_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_DMGIOITHIEU_ID\"]);\n\t\t$t_tinbai_mainsite->FK_DMGIOITHIEU_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_DMGIOITHIEU_ID\"];\n\n\t\t// FK_DMTUYENSINH_ID\n\t\t$t_tinbai_mainsite->FK_DMTUYENSINH_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_DMTUYENSINH_ID\"]);\n\t\t$t_tinbai_mainsite->FK_DMTUYENSINH_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_DMTUYENSINH_ID\"];\n\n\t\t// FK_DTSVTUONGLAI_ID\n\t\t$t_tinbai_mainsite->FK_DTSVTUONGLAI_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_DTSVTUONGLAI_ID\"]);\n\t\t$t_tinbai_mainsite->FK_DTSVTUONGLAI_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_DTSVTUONGLAI_ID\"];\n\n\t\t// FK_DTSVDANGHOC_ID\n\t\t$t_tinbai_mainsite->FK_DTSVDANGHOC_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_DTSVDANGHOC_ID\"]);\n\t\t$t_tinbai_mainsite->FK_DTSVDANGHOC_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_DTSVDANGHOC_ID\"];\n\n\t\t// FK_DTCUUSV_ID\n\t\t$t_tinbai_mainsite->FK_DTCUUSV_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_DTCUUSV_ID\"]);\n\t\t$t_tinbai_mainsite->FK_DTCUUSV_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_DTCUUSV_ID\"];\n\n\t\t// FK_DTDOANHNGHIEP_ID\n\t\t$t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_DTDOANHNGHIEP_ID\"]);\n\t\t$t_tinbai_mainsite->FK_DTDOANHNGHIEP_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_DTDOANHNGHIEP_ID\"];\n\n\t\t// C_TITLE\n\t\t$t_tinbai_mainsite->C_TITLE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_TITLE\"]);\n\t\t$t_tinbai_mainsite->C_TITLE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_TITLE\"];\n\n\t\t// C_SUMARY\n\t\t$t_tinbai_mainsite->C_SUMARY->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_SUMARY\"]);\n\t\t$t_tinbai_mainsite->C_SUMARY->AdvancedSearch->SearchOperator = @$_GET[\"z_C_SUMARY\"];\n\n\t\t// C_CONTENTS\n\t\t$t_tinbai_mainsite->C_CONTENTS->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_CONTENTS\"]);\n\t\t$t_tinbai_mainsite->C_CONTENTS->AdvancedSearch->SearchOperator = @$_GET[\"z_C_CONTENTS\"];\n\n\t\t// C_HIT_MAINSITE\n\t\t$t_tinbai_mainsite->C_HIT_MAINSITE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_HIT_MAINSITE\"]);\n\t\t$t_tinbai_mainsite->C_HIT_MAINSITE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_HIT_MAINSITE\"];\n\n\t\t// C_NEW_MYSEFLT\n\t\t$t_tinbai_mainsite->C_NEW_MYSEFLT->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_NEW_MYSEFLT\"]);\n\t\t$t_tinbai_mainsite->C_NEW_MYSEFLT->AdvancedSearch->SearchOperator = @$_GET[\"z_C_NEW_MYSEFLT\"];\n\n\t\t// C_COMMENT_MAINSITE\n\t\t$t_tinbai_mainsite->C_COMMENT_MAINSITE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_COMMENT_MAINSITE\"]);\n\t\t$t_tinbai_mainsite->C_COMMENT_MAINSITE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_COMMENT_MAINSITE\"];\n\n\t\t// C_ORDER_MAINSITE\n\t\t$t_tinbai_mainsite->C_ORDER_MAINSITE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_ORDER_MAINSITE\"]);\n\t\t$t_tinbai_mainsite->C_ORDER_MAINSITE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_ORDER_MAINSITE\"];\n\n\t\t// C_STATUS_MAINSITE\n\t\t$t_tinbai_mainsite->C_STATUS_MAINSITE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_STATUS_MAINSITE\"]);\n\t\t$t_tinbai_mainsite->C_STATUS_MAINSITE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_STATUS_MAINSITE\"];\n\n\t\t// C_VISITOR_MAINSITE\n\t\t$t_tinbai_mainsite->C_VISITOR_MAINSITE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_VISITOR_MAINSITE\"]);\n\t\t$t_tinbai_mainsite->C_VISITOR_MAINSITE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_VISITOR_MAINSITE\"];\n\n\t\t// C_ACTIVE_MAINSITE\n\t\t$t_tinbai_mainsite->C_ACTIVE_MAINSITE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_ACTIVE_MAINSITE\"]);\n\t\t$t_tinbai_mainsite->C_ACTIVE_MAINSITE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_ACTIVE_MAINSITE\"];\n\n\t\t// C_TIME_ACTIVE_MAINSITE\n\t\t$t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_TIME_ACTIVE_MAINSITE\"]);\n\t\t$t_tinbai_mainsite->C_TIME_ACTIVE_MAINSITE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_TIME_ACTIVE_MAINSITE\"];\n\n\t\t// FK_NGUOIDUNGID_MAINSITE\n\t\t$t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_NGUOIDUNGID_MAINSITE\"]);\n\t\t$t_tinbai_mainsite->FK_NGUOIDUNGID_MAINSITE->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_NGUOIDUNGID_MAINSITE\"];\n\n\t\t// C_NOTE\n\t\t$t_tinbai_mainsite->C_NOTE->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_NOTE\"]);\n\t\t$t_tinbai_mainsite->C_NOTE->AdvancedSearch->SearchOperator = @$_GET[\"z_C_NOTE\"];\n\n\t\t// C_USER_ADD\n\t\t$t_tinbai_mainsite->C_USER_ADD->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_USER_ADD\"]);\n\t\t$t_tinbai_mainsite->C_USER_ADD->AdvancedSearch->SearchOperator = @$_GET[\"z_C_USER_ADD\"];\n\n\t\t// C_ADD_TIME\n\t\t$t_tinbai_mainsite->C_ADD_TIME->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_ADD_TIME\"]);\n\t\t$t_tinbai_mainsite->C_ADD_TIME->AdvancedSearch->SearchOperator = @$_GET[\"z_C_ADD_TIME\"];\n\n\t\t// C_USER_EDIT\n\t\t$t_tinbai_mainsite->C_USER_EDIT->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_USER_EDIT\"]);\n\t\t$t_tinbai_mainsite->C_USER_EDIT->AdvancedSearch->SearchOperator = @$_GET[\"z_C_USER_EDIT\"];\n\n\t\t// C_EDIT_TIME\n\t\t$t_tinbai_mainsite->C_EDIT_TIME->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_C_EDIT_TIME\"]);\n\t\t$t_tinbai_mainsite->C_EDIT_TIME->AdvancedSearch->SearchOperator = @$_GET[\"z_C_EDIT_TIME\"];\n\n\t\t// FK_EDITOR_ID\n\t\t$t_tinbai_mainsite->FK_EDITOR_ID->AdvancedSearch->SearchValue = ew_StripSlashes(@$_GET[\"x_FK_EDITOR_ID\"]);\n\t\t$t_tinbai_mainsite->FK_EDITOR_ID->AdvancedSearch->SearchOperator = @$_GET[\"z_FK_EDITOR_ID\"];\n\t}",
"function LoadSearchValues() {\n\t\tglobal $objForm, $sponsored_student;\n\n\t\t// Load search values\n\t\t// sponsored_student_id\n\n\t\t$sponsored_student->sponsored_student_id->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_sponsored_student_id\"));\n\t\t$sponsored_student->sponsored_student_id->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_sponsored_student_id\");\n\n\t\t// student_firstname\n\t\t$sponsored_student->student_firstname->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_student_firstname\"));\n\t\t$sponsored_student->student_firstname->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_student_firstname\");\n\t\t$sponsored_student->student_firstname->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_student_firstname\");\n\t\t$sponsored_student->student_firstname->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_student_firstname\"));\n\t\t$sponsored_student->student_firstname->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_student_firstname\");\n\n\t\t// student_middlename\n\t\t$sponsored_student->student_middlename->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_student_middlename\"));\n\t\t$sponsored_student->student_middlename->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_student_middlename\");\n\t\t$sponsored_student->student_middlename->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_student_middlename\");\n\t\t$sponsored_student->student_middlename->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_student_middlename\"));\n\t\t$sponsored_student->student_middlename->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_student_middlename\");\n\n\t\t// student_lastname\n\t\t$sponsored_student->student_lastname->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_student_lastname\"));\n\t\t$sponsored_student->student_lastname->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_student_lastname\");\n\t\t$sponsored_student->student_lastname->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_student_lastname\");\n\t\t$sponsored_student->student_lastname->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_student_lastname\"));\n\t\t$sponsored_student->student_lastname->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_student_lastname\");\n\n\t\t// student_grades\n\t\t$sponsored_student->student_grades->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_student_grades\"));\n\t\t$sponsored_student->student_grades->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_student_grades\");\n\n\t\t// student_resident_programarea_id\n\t\t$sponsored_student->student_resident_programarea_id->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_student_resident_programarea_id\"));\n\t\t$sponsored_student->student_resident_programarea_id->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_student_resident_programarea_id\");\n\n\t\t// group_id\n\t\t$sponsored_student->group_id->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_group_id\"));\n\t\t$sponsored_student->group_id->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_group_id\");\n\n\t\t// community_community_id\n\t\t$sponsored_student->community_community_id->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_community_community_id\"));\n\t\t$sponsored_student->community_community_id->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_community_community_id\");\n\t}",
"function LoadSearchValues() {\n\t\tglobal $objForm;\n\n\t\t// Load search values\n\t\t// Purchase_ID\n\n\t\t$this->Purchase_ID->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Purchase_ID\"));\n\t\t$this->Purchase_ID->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Purchase_ID\");\n\t\t$this->Purchase_ID->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Purchase_ID\");\n\t\t$this->Purchase_ID->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Purchase_ID\"));\n\t\t$this->Purchase_ID->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Purchase_ID\");\n\n\t\t// Purchase_Number\n\t\t$this->Purchase_Number->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Purchase_Number\"));\n\t\t$this->Purchase_Number->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Purchase_Number\");\n\t\t$this->Purchase_Number->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Purchase_Number\");\n\t\t$this->Purchase_Number->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Purchase_Number\"));\n\t\t$this->Purchase_Number->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Purchase_Number\");\n\n\t\t// Supplier_Number\n\t\t$this->Supplier_Number->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Supplier_Number\"));\n\t\t$this->Supplier_Number->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Supplier_Number\");\n\t\t$this->Supplier_Number->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Supplier_Number\");\n\t\t$this->Supplier_Number->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Supplier_Number\"));\n\t\t$this->Supplier_Number->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Supplier_Number\");\n\n\t\t// Stock_Item\n\t\t$this->Stock_Item->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Stock_Item\"));\n\t\t$this->Stock_Item->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Stock_Item\");\n\t\t$this->Stock_Item->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Stock_Item\");\n\t\t$this->Stock_Item->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Stock_Item\"));\n\t\t$this->Stock_Item->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Stock_Item\");\n\n\t\t// Purchasing_Quantity\n\t\t$this->Purchasing_Quantity->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Purchasing_Quantity\"));\n\t\t$this->Purchasing_Quantity->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Purchasing_Quantity\");\n\t\t$this->Purchasing_Quantity->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Purchasing_Quantity\");\n\t\t$this->Purchasing_Quantity->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Purchasing_Quantity\"));\n\t\t$this->Purchasing_Quantity->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Purchasing_Quantity\");\n\n\t\t// Purchasing_Price\n\t\t$this->Purchasing_Price->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Purchasing_Price\"));\n\t\t$this->Purchasing_Price->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Purchasing_Price\");\n\t\t$this->Purchasing_Price->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Purchasing_Price\");\n\t\t$this->Purchasing_Price->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Purchasing_Price\"));\n\t\t$this->Purchasing_Price->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Purchasing_Price\");\n\n\t\t// Selling_Price\n\t\t$this->Selling_Price->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Selling_Price\"));\n\t\t$this->Selling_Price->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Selling_Price\");\n\t\t$this->Selling_Price->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Selling_Price\");\n\t\t$this->Selling_Price->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Selling_Price\"));\n\t\t$this->Selling_Price->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Selling_Price\");\n\n\t\t// Purchasing_Total_Amount\n\t\t$this->Purchasing_Total_Amount->AdvancedSearch->SearchValue = ew_StripSlashes($objForm->GetValue(\"x_Purchasing_Total_Amount\"));\n\t\t$this->Purchasing_Total_Amount->AdvancedSearch->SearchOperator = $objForm->GetValue(\"z_Purchasing_Total_Amount\");\n\t\t$this->Purchasing_Total_Amount->AdvancedSearch->SearchCondition = $objForm->GetValue(\"v_Purchasing_Total_Amount\");\n\t\t$this->Purchasing_Total_Amount->AdvancedSearch->SearchValue2 = ew_StripSlashes($objForm->GetValue(\"y_Purchasing_Total_Amount\"));\n\t\t$this->Purchasing_Total_Amount->AdvancedSearch->SearchOperator2 = $objForm->GetValue(\"w_Purchasing_Total_Amount\");\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\" && $this->Command == \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\r\n\t\tglobal $fs_multijoin_v;\r\n\t\t$fs_multijoin_v->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];\r\n\t\t$fs_multijoin_v->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\r\n\t}",
"function LoadBasicSearchValues() {\n\t\tglobal $tbl_slide;\n\t\t$tbl_slide->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\t$tbl_slide->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function LoadBasicSearchValues() {\r\n\t\t$this->BasicSearch->Keyword = @$_GET[EW_TABLE_BASIC_SEARCH];\r\n\t\tif ($this->BasicSearch->Keyword <> \"\") $this->Command = \"search\";\r\n\t\t$this->BasicSearch->Type = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\r\n\t}",
"function LoadBasicSearchValues() {\n\t\tglobal $t_tinbai_mainsite;\n\t\t$t_tinbai_mainsite->BasicSearchKeyword = @$_GET[EW_TABLE_BASIC_SEARCH];\n\t\t$t_tinbai_mainsite->BasicSearchType = @$_GET[EW_TABLE_BASIC_SEARCH_TYPE];\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//global $MyTable;\n\t\t//$MyTable->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function Recordset_SearchValidated() {\n\n\t\t// Example:\n\t\t//$this->MyField1->AdvancedSearch->SearchValue = \"your search criteria\"; // Search value\n\n\t}",
"function load_search_parms()\n{\n\n\t$postdata = \\JFactory::getApplication()->input->post;\n $srch_parms['fname'] = $postdata->get('fname','','STRING');\n $srch_parms['lname'] = $postdata->get('lname','','STRING');\n\n\t$fromdate =\tvalidated_date($postdata->get('from_gold_card_date','','STRING'));\n\t$todate = validated_date($postdata->get('to_gold_card_date','','STRING'));\n\tif (empty($fromdate) && empty($todate)) {\n\t\t$todate = \\JFactory::getDate()->format('Y-m-d');\n\t\t$fromdate = date_sub(\\JFactory::getDate(),\n\t\t\tdate_interval_create_from_date_string('4 months'))->format('Y-m-d');\n\t} else if (empty($fromdate)) {\n\t\t$fromdate = date_sub(date_create($todate),\n\t\t\tdate_interval_create_from_date_string('4 months'))->format('Y-m-d');\n\t} else if (empty($todate)) {\n\t\t$todate = date_add(date_create($fromdate),\n\t\t\tdate_interval_create_from_date_string('4 months'))->format('Y-m-d');\n\t}\n $srch_parms['from_gold_card_date'] = $fromdate;\n $srch_parms['to_gold_card_date'] = $todate;\n\n return $srch_parms;\n\n}",
"public function search(){}",
"public function getSearch();",
"public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }",
"public function load( $values ) {\n\t\t$values = $this->load_data( $values );\n\t\t$this->regex = isset( $values['regex'] ) ? $values['regex'] : false;\n\t\t$this->agent = isset( $values['agent'] ) ? $values['agent'] : '';\n\t}",
"public function search();"
] |
[
"0.7142175",
"0.7106761",
"0.70981145",
"0.69927216",
"0.6975144",
"0.6898849",
"0.6852258",
"0.6795045",
"0.66674805",
"0.66674805",
"0.6617435",
"0.6617435",
"0.6617435",
"0.6617435",
"0.661378",
"0.6597139",
"0.65731776",
"0.64533865",
"0.62756234",
"0.60543895",
"0.60543895",
"0.60543895",
"0.60543895",
"0.60543895",
"0.584808",
"0.5829677",
"0.5747408",
"0.5733654",
"0.5670438",
"0.5640069"
] |
0.71265393
|
1
|
Resources list admin main page
|
public function action_index()
{
$this->template->title = 'Resources';
$this->view = View::factory('admin/resource/index');
$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';
$this->template->scripts[] = 'media/js/admin/resource.js';
$resources = Sprig::factory('resource')->load(NULL, FALSE);
if (!empty($resources))
{
$this->view->resources = $resources->as_array();
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function index()\n {\n $admins = Admin::paginate(5);\n return AdminResourceCollection::collection($admins);\n }",
"public function admin_index()\n\t{\n\t\t$this->paginate['Role']['order'] = 'Role.id Desc';\n\t\t$this->set('roles', $this->paginate('Role'));\n\t}",
"public function index()\n {\n $admin = Admin::simplePaginate(25);\n \n return new AdminResourceCollection($admin);\n }",
"public function indexAdmin()\n\t{\n\t\treturn ResourcesWorks::collection(Works::all());\n\t}",
"public function adminIndex()\n {\n $config['list'] = VRPages::get()->toArray();\n $config['pageTitle'] = trans('app.pages');\n $config['route'] = route('app.pages.create');\n\n $config['edit'] = 'app.pages.edit';\n $config['delete'] = 'app.pages.delete';\n//dd($config);\n return view('admin.list', $config);\n }",
"public function resources(){\n\t\t$this->verify();\n\t\t$data['title']=\"Resources\";\n\t\t$data['category']=$this->admin_model->fetch_rescources_cat();\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('resources/resources', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}",
"public function adminIndex ()\n {\n $config = [\n 'title' => trans('Rivile::rivile_payments.page_title'),\n 'listURL' => route('admin.api.routes.rivile.payments'),\n 'newFormUrl' => route('admin.api.form-manager', ['rivile-payments-new']),\n 'editFormUrl' => route('admin.api.form-manager', ['rivile-payments-edit']),\n 'imagesUrl' => route('resource.get', ['/']),\n 'headers' => $this->getAdminListHeader(),\n ];\n\n $config['actions'][] = 'search';\n $config['filters'] = $this->getFilters();\n\n return hcview('HCCoreUI::admin.content.list', ['config' => $config]);\n }",
"public function index() {\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t$this->layout->display_admin ( $this->folder . $this->module . \"-list\", $data );\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"function _setResourceMenu() {\n\t\t$this->loadModel('Content');\n\t\t$resources = $this->Content->find('all', array('conditions' => array('ctid' => 3), 'limit' => 10));\n\t\t$this->set('resource_list', $resources);\n\t}",
"public function index()\n {\n $number_of_items = $this->calculate->getTotalOfItemsAdmin();\n if (null != $this->request->ifParameter(\"id\")) {\n $items_current_page = $this->request->getParameter(\"id\");\n } else {\n $items_current_page = 1;\n }\n $items = $this->item->getItemsForAdmin($items_current_page);\n $page_previous_items = $items_current_page - 1;\n $page_next_items = $items_current_page + 1;\n $number_of_items_pages = $this->calculate->getNumberOfPagesOfExtAdmin();\n $this->generateadminView(array(\n 'items' => $items,\n 'number_of_items' => $number_of_items,\n 'items_current_page' => $items_current_page,\n 'page_previous_items' => $page_previous_items,\n 'page_next_items' => $page_next_items,\n 'number_of_items_pages' => $number_of_items_pages\n ));\n }",
"public function admin_index()\n {\n $this->Redirect->urlToNamed();\n\n // Sets Search Parameters\n $conditions = $this->getSearchConditions(array(\n array('model' => $this->modelClass, 'field' => \"name\", 'type' => 'string', 'view_field' => 'name'),\n ));\n \n $this->paginate[\"limit\"] = 20;\n $records = $this->paginate($this->modelClass, $conditions);\n \n //setting variables\n $this->set(compact('records')); \n }",
"public function adminIndexAction()\r\n {\r\n $pages=$this->getDoctrine()->getRepository(\"AppBundle:Page\")->findAll();\r\n $view=array('pages' => $pages,\r\n );\r\n return $this->render('page/adminIndex.html.twig', $view);\r\n }",
"public function actionList() {\n $this->_getList();\n }",
"public function collection_list()\n\t{\n\t\t$data['collection_list']=$this->ref_coll->get_all();\n\t\t$data['brands_list']=$this->ref_brand->get_all();\n\t\t$data['catagory_list']=$this->ref_cat->get_all();\n\t\t$data['season_list']=$this->ref_season->get_all();\n\t\t$data['page']='Collection List';\n\t\t$view = 'Admin/collection/admin_collection_list_view';\n\t\techo Modules::run('Template/admin_template', $view, $data);\t\n\t}",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function listAction()\n {\t\n\t\t$this->createActivity(\"Admin\",\"List view\");\n $em = $this->getDoctrine()->getManager();\n\t\t$oEmTeacher=$em->getRepository('BoAdminBundle:Admin');\n $admin = $oEmTeacher->getTeacherList(\"Teacher\");\n\t\t$nb_tc = count($admin);\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null) $page=1;\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$admin = $oEmTeacher->getTeacherList(\"Teacher\",$offset,$nb_cpp);\n return $this->render('admin/index.html.twig', array(\n 'admin' => $admin,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"personnel\",\n\t\t\t'sm'=>\"admin\",\n ));\n }",
"public function admin_index() \n\t{\n\t\t$results = $this->paginate();\n\n\t\t// Set\n\t\t$this->set(\n\t\t\tarray(\n\t\t\t\t'title_for_layout' \t=> 'Notícias',\n\t\t\t\t'action'\t\t\t=> 'add',\n\t\t\t\t'button'\t\t\t=> 'Adicionar Notícia',\n\t\t\t\t'class'\t\t\t\t=> 'success',\n\t\t\t\t'is_save'\t\t\t=> false,\n\t\t\t\t'results'\t\t\t=> $results\n\t\t\t)\n\t\t);\n\t}",
"function admin_cms_list(){\r\r\n\t\t\r\r\n\t\t$this->layout='backend/backend';\r\r\n\t\t$this->set(\"title_for_layout\",CMS_PAGE_LISTING);\r\r\n\t\tApp::import(\"Model\",\"CmsPage\");\r\r\n\t\t$this->CmsPage = new CmsPage();\r\r\n\t\t$conditions = array(\"CmsPage.is_deleted\"=>\"0\");\r\r\n\t\t\r\r\n\t\t$this->paginate = array('recursive'=>-1,'conditions'=>$conditions,'limit' =>CMS_PAGE_LIMIT,'order'=>array(\"CmsPage.page_order\"=>\"asc\"));\r\r\n\t\t$cms_page_data = $this->paginate('CmsPage'); \r\r\n\t\t$this->set('cms_page_data',$cms_page_data);\r\r\n\t}",
"public function action_index()\n\t{\n\t\tif ( ! Auth::instance()->logged_in('admin'))\n\t\t\tthrow new HTTP_Exception_403();\n\t\t\n\t\t// show admin page\n\t\t$companies = ORM::factory('company')->find_all();\n\t\t$this->template->content = View::factory('admin/admin')->bind('companies', $companies);\n\t\t\n\t}",
"public function admin_index() {\r\n \r\n $sucursales = $this->Sucursal->find(\"all\");\r\n $this->set(compact('sucursales'));\r\n \r\n }",
"function admin_index() \r\n {\r\n \t// setting the layout for admin\r\n \t$this->layout = 'admin';\r\n \t$this->Product->recursive = 0;\r\n \t$this->set('products', $this->paginate());\r\n }",
"public function admin_index(){\n \n $this->set(\"title_for_layout\",\"Manage Satellite Groups\");\n \n // Load all configured groups\n $this->set('groups', $this->Group->find('all'));\n }",
"public function listViewName() { return ContentServiceProvider::NAME.\"::admin.list\"; }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function listAction() {}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"function index() {\n\t\t$this->show_list();\n\t}",
"function adminIndex(){\r\n\t\t$data = $this->paginate('AdminBooking');\r\n\t\t$this->set(compact('data'));\r\n\t}"
] |
[
"0.7088972",
"0.70579225",
"0.70500714",
"0.6972637",
"0.6932615",
"0.6887187",
"0.68677866",
"0.68597937",
"0.68585765",
"0.68477327",
"0.6792406",
"0.67574376",
"0.67558056",
"0.67252314",
"0.6719069",
"0.669233",
"0.6688543",
"0.668837",
"0.6678554",
"0.66667134",
"0.6658677",
"0.6658094",
"0.6656133",
"0.66526604",
"0.6647315",
"0.66389555",
"0.6624563",
"0.6621465",
"0.66142887",
"0.6603653"
] |
0.80160224
|
0
|
Initializes the resource for edit/delete Also performs resource id validation so that only valid resource id will be processed on actions
|
protected function _init_resource()
{
$resource_id = $this->request->param('id');
if (!$resource_id)
{
$this->session->set('error', 'Invalid resource id');
$this->request->redirect('/admin/resource');
}
// check if resource exists
$this->resource = Sprig::factory('resource', array(
'resource_id' => $resource_id
));
$this->resource->load();
if (!$this->resource->loaded())
{
$this->session->set('error', 'Resource not found');
$this->request->redirect('/admin/resource');
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function postEditResources()\n {\n $id = $this->_params['id'];\n\n $errors = validateEditResource($id);\n\n if(!($errors === true)) {\n $database = new Database();\n\n $resource = $database->getResourceById($id);\n /*construct($resourceID = \"0\", $resourceName = \"Resource\", $description = \"Info\",\n $contactName =\"\",$contactEmail = \"\",$contactPhone = \"\",$link = \"\", $active = \"1\" )*/\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['Active']);\n $this->_f3->set('Resource', $availableResource);\n $this->_f3->set('errors', $errors);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n } else {\n // fixme add routing\n $this->_f3->reroute('/Admin');\n }\n\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function __construct()\n\t\t{\n\t\t\t/*goi thang den ham _init trong ResourceModel*/\n\t\t\tparent::_init('lienhe', 'id', new ContactModel);\n\t\t}",
"abstract protected function initResource();",
"public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"protected function _construct()\n {\n $this->_init(Model::class, ResourceModel::class);\n }",
"public function init(){\n\t\tparent::init();\n\n\t\t// CSS & JS\n\t\tRequirements::javascript('swipestripe/javascript/Attribute_OptionField.js');\n\t\t$params = $this->getURLParams();\n\n\t\tif($params['ID'] != '') {\n\t\t\t$product = $this->getProductFromUrl();\n\t\t\tif($product && $product->exists()){\n\t\t\t\t$this->dataRecord = $product;\n\t\t\t\t$this->failover = $this->dataRecord;\n\t\t\t\t$request = $this->request;\n\n\t\t\t\t// Handle Actions - TODO: work out why this doesn't work normally\n\t\t\t\tif(isset($params['Action']) && $params['Action'] != ''){\n\t\t\t\t\t$val = $this->handleAction($request, $params['Action']);\n\t\t\t\t\tif(Director::is_ajax()){\n\t\t\t\t\t\tdie($val);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn $this->httpError(404);\n\t\t\t}\n\t\t} else {\n\t\t\treturn $this->httpError(404);\n\t\t}\n\n\t\t$this->extend('onInit');\n\t}",
"protected function _initResources () {\r\n\r\n\t\t$bFreshData = false;\r\n\r\n\t\tif (self::$_bUseCache) {\r\n\t\t\t$oCacheManager = Kwgl_Cache::getManager();\r\n\t\t\t$oAclCache = $oCacheManager->getCache('acl');\r\n\r\n\t\t\tif (($aResourceListing = $oAclCache->load(self::CACHE_IDENTIFIER_RESOURCES)) === false) {\r\n\t\t\t\t// Not Cached or Expired\r\n\r\n\t\t\t\t$bFreshData = true;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$bFreshData = true;\r\n\t\t}\r\n\r\n\t\tif ($bFreshData) {\r\n\t\t\t// Get Resources from the Database\r\n\t\t\t$oDaoResource = Kwgl_Db_Table::factory('System_Resource'); /* @var $oDaoResource Dao_System_Resource */\r\n\t\t\t//$aResourceListing = $oDaoResource->fetchAll();\r\n\t\t\t$aResourceListing = $oDaoResource->getResources();\r\n\r\n\t\t\tif (self::$_bUseCache) {\r\n\t\t\t\t$oAclCache->save($aResourceListing, self::CACHE_IDENTIFIER_RESOURCES);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tforeach ($aResourceListing as $aResourceDetail) {\r\n\t\t\t$sResourceName = $aResourceDetail['name'];\r\n\t\t\tif (is_null($aResourceDetail['parent'])) {\r\n\t\t\t\t// Add the Resource if it hasn't been defined yet\r\n\t\t\t\tif (!$this->has($sResourceName)) {\r\n\t\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceName));\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// Parent Resource assigned\r\n\t\t\t\t$sResourceParentName = $aResourceDetail['parent'];\r\n\t\t\t\t// Add the Parent Role if the Parent Role hasn't been defined yet\r\n\t\t\t\tif (!$this->has($sResourceParentName)) {\r\n\t\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceParentName));\r\n\t\t\t\t}\r\n\t\t\t\t$this->addResource(new Zend_Acl_Resource($sResourceName), $sResourceParentName);\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t}",
"public function init() {\n $resources = new Model_Resources();\n $resources->form_values['only_childs'] = 1;\n $result2 = $resources->getResources('resource_name', 'ASC');\n $this->_list[\"page_name\"][''] = \"Select\";\n if ($result2) {\n foreach ($result2 as $row2) {\n $resource = $row2->getResourceName();\n $arr_resources = explode(\"/\", $resource);\n $second_name = (!empty($arr_resources[1])) ? ucfirst($arr_resources[1]) . \" - \" : \"\";\n $this->_list[\"page_name\"][$row2->getPkId()] = ucfirst($arr_resources[0]) . \" - \" . $second_name . $row2->getDescription();\n }\n }\n\n //Generate fields \n // for Form_Iadmin_MessagesAdd\n foreach ($this->_fields as $col => $name) {\n if ($col == \"description\") {\n parent::createMultiLineText($col, \"4\");\n }\n\n // Generate combo boxes \n // for Form_Iadmin_MessagesAdd\n if (in_array($col, array_keys($this->_list))) {\n parent::createSelect($col, $this->_list[$col]);\n }\n\n // Generate Radio buttons\n // for Form_Iadmin_MessagesAdd\n if (in_array($col, array_keys($this->_radio))) {\n parent::createRadio($col, $this->_radio[$col]);\n }\n }\n }",
"public function __construct() {\n\t\tparent::__construct(FALSE, array(), array(), array('resources'));\n\t\t$this->resources = array();\n\t\t$this->_restrict_write_access();\n\n\t}",
"public function __construct($resource = null)\n {\n $this->resource = $resource ?? new static::$model;\n }",
"public function init()\n {\n //$this->view->checkaclresource('0','0',0); // Just for initiallization for helper call\n }",
"protected function _construct()\n {\n $this->_init(ProductResourceModel::class);\n }",
"public function init()\n {\n parent::init();\n\n $this->deleted = 0;\n }",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t$this->strAction = Input::get('key') == '' ? Input::get('act') : Input::get('key');\n\t\t\n\t\tif(Input::get('tid') != null)\n\t\t{\n\t\t\t$this->strAction = 'toggle';\n\t\t\t$this->intId = Input::get('tid');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->intId = Input::get('id');\n\t\t}\n\t\t\n\t\t$this->blnDraftMode = Input::get('draft') == '1';\n\t\t$this->blnParentView = in_array($this->strAction, array(null, 'select', 'create')) || ($this->strAction == 'paste' && Input::get('mode') == 'create');\n\t}",
"private function setResource()\n {\n $path = $_SERVER['PATH_INFO'];\n $params = explode('/', $path);\n $this->_requestResource = $params[2];\n if (!in_array($this->_requestResource, $this->_allowResource)) {\n throw new Exception(\"Request resource not allowed!\", 405);\n }\n\n $this->_version = $params[1];\n\n if (!$this->notValid($params[3])) {\n $this->_requestUri = $params[3];\n }\n }",
"function __construct(){\n\t\n\t\t//Load the id state from the request\n\t\t$this->_id\t\t= JRequest::getInt( 'id' );\t\t\n\t\t$this->_user\t= JFactory::getUser()->get('id');\n\t\t\n\t\tparent::__construct();\n\t\t\n\t}",
"protected function _construct()\n {\n $this->_init('AVATOR\\ContactUs\\Model\\ResourceModel\\ContactUs');\n }",
"protected function _construct() \n {\n\t$this->_objectId = 'author_id';\n\t$this->_blockGroup = 'Brituy_SimpleBlog';\n\t$this->_controller = 'adminhtml_author';\n\tparent::_construct();\n\t\n\t$this->buttonList->update('save primary', 'label', __('Save Author'));\n\t$this->buttonList->add(\n\t\t'saveandcontinue',[\n\t\t\t'label' => __('Save and Continue Edit'),\n\t\t\t'class' => 'save',\n\t\t\t'data_attribute' => [\n\t\t\t\t'mage-init' => [\n\t\t\t\t\t'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],\n\t\t\t\t],\n\t\t\t],\n\t\t],\n\t-100);\n\n\t$this->buttonList->update('delete', 'label', __('Delete'));\n }",
"public function __construct(){\n add_action( 'init', [ $this, 'create_resource_lists' ], 0 ); \t\n \t\n \t//init the custom post type for record items\n add_action( 'init', [ $this, 'resource_list_generator' ], 0 ); \n \n\n }",
"private function __validate_id() {\n if (isset($this->initial_data[\"id\"])) {\n # Check the Unbound ACLs array for ID\n if (array_key_exists($this->initial_data[\"id\"], $this->config[\"unbound\"][\"acls\"])) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2074);\n }\n } else {\n $this->errors[] = APIResponse\\get(2072);\n }\n }",
"public function __construct($resource, $leaderboard_id)\n {\n // Ensure you call the parent constructor\n parent::__construct($resource);\n $this->resource = $resource;\n \n $this->leaderboard_id = $leaderboard_id;\n }",
"public function init()\n {\n $actionName = Yii::$app->controller->action->id;\n $function = new \\ReflectionClass($this->model->className());\n $modelName = $function->getShortName();\n $this->permissionSave = PermissionHelper::findPermissionModelAction($modelName, $actionName);\n\n parent::init();\n\n $this->initVariablesI18n();\n }",
"public function editAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n\t \t\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n //$id = sapp_Global::_decrypt($id);\n if(is_numeric($id) && $id>0)\n {\n $app_manager_model = new Default_Model_Appraisalmanager();\n $appraisal_init_model = new Default_Model_Appraisalinit();\n $appraisalQsModel = new Default_Model_Appraisalquestions();\n $tablename = 'main_pa_questions_privileges';\n \n $appraisal_data = $appraisal_init_model->getappdata_forview($id);\n if($appraisal_data['status'] == 1 && $appraisal_data['enable_step'] == 1)\n {\n\t \t$appraisal_data['process_status'] = '';\n\t if(!empty($appraisal_data))\n\t {\n\t \tif($appraisal_data['initialize_status'] == 1)\n\t \t{\n\t \t\tif($appraisal_data['enable_step'] == 1)\n\t \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n\t \t\tif($appraisal_data['enable_step'] == 2)\n\t \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n\t \t}\n\t \telse if($appraisal_data['initialize_status'] == 2)\n\t \t{\n\t \t\t$appraisal_data['process_status'] = 'Initialize Later';\n\t \t}else\n\t\t\t\t\t {\n\t\t\t\t\t \t $appraisal_data['process_status'] = 'In progress';\t\n\t\t\t\t\t }\n\t }\n\t $EmpCountArr = $app_manager_model->getManagerGroupCount($id,$loginUserId);\n\t\t\t\t\t\tif(!empty($EmpCountArr))\n\t\t\t\t\t\t\t$appraisal_data['empcount'] = $EmpCountArr[0]['empcount'];\n\t $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n\t \n\t $questionsArr = $appraisalQsModel->getQuestionsByCategory($appraisal_data['category_id'],'');\n\t \n\t $view = $this->getHelper('ViewRenderer')->view;\n\t $view->previ_data = 'no'; \n\t $view->data = $appraisal_data;\n\t $text = $view->render('appraisalinit/view.phtml');\n\t $this->view->appraisal_id = $id;\n\t $this->view->manager_id = $loginUserId;\n\t $this->view->manager_groups = $manager_groups;\n\t $this->view->appraisal_data = $appraisal_data;\n\t $this->view->app_text = $text; \n\t $this->view->questionsArr = $questionsArr;\n }\n else\n {\n \t$this->view->ermsg = 'nodata';\n } \n\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\n }",
"public function initialize()\n {\n $this->setSchema(\"zeji_qa_admin\");\n $this->setSource(\"tb_resource\");\n }",
"protected function _construct()\n {\n $this->_init(\\Mage2\\Inquiry\\Model\\ResourceModel\\Inquiry::class);\n }",
"protected function _construct()\n {\n $this->_init(\\AddictedToMagento\\DynamicForms\\Model\\ResourceModel\\Form::class);\n }",
"public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }",
"protected function handleFormAction(): void\n {\n $action = $_REQUEST['action'] ?? null;\n $editableColumns = $this->editableColumns();\n\n $isFormAction = in_array($action, ['edit', 'create']);\n $isAdmin = current_user_can('manage_options');\n $shouldSkip = 'GET' === $_SERVER['REQUEST_METHOD']\n || empty($_POST)\n || is_null($action);\n\n if ($shouldSkip || !$isFormAction || !$isAdmin) {\n return;\n }\n\n try {\n $this->validateEditableColumns($editableColumns, $_POST);\n } catch (\\Throwable $e) {\n $this->displayResourceNotice($e->getMessage());\n return;\n }\n\n $primaryKey = $this->newModel()->getPrimaryColumn();\n preg_match('/\\w+/', $_POST[$primaryKey] ?? '', $matches);\n\n $resourceId = $matches[0] ?? '';\n $values = $this->filterGuardedAttributes($editableColumns, $_POST);\n\n $model = !strlen($resourceId)\n ? $this->newModel()\n : $this->model::find($resourceId);\n\n $model->fill($values);\n $model->saveOrUpdate();\n\n $this->displayResourceNotice('Resource was updated', 'success');\n\n // to display the edit page after creating new resources\n if ($action === 'create') {\n $this->model = $model;\n }\n }"
] |
[
"0.6838568",
"0.64770764",
"0.6466177",
"0.64092463",
"0.619019",
"0.60112774",
"0.59569925",
"0.588963",
"0.58311826",
"0.58164364",
"0.5812927",
"0.57787544",
"0.57583594",
"0.5751433",
"0.57492846",
"0.5733288",
"0.5715216",
"0.57061183",
"0.5698464",
"0.56835157",
"0.5651782",
"0.56497866",
"0.56489015",
"0.5647572",
"0.56350124",
"0.5633612",
"0.55981815",
"0.55953825",
"0.55861074",
"0.5558591"
] |
0.7816533
|
0
|
/ | | Ppe Controller | | | This controller handles request for Ppes | Sets delivered true and puts the Ppe in the Stock
|
public function deliveredPPE(Request $request)
{
$ppe = null;
// Read in request objects
if (array_key_exists('ppe', $request->all())) {
$ppe = $request['ppe'];
} else {
return response()->json(['error' => 'Could not update Ppe (values have to be in a "ppe" array)'], 400);
}
$company = Auth::user()->company;
$stock = Stock::where('company_ID', $company['company_ID'])->get()->first();
$oldPPE = Ppe::findOrFail($ppe['sn']);
if ($oldPPE['delivered'] != false) {
return response()->json(['error' => 'Could not update Ppe (the PPE already got delivered)'], 400);
}
if (!array_key_exists('newSN', $ppe)) {
return response()->json(['error' => 'Could not update Ppes (at least one newSN is missing for the PPEs)'], 400);
}
$sizeranges = sizerange_ppe::where('sn', $ppe['sn'])->get();
if (count($sizeranges) != 0) {
foreach ($sizeranges as $sizerange) {
$sizerange->delete();
}
}
$properties = property_ppe::where('sn', $ppe['sn'])->get();
if (count($properties) != 0) {
foreach ($properties as $property) {
$property->delete();
}
}
$oldPPE->sn = $ppe['newSN'];
$oldPPE->delivered = true;
$oldPPE->stock()->associate($stock);
$oldPPE->save();
if (count($sizeranges) != 0) {
foreach ($sizeranges as $sizerange) {
$sizer = Size_Range::findOrFail($sizerange['sizer_ID']);
$oldPPE->size_ranges()->attach($sizerange->sizer_ID);
}
}
if (count($properties) != 0) {
foreach ($properties as $property) {
$propertyEnt = Property::findOrFail($property['property_ID']);
$oldPPE->properties()->attach($property->property_ID);
}
}
$oldPPE->save();
$order = OrderEnt::findOrFail($oldPPE['order_ID']);
$allPPEsSend = true;
$ppes = Ppe::where('order_ID', $oldPPE['order_ID'])->get();
foreach ($ppes as $ppe) {
if (!$ppe['delivered']) {
$allPPEsSend = false;
}
}
if ($allPPEsSend) {
$date = date("Y-m-d");
$order->commitedDeliveryDate = $date;
$order->state = "delivered";
$order->save();
}
return response()->json($oldPPE, 201);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function process_paf_stockintake()\r\n\t{\r\n\t\t$this->auth(PAF_ROLE);\r\n\t\t\r\n\t\t$paf_id = $this->input->post('paf_id');\r\n\t\t\r\n\t\t$product = $this->input->post('product');\r\n\t\t$mrp = $this->input->post('mrp');\r\n\t\t$pprice = $this->input->post('pprice');\r\n\t\t$qty = $this->input->post('qty');\r\n\t\t$vendor = $this->input->post('vendor');\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$paf_status = $this->db->query(\"select paf_status from t_paf_list where id = ? \",$paf_id)->row()->paf_status;\r\n\t\tif($paf_status != 1)\r\n\t\t{\r\n\t\t\tif($paf_status == 3)\r\n\t\t\t\tshow_error(\"Stockintake cannot be processed, paf is closed \");\r\n\t\t\telse if($paf_status == 2)\r\n\t\t\t\tshow_error(\"Stockintake cannot be processed, paf is not opened \");\r\n\t\t\t\t\r\n\t\t\tdie();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$user=$this->erpm->getadminuser();\r\n\t\t\r\n\t\t// Create PO and process Stock intake automatically\r\n\t\t\r\n\t\t\r\n\r\n\t\t// build PO by vendor \r\n\t\t$prod_vendor_link = array();\r\n\t\tforeach($vendor as $i=>$v)\r\n\t\t{\r\n\t\t\tif(!isset($prod_vendor_link[$v]))\r\n\t\t\t{\r\n\t\t\t\t$prod_vendor_link[$v] = array();\r\n\t\t\t}\r\n\t\t\tarray_push($prod_vendor_link[$v],array('pid'=>$product[$i],'qty'=>$qty[$i],'mrp'=>$mrp[$i],'pprice'=>$pprice[$i])); \r\n\t\t} \r\n\t\t\r\n\t\t \r\n\t\t$po_ids = array();\r\n\t\tforeach($prod_vendor_link as $ven_id=>$prod_det)\r\n\t\t{\r\n\t\t\r\n\t\t\t// Create PO Source\r\n\t\t\t$this->db->query(\"insert into t_po_info(vendor_id,paf_id,remarks,created_on,po_status) values(?,?,?,now(),0)\",array($ven_id,$paf_id,'created by paf-'.$paf_id));\r\n\t\t\t$po=$this->db->insert_id();\r\n\t\t\t$total=0;\r\n\t\t\tforeach($prod_det as $i=>$p)\r\n\t\t\t{\r\n\t\t\t\t $product_id = $p['pid'];\r\n\t\t\t\t $order_qty = $p['qty'];\r\n\t\t\t\t $mrp = $p['mrp'];\r\n\t\t\t\t // calculate margin from mrp and purchase price \r\n\t\t\t\t $margin = (1-($p['pprice']/$p['mrp']))*100;\r\n\t\t\t\t $scheme_discount_value = 0;\r\n\t\t\t\t $scheme_discount_type = 0;\r\n\t\t\t\t $purchase_price = $p['pprice'];\r\n\t\t\t\t $is_foc = 0;\r\n\t\t\t\t $has_offer = 0;\r\n\t\t\t\t $special_note = 'Create by paf-'.$paf_id;\r\n\t\t\t\t \r\n\t\t\t\t\t\r\n\t\t\t\t//$sv=$pt['sch_type'][$i]?$pt['mrp'][$i]*$pt['sch_discount'][$i]/100:$pt['sch_discount'][$i];\r\n\t\t\t\t$sv = 0;\r\n\t\t\t\t\r\n\t\t\t\t$inp=array($po,$product_id,$order_qty,$mrp,$margin,$scheme_discount_value,$scheme_discount_type,$purchase_price,$is_foc,$has_offer,$special_note);\r\n\t\t\t\t$this->db->query(\"insert into t_po_product_link(po_id,product_id,order_qty,mrp,margin,scheme_discount_value,scheme_discount_type,purchase_price,is_foc,has_offer,special_note,created_on)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues(?,?,?,?,?,?,?,?,?,?,?,now())\",$inp);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$total+=$p['mrp']*$p['qty'];\r\n\t\t\t}\r\n\t\t\t$this->db->query(\"update t_po_info set total_value=? where po_id=? limit 1\",array($total,$po));\r\n\t\t\t\r\n\t\t\tarray_push($po_ids,$po);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// STOCK INTAKE RECODED VENDOR PO WISE\r\n\t\t \r\n\t\t$grn_ids = array();\r\n\t\t$grn_ven_ids = array();\r\n\t\t$pos = array();\r\n\t\t$user=$this->erpm->getadminuser();\r\n\t\tforeach($po_ids as $p)\r\n\t\t{\r\n\t\t\t \r\n\t\t\t\r\n\t\t\t$vid=$this->db->query(\"select vendor_id from t_po_info where po_id=?\",$p)->row()->vendor_id;\r\n\t\t\t$this->db->query(\"insert into t_grn_info(vendor_id,remarks,created_by,created_on) values(?,?,?,now())\",array($vid,'Created from paf-'.$paf_id,$user['userid']));\r\n\t\t\t$grn= $this->db->insert_id();\r\n\t\t\t$grn_ids[$p] = $grn;\r\n\t\t\t$grn_ven_ids[$vid] = $grn;\r\n\t\t\t \r\n\t\t\t\tif(!isset($pos[$p]))\r\n\t\t\t\t\t$pos[$p]=array();\r\n\t\t\t\t\t\r\n\t\t\t\t$poi_data_res=$this->db->query(\"select a.*,b.brand_id,c.rack_bin_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfrom t_po_product_link a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tjoin m_product_info b on a.product_id = b.product_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tjoin m_rack_bin_brand_link c on c.brandid = b.brand_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\twhere po_id= ? \",array($p)); \t\r\n\t\t\t\t\t\r\n\t\t\t\tif($poi_data_res->num_rows())\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach($poi_data_res->result_array() as $po_p)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$po=array();\r\n\t\t\t\t\t\t$po['tax']=$this->db->query(\"select vat from m_product_info where product_id=?\",$po_p['product_id'])->row()->vat;\r\n\t\t\t\t\t\t$po['product']=$po_p['product_id'];\r\n\t\t\t\t\t\t$po['oqty']=$po_p['order_qty'];\r\n\t\t\t\t\t\t$po['rqty']=$po_p['order_qty'];\r\n\t\t\t\t\t\t$po['mrp']=$po_p['mrp'];\r\n\t\t\t\t\t\t$po['price']=$po_p['purchase_price'];\r\n\t\t\t\t\t\t// get default storage localtion for product . \r\n\t\t\t\t\t\t$po['rackbin']=$po_p['rack_bin_id'];\r\n\t\t\t\t\t\t$po['location']=$this->db->query(\"select location_id from m_rack_bin_info where id=?\",$po_p['rack_bin_id'])->row()->location_id;\r\n\t\t\t\t\t\t$po['margin']=$po_p['margin'];\r\n\t\t\t\t\t\t$po['foc']=$po_p['is_foc'];\r\n\t\t\t\t\t\t$po['offer']=$po_p['has_offer'];\r\n\t\t\t\t\t\t$pos[$p][]=$po;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t} \r\n\t\t\t\r\n\t\t \r\n\r\n\r\n\t\t\t \r\n\t\t\t\r\n\t\t\t\r\n\t\t\tforeach($pos as $poid=>$po)\r\n\t\t\t{\r\n\t\t\t\tforeach($po as $p)\r\n\t\t\t\t{\r\n\t\t\t\t\t$inp=array($grn_ids[$poid],$poid,$p['product'],$p['oqty'],$p['rqty'],$p['mrp'],$p['price'],$p['tax'],$p['location'],$p['rackbin'],$p['margin'],$p['foc'],$p['offer']);\r\n\t\t\t\t\t$this->db->query(\"insert into t_grn_product_link(grn_id,po_id,product_id,invoice_qty,received_qty,mrp,purchase_price,tax_percent,location_id,rack_bin_id,margin,is_foc,has_offer,created_on) \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalues(?,?,?,?,?,?,?,?,?,?,?,?,?,now())\",$inp);\r\n\t\t\t\t\t$this->db->query(\"update t_po_product_link set received_qty=received_qty+? where po_id=? and product_id=?\",array($p['rqty'],$poid,$p['product']));\r\n\t\t\t\t\tif($p['rqty']!=0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$p['product_id']=$p['product'];\r\n\t\t\t\t\t\tif($p['mrp']!=0)\r\n\t\t\t\t\t\t\t$pc_prod=$this->db->query(\"select * from m_product_info where product_id=? and mrp!=?\",array($p['product_id'],$p['mrp']))->row_array();\r\n\t\t\t\t\t\telse $pc_prod=array();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(!empty($pc_prod))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$pid=$p['product_id'];\r\n\t\t\t\t\t\t\t$inp=array(\"product_id\"=>$p['product_id'],\"new_mrp\"=>$p['mrp'],\"old_mrp\"=>$pc_prod['mrp'],\"reference_grn\"=>$grn,\"created_by\"=>$user['userid'],\"created_on\"=>time());\r\n\t\t\t\t\t\t\t$this->db->insert(\"product_price_changelog\",$inp);\r\n\t\t\t\t\t\t\t$this->db->query(\"update m_product_info set mrp=? where product_id=? limit 1\",array($p['mrp'],$p['product_id']));\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tforeach($this->db->query(\"select product_id from products_group_pids where group_id in (select group_id from products_group_pids where product_id=$pid) and product_id!=$pid\")->result_array() as $pg)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$inp=array(\"product_id\"=>$pg['product_id'],\"new_mrp\"=>$p['mrp'],\"old_mrp\"=>$this->db->query(\"select mrp from m_product_info where product_id=?\",$pg['product_id'])->row()->mrp,\"reference_grn\"=>0,\"created_by\"=>$user['userid'],\"created_on\"=>time());\r\n\t\t\t\t\t\t\t\t$this->db->insert(\"product_price_changelog\",$inp);\r\n\t\t\t\t\t\t\t\t$this->db->query(\"update m_product_info set mrp=? where product_id=? limit 1\",array($p['mrp'],$pg['product_id']));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$r_itemids=$this->db->query(\"select itemid from m_product_deal_link where product_id=?\",$p['product_id'])->result_array();\r\n\t\t\t\t\t\t\t$r_itemids2=$this->db->query(\"select l.itemid from products_group_pids p join m_product_group_deal_link l on l.group_id=p.group_id where p.product_id=?\",$p['product_id'])->result_array();\r\n\t\t\t\t\t\t\t$r_itemids=array_unique(array_merge($r_itemids,$r_itemids2));\r\n\t\t\t\t\t\t\tforeach($r_itemids as $d)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$itemid=$d['itemid'];\r\n\t\t\t\t\t\t\t\t$item=$this->db->query(\"select orgprice,price from king_dealitems where id=?\",$itemid)->row_array();\r\n\t\t\t\t\t\t\t\t$o_price=$item['price'];$o_mrp=$item['orgprice'];\r\n\t\t\t\t\t\t\t\t$n_mrp=$this->db->query(\"select sum(p.mrp*l.qty) as mrp from m_product_deal_link l join m_product_info p on p.product_id=l.product_id where l.itemid=?\",$itemid)->row()->mrp+$this->db->query(\"select sum((select avg(mrp) from m_product_group_deal_link l join products_group_pids pg on pg.group_id=l.group_id join m_product_info p on p.product_id=pg.product_id where l.itemid=$itemid)*(select qty from m_product_group_deal_link where itemid=$itemid)) as mrp\")->row()->mrp;\r\n\t\t\t\t\t\t\t\t$n_price=$item['price']/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t\t$inp=array(\"itemid\"=>$itemid,\"old_mrp\"=>$o_mrp,\"new_mrp\"=>$n_mrp,\"old_price\"=>$o_price,\"new_price\"=>$n_price,\"created_by\"=>$user['userid'],\"created_on\"=>time(),\"reference_grn\"=>$grn);\r\n\t\t\t\t\t\t\t\t$this->db->insert(\"deal_price_changelog\",$inp);\r\n\t\t\t\t\t\t\t\t$this->db->query(\"update king_dealitems set orgprice=?,price=? where id=? limit 1\",array($n_mrp,$n_price,$itemid));\r\n\t\t\t\t\t\t\t\tif($this->db->query(\"select is_pnh as b from king_dealitems where id=?\",$itemid)->row()->b)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$o_s_price=$this->db->query(\"select store_price from king_dealitems where id=?\",$itemid)->row()->store_price;\r\n\t\t\t\t\t\t\t\t\t$n_s_price=$o_s_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t\t\t$this->db->query(\"update king_dealitems set store_price=? where id=? limit 1\",array($n_s_price,$itemid));\r\n\t\t\t\t\t\t\t\t\t$o_n_price=$this->db->query(\"select nyp_price as p from king_dealitems where id=?\",$itemid)->row()->p;\r\n\t\t\t\t\t\t\t\t\t$n_n_price=$o_n_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t\t\t$this->db->query(\"update king_dealitems set nyp_price=? where id=? limit 1\",array($n_n_price,$itemid));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tforeach($this->db->query(\"select * from partner_deal_prices where itemid=?\",$itemid)->result_array() as $r)\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$o_c_price=$r['customer_price'];\r\n\t\t\t\t\t\t\t\t\t$n_c_price=$o_c_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t\t\t$o_p_price=$r['partner_price'];\r\n\t\t\t\t\t\t\t\t\t$n_p_price=$o_p_price/$o_mrp*$n_mrp;\r\n\t\t\t\t\t\t\t\t\t$this->db->query(\"update partner_deal_prices set customer_price=?,partner_price=? where itemid=? and partner_id=?\",array($n_c_price,$n_p_price,$itemid,$r['partner_id']));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$imeis=explode(\",\",$this->input->post(\"imei{$p['product']}\"));\r\n\t\t\t\t\t\tforeach($imeis as $imei)\r\n\t\t\t\t\t\t\t$this->db->insert(\"t_imei_no\",array('product_id'=>$p['product_id'],\"imei_no\"=>$imei,\"grn_id\"=>$grn,\"created_on\"=>time()));\r\n\t\t\t\t\t\tif($this->db->query(\"select 1 from t_stock_info where product_id=? and location_id=? and rack_bin_id=? and mrp=?\",array($p['product'],$p['location'],$p['rackbin'],$p['mrp']))->num_rows()==0)\r\n\t\t\t\t\t\t\t$this->db->query(\"insert into t_stock_info(product_id,location_id,rack_bin_id,mrp,available_qty,created_on) values(?,?,?,?,?,now())\",array($p['product'],$p['location'],$p['rackbin'],$p['mrp'],$p['rqty']));\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$this->db->query(\"update t_stock_info set available_qty=available_qty+?,modified_on=now() where product_id=? and location_id=? and rack_bin_id=? and mrp=? limit 1\",array($p['rqty'],$p['product'],$p['location'],$p['rackbin'],$p['mrp']));\r\n\t\t\t\t\t\t$this->erpm->do_stock_log(1,$p['rqty'],$p['product'],$grn);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$po_status=2;\r\n\t\t\t\tforeach($this->db->query(\"select * from t_po_product_link where po_id=?\",$poid)->result_array() as $poi)\r\n\t\t\t\t{\r\n\t\t\t\t\tif($poi['order_qty']>$poi['received_qty'])\r\n\t\t\t\t\t\t$po_status=1;\r\n\t\t\t\t\t$this->db->query(\"update t_po_info set po_status=? where po_id=? limit 1\",array($po_status,$poid));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t\r\n\t\t\t$inv_vendor_ids = $_POST['inv_vendor_id'];\r\n\t\t\t$inv_nos = $_POST['invno'];\r\n\t\t\t\r\n\t\t\t$invs=array();\r\n\t\t\tforeach($inv_vendor_ids as $i=>$vid)\r\n\t\t\t{\r\n\t\t\t\tif(!isset($grn_ven_ids[$vid]))\r\n\t\t\t\t\tcontinue ;\r\n\t\t\t\t$grn = $grn_ven_ids[$vid];\r\n\t\t\t\t$no = $inv_nos[$i];\r\n\t\t\t\t$this->db->query(\"insert into t_grn_invoice_link(grn_id,purchase_inv_no,purchase_inv_date,purchase_inv_value,created_on) values(?,?,?,?,now())\",array($grn,$no,$_POST['invdate'][$i],$_POST['invamount'][$i]));\r\n\t\t\t\t$inv_id=$this->db->insert_id();\r\n\t\t\t\t\r\n\t\t\t\tif(isset($_FILES['scan_'.($i+1)]))\r\n\t\t\t\t{\r\n\t\t\t\t\tif(!strlen($_FILES['scan_'.($i+1)]['name']) > 0)\t\t\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(file_exists(ERP_PHYSICAL_IMAGES.\"invoices/$inv_id.jpg\"))\r\n\t\t\t\t\t\t\tunlink(ERP_PHYSICAL_IMAGES.\"invoices/$inv_id.jpg\");\r\n\t\t\t\t\t\tmove_uploaded_file($_FILES['scan_'.($i+1)]['tmp_name'], ERP_PHYSICAL_IMAGES.\"invoices/{$inv_id}.jpg\");\t\r\n\t\t\t\t}\r\n\t\t\t \t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$this->db->query(\"update t_paf_list set paf_status = 2,modified_by=?,modified_on = ? where paf_status = 1 and id = ?\",array($user['userid'],date('Y-m-d H:i:s'),$paf_id));\r\n\t\t\t\r\n\t\t\r\n\t\t\t$this->session->set_flashdata(\"erp_pop_info\",\"PO Created and Stock intake processed\");\r\n\t\t\tredirect('admin/stock_intake_list','refresh');\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}",
"public function actionSend(): void\n {\n $prizes = UserPrize::find()->alias('user_prize')->JoinWith(['prize','user'])\n ->where([\n 'user_prize.status' => UserPrize::STATUS_RECEIVED,\n 'prize_type' => Prize::TYPE_MONEY,\n ])\n ->limit(self::DEFAULT_NUMBER)\n ->all();\n\n if ($prizes) {\n $this->stdout(\\Yii::t('app', 'Sending {prizes} prize(s)...' . PHP_EOL,\n ['prizes' => count($prizes)]), Console::FG_GREEN);\n } else {\n $this->stdout(\\Yii::t('app', 'Nothing to send!' . PHP_EOL), Console::FG_YELLOW);\n }\n\n foreach ($prizes as $prize) {\n\n $prize->status = UserPrize::STATUS_SENT;\n $prize->save(false);\n\n $this->stdout(\\Yii::t('app', 'Sending {money} money to user {user}...', [\n 'money' =>$prize->quantity,\n 'user' => $prize->user->email\n ]));\n\n\n $this->stdout(\\Yii::t('app', ' [SENT]' . PHP_EOL), Console::FG_GREEN);\n }\n }",
"public function createpoAction() {\n $filter = $this->getRequest()->getParam('top_filter');\n $helperClass = Mage::helper('inventorysupplyneeds');\n if ($helperClass->getDraftPO()->getId()) {\n Mage::getSingleton('vendorsinventory/session')->addNotice(\n $helperClass->__('There was an existed draft purchase order. Please process it before creating new one'));\n return $this->_redirect('*/*/index', array('top_filter' => $filter));\n }\n $helperClass->setTopFilter($filter);\n $data = $helperClass->prepareDataForDraftPO();\n try {\n if (!isset($data['product_data']) || !count($data['product_data'])) {\n throw new Exception($helperClass->__('There is no product needed to purchase.'));\n }\n //var_dump($data); die();\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')\n ->addData($data);\n $model->setCreatedAt(now())\n ->setCreatedBy($this->_getUser()->getVendorId());\n $model->setType(Magestore_Inventorypurchasing_Model_Purchaseorder_Draftpo::SUPPLYNEED_TYPE);\n $model->create();\n Mage::getSingleton('vendorsinventory/session')\n ->addSuccess($helperClass->__('The supply needs have been saved successfully as draft purchase order(s).'));\n return $this->_redirect('*/inventory_draftpo/view', array('id' => $model->getId()));\n } catch (Exception $ex) {\n Mage::getSingleton('vendorsinventory/session')\n ->addError($helperClass->__('There is error while creating new draft purchase order.'));\n Mage::getSingleton('vendors/session')->addError($ex->getMessage());\n return $this->_redirect('*/*/index', array('top_filter' => $filter));\n }\n }",
"public function store(Request $request)\n {\n if(empty(ErpReceiveInventory::where('invoice_number', $request->invoice_number)->first())){\n $data = $request->except(['pending_po', 'product_id', 'pogross_price', 'ponet_amount']);\n $data['company_id'] = session('company_id');\n ErpReceiveInventory::create($data);\n $product = tblproduct_stockavailability::where('product_id', $request->product_id)->first();\n if(empty($product)){\n tblproduct_stockavailability::create([\n 'product_id'=> $request->product_id,\n 'stock_in_hand' => $request->received_qty\n ]);\n }else{\n $total_product = $product['stock_in_hand'] + $request->received_qty;\n tblproduct_stockavailability::where('product_id', $request->product_id)->update([\n 'stock_in_hand' => $total_product\n ]);\n }\n $status = $request->remaining_quantity == 0 ? 1 : 0; \n $po = erp_purchase_order::where('id', $request->po_id)->first();\n $po->received_qty = $po->received_qty + $request->received_qty;\n $po->po_status = $status;\n $po->save();\n return response()->json([\n \"status\" => true,\n \"message\" => \"Save Receive Inventory\"\n ]);\n }else{\n return response()->json([\n \"status\" => false,\n \"message\" => \"This invoice number is already exist, please use another\"\n ]);\n }\n }",
"public function deliver()\n {\n $GLOBALS['SITE_DB']->query_update('invoices', array('i_state' => 'delivered'), array('id' => get_param_integer('id')), '', 1);\n\n $url = build_url(array('page' => '_SELF', 'type' => 'undelivered'), '_SELF');\n return redirect_screen($this->title, $url, do_lang_tempcode('SUCCESS'));\n }",
"public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n $this->load->model('esls_model');\n\n $formData = $this->input->post(NULL, TRUE);\n\n //DATA THAT COMES FROM PRODUCERS\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"delivery_ready\"){\n $this->process_delivery_ready_event($formData);\n }\n else if($name === \"bid_awarded\"){\n $this->process_bid_awarded_event($formData);\n }\n }",
"public function deleteOne($id)\n {\n $ppe = Ppe::findOrFail($id);\n\n $sizerKeys = sizerange_ppe::where('sn', $id)->get();\n if (count($sizerKeys) != 0) {\n foreach ($sizerKeys as $key) {\n $range = Size_Range::find($key['sizer_ID']);\n if (!empty($range)) {\n $range->delete();\n }\n }\n }\n\n $propertyKeys = property_ppe::where('sn', $id)->get();\n if (count($propertyKeys) != 0) {\n foreach ($propertyKeys as $key) {\n $property = Property::find($key['property_ID']);\n if (!empty($property)) {\n $property->delete();\n }\n }\n }\n $oldPPE = $ppe;\n $ppe->delete();\n if ($oldPPE['order_ID']) {\n $order = OrderEnt::findOrFail($oldPPE['order_ID']);\n if ($order['state'] != \"delivered\") {\n $allPPEsSend = true;\n $ppes = Ppe::where('order_ID', $order['order_ID'])->get();\n foreach ($ppes as $ppe) {\n if (!$ppe['delivered']) {\n $allPPEsSend = false;\n }\n }\n if ($allPPEsSend) {\n $date = date(\"Y-m-d\");\n $order->commitedDeliveryDate = $date;\n $order->state = \"delivered\";\n $order->save();\n }\n }\n }\n return response()->json(['success' => 'PPE deleted'], 201);\n }",
"function onAction()\n {\n global $application;\n $request = $application->getInstance('Request');\n\t$msgres = $application->getInstance(\"MessageResources\", \"messages\");\n\n // checking if wishlist product is being added\n $wl_id = $request->getValueByKey('wl_id');\n if ($wl_id > 0)\n {\n $data = modApiFunc('Wishlist', 'getWishlistRecordCartData', $wl_id);\n if (!$data)\n {\n // invalid wishlist record...\n $request = new Request();\n $request -> setView('Wishlist');\n $application -> redirect($request);\n\t\t$this->setStatusError();\n\t\t$this->setMessage('Invalid wishlist record');\n }\n\n $options_sent = $data['options_sent'];\n $prod_id = $data['entity_id'];\n }\n else\n {\n $prod_id = $request->getValueByKey('prod_id');\n\n $data=array(\n 'parent_entity' => 'product'\n ,'entity_id' => $prod_id\n ,'options' => $request->getValueByKey('po')\n ,'qty' => $request->getValueByKey('quantity_in_cart')\n \t\t ,'colorname' => $request->getValueByKey('colorname')\n\n );\n\n $options_sent = $request->getValueByKey('options_sent');\n }\n\n // setting qty=1 if quantity_in_stock is not specified\n if (!$data['qty'] && $data['qty'] !== 0)\n $data['qty'] = 1;\n\n if($data['options']==null)\n {\n $data['options']=array();\n }\n\n\n $result = modApiFunc('Cart', 'processPostedProductData', $data, $options_sent);\n\n if (!$result['is_error'])\n {\n if(!empty($result['stock_discarded_by_warning']))\n {\n modApiFunc('Session','set','StockDiscardedBy',$result['stock_discarded_by_warning']);\n }\n\n $added = modApiFunc('Cart', 'addToCart', $result['data']);\n\t $cc = modApiFunc('Cart', 'getCartContent');\n\t $cartPrice = '';\n\t $cart_id = $prod_id.\"_\".modApiFunc(\"Product_Options\", \"getCombinationHash\", $result['data']['options']);\n\t if( !empty($cc))\n\t\t foreach($cc as $product)\n\t\t\t if($product[\"CartID\"]==$cart_id)\n\t\t\t\t $cartPrice = modApiFunc(\"Localization\", \"format\", $product[\"CartItemSalePrice\"], \"currency\");\n\n\t $this->setStatusSuccess();\n\n\t $p = new CProductInfo($prod_id);\n\t $message = array(\n\t\t \"<h2>\".$msgres->getMessage('CATALOG_PRODUCT_ADDED').\"</h2>\".\n\t\t \"<div class='ajax_message_cart_prod_link'><a href='\". $p->getProductInfoLink($prod_id, $p->chooseCategoryID()) .\"'>\".$p->getProductTagValue('name').\"</a></div>\".\n \"<div class='ajax_message_cart_prod_qty'>\".$data['qty'].\" \".$msgres->getMessage('CATALOG_X').\" \".$cartPrice.\"</div>\"\n );\n\n // if a wishlist product is being added...\n if ($wl_id > 0 && $added)\n {\n modApiFunc('Wishlist', 'removeFromWishlist', $wl_id);\n\t\t$message[] = 'This product was removed from your Wishlist';\n }\n\n\t $this->setMessage($message);\n $request = new Request();\n $request->setView(CURRENT_REQUEST_URL);\n $application->redirect($request);\n }\n else\n {\n\t $this->setStatusError();\n\t $message = array();\n\n if($result['discard_by'] != 'none')\n {\n modApiFunc('Session','set','OptionsDiscardedBy',$result['discard_by']);\n\t\t$message[] = $msgres->getMessage($result['discard_by']);\n }\n if($result['stock_discarded_by'] != 'none')\n {\n\t\t modApiFunc('Session','set','StockDiscardedBy',$result['stock_discarded_by']);\n\t\t $message[] = $msgres->getMessage($result['stock_discarded_by']);\n }\n modApiFunc('Session','set','sentCombination',$result['data']['options']);\n\t $this->setMessage($message);\n $request = new Request();\n $request->setView('ProductInfo');\n $request->setAction('SetCurrentProduct');\n $request->setKey('prod_id',$prod_id);\n $request->setProductID($prod_id);\n $p = new CProductInfo($prod_id);\n $request->setCategoryID($p->chooseCategoryID());\n $application->redirect($request);\n };\n }",
"public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n\n $formData = $this->input->post(NULL, TRUE);\n\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"bid_available\"){\n //Get data to store\n $data = array(\n 'guildPhoneNumber' => $formData['guildPhoneNumber'],\n 'deliveryRequestId' => $formData['deliveryRequestId'],\n 'driverPhoneNumber' => $formData['driverPhoneNumber'],\n 'driverName' => $formData['driverName'],\n 'estimatedDeliveryTime' => $formData['estimatedDeliveryTime']\n );\n\n //Store bid in DB and exit\n $this->save_bid($data);\n }\n else if($name === \"complete\"){\n $driverPhoneNumber = $formData['driverPhoneNumber'];\n\n $this->load->model('bids_model');\n $this->bids_model->set_delivered($driverPhoneNumber);\n }\n }",
"public function notificationAction() {\n global $CFG;\n\n // Full strength error logging\n error_reporting(E_ALL);\n ini_set('display_errors', 0);\n ini_set('log_errors', 1);\n\n // Library stuff\n $sagepay = new sagepayserverlib();\n $sagepay->setController($this);\n\n // POST data from SagePay\n $data = $sagepay->getNotification();\n\n // Log the notification data to debug file (in case it's interesting)\n $this->log(var_export($data, true));\n\n // Get the VendorTxCode and use it to look up the purchase\n $VendorTxCode = $data['VendorTxCode'];\n if (!$purchase = $this->bm->getPurchaseFromVendorTxCode($VendorTxCode)) {\n $url = $this->Url('booking/fail') . '/' . $VendorTxCode . '/' . urlencode('Purchase record not found');\n $this->log('SagePay notification: Purchase not found - ' . $url);\n $sagepay->notificationreceipt('INVALID', $url, 'Purchase record not found');\n die;\n }\n\n // Now that we have the purchase object, we can save whatever we got back in it\n $purchase = $this->bm->updateSagepayPurchase($purchase, $data);\n\n // Mailer\n $mail = new maillib();\n $mailpurchase = clone $purchase;\n $mail->initialise($this, $mailpurchase, $this->bm);\n $mail->setExtrarecipients($CFG->backup_email);\n\n // Check VPSSignature for validity\n if (!$sagepay->checkVPSSignature($purchase, $data)) {\n $purchase->status = 'VPSFAIL';\n $purchase->save();\n $url = $this->Url('booking/fail') . '/' . $VendorTxCode . '/' . urlencode('VPSSignature not matched');\n $this->log('SagePay notification: VPS sig no match - ' . $url);\n $sagepay->notificationreceipt('INVALID', $url, 'VPSSignature not matched');\n die;\n }\n\n // Check Status.\n // Work out what next action should be\n $status = $purchase->status;\n if ($status == 'OK' || ($status == 'OK REPEATED')) {\n\n // Send confirmation email\n $url = $this->Url('booking/complete') . '/' . $VendorTxCode;\n $mail->confirm();\n $this->log('SagePay notification: Confirm sent - ' . $url);\n $sagepay->notificationreceipt('OK', $url, '');\n } else if ($status == 'ERROR') {\n $url = $this->Url('booking/fail') . '/' . $VendorTxCode . '/' . urlencode($purchase->statusdetail);\n $this->log('SagePay notification: Booking fail - ' . $url);\n $mail->decline();\n $sagepay->notificationreceipt('OK', $url, $purchase->statusdetail);\n } else {\n $url = $this->Url('booking/decline') . '/' . $VendorTxCode;\n $this->log('SagePay notification: Booking decline - ' . $url);\n $mail->decline();\n $sagepay->notificationreceipt('OK', $url, $purchase->statusdetail);\n }\n\n $purchase->completed = 1;\n $purchase->save();\n\n die;\n }",
"function mark_as_paid() {\n if (!$this->active_invoice->isLoaded()) {\n $this->response->notFound();\n } // if\n\n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n try{\n if($this->request->isAsyncCall()) {\n $this->active_invoice->setStatus(INVOICE_STATUS_PAID);\n $this->active_invoice->save();\n $this->response->respondWithData($this->active_invoice, array(\n 'as' => 'invoice',\n 'detailed' => true,\n ));\n } else {\n $this->response->badRequest();\n } //if\n } catch (Exception $e) {\n $this->response->exception($e);\n } //try\n }",
"private function publishOffer() {\n if ($this->Session->check('addOffer')) {\n\n // salvando oferta\n $params ['Offer'] = $this->Session->read('addOffer.Offer');\n\n if ($params ['Offer'] ['parcels'] == 1) {\n $params ['Offer'] ['parcels'] = 'ACTIVE';\n\n if ($params ['Offer'] ['parcels_off_impost'] == 1)\n $params ['Offer'] ['parcels_off_impost'] = 'ACTIVE';\n else\n $params ['Offer'] ['parcels_off_impost'] = 'INACTIVE';\n } else {\n $params ['Offer'] ['parcels'] = 'INACTIVE';\n $params ['Offer'] ['parcels_off_impost'] = 'INACTIVE';\n }\n\n $params ['Offer'] ['company_id'] = $this->Session->read('CompanyLoggedIn.Company.id');\n $params ['Offer'] ['status'] = 'ACTIVE';\n\n $params ['Offer'] ['begins_at'] = $this->Utility->formataData($params ['Offer'] ['begins_at']);\n $params ['Offer'] ['ends_at'] = $this->Utility->formataData($params ['Offer'] ['ends_at']);\n\n // trabalhando especificacao e descricao para insert no banco\n $params ['Offer'] ['description'] = strip_tags($params ['Offer'] ['description'], '<a><strong><p><br><b><li><ul><img>');\n $params ['Offer'] ['specification'] = strip_tags($params ['Offer'] ['specification'], '<a><strong><p><br><b><li><ul><img>');\n\n // $params['Offer']['description'] = substr($params['Offer']['description'], 0, 1000);\n // $params['Offer']['specification'] = substr ($params['Offer']['specification'], 0 ,1000);\n\n $ofertaPublica = $params ['Offer'] ['public'];\n $params ['Offer'] ['value'] = str_replace(',', '.', str_replace('.', '', $params ['Offer'] ['value']));\n $addOffer = $this->Utility->urlRequestToSaveData('offers', $params);\n if ($addOffer ['status'] == 'SAVE_OK') {\n if ($this->Session->read('addOffer.update') == true) {\n // deletando publico alvo e filtros selecionados\n $offerId = $this->Session->read('addOffer.Offer.id');\n\n $query = \"DELETE FROM offers_filters where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferFilter = $this->Utility->urlRequestToGetData('users', 'query', $params);\n\n $query = \"DELETE FROM offers_users where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferUser = $this->Utility->urlRequestToGetData('users', 'query', $params);\n\n $query = \"DELETE FROM offers_photos where offer_id = {$offerId}\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $delOfferUser = $this->Utility->urlRequestToGetData('users', 'query', $params);\n } else {\n // pegando id de oferta cadastrada\n $params = array(\n 'Offer' => array(\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $offer = $this->Utility->urlRequestToGetData('offers', 'first', $params);\n $offerId = $offer ['Offer'] ['id'];\n }\n\n // $offerId = 42;\n // pegando valores de filtros selecionados\n $gender = implode(',', $this->Session->read('addOffer.filters.gender'));\n $location = implode(',', $this->Session->read('addOffer.filters.location'));\n $age_group = implode(',', $this->Session->read('addOffer.filters.age_group'));\n $political = implode(',', $this->Session->read('addOffer.filters.political'));\n $relationship_status = implode(',', $this->Session->read('addOffer.filters.relationship_status'));\n $religion = implode(',', $this->Session->read('addOffer.filters.religion'));\n\n // fazendo insert de filtros\n $params = array(\n 'OffersFilter' => array(\n 'offer_id' => $offerId,\n 'gender' => $gender,\n 'location' => $location,\n 'age_group' => $age_group,\n 'political' => $political,\n 'religion' => $religion,\n 'relationship_status' => $relationship_status\n )\n );\n $addOfferFilters = $this->Utility->urlRequestToSaveData('offers', $params);\n\n // fazendo insert de fotos\n $photos = $this->Session->read('addOffer.OffersPhoto');\n foreach ($photos as $photo) {\n if (!empty($photo)) {\n $params = array(\n 'OffersPhoto' => array(\n 'offer_id' => $offerId,\n 'photo' => $photo ['photo']\n )\n );\n $addPhoto = $this->Utility->urlRequestToSaveData('offers', $params);\n }\n }\n\n if ($ofertaPublica == 'INACTIVE') {\n // fazendo insert de usuarios capturados\n $users = $this->Session->read('addOffer.users');\n foreach ($users as $user) {\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$offerId}', '{$user['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n }\n\n // verifica se oferta esta sendo cadastrada para usuario que fez desejo\n if ($this->Session->check('CadOfferUser.id_linha_wishlist')) {\n $data = date('Y/m/d');\n\n // faz update de oferta para usuario na linha do wishlist\n $params = array(\n 'UsersWishlistCompany' => array(\n 'id' => $this->Session->read('CadOfferUser.id_linha_wishlist'),\n 'status' => 'ACTIVE',\n 'offer_id' => $offerId\n )\n );\n $desejosOfferUpdate = $this->Utility->urlRequestToSaveData('companies', $params);\n\n if ($desejosOfferUpdate ['status'] == 'SAVE_OK') {\n\n // verifica se usuario ja tem esta oferta\n $params = array(\n 'OffersUser' => array(\n 'conditions' => array(\n 'offer_id' => $desejosOfferUpdate ['data'] ['UsersWishlistCompany'] ['offer_id'],\n 'user_id' => $desejosOfferUpdate ['data'] ['User'] ['id']\n )\n )\n );\n $offer_user = $this->Utility->urlRequestToGetData('users', 'first', $params);\n\n if (!is_array($offer_user)) {\n // salvando oferta para usuario\n $data = date('Y/m/d');\n $query = \"INSERT INTO offers_users values(NULL, '{$desejosOfferUpdate['data']['UsersWishlistCompany']['offer_id']}', '{$desejosOfferUpdate['data']['User']['id']}', '{$data}', 'facebook - portal')\";\n $params = array(\n 'User' => array(\n 'query' => $query\n )\n );\n $addUserOffer = $this->Utility->urlRequestToGetData('users', 'query', $params);\n }\n }\n }\n } else {\n echo \"<script>alert('email enviado com sucesso');</script>\";\n $this->redirect(array(\n 'controller' => 'companies',\n 'action' => 'addOffer',\n 'plugin' => 'companies',\n 'detalhes'\n ));\n }\n }\n }",
"public function store(Request $request)\n {\n try {\n\n //$charge = Stripe::charges()->create([\n // 'amount' => Cart::total(),\n // 'currency' => 'CAD',\n // 'source' => $request->stripeToken,\n // 'description' => 'Order',\n // 'receipt_email' => $request->email,\n // 'metadata' => [\n // 'contents' => $contents,\n // 'quantity' => Cart::instance('default')->count(), */],\n //]);\n //SUCCESFULL\n\n\n $duplicates = Cart::search(function ($cartItem) {\n return $cartItem->name;\n });\n\n $nom = $duplicates->keyBy('name');\n\n $idProducte = $duplicates->keyBy('id');\n $idProducte2 = $idProducte->pluck('id');\n\n\n foreach ($idProducte2 as $itemProducteBaja) {\n $pedidoBAJA = DB::table('products')->where('id_producte', $itemProducteBaja)->update(['vendido' => \"1\"]);\n }\n\n\n //dd($pedidoBAJA);\n\n $pedido = new Pedidos();\n\n\n\n $pedido->nombrecompleto = $request->nombre;\n $pedido->correo = $request->email;\n $pedido->ciudad = $request->ciudad;\n $pedido->direccion = $request->direccion;\n $pedido->provincia = $request->provincia;\n $pedido->codigopostal = $request->postal;\n $pedido->telefono = $request->telefono;\n $pedido->precioACobrar = $request->get('newTotal');\n $pedido->obras = $nom->pluck('name');\n\n //dd($pedido);\n $pedido->save();\n\n Mail::send(new OrderPlaced($pedido));\n\n Cart::instance('default')->destroy();\n\n return redirect()->route('gracias.index')->with('success_message', 'Gracias! Tu compra ha sido realizada correctamente! :)');\n } catch (Exception $e) { }\n }",
"public function store(Request $request)\n {\n //store the action\n $action = $request->input(\"action\");\n\n switch($action){\n //if approve damage request button is clicked\n case \"approve_damage\":\n Product_Report::where('id', $request->input(\"damageid\"))->update([\"is_replaced\" => 1]);\n \n //set message\n $message = 'Your Damage request # '.$request->input(\"damageid\").' has been accepted. Please be advised accordingly';\n\n //call the global function for setting the notification\n $this->set_notification(\"approved_customer_order\", $message, $request->input(\"clientid\"));\n\n return response()->json([\n 'message' => \"Order Damage Approved!\",\n ]);\n break;\n case \"disapprove_damage\":\n\n if($user = User::find($request->clientid)){\n //set text message\n $text_message = \"Your replacement \".$request->report_no.\" was declined. Please contact the staff assigned in your store area. \n \\nBest regards,\\nCharpling Square Enterprise \\nCreamline Authorized Distributor\";\n\n //send it to customer\n $this->global_itexmo($user->contact_num, $text_message, \"ST-CHARP371478_AF72H\", '7x8j1z3vnv');\n // $order = DB::table('order_invoice')->where('id', $request->damageid)->first();\n $this->notificationDispatch([\n 'user_id' => $request->clientid,\n 'type' => 'file_replacement_disapproved',\n 'area_id' => $user->area_id,\n 'email_to' => 'client',\n 'message' => \"Your replacement \".$request->report_no.\" was declined. Please contact the staff assigned in your store area.\",\n 'status' => 'unread'\n ]); \n }\n Product_Report::where('id', $request->input(\"damageid\"))->update([\"is_replaced\" => 2]);\n \n //set message\n // $message = 'Your Damage request # '.$request->input(\"damageid\").' has been disapproved. Please be advised accordingly';\n\n //call the global function for setting the notification\n // $this->set_notification(\"approved_customer_order\", $message, $request->input(\"clientid\"));\n \n return response()->json([\n 'message' => \"Order Damage Disapproved!\",\n ]);\n break;\n default:\n echo \"do nothing here....\";\n }\n }",
"public function publish(){\n $post = Products::where('id', \\request(\"id\"))->first();\n $post->active = $post->active==\"pending\"?\"Approved\":\"pending\";\n $post->save();\n return redirect(route('voyager.h-products.index'));\n }",
"public function buy()\n\t{\n\t\t$data['aktif']\t= 'prospektus';\n\t\t$this->template->load('template','prospektus/V_buy', $data);\n\t}",
"public function pesquisarAction() {\r\n \r\n }",
"public function index()\n {\n $pedido = PedidoProduto::where([\n 'pedido_id' => $idpedido,\n 'valor' => $produto->valor\n ])->get();\n \n $preference_data = array (\n \"items\" => array (\n array (\n \"title\" => \"Pagamento MIXCOM\",\n \"quantity\" => 1,\n \"currency_id\" => \"BRL\",\n \"unit_price\" => $pedido\n )\n )\n );\n\n try {\n $preference = MP::create_preference($preference_data);\n return redirect()->to($preference['response']['init_point']);\n } catch (Exception $e){\n dd($e->getMessage());\n }\n }",
"public function processPayment(){\n\t\t\t\t// See your keys here https://dashboard.stripe.com/account/apikeys\n\t\t\t\tStripe::setApiKey(\"sk_live_NharL7KTJBPcvdVrbQIXr3MS\");\n\n\t\t\t\t// Get the credit card details submitted by the form\n\t\t\t\t$token = Input::get('stripeToken');\n\n\t\t// Create the charge on Stripe's servers - this will charge the user's card\n\t\ttry {\n\t\t\tif(Shipping::where('cart_id', Session::get('cart_id'))->pluck('payment_status') == 'Paid'){\n\t\t\t\treturn Redirect::route('alreadyPaid');\n\t\t\t}\n\t\t$charge = Charge::create(array(\n\t\t \"amount\" => Input::get('data-description'), // amount in cents, again\n\t\t \"currency\" => \"usd\",\n\t\t \"source\" => $token,\n\t\t \"description\" => Session::get('cart_id'))\n\t\t);\n\t} catch(\\Stripe\\Error\\Card $e) {\n\t // The card has been declined\n\t}\n\t\t\t$cart_id = Session::get('cart_id');\n\t\t\t$markPaid = Shipping::where('cart_id', Session::get('cart_id'))->first();\n\t\t\t$markPaid->payment_status = 'Paid';\n\t\t\t$markPaid->shipped_status = 'Not Shipped';\n\t\t\t$markPaid->save();\n\n\t\t\t//inventorytime\n\t\t\t// foreach(Cart::where('customer_id', $cart_id)->get() as $purgeCarts)\n\t\t\t// {\t\n\t\t\t// \t$inventory = Inventory::where('product_id', $purgeCarts->item)->pluck($purgeCarts->size);\n\t\t\t// \t$newsize = $inventory - $purgeCarts->quantity;\n\t\t\t// \tDB::table('inventories')->where('product_id', $purgeCarts->item)->update(array($purgeCarts->size => $newsize));\n\t\t\t// }\n\n\t\t\t\n\t\t\tMail::send('emails.Newsale', array('cart' => $cart_id, 'customer' => Shipping::where('cart_id', $cart_id)->first()), function($message){\n\t\t\t\t$checkoutAmt = Session::get('checkoutAmt');\n\t\t\t\t$message->to(Shipping::where('cart_id', Session::get('cart_id'))->pluck('email'))->subject(\"Your Eternally Nocturnal Order\");\n\t\t\t});\n\t\t\tMail::send('emails.Newsaleadmin', array('cart' => $cart_id, 'customer' => Shipping::where('cart_id', $cart_id)->first()), function($message){\n\t\t\t\t$checkoutAmt = Session::get('checkoutAmt');\n\t\t\t\t$message->to('[email protected]')->subject(\"NEW SALE $\".substr($checkoutAmt,0,-2).\".\".substr($checkoutAmt,-2));\n\t\t\t});\n\n\t\t\tSale::create(array('customer_id' => $markPaid->email, 'cart_id' => Session::get('cart_id')));\n\n\t\t\tSession::forget('cart_id');\n\t\t\tSession::forget('checkoutAmt');\n\t\t\treturn Redirect::route('transSuccess');\n\t\t}",
"public function store()\n {\n Delivery::create([\n 'id_pengirim' => request('id_pengirim'),\n 'desk_barang' => request('desk_barang'),\n 'tgl_kirim' => request('tgl_kirim'),\n 'id_kurir' => request('id_kurir'),\n 'id_tracking' => request('id_tracking')\n ]);\n return redirect('/pengiriman');\n }",
"public function peps(Request $request){\n try{\n $idAlmacen = \\App\\Almacenes::Where('almacen', '=', $request->id_almacen)->first();\n\n $idBien = \\App\\Bienes::Where('id_gestion', '=', Gestiones::gestion())->where('bien', '=', $request->id_articulo )->first();\n $bien = $request->id_articulo != '' ? \"articulos_movimientos.id_bien = '\".$idBien->id.\"'\" : ' 1=1 ' ;\n $bett0 = $bien;\n $bienes = $request->id_articulo != '' ? \"bienes.id = '\".$idBien->id.\"'\" : ' 1=1 ' ;\n\n if($request->button == 'inmediato'){\n $link = \"reporte.pepsReporteInmediato\";\n $movimiento = \" articulos_movimientos.movimiento = 'INGRESO' or articulos_movimientos.movimiento = 'SALIDA'\" ;\n }elseif ($request->button == 'stock'){\n $link = \"reporte.pepsReporteStock\";\n $movimiento = \" articulos_movimientos.movimiento = 'INGRESO STOCK' or articulos_movimientos.movimiento = 'SALIDA STOCK'\" ;\n }elseif ($request->button == 'fisicoValorado'){\n $link = \"reporte.pepsReporteFisicoValorado\";\n }\n\n $aperturas = \\DB::table('articulos_movimientos')\n ->join('aperturas', 'articulos_movimientos.id_apertura', '=', 'aperturas.id')\n ->where('articulos_movimientos.movimiento', '=', 'INGRESO STOCK')\n ->where('articulos_movimientos.observacion', '=', '')\n ->where('articulos_movimientos.id_gestion', '=', $request->gestion)\n ->select('aperturas.*')\n ->groupBy('aperturas.id')\n ->orderBy('aperturas.id')\n ->get();\n\n\n $bienes = \\DB::table('bienes')->join('users', 'bienes.id_usuario', '=', 'users.id')\n ->join('unidades', 'bienes.id_unidad', '=', 'unidades.id')\n ->join('clasificadores', 'bienes.id_clasificador', '=', 'clasificadores.id')\n ->join('articulos_movimientos', 'bienes.id', '=', 'articulos_movimientos.id_bien')\n ->whereRaw($bien)\n //->whereRaw($movimiento)\n ->where('bienes.id_gestion', '=', Gestiones::gestion())\n ->select('bienes.id as idBien', 'bienes.codigo', 'bienes.bien', 'unidades.unidad', 'users.name',\n 'clasificadores.codigo as clasificadorCodigo', 'articulos_movimientos.id_almacen', 'articulos_movimientos.movimiento')\n ->groupBy('bienes.id')\n ->orderBy('bienes.id')\n ->get();\n\n\n $datos = \\DB::table('articulos_movimientos')->join('users', 'articulos_movimientos.id_usuario', '=', 'users.id')\n ->join('movimientos', 'articulos_movimientos.id_movimiento', '=', 'movimientos.id')\n ->join('almacenes', 'articulos_movimientos.id_almacen', '=', 'almacenes.id')\n ->join('conceptos', 'movimientos.id_concepto', '=', 'conceptos.id')\n ->join('aperturas', 'articulos_movimientos.id_apertura', '=', 'aperturas.id')\n ->join('clasificadores', 'articulos_movimientos.id_clasificador','=', 'clasificadores.id')\n ->join('bienes', 'articulos_movimientos.id_bien', '=', 'bienes.id')\n ->whereRaw($bien)\n ->where('articulos_movimientos.eliminacion', '=', \"\")\n ->where('articulos_movimientos.observacion', '=', \"\")\n ->where('articulos_movimientos.id_almacen', '=', $idAlmacen->id)\n ->where('movimientos.created_at', '>=', Carbon::parse($request->fecha_inicio) )\n ->where('movimientos.created_at', '<=', Carbon::parse($request->fecha_fin) )\n ->where('articulos_movimientos.id_gestion', '=', Gestiones::gestion())\n ->select( 'articulos_movimientos.id', 'articulos_movimientos.*',\n 'movimientos.fecha as movimientoFecha', 'movimientos.movimiento as movimientoTipo', 'movimientos.nro_moviento',\n 'conceptos.tipo', 'conceptos.concepto',\n 'users.name', 'bienes.bien', 'bienes.codigo as bienCodigo',\n 'almacenes.*','aperturas.codigo as aperturaCodigo','clasificadores.codigo as clasificadorCodigo', 'aperturas.*'\n )\n ->orderBy('bienes.bien', 'asc')\n ->orderBy('articulos_movimientos.id_bien', 'asc')\n ->orderBy('articulos_movimientos.movimiento', 'asc')\n ->get();\n\n if ($request->button == 'fisicoValorado'){\n $datos = \\DB::table('articulos_movimientos')->join('users', 'articulos_movimientos.id_usuario', '=', 'users.id')\n ->join('movimientos', 'articulos_movimientos.id_movimiento', '=', 'movimientos.id')\n ->join('almacenes', 'articulos_movimientos.id_almacen', '=', 'almacenes.id')\n ->join('proveedores', 'movimientos.id_proveedor', '=', 'proveedores.id')\n ->join('conceptos', 'movimientos.id_concepto', '=', 'conceptos.id')\n ->join('bienes', 'articulos_movimientos.id_bien', '=', 'bienes.id')\n ->join('unidades', 'bienes.id_unidad', '=', 'unidades.id')\n ->join('aperturas', 'articulos_movimientos.id_apertura', '=', 'aperturas.id')\n ->join('clasificadores', 'articulos_movimientos.id_clasificador', '=', 'clasificadores.id')\n ->where('articulos_movimientos.movimiento', '=', 'INGRESO STOCK')\n ->where('articulos_movimientos.observacion', '=', '')\n ->where('articulos_movimientos.id_gestion', '=', $request->gestion)\n ->select('users.name',\n 'movimientos.*', 'movimientos.fecha as fechaMovimiento', 'movimientos.nro_moviento',\n 'articulos_movimientos.observacion', 'articulos_movimientos.cantidad', 'articulos_movimientos.cantidad_actual', 'articulos_movimientos.costo', 'articulos_movimientos.total', 'articulos_movimientos.id_bien', 'articulos_movimientos.*',\n 'conceptos.concepto', 'proveedores.proveedor', 'unidades.unidad','almacenes.almacen','bienes.bien','bienes.codigo as BienCod',\n 'aperturas.id as idApertura', 'aperturas.apertura', 'aperturas.codigo as codigoApertura', 'aperturas.*',\n 'clasificadores.clasificador', 'clasificadores.codigo as clasificadorcodigo','unidades.unidad')\n ->orderBy('aperturas.id')\n ->orderBy('bienes.bien')\n ->get();\n $aperturas = \\DB::table('articulos_movimientos')\n ->join('aperturas', 'articulos_movimientos.id_apertura', '=', 'aperturas.id')\n ->where('articulos_movimientos.movimiento', '=', 'INGRESO STOCK')\n ->where('articulos_movimientos.observacion', '=', '')\n ->where('articulos_movimientos.id_gestion', '=', $request->gestion)\n ->select('aperturas.*')\n ->groupBy('aperturas.id')\n ->orderBy('aperturas.id')\n ->get();\n\n\n }\n\n $gestion = \\App\\Gestiones::find($request->gestion);\n $fechaInicio = $request->fecha_inicio;\n $fechafinal = $request->fecha_fin;\n $configuracion = \\DB::table('configuraciones')->first();\n $almacen = \\DB::table('almacenes')->select('almacen')->first();\n\n //return view($link, compact('bienes', 'configuracion', 'fechaInicio', 'fechafinal', 'almacen', 'bett0', 'gestion', 'aperturas', 'datos'));\n\n $pdf = \\PDF::loadView($link, compact('bienes', 'configuracion', 'fechaInicio', 'fechafinal', 'almacen', 'bett0', 'gestion', 'aperturas', 'datos') )\n ->setPaper('letter')->setOrientation('portrait')\n ->setOption('page-width', '216mm')\n ->setOption('page-height', '279mm')\n ->setOption('margin-right', '10mm')\n ->setOption('margin-left', '15mm')\n ->setOption('margin-bottom', '15mm')\n ->setOption('header-spacing', 15)\n ->setOption('footer-spacing', 1)\n ->setOption('footer-html', asset('pie.php'));\n\n return $pdf->inline('Codigo4060_GlovalFisicoValorado'.date('Ymdhis').'.pdf');\n }catch (Exception $e) {\n return \"<script> alert('Error R0012: Reporte de movimientos por bien \\n\".$e->getMessage().\"'); location.href='\".asset('index.php/Reportes').\"'; </script>\";\n }\n }",
"public function store(Request $request)\n {\n $paiement = new Paiement();\n $paiement->pack_id = $request->pack_id;\n $paiement->user_id = $request->user_id;\n $paiement->save();\n return back()->with('success', 'Pack a été ajouté!');\n }",
"public function store(Request $request)\n {\n //\n\n $validation = \\Validator::make($request->all(),[\n \"tanggal_transaksi\" => \"required\",\n \"customer\" => \"required\",\n \"status\" => \"required\",\n \"product\" => \"required\",\n \"qty\" => \"required\"\n ])->validate();\n\n foreach ($request->get('product') as $key => $brg) {\n $stock = \\App\\Stock::find($request->get('product')[$key]);\n $product = \\App\\Product::find($request->get('product')[$key]);\n if($request->get('qty')[$key] > $stock->stok ){\n return redirect()->route('penjualans.create')->with('message', 'Stok '. $product->nama_produk .' tidak mencukupi');\n }\n }\n\n\n $new_penjualan = new \\App\\Penjualan;\n $new_penjualan->created_by = \\Auth::user()->id;\n $new_penjualan->customer_id = $request->get('customer');\n\n $new_penjualan->tanggal_transaksi =\n date('Y-m-d', strtotime($request->get('tanggal_transaksi')));\n\n $mytime = Carbon::now();\n $invoice = \\App\\Penjualan::get('invoice_number')->last();\n if ($invoice === null) {\n $invoice_no = 7001;\n } else {\n $invoice_no = $invoice->invoice_number + 1;\n }\n $new_penjualan->invoice_number = $invoice_no;\n $new_penjualan->status = $request->get('status');\n $new_penjualan->total_harga = 0;\n $new_penjualan->profit = 0;\n $new_penjualan->shipping = $request->get('shipping');\n $new_penjualan->save();\n $penjualan_id = $new_penjualan->id;\n\n $total_harga = 0;\n $profit = 0;\n\n foreach ($request->get('product') as $key => $brg) {\n $new_penjualan_product = new \\App\\PenjualanProduct;\n $new_penjualan_product->penjualan_id = $penjualan_id;\n $new_penjualan_product->product_id = $brg;\n $new_penjualan_product->qty = $request->get('qty')[$key];\n\n\n $product = \\App\\Product::find($request->get('product')[$key]);\n $new_penjualan_product->harga_jual = $product->harga_jual;\n $new_penjualan_product->harga_beli = $product->harga_dasar;\n $new_penjualan_product->save();\n\n $total_harga += $new_penjualan_product->harga_jual * $new_penjualan_product->qty;\n $profit += ($new_penjualan_product->harga_jual - $new_penjualan_product->harga_beli) * $new_penjualan_product->qty;\n\n $new_Stock = \\App\\Stock::find($request->get('product')[$key]);\n $new_Stock->stok -= $request->get('qty')[$key];\n $new_Stock->save();\n }\n\n $new_penjualan = \\App\\Penjualan::find($penjualan_id);\n $new_penjualan->total_harga = $total_harga;\n $new_penjualan->profit = $profit;\n $new_penjualan->save();\n\n\n $data = array(\n 'id' => $penjualan_id,\n 'name' => \"yes\",\n 'message' => \"yes\"\n );\n $cus = \\App\\Customer::find($request->get('customer'));\n\n Mail::to($cus->email)->send(new SendMail($data));\n\n return redirect()->route('invoiceTransaksi', ['id' => $penjualan_id])->with('status', 'penjualan successfully created.');\n }",
"public function home_marketplace_publish(Request $request) {\n $id = $request->id;\n $partner = HomeMarketplace::where('id', $id)->get()->first();\n $new['active'] = 1 - $partner->active;\n HomeMarketplace::where('id', $id)->update($new);\n if($new['active'] == 1) {\n Session::flash('flash_success', 'Data has been Published successfully'); \n }else {\n Session::flash('flash_success', 'Data has been Unpublished successfully'); \n } \n echo \"success\";\n\n }",
"public function proses()\n {\n $getparam = explode(\";\",$_GET['param']);\n $getso = $this->Detailsalesorder_model->get_where_in('no_so',$getparam,'trans_so_header');\n\n $and = \" proses_do IS NULL \";\n $getitemso = $this->Detailsalesorder_model->get_where_in_and('no_so',$getparam,$and,'trans_so_detail');\n $driver = $this->Deliveryorder_model->pilih_driver()->result();\n\t\t$Arr_Driver\t= array();\n\t\tif($driver){\n\t\t\tforeach($driver as $keyD=>$valD){\n\t\t\t\t$Kode_Driver\t\t= $valD->id_karyawan;\n\t\t\t\t$Name_Driver\t\t= $valD->nama_karyawan;\n\t\t\t\t$Arr_Driver[$Kode_Driver]\t= $Name_Driver;\n\t\t\t}\n\t\t\tunset($driver);\n\t\t}\n $kendaraan = $this->Deliveryorder_model->pilih_kendaraan()->result();\n $Arr_Kendaraan = array();\n if($kendaraan){\n foreach($kendaraan as $keyK=>$valK){\n $Id_kendaraan = $valK->id_kendaraan;\n $Nama_kendaraan = $valK->nm_kendaraan;\n $Arr_Kendaraan[$Id_kendaraan] = $Nama_kendaraan;\n }\n unset($kendaraan);\n }\n $this->template->set('param',$getparam);\n $this->template->set('headerso',$getso);\n $this->template->set('getitemso',$getitemso);\n $this->template->set('arr_driver',$Arr_Driver);\n $this->template->set('kendaraan',$Arr_Kendaraan);\n $this->template->title('Input Delivery Order');\n $this->template->render('deliveryorder_form');\n }",
"public function store(Request $request)\n {\n //dd($request->all());\n $this->validate($request,[\n\n 'supplier_id'=>'required',\n 'payment_type'=>'required',\n 'total'=>'required',\n 'payment'=>'required'\n \n ]);\n \n $receivingItems = RecevingTemp::all();\n // dd($receivingItems);\n if(empty($receivingItems->toArray())) {\n notify()->error(\"Please Add some Items to create purchase!\",\"Error\");\n return back();\n }\n \n $receiving = new Receving;\n $receiving->supplier_id = $request->supplier_id;\n $receiving->user_id = Auth::user()->id;\n $receiving->payment_type = $request->payment_type;\n $payment = $receiving->payment = $request->payment;\n $total = $receiving->total = $request->total;\n $dues = $receiving->dues = $total - $payment;\n $receiving->comments = $request->comments;\n\n if ($dues > 0) {\n $receiving->status = 0;\n } else {\n $receiving->status = 1;\n }\n $receiving->save();\n \n $supplier = Supplier::findOrFail($receiving->supplier_id);\n $supplier->prev_balance = $supplier->prev_balance + $dues;\n $supplier->update();\n if ($request->payment > 0) {\n $payment = new RecevingPayment;\n $paid = $payment->payment = $request->payment;\n $payment->dues = $total - $paid;\n $payment->payment_type = $request->payment;\n $payment->comments = $request->comments;\n $payment->receiving_id = $receiving->id;\n $payment->user_id = Auth::user()->id;\n $payment->save();\n }\n \n $receivingItemsData=[];\n foreach ($receivingItems as $value) {\n $receivingItemsData = new RecevingItem;\n $receivingItemsData->receiving_id = $receiving->id;\n $receivingItemsData->product_id = $value->product_id;\n $receivingItemsData->cost_price = $value->cost_price;\n $receivingItemsData->quantity = $value->quantity;\n $receivingItemsData->total_cost = $value->total_cost;\n $receivingItemsData->save();\n //process inventory\n $products = Product::find($value->product_id);\n if ($products->type == 1) {\n $inventories = new Inventory;\n $inventories->product_id = $value->product_id;\n $inventories->user_id = Auth::user()->id;\n $inventories->in_out_qty = -($value->quantity);\n $inventories->remarks = 'PURCHASE' . $receiving->id;\n $inventories->save();\n //process product quantity\n $products->quantity = $products->quantity - $value->quantity;\n $products->save();\n } \n }\n \n //delete all data on SaleTemp model\n RecevingTemp::truncate();\n $itemsreceiving = RecevingItem::where('receiving_id', $receivingItemsData->receiving_id)->get();\n notify()->success(\"You have successfully added Purchases!\",\"Success\");\n return view('receiving.complete')\n ->with('receiving', $receiving)\n ->with('receivingItemsData', $receivingItemsData)\n ->with('receivingItems', $itemsreceiving);\n }",
"public function copyFromPoAction()\r\n {\r\n $request = $this->getRequest();\r\n $this->layout(\"Finance/layout-fullscreen\");\r\n\r\n /**@var \\Application\\Controller\\Plugin\\NmtPlugin $nmtPlugin ;*/\r\n $nmtPlugin = $this->Nmtplugin();\r\n\r\n /**@var \\Application\\Entity\\MlaUsers $u ;*/\r\n $u = $this->doctrineEM->getRepository('Application\\Entity\\MlaUsers')->findOneBy(array(\r\n \"email\" => $this->identity()\r\n ));\r\n\r\n $default_cur = null;\r\n if ($u->getCompany() instanceof \\Application\\Entity\\NmtApplicationCompany) {\r\n $default_cur = $u->getCompany()->getDefaultCurrency();\r\n }\r\n\r\n // Is Posting .................\r\n // ============================\r\n if ($request->isPost()) {\r\n\r\n $errors = array();\r\n\r\n $data = $this->params()->fromPost();\r\n $redirectUrl = $data['redirectUrl'];\r\n\r\n $id = (int) $request->getPost('target_id');\r\n $token = $request->getPost('target_token');\r\n\r\n /**@var \\Application\\Repository\\NmtProcurePoRepository $res ;*/\r\n $res = $this->doctrineEM->getRepository('Application\\Entity\\NmtProcurePo');\r\n $po = $res->getPo($id, $token);\r\n\r\n /**@var \\Application\\Entity\\NmtProcurePo $target ;*/\r\n $target = null;\r\n\r\n if ($po != null) {\r\n if ($po[0] instanceof NmtProcurePo) {\r\n $target = $po[0];\r\n }\r\n }\r\n\r\n if ($target == null) {\r\n $errors[] = 'Contract /PO can\\'t be empty!';\r\n $this->flashMessenger()->addMessage('Something wrong!');\r\n\r\n if (count($errors) > 0) {\r\n $viewModel = new ViewModel(array(\r\n 'action' => \\Application\\Model\\Constants::FORM_ACTION_AP_FROM_PO,\r\n 'redirectUrl' => $redirectUrl,\r\n 'errors' => $errors,\r\n 'entity' => null,\r\n 'target' => null,\r\n 'nmtPlugin' => $nmtPlugin\r\n ));\r\n\r\n $viewModel->setTemplate(\"finance/v-invoice/crud\");\r\n return $viewModel;\r\n }\r\n }\r\n\r\n $entity = new FinVendorInvoice();\r\n $entity->setLocalCurrency($default_cur);\r\n $entity->setTransactionType(\\Application\\Model\\Constants::TRANSACTION_TYPE_PURCHASED);\r\n $entity->setDocStatus(\\Application\\Model\\Constants::DOC_STATUS_DRAFT);\r\n $errors = $this->apService->saveHeader($entity, $data, $u, TRUE);\r\n\r\n if (count($errors) > 0) {\r\n $viewModel = new ViewModel(array(\r\n 'action' => \\Application\\Model\\Constants::FORM_ACTION_AP_FROM_PO,\r\n 'redirectUrl' => $redirectUrl,\r\n 'errors' => $errors,\r\n 'entity' => $entity,\r\n 'target' => $target,\r\n 'nmtPlugin' => $nmtPlugin\r\n ));\r\n\r\n $viewModel->setTemplate(\"finance/v-invoice/crud\");\r\n return $viewModel;\r\n }\r\n\r\n try {\r\n $this->apService->copyFromPO($entity, $target, $u, TRUE);\r\n } catch (\\Exception $e) {\r\n $errors[] = $e->getMessage();\r\n }\r\n\r\n if (count($errors) > 0) {\r\n $viewModel = new ViewModel(array(\r\n 'action' => \\Application\\Model\\Constants::FORM_ACTION_AP_FROM_PO,\r\n 'redirectUrl' => $redirectUrl,\r\n 'errors' => $errors,\r\n 'entity' => $entity,\r\n 'target' => $target,\r\n 'nmtPlugin' => $nmtPlugin\r\n ));\r\n\r\n $viewModel->setTemplate(\"finance/v-invoice/crud\");\r\n return $viewModel;\r\n }\r\n\r\n $m = sprintf(\"[OK] AP #%s created from P/O #%s\", $entity->getSysNumber(), $target->getSysNumber());\r\n $this->flashMessenger()->addMessage($m);\r\n\r\n $redirectUrl = \"/finance/v-invoice/review?token=\" . $entity->getToken() . \"&entity_id=\" . $entity->getId();\r\n return $this->redirect()->toUrl($redirectUrl);\r\n }\r\n\r\n // NO POST\r\n // Initiate.....................\r\n // ==============================\r\n\r\n $redirectUrl = null;\r\n if ($request->getHeader('Referer') != null) {\r\n\r\n $redirectUrl = $this->getRequest()\r\n ->getHeader('Referer')\r\n ->getUri();\r\n }\r\n\r\n $id = (int) $this->params()->fromQuery('target_id');\r\n $token = $this->params()->fromQuery('token');\r\n\r\n /**@var \\Application\\Repository\\NmtProcurePoRepository $res ;*/\r\n $res = $this->doctrineEM->getRepository('Application\\Entity\\NmtProcurePo');\r\n $po = $res->getPo($id, $token);\r\n\r\n if ($po == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n /**@var \\Application\\Entity\\NmtProcurePo $target ;*/\r\n\r\n $target = null;\r\n if ($po[0] instanceof NmtProcurePo) {\r\n $target = $po[0];\r\n }\r\n\r\n if ($target == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $entity = new FinVendorInvoice();\r\n $entity->setContractNo($target->getContractNo());\r\n $entity->setContractDate($target->getContractDate());\r\n $entity->setVendor($target->getVendor());\r\n $entity->setCurrency($target->getCurrency());\r\n $entity->setExchangeRate($target->getExchangeRate());\r\n\r\n $entity->setLocalCurrency($target->getLocalCurrency());\r\n $entity->setDocCurrency($target->getDocCurrency());\r\n\r\n $entity->setIsActive(1);\r\n\r\n $default_wh = $this->doctrineEM->getRepository('Application\\Entity\\NmtInventoryWarehouse')->findOneBy(array(\r\n 'isDefault' => 1\r\n ));\r\n\r\n if ($default_wh !== null) {\r\n $entity->setWarehouse($default_wh);\r\n }\r\n\r\n $viewModel = new ViewModel(array(\r\n 'action' => \\Application\\Model\\Constants::FORM_ACTION_AP_FROM_PO,\r\n 'redirectUrl' => $redirectUrl,\r\n 'errors' => null,\r\n 'entity' => $entity,\r\n 'target' => $target,\r\n 'nmtPlugin' => $nmtPlugin\r\n ));\r\n\r\n $viewModel->setTemplate(\"finance/v-invoice/crud\");\r\n return $viewModel;\r\n }",
"public function store(Request $request)\n {\n\n //dd($request->all());\n $cart = cartGet();\n $res = ['status' => 'success'];\n //dd(route('success'));\n if (!cart()->empty) {\n\n $order = new Order;\n $order->city = currentCity() ? currentCity()->name : '';\n $order->country_id = country()->id;\n $order->delivery = $request->cart_delivery;\n $order->fio = $request->name;\n $order->phone = $request->phone;\n $order->address = $request->address;\n $order->comment = $request->message;\n $order->date = time();\n $order->save();\n\n $res['name'] = $order->fio;\n $res['phone'] = $order->phone;\n $res['status'] = 'success';\n\n //apply promocode\n if(promocode() && !promocode()->apply(cart()->collection))\n {\n return abort(406);\n }\n\n foreach (cart()->products as $product) {\n $items[] = [\n 'order_id' => $order->id,\n 'product_id' => $product->id,\n 'price' => $product->price_real,\n 'price_promo'=> $product->price,\n 'count' => $product->count,\n ];\n }\n\n $pid = \\DB::table('order_items')->insert($items);\n\n $order->price = cart()->total;\n $order->save();\n\n if (!env(\"MAIL_DISABLE\", false)) {\n Mail::to(getConfigValue('message_mail'))->send(new OrderShipped($order));\n }\n\n cart()->flush();\n\n //clear promocode\n if(promocode())\n {\n promocode()->remove();\n }\n\n session(['order_id' => $order->id]);\n return redirect(route('success') . '/');\n $res['fields'] = [\n '.js-cart-count' => cartCount(),\n '.js-cart-sum' => cartSum(),\n '.js-order-phone' => $request->phone,\n '.js-order-name' => $request->name,\n ];\n $res['location'] = '/success';\n $res['popup'] = '#order-pop';\n } else {\n $res['location'] = '/';\n }\n return back();\n }",
"public function notifyTransferedPlayers(){\n \n Service::loadModels('rally', 'rally');\n $peopleService = parent::getService('people','people');\n $carService = parent::getService('car','car');\n $teamService = parent::getService('team','team');\n $marketService = parent::getService('market','market');\n $notificationService = parent::getService('user','notification');\n \n /*\n * Players\n */\n $offersNoBid = $marketService->getFinishedOffersNotNotifiedNoBid();\n foreach($offersNoBid as $offerNoBid):\n $notificationService->addNotification($offerNoBid['Player']['first_name'].\" \".$offerNoBid['Player']['last_name'].\" was not sold. Player will return to your team tomorrow\",3,$offerNoBid['Team']['User']['id']);\n $offerNoBid->set('notified',1);\n $offerNoBid->save();\n endforeach;\n \n $offers = $marketService->getFinishedOffersNotNotified();\n // 1. Zaplacenie za transfer przez kupujacego\n \n foreach($offers as $offer): \n foreach($offer['Bids'] as $key => $bid){\n if($key==0){\n $notificationService->addNotification($offer['Player']['first_name'].\" \".$offer['Player']['last_name'].\" was successfully sold. Player will leave your team tomorrow\",3,$offer['Team']['User']['id']);\n $notificationService->addNotification($offer['Player']['first_name'].\" \".$offer['Player']['last_name'].\" has been bought. Player will join your team tomorrow\",3,$bid['Team']['User']['id']);\n }\n else{\n $notificationService->addNotification($offer['Player']['first_name'].\" \".$offer['Player']['last_name'].\" has not been bought.\",3,$bid['Team']['User']['id']);\n }\n } \n \n \n $offer->set('notified',1);\n $offer->save();\n endforeach;\n /*\n * Cars\n */\n \n $caroffersNoBid = $marketService->getFinishedCarOffersNotMovedNoBid();\n foreach($caroffersNoBid as $offerNoBid):\n $notificationService->addNotification($offerNoBid['Car']['name'].\" was not sold. The car will return to your team tomorrow\",3,$offerNoBid['Team']['User']['id']);\n $offerNoBid->set('notified',1);\n $offerNoBid->save();\n endforeach;\n \n $caroffers = $marketService->getFinishedCarOffersNotMoved();\n // 1. Zaplacenie za transfer przez kupujacego\n // 2. OTrzymanie kasy przez sprzedajacego\n // 3. Zmiana teamu przez kupujacego\n // 4. Ustawienie oferty na player_moved\n foreach($caroffers as $offer):\n foreach($offer['Bids'] as $key => $bid){\n if($key==0){\n $notificationService->addNotification($offer['Car']['name'].\" was successfully sold. The car will leave your team tomorrow\",3,$offer['Team']['User']['id']);\n $notificationService->addNotification($offer['Car']['name'].\" has been bought. The car will join your team tomorrow\",3,$bid['Team']['User']['id']);\n }\n else{\n $notificationService->addNotification($offer['Car']['name'].\" has not been bought.\",3,$bid['Team']['User']['id']);\n }\n }\n $offer->set('notified',1);\n $offer->save();\n endforeach;\n \n echo \"done\";exit;\n }",
"public function assignOne(Request $request)\n {\n if ($request['employee_ID'] != null && $request['sn'] != null) {\n $employee = Employee::findOrFail($request['employee_ID']);\n $ppe = Ppe::findOrFail($request['sn']);\n if ($ppe->stock_ID != null) {\n $ppe->stock()->dissociate();\n }\n $ppe->employee()->associate($employee);\n $ppe->save();\n $propertieKeys = property_ppe::where('sn', $request['sn'])->get();\n $properties = array();\n if (count($propertieKeys) != 0) {\n foreach ($propertieKeys as $key) {\n $properties['properties'][] = Property::findOrFail($key['property_ID']);\n }\n } else {\n $properties['properties'][] = null;\n }\n\n $sizerKeys = sizerange_ppe::where('sn', $request['sn'])->get();\n $sizeranges = array();\n if (count($sizerKeys) != 0) {\n foreach ($sizerKeys as $key) {\n $range = array();\n $range = Size_Range::findOrFail($key['sizer_ID']);\n\n $range['sizes'] = Size::where('sizer_ID', $key['sizer_ID'])->get();\n $sizeranges[] = $range;\n }\n }\n\n $ppe['properties'] = $properties['properties'];\n $ppe['size_ranges'] = $sizeranges;\n return response()->json($ppe, 201);\n } else {\n return response()->json(['error' => 'No employee_ID or sn given in the request'], 404);\n }\n }"
] |
[
"0.606009",
"0.57359093",
"0.55929077",
"0.5572135",
"0.55550003",
"0.55527157",
"0.55466765",
"0.5532281",
"0.5531894",
"0.5522455",
"0.54305845",
"0.5395267",
"0.5390566",
"0.53898996",
"0.53858286",
"0.53610086",
"0.5341713",
"0.5338184",
"0.53298265",
"0.5313731",
"0.5284257",
"0.52660817",
"0.52448535",
"0.524482",
"0.52426714",
"0.5231625",
"0.52238834",
"0.52067715",
"0.52009475",
"0.51962316"
] |
0.7298293
|
0
|
Assign a Ppe to a Employee with the given ID and SN
|
public function assignOne(Request $request)
{
if ($request['employee_ID'] != null && $request['sn'] != null) {
$employee = Employee::findOrFail($request['employee_ID']);
$ppe = Ppe::findOrFail($request['sn']);
if ($ppe->stock_ID != null) {
$ppe->stock()->dissociate();
}
$ppe->employee()->associate($employee);
$ppe->save();
$propertieKeys = property_ppe::where('sn', $request['sn'])->get();
$properties = array();
if (count($propertieKeys) != 0) {
foreach ($propertieKeys as $key) {
$properties['properties'][] = Property::findOrFail($key['property_ID']);
}
} else {
$properties['properties'][] = null;
}
$sizerKeys = sizerange_ppe::where('sn', $request['sn'])->get();
$sizeranges = array();
if (count($sizerKeys) != 0) {
foreach ($sizerKeys as $key) {
$range = array();
$range = Size_Range::findOrFail($key['sizer_ID']);
$range['sizes'] = Size::where('sizer_ID', $key['sizer_ID'])->get();
$sizeranges[] = $range;
}
}
$ppe['properties'] = $properties['properties'];
$ppe['size_ranges'] = $sizeranges;
return response()->json($ppe, 201);
} else {
return response()->json(['error' => 'No employee_ID or sn given in the request'], 404);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function assign($objToAssign){\n if($this->ID != NULL and\n $objToAssign instanceof Employee and\n $objToAssign->ID != NULL){\n $myAssignment = new Assignment($this->ID, $objToAssign->ID);\n return $myAssignment->save();\n }\n }",
"function set_employee($emp)\n\t\t{\n\t\t\t$this->employee = $emp;\n\t\t}",
"function assignSingle()\n {\n /* If id == 0, we shall create a new record. */\n if ($this->id)\n {\n /* Query data of this person. */\n $this->dbQuerySingle();\n }\n else\n {\n /* Initialize default values. */\n $this->_setDefaults();\n /* Find out the first non-standard candidate id, that is, an id lower than 50000. */\n $rs = $this->dbQuery(\"SELECT max(id)+1 AS id FROM student WHERE id<50000\");\n if (!empty($rs))\n {\n $this->id = $this->rs['id'] = $rs[0]['id'];\n }\n }\n $this->assign_rs();\n }",
"public function assign(Employee $employee, Request $request)\n {\n $this->validate($request, [\n 'ars_id' => 'required|exists:arss,id',\n ]);\n\n Cache::forget('employees');\n Cache::forget('arss');\n\n $employee->update($request->only(['ars_id']));\n\n return $employee->loadLists();\n }",
"public function update_spouce() {\n $this->is_access('Employer');\n\n foreach ($_POST as $key=>$value) {\n $p[$key] = $this->linkID->real_escape_string($value);\n }\n\n\n\t\tif ($p['FirstName'] == \"\") {\n\t\t\t$err = \"1\";\n\t\t}\n\t\tif ($p['LastName'] == \"\") {\n\t\t\t$err = \"1\";\n\t\t}\n\t\tif ($p['EmailAddress'] == \"\") {\n\t\t\t$err = \"1\";\n\t\t}\n\n\t\tif ($err == \"1\") {\n\t\t\tprint \"<br><font color=red>One of the required fields was empty. You must enter in at least the first name, last name and email address. The email address must not be the same as the employee.</font><br><br>\";\n\t\t}\n\n\t\t$sql = \"SELECT `employeeID` FROM `spouse` WHERE `employeeID` = '$p[employeeID]'\";\n\t\t$result = $this->new_mysql($sql);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$found = \"1\";\n\t\t}\n\n\t\tif ($found == \"1\") {\n\t\t\t// update\n\t\t\tif ($p['SSN'] != \"\") {\n\t\t\t\t$ssn = \",`SSN` = '$p[SSN]'\";\n\t\t\t}\n\n\t\t\t$sql = \"UPDATE `spouse` SET `FirstName` = '$p[FirstName]', `MiddleName` = '$p[MiddleName]', `LastName` = '$p[LastName]',\n\t\t\t`Gender` = '$p[Gender]', `DOB` = '$p[DOB]', `EmailAddress` = '$p[EmailAddress]', `PhoneNumber` = '$p[PhoneNumber]',\n\t\t\t`Street` = '$p[Street]', `City` = '$p[City]', `State` = '$p[State]', `PostalCode` = '$p[PostalCode]',\n\t\t\t`WorkLocationCode` = '$p[WorkLocationCode]', `WorkLocationDescription` = '$p[WorkLocationDescription]'\n\n\t\t\t$ssn\n\t\t\tWHERE `employeeID` = '$p[employeeID]'\n\t\t\t\";\n\n\t\t} else {\n\t\t\t// insert\n\t\t\t$sql = \"INSERT INTO `spouse` (`employeeID`,`FirstName`,`MiddleName`,`LastName`,`SSN`,`Gender`,`DOB`,`EmailAddress`,`PhoneNumber`,\n\t\t\t`Street`,`City`,`State`,`PostalCode`,`WorkLocationCode`,`WorkLocationDescription`) \n\n\t\t\tVALUES ('$p[employeeID]','$p[FirstName]','$p[MiddleName]','$p[LastName]','$p[SSN]','$p[Gender]',\n\t\t\t'$p[DOB]','$p[EmailAddress]','$p[PhoneNumber]','$p[Street]','$p[City]','$p[State]','$p[PostalCode]',$p[WorkLocationCode],'$p[WorkLocationDescription]')\";\n\t\t}\n\t\t$result = $this->new_mysql($sql);\n\t\tif ($result == \"TRUE\") {\n\t\t\tprint \"<br><font color=green>The record was saved. Loading...</font><br>\";\n\t\t} else {\n\t\t\tprint \"<br><font color=red>The record failed to update. Loading...</font><br>\";\n\t\t}\n\n ?>\n <script>\n setTimeout(function() {\n document.location.href='employer.php?section=employees';\n }\n ,2000);\n </script>\n <?php\n\t}",
"function setEmployeeID($employeeid) {\n $this->employeeid = $employeeid;\n }",
"public function save()\n\t{\n\t\tglobal $ilDB;\n\n\t\t// sequence\n\t\t$this->setId($ilDB->nextId(\"adn_ep_assignment\"));\n \t$id = $this->getId();\n\n\t\t$fields = $this->propertiesToFields();\n\t\t$fields[\"id\"] = array(\"integer\", $id);\n\t\t\t\n\t\t$ilDB->insert(\"adn_ep_assignment\", $fields);\n\n\t\tparent::save($id, \"adn_ep_assignment\");\n\n\t\treturn $id;\n\t}",
"public function __construct(Employee $employee)\n {\n $this->employee = $employee ;\n }",
"function setAssignment($studentId, $subtaskId, $assignmentId, $fileId)\n {\n $this->student_id = $studentId;\n $this->subtask_id = $subtaskId;\n $this->assignment_id = $assignmentId;\n $this->file_id = $fileId;\n\n /* Store the record. */\n $this->dbReplace();\n }",
"public function __construct($employee)\n {\n $this->employee = $employee;\n }",
"public function AssignInstructor()\n\t{\t$this->act = new AdminInstructorAct($_GET['id']);\n\t\tif ($this->act->id)\n\t\t{\t$this->instructor = new AdminInstructor($this->act->details['inid']);\n\t\t} else\n\t\t{\t$this->instructor = new AdminInstructor($_GET['inid']);\n\t\t}\n\t}",
"public function setEmpId($val){\n\t\tif(intval($val) > 0){\n\t\t\t$this->employeeId = intval($val);\n\t\t}\t\t\n\t\treturn $this;\n\t}",
"public static function assign_user($targetitemid, $assigneeid, $assignerid) {}",
"public function AlterarProfessor($id,$nome,$rg,$cpf,$dtnasc,$endereco,$email,$telefone,$modalidade){\n $PDO = db_connect();\n $sql = \"UPDATE professor SET \n nm_professor = :nome,\n cpf_professor = :cpf,\n registro_geral_professor = :rg,\n nm_endereco = :endereco,\n dt_nascimento_professor = :dtnasc,\n cd_telefone_professor = :telefone, \n nm_email_professor = :email,\n nm_modalidade = :modalidade\n WHERE id_professor = :id\";\n\n $stmt = $PDO->prepare($sql);\n $stmt->bindParam(':nome',$nome);\n $stmt->bindParam(':cpf',$cpf);\n $stmt->bindParam(':rg',$rg);\n $stmt->bindParam(':endereco',$endereco);\n $stmt->bindParam(':dtnasc',$dtnasc);\n $stmt->bindParam(':telefone',$telefone);\n $stmt->bindParam(':email',$email);\n $stmt->bindParam(':modalidade', $modalidade);\n $stmt->bindParam(':id',$id, PDO::PARAM_INT);\n\n if($stmt->execute()){\n header('location: ../Views/professor.php');\n }else{\n echo $_SESSION['Error']=\"Erro ao alterar!\";\n print_r($stmt->errorInfo());\n }\n\t}",
"public function AssignIdentity($id, $Identity, $start, $end, $AdminName){\n try {\n $this->validateAssignParams($Identity, $start,$end);\n $this->accountGateway->AssignIdentity($id, $Identity, $start, $end, $AdminName);\n } catch (ValidationException $exc) {\n throw $exc;\n } catch (PDOException $e){\n throw $e;\n }\n }",
"public function save()\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$recordEmp = new Employee();\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tdie(\"Error: {$e->getMessage()}\");\n\t\t\t}\n\n\t\t\t$recordEmp->idEmployee = (int)htmlentities(addslashes($_POST['id']));\n\t\t\t$recordEmp->Name = htmlentities(addslashes($_POST['Name']));\n\t\t\t$recordEmp->Edad = htmlentities(addslashes($_POST['Edad']));\n\t\t\t$recordEmp->idArea = htmlentities(addslashes($_POST['idArea']));\n\n\t\t\t// if it has some phone record to add else it assigns a new empty array \n\t\t\t$recordEmp->telefonos = isset($_POST['Telefonos']) ? $_POST['Telefonos'] : array();\n\n\t\t\tif($recordEmp->uoriEmployee())\n\t\t\t{\n\t\t\t\theader('location: index.php');\n\t\t\t}\n\t\t}",
"public function save(\\Admin\\Model\\Employee $employee) {\n if ($employee->employee_id == 0) {\n // set date fields to now\n $d = new \\DateTime();\n $employee->date_created = $d->format(\"Y-m-d H:i:s\");\n $employee->date_modified = $d->format(\"Y-m-d H:i:s\");\n $employee->date_last_visited = \"0000-00-00 00:00:00\";\n if ($this->emailExists($employee->getEmail()))\n throw new \\Admin\\Exception(\"email already exists\");\n\n $this->tableGateway->insert($employee->getArrayCopy());\n $employee->employee_id = $this->tableGateway->lastInsertValue;\n } else {\n\n if ($employee = $this->getEmployee($id)) {\n $d = new \\DateTime();\n $new_employee->setDateCreated($employee->getDateCreated());\n $new_employee->setDateModified($d->format(\"Y-m-d H:i:s\"));\n $this->tableGateway->update($new_employee->toArray(), array('employee_id' => $id));\n }\n }\n }",
"function fetch_assign($employee_school_profile_id)\n\t\t{\n\t\t\treturn $this->db->query('select * from employee join driver_bus_route_assgn on employee.employee_profile_id = driver_bus_route_assgn.DBR_driver_id join bus on bus.bus_id = driver_bus_route_assgn.DBR_bus_id join route on route.route_id = driver_bus_route_assgn.DBR_route_no WHERE driver_bus_route_assgn.DBR_school_profile_id = '.$employee_school_profile_id.' AND driver_bus_route_assgn.DBR_expiry_date=\"9999-12-31\"')->result_array();\n\t\t}",
"function assignSingle()\n {\n $studentId = SessionDataBean::getUserId();\n $rs = $this->getSingle($studentId, $this->id);\n $this->_smarty->assign('assignment', $rs);\n return $rs;\n }",
"function allow_assign($sroleid, $troleid) {\n $record = new object;\n $record->roleid = $sroleid;\n $record->allowassign = $troleid;\n return insert_record('role_allow_assign', $record);\n}",
"public function Crear_Empre_Prov(,$Id_emp ,$EstadoUsu_Id_est_usu ,$Solicitud_empleado_idSolicitud ,$Name_emp ,$Email_emp ,$Pass_emp ,$Img_emp ,$Id_supvisor ,$Obser_emp ,$Edad_emp ){\n $this->Id_emp=$Id_emp;\n $this->EstadoUsu_Id_est_usu=$EstadoUsu_Id_est_usu;\n $this->Solicitud_empleado_idSolicitud=$Solicitud_empleado_idSolicitud;\n $this->Name_emp=$Name_emp;\n $this->Email_emp=$Email_emp;\n $this->Pass_emp=$Pass_emp;\n $this->Img_emp=$Img_emp;\n $this->Id_supvisor=$Id_supvisor;\n $this->Obser_emp=$Obser_emp;\n $this->Edad_emp=$Edad_emp;\n }",
"public function Crear_Empre_Prov(,$Id_emp ,$EstadoUsu_Id_est_usu ,$Solicitud_empleado_idSolicitud ,$Name_emp ,$Email_emp ,$Pass_emp ,$Img_emp ,$Id_supvisor ,$Obser_emp ,$Edad_emp ){\n $this->Id_emp=$Id_emp;\n $this->EstadoUsu_Id_est_usu=$EstadoUsu_Id_est_usu;\n $this->Solicitud_empleado_idSolicitud=$Solicitud_empleado_idSolicitud;\n $this->Name_emp=$Name_emp;\n $this->Email_emp=$Email_emp;\n $this->Pass_emp=$Pass_emp;\n $this->Img_emp=$Img_emp;\n $this->Id_supvisor=$Id_supvisor;\n $this->Obser_emp=$Obser_emp;\n $this->Edad_emp=$Edad_emp;\n }",
"public function __construct($id, $firstName, $lastName,\n $email, $phone, $reason,\n $date, $emp, $data) {\n $this->id =$id;\n $this->firstName = $firstName;\n $this->lastName = $lastName;\n $this->email = $email;\n $this->phone = $phone;\n $this->reason = $reason;\n $this->date = $date;\n $this->assnEmp = $emp;\n $this->data = $data;\n }",
"function AddTestee($testentryID, Profile $profile)\n {\n try\n {\n $firstNameIndex = $profile->GetFirstNameIndex();\n $lastNameIndex = $profile->GetLastNameIndex();\n $emailIndex = $profile->GetEmailIndex();\n $majorIndex = $profile->GetMajorIndex();\n $highSchoolIndex = $profile->GetHighSchoolIndex();\n $spokenAtHomeIndex = $profile->GetSpokenAtHomeIndex();\n \n $db = GetDBConnection();\n \n $query = 'INSERT INTO ' . GetTesteesIdentifier()\n . ' (' . GetTestIdIdentifier()\n . ', ' . $spokenAtHomeIndex\n . ', ' . $firstNameIndex\n . ', ' . $lastNameIndex\n . ', ' . $emailIndex\n . ', ' . $majorIndex\n . ', ' . $highSchoolIndex . ') VALUES'\n . ' (:' . GetTestIdIdentifier()\n . ', :' . $spokenAtHomeIndex\n . ', :' . $firstNameIndex\n . ', :' . $lastNameIndex\n . ', :' . $emailIndex\n . ', :' . $majorIndex\n . ', :' . $highSchoolIndex . ');';\n \n $statement = $db->prepare($query);\n $statement->bindValue(':' . GetTestIdIdentifier(), $testentryID);\n $statement->bindValue(':' . $spokenAtHomeIndex, $profile->GetSpokenAtHome());\n $statement->bindValue(':' . $firstNameIndex, $profile->GetFirstName());\n $statement->bindValue(':' . $lastNameIndex, $profile->GetLastName());\n $statement->bindValue(':' . $emailIndex, $profile->GetEmail());\n $statement->bindValue(':' . $majorIndex, $profile->GetMajor());\n $statement->bindValue(':' . $highSchoolIndex, $profile->GetHighSchool());\n \n $statement->execute();\n \n $statement->closeCursor();\n }\n catch (PDOException $ex)\n {\n LogError($ex);\n }\n }",
"public function AssignTestCase($pid, $tcID, $ts_id) {\n $this->load->model('project_model');\n $nSubject = new Notification_m();\n $nSubject->insertNotification($this->input->post('user'), $pid, \"Assign Test Case To Execute\", \"You have assigned for new test case to execute\", \"Assigned\", site_url() . \"engineer/assignedToMe_controller/LoadAssignedTestCase/$pid\");\n $nSubject->insertNotification($this->session->userdata('uid'), $pid, \"Assign Test Case To Execute\", \"You have assign a new test case to execute\", \"Assigned\", site_url() . \"manager/assignTestCases_controller\");\n $data = array(\n 'member_id' => $this->input->post('user'),\n 'psb_status' => 'Assign To Excecution',\n );\n $this->project_model->updateTCAssign($data, $tcID);\n redirect(\"manager/assignTestCases_controller/LoadTestCase/$pid/$ts_id\");\n }",
"private function assignSelf()\n {\n $user_id = $_SESSION['LOGIN_USER']['userId'];\n \n $ticket_id = $_REQUEST['ticket_id'];\n if(!$ticket_id)\n {\n echo '[{\"isError\":1, \"message\":\"No ticket ID given\"}]';\n exit;\n }\n \n $status_type = Utils::arrayAlterKeyValue(\n $GLOBALS['TICKET_STATUS_TYPE']\n );\n\n $sql = \"SELECT count(*) as total \n FROM \" . TICKET_ASSIGNMENTS_TBL . \" \n WHERE ticket_id = $ticket_id AND user_id = $user_id\";\n try\n {\n $rows = $this->db->select($sql);\n }\n catch(Exception $Exception){}\n if($rows)\n {\n if($rows[0]->total)\n {\n echo '[{\"isError\":1, \"message\":\"The ticket is already being assigned\"}]';\n exit;\n }\n }\n\n $data = array();\n $data['table'] = TICKETS_TBL;\n $data['data'] = array(\n 'status' => $status_type['assigned']\n );\n $data['where'] = \"ticket_id = \" . $ticket_id;\n try\n {\n $this->db->update($data);\n }\n catch(Exception $Exception){}\n \n $data = array();\n $data['table'] = TICKET_ASSIGNMENTS_TBL;\n $data['data'] = array(\n 'ticket_id' => $ticket_id,\n 'user_id' => $user_id,\n 'assigned_date' => date('Y-m-d H:i:s')\n );\n try\n {\n $this->db->insert($data);\n }\n catch(Exception $Exception){}\n \n //save log \n $this->saveLog(TICKET_ASSIGNMENT, $ticket_id, $user_id);\n \n echo '[{\"isError\":0, \"message\":\"The ticket has been assigned successfully\"}]';\n exit;\n }",
"protected function setNewMailPsw($email, $hashs, $id){\n \n $sql = \"UPDATE users SET email=?, hashs=? WHERE id = $id\"; //selecting from database\n $stmt = $this->connect()->prepare($sql); //istantiate a new statement and utilize $this coz i refer to database class and ask to the database to prepare it\n $stmt->execute([$email, $hashs]);\n\n \n }",
"function set_street_address($name='*', $suffix='*', $street_num='*', $apt_num='*')\r\n{\r\n\tif ( $this->debug ) $this->print_d(__FUNCTION__ . ' : set street address');\r\n\t\r\n\t// random apartment num\r\n\tif ( $apt_num == '*' ) $apt_num = $this->_get_random_apt_num();\r\n\t\r\n\t// random suffix (St, Ave, Blvd, etc.)\r\n\tif ( $suffix == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_SUFFIX = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$suffix = $_SUFFIX[1];\r\n\t\tif ( $this->debug ) $this->print_d(\"random suffix: $suffix\");\r\n\t}\r\n\t\r\n\t// random street name\r\n\tif ( $name == '*' )\r\n\t{\r\n\t\t$_LINE = $this->thresh_file($this->SOURCE['us_streets'], $ratio_denominator=1000, $this->SKIP_TOKENS);\r\n\t\t$_NAME = explode(',', $this->Randomizer->pick_random_array_item($_LINE));\r\n\t\t$name = $_NAME[0];\r\n\t\tif ( $this->debug ) $this->print_d(\"random name: $name\");\r\n\t}\r\n\t\r\n\t// street number (quick and dirty)\r\n\tif ( $street_num == '*' )\r\n\t{\r\n\t\t$street_num = mt_rand(1,12500);\r\n\t\tif ( $this->debug ) $this->print_d(\"random street number: $street_num\");\r\n\t}\r\n\t\r\n\t// set street prop\r\n\t$this->street_address = trim(ucwords(strtolower(\"$street_num $name $suffix $apt_num\")));\r\n\tif ( $this->debug ) $this->print_d(\"random street_address : {$this->street_address}\");\r\n\treturn;\r\n}",
"public function set_pessoa(Pessoa $object)\n {\n $this->pessoa = $object;\n $this->ref_pessoa = $object->id;\n }",
"public function callEmployeeDetail($pk)\n {\n return $this->call('team/detail', array('id' => $pk));\n }"
] |
[
"0.56478286",
"0.56390035",
"0.5570851",
"0.53028804",
"0.5207303",
"0.5201446",
"0.5175672",
"0.49478",
"0.49209225",
"0.48594627",
"0.4848802",
"0.48457274",
"0.48251396",
"0.48237026",
"0.48189023",
"0.48082164",
"0.48006675",
"0.47886667",
"0.4772056",
"0.47667265",
"0.47446764",
"0.47446764",
"0.47404906",
"0.47344902",
"0.4709391",
"0.46716338",
"0.46598896",
"0.46407187",
"0.46329182",
"0.46294373"
] |
0.589834
|
0
|
Unassign a Ppe from a Employee and put it in the Stock
|
public function unassignOne(Request $request)
{
if ($request['stock_ID'] != null && $request['sn'] != null) {
$stock = Stock::findOrFail($request['stock_ID']);
$ppe = Ppe::findOrFail($request['sn']);
if ($ppe->employee_ID != null) {
$ppe->employee()->dissociate();
}
$ppe->stock()->associate($stock);
$ppe->save();
$propertieKeys = property_ppe::where('sn', $request['sn'])->get();
$properties = array();
if (count($propertieKeys) != 0) {
foreach ($propertieKeys as $key) {
$properties['properties'][] = Property::findOrFail($key['property_ID']);
}
} else {
$properties['properties'][] = null;
}
$sizerKeys = sizerange_ppe::where('sn', $request['sn'])->get();
$sizeranges = array();
if (count($sizerKeys) != 0) {
foreach ($sizerKeys as $key) {
$range = array();
$range = Size_Range::findOrFail($key['sizer_ID']);
$range['sizes'] = Size::where('sizer_ID', $key['sizer_ID'])->get();
$sizeranges[] = $range;
}
}
$ppe['properties'] = $properties['properties'];
$ppe['size_ranges'] = $sizeranges;
return response()->json($ppe, 201);
} else {
return response()->json(['error' => 'No stock_ID or sn given in the request'], 404);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function unemploy(){\n unset($this->staffId);\n unset($this->store);\n $connection = new Connection();\n $link = $connection->connect();\n $link->exec(\"DELETE FROM staff WHERE user_id = '$this->id'\");\n $connection = null;\n }",
"public function unassignDepartment() {\n if($this->department)\n $this->department()->delete();\n }",
"public function unarchiveEmployee() {\n $id = request('employeeId');\n User::withTrashed()->find($id)->restore();\n return redirect('admin/archivedEmployees');\n }",
"public function unequip()\n {\n $this->equipped = 0;\n $this->Update();\n self::Log('unequpped', $this->char_id);\n }",
"public function desreservarStock(){\n $registrosReservas = ProductosTransacciones::obtenerTransacciones('pedido_id',$this->id_pedido);\n\n //Tengo que crear movimientos por reserva segun el stock disponible y prioridad de las bodegas\n foreach ($registrosReservas as $transaccion) {\n\n //Revierto transaccion\n $transaccion->revertir();\n\n }\n }",
"public function remove_assignment($objToAssign){\n if($this->ID != NULL and\n $objToAssign instanceof Employee and\n $objToAssign->ID != NULL){\n $myAssignment = new Assignment();\n $myAssignment = $myAssignment->get_by_task_DEV($this->ID, $objToAssign->ID);\n $myAssignment->delete();\n return $myAssignment;\n }\n }",
"public function destroy(Supply $supply)\n {\n //\n }",
"public function unExpressInterest($jobId) {\n require_once 'libs/DB.php';\n $conn = DB::connect();\n $userId = $this->id();\n $conn->exec(\"DELETE FROM job_interest WHERE job_id='$jobId' AND seeker_id='$userId'\");\n }",
"public function unsetInStockStockItems()\n {\n $this->_inStockStockItems = null;\n }",
"public function destroy(employee $employee)\n {\n //\n }",
"function remove_assignment($userid) {\n $result = delete_records('helpdesk_ticket_assignments', 'userid', $userid, 'ticketid', $this->id);\n if ($result) {\n $this->store();\n $urecord = get_record('user', 'id', $userid);\n $dat = new stdClass;\n $dat->ticketid = $this->id;\n $dat->notes = fullname($urecord) . ' ' .\n get_string('wasunassigned', 'block_helpdesk');\n $dat->status = HELPDESK_NATIVE_UPDATE_UNASSIGN;\n $dat->type = HELPDESK_UPDATE_TYPE_DETAILED;\n\n if(!$this->add_update($dat)) {\n notify(get_string('cantaddupdate', 'block_helpdesk'));\n }\n return $result;\n }\n }",
"public function updateSellIn(): void\n {\n $this->getItem()->sell_in--;\n }",
"public static function commandUnAssign(){\n\n self::$console->register('tasks:unassign')\n ->setDescription('Remove assigned user from a task')\n ->setDefinition(array(\n new InputArgument('taskid', InputArgument::REQUIRED, \"Task ID\"),\n new InputArgument('user', InputArgument::REQUIRED, \"User ID\")\n ))\n ->setCode(function (InputInterface $input, OutputInterface $output) {\n $taskid = (int) $input->getArgument(\"taskid\");\n $user = $input->getArgument(\"user\");\n\n if(!is_numeric($user)){\n //user didn't enter an id, search for the id by string:\n $usr = new UserCommands();\n $user = $usr->getUseridFromString($user);\n }\n\n $params = array(\n \"taskid\" => $taskid,\n \"userid\" => $user,\n \"modifyrecurrency\" => 0,\n \"isassignee\" => false,\n );\n $re = Task::AssignUserTask($params);\n print_r($re);\n\n });\n }",
"public function destroy(Emploitime $emploitime)\n {\n //\n }",
"public function removeFromInventory()\n {\n self::Log('removed from inventory', $this->char_id);\n $this->char_id = null;\n $this->Update();\n }",
"public function takeFromStock($quantity = 1) {\n $this->leftInStock = $this->leftInStock - $quantity;\n $this->save();\n }",
"public function logOffEmployee()\n {\n $this->destroyEmployeeHash($_SESSION[\"emp_id\"], $_SESSION[\"emp_hash\"]);\n $this->destroyEmployeeSession();\n }",
"public function remove (Product $product) {\n $basket = session()->get(\"basket\"); // On récupère le panier en session\n unset($basket[$product->id]); // On supprime le produit du tableau $basket\n session()->put(\"basket\", $basket); // On enregistre le panier\n}",
"public function destroy(Employee $employee)\n {\n //\n }",
"public function destroy(Employee $employee)\n {\n //\n }",
"public function destroy(Employee $employee)\n {\n //\n }",
"public function __unset( string $name ) {\n\t\t$this->data = array_diff_key( $this->data, [ $name => $this->data[ $name ] ] );\n\t}",
"public function updatedStateEmployee(){\n $this->clearTime();\n }",
"public function consumeEmployee(){\n if (count($this->eids)<1)\n return false;\n\n $id = $this->eids[count($this->eids)-1];\n unset($this->eids[count($this->eids)-1]);\n $this->shift->setEid($id);\n $this->shift->updateSQL();\n\n return true;\n }",
"final public function __unset($name)\n {\n throw new \\RuntimeException('The state of the object cannot be changed');\n }",
"public function restored(assignment $assignment)\n {\n //code...\n }",
"private function detach_order($order){\n foreach ($order->products as $product){\n $product->update([\n 'stock'=>$product->stock + $product->pivot->quantity,\n ]);\n $order->delete();\n }\n }",
"function nf_revertToOriginalOwner($id) {\n global $_TABLES;\n\n if (DB_count($_TABLES['nfproductionassignments'],'id',$id)) {\n $sql = \"SELECT uid,assignBack_uid FROM {$_TABLES['nfproductionassignments']} WHERE id=$id\";\n $currentProdRec = DB_fetchArray(DB_query($sql));\n\n $sql = \"UPDATE {$_TABLES['nfproductionassignments']} SET uid={$currentProdRec['assignBack_uid']},assignBack_uid=0 \";\n $sql .= \"WHERE id=$id \";\n DB_query($sql);\n }\n\n}",
"public function unshelve(array $shelf): void {\n\t\t$this->data = $shelf;\n\t\tDebug::log($this->data, 'Unshelving');\n\t}",
"public function restoring(assignment $assignment)\n {\n //code...\n }"
] |
[
"0.567711",
"0.55653393",
"0.5411853",
"0.5402963",
"0.5378249",
"0.53611857",
"0.53080624",
"0.5295553",
"0.5203728",
"0.5138158",
"0.51330775",
"0.4991981",
"0.49914175",
"0.49758545",
"0.495357",
"0.49422503",
"0.49115732",
"0.49109983",
"0.49010187",
"0.49010187",
"0.49010187",
"0.489793",
"0.48855042",
"0.4882591",
"0.48782498",
"0.48721147",
"0.48662806",
"0.48650187",
"0.48448765",
"0.484346"
] |
0.57893044
|
0
|
Updates a existing Ppe with given SN
|
public function updateOne(Request $req)
{
$request = null;
// Read in request objects
if (array_key_exists('psa', $req->all())) {
$request = $req['psa'];
} else {
return response()->json(['error' => 'Could not create Ppe (values has to be in a "psa" array)'], 400);
}
//return response()->json($request ,201);
$propertyRequest = array();
$sizerRequest = array();
if (array_key_exists('properties', $request)) {
$propertyRequest = $request['properties'];
}
if (array_key_exists('size_ranges', $request)) {
$sizerRequest = $request['size_ranges'];
}
if (empty($request)) {
return response()->json(['error' => 'Could not update Ppe'], 400);
}
// Create validator
$validator = Validator::make($request, Ppe::$rules);
//---------
//important Validations
//1. has sizerange at least one size
//2. are the sizes valid
//3. is the ppe valid
//4. are the given properties valid
//5. is given type for given attribute
//6. is the given SN already existing
//1.
if (!empty($sizerRequest)) {
foreach ($sizerRequest as $sizerReq) {
if ($sizerReq != null) {
if (!array_key_exists('sizes', $sizerReq) || count($sizerReq['sizes']) == 0) {
return response()->json(['error' => 'Could not create Ppe (one size of a size_range is needed)'], 400);
}
//2.
$validateSizes = $sizerReq['sizes'];
foreach ($validateSizes as $validateSize) {
$validatorSize = Validator::make($validateSize, Size::$rules);
if (!$validatorSize->passes()) {
return response()->json(['error' => 'Could not create Ppe (at least one size is not valid)'], 400);
}
}
}
}
}
//3.
if (!$validator->passes()) {
return response()->json(['error' => 'Could not create Ppe (some attributes are not valid)'], 400);
}
//4.
if (!empty($propertyRequest)) {
foreach ($propertyRequest as $property) {
if ($property != null) {
$validatorProperty = Validator::make($property, Property::$rules);
if (!($validatorProperty->passes())) {
return response()->json(['error' => 'Could not create Ppe (at least one property is not valid)'], 400);
}
//5.
$type = $property['type'];
switch ($type) {
case "value":
if (!array_key_exists('minValue', $property)) {
return response()->json(['error' => 'Could not create Ppe (ppes of type value need a value(minValue))'], 400);
} else if ($property['minValue'] === null) {
return response()->json(['error' => 'Could not create Ppe (ppes of type value need a value(minValue))'], 400);
}
break;
case "upValueRange":
if (!array_key_exists('minValue', $property) || !array_key_exists('maxValue', $property)) {
return response()->json(['error' => 'Could not create Ppe (ppes of type upValueRange need a min&maxValue)'], 400);
} else if ($property['minValue'] === null || $property['maxValue'] === null) {
return response()->json(['error' => 'Could not create Ppe (ppes of type upValueRange need a min&maxValue)'], 400);
}
break;
case "downValueRange":
if (!array_key_exists('minValue', $property) || !array_key_exists('maxValue', $property)) {
return response()->json(['error' => 'Could not create Ppe (ppes of type downValueRange need a min&maxValue)'], 400);
} else if ($property['minValue'] === null || $property['maxValue'] === null) {
return response()->json(['error' => 'Could not create Ppe (ppes of type downValueRange need a min&maxValue)'], 400);
}
break;
case "intervall":
if (!array_key_exists('intervall', $property)) {
return response()->json(['error' => 'Could not create Ppe (ppes of type intervall need a intervall value)'], 400);
} else if ($property['intervall'] == null) {
return response()->json(['error' => 'Could not create Ppe (ppes of type intervall need a intervall value != 0)'], 400);
}
break;
}
}
}
}
//6.
if (!array_key_exists('sn', $request)) {
return response()->json(['error' => 'Could not create Ppe (sn is missing)'], 400);
} else if ($request['sn'] == null) {
return response()->json(['error' => 'Could not create Ppe (sn is missing)'], 400);
}
//---------
$ppe = Ppe::findOrFail($request['sn']);
// Set Ppe with Pe
// Check for attributes
if (array_key_exists('state', $request)) {
$ppe->state = $request['state'];
}
if (array_key_exists('commissioningdate', $request)) {
$ppe->commissioningdate = $request['commissioningdate'];
}
if (array_key_exists('comment', $request)) {
$ppe->comment = $request['comment'];
}
// Set properties
$properties = array();
if (!empty($propertyRequest)) {
foreach ($propertyRequest as $property) {
if ($property != null) {
$prop = Property::findOrFail($property['property_ID']);
if (array_key_exists('text', $property) && $property['type'] == "text") {
$prop->text = $property['text'];
}
if (array_key_exists('date', $property) && $property['type'] == "date") {
$prop->date = $property['date'];
}
if (array_key_exists('minValue', $property) && ($property['type'] == "value" || $property['type'] == "downValueRange" || $property['type'] == "upValueRange")) {
$prop->minValue = $property['minValue'];
}
if (array_key_exists('maxValue', $property) && ($property['type'] == "downValueRange" || $property['type'] == "upValueRange")) {
$prop->maxValue = $property['maxValue'];
}
if (array_key_exists('intervall', $property) && $property['type'] == "intervall") {
$prop->minValue = $property['intervall'];
}
$prop->save();
$properties[] = $prop;
}
}
}
// Set Size Range
$size_ranges = array();
if (!empty($sizerRequest)) {
foreach ($sizerRequest as $sizerReq) {
if ($sizerReq != null) {
$sizer = Size_Range::findOrFail($sizerReq['sizer_ID']);
$size = $sizerReq['sizes'][0];
// Set Size
$sizeTemp = Size::where('sizer_ID', $sizerReq['sizer_ID'])->get()->first();
$sizeTemp->name = $size['name'];
$sizeTemp->save();
$newSize = Size::find($sizeTemp['size_ID']);
$sizer['sizes'] = $newSize;
$size_ranges[] = $sizer;
}
}
}
$ppe->save();
$ppe['properties'] = $properties;
$ppe['size_ranges'] = $size_ranges;
return response()->json($ppe, 201);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function update(Request $request, Ptpn $ptpn)\n {\n $request->validate([\n 'company' => 'required|max:150',\n 'company_code' => 'required|max:10',\n 'description' => 'required',\n 'address' => 'required'\n ],[\n 'company.max' => 'Maksimal 150 karakter !',\n 'company.required' => 'Kolom Nama Perusahaan harus diisi !',\n 'company_code.required' => 'Kolom Kode Perusahaan harus diisi !',\n 'company_code.max' => 'Maksimal 10 karakter !',\n 'description.required' => 'Kolom Deskripsi Perusahaan harus diisi !',\n 'address.required' => 'Kolom Alamat Perusahaan harus diisi !',\n ]);\n\n $ptpn->company = $request->company;\n $ptpn->company_code = $request->company_code;\n $ptpn->description = $request->description;\n $ptpn->address = $request->address;\n $ptpn->update();\n\n return redirect()->route('ptpn.index')->with('sukses', 'Data Perusahaan berhasil diubah !');\n }",
"public function update_spouce() {\n $this->is_access('Employer');\n\n foreach ($_POST as $key=>$value) {\n $p[$key] = $this->linkID->real_escape_string($value);\n }\n\n\n\t\tif ($p['FirstName'] == \"\") {\n\t\t\t$err = \"1\";\n\t\t}\n\t\tif ($p['LastName'] == \"\") {\n\t\t\t$err = \"1\";\n\t\t}\n\t\tif ($p['EmailAddress'] == \"\") {\n\t\t\t$err = \"1\";\n\t\t}\n\n\t\tif ($err == \"1\") {\n\t\t\tprint \"<br><font color=red>One of the required fields was empty. You must enter in at least the first name, last name and email address. The email address must not be the same as the employee.</font><br><br>\";\n\t\t}\n\n\t\t$sql = \"SELECT `employeeID` FROM `spouse` WHERE `employeeID` = '$p[employeeID]'\";\n\t\t$result = $this->new_mysql($sql);\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$found = \"1\";\n\t\t}\n\n\t\tif ($found == \"1\") {\n\t\t\t// update\n\t\t\tif ($p['SSN'] != \"\") {\n\t\t\t\t$ssn = \",`SSN` = '$p[SSN]'\";\n\t\t\t}\n\n\t\t\t$sql = \"UPDATE `spouse` SET `FirstName` = '$p[FirstName]', `MiddleName` = '$p[MiddleName]', `LastName` = '$p[LastName]',\n\t\t\t`Gender` = '$p[Gender]', `DOB` = '$p[DOB]', `EmailAddress` = '$p[EmailAddress]', `PhoneNumber` = '$p[PhoneNumber]',\n\t\t\t`Street` = '$p[Street]', `City` = '$p[City]', `State` = '$p[State]', `PostalCode` = '$p[PostalCode]',\n\t\t\t`WorkLocationCode` = '$p[WorkLocationCode]', `WorkLocationDescription` = '$p[WorkLocationDescription]'\n\n\t\t\t$ssn\n\t\t\tWHERE `employeeID` = '$p[employeeID]'\n\t\t\t\";\n\n\t\t} else {\n\t\t\t// insert\n\t\t\t$sql = \"INSERT INTO `spouse` (`employeeID`,`FirstName`,`MiddleName`,`LastName`,`SSN`,`Gender`,`DOB`,`EmailAddress`,`PhoneNumber`,\n\t\t\t`Street`,`City`,`State`,`PostalCode`,`WorkLocationCode`,`WorkLocationDescription`) \n\n\t\t\tVALUES ('$p[employeeID]','$p[FirstName]','$p[MiddleName]','$p[LastName]','$p[SSN]','$p[Gender]',\n\t\t\t'$p[DOB]','$p[EmailAddress]','$p[PhoneNumber]','$p[Street]','$p[City]','$p[State]','$p[PostalCode]',$p[WorkLocationCode],'$p[WorkLocationDescription]')\";\n\t\t}\n\t\t$result = $this->new_mysql($sql);\n\t\tif ($result == \"TRUE\") {\n\t\t\tprint \"<br><font color=green>The record was saved. Loading...</font><br>\";\n\t\t} else {\n\t\t\tprint \"<br><font color=red>The record failed to update. Loading...</font><br>\";\n\t\t}\n\n ?>\n <script>\n setTimeout(function() {\n document.location.href='employer.php?section=employees';\n }\n ,2000);\n </script>\n <?php\n\t}",
"function update_pinjam($no_po,$params)\n {\n $this->db->where('no_po',$no_po);\n return $this->db->update('pinjam',$params);\n }",
"public function update(Request $request, Snake $snake)\n {\n //\n }",
"public function testUpdate()\n\t{\n\t\t// Update just updates the given fields, let's the rest unchanged.\n\t\t// Use Replace to replace all fields.\n\t\t$updateProduct = [\n\t\t\t'description' => 'This is a product description.',\n\t\t\t'price' => 1150.00\n\t\t];\n\n\t\t$service = $this->getService();\n\n\t\t// Update product\n\t\t$this->mockResponseFromFile('products.update.success');\n\t\t$response = $service->update()->pin('AD8CCDD5F9')->area('work')->spn('MBA11')->product($updateProduct)->execute();\n\t\t$this->assertIsArray($response);\n\t\t$this->assertArrayHasKey('kind', $response);\n\t\t$this->assertArrayHasKey('link', $response);\n\t}",
"public function updatePen($penid, $penno, $fxn)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$query = \"UPDATE pen \r\n\t\t\t\t\t\t\tset pen_no = '\" .$penno. \"',\r\n\t\t\t\t\t\t\t\tfunction = '\" .$fxn. \"'\r\n\t\t\t\t\t\tWHERE pen_id = '\" . $penid. \"'\";\r\n\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t}",
"public function setPaySn($pay_sn)\n {\n $this->pay_sn = $pay_sn;\n\n return $this;\n }",
"public function update(Request $request, peserta $peserta)\n {\n //\n }",
"public function testUpdate()\n\t{\n\t\t$pessoa = $this->buildPessoa();\n\t\t$this->em->persist($pessoa);\n\n /**\n * pegando a pessoa salva no banco\n */\n\t\t$savedPessoa = $this->em->find('Usuario\\Entity\\Pessoa', $pessoa->getId());\n\t\t/**\n\t\t * Verificando se o nome da pessoa é Steve Jobs\n\t\t */\n\t\t$this->assertEquals('Steve Jobs', $savedPessoa->getNome());\n\n /**\n * alterando o nome da pessoa\n */\n $savedPessoa->setNome('Bill Gates');\n $this->em->flush();\n\n /**\n * Verificando alteracao\n */\n $savedPessoa = $this->em->find('Usuario\\Entity\\Pessoa', $pessoa->getId());\n $this->assertEquals('Bill Gates', $savedPessoa->getNome());\n\n\t}",
"public function update(Request $request, Penulis $penulis)\n {\n //\n }",
"public function update(Request $request, Pro $pro)\n {\n\n }",
"public function update(Request $request, Peserta $peserta)\n {\n //\n }",
"public function pesanan_update_proses($kode_pesanan)\n\t{\n\t\t$updata = array(\n\t\t\t'tanggal_pesanan' => $_POST['tanggal_pesanan'],\n\t\t\t'status_lunas' => $_POST['status_lunas']\n\t\t);\n\t\t\n\t\t// update execution\n\t\t$this->ModelsKedai->update(\"pesanan\",\"kode_pesanan\",$kode_pesanan,$updata);\n\t\t\n\t\t// goto pesanan page\n\t\tredirect('administrator/pesanan/1');\n\t}",
"public function testUpdatePayslip()\n {\n }",
"public function testUpdatePayslipByID()\n {\n }",
"public function update(Request $request, $DNI)\n {\n //\n // $articulos= Articulo::find($id);\n // $articulos->codigo = $request->get('codigo');\n // $articulos->descripcion = $request->get('descripcion');\n // $articulos->cantidad = $request->get('cantidad');\n // $articulos->precio = $request->get('precio');\n // // $articulos->save();\n\n\n\n $profesores= profesore::find($DNI);\n $DNI=$request->get('dni');\n $nombre=$request->get('nombre');\n $apellido=$request->get('apellido');\n $direccion=$request->get('direccion');\n $titulo=$request->get('titulo');\n $telefono=$request->get('telefono');\n DB:: update('update profesores set nombre=?, apellido=?, direccion=?, titulo=?, telefono=? where dni=?', [$nombre,$apellido,$direccion,$titulo,$telefono,$DNI]);\n return redirect('/profesores');\n }",
"public function assignOne(Request $request)\n {\n if ($request['employee_ID'] != null && $request['sn'] != null) {\n $employee = Employee::findOrFail($request['employee_ID']);\n $ppe = Ppe::findOrFail($request['sn']);\n if ($ppe->stock_ID != null) {\n $ppe->stock()->dissociate();\n }\n $ppe->employee()->associate($employee);\n $ppe->save();\n $propertieKeys = property_ppe::where('sn', $request['sn'])->get();\n $properties = array();\n if (count($propertieKeys) != 0) {\n foreach ($propertieKeys as $key) {\n $properties['properties'][] = Property::findOrFail($key['property_ID']);\n }\n } else {\n $properties['properties'][] = null;\n }\n\n $sizerKeys = sizerange_ppe::where('sn', $request['sn'])->get();\n $sizeranges = array();\n if (count($sizerKeys) != 0) {\n foreach ($sizerKeys as $key) {\n $range = array();\n $range = Size_Range::findOrFail($key['sizer_ID']);\n\n $range['sizes'] = Size::where('sizer_ID', $key['sizer_ID'])->get();\n $sizeranges[] = $range;\n }\n }\n\n $ppe['properties'] = $properties['properties'];\n $ppe['size_ranges'] = $sizeranges;\n return response()->json($ppe, 201);\n } else {\n return response()->json(['error' => 'No employee_ID or sn given in the request'], 404);\n }\n }",
"public function update(Request $request, ZoznamStn $zoznamStn)\n {\n //\n }",
"public function update(Request $request, Stipend $stipend)\n {\n //\n }",
"public function update(Request $request, Pemesanan $pemesanan)\n {\n //\n }",
"public function update(Request $request, Point $student_point)\n {\n //\n }",
"public function update(Request $request, Sprint $sprint)\n {\n //\n }",
"public function update($record);",
"public function edit(Snake $snake)\n {\n //\n }",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, ss $ss)\n {\n App\\ss::where('active',1)\n ->where('prijs','500')\n ->update('rented');\n }",
"function update(PDO $pdo) {\n\tif($this->profileId === null){\n\t\tthrow(new PDOException(\"unable to update profile that has no existence\"));\n\t}\n\t// create query template\n\t$query\t = \"UPDATE profile SET profileId = :profileId, profileContent = :profileContent, profileDate = :profileDate WHERE profileId = :profileId\";\n\t$statement = $pdo->prepare($query);\n\n\t// bind the member variables to the place holders in the template\n\t$formattedDate = $this->profileDate->format(\"Y-m-d H:i:s\");\n\t$parameters = array(\"profileId\" => $this->profileId, \"profileContent\" => $this->profileContent, \"tweetDate\" => $formattedDate, \"profileId\" => $this->profiletId);\n\t$statement->execute($parameters);\n}",
"function UpdateNote($note){\r\n $statement = new UpdateStatement(\"job_note\");\r\n $statement->addParameter(\"note_date\", $note->getNoteDate());\r\n $statement->addParameter(\"note_name\", $note->getNoteName());\r\n $statement->addParameter(\"note\", $note->getNote());\r\n $statement->where(\"id\", $note->getId());\r\n $statement->where(\"job_id\", $note->getJobId());\r\n $statement->executeStatement();\r\n }",
"public function update(Request $request, $sifPred)\n{\n $request->validate([\n 'sifPred'=>'required',\n 'nazPred'=> 'required'\n ]);\n\n $user = Pred::find($sifPred);\n $user->sifPred = $request->get('sifPred');\n $user->nazPred = $request->get('nazPred');\n $user->save();\n\n return redirect('/shares')->with('success', 'Stock has been updated');\n}",
"function update() {\n\t\t$sql = \"UPDATE \".$this->hr_db.\".hr_person_detail \n\t\t\t\tSET\tpsd_dp_id=?, psd_tax_no=?, psd_id_card_no=?, psd_passport_no=?, psd_picture=?, psd_blood_id=?, psd_reli_id=?, psd_nation_id=?, psd_race_id=?, psd_psst_id=?, psd_birthdate=?, psd_birth_pv_id=?, psd_gd_id=?, psd_account_no=?, psd_ba_id=?, psd_facebook=?, psd_twitter=?, psd_website=?, psd_email=?, psd_cellphone=?, psd_phone=?, psd_ex_phone=?, psd_work_phone=?, psd_lodge_id=?, psd_lodge_no=?, psd_lodge_phone=?, psd_addcur_no=?, psd_addcur_pv_id=?, psd_addcur_amph_id=?, psd_addcur_dist_id=?, psd_addcur_zipcode=?, psd_addhome_no=?, psd_addhome_pv_id=?, psd_addhome_amph_id=?, psd_addhome_dist_id=?, psd_addhome_zipcode=? \n\t\t\t\tWHERE psd_ps_id=?\";\t\n\t\t$this->hr->query($sql, array($this->psd_dp_id, $this->psd_tax_no, $this->psd_id_card_no, $this->psd_passport_no, $this->psd_picture, $this->psd_blood_id, $this->psd_reli_id, $this->psd_nation_id, $this->psd_race_id, $this->psd_psst_id, $this->psd_birthdate, $this->psd_birth_pv_id, $this->psd_gd_id, $this->psd_account_no, $this->psd_ba_id, $this->psd_facebook, $this->psd_twitter, $this->psd_website, $this->psd_email, $this->psd_cellphone, $this->psd_phone, $this->psd_ex_phone, $this->psd_work_phone, $this->psd_lodge_id, $this->psd_lodge_no, $this->psd_lodge_phone, $this->psd_addcur_no, $this->psd_addcur_pv_id, $this->psd_addcur_amph_id, $this->psd_addcur_dist_id, $this->psd_addcur_zipcode, $this->psd_addhome_no, $this->psd_addhome_pv_id, $this->psd_addhome_amph_id, $this->psd_addhome_dist_id, $this->psd_addhome_zipcode, $this->psd_ps_id));\t\n\t}"
] |
[
"0.53609353",
"0.53329825",
"0.52522075",
"0.5239191",
"0.52295536",
"0.520695",
"0.5166219",
"0.5135321",
"0.5101447",
"0.50750667",
"0.50600415",
"0.50388634",
"0.5036652",
"0.5028248",
"0.5021166",
"0.5018925",
"0.50131327",
"0.4998895",
"0.49877086",
"0.49664786",
"0.49593434",
"0.49542367",
"0.48956192",
"0.4886541",
"0.48711747",
"0.48652032",
"0.48402464",
"0.48337594",
"0.48324353",
"0.48153585"
] |
0.55053437
|
0
|
Move Hits for a particular search from NewHit to ArchiveHit
|
public function archiveHits($search_id) {
$this->move_using_params('ArchiveHit', array('SearchID'=>$search_id));
$this->optimize();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function ydgdict_specify_a_seach_destination( $where, $wp_query ) \n{\n if ( ! $wp_query->is_archive( 'entry' ) || ! $wp_query->is_search() || is_admin() ) return $where; // unchanged\n\n global $wpdb;\n\n /* \n * PART OF THE SQL QUERY READS \n * \n * WHERE 1=1 AND (\n * (\n * ( wp_posts.post_title LIKE %abc% ) OR -- THESE LINES --\n * )\n * )\n * \n * IF THERE ARE MORE THAN ONE SEARCH KEYWORDS IT WOULD LOOK SOMETHING LIKE THIS\n * \n * WHERE 1=1 AND (\n * (\n * ( wp_posts.post_title LIKE %abc% ) OR -- THESE LINES --\n * ) OR\n * (\n * ( wp_posts.post_title LIKE %xyz% ) OR -- THESE LINES --\n * )\n * )\n * \n * WE WANT TO DUPLCIATE THE LINE(S) CONTAINING THE SEACH TERM(S) \n * SWAPPING OUT wp_posts.post_title FOR $fields_to_include (defiend below)\n * \n * \n * DEPENDING ON WHERE WE SHOULD SEARCH ( 's_dest' )\n * WE'LL END UP WITH SOMETHING LIKE THIS\n * \n * WHERE 1=1 AND (\n * (\n * ( wp_posts.post_title LIKE %abc% ) OR\n * ( ydgdict_nouns.gender LIKE %abc% ) OR\n * ( ydgdict_nouns.plural LIKE %abc% ) OR\n * ) OR\n * (\n * ( wp_posts.post_title LIKE %xyz% ) OR\n * ( ydgdict_nouns.gender LIKE %xyz% ) OR\n * ( ydgdict_nouns.plural LIKE %xyz% ) OR\n * )\n * )\n */\n\n\n /* \n * SO... \n * \n * GET THE $the_line FROM $where\n * \n * EACH INSTANCE OF $the_line IS A DIFFERENT SEARCH KEYWORD and therefore a $line_to_copy\n */\n $field_to_replace = preg_quote( \"{$wpdb->posts}.post_title\" );\n\n // this was broken out into a function for use in another part below\n function get_the_line( $field )\n {\n return \"/\\(\\s*{$field}\\s+LIKE\\s+'.*?'\\)\\s*OR/\";\n }\n\n $the_line = get_the_line( $field_to_replace );\n\n preg_match_all( $the_line, $where, $lines_to_copy );\n\n $lines_to_copy = $lines_to_copy[0];\n /* \n * NOW WE HAVE\n * \n * $lines_to_copy: array(\n * [0] => '( wp_posts.post_title LIKE %abc% ) OR'\n * [1] => '( wp_posts.post_title LIKE %xyz% ) OR'\n * )\n */\n \n\n /* \n * DETERMINE WHICH FIELDS WE SHOULD INCLUDE IN THE SQL QUERY\n */\n switch ( $wp_query->get( 's_dest', 0 ) )\n {\n case 0: // EVERYWHERE\n $fields_to_include = array( \"verbs.pres_part\", \"verbs.past_part\", \"verbs.preterit\", \"verbs.aux\", \"nouns.gender\", \"nouns.plural\", \"ideas.idea\" );\n break;\n case 1: // JUST THE ENTRY (AND ITS FORMS)\n $fields_to_include = array( \"verbs.pres_part\", \"verbs.past_part\", \"verbs.preterit\", \"verbs.aux\", \"nouns.gender\", \"nouns.plural\" );\n break;\n case 2: // JUST THE IDEAS\n $fields_to_include = array( \"ideas.idea\" );\n break;\n }\n \n\n /* \n * FOR EACH OF THE $fields_to_include \n * CREATE A $new_line_to_insert INTO THE SQL QUERY \n * BY DUPLICATING EACH $line_to_copy \n * SWAPPING OUT $field_to_replace WITH $field_to_include\n */\n foreach ( $fields_to_include as $field_to_include )\n {\n foreach ( $lines_to_copy as $line_to_copy )\n {\n // CREATE THE LINE TO INSERT \n $new_line_to_insert = preg_replace( \"/{$field_to_replace}/\", $field_to_include, $line_to_copy, 1 );\n \n /* \n * AND INSERT IT INTO THE SQL QUERY\n * \n * BY REPLACING THE $line_to_copy WITH \n * $line_to_copy PLUS $new_line_to_insert\n */\n $line_to_copy = preg_quote( $line_to_copy );\n $where = preg_replace( \"/{$line_to_copy}/\", \"$0 \" . $new_line_to_insert, $where, 1 );\n }\n }\n\n /* \n * FINALLY, IF 'SEARCH JUST THE IDEAS' IS SELECTED\n * REMOVE $the_line (wp_posts.post_title) AND (wp_posts.post_excerpt) FROM THE QUERY\n */\n if ( $wp_query->get( 's_dest' ) == 2 )\n {\n // remove post_title\n $where = preg_replace( $the_line, '', $where, 1 );\n\n // remove post_excerpt\n $post_excerpt = get_the_line( \"{$wpdb->posts}.post_excerpt\");\n $where = preg_replace( $post_excerpt, '', $where, 1 );\n }\n // error_log( \"sql: \" . print_r( $where, true ) );\n\n return $where;\n}",
"function InPlaceCache_mergeParserOutputTo(&$dest, &$src)\r\n{\r\n\tInPlaceCache_mergeTo($dest->mLanguageLinks, $src->mLanguageLinks);\r\n\tInPlaceCache_mergeTo($dest->mCategories, $src->mCategories);\r\n\t$dest->mContainsOldMagic = $dest->mContainsOldMagic || $src->mContainsOldMagic;\r\n\tInPlaceCache_mergeTo($dest->mLinks, $src->mLinks);\r\n\tInPlaceCache_mergeTo($dest->mTemplates, $src->mTemplates);\r\n\tInPlaceCache_mergeTo($dest->mImages, $src->mImages);\r\n\tInPlaceCache_mergeTo($dest->mExternalLinks, $src->mExternalLinks);\r\n\tInPlaceCache_mergeTo($dest->mHeadItems, $src->mHeadItems);\r\n\tInPlaceCache_mergeTo($dest->mTemplateIds, $src->mTemplateIds);\r\n\tInPlaceCache_mergeTo($dest->mOutputHooks, $src->mOutputHooks);\r\n\t$dest->mNoGallery = $dest->mNoGallery || $src->mNoGallery;\r\n}",
"function admin_archive_posts($query){\n \n global $pagenow;\n \n if (!is_admin() || !$query->is_main_query() || $pagenow !== 'edit.php' || $query->get('post_type') !== $this->post_type)\n return;\n \n $query->set('meta_key', 'position');\n $query->set('orderby', 'meta_value_num title');\n $query->set('order', 'ASC');\n \n }",
"function nicholls_move_search_title() {\n\t// Website Title\n\tremove_action( 'fnbx_header', 'fnbx_default_title' );\n\t// Website Description\n\tremove_action( 'fnbx_header', 'fnbx_default_description' );\n\t// Entry title\n\tremove_action( 'fnbx_template_loop_entry_title', 'fnbx_entry_title' );\n\t// Move the entry-title\n\tadd_action( 'fnbx_header', 'fnbx_entry_title' );\n}",
"function merge($p_archive_to_add)\n {\n }",
"function execute(){\n\t\tcanonicalizeNQL($this->source->getDocument(),$this->source->getFirstChild()->getPath());\n\t\tcanonicalizeNQL($this->destination->getDocument(),$this->destination->getFirstChild()->getPath());\n\t\t\n\t\t// creating a third XML with only the root of the request, to copy the merging into it\n\t\t$operation = $this->source->nodename();\n\t\t$source_elementNode = $this->source->getFirstChild();\n\t\t$element = $source_elementNode->nodename();\n\t\t$this->query_final = new XML($this->source->toString());\n\t\t\n\t\t$this->query_final->removeChild('/*[1]/*[1]/INFO');\n\t\t$final_operationNode = $this->query_final->getElement('/*[1]');\n\t\t$final_elementNode = $this->query_final->getElement('/*[1]/*[1]');\n\t\t\n\t\t// mixing the INFO nodes\n\t\t$this->handleInfoNode();\n\t\t\n\t\t// copying SORT, PAGINATE, etc\n\t\t// first removing the existing one\n\t\tif($final_operationNode->getElement('SORT') && $this->destination->getElement('SORT')){\n\t\t\t$final_operationNode->removeChild('/SORT');\n\t\t}\n\t\tif($final_operationNode->getElement('PAGINATE') && $this->destination->getElement('PAGINATE')){\n\t\t\t$final_operationNode->removeChild('/PAGINATE');\n\t\t}\n\t\tif($final_operationNode->getElement('RETURN') && $this->destination->getElement('RETURN')){\n\t\t\t$final_operationNode->removeChild('/RETURN');\n\t\t}\n\t\t\n\t\t$nodes_to_import = $this->destination->getElements('/*[position()>1]');\n\t\tforeach($nodes_to_import as $node){\n\t\t\t$final_operationNode->appendChild($node->toString());\n\t\t}\n\t\t\n\t\t// copying other crits than INFO : DESCRIPTION, CATGEORY, DEPENDENCY\n\t\t//$final_elementNode->appendChild($this->destination->getFirstChild()->copyOf('/*[name()!=\"INFO\"]'));\n\t\t$other_children = $this->destination->getFirstChild()->getElements('/*[name()!=\"INFO\"]');\n\t\tforeach($other_children as $node){\n\t\t\t$final_elementNode->appendChild($node->toString());\n\t\t}\n\t\t\n\t\tquery_log($this->query_final->toString());\n\t\treturn $this->query_final;\n\t\treturn false;\n\t}",
"function _archiveFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_archivePath, $this->_claimedFilename);\n\t}",
"public function buildSearchResultEntry() {\n\t\t$this->sortBy('viewOrder');\n\t\t$outputObject = array();\n\t\t$foundFirst = false;\n\t\t$uploadCount = 0;\n\t\t$rootTitleArray = $this->getAssetTitle();\n\t\t$outputObject['title'] = array_shift($rootTitleArray); // only show the first title\n\t\tforeach($this->assetObjects as $assetKey=>$assetObject) {\n\t\t\tif($assetObject->getDisplayInPreview() && get_class($assetObject) != \"Upload\") {\n\n\t\t\t\t// check to make sure this isn't the same value we used as the title\n\t\t\t\t// we'll handle it for related_asset later, for better perf\n\t\t\t\tif(get_class($assetObject) !== \"Related_asset\") {\n\t\t\t\t\t$entryAsText = $assetObject->getArrayOfText(false);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$entryAsText = array();\n\t\t\t\t}\n\n\t\t\t\tif(array_shift($entryAsText) != $outputObject['title'] && $assetObject->hasContents()) {\n\t\t\t\t\t/**\n\t\t\t\t\t * ok, I really really don't want to have a special case here. Ok?\n\t\t\t\t\t * but I also don't want to fork the widget API.\n\t\t\t\t\t */\n\n\t\t\t\t\tif(get_class($assetObject) == \"Related_asset\") {\n\t\t\t\t\t\t$titleArray = array();\n\t\t\t\t\t\t$maxCount = 3;\n\t\t\t\t\t\t$count = 0;\n\t\t\t\t\t\tforeach($assetObject->fieldContentsArray as $entry) {\n\t\t\t\t\t\t\tif($count > $maxCount) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$titleArray[] = $entry->getRelatedObjectTitle();\n\t\t\t\t\t\t\t$count++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($outputObject['title'] == reset($titleArray[0])) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach($titleArray as $key=>$value) {\n\t\t\t\t\t\t\t$titleArray[$key] = join(\", \", $value);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$outputObject['entries'][] = [\"label\"=>$assetObject->getLabel(), get_class($assetObject)=>true, \"entries\"=>$titleArray];\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$outputObject['entries'][] = [\"label\"=>$assetObject->getLabel(), get_class($assetObject)=>true, \"entries\"=>$assetObject->getArrayOfText(false)];\n\t\t\t\t\t}\n\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t/**\n\t\t * We've cached the upload count for nested elements, so we can use that to draw the little eyeball, in\n\t\t * addition to any display elements or first level uploads.\n\t\t */\n\t\t$nestedUploadCount = 0;\n\t\tforeach($this->assetObjects as $assetObject) {\n\t\t\tif(get_class($assetObject) == \"Related_asset\") {\n\t\t\t\tforeach($assetObject->fieldContentsArray as $entry) {\n\t\t\t\t\tif(!$relatedAsset = $entry->getRelatedAsset()) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tforeach($relatedAsset->getAllWithinAsset(\"Upload\") as $uploadWidget) {\n\t\t\t\t\t\t$nestedUploadCount += count($uploadWidget->fieldContentsArray);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif(get_class($assetObject) == \"Upload\") {\n\t\t\t\t$nestedUploadCount += count($assetObject->fieldContentsArray);\n\t\t\t}\n\t\t}\n\n\t\t$uploadCount += $nestedUploadCount;\n\t\tif($uploadCount > 1) {\n\t\t\t$outputObject[\"fileAssets\"] = $uploadCount;\n\t\t}\n\n\t\t$locationAssets = $this->getAllWithinAsset(\"Location\", $this, 1);\n\t\t$locationArray = array();\n\t\tforeach($locationAssets as $location) {\n\t\t\tif($location->getDisplay() && $location->getSearchable()) {\n\t\t\t\t$locationArray[] = [\"label\"=>$location->getLabel(), \"entries\"=>$location->getAsArray(false)];\n\t\t\t}\n\t\t}\n\t\t$outputObject['locations'] = $locationArray;\n\n\t\t$dateAssets = $this->getAllWithinAsset(\"Date\",$this, 1);\n\t\t$dateArray = array();\n\t\tforeach($dateAssets as $dateAsset) {\n\t\t\tif($dateAsset->getDisplay() && $dateAsset->getSearchable()) {\n\t\t\t\t$dateArray[] = [\"label\"=>$dateAsset->getLabel(), \"dateAsset\"=>$dateAsset->getAsArray(false)];\n\t\t\t}\n\t\t}\n\t\t$outputObject['dates'] = $dateArray;\n\n\n\t\t$uploadAssets = $this->getAllWithinAsset(\"Upload\", $this, 0);\n\t\tforeach($uploadAssets as $upload) {\n\t\t\tif($upload->getDisplay()) {\n\n\t\t\t\t$entryArray = array();\n\t\t\t\t$dateArray = array();\n\t\t\t\t$limit = 0;\n\t\t\t\tforeach($upload->fieldContentsArray as $fieldContent) {\n\t\t\t\t\tif($limit > 10) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$limit++;\n\n\t\t\t\t\t$fieldContent->extractLocation = $upload->extractLocation; // this is wrong, should use a method on the widget\n\t\t\t\t\t$fieldContent->extractDate = $upload->extractDate;\n\n\t\t\t\t\tif($fieldContent->getLocationData()) {\n\t\t\t\t\t\t$entryArray[] = $fieldContent->getAsArray(false);\n\n\t\t\t\t\t}\n\t\t\t\t\tif($fieldContent->getDateData()) {\n\t\t\t\t\t\t$dateArray[] = $fieldContent->getAsArray(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(count($entryArray)>0) {\n\t\t\t\t\t$outputObject['locations'][] = [\"label\"=>$upload->getLabel(), \"entries\"=>$entryArray];\n\t\t\t\t}\n\t\t\t\tif(count($dateArray)> 0) {\n\t\t\t\t\t$outputObject['dates'][] = [\"label\"=>$upload->getLabel(), \"dateAsset\"=>$dateArray];\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t$outputObject[\"objectId\"] = $this->getObjectId();\n\n\t\tif($this->getGlobalValue(\"modified\")) {\n\t\t\t$outputObject[\"lastModified\"] = $this->getGlobalValue(\"modified\")->format('Y-m-d H:i:s');\n\t\t}\n\t\telse {\n\t\t\t$outputObject[\"lastModified\"] = \"\";\n\t\t}\n\t\t\n\n\t\ttry {\n\t\t\t$fileHandler = false;\n\n\t\t\t$fileHandler = $this->getPrimaryFilehandler();\n\t\t\t$outputObject[\"primaryHandlerType\"] = get_class($fileHandler);\n\t\t\t$outputObject[\"primaryHandlerId\"] = $fileHandler->getObjectId();\n\t\t\t$outputObject[\"primaryHandlerThumbnail\"] = $fileHandler->getPreviewThumbnail()->getURLForFile(true);\n\t\t\t$outputObject[\"primaryHandlerThumbnail2x\"] = $fileHandler->getPreviewThumbnail(true)->getURLForFile(true);\n\t\t\t$outputObject[\"primaryHandlerTiny\"] = $fileHandler->getPreviewTiny()->getURLForFile(true);\n\t\t\t$outputObject[\"primaryHandlerTiny2x\"] = $fileHandler->getPreviewTiny(true)->getURLForFile(true);\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t// don't need to do anything, might not have a handler, that's ok.\n\t\t}\n\n\t\treturn $outputObject;\n\n\t}",
"function fumseck_add_cpt_search( $query ) {\n\tif ( ($query->is_search || $query->is_archive) && ! is_admin() )\n\t\t$query->set( 'post_type', array( 'post', 'batbelt_project', 'batbelt_event' ) );\n\treturn $query;\n}",
"function duplicate($p_archive)\n {\n }",
"protected function thenExistingDocumentWasArchived()\n {\n }",
"public function registerHit($query, $bundle, $target, $count = 1)\n {\n $searchHit = new $this->entities['search_hit']['class']();\n $searchHit->setQuery($query)\n ->setBundle($bundle)\n ->setTarget($target);\n\n if ($count > 1) {\n for ($i=0; $i<$count; $i++) {\n $this->om->persist(clone $searchHit);\n }\n }\n\n $this->om->persist($searchHit);\n $this->om->flush();\n }",
"public function merge_with(&$other)\r\n {\r\n foreach ($other->entries as $entry) {\r\n $this->entries[$entry->key()] = $entry;\r\n }\r\n }",
"public function modifyQuery($query, SearchTerm $search);",
"public function apply() {\n\t\t$prepLookup = clone $this->oLookup;\n\n\t\t$size = $this->oLookup->getSize();\n\n\t\t// Prepare preprocessor query\n\t\t$prepLookup->setSize( $size );\n\t\t$prepLookup->clearSourceField();\n\t\t$prepLookup->addSourceField( 'basename' );\n\t\t$prepLookup->addSourceField( 'namespace' );\n\t\t$prepLookup->addSourceField( 'prefixed_title' );\n\n\t\t$excludes = [];\n\n\t\t$this->getExcludesForCurrentPage( $prepLookup, $size, $excludes );\n\n\t\tif ( empty( $excludes ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Add result _ids to exclude from the search\n\t\t$this->oLookup->addBoolMustNotTerms( '_id', $excludes );\n\t}",
"function resetHits($id)\r\n\t{\r\n\t\t$row =& $this->getTable('flexicontent_items', '');\r\n\t\t$row->load($id);\r\n\t\t$row->hits = 0;\r\n\t\t$row->store();\r\n\t\t$row->checkin();\r\n\t\treturn $row->id;\r\n\t}",
"public function update($techHit);",
"function replace_original_search_query() {\n\t\tglobal $wp_query;\n\n\t\tif ( ! empty( $this->original_query ) ) {\n\t\t\t$wp_query->set( 's', $this->original_query );\n\t\t}\n\t}",
"public function updatingSearch()\n {\n $this->gotoPage(1);\n }",
"public function postprocessSearchResults(array &$response, SearchApiQuery $query) {\n // Postprocessing is done in exactly the opposite direction than preprocessing.\n foreach (array_reverse($this->getProcessors()) as $processor) {\n $processor->postprocessSearchResults($response, $query);\n }\n return $this;\n }",
"public function bake()\n {\n $result = array();\n \n foreach( $this->searchResult as $line )\n {\n $id = $line[ 'id' ];\n $title = $line[ 'title' ];\n $score = $line[ 'score' ];\n $name = $line[ 'name' ];\n $value = self::highlight( $this->searchString , $line[ 'value' ] );\n \n if ( ! array_key_exists( $id , $result ) )\n {\n $result[ $id ][ 'score' ] = 0;\n }\n \n $result[ $id ][ 'title' ] = $title;\n $result[ $id ][ 'matches' ][ $name ] = $value;\n $result[ $id ][ 'score' ] += $score;\n }\n \n $sortedResult = array();\n \n foreach( $result as $id => $datas )\n {\n $sortedResult[ $datas[ 'score' ] ][ $id ] = array( 'title' => $datas[ 'title' ]\n , 'matches' => $datas[ 'matches' ] );\n }\n \n krsort( $sortedResult );\n \n return $this->bakedResult = $sortedResult;\n }",
"public function modifyDAMIndexEntry(&$title, &$abstract, &$fullContent, &$params, &$tags, $damRecord, $targetPID, &$clearTextTags, &$additionalFields) {\r\n\t\tif(isset($damRecord['crdate']) && $damRecord['crdate'] > 0) {\r\n\t\t\t$additionalFields['sortdate'] = $damRecord['crdate'];\r\n\t\t}\r\n\t\t// if TYPO3 sets last changed\r\n\t\tif(isset($damRecord['file_ctime']) && $damRecord['file_ctime'] > 0) {\r\n\t\t\t$additionalFields['sortdate'] = $damRecord['file_ctime'];\r\n\t\t}\r\n\t\t// if TYPO3 sets last changed\r\n\t\tif(isset($damRecord['file_mtime']) && $damRecord['file_mtime'] > 0) {\r\n\t\t\t$additionalFields['sortdate'] = $damRecord['file_mtime'];\r\n\t\t}\r\n\r\n\t\t// fill orig_uid\r\n\t\tif(isset($damRecord['uid']) && $damRecord['uid'] > 0) {\r\n\t\t\t$additionalFields['orig_uid'] = $damRecord['uid'];\r\n\t\t}\r\n\t\t// fill orig_pid\r\n\t\tif(isset($damRecord['pid']) && $damRecord['pid'] > 0) {\r\n\t\t\t$additionalFields['orig_pid'] = $damRecord['pid'];\r\n\t\t}\r\n\t}",
"public function updatingSearch()\n {\n $this->resetPage();\n }",
"function catch_search( &$query ) {\n\tif ( !is_admin() && $query->is_main_query() ) :\n\t\tif ( isset( $_GET['buscar'] ) ) :\n\t\t\t$query->set( 'posts_per_page', 4 );\n\t\t\t$query->set( 'es_busqueda_vivienda', 1 );\n\t\tendif;\n\tendif;\n\t//remove_action( 'pre_get_posts', 'custom_post_author_archive' ); // run once!\n}",
"public function insert($techHit);",
"function filter_search($query) {\n if ($query->is_search) {\n\t$query->set('post_type', array('post', 'issue'));\n };\n return $query;\n}",
"function cera_grimlock_search_post() {\n\t\tdo_action( 'grimlock_search_post' );\n\t}",
"public function modifySearch(Search $search, FilterState $state = null, SearchRequest $request = null);",
"protected function importFromSearch()\n {\n $api = $this->_getSearchAPI();\n\n for ($i = 1; $i <= self::MAX_PAGES; $i++) {\n Minion_CLI::write(\"Searching page $i...\");\n\n $response = $api->find(self::SEARCH_TERM, array('start_page' => $i));\n $results = $response['repositories'];\n $this->_saveResults($results);\n\n if (count($results) < self::PER_PAGE) {\n break;\n }\n }\n\n Minion_CLI::write('Finished.');\n }",
"public function upsertToIndex(Searchable $subject)\n {\n $this->elasticsearch->index(\n [\n 'index' => $this->indexName,\n 'type' => $subject->getSearchableType(),\n 'id' => $subject->getSearchableId(),\n 'body' => $subject->getSearchableBody(),\n ]\n );\n }"
] |
[
"0.53093475",
"0.48687628",
"0.47783616",
"0.46289054",
"0.45384017",
"0.44920036",
"0.44911525",
"0.44823036",
"0.4441043",
"0.4435913",
"0.43831778",
"0.43673226",
"0.43596262",
"0.4333806",
"0.43212464",
"0.43106177",
"0.42983156",
"0.42879435",
"0.42640814",
"0.42403388",
"0.42379954",
"0.4232731",
"0.42293504",
"0.42261058",
"0.42258498",
"0.41987225",
"0.41680947",
"0.41340306",
"0.41227746",
"0.4116236"
] |
0.6773551
|
0
|
Exercises the basic functionality of the getSalaryDateForMonth function
|
public function testGetSalaryDateForMonth($month, $year, $expected)
{
$actualDate = DateCalculator::getSalaryDateForMonth($month, $year);
$this->assertSame(
$expected,
$actualDate->format('Y-m-d')
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getSalaryDate(int $year, int $month, array $weekEnds): string\n {\n $monthEnd = date('t-m-Y', strtotime(sprintf('%d-%d-1', $year, $month)));\n $monthEndDay = date('l', strtotime($monthEnd));\n\n if (false !== ($position = array_search($monthEndDay, $weekEnds))) {\n $monthEnd = date('d-m-Y', strtotime(sprintf('%s - %d day', $monthEnd, ($position + 1))));\n }\n\n return $monthEnd;\n }",
"public function computeSalary()\n {\n /**\n * Payments are done every 15th and 30th of every month\n * For 15th:\n * Day 1 to 14th of the month plus day 30 and 31st of the previous month\n * For 30th:\n * Day 15th to 29th\n */\n\n // check if today is the 15th or 30th / 28th for Feb\n $today = new \\DateTime();\n $day_today = $today->format( 'd' );\n $is_leap_year = intval( date('Y') ) % 4 == 0;\n\n // compute salary only on the 15th and the 30th\n if( $day_today == 15 ){\n // get teacher whose salary was not computed yet\n $teachers = ( new TeacherPivot )->getSalaryUnprocessedAsOf( $today->format('Y-m-d') );\n foreach( $teachers as $teacher ){\n $teacher->processDailyIncome();\n }\n }elseif( $day_today == 30 ){\n\n }elseif( $day_today == 28 && date('m') == 2 && !$is_leap_year ){\n\n }elseif( $day_today == 29 && date('m') == 2 && $is_leap_year ){\n\n }\n\n }",
"public function takePostBaseOnMonth();",
"public function get_month_permastruct()\n {\n }",
"private function _daysInMonth($month=null,$year=null){\n \n if(null==($year))\n $year = date(\"Y\",time()); \n \n if(null==($month))\n $month = date(\"m\",time());\n \n return date('t',strtotime($year.'-'.$month.'-01'));\n }",
"public function getMonthlyInstalment();",
"function GetSalaryMonthList($type = NULL) {\n $companyid = $this->companyID;\n $emp_seqno = $this->empSeqNo;\n //得到登陆员工的计薪期间代码 add by Jack\n $period_master_id = $this->DBConn->GetOne(\"select period_master_id from hr_personnel where id = '\" . $emp_seqno . \"'\");\n $_where = is_null($type) ? \" and period_master_id = nvl('\" . $period_master_id . \"', period_master_id)\" : \"\";\n\n $sql_string = <<<_LeaveYearList_\n select distinct mm as mm1,\n mm as mm2\n from hr_period_detail\n where seg_segment_no = '$companyid'\n $_where\n order by mm asc\n_LeaveYearList_;\n return $this->DBConn->GetArray($sql_string);\n }",
"public function calculateSalaryDay()\n {\n /**\n * (numberOfDays + indexOfFirstDay + 6) mod 7\n * gives you the numeric representation of the last day of the month \n */\n $lastDay = ($this->_numberOfDays + $this->_startsOn + 6) % 7;\n if ($lastDay == 0) {\n return $this->_numberOfDays - (7 - $this->_altSalaryDay);\n } else if ($lastDay == 6) {\n return $this->_numberOfDays - (6 - $this->_altSalaryDay);\n } else {\n return $this->_numberOfDays;\n }\n }",
"public function get_month($month_number)\n {\n }",
"public function testCanGetBirthMonth() : void\n {\n $this->assertSame('02', $this->personalCodeObj->getBirthMonth());\n\n $formatsAndExpectedValues = [\n 'F' => 'February', // A full textual representation of a month, such as January or March\n 'M' => 'Feb', // A short textual representation of a month, three letters\n 'n' => 2, // Numeric representation of a month, without leading zeros\n 't' => 28, // Number of days in the given month\n ];\n\n foreach ($formatsAndExpectedValues as $format => $expectedValue) {\n $this->assertEquals($expectedValue, $this->personalCodeObj->getBirthMonth($format));\n }\n }",
"function checkRenewalMonth($renewal_month)\n{\n //this is the full text version of the months as dictated by PHP functions\n if ($renewal_month !== date(\"F\"))\n {\n return \"Welcome!\";\n } else {\n return \"Time to renew\";\n }\n}",
"public function addMonths($month){\n\t\t$month = abs($month);\n\t\tif($this->_month+$month>12){\n\t\t\t$year = ceil(($month+$this->_month)/12) - 1;\n\t\t\t$this->_month = ($year * 12) - $this->_month + $month;\n\t\t\t$this->_year+= $year;\n\t\t} else {\n\t\t\t$this->_month+=$month;\n\t\t}\n\t\tif($this->_day>30||($this->_day>28&&$this->_month==2)){\n\t\t\t$this->_day = substr(self::getLastDayOfMonth($this->_month, $this->_year),-2);\n\t\t}\n\t\t$this->_consolideDate();\n\t\treturn $this->_date;\n\t}",
"function date_month($month) {\n\tswitch ($month) {\n\t\tcase 1:\n\t\t\techo \"Януари\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\techo \"Февруари\";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\techo \"Март\";\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\techo \"Април\";\n\t\t\tbreak;\n\t\tcase 5:\n\t\t\techo \"Май\";\n\t\t\tbreak;\n\t\tcase 6:\n\t\t\techo \"Юни\";\n\t\t\tbreak;\n\t\tcase 7:\n\t\t\techo \"Юли\";\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\techo \"Август\";\n\t\t\tbreak;\n\t\tcase 9:\n\t\t\techo \"Септември\";\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\techo \"Октомври\";\n\t\t\tbreak;\n\t\tcase 11:\n\t\t\techo \"Ноември\";\n\t\t\tbreak;\n\t\tcase 12:\n\t\t\techo \"Декември\";\n\t\t\tbreak;\n\t}\n}",
"public static function getMonth(){\n\t\t// this represents the number of seconds ni a month\n\t\t// editing this will lead to false values\n\t\treturn 2419200;\n\t}",
"function daysInMonth( $month=0, $year=0 ) {\n\t\t$month = intval( $month );\n\t\t$year = intval( $year );\n\t\tif (!$month) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$month = $this->month;\n\t\t\t} else {\n\t\t\t\t$month = date( \"m\" );\n\t\t\t}\n\t\t}\n\t\tif (!$year) {\n\t\t\tif (isset( $this )) {\n\t\t\t\t$year = $this->year;\n\t\t\t} else {\n\t\t\t\t$year = date( \"Y\" );\n\t\t\t}\n\t\t}\n\t\tif ($month == 2) {\n\t\t\tif (($year % 4 == 0 && $year % 100 != 0) || $year % 400 == 0) {\n\t\t\t\treturn 29;\n\t\t\t} else {\n\t\t\t\treturn 28;\n\t\t\t}\n\t\t} else if ($month == 4 || $month == 6 || $month == 9 || $month == 11) {\n\t\t\treturn 30;\n\t\t} else {\n\t\t\treturn 31;\n\t\t}\n\t}",
"public function getMonths();",
"function getMonthOfBirth() {\n global $USER;\n\t$monthOfBirth = date(\"m\", $USER['dob']);\n\t//echo $monthOfBirth;\n\treturn $monthOfBirth;\n}",
"private function getLastDayMonth($year,$month) {\n\t\treturn date(\"d\",(mktime(0,0,0,$month+1,1,$year)-1));\n\t}",
"function _data_first_month_day()\n {\n $month = date('m');\n $year = date('Y');\n return date('Y-m-d', mktime(0, 0, 0, $month, 1, $year));\n }",
"public function getMonthlyFee();",
"function daysInMonth($m, $y)\n\t{\n\t\tif( $m < 1 || $m > 12 )\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// 30: 9, 4, 6, 11\n\t\t\tif( $m == 9 || $m == 4 || $m == 6 || $m == 11 )\n\t\t\t{\n\t\t\t\treturn 30;\n\t\t\t}\n\t\t\telse if( $m != 2 )\n\t\t\t{\n\t\t\t\t// all the rest have 31\n\t\t\t\treturn 31;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// except for february alone\n\t\t\t\tif( $y % 4 != 0 )\n\t\t\t\t{\n\t\t\t\t\t// which has 28\n\t\t\t\t\treturn 28;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif( $y % 100 != 0 ) \n\t\t\t\t\t{\n\t\t\t\t\t\t// and on leap years 29\n\t\t\t\t\t\treturn 29;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tif( $y % 400 != 0 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// deja vu: which has 28\n\t\t\t\t\t\t\treturn 28;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// deja vu: and on leap years 29\n\t\t\t\t\t\t\treturn 29;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function store_sallary_month()\n\t{\n\t\t$this->form_validation->set_rules('year', 'Year', 'required|trim');\n\t\t$this->form_validation->set_rules('month_id', 'Month Name', 'required|trim');\n\n\t\tif($this->form_validation->run() == FAlSE){\n\t\t\techo 0;\n\t\t}else{\n\t\t\tif($this->SallaryMonth_model->sallary_month_store()){\n\t\t\t\t$data['sallary_months'] = $this->SallaryMonth_model->get_all_sallay_month();\n\t\t\t\t$this->load->view('admin/employee/month/sallary_month_tbl',$data);\n\t\t\t}else{\n\t\t\t\techo 0;\n\t\t\t}\n\t\t}\n\t}",
"function getBookingByMonth()\n {\n $query = $this->db->select('BK_Year,BK_Month,BK_Day')\n ->get('booking');\n return $query->result();\n }",
"private function getMonth() {\n\t\treturn $this->month;\n\t}",
"private function _daysInMonth ()\n {\n return date('t', strtotime($this->currentYear.'-'.$this->currentMonth));\n }",
"function getMonthlyHiredDays( $startDate, $endDate ) {\n \n $startDate = DateTime::createFromFormat('Y-m-d H:i:s', $startDate);\n $endDate = DateTime::createFromFormat('Y-m-d H:i:s', $endDate);\n \n if ( !$startDate || !$endDate ) {\n \n echo 'Invalid arguments';\n return;\n }\n \n if ( $startDate > $endDate) {\n \n echo 'The start date is greater than the end date';\n return;\n }\n \n $hiredDays = array(); \n if ( $startDate->format('n') == $endDate->format('n') && $startDate->format('Y') == $endDate->format('Y') ) {\n \n // Get ddays between days and push to the array\n array_push( $hiredDays,\n array(\n 'year' => $startDate->format('Y'),\n 'month' => $startDate->format('n'),\n 'days' => $startDate->diff($endDate, true)->days\n )\n );\n \n }else {\n \n // Loop until the last date and get the days of every month \n while( true ) { \n \n if( !isset($startPoint) ) {\n \n $startPoint = $startDate; \n $m = $startDate->format('n');\n }else {\n \n $startPoint = $endPoint->add(new DateInterval('P1D'));\n $startPoint = $startPoint->setTime(0,0,0);\n $m = $startPoint->format('n');\n }\n \n if ( $m == 11 //30 days\n || $m == 4\n || $m == 6\n || $m == 9 ) {\n \n $monthDays = 30;\n }elseif ( $m == 2 ) { // 28 days\n \n $monthDays = $startPoint->format('L') == 1 ? 29 : 28;\n \n }else { // 31 days \n \n $monthDays = 31;\n }\n \n $endPoint = DateTime::createFromFormat('Y-m-d H:i:s', $startPoint->format('Y').'-'.$m.'-'.$monthDays.' 23:59:59');\n \n if ( $endPoint > $endDate ) {\n \n $endPoint = $endDate;\n } \n \n array_push( $hiredDays,\n array(\n 'year' => $startPoint->format('Y'),\n 'month' => $startPoint->format('n'),\n 'days' => $startPoint->diff($endPoint, true)->days + 1\n )\n );\n\n if ( $endPoint == $endDate ) {\n break;\n }\n \n $m = $m == 12 ? 1 : $m + 1;\n }\n } \n return $hiredDays;\n }",
"function _data_first_month_day() {\r\n $month = date('m');\r\n $year = date('Y');\r\n return date('d/m/Y', mktime(0,0,0, $month, 1, $year));\r\n }",
"function days_in_month($month, $year)\n{\n\treturn $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : (($month - 1) % 7 % 2 ? 30 : 31);\n}",
"function _data_first_month_day() {\n\t$month = date('m');\n\t$year = date('Y');\n\treturn date('Y-m-d', mktime(0,0,0, $month, 1, $year));\n}",
"public static function getDaysInMonth($month, $year) {}"
] |
[
"0.6421288",
"0.6264306",
"0.62039286",
"0.5955074",
"0.5947811",
"0.5923201",
"0.5898073",
"0.5886438",
"0.5872708",
"0.58410287",
"0.58271796",
"0.5739565",
"0.56595004",
"0.5659228",
"0.565463",
"0.5645021",
"0.5634132",
"0.561934",
"0.5607699",
"0.5605454",
"0.5563183",
"0.55612546",
"0.5548191",
"0.55455315",
"0.55040145",
"0.5500592",
"0.54866177",
"0.5471067",
"0.5470492",
"0.5467265"
] |
0.6833126
|
0
|
Finds an album with given id.
|
public function find($id, $params = array())
{
$that = $this;
return $this->cache->load("album-$id", function(&$dependencies) use ($that, $id, $params) {
$dependencies[Cache::TAGS] = ["album-$id"];
return $that->doFind($id, $params);
});
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function show($id)\n {\n return albumdetail::findOrFail($id);\n }",
"public function getAlbum($id)\n {\n $key = md5($id);\n if($this->cache->hasItem($key)){\n return unserialize($this->cache->getItem($key));\n }\n\n $results = $this->realSpotifyApi->getAlbum($id);\n\n $this->cache->setItem($key, serialize($results));\n return $results;\n }",
"public function getAlbum($id)\n {\n // cast the supplied argument\n $id = (int)$id;\n // retrieve the rowset based on the supplied parameter id\n $rowset = $this->tableGateway->select(array('id' => $id));\n // get the first item in the rowset\n $row = $rowset->current();\n // if nothing throw an \\Exception\n if (! $row) {\n throw new \\Exception('Could not find row ' . $id);\n }\n // return the item\n return $row;\n }",
"public function getAlbum($id)\n {\n $album = DB::table('albums')->select('name')->where(['id' => $id])->first();\n return $album->name;\n }",
"public function get_albums_by_id($id)\n {\n $this->db->where('id', $id);\n $this->db->where('num_song >', 0);\n $data_album = $this->db->get('album_song')->row_array();\n\n return $data_album;\n }",
"public function getAlbum($id)\n {\n $id = (int) $id;\n $rowSet = $this->tableGateway->select(array('id' => $id));\n $row = $rowSet->current();\n \n if (!$row) {\n throw new \\Exception(\"Could not find row $id\");\n }\n \n return $row;\n }",
"public function getAlbum($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT albums.id, category_id, title, artist\n FROM albums \n LEFT JOIN categories \n ON categories.id = category_id \n WHERE albums.id= ?';\n return $this->_db->fetchAssoc($query, array((int)$id));\n } else {\n return array();\n }\n }",
"public function show($id)\n {\n $sql = 'select * FROM albums WHERE id=:id';\n return DB::select($sql, ['id' => $id]);\n }",
"public function album ($album_id = '')\n {\n if (preg_match('#^http#iu', $album_id)) {\n $album_id = parse_url ($album_id, PHP_URL_PATH);\n $album_id = trim ($album_id, '/');\n\n if (preg_match ('#album\\/([a-z0-9]+)\\/?#iu', $album_id, $parts)) {\n $album_id = $parts[1];\n }\n }\n\n $url = sprintf (Request::ALBUMS_URL, $album_id);\n\n $this->_request($url, CurlClient::GET);\n\n if ( ! $this->_raw_output) {\n $this->_populate_album ($this->_body);\n }\n\n return $this->_body;\n }",
"public function getAlbum($id) {\n $this->requirePermission('album.get');\n\n $album = $this->controller->getAlbum($id, ['arts', 'artist' => function($query) {\n $query->select('id', 'name');\n }]);\n\n $album->makeVisible(['type', 'song_count', 'total_duration', 'song_ids']);\n\n return $this->response($album);\n }",
"public function fetch_albums_id($id)\n {\n \t\t\n\t\t$this->db->select('*');\n $this->db->from(\"album_song\");\n\t\t$this->db->where('num_song >', 0);\n $this->db->where(\"user_id\", $id);\n $query = $this->db->get();\n \t\treturn $query->result();\n }",
"public function getAlbums($id){\n $artist = Artist::find($id);\n return $artist->albums;\n }",
"public function show($id)\n {\n $photos = PhotoManager::getPhotos($id, 24);\n\n if ($photos) return view('photos.album', ['photos' => $photos]);\n\n abort(404, 'Album not found.');\n }",
"public function getAlbumById($album_id) {\n $query = \"SELECT\n al.id,\n al.name,\n al.year,\n al.version,\n al.location,\n al.sport,\n al.event_type,\n al.manufacturer,\n al.url\n FROM \" . $this->__schema . \".album al\n WHERE al.id = \" . $this->db()->quote($album_id);\n $data = $this->db()->getRow($query);\n if ($data) {\n return [\n 'success' => TRUE,\n 'payload' => $data,\n ];\n }\n else {\n return [\n 'success' => FALSE,\n 'payload' => NULL,\n ];\n }\n }",
"public function album($id)\n {\n try {\n $product = Product::with('projectCategory')\n ->where('type', 'Album')\n ->find($id);\n if ($product) {\n $this->solrController->kiki_product_delete_by_id($id);\n $this->productSolr($product);\n return \"Album ID -$id record successfully updated\";\n } else {\n return \"Album ID -$id not found. Please recheck ID\";\n }\n } catch (Exception $exception) {\n Log::error(\"Album album solr bulk upload error \" . $exception->getMessage());\n }\n }",
"public function deleteAlbum($id)\n {\n return DB::table('albums')->where(['id' => $id])->delete();\n }",
"function album($id) {\n\n // Get nickname\n if (isset($_SESSION['nickname'])) $nn = $_SESSION['nickname'];\n else $nn = 'nobody';\n\n $this->pager->limit = $this->per_page;\n\n // Start pager\n $this->pager->setStart();\n\n // \"Cache Groups\" using a vertical bar |\n $cache_id = \"$nn|album|{$id}|\" . $this->pager->start;\n $this->tpl->caching = 1;\n\n if (!$this->tpl->isCached('album.tpl', $cache_id)) {\n\n $this->pager->setPages($this->photo->countPhotos($id));\n $this->r->text['pager'] = $this->pager->pageList(suxFunct::makeUrl(\"/photos/album/{$id}\"));\n $this->r->arr['photos'] = $this->photo->getPhotos($this->pager->limit, $this->pager->start, $id);\n $this->r->arr['album'] = $this->photo->getAlbumByID($id);\n\n if ($this->r->arr['album'] && $this->r->arr['photos'] && (is_countable($this->r->arr['photos']) ? count($this->r->arr['photos']) : 0))\n {\n $tmp = $this->user->getByID($this->r->arr['album']['users_id']);\n $this->r->arr['album']['nickname'] = $tmp['nickname'];\n $this->r->title .= \" | {$this->r->gtext['photos']} | {$this->r->arr['album']['title']}\";\n }\n\n else {\n $this->tpl->caching = 0; // Nothing to cache, avoid writing to disk\n }\n\n }\n\n $this->tpl->display('album.tpl', $cache_id);\n\n }",
"public function show($id)\n\t{\n\t\tif (Request::ajax()) {\n\t\t\t$album = Album::with('images')->find($id);\n\t\t\treturn $album;\n\t\t}\n\t}",
"public function show($id)\n {\n $user = JWTAuth::parseToken()->authenticate();\n $album = $this->albumRepository->find($id);\n\n if (Gate::forUser($user)->allows('albums-show', $album)) {\n\n $records = $this->albumRepository->findSongs($album);\n\n return response()->json([\n 'success' => true,\n 'album' => $this->prepareAlbumData($album, $records)\n ]);\n }else{\n return response()->json([\n 'success' => false,\n 'errors' => [\"Access denied, you don't have access to this album\"]\n ],403);\n }\n }",
"public static function existsAlbum($id)\n\t{\n\t\treturn (BackendModel::getDB()->getVar('SELECT 1 FROM pictures_albums WHERE id = ?', $id) > 0);\n\t}",
"public static function find($id);",
"public function getAlbumAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n $albums = $em->getRepository(Album::class)->find($id);\n if (!$albums){\n //no blog entry is found so we set the view\n //to no content and set the staus code to 404\n $view = $this->view(null, 404);\n }\n else{\n //the blog entry exists, so we pass it to the view\n //and the status code defaults to 200 \"OK\"\n $view = $this->view($albums);\n }\n return $this->handleView($view);\n }",
"public function getAlbumToView($id)\n {\n if (($id != '') && ctype_digit((string)$id)) {\n $query = 'SELECT name, title, artist\n FROM albums, categories\n WHERE categories.id = category_id\n AND albums.id = ?';\n return $this->_db->fetchAssoc($query, array((int)$id));\n } else {\n return array();\n }\n }",
"public static function findAlbumModel($id)\n {\n if (($model = Album::find()->where(['ID'=>$id])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public static function findById($id);",
"public function show($id)\n {\n $album = Album::with('photos')->findOrFail($id);\n return new AlbumsResource($album);\n }",
"public function show($id)\n {\n $album = Ablum::with('photos')->find($id);\n return view('albums.show')->with('album', $album);\n }",
"public function edit($id)\n {\n // Incomplete\n $album = Album::find($id);\n }",
"public function album($id) {\n // tagged with one or more tags.\n\n // Load the specified ID to make sure it exists.\n $album_tags = ORM::factory(\"tags_album_id\")\n ->where(\"id\", \"=\", $id)\n ->find_all();\n\n // If it doesn't exist, redirect to the modules root page.\n if (count($album_tags) == 0) {\n url::redirect(\"tag_albums/\");\n }\n\n // If it does exist, and is set to *, load a list of all tags.\n if ($album_tags[0]->tags == \"*\") {\n $this->index($id, \"\");\n } else {\n // Otherwise, populate this page with the specified items.\n\n // Inherit permissions, title and description from the album that linked to this page.\n $album = ORM::factory(\"item\", $album_tags[0]->album_id);\n access::required(\"view\", $album);\n $page_title = $album->title;\n $page_description = $album->description;\n\n // URL to this page\n $str_page_url = \"tag_albums/album/\" . $id . \"/\" . urlencode($album->name);\n\n // Determine page sort order.\n $sort_page_field = $album->sort_column;\n $sort_page_direction = $album->sort_order;\n\n // Determine search type (AND/OR) and generate an array of the tag ids.\n $tag_ids = Array();\n foreach (explode(\",\", $album_tags[0]->tags) as $tag_name) {\n $tag = ORM::factory(\"tag\")->where(\"name\", \"=\", trim($tag_name))->find();\n if ($tag->loaded()) {\n $tag_ids[] = $tag->id;\n }\n }\n $album_tags_search_type = $album_tags[0]->search_type;\n\n // Figure out how many items to display on each page.\n $page_size = module::get_var(\"gallery\", \"page_size\", 9);\n\n // If this page was reached from a breadcrumb, figure out what page to load from the show id.\n $show = Input::instance()->get(\"show\");\n if ($show) {\n $child = ORM::factory(\"item\", $show);\n $index = $this->_get_position($child->$sort_page_field, $child->id, $tag_ids, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, true);\n if ($index) {\n $page = ceil($index / $page_size);\n if ($page == 1) {\n url::redirect($str_page_url);\n } else {\n url::redirect($str_page_url . \"?page=$page\");\n }\n }\n }\n\n // Figure out how many items are in this \"virtual album\"\n $count = $this->_count_records($tag_ids, $album_tags_search_type, true);\n\n // Figure out which page # the visitor is on and\n // don't allow the visitor to go below page 1.\n $page = Input::instance()->get(\"page\", 1);\n if ($page < 1) {\n url::redirect($str_page_url);\n }\n\n // First item to display.\n $offset = ($page - 1) * $page_size;\n\n // Figure out what the highest page number is.\n $max_pages = ceil($count / $page_size);\n\n // Don't let the visitor go past the last page.\n if ($max_pages && $page > $max_pages) {\n url::redirect($str_page_url . \"/?page=$max_pages\");\n }\n\n // Figure out which items to display on this page and store their details in $children.\n $tag_children = $this->_get_records($tag_ids, $page_size, $offset, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, true); \n\n // Set up the previous and next page buttons.\n if ($page > 1) {\n $previous_page = $page - 1;\n $view->previous_page_link = url::site($str_page_url . \"/?page={$previous_page}\");\n }\n if ($page < $max_pages) {\n $next_page = $page + 1;\n $view->next_page_link = url::site($str_page_url . \"/?page={$next_page}\");\n }\n\n // Set up breadcrumbs.\n $tag_album_breadcrumbs = array();\n $counter = 0;\n $tag_album_breadcrumbs[] = Breadcrumb::instance($album->title, $album->url())->set_last();\n $parent_item = ORM::factory(\"item\", $album->parent_id);\n while ($parent_item->id != 1) {\n $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url());\n $parent_item = ORM::factory(\"item\", $parent_item->parent_id);\n }\n $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first();\n $tag_album_breadcrumbs[1]->url .= \"?show=\" . $album->id;\n\t \n $tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);\n\n // Set up and display the actual page.\n $template = new Theme_View(\"page.html\", \"collection\", \"Tag Albums\");\n $template->set_global(\n array(\"page\" => $page,\n \"max_pages\" => $max_pages,\n \"page_size\" => $page_size,\n \"children\" => $tag_children,\n \"breadcrumbs\" => $tag_album_breadcrumbs,\n \"children_count\" => $count));\n $template->page_title = $page_title;\n $template->content = new View(\"dynamic.html\");\n $template->content->title = $page_title;\n $template->content->description = $page_description;\n\n $template->set_global(\"all_siblings\", $this->_get_records($tag_ids, $count, 0, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, false));\n print $template;\n\n // Set breadcrumbs on the photo pages to point back to the calendar day view.\n item::set_display_context_callback(\"tag_albums_Controller::get_display_context\", 0, $id);\n }\n }",
"public static function findById($id)\n\t{\n\t\n\t}"
] |
[
"0.74278265",
"0.7218482",
"0.72008306",
"0.7182056",
"0.6999691",
"0.69355935",
"0.68361074",
"0.6781345",
"0.6738403",
"0.6706008",
"0.66796386",
"0.6641169",
"0.66108453",
"0.65805566",
"0.65318775",
"0.65023935",
"0.64957935",
"0.6487847",
"0.6480914",
"0.64630157",
"0.64364856",
"0.64189535",
"0.6402514",
"0.6367289",
"0.63396734",
"0.63109976",
"0.627202",
"0.62154317",
"0.61852515",
"0.6178051"
] |
0.746599
|
0
|
SEND NOTIFICATION to pending installments
|
public function send_notification_to_pending_installments() {
$input_data = json_decode(file_get_contents('php://input'), TRUE);
if ($this->input->server('REQUEST_METHOD') == 'POST') {
$this->load->model('Background_model');
$resp = $this->Background_model->send_notification_to_pending_installments($input_data);
echo json_encode($resp);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function notify()\n\t\t{\n\t\t\techo \"Notifying via YM\\n\";\n\t\t}",
"public function sendUserUpdateNotification(): void\n {\n $this->notify(new VerifyAccountNotification());\n }",
"public function do_notify($send, $mailer = NULL);",
"public function trigger_notification()\n\t{\n \t\t\n\t\t $result=$this->Fb_common_func->send_notification($this->facebook,'Skywards meet me here!',array('100001187318347','1220631499','1268065008','1347427052','566769531'),'467450859982651|cf5YXgYRZZDJuvBF1_ZOyDyRJHM','100001187318347');\n\n\t echo $result;\n\t}",
"public function broadcastOn()\n {\n return ['pending-products'];\n }",
"public function sendEmailVerificationNotification();",
"public function sendEmailVerificationNotification()\n { \n \n $this->notify(new ConfirmEmail); \n \n }",
"public function runNotifications():void;",
"private function sendNotification(Application $app){\n }",
"public function notifyReporter()\r\n {\r\n $message = new Message();\r\n if (!$message->create())\r\n {\r\n return false;\r\n } \r\n \r\n $message->from( \"TicketSystem\" ); \r\n $message->to( $this->getReporter() ); \r\n $message->subject( \"Antwort auf Ticket #\".$this->getId() );\r\n \r\n $subJ = $this->getSubject();\r\n $tID = $this->getId();\r\n \r\n $msgText = \"Deinem Ticket mit dem Betreff \\\"\".$subJ.\"\\\" wurde eine neue Nachricht hinzugefügt.<br/><br/>\";\r\n $msgText .= \"<a href=\\\"ticketsystem.php?ticketid=\".$tID.\"\\\">Klicke hier um zum Ticket zu gelangen</a>\"; \r\n \r\n $message->text( $msgText ); \r\n $message->html( true );\r\n \r\n $message->addUser( $this->getReporter(), 6 ); \r\n\r\n unset( $message ); \r\n }",
"public function sendEmailVerificationNotification()\n {\n $this->notify(new VerifyEmail); // my notification\n }",
"public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('networking_agent'));\n }",
"public function register_notifications();",
"public function notifyPayment()\n {\n }",
"private function notifyDean() {\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/DeanNotification.php');\r\n\r\n $piDetails = $this->getPIDisplayDetails();\r\n $piName = $piDetails['firstName'] . \" \" . $piDetails['lastName'];\r\n\r\n $subject = sprintf('[TID-%s] Tracking form submitted online [%s]', $this->trackingFormId, $piName);\r\n $emailBody = sprintf('A tracking form was submitted online that requires approval :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nPrincipal Investigator : %s\r\nDepartment : %s\r\n\r\nTo view full details of this tracking form, please login at http://research.mtroyal.ca and navigate to \"My Approvals\".\r\n\r\n', $this->trackingFormId, $this->projectTitle, $piName, $piDetails['departmentName']);\r\n\r\n $DeanNotification = new DeanNotification($subject, $emailBody, $this);\r\n try {\r\n $DeanNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to Dean : '. $e);\r\n }\r\n }",
"public function install() {\n\t\t\t$query = $this->db->query(\"SELECT count(*) as total FROM `\" . DB_PREFIX . \"setting` WHERE `key` = 'special_timer_status'\");\n\t\t\t$countforumstatus = $query->row['total'];\n\t\t\tif($countforumstatus<1 && (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate())){\n\t\t\t\t$store_name = $this->config->get('config_name');\n\t\t\t\t\n\t\t\t\t$store_url = HTTP_CATALOG ;\t\n\n\t\t\t\t$message = \"It is default email. Sender has installed Deal Timer extension on the below store.\";\n\t\t\t\t$message .= \"\\n\\n\";\n\t\t\t\t$message .= 'Store URL- '.$store_url . \"\\n\\n\";\n\t\t\t\t$message .= 'Store Email- '.$this->config->get('config_email') . \"\\n\\n\";\n\t\t\t\t$message .= 'Store Name- '.html_entity_decode($store_name, ENT_QUOTES, 'UTF-8');\n\n\t\t\t\t$mail = new Mail();\n\t\t\t\t$mail->protocol = $this->config->get('config_mail_protocol');\n\t\t\t\t$mail->parameter = $this->config->get('config_mail_parameter');\n\t\t\t\t$mail->smtp_hostname = $this->config->get('config_mail_smtp_hostname');\n\t\t\t\t$mail->smtp_username = $this->config->get('config_mail_smtp_username');\n\t\t\t\t$mail->smtp_password = html_entity_decode($this->config->get('config_mail_smtp_password'), ENT_QUOTES, 'UTF-8');\n\t\t\t\t$mail->smtp_port = $this->config->get('config_mail_smtp_port');\n\t\t\t\t$mail->smtp_timeout = $this->config->get('config_mail_smtp_timeout');\n\n\t\t\t\t$mail->setTo('[email protected]');\n\t\t\t\t$mail->setFrom($this->config->get('config_email'));\n\t\t\t\t$mail->setSender(html_entity_decode($store_name, ENT_QUOTES, 'UTF-8'));\n\t\t\t\t$mail->setSubject('Deal Timer extension installed');\n\t\t\t\t$mail->setText($message);\n\t\t\t\t$mail->send();\n\t\t\t}\n\t\t\t/* End Email Function on Installation */\t\t\n }",
"public function it_sends_notification_to_user()\n {\n $this->migrateDatabase();\n $this->createUser();\n $user = UserModel::first();\n $bus = app('Joselfonseca\\LaravelTactician\\CommandBusInterface');\n $bus->addHandler('JJSoft\\SigesCore\\Notifications\\SendAppNotification\\SendAppNotificationCommand',\n 'JJSoft\\SigesCore\\Notifications\\SendAppNotification\\Handler\\SendAppNotificationCommandHandler');\n $bus->dispatch('JJSoft\\SigesCore\\Notifications\\SendAppNotification\\SendAppNotificationCommand', [\n 'user' => $user,\n 'type' => 'success',\n 'message' => 'Some Message'\n ],\n [\n 'JJSoft\\SigesCore\\Notifications\\SendAppNotification\\Middleware\\SetTheUserId'\n ]);\n $this->seeInDatabase('app_notifications', [\n 'user_id' => $user->id,\n 'type' => 'success',\n 'message' => 'Some Message'\n ]);\n }",
"private function sendAPN() {\n try {\n $this->apnProvider->pushToAll($this->apn);\n echo \"Successfully pushed notification.\\n\";\n } catch (Exception $e) {\n echo \"Failed to push notification.\\n\";\n throw $e;\n }\n }",
"public function sendConfirm()\n {\n $newPackage = \"\";\n $client = $this->clientEntity;\n $client->writeByte($newPackage, ClientEntity::HEAD_MAIL_SENT);\n $client->writeByte($newPackage, 1);\n $client->writeLong($newPackage, $this->messageEntity->time);\n $client->addPackageToBuffer($newPackage);\n $client->sendToClient();\n $client->addPackageToBuffer($newPackage);\n $client->sendToClient();\n }",
"private function notifyHREB() {\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/HREBNotification.php');\r\n\r\n $piDetails = $this->getPIDisplayDetails();\r\n $piName = $piDetails['firstName'] . \" \" . $piDetails['lastName'];\r\n $subject = sprintf('[TID-%s] Tracking form submitted online [%s]', $this->trackingFormId, $piName);\r\n $emailBody = sprintf('A tracking form was submitted online :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nPrincipal Investigator : %s\r\nDepartment : %s\r\n\r\n', $this->trackingFormId, $this->projectTitle, $piName, $piDetails['departmentName']);\r\n\r\n $HREBNotification = new HREBNotification($subject, $emailBody);\r\n try {\r\n $HREBNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to HREB : '. $e);\r\n }\r\n }",
"public function sendEmailVerificationNotification()\n {\n $this->notify(new EmailVerification('admin'));\n }",
"public static function sendNotifications(): string\n\t{\n\t\tif (\n\t\t\tLoader::includeModule('imopenlines')\n\t\t\t&& Loader::includeModule('imconnector')\n\t\t\t&& Loader::includeModule('ui')\n\t\t)\n\t\t{\n\t\t\t$lineIds = [];\n\t\t\t$activeConnections = StatusConnectorsTable::getList([\n\t\t\t\t'select' => ['LINE'],\n\t\t\t\t'filter' => [\n\t\t\t\t\t'=CONNECTOR' => [\n\t\t\t\t\t\t'facebook',\n\t\t\t\t\t\t'fbinstagramdirect'\n\t\t\t\t\t],\n\t\t\t\t\t'=ACTIVE' => 'Y',\n\t\t\t\t\t'=CONNECTION' => 'Y',\n\t\t\t\t\t'=REGISTER' => 'Y',\n\t\t\t\t],\n\t\t\t]);\n\n\t\t\twhile ($activeConnection = $activeConnections->fetch())\n\t\t\t{\n\t\t\t\t$lineIds[] = $activeConnection['LINE'];\n\t\t\t}\n\n\t\t\tif (!empty($lineIds))\n\t\t\t{\n\t\t\t\tif (\n\t\t\t\t\tLoader::includeModule('bitrix24')\n\t\t\t\t\t&& Loader::includeModule('imbot')\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\t$userIds = [];\n\n\t\t\t\t\t$lineIds = array_unique($lineIds);\n\n\t\t\t\t\t$queueLine = ConfigTable::getList([\n\t\t\t\t\t\t'select' => ['MODIFY_USER_ID'],\n\t\t\t\t\t\t'filter' => [\n\t\t\t\t\t\t\t'=ID' => $lineIds,\n\t\t\t\t\t\t],\n\t\t\t\t\t]);\n\n\t\t\t\t\twhile ($row = $queueLine->fetch())\n\t\t\t\t\t{\n\t\t\t\t\t\t$userIds[] = $row['MODIFY_USER_ID'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif (empty($userIds))\n\t\t\t\t\t{\n\t\t\t\t\t\t$userIds = ['ADMIN'];\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$admins = Support24::getAdministrators();\n\t\t\t\t\t\t$userIds = array_merge($userIds, $admins);\n\t\t\t\t\t\t$userIds = array_unique($userIds);\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ($userIds as $userId)\n\t\t\t\t\t{\n\t\t\t\t\t\tSupport24::sendMessage([\n\t\t\t\t\t\t\t'DIALOG_ID' => $userId,\n\t\t\t\t\t\t\t'MESSAGE' => Loc::getMessage('IMCONNECTOR_UPDATER_2112000_CHAT', [\n\t\t\t\t\t\t\t\t'#HREF#' => Util::getArticleUrlByCode(self::ID_ARTICLE_HELP_DESK),\n\t\t\t\t\t\t\t]),\n\t\t\t\t\t\t\t'SYSTEM' => 'N',\n\t\t\t\t\t\t\t'URL_PREVIEW' => 'N'\n\t\t\t\t\t\t]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\\CAdminNotify::Add([\n\t\t\t\t\t\t'MODULE_ID' => 'imconnector',\n\t\t\t\t\t\t'ENABLE_CLOSE' => 'Y',\n\t\t\t\t\t\t'NOTIFY_TYPE' => \\CAdminNotify::TYPE_NORMAL,\n\t\t\t\t\t\t'MESSAGE' => Loc::getMessage('IMCONNECTOR_UPDATER_2112000_ADMIN_NOTIFY', [\n\t\t\t\t\t\t\t'#HREF#' => Util::getArticleUrlByCode(self::ID_ARTICLE_HELP_DESK),\n\t\t\t\t\t\t]),\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn '';\n\t}",
"public function notifyOwner()\n {\n global $config, $reefless, $account_info;\n\n $reefless->loadClass('Mail');\n\n $mail_tpl = $GLOBALS['rlMail']->getEmailTemplate(\n $config['listing_auto_approval']\n ? 'free_active_listing_created'\n : 'free_approval_listing_created'\n );\n\n if ($config['listing_auto_approval']) {\n $link = $reefless->getListingUrl(intval($this->listingID));\n } else {\n $myPageKey = $config['one_my_listings_page'] ? 'my_all_ads' : 'my_' . $this->listingType['Key'];\n $link = $reefless->getPageUrl($myPageKey);\n }\n\n $mail_tpl['body'] = str_replace(\n array('{username}', '{link}'),\n array(\n $account_info['Username'],\n '<a href=\"' . $link . '\">' . $link . '</a>',\n ),\n $mail_tpl['body']\n );\n $GLOBALS['rlMail']->send($mail_tpl, $account_info['Mail']);\n }",
"public function notifyTransferedPlayers(){\n \n Service::loadModels('rally', 'rally');\n $peopleService = parent::getService('people','people');\n $carService = parent::getService('car','car');\n $teamService = parent::getService('team','team');\n $marketService = parent::getService('market','market');\n $notificationService = parent::getService('user','notification');\n \n /*\n * Players\n */\n $offersNoBid = $marketService->getFinishedOffersNotNotifiedNoBid();\n foreach($offersNoBid as $offerNoBid):\n $notificationService->addNotification($offerNoBid['Player']['first_name'].\" \".$offerNoBid['Player']['last_name'].\" was not sold. Player will return to your team tomorrow\",3,$offerNoBid['Team']['User']['id']);\n $offerNoBid->set('notified',1);\n $offerNoBid->save();\n endforeach;\n \n $offers = $marketService->getFinishedOffersNotNotified();\n // 1. Zaplacenie za transfer przez kupujacego\n \n foreach($offers as $offer): \n foreach($offer['Bids'] as $key => $bid){\n if($key==0){\n $notificationService->addNotification($offer['Player']['first_name'].\" \".$offer['Player']['last_name'].\" was successfully sold. Player will leave your team tomorrow\",3,$offer['Team']['User']['id']);\n $notificationService->addNotification($offer['Player']['first_name'].\" \".$offer['Player']['last_name'].\" has been bought. Player will join your team tomorrow\",3,$bid['Team']['User']['id']);\n }\n else{\n $notificationService->addNotification($offer['Player']['first_name'].\" \".$offer['Player']['last_name'].\" has not been bought.\",3,$bid['Team']['User']['id']);\n }\n } \n \n \n $offer->set('notified',1);\n $offer->save();\n endforeach;\n /*\n * Cars\n */\n \n $caroffersNoBid = $marketService->getFinishedCarOffersNotMovedNoBid();\n foreach($caroffersNoBid as $offerNoBid):\n $notificationService->addNotification($offerNoBid['Car']['name'].\" was not sold. The car will return to your team tomorrow\",3,$offerNoBid['Team']['User']['id']);\n $offerNoBid->set('notified',1);\n $offerNoBid->save();\n endforeach;\n \n $caroffers = $marketService->getFinishedCarOffersNotMoved();\n // 1. Zaplacenie za transfer przez kupujacego\n // 2. OTrzymanie kasy przez sprzedajacego\n // 3. Zmiana teamu przez kupujacego\n // 4. Ustawienie oferty na player_moved\n foreach($caroffers as $offer):\n foreach($offer['Bids'] as $key => $bid){\n if($key==0){\n $notificationService->addNotification($offer['Car']['name'].\" was successfully sold. The car will leave your team tomorrow\",3,$offer['Team']['User']['id']);\n $notificationService->addNotification($offer['Car']['name'].\" has been bought. The car will join your team tomorrow\",3,$bid['Team']['User']['id']);\n }\n else{\n $notificationService->addNotification($offer['Car']['name'].\" has not been bought.\",3,$bid['Team']['User']['id']);\n }\n }\n $offer->set('notified',1);\n $offer->save();\n endforeach;\n \n echo \"done\";exit;\n }",
"private function notifyORS() {\r\n require_once('classes/tracking/notifications/Notifications.php');\r\n require_once('classes/tracking/notifications/ORSNotification.php');\r\n\r\n $piDetails = $this->getPIDisplayDetails();\r\n $piName = $piDetails['firstName'] . \" \" . $piDetails['lastName'];\r\n\r\n $subject = sprintf('[TID-%s] Tracking form submitted online [%s]', $this->trackingFormId, $piName);\r\n $emailBody = sprintf('A tracking form was submitted online :\r\n\r\nTracking ID : %s\r\nTitle : \"%s\"\r\nPrincipal Investigator : %s\r\nDepartment : %s\r\n\r\n', $this->trackingFormId, $this->projectTitle, $piName, $piDetails['departmentName']);\r\n\r\n $ORSNotification = new ORSNotification($subject, $emailBody);\r\n try {\r\n $ORSNotification->send();\r\n } catch(Exception $e) {\r\n printf('Error: Unable to send email notification to ORS : '. $e);\r\n }\r\n }",
"public function inform() {\n $this->deliveryType(DELIVERY_TYPE_BOOL);\n $this->deliveryMethod(DELIVERY_METHOD_JSON);\n\n // Retrieve all notifications and inform them.\n NotificationsController::informNotifications($this);\n $this->fireEvent('BeforeInformNotifications');\n\n $this->render();\n }",
"public function sendEmailVerificationNotification(){\n $this->notify(new VerifyEmail);\n }",
"public function notificationQuestion()\n {\n\n $unanswered_questions_count = $this->Question_model->getUnansweredCount();\n $tokens = $this->Question_model->getTokens();\n\n foreach ($tokens as $token)\n {\n //$token = \"dzD9G0LpT7o:APA91bE5EGEGOTs_gB8uWvalTy05LY2B6CoVddeEg2qZiiZDuzEwJ-5U_8Oj-zPSZe44dXlY5m1aZ3ZCAW7jM8vZ5V2vM1vMLQgF5l9S8Q68ibK0lL4MhXQxuVjgb9A7ZRKm7PdUMlA3\";\n $url = 'https://fcm.googleapis.com/fcm/send';\n $headers = array('Content-Type' => 'application/json', 'authorization' => 'key= AIzaSyDJnLqtnXqSI5vF6N8IJCRgHLF58pQ7xYI');\n $fields = array (\n 'data' => array(\n \"unanswered_questions_count\" => $unanswered_questions_count\n ),\n 'to' => $token['token']\n );\n\n $response = (Requests::post($url, $headers, json_encode($fields)));\n }\n }",
"public function sendAssignmentNotification()\n {\n \t$ctime = date('Y-m-d'); //get current day\n \n \t//get facebook id from the user setting for facebook reminder\n \t$this->PleAssignmentReminder->virtualFields = array('tid' => 'PleUserMapTwitter.twitterId');\n \n \t//get last sent id\n \t$last_sent_id = $this->PleLastReminderSent->find('first',array('conditions' => array('PleLastReminderSent.date' => $ctime, 'PleLastReminderSent.type' => 'twitter')));\n \n \tif( count($last_sent_id) > 0 ) {\n \t\t$options['conditions'][] = array('PleAssignmentReminder.id >' => $last_sent_id['PleLastReminderSent']['last_sent_rid']);\n \t}\n \n \t//get appController class object\n \t$obj = new AppController();\n \t$assignments = $obj->getAssignmentConstraints();\n \n \t//get today assignments\n \n \t$options['conditions'][] = $assignments;\n \t$options['fields'] = array('id', 'user_id', 'assignment_uuid', 'assignment_title', 'due_date', 'course_id');\n \t$options['order'] = array('PleAssignmentReminder.id ASC');\n \n \t//execute query\n \t$assignmnet_details = $this->PleAssignmentReminder->find('all', $options);\n \t\n \n \t//send twitter reminder\n \tforeach( $assignmnet_details as $assignmnet_detail ) {\n\t $user_id = $assignmnet_detail['PleAssignmentReminder']['user_id'];\n \t\t//$to_twitter = $assignmnet_detail['PleAssignmentReminder']['tid'];\n \t\t$body = $assignmnet_detail['PleAssignmentReminder']['assignment_title'];\n\t\t$course_id = $assignmnet_detail['PleAssignmentReminder']['course_id'];\n \t\t\n\t\t//get twitter users array if user is instructor\n \t\t$twitter_users_array = $this->getChildren( $user_id, $course_id );\n\t\t\n \t\t//set display date for assignments\n \t\t$originalDate = $assignmnet_detail['PleAssignmentReminder']['due_date'];\n\t\tif($originalDate != \"\"){\n \t\t$newDate = date(\"F d, Y\", strtotime($originalDate));\n \t\t$due_date = \" due on $newDate\";\n\t\t}else{\n\t\t \t$due_date = \" is due on NA\";\n\t\t }\n \t\t\n \t\t//compose mail date\n \t\t$mail_data = \"Assignment Reminder! $course_id. Your assignment, $body, $due_date.\";\n \t\t$subject = $course_id.\" - \".$body;\n \n\t\t//send the reminder to multiple users\n \t\tforeach ($twitter_users_array as $to_twitter_data ) {\n\t\t$to_twitter = $to_twitter_data['twitter_id'];\n \t\t$to_id = $to_twitter_data['id'];\n \t\t$send_twitter = $this->sendNotification( $to_twitter, $mail_data );\n \n \t\t//check for if facebook reminder sent\n \t\tif ( $send_twitter == 1) {\n \n \t\t\t//remove the previous entry of current date\n \t\t\t$this->PleLastReminderSent->deleteAll(array('PleLastReminderSent.date'=>$ctime, 'PleLastReminderSent.type'=>'twitter'));\n \t\t\t$this->PleLastReminderSent->create();\n \n \t\t\t//update the table for sent facebook reminder\n \t\t\t$data['PleLastReminderSent']['last_sent_rid'] = $assignmnet_detail['PleAssignmentReminder']['id'];\n \t\t\t$data['PleLastReminderSent']['type'] = 'twitter';\n \t\t\t$data['PleLastReminderSent']['date'] = $ctime;\n \t\t\t$this->PleLastReminderSent->save($data);\n \n \t\t\t//create the CSV user data array\n \t\t\t$csv_data = array('id'=>$to_id, 'tid'=>$to_twitter, 'mail_data'=> $mail_data);\n \n \t\t\t//write the csv\n \t\t\t$this->writeTwitterCsv($csv_data);\n \n \t\t\t//unset the csv data array\n \t\t\tunset($csv_data);\n \t\t} else if ( $send_twitter == 2) { //twitter app not following case(can be used for future for notification on dashboard)\n \t\t\t\n \t\t} else {\n \t\t\t//handling for twitter reminder failure\n\t \t\t$tw_data = array();\n\t \t\t$tw_data['AssignmentTwitterFailure']['twitter_id'] = $to_twitter;\n\t \t\t$tw_data['AssignmentTwitterFailure']['mail_data'] = $mail_data;\n\t \t\t$this->AssignmentTwitterFailure->create();\n\t \t\t$this->AssignmentTwitterFailure->save($tw_data);\n \t\t}\n\t\t}\n \t}\n }",
"function wp_send_new_user_notifications($user_id, $notify = 'both')\n {\n }"
] |
[
"0.61055446",
"0.6080214",
"0.6078353",
"0.60544705",
"0.60220015",
"0.5970531",
"0.5926754",
"0.5915458",
"0.5903208",
"0.590277",
"0.5901751",
"0.5888898",
"0.58834714",
"0.5874796",
"0.58671635",
"0.5862883",
"0.5851627",
"0.5850492",
"0.584404",
"0.5837565",
"0.583041",
"0.58263385",
"0.58222985",
"0.57688004",
"0.57309526",
"0.5719763",
"0.57144403",
"0.57104963",
"0.57094216",
"0.56877464"
] |
0.72615194
|
0
|
Normalize a phone number (with or without country code)
|
function normalize_phone($phone)
{
$phone = preg_replace('/\D/', '', $phone);
return (strlen($phone) > 10) ? $phone : (getenv('PHONE_DEFAULT_COUNTRY_CODE') ?: '91') . $phone;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getLocalisedPhoneNumber($phone_number, $country_code='KE') { \n\t$phone_number = PhoneNumber::make($phone_number, $country_code)->formatNational();\n\t//remove spaces\n\treturn str_replace(\" \", \"\", $phone_number);\n\n}",
"function getInternationalPhoneNumberNoSpaces($phone_number, $country_code='KE') { \n\treturn PhoneNumber::make($phone_number, $country_code)->formatE164();\n}",
"function normalize_phone_to_E164($phone) {\n\t$phone = preg_replace('/[^0-9+]/', '', $phone);\n\n\t// validate intl 10\n\tif(preg_match('/^\\+([2-9][0-9]{9})$/', $phone, $matches)){\n\t\treturn \"+{$matches[1]}\";\n\t}\n\n\t// validate US DID\n\tif(preg_match('/^\\+?1?([2-9][0-9]{9})$/', $phone, $matches)){\n\t\treturn \"+1{$matches[1]}\";\n\t}\n\n\n\t// validate INTL DID\n\tif(preg_match('/^\\+?([2-9][0-9]{8,14})$/', $phone, $matches)){\n\t\treturn \"+{$matches[1]}\";\n\t}\n\n\t// premium US DID\n\tif(preg_match('/^\\+?1?([2-9]11)$/', $phone, $matches)){\n\t\treturn \"+1{$matches[1]}\";\n\t}\n\n\treturn $phone;\n}",
"private function intlPhone($phone)\n\t{ \n\t\t$norm = preg_replace('~[^0-9]~', '', $phone);\n\n\t\tif (10 === strlen($norm)) {\n\t\t\treturn '1' . $norm; // US\n\t\t}\n\n\t\treturn $norm;\n\t}",
"function nrua_sanitize_phone_number( $phone_mobile )\n{\n\t// = Remove all non int chars\n\t$phone_mobile = filter_var( $phone_mobile, FILTER_SANITIZE_NUMBER_INT );\n\t$phone_mobile = str_replace(\"+\", \"\", $phone_mobile);\n\t$phone_mobile = str_replace(\"-\", \"\", $phone_mobile);\n\t\n\t// = Add the international char\n\t$phone_mobile = '+' .$phone_mobile;\n\t\n\t// = Check lenght\n\tif ( ( strlen( $phone_mobile ) < 10 ) || ( strlen( $phone_mobile ) > 14 ) ) \n\t{\n\t\t$phone_mobile = null;\n\t}\n\t\n\treturn $phone_mobile;\n}",
"public static function normalize($number) {\n\t\t$number = preg_replace('#[^0-9]#','',''.$number);\n\t\t$norm = array('ccc'=>'');\n\t\tswitch (true) {\n\t\t\t\n\t\t\tcase (strlen($number)==10 && substr($number,0,1)=='0'):\n\t\t\t\t$number = substr($number,1);\n\t\t\tcase (strlen($number)==9 && substr($number,0,1)!=='0'):\t\n\t\t\t\t$norm['ccc'] = '33';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$found = false;\n\t\t\t\t$number = preg_replace('#^[0]+#', '', $number);\n\t\t\t\t$found = false;\n\t\t\t\tfor ($i=4; $i>0; $i--) {\n\t\t\t\t\t$ccc = substr($number,0,$i);\n\t\t\t\t\tif (in_array($ccc,self::$ccc)) {\n\t\t\t\t\t\t$found = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($found) {\n\t\t\t\t\t$norm['ccc'] = $ccc;\n\t\t\t\t\t$number = preg_replace('#^'.$ccc.'0*#','',$number);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthrow new PhoneNumberException($number,1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t\t$norm['number'] = $number;\n\t\treturn $norm;\n\t}",
"function getInternationalPhoneNumber($phone_number, $country_code='KE') { \n\treturn PhoneNumber::make($phone_number, $country_code)->formatInternational();\n}",
"function clean_number($phone_number){\n\treturn preg_replace(\"/[^0-9]/\", \"\", $phone_number);\n}",
"function clean_phone($phone_number){\n $clean = str_replace(array('+','(',')','-',' '),'',$phone_number);\n return $clean;\n }",
"function parseUSPhoneNumber($phoneNumber){\n\t\t$input = preg_replace('/\\D/', '', $phoneNumber);\n\t\t$areaCode;\n\t\t$phone;\n\t\t//if it's not 10 or 11 in length we have an issue\n\t\tif(strlen($input) == 11){\n\t\t\t$areaCode = substr($input, 1,3);\n\t\t\t$phone = substr($input, 4,7);\n\t\t\treturn [\"area\" => $areaCode, \"phone\" => $phone];\n\t\t} else if(strlen($input) == 10){\n\t\t\t$areaCode = substr($input, 0,3);\n\t\t\t$phone = substr($input, 3,7);\n\t\t\treturn [\"area\" => $areaCode, \"phone\" => $phone];\n\t\t\t//(123)123-1234\n\t\t}\n\t\treturn false;\n\t}",
"function get_phone_number( $phone_number ) {\n return str_replace( array( '-', '(', ')', ' ' ), '', $phone_number );\n}",
"public static function convertPhoneNumber($phone, $country, $format = null)\n {\n if (! $format)\n {\n return $phone;\n }\n\n $regex\t\t\t= $format;\n $escape_chars\t= '\\()[]{|.?^$+*';\n\n for ($pos = 0; $pos < strlen($escape_chars); $pos++)\n {\n $regex = str_replace($escape_chars[$pos], \"\\\\\" . $escape_chars[$pos], $regex);\n }\n\n $country_code = self::$country_codes[strtoupper($country)];\n\n if ($country_code)\n {\n if (substr_count($regex, \"%c\"))\n {\n $regex = str_replace(\"%c\", \"(?P<country_code>\" . $country_code . \")\", $regex);\n }\n }\n else\n {\n $regex = str_replace(\"%c\", \"(?P<country_code>[1-9][0-9]{0,2})\", $regex);\n }\n\n $regex = str_replace(\"%a\", \"(?P<area_code>[1-9][0-9]{0,6})\", $regex);\n $regex = str_replace(\"%s\", \"(?P<subscriber_number>[1-9][0-9 ]{2,15})\", $regex);\n $regex = \"/\" . $regex . \"/\";\n\n preg_match($regex, $phone, $m);\n\n if (! isset($m['country_code']) && $country_code)\n {\n $m['country_code'] = $country_code;\n }\n\n if (! isset($m['area_code']))\n {\n $m['area_code'] = \"\";\n }\n\n $strip_chars = \" \";\n\n for ($pos = 0; $pos < strlen($strip_chars); $pos++)\n {\n $m['subscriber_number'] = str_replace($strip_chars[$pos], \"\", $m['subscriber_number']);\n }\n\n if (! $m['country_code'] || !$m['subscriber_number'])\n {\n return $phone;\n }\n\n $phone = \"+\" . $m['country_code'] . \".\" . $m['area_code'] . $m['subscriber_number'];\n\n return $phone;\n }",
"public function international_phone_number($phone,$country_code)\n\t{\n\t\tif(($country_code == 'GB')) {\n\t\t\t//Currently only support UK mobiles\n\t\t\t//Get rid of any non digits\n\t\t\t$phone = preg_replace('/\\D/','',$phone);\n\t\t\n\t\t\t//Count how many digits we have\n\t\t\t//07538069877\n\t\t\t//447538069877 [tick]\n\t\t\t//00447538069877\n\t\t\tif(strlen($phone) == 11) {\n\t\t\t\t//Chop the first 0 character and add 44\n\t\t\t\t$phone = \"44\" . substr($phone, 1);\n\t\t\t}\n\t\t\t\n\t\t\tif(strlen($phone) == 14) {\n\t\t\t\t//Chop the first two 00s\n\t\t\t\t$phone = substr($phone, 2);\n\t\t\t}\n\t\t\n\t\t\treturn $phone;\n\t\t} else {\n\t\n\t\t\treturn NULL;\n\t\t}\n\t}",
"private function cleanPhoneNumber($phone = '') {\n $phone = preg_replace('/[^0-9-]/', '', trim($phone));\n return (string)$phone;\n }",
"function getDatabasePhoneNumber($phone_number, $country_code='KE') { \n\t$phone_number = PhoneNumber::make($phone_number, $country_code)->formatE164();\n\treturn str_replace(\"+\", \"\", $phone_number);\n}",
"function sanitize_phone($value, bool $preserveSpaces): string\n{\n if(isNullOrEmpty($value)){\n return '';\n }\n\n $startsWithPlus = starts_withEx($value, '+');\n\n $phone = mb_ereg_replace('([^\\d\\(\\)' . ($preserveSpaces ? '[:space:]' : '') . '])', $preserveSpaces ? ' ' : '', $value);\n $phone = trim($phone);\n\n //revert initial + if needed\n if ($startsWithPlus) {\n $phone = '+' . $phone;\n }\n\n //check for illegal parenthesis\n if ((strpos($phone, '(') !== false || strpos($phone,\n ')') !== false) && !preg_match('/.*\\([[:space:]0-9]{1,}\\)[[:space:]0-9]{1,}/', $phone)\n ) {\n $phone = str_replace(['(', ')'], $preserveSpaces ? ' ' : '', $phone);\n }\n\n //remove multiple spaces\n $phone = str_replace_multiple_spaceEx($phone);\n\n //remove spaces into and around ()\n $phone = str_replace(['( ', ' )', ' (', ') '], ['(', ')', '(', ')'], $phone);\n\n $phone = trim($phone);\n\n return $phone;\n}",
"function validate_phone($phone)\n{\n $filtered_phone_number = filter_var($phone, FILTER_SANITIZE_NUMBER_INT);\n // Check the lenght of number\n // This can be customized if you want phone number from a specific country\n if (strlen($filtered_phone_number) != 12) {\n return false;\n } else {\n return true;\n }\n}",
"function US_phone_number($sPhone)\n {\n $sPhone = ereg_replace(\"[^0-9]\", '', $sPhone);\n if (strlen($sPhone) != 10) return (False);\n $sArea = substr($sPhone, 0, 3);\n $sPrefix = substr($sPhone, 3, 3);\n $sNumber = substr($sPhone, 6, 4);\n $sPhone = \"(\" . $sArea . \")\" . $sPrefix . \"-\" . $sNumber;\n return ($sPhone);\n }",
"private function validatePhone($phone)\n {\n $phone = preg_replace('/[^\\d]/', '', $phone);\n return $phone;\n }",
"function format_phone_plain($number) {\n return preg_replace('/[^0-9]/', '', $number);\n}",
"function PhoneClean($PhoneClean)\n {\n // Es gibt unzählige Varianten. Wenigstens die Gebräuchlichsten davon sollen erkannt und bereinigt werden\n\n // Ersetze 00 oder (00 oder ( 00 durch ein + ,\n // was der Internationalen Vorwahl entspricht\n $PhoneClean = eregi_replace(\"^(00|\\(00|\\( 00)\", \"+\", $PhoneClean);\n\n // Hat jemand 2x hintereinander ein + eingegeben,\n // ersetze es durch ein einzelnes +\n $PhoneClean = eregi_replace(\"\\+\\+\", \"+\", $PhoneClean);\n\n // Hat da jemand ein oder zwei Leerzeichen nach dem Plus eingegeben,\n // dann entferne auch diese.\n $PhoneClean = eregi_replace(\"^(\\+ |\\+ )\", \"+\", $PhoneClean);\n\n // Wenn es Ländervorwal hat, beginnt diese nun mit einem +\n // Hat es ein Plus am Anfang ? Wenn ja,(0)entfernen.\n // (Diese wird bei Ortsvorwahlen gerne als Lesehilfe hinzugefügt)\n if (ereg (\"^\\+\", $PhoneClean))\n $PhoneClean = trim(eregi_replace(\"\\(0)\", \"\", $PhoneClean));\n\n // Alle typischen Zeichen ausser den Numerischen und dem Plus durch Leerzeichen ersetzen,\n // entferne anschliessend unbekannte Zeichen und ersetze doppelte Leerzeichen duch einfache\n $PhoneClean = eregi_replace(\"\\(|)|/|\\.\", \" \", $PhoneClean);\n $PhoneClean = trim(eregi_replace(\"[^0-9\\+[:space:]]\", null, $PhoneClean));\n $PhoneClean = trim(preg_replace(\"/ +/\", ' ', $PhoneClean));\n return $PhoneClean;\n }",
"private function sanitize_phone($phone)\n {\n if (empty($phone)) {\n return false;\n }\n\n if (preg_match('/^[+]?([0-9]?)[(|s|-|.]?([0-9]{3})[)|s|-|.]*([0-9]{3})[s|-|.]*([0-9]{4})$/', $phone)) {\n return trim($phone);\n }\n\n return false;\n }",
"function formatPhoneNumber($phoneNumber) {\n $phoneNumber = preg_replace('/[^0-9]/','',$phoneNumber);\n\n if(strlen($phoneNumber) > 10) {\n $countryCode = substr($phoneNumber, 0, strlen($phoneNumber)-10);\n $areaCode = substr($phoneNumber, -10, 3);\n $nextThree = substr($phoneNumber, -7, 3);\n $lastFour = substr($phoneNumber, -4, 4);\n\n $phoneNumber = '+'.$countryCode.' '.$areaCode.' '.$nextThree.' '.$lastFour;\n }\n else if(strlen($phoneNumber) == 10) {\n $areaCode = substr($phoneNumber, 0, 3);\n $nextThree = substr($phoneNumber, 3, 3);\n $lastFour = substr($phoneNumber, 6, 4);\n\n $phoneNumber = ''.$areaCode.' '.$nextThree.' '.$lastFour;\n }\n else if(strlen($phoneNumber) == 7) {\n $nextThree = substr($phoneNumber, 0, 3);\n $lastFour = substr($phoneNumber, 3, 4);\n\n $phoneNumber = $nextThree.' '.$lastFour;\n }\n\n return $phoneNumber;\n}",
"function formatPhoneNumber($phoneNumber) {\n $phoneNumber = preg_replace('/[^0-9]/','',$phoneNumber);\n\n if(strlen($phoneNumber) > 10) {\n $countryCode = substr($phoneNumber, 0, strlen($phoneNumber)-10);\n $areaCode = substr($phoneNumber, -10, 3);\n $nextThree = substr($phoneNumber, -7, 3);\n $lastFour = substr($phoneNumber, -4, 4);\n\n $phoneNumber = '+'.$countryCode.' ('.$areaCode.') '.$nextThree.'-'.$lastFour;\n }\n else if(strlen($phoneNumber) == 10) {\n $areaCode = substr($phoneNumber, 0, 3);\n $nextThree = substr($phoneNumber, 3, 3);\n $lastFour = substr($phoneNumber, 6, 4);\n\n $phoneNumber = '('.$areaCode.') '.$nextThree.'-'.$lastFour;\n }\n else if(strlen($phoneNumber) == 7) {\n $nextThree = substr($phoneNumber, 0, 3);\n $lastFour = substr($phoneNumber, 3, 4);\n\n $phoneNumber = $nextThree.'-'.$lastFour;\n }\n return $phoneNumber;\n }",
"public function unmaskPhone(){\n \n $this->phone = Yii::$app->formatter->asUnmaskedNumber($this->phone);\n return true;\n }",
"public function phoneClean():string\n {\n $phone = '';\n if (!empty($this->phone)) {\n $phone = preg_replace('#[^\\d\\+]#si', '', $this->phone);\n }\n return $phone;\n }",
"function format_phone_us($phone) {\n if(!isset($phone{3})) { return ''; }\n // note: strip out everything but numbers \n $phone = preg_replace(\"/[^0-9]/\", \"\", $phone);\n $length = strlen($phone);\n switch($length) {\n case 7:\n return preg_replace(\"/([0-9]{3})([0-9]{4})/\", \"$1-$2\", $phone);\n break;\n case 10:\n return preg_replace(\"/([0-9]{3})([0-9]{3})([0-9]{4})/\", \"($1) $2-$3\", $phone);\n break;\n case 11:\n return preg_replace(\"/([0-9]{1})([0-9]{3})([0-9]{3})([0-9]{4})/\", \"$1($2) $3-$4\", $phone);\n break;\n default:\n return $phone;\n break;\n }\n}",
"function unify_number($number){\n $number = str_replace([\" \", \"-\"], \"\", $number); // Android likes to put those in\n if( strpos($number, \"00\") === 0 )\n return \"+\".substr($number, 2);\n if( strpos($number, \"0\") === 0 )\n return \"+49\".substr($number, 1);\n if( strpos($number, \"+\") === 0 ){\n return $number;\n }\n return \"+496659\".$number;\n}",
"function makePhone( $phone, $column = '' )\n{\n\tglobal $locale;\n\n\t$phone = trim( $phone );\n\n\tif ( $phone === '' )\n\t{\n\t\treturn '';\n\t}\n\n\t// Keep numbers and extension.\n\t$unformatted_phone = preg_replace( \"/[^0-9\\+x]/\", \"\", $phone );\n\n\t$fphone = $phone;\n\n\tif ( $unformatted_phone !== $phone )\n\t{\n\t\t// Phone already contains formatting chars, keep them.\n\t}\n\telseif ( mb_strlen( $phone ) === 9 )\n\t{\n\t\t// Spain: 012 345 678.\n\t\t$fphone = mb_substr( $phone, 0, 3 ) . ' ' .\n\t\t\tmb_substr( $phone, 3, 3 ) . ' ' . mb_substr( $phone, 6 );\n\t}\n\telseif ( mb_strlen( $phone ) === 10 )\n\t{\n\t\tif ( mb_strpos( $locale, 'fr' ) === 0 )\n\t\t{\n\t\t\t// France: 01 23 45 67 89.\n\t\t\t$fphone = mb_substr( $phone, 0, 2 ) . ' ' .\n\t\t\t\tmb_substr( $phone, 2, 2 ) . ' ' . mb_substr( $phone, 4, 2 ) . ' ' .\n\t\t\t\tmb_substr( $phone, 6, 2 ) . ' ' . mb_substr( $phone, 8 );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// US: (012) 345-6789.\n\t\t\t$fphone = '(' . mb_substr( $phone, 0, 3 ) . ') ' .\n\t\t\t\tmb_substr( $phone, 3, 3 ) . '-' . mb_substr( $phone, 6 );\n\t\t}\n\t}\n\telseif ( mb_strlen( $phone ) === 7 )\n\t{\n\t\t// US: 345-6789.\n\t\t$fphone = mb_substr( $phone, 0, 3 ) . '-' . mb_substr( $phone, 3 );\n\t}\n\n\t$dial_phone = $unformatted_phone;\n\n\t$extension_pos = mb_strpos( $dial_phone, 'x' );\n\n\tif ( $extension_pos !== false )\n\t{\n\t\t// Remove extension.\n\t\t$dial_phone = mb_substr( $dial_phone, 0, $extension_pos );\n\t}\n\n\treturn '<a href=\"tel:' . $dial_phone . '\" title=\"' . _( 'Call' ) . '\" class=\"phone-link\">' . $fphone . '</a>';\n}",
"public function filter($value)\n {\n if(!is_scalar($value)) {\n // Return non-scalar value unfiltered.\n return $value;\n }\n\n $value = (string)$value;\n\n if(strlen($value)==0) {\n // Return empty value unfiltered.\n return $value;\n }\n\n // First remove any non-digit character.\n $digits = preg_replace('#[^0-9]#', '', $value);\n\n $format = $this->options['format'];\n\n if($format == self::PHONE_FORMAT_INTL) {\n\n // Pad with zeros if count of digits is incorrect.\n $digits = str_pad($digits, 11, \"0\", STR_PAD_LEFT);\n\n // Add the braces, spacing and the dash.\n $phoneNumber = substr($digits, 0, 1) . ' ('. substr($digits, 1, 3) . ') ' .\n substr($digits, 4, 3) . '-'. substr($digits, 7, 4);\n } else { // self::PHONE_FORMAT_LOCAL\n // Pad with zeros if count of digits is incorrect.\n $digits = str_pad($digits, 7, \"0\", STR_PAD_LEFT);\n\n // Add the the dash.\n $phoneNumber = substr($digits, 0, 3) . '-'. substr($digits, 3, 4);\n }\n\n return $phoneNumber;\n }"
] |
[
"0.7386986",
"0.72516775",
"0.7090571",
"0.7044733",
"0.69965905",
"0.69056433",
"0.67739207",
"0.6738402",
"0.6681144",
"0.6672891",
"0.6644825",
"0.66391045",
"0.65769625",
"0.65477604",
"0.65464294",
"0.65433496",
"0.6431092",
"0.6375642",
"0.6341561",
"0.6334437",
"0.63229376",
"0.6292616",
"0.62841433",
"0.6263905",
"0.62595755",
"0.6206999",
"0.6196459",
"0.61949253",
"0.6191965",
"0.6172639"
] |
0.7878908
|
0
|
Fix products that are assigned to configurable, but not assigned to categories and still marked as visible
|
public function fixVisibleButWithoutCategoryAndInConfigurable()
{
$visibilityAttribute = $this->eavConfig->getAttribute(Mage_Catalog_Model_Product::ENTITY, 'visibility');
$select = $this->_getWriteAdapter()->select();
$select->join(['data_index' => $this->getMainTable()], 'data_index.entity_id = attribute.entity_id', []);
$select->where('attribute.attribute_id = ?', $visibilityAttribute->getId());
$select->where('data_index.is_in_configurable = ?', 1);
$select->where('data_index.is_in_category = ?', 0);
$select->where('data_index.visibility <> ?', Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE);
$select->columns([
'value' => new Zend_Db_Expr(Mage_Catalog_Model_Product_Visibility::VISIBILITY_NOT_VISIBLE)
]);
$this->_getWriteAdapter()->query($select->crossUpdateFromSelect(
['attribute' => $visibilityAttribute->getBackendTable()]
));
Mage::getSingleton('index/indexer')
->getProcessByCode('catalog_category_product')
->reindexAll();
Mage::getSingleton('index/indexer')
->getProcessByCode('catalog_product_flat')
->reindexAll();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function _applyProductLimitations()\n {\n Mage::dispatchEvent('catalog_product_collection_apply_limitations_before', array(\n 'collection' => $this,\n 'category_id' => isset($this->_productLimitationFilters['category_id']) ?\n $this->_productLimitationFilters['category_id'] : null,\n ));\n $this->_prepareProductLimitationFilters();\n $this->_productLimitationJoinWebsite();\n $this->_productLimitationJoinPrice();\n $filters = $this->_productLimitationFilters;\n\n if (!isset($filters['category_id']) && !isset($filters['visibility'])) {\n return $this;\n }\n\n $conditions = array(\n 'cat_index.product_id=e.entity_id',\n $this->getConnection()->quoteInto('cat_index.store_id=?', $filters['store_id'])\n );\n if (isset($filters['visibility']) && !isset($filters['store_table'])) {\n $conditions[] = $this->getConnection()\n ->quoteInto('cat_index.visibility IN(?)', $filters['visibility']);\n }\n\n if (!$this->getFlag('disable_root_category_filter')) {\n if (is_array($filters['category_id'])) {\n $categoryIdConditions = array();\n foreach ($filters['category_id'] as $categoryId) {\n $categoryIdConditions[] = $this->getConnection()->quoteInto('cat_index.category_id = ?',\n $categoryId);\n }\n $conditions[] = '(' . join(' OR ', $categoryIdConditions) . ')';\n } else {\n $conditions[] = $this->getConnection()->quoteInto('cat_index.category_id = ?', $filters['category_id']);\n }\n }\n\n if (isset($filters['category_is_anchor'])) {\n $conditions[] = $this->getConnection()\n ->quoteInto('cat_index.is_parent=?', $filters['category_is_anchor']);\n }\n\n $joinCond = join(' AND ', $conditions);\n $fromPart = $this->getSelect()->getPart(Zend_Db_Select::FROM);\n if (isset($fromPart['cat_index'])) {\n $fromPart['cat_index']['joinCondition'] = $joinCond;\n $this->getSelect()->setPart(Zend_Db_Select::FROM, $fromPart);\n } else {\n $this->getSelect()->join(\n array('cat_index' => $this->getTable('catalog/category_product_index')),\n $joinCond,\n array('cat_index_position' => 'position')\n );\n }\n\n $this->_productLimitationJoinStore();\n\n Mage::dispatchEvent('catalog_product_collection_apply_limitations_after', array(\n 'collection' => $this\n ));\n\n return $this;\n }",
"public function setEmptyProducts(){\n foreach ($this->products as $i => $product) {\n $counts = $product->variant->maxCounts;\n //print_R($product);\n $allCount=0;\n foreach ($counts as $count){\n $allCount = $allCount+$count->count;\n }\n if($allCount<=0 || $product->variant->status==0 || $product->product->status==0 ){\n $product->status=0;\n $product->save(true);\n }\n if($product->count > $allCount){\n $product->count = $allCount;\n $product->save(true);\n }\n if($product->count==0){\n\n //unset($this->products[$i]);\n //$product->status=0;\n //$product->save(true);\n $this->removeProduct($product->id);\n }\n }\n foreach ($this->emptyProducts as $i => $emptyProduct) {\n $emptyCounts = $emptyProduct->variant->maxCounts;\n $emptyAllCount=0;\n foreach ($emptyCounts as $emptyCount){\n $emptyAllCount = $emptyAllCount+$emptyCount->count;\n }\n if($emptyAllCount>0 && $emptyProduct->variant->status==1 && $emptyProduct->product->status==1){\n $emptyProduct->status=1;\n $emptyProduct->save(true);\n }\n }\n }",
"public function addRemoveProducts() {\n\n //date calculation \n $email_content = array();\n $current_date = date(\"Y-m-d 00:00:00\", Mage::getModel('core/date')->timestamp(time()));\n $yesterday_date = date(\"Y-m-d 00:00:00\", Mage::getModel('core/date')->timestamp(time() - 60 * 60 * 24));\n\n\n //case 1 \n if (Mage::getStoreConfig('sale_category/general/t_shirt_of_day_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/t_shirt_of_day');\n $attr_name = 'special_to_date';\n $email_content['shirt']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'special_from_date';\n $email_content['shirt']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n\n //case 2 \n if (Mage::getStoreConfig('sale_category/general/after_hour_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/after_hour');\n $attr_name = 'afterhours_to_date';\n $email_content['after_hour']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'afterhours_from_date';\n $email_content['after_hour']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n\n //case 3 \n if (Mage::getStoreConfig('sale_category/general/gallery_enable')) {\n\n //category\n $catid = Mage::getStoreConfig('sale_category/general/gallery');\n $attr_name = 'gallery_to_date';\n $email_content['gallery']['removed'] = $this->removeProduct($catid, $yesterday_date, $attr_name);\n $attr_name = 'gallery_from_date';\n $email_content['gallery']['added'] = $this->addProduct($catid, $current_date, $attr_name);\n }\n if (Mage::getStoreConfig('sale_category/general/offer_mail')) {\n $newContent = \"Hi,<br/> These are the products Added or Removed through Auto Sale Extension\";\n $headers = \"MIME-Version: 1.0\" . \"\\r\\n\";\n $headers .= \"Content-type:text/html;charset=iso-8859-1\" . \"\\r\\n\";\n $headers .= 'From: <' . Mage::getStoreConfig('general/store_information/name') . '@magento.com>';\n \n $newContent .='<br/><br/><b><u>T-Shirt of the day </u></b><br/>Added Products';\n foreach ($email_content['shirt']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['shirt']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/><b><u>After Hour </u></b><br/>Added Products';\n foreach ($email_content['after_hour']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['after_hour']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/><b><u>Gallery </u></b><br/>Added Products';\n foreach ($email_content['gallery']['added'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n $newContent .='<br/><br/>Removed Products';\n foreach ($email_content['gallery']['removed'] as $prod_id => $prod_name) {\n $newContent .='<br/>' . $prod_id . ' - ' . $prod_name;\n }\n\n $newContent .='<br/><br/> Thanks....<br/>';\n mail(Mage::getStoreConfig('trans_email/ident_general/email'), \"Product Added/Removed By Auto Sale Extension\", $newContent, $headers);\n }\n\n //mage::log($email_content);\n }",
"function es_add_product_meta_action() {\n\t\n\tremove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );\n\t\n\tif(is_product()) {\n\t\tglobal $product;\n\t\n\t\t$hide_category = false;\n\t\t$product_cats = wp_get_post_terms( $product->id, 'product_cat' );\n\t\n\t\tforeach($product_cats as $category) {\n\t\t\tif ($category->slug != 'hidden-front-end-user'){\n\t\t\t\tadd_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\t\n\t}\n}",
"public function SetPanelSettings()\n\t{\n\t\t$GLOBALS['ISC_CLASS_PRODUCT'] = GetClass('ISC_PRODUCT');\n\t\t$id = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId();\n\t\t// How many tags do we have?\n\t\t$query = \"\n\t\t\tSELECT p.* , pi.imagefilethumb\n\t\t\tFROM isc_products p\n\t\t\tINNER JOIN isc_product_associations pa ON ( \n\t\t\t\tpa.assocbaseid = \" . $id . \" AND pa.assocprodid = p.productid\n\t\t\t) \n\t\t\tINNER JOIN isc_product_images pi ON ( \n\t\t\t\tpi.imageprodid = pa.assocprodid AND pi.imageisthumb = 1\n\t\t\t) \n\t\t\";\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\n\t\t$GLOBALS['SNIPPETS']['ProductMadeByList'] = '';\n\t\twhile($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t$GLOBALS['ComponentImg'] = GetConfig('ShopPath') . '/' . GetConfig('ImageDirectory') . '/' . $row['imagefilethumb'];\n\t\t\t$GLOBALS['ComponentName'] = $row['prodname'];\n\t\t\t$GLOBALS['ComponentLink'] = ProdLink($row['prodname']);\n\t\t\t$GLOBALS['SNIPPETS']['ProductMadeByList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductMadeByItem');\n\t\t}\n\t\t\n\t\tif($GLOBALS['SNIPPETS']['ProductMadeByList'] == '') {\n\t\t\t$this->DontDisplay = true;\n\t\t}\n\t}",
"function limit_engine_to_products( $settings ) {\n\t\tif ( $this->woocommerce_query ) {\n\t\t\tforeach ( $settings as $engine_post_type => $options ) {\n\t\t\t\tif ( $this->post_type !== $engine_post_type ) {\n\t\t\t\t\t$settings[ $engine_post_type ]['enabled'] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $settings;\n\t}",
"function fn_product_variations_convert_to_configurable_product($product_id)\n{\n $auth = array();\n\n $product = fn_get_product_data($product_id, $auth);\n $languages = Languages::getAll();\n $product_options = fn_get_product_options($product_id, CART_LANGUAGE, true);\n $product_row = db_get_row('SELECT * FROM ?:products WHERE product_id = ?i', $product_id);\n $product_variation_ids = db_get_fields('SELECT product_id FROM ?:products WHERE parent_product_id = ?i', $product_id);\n $product_exceptions = fn_get_product_exceptions($product_id);\n\n foreach ($product_variation_ids as $product_variation_id) {\n fn_delete_product($product_variation_id);\n }\n\n $options_ids = array();\n $inventory_combinations = db_get_array('SELECT * FROM ?:product_options_inventory WHERE product_id = ?i', $product_id);\n $index = 0;\n\n foreach ($inventory_combinations as $item) {\n $index++;\n $selected_options = array();\n $parts = array_chunk(explode('_', $item['combination']), 2);\n\n foreach ($parts as $part) {\n $selected_options[$part[0]] = $part[1];\n }\n\n $combination = fn_product_variations_get_variation_by_selected_options(\n $product,\n $product_options,\n $selected_options,\n $index\n );\n\n if (!empty($item['product_code'])) {\n $combination['code'] = $item['product_code'];\n }\n\n if (!empty($item['amount'])) {\n $combination['amount'] = $item['amount'];\n }\n\n $is_allow = true;\n\n if ($product_row['exceptions_type'] == 'F') {\n foreach ($product_exceptions as $exception) {\n\n foreach ($exception['combination'] as $option_id => &$variant_id) {\n if ($variant_id == OPTION_EXCEPTION_VARIANT_ANY || $variant_id == OPTION_EXCEPTION_VARIANT_NOTHING) {\n $variant_id = isset($combination['selected_options'][$option_id]) ? $combination['selected_options'][$option_id] : null;\n }\n }\n unset($variant_id);\n\n if ($exception['combination'] == $combination['selected_options']) {\n $is_allow = false;\n break;\n }\n }\n } elseif ($product_row['exceptions_type'] == 'A') {\n $is_allow = false;\n\n foreach ($product_exceptions as $exception) {\n\n foreach ($exception['combination'] as $option_id => &$variant_id) {\n if ($variant_id == OPTION_EXCEPTION_VARIANT_ANY) {\n $variant_id = isset($combination['selected_options'][$option_id]) ? $combination['selected_options'][$option_id] : null;\n }\n }\n unset($variant_id);\n\n if ($exception['combination'] == $combination['selected_options']) {\n $is_allow = true;\n break;\n }\n }\n }\n\n if (!$is_allow) {\n continue;\n }\n\n $variation_id = fn_product_variations_save_variation($product_row, $combination, $languages);\n\n $image = fn_get_image_pairs($item['combination_hash'], 'product_option', 'M', true, true);\n\n if ($image) {\n $detailed = $icons = array();\n $pair_data = array(\n 'type' => 'M'\n );\n\n if (!empty($image['icon'])) {\n $tmp_name = fn_create_temp_file();\n Storage::instance('images')->export($image['icon']['relative_path'], $tmp_name);\n $name = fn_basename($image['icon']['image_path']);\n\n $icons[$image['pair_id']] = array(\n 'path' => $tmp_name,\n 'size' => filesize($tmp_name),\n 'error' => 0,\n 'name' => $name\n );\n\n $pair_data['image_alt'] = empty($image['icon']['alt']) ? '' : $image['icon']['alt'];\n }\n\n if (!empty($image['detailed'])) {\n $tmp_name = fn_create_temp_file();\n Storage::instance('images')->export($image['detailed']['relative_path'], $tmp_name);\n $name = fn_basename($image['detailed']['image_path']);\n\n $detailed[$image['pair_id']] = array(\n 'path' => $tmp_name,\n 'size' => filesize($tmp_name),\n 'error' => 0,\n 'name' => $name\n );\n\n $pair_data['detailed_alt'] = empty($image['detailed']['alt']) ? '' : $image['detailed']['alt'];\n }\n\n $pairs_data = array(\n $image['pair_id'] => $pair_data\n );\n\n fn_update_image_pairs($icons, $detailed, $pairs_data, $variation_id, 'product');\n }\n }\n\n if (!empty($selected_options)) {\n $options_ids = array_keys($selected_options);\n }\n\n db_query(\n 'UPDATE ?:products SET product_type = ?s, variation_options = ?s WHERE product_id = ?i',\n ProductManager::PRODUCT_TYPE_CONFIGURABLE, json_encode(array_values($options_ids)), $product_id\n );\n\n fn_delete_product_option_combinations($product_id);\n db_query('DELETE FROM ?:product_options_exceptions WHERE product_id = ?i', $product_id);\n}",
"public function setNoMultiShipping(){\n $emptyCache = false;\n $db = JFactory::getDBO();\n if (JeproshopSettingModelSetting::getValue('allow_multi_shipping')){\n // Upgrading quantities\n $query = \"SELECT sum(\" . $db->quoteName('quantity') . \") AS quantity, product_id, product_attribute_id, count(*) as count FROM \";\n $query .= $db->quoteName('#__jeproshop_cart_product') . \" WHERE \" . $db->quoteName('cart_id') . \" = \" . (int)$this->cart_id . \" AND \" ;\n $query .= $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id . \" GROUP BY product_id, product_attribute_id HAVING count > 1\";\n\n $db->setQuery($query);\n $products = $db->loadObjectList();\n\n foreach ($products as $product){\n $query = \"UPDATE \" . $db->quoteName('#__jeproshop_cart_product') . \" SET \" . $db->quoteName('quantity') . \" = \" . $product->quantity;\n $query .= \"\tWHERE \" . $db->quoteName('cart_id') . \" = \".(int)$this->cart_id . \" AND \" . $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id ;\n $query .= \" AND product_id = \" . $product->product_id . \" AND product_attribute_id = \" . $product->product_attribute_id;\n $db->setQuery($query);\n if ($db->query())\n $emptyCache = true;\n }\n\n // Merging multiple lines\n $query = \"DELETE cart_product_1 FROM \" . $db->quoteName('#__jeproshop_cart_product') . \" AS cart_product_1 INNER JOIN \";\n $query .= $db->quoteName('#__jeproshop_cart_product') . \" AS cart_product_2 ON ((cart_product_1.cart_id = cart_product_2.\";\n $query .= \"cart_id) AND (cart_product_1.product_id = cart_product_2.product_id) AND (cart_product_1.product_attribute_id = \";\n $query .= \"cart_product_2.product_attribute_id) AND (cart_product_1.address_delivery_id <> cart_product_2.address_delivery_id) \";\n $query .= \" AND (cart_product_1.date_add > cart_product_2.date_add) )\";\n $db->setQuery($query);\n $db->query();\n }\n\n // Update delivery address for each product line\n $query = \"UPDATE \" . $db->quoteName('#__jeproshop_cart_product') . \" SET \" . $db->quoteName('address_delivery_id') . \" = ( SELECT \";\n $query .= $db->quoteName('address_delivery_id') . \" FROM \" . $db->quoteName('#__jeproshop_cart') . \" WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . \" AND \" . $db->quoteName('shop_id') . \" = \" . (int)$this->shop_id . \") WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . (JeproshopSettingModelSetting::getValue('allow_multi_shipping') ? \" AND \" . $db->quoteName('shop_id') . \" = \" .(int)$this->shop_id : \"\");\n\n $db->setQuery($query);\n\n $cache_id = 'jeproshop_cart_set_no_multi_shipping'.(int)$this->cart_id.'_'.(int)$this->shop_id .((isset($this->address_delivery_id) && $this->address_delivery_id) ? '-'.(int)$this->address_delivery_id : '');\n if (!JeproshopCache::isStored($cache_id)){\n $db->setQuery($query);\n if ($result = (bool)$db->query())\n $emptyCache = true;\n JeproshopCache::store($cache_id, $result);\n }\n\n if (JeproshopCustomization::isFeaturePublished()){\n //Db::getInstance()->execute(\n\t\t\t$query = \" UPDATE \" . $db->quoteName('#__jeproshop_customization') . \" SET \" . $db->quoteName('address_delivery_id') . \" = ( SELECT \";\n $query .= $db->quoteName('address_delivery_id') . \" FROM \" . $db->quoteName('#__jeproshop_cart') . \" WHERE \" . $db->quoteName('cart_id');\n $query .= \" = \" . (int)$this->cart_id . \" ) WHERE \" . $db->quoteName('cart_id') . \" = \" .(int)$this->cart_id;\n\n $db->setQuery($query);\n $db->query();\n }\n if ($emptyCache){\n $this->_products = null;\n }\n }",
"public function afterSave()\n {\n // from the product. Otherwise we will end up with duplicated values.\n if ($this->getOriginal('inventory_management_method') === 'single' && $this->inventory_management_method === 'variant') {\n $this->forceReindex = true;\n $properties = $this->categories->flatMap->properties->filter(function ($q) {\n return $q->pivot->use_for_variants;\n })->pluck('id');\n\n PropertyValue\n ::where('product_id', $this->id)\n ->whereNull('variant_id')\n ->whereIn('property_id', $properties)\n ->delete();\n }\n\n if ($this->forceReindex) {\n $this->forceReindex = false;\n (new ProductObserver(app(Index::class)))->updated($this);\n }\n }",
"private function __adjustProduct (&$product, $skipRelations = true) {\n global $app;\n // adjusting\n $productID = intval($product['ID']);\n $product['ID'] = $productID;\n $product['OriginID'] = intval($product['OriginID']);\n $product['CategoryID'] = intval($product['CategoryID']);\n $product['_category'] = API::getAPI('shop:categories')->getCategoryByID($product['CategoryID']);\n $product['_origin'] = API::getAPI('shop:origins')->getOriginByID($product['OriginID']);\n $product['Attributes'] = $this->getProductAttributes($productID);\n $product['IsPromo'] = intval($product['IsPromo']) === 1;\n $product['IsFeatured'] = intval($product['IsFeatured']) === 1;\n $product['IsOffer'] = intval($product['IsOffer']) === 1;\n $product['ShowBanner'] = intval($product['ShowBanner']) === 1;\n\n // create display product title\n $displayName = array();\n if (!empty($product['Name'])) {\n $displayName[] = $product['Name'];\n }\n if (!empty($product['_origin'])) {\n $displayName[] = $product['_origin']['Name'];\n }\n if (!empty($product['Model'])) {\n $displayName[] = $product['Model'];\n }\n $product['_displayNameFull'] = implode(' ', $displayName);\n $product['_displayName'] = implode(' ', array_slice($displayName, 1));\n\n // misc data\n if (!$skipRelations) {\n $product['Relations'] = $this->getProductRelations($productID);\n }\n\n // features\n $product['Features'] = $this->getProductFeatures($productID);\n\n // media\n $product['Images'] = $this->getProductImages($productID);\n $product['Videos'] = $this->getProductVideos($productID);\n $product['Banners'] = $this->getProductBanners($productID);\n\n // Utils\n $product['viewExtrasInWish'] = API::getAPI('shop:wishlists')->productIsInWishList($productID);\n $product['viewExtrasInCompare'] = API::getAPI('shop:comparelists')->productIsInCompareList($productID);\n $product['viewExtrasInCartCount'] = API::getAPI('shop:orders')->productCountInCart($productID);\n\n // is available\n $product['_available'] = in_array($product['Status'], dbquery::getProductStatusesWhenAvailable());\n $product['_archived'] = in_array($product['Status'], dbquery::getProductStatusesWhenDisabled());\n\n // promo\n $promo = API::getAPI('shop:promos')->getSessionPromo();\n $product['_promo'] = $promo;\n\n // prices and actual price\n $price = floatval($product['Price']);\n $prevprice = floatval($product['PrevPrice']);\n $actualPrice = 0;\n $priceHistory = $this->getProductPriceHistory($productID);\n if ($product['IsPromo'] && !empty($promo) && !empty($promo['Discount']) && $promo['Discount'] > 0) {\n $product['_promoIsApplied'] = true;\n $actualPrice = (100 - intval($promo['Discount'])) / 100 * $price;\n } else {\n $product['_promoIsApplied'] = false;\n $actualPrice = $price;\n }\n $actualPrice = floatval($actualPrice);\n $savingValue = $prevprice - $actualPrice;\n unset($product['Price']);\n unset($product['PrevPrice']);\n\n // apply currencies\n $convertedPrices = API::getAPI('shop:exchangerates')->convertToRates($actualPrice);\n $convertedPrevPrices = API::getAPI('shop:exchangerates')->convertToRates($prevprice);\n $convertedSavings = API::getAPI('shop:exchangerates')->convertToRates($savingValue);\n\n // create product prices object\n $product['_prices'] = array(\n 'price' => $price,\n 'previous' => $prevprice,\n 'actual' => $actualPrice,\n 'others' => $convertedPrices,\n 'history' => $priceHistory,\n 'previousothers' => $convertedPrevPrices,\n 'savings' => $savingValue,\n 'savingsothers' => $convertedSavings\n );\n\n $product['ShopDiscount'] = $prevprice > 0 ? 100 - intval($price * 100 / $prevprice) : 0;\n $product['IsBigSavings'] = $product['ShopDiscount'] > 5;\n $product['GoodToShowPreviousPrice'] = $savingValue > 10;\n\n if (!empty($product['Attributes']['PROMO_TEXT'])) {\n $product['Attributes']['PROMO_TEXT'] = str_replace('[DisplayName]', $product['_displayName'], $product['Attributes']['PROMO_TEXT']);\n }\n\n // // save product into recently viewed list\n // $isDirectRequestToProduct = Request::hasInGet('id') || Request::hasInGet('params');\n // if (Request::isGET() && !$app->isToolbox() && !empty($isDirectRequestToProduct)) {\n // $recentProducts = isset($_SESSION[$this->_listKey_Recent]) ? $_SESSION[$this->_listKey_Recent] : array();\n // $recentProducts[] = $productID;\n // $_SESSION[$this->_listKey_Recent] = array_unique($recentProducts);\n // }\n\n // var_dump($product);\n return $product;\n }",
"public function SetPanelSettings()\r\n\t\t{\r\n\t\t\t$products = $this->getProducts();\r\n\t\t\t$GLOBALS['ProductsOffersList'] = \"\";\r\n\r\n\t\t\t// Should we hide the comparison button?\n\t\t\tif(GetConfig('EnableProductComparisons') == 0 || count($products) < 2) {\n\t\t\t\t$GLOBALS['HideCompareItems'] = \"none\";\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(GetConfig('ShowProductRating') == 0) {\r\n\t\t\t\t$GLOBALS['HideProductRating'] = \"display: none\";\r\n\t\t\t}\r\n\r\n\t\t\t$display_mode = ucfirst(GetConfig(\"CategoryDisplayMode\"));\r\n\t\t\tif ($display_mode == \"Grid\") {\r\n\t\t\t\t$display_mode = \"\";\r\n\t\t\t}\r\n\t\t\t$GLOBALS['DisplayMode'] = $display_mode;\r\n\r\n\t\t\tif ($display_mode == \"List\") {\r\n\t\t\t\tif (GetConfig('ShowAddToCartLink') && count($products) > 0) {\r\n\t\t\t\t\t$GLOBALS['HideAddButton'] = '';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$GLOBALS['HideAddButton'] = 'none';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$GLOBALS['ListJS'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ListCheckForm\");\r\n\t\t\t}\r\n\r\n\t\t\t$GLOBALS['CompareButton'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CompareButton\" . $display_mode);\r\n\r\n\t\t\tif (GetConfig('CategoryProductsPerPage') > 0) {\n\t\t\t\t$this->_numpages = ceil(count($products) / GetConfig('CategoryProductsPerPage'));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->_numpages = 0;\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($display_mode == \"List\" && $this->_numpages > 1) {\r\n\t\t\t\t$GLOBALS['CompareButtonTop'] = $GLOBALS['CompareButton'];\r\n\t\t\t}\r\n\r\n\t\t\t$GLOBALS['AlternateClass'] = '';\r\n\t\t\tforeach($products as $row) {\r\n\t\t\t\t$this->setProductGlobals($row);\r\n\r\n\t\t\t\t// for list style\r\n\t\t\t\tif ($display_mode == \"List\") {\r\n\t\t\t\t\t// get a small chunk of the product description\r\n\t\t\t\t\t$desc = isc_substr(strip_tags($row['proddesc']), 0, 225);\r\n\t\t\t\t\tif (isc_strlen($row['proddesc']) > 225) {\r\n\t\t\t\t\t\t// trim the description back to the last period or space so words aren't cut off\r\n\t\t\t\t\t\t$period_pos = isc_strrpos($desc, \".\");\r\n\t\t\t\t\t\t$space_pos = isc_strrpos($desc, \" \");\r\n\t\t\t\t\t\t// find the character that we should trim back to. -1 on space pos for a space that follows a period, so we dont end up with 4 periods\r\n\t\t\t\t\t\tif ($space_pos - 1 > $period_pos) {\r\n\t\t\t\t\t\t\t$pos = $space_pos;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$pos = $period_pos;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$desc = isc_substr($desc, 0, $pos);\r\n\t\t\t\t\t\t$desc .= \"...\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$GLOBALS['ProductDescription'] = $desc;\r\n\r\n\t\t\t\t\t$GLOBALS['AddToCartQty'] = \"\";\r\n\r\n\t\t\t\t\tif (CanAddToCart($row) && GetConfig('ShowAddToCartLink')) {\r\n\t\t\t\t\t\tif (isId($row['prodvariationid']) || trim($row['prodconfigfields'])!='' || $row['prodeventdaterequired']) {\r\n\t\t\t\t\t\t\t$GLOBALS['AddToCartQty'] = '<a href=\"' . $GLOBALS[\"ProductURL\"] . '\">' . $GLOBALS['ProductAddText'] . \"</a>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t$GLOBALS['CartItemId'] = $GLOBALS['ProductId'];\r\n\t\t\t\t\t\t\t// If we're using a cart quantity drop down, load that\r\n\t\t\t\t\t\t\tif (GetConfig('TagCartQuantityBoxes') == 'dropdown') {\r\n\t\t\t\t\t\t\t\t$GLOBALS['Quantity0'] = \"selected=\\\"selected\\\"\";\r\n\t\t\t\t\t\t\t\t$GLOBALS['QtyOptionZero'] = '<option %%GLOBAL_Quantity0%% value=\"0\">'.GetLang('Quantity').'</option>';\r\n\t\t\t\t\t\t\t\t$GLOBALS['QtySelectStyle'] = 'width: auto;';\r\n\t\t\t\t\t\t\t\t$GLOBALS['AddToCartQty'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CartItemQtySelect\");\r\n\t\t\t\t\t\t\t// Otherwise, load the textbox\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$GLOBALS['ProductQuantity'] = 0;\r\n\t\t\t\t\t\t\t\t$GLOBALS['AddToCartQty'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CartItemQtyText\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} // for grid style\r\n\t\t\t\telse {\r\n\t\t\t\t\t$GLOBALS[\"CompareOnSubmit\"] = \"onsubmit=\\\"return compareProducts(config.CompareLink)\\\"\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$GLOBALS['ProductsOffersList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"HomeProductsOfferItem\" . $display_mode);\r\n\t\t\t}\r\n\r\n\t\t\tif(count($products) == 0) {\r\n\t\t\t\t// There are no products in this category\r\n\t\t\t\t$GLOBALS['ProductsOffersList'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CategoryNoProductsMessage\");\r\n\t\t\t}\r\n\t\t\t\r\n\t\t// Paging\r\n\t\tif(count($products) <= GetConfig('CategoryProductsPerPage')) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Workout the paging data\n\t\t$GLOBALS['SNIPPETS']['PagingData'] = \"\";\n\t\t\n\t\t$maxPagingLinks = 5;\n\t\tif($GLOBALS['ISC_CLASS_TEMPLATE']->getIsMobileDevice()) {\n\t\t\t$maxPagingLinks = 3;\n\t\t}\n\t\t\n\t\t$start = max($this->_page-$maxPagingLinks,1);\n\t\t$end = min($this->_page+$maxPagingLinks, $this->_numpages);\n\t\t\n\t\t$queryStringAppend = array(\n\t\t\t\t'sort' => $this->_sort,\n\t\t);\n\t\t\n\t\tif(!empty($_GET['price_min'])) {\n\t\t\t$queryStringAppend['price_min'] = (float)$_GET['price_min'];\n\t\t}\n\t\t\n\t\tif(!empty($_GET['price_max'])) {\n\t\t\t$queryStringAppend['price_max'] = (float)$_GET['price_max'];\n\t\t}\n\t\t\n\t\t\n\t\tfor ($page = $start; $page <= $end; $page++) {\n\t\t\tif($page == $this->_page) {\n\t\t\t\t$snippet = \"CategoryPagingItemCurrent\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$snippet = \"CategoryPagingItem\";\n\t\t\t}\n\t\t\n\t\t\t$pageQueryStringAppend = $queryStringAppend;\n\t\t\t$pageQueryStringAppend['page'] = $page;\r\n\t\t\t$GLOBALS['PageLink'] = $this->getPageLink($pageQueryStringAppend);\n\t\t\t$GLOBALS['PageNumber'] = $page;\n\t\t\t$GLOBALS['SNIPPETS']['PagingData'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet($snippet);\n\t\t}\n\t\t\n\t\t// Parse the paging snippet\n\t\tif($this->_page > 1) {\n\t\t\t// Do we need to output a \"Previous\" link?\n\t\t\t$pageQueryStringAppend = $queryStringAppend;\n\t\t\t$pageQueryStringAppend['page'] = $this->_page- 1;\n\t\t\t$GLOBALS['PrevLink'] = $this->getPageLink($pageQueryStringAppend);\n\t\t\t$GLOBALS['SNIPPETS']['CategoryPagingPrevious'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CategoryPagingPrevious\");\n\t\t}\n\t\t\n\t\tif($this->_page < $this->_numpages) {\n\t\t\t// Do we need to output a \"Next\" link?\n\t\t\t$pageQueryStringAppend = $queryStringAppend;\n\t\t\t$pageQueryStringAppend['page'] = $this->_page + 1;\r\n\t\t\t$GLOBALS['NextLink'] = $this->getPageLink($pageQueryStringAppend);\n\t\t\t$GLOBALS['SNIPPETS']['CategoryPagingNext'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CategoryPagingNext\");\n\t\t}\n\t\t\n\t\t$output = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"CategoryPaging\");\n\t\t$output = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output, $GLOBALS['SNIPPETS']);\n\t\t$GLOBALS['SNIPPETS']['CategoryPaging'] = $output;\r\n\t\t}",
"function fn_rebuild_product_options_inventory($product_id, $amount = 50)\n{\n\n\t$_options = db_get_fields(\"SELECT a.option_id FROM ?:product_options as a LEFT JOIN ?:product_global_option_links as b ON a.option_id = b.option_id WHERE (a.product_id = ?i OR b.product_id = ?i) AND a.option_type IN ('S','R','C') AND a.inventory = 'Y' ORDER BY position\", $product_id, $product_id);\n\n\tif (empty($_options)) {\n\t\treturn;\n\t}\n\n\tdb_query(\"UPDATE ?:product_options_inventory SET temp = 'Y' WHERE product_id = ?i\", $product_id);\n\tforeach ($_options as $k => $option_id) {\n\t\t$variants[$k] = db_get_fields(\"SELECT variant_id FROM ?:product_option_variants WHERE option_id = ?i ORDER BY position\", $option_id);\n\t}\n\t$combinations = fn_look_through_variants($product_id, $amount, $_options, $variants);\n\n\t// Delete image pairs assigned to old combinations\n\t// $hashes = db_get_fields(\"SELECT combination_hash FROM ?:product_options_inventory WHERE product_id = ?i AND temp = 'Y'\", $product_id);\n\t// foreach ($hashes as $v) {\n\t\t// fn_delete_image_pairs($v, 'product_option');\n\t// }\n\t\n\t// Delete old combinations\n\tdb_query(\"DELETE FROM ?:product_options_inventory WHERE product_id = ?i AND temp = 'Y'\", $product_id);\n\n\treturn true;\n}",
"public function testConditionOverride() {\n\t\t$products = $this->productsManager->filter(Attr::id()->lt(3))->find(Attr::category()->eq('Clothes'));\n\t\t$this->assertCount(3, $products);\n\t}",
"function ciniki_products_typeObjectDefUpdate($ciniki, $object_def, $args) {\n\n if( $object_def == NULL ) {\n $object_def = array(\n 'name'=>array('name_s'=>'', 'name_p'=>''),\n );\n }\n if( !isset($object['parent']) ) {\n $object['parent'] = array('products'=>array());\n }\n if( !isset($object['parent']['products']) ) {\n $object['parent']['products'] = array();\n }\n\n $product_fields = array(\n 'name',\n 'code',\n 'sequence',\n 'category',\n 'source',\n 'flags',\n 'status',\n 'barcode',\n 'supplier_tnid',\n 'supplier_product_id',\n 'price',\n 'unit_discount_amount',\n 'unit_discount_percentage',\n 'taxtype_id',\n 'cost',\n 'msrp',\n 'sell_unit',\n 'supplier_id',\n 'supplier_item_number',\n 'supplier_minimum_order',\n 'supplier_order_multiple',\n 'manufacture_min_time',\n 'manufacture_max_time',\n 'inventory_flags',\n 'inventory_current_num',\n 'inventory_reorder_num',\n 'inventory_reorder_quantity',\n 'shipping_flags',\n 'shipping_weight',\n 'shipping_weight_units',\n 'shipping_length',\n 'shipping_width',\n 'shipping_height',\n 'shipping_size_units',\n 'primary_image_id',\n 'short_description',\n 'long_description',\n 'description',\n 'start_date',\n 'end_date',\n 'webflags',\n 'detail01',\n 'detail02',\n 'detail03',\n 'detail04',\n 'detail05',\n 'detail06',\n 'detail07',\n 'detail08',\n 'detail09',\n );\n foreach($product_fields as $field) {\n if( isset($args['parent_product_' . $field]) ) {\n if( $args['parent_product_' . $field] == 'on' ) {\n $object_def['parent']['products'][$field] = array();\n } elseif( $args['parent_product_' . $field] == 'off' \n && isset($object_def['parent']['products'][$field]) ) {\n unset($object_def['parent']['products'][$field]);\n }\n }\n if( (!isset($args['parent_product_' . $field . '-name']) || $args['parent_product_' . $field . '-name'])\n && isset($args['parent_product_' . $field . '-name']) ) {\n if( isset($object_def['parent']['products']) ) {\n $object_def['parent']['products'][$field]['name'] = $args['parent_product_' . $field . '-name'];\n }\n }\n if( isset($args['child_product_' . $field]) ) {\n if( $args['child_product_' . $field] == 'on' ) {\n if( !isset($object_def['child']) ) {\n $object_def['child'] = array('products'=>array());\n }\n $object_def['child']['products'][$field] = array();\n } elseif( $args['child_product_' . $field] == 'off' \n && isset($object_def['child']['products'][$field]) ) {\n unset($object_def['child']['products'][$field]);\n }\n }\n if( (!isset($args['child_product_' . $field . '-name']) || $args['child_product_' . $field . '-name'])\n && isset($args['child_product_' . $field . '-name']) ) {\n if( isset($object_def['child']['products']) ) {\n $object_def['child']['products'][$field]['name'] = $args['child_product_' . $field . '-name'];\n }\n }\n }\n\n $price_fields = array(\n 'name',\n 'pricepoint_id',\n 'available_to',\n 'min_quantity',\n 'unit_amount',\n 'unit_discount_amount',\n 'unit_discount_percentage',\n 'taxtype_id',\n 'start_date',\n 'end_date',\n 'webflags',\n );\n\n foreach($price_fields as $field) {\n if( isset($args['parent_price_' . $field]) ) {\n if( $args['parent_price_' . $field] == 'on' ) {\n if( !isset($object_def['parent']['prices']) ) { $object_def['parent']['prices'] = array(); }\n $object_def['parent']['prices'][$field] = array();\n } elseif( $args['parent_price_' . $field] == 'hidden' ) {\n if( !isset($object_def['parent']['prices']) ) { $object_def['parent']['prices'] = array(); }\n $object_def['parent']['prices'][$field] = array('ui-hide'=>'yes');\n } elseif( $args['parent_price_' . $field] == 'off' \n && isset($object_def['parent']['prices'][$field]) ) {\n unset($object_def['parent']['prices'][$field]);\n }\n if( $args['parent_price_' . $field] != 'off' ) {\n if( isset($args['parent_price_' . $field . '-default']) \n && $args['parent_price_' . $field . '-default'] != '' ) {\n $object_def['parent']['prices'][$field]['default'] = $args['parent_price_' . $field . '-default'];\n }\n }\n }\n if( isset($args['child_price_' . $field]) ) {\n if( $args['child_price_' . $field] == 'on' ) {\n if( !isset($object_def['child']) ) { $object_def['child'] = array('products'=>array()); }\n if( !isset($object_def['child']['prices']) ) { $object_def['child']['prices'] = array(); }\n $object_def['child']['prices'][$field] = array();\n } elseif( $args['child_price_' . $field] == 'off' \n && isset($object_def['child']['prices'][$field]) ) {\n unset($object_def['child']['prices'][$field]);\n }\n }\n }\n\n //\n // Remove old ones\n //\n if( isset($object_def['parent']['subcategories']) ) { unset($object_def['parent']['subcategories']); }\n\n// $args['object_def'] = serialize($object_def);\n\n //\n // Check for subcategories\n //\n for($i=11;$i<30;$i++) {\n $field = 'parent_subcategories-' . $i;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['parent']['subcategories-' . $i] = array();\n if( isset($args[$field . '-sname']) ) {\n $object_def['parent']['subcategories-' . $i]['sname'] = $args[$field . '-sname'];\n }\n if( isset($args[$field . '-pname']) ) {\n $object_def['parent']['subcategories-' . $i]['pname'] = $args[$field . '-pname'];\n }\n } elseif( $args[$field] == 'off' && isset($object_def['parent']['subcategories-' . $i]) ) {\n unset($object_def['parent']['subcategories-' . $i]);\n }\n }\n }\n\n $extras = array('categories', \n// 'subcategories-11', 'subcategories-12', 'subcategories-13', 'subcategories-14', 'subcategories-15', \n 'tags', 'images', 'audio', 'files', 'similar', 'recipes');\n foreach($extras as $extra) {\n $field = 'parent_' . $extra;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['parent'][$extra] = array();\n } elseif( $args[$field] == 'off' && isset($object_def['parent'][$extra]) ) {\n unset($object_def['parent'][$extra]);\n }\n }\n $field = 'child_' . $extra;\n if( isset($args[$field]) ) {\n if( $args[$field] == 'on' ) {\n $object_def['child'][$extra] = array();\n } elseif( $args[$field] == 'off' && isset($object_def['child'][$extra]) ) {\n unset($object_def['child'][$extra]);\n }\n }\n }\n\n return array('stat'=>'ok', 'object_def'=>$object_def);\n}",
"protected function _prepareColumns()\n {\n $this->addColumn('in_products', array(\n 'header_css_class' => 'a-center',\n 'type' => 'checkbox',\n 'field_name' => 'in_products',\n 'values' => $this->_getSelectedProducts(),\n 'align' => 'center',\n 'index' => 'entity_id'\n ));\n\n /*$this->addColumn('entity_id',\n array(\n 'header'=> Mage::helper('catalog')->__('ID'),\n 'width' => 50,\n 'sortable' => true,\n 'type' => 'number',\n 'index' => 'entity_id',\n ));*/\n $this->addColumn('product_name',\n array(\n 'header'=> Mage::helper('catalog')->__('Name'),\n 'index' => 'name',\n ));\n\n $this->addColumn('type',\n array(\n 'header' => Mage::helper('catalog')->__('Type'),\n 'width' => 100,\n 'index' => 'type_id',\n 'type' => 'options',\n 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),\n ));\n\n $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')\n ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())\n ->load()\n ->toOptionHash();\n\n $this->addColumn('set_name',\n array(\n 'header' => Mage::helper('catalog')->__('Attrib. Set Name'),\n 'width' => 100,\n 'index' => 'attribute_set_id',\n 'type' => 'options',\n 'options' => $sets,\n ));\n\n $this->addColumn('sku',\n array(\n 'header'=> Mage::helper('catalog')->__('SKU'),\n 'width' => 80,\n 'index' => 'sku',\n ));\n\n $this->addColumn('price',\n array(\n 'header' => Mage::helper('catalog')->__('Price'),\n 'type' => 'price',\n 'currency_code' => Mage::app()->getStore()->getBaseCurrency()->getCode(),\n 'index' => 'price',\n ));\n\n $this->addColumn('visibility',\n array(\n 'header' => Mage::helper('catalog')->__('Visibility'),\n 'width' => 100,\n 'index' => 'visibility',\n 'type' => 'options',\n 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray(),\n ));\n\n $this->addColumn('status',\n array(\n 'header' => Mage::helper('catalog')->__('Status'),\n 'width' => 70,\n 'index' => 'status',\n 'type' => 'options',\n 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(),\n ));\n\n $this->addColumn('source_store',\n array(\n 'header'=> Mage::helper('catalog')->__('Source Store'),\n 'width' => '100px',\n 'sortable' => false,\n 'index' => 'source_store_view',\n 'type' => 'options',\n 'options' => Mage::getModel('unl_core/store_source_filter')->toOptionArray(),\n ));\n\n return parent::_prepareColumns();\n }",
"function single_cart_button_availability() {\n\n $availability_by_warehouse = get_product_availability_by_warehouse(get_the_ID());\n\n if( !array_sum($availability_by_warehouse) ) {\n remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );\n }\n}",
"public function updateAllStoreAssociations() {\n\n $allstores = $this->getStores(null, 1);\n $this->load->model('user/productset');\n\n //echo count($allstores);\n\n //print_r($allstores);\n foreach ($allstores as $store_info) {\n //KMC new category management, disabled all categories first.\n //\n // ???? SHOULD I DELETE CATEGORIES FOR THE STORE/PRODUCTSETS FIRST??\n // Yes, I think we should otherwise we will not pick up good changes.\n $this->db->query(\"DELETE FROM \". DB_PREFIX . \"category WHERE store_code='\".$store_info['code'].\"'\");\n \n unset($productset_ids);\n\n // This picks up whatever is already set (checked in their catalog list) for a dealer.\n $productset_array = $this->model_user_productset->getProductsetsForStoreId($store_info['store_id']);\n\n foreach ($productset_array as $pset)\n {\n $productset_ids[] = $pset['productset_id'];\n }\n print_r($productset_ids);\n \t \n // For each productset ...\n if ($productset_ids) {\n \t\tforeach ($productset_ids as $productset_id) {\n // Make sure that we have categories defined for this productset, \n // else we have to add them based on our ZZZ store which holds the defaults.\n $this->load->model('catalog/category');\n $this->model_catalog_category->createStoreCategoriesIfNeeded($store_info['code'], $productset_id);\n \t\t}\n \n // Create the product_to_category associations.\n $this->load->model('productset/product');\n $this->model_productset_product->buildProductToCategoryAssociations($store_info['code'], $productset_ids);\n \n // Re-build related products for the dealer based no the default set of ZZZ.\n $this->model_productset_product->buildRelatedProductAssociations($store_info['code'], $productset_ids);\n \n // Now update the store_product table.\n $this->load->model('store/product');\n $this->model_store_product->createUnjunctionedProductRecords($store_info['code']);\n }\n }\n }",
"public function detectCombos()\n {\n foreach ($this->order->getProducts() as $k => $product) {\n if ($product->getCategory() == 'Shampoo') {\n foreach ($this->order->getProducts() as $key => $productB) {\n if ($productB->getCategory() == 'Conditioner') {\n $productB->setDiscount(0.5);\n }\n }\n }\n }\n }",
"public function manageProducts()\r\n {\r\n $multi_submit = $this->getRequest()->getPost('multi_submit');\r\n $entityIds = $this->getRequest()->getParam('id');\r\n $delete = $this->getRequest()->getPost('multi');\r\n /**\r\n * Check if submit buttom submitted.\r\n */\r\n if ($multi_submit) {\r\n if (count($entityIds) > 0 && $delete == 'delete') {\r\n foreach ($entityIds as $entityIdData) {\r\n Mage::register('isSecureArea', true);\r\n Mage::helper('marketplace/marketplace')->deleteProduct($entityIdData);\r\n $this->getRequest()->setPost('id', null);\r\n Mage::unregister('isSecureArea');\r\n }\r\n Mage::getSingleton('core/session')->addSuccess($this->__(\"selected Products are Deleted Successfully\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n\r\n\r\n }\r\n\r\n /*----------------Disable ----------------*/\r\n if (count($entityIds) > 0 && $delete == 'disable') {\r\n $currentStoreId = Mage::app()->getStore()->getStoreId();\r\n Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );\r\n foreach ($entityIds as $entityIdData) {\r\n Mage::register('isSecureArea', true);\r\n Mage::getModel('catalog/product_status')->updateProductStatus($entityIdData, Mage::app()->getStore()->getStoreId() , Mage_Catalog_Model_Product_Status::STATUS_DISABLED);\r\n Mage::unregister('isSecureArea');\r\n $this->getRequest()->setPost('id', null);\r\n }\r\n Mage::app ()->setCurrentStore ( $currentStoreId );\r\n\r\n Mage::getSingleton('core/session')\r\n ->addSuccess($this->__(\"selected Products has been disabled Successfully.\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n\r\n if (count($entityIds) == 0 && $delete == 'disable') {\r\n Mage::getSingleton('core/session')->addError($this->__(\"Please select a product to update status\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n\r\n /*----------------Disable End----------------*/\r\n\r\n /*----------------Sold Out ----------------*/\r\n if (count($entityIds) > 0 && $delete == 'soldout') {\r\n $currentStoreId = Mage::app()->getStore()->getStoreId();\r\n Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );\r\n foreach ($entityIds as $entityIdData) {\r\n Mage::register('isSecureArea', true);\r\n Mage::helper('marketplace/marketplace')->outOfStock($entityIdData);\r\n Mage::unregister('isSecureArea');\r\n $this->getRequest()->setPost('id', null);\r\n }\r\n Mage::app ()->setCurrentStore ( $currentStoreId );\r\n Mage::getSingleton('core/session')\r\n ->addSuccess($this->__(\"selected Products status has been sold Out Successfully and Un Publish\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n\r\n if (count($entityIds) == 0 && $delete == 'soldout') {\r\n Mage::getSingleton('core/session')->addError($this->__(\"Please select a product to update status\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n /*--------------------- END -------------------------*/\r\n /*----------------paused ----------------*/\r\n if (count($entityIds) > 0 && $delete == 'paused') {\r\n $currentStoreId = Mage::app()->getStore()->getStoreId();\r\n Mage::app ()->setCurrentStore ( Mage_Core_Model_App::ADMIN_STORE_ID );\r\n foreach ($entityIds as $entityIdData) {\r\n Mage::register('isSecureArea', true);\r\n Mage::helper('marketplace/marketplace')->pausedStock($entityIdData);\r\n Mage::unregister('isSecureArea');\r\n $this->getRequest()->setPost('id', null);\r\n }\r\n Mage::app ()->setCurrentStore ( $currentStoreId );\r\n Mage::getSingleton('core/session')\r\n ->addSuccess($this->__(\"selected Products status has been sold Out Successfully and Un Publish\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n\r\n if (count($entityIds) == 0 && $delete == 'paused') {\r\n Mage::getSingleton('core/session')->addError($this->__(\"Please select a product to update status\"));\r\n $url = Mage::getUrl('marketplace/product/manage');\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($url);\r\n }\r\n /*--------------------- END -------------------------*/\r\n }\r\n $filterPrice = $this->getRequest()->getParam('filter_price');\r\n $filterStatus = $this->getRequest()->getParam('filter_status');\r\n $ProductStatus = $this->getRequest()->getParam('product_status');\r\n $filterId = $this->getRequest()->getParam('filter_id');\r\n $filterName = $this->getRequest()->getParam('filter_name');\r\n $filterQuantity = $this->getRequest()->getParam('filter_quantity');\r\n $filterProductType = $this->getRequest()->getParam('filter_product_type');\r\n $cusId = Mage::getSingleton('customer/session')->getCustomer()->getId();\r\n $products = Mage::getModel('catalog/product')->getCollection();\r\n $products->addAttributeToSelect('*');\r\n $products->addAttributeToFilter('seller_id', array(\r\n 'eq' => $cusId,\r\n ));\r\n\r\n $products = Mage::helper('marketplace/product')->productFilterByAttribute('name', $filterName, $products);\r\n $products = Mage::helper('marketplace/product')->productFilterByAttribute('entity_id', $filterId, $products);\r\n $products = Mage::helper('marketplace/product')->productFilterByAttribute('price', $filterPrice, $products);\r\n $products = Mage::helper('marketplace/product')->productFilterByAttribute('status', $filterStatus, $products);\r\n $products = Mage::helper('marketplace/product')\r\n ->productFilterByAttribute('seller_product_status', $ProductStatus, $products);\r\n\r\n /**\r\n * confirming filter product type is not empty\r\n */\r\n if (!empty ($filterProductType)) {\r\n $products->addAttributeToFilter('type_id', array(\r\n 'eq' => $filterProductType,\r\n ));\r\n }\r\n /**\r\n * Check filter quantity is not equal to empty\r\n */\r\n if ($filterQuantity != '') {\r\n $products->joinField('qty', 'cataloginventory/stock_item', 'qty', 'product_id=entity_id',\r\n '{{table}}.stock_id=1', 'left')->addAttributeToFilter('qty', array(\r\n 'eq' => $filterQuantity,\r\n ));\r\n }\r\n\r\n $products->addAttributeToFilter('visibility', array(\r\n 'eq' => Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH,\r\n ));\r\n $products->addAttributeToSort('entity_id', 'DESC');\r\n\r\n return $products;\r\n }",
"public function productDisableStatus($customerId){\n $productCollections = Mage::getModel ( 'catalog/product' )->getCollection ()->addAttributeToFilter ( 'userid', $customerId)->addAttributeToFilter ( 'type_id', array (\n 'eq' => 'property'\n ) );\n /**\n * Iterating the loop\n */\n foreach ( $productCollections as $product ) {\n /**\n * Get Product Id\n */\n $productId = $product->getEntityId ();\n $data = array (\n 'propertyapproved' => 0,\n 'status' => 0\n );\n $model = Mage::getModel ( 'catalog/product' )->load ( $productId )->addData ( $data );\n $model->setId ( $productId )->save ();\n }\n }",
"public function clean()\n\t{\n\t\t(($sPlugin = Phpfox_Plugin::get('advancedmarketplace.component_block_category_clean')) ? eval($sPlugin) : false);\n\t}",
"function jigoshop_upgrade_130() {\n\t\n\tglobal $wpdb;\n\t\n\t/* Update all product variation titles to something useful. */\n\t$args = array(\n\t\t'post_type' => 'product',\n\t\t'tax_query' => array(\n\t\t\tarray(\n\t\t\t\t'taxonomy'=> 'product_type',\n\t\t\t\t'terms' => 'variable',\n\t\t\t\t'field' => 'slug',\n\t\t\t\t'operator'=> 'IN'\n\t\t\t)\n\t\t)\n\t);\n\t$posts_array = get_posts( $args );\n\n\tforeach ( $posts_array as $post ) {\n\n\t\t$product = new jigoshop_product ( $post->ID );\n\t\t$var = $product->get_children();\n\n\t\tforeach ( $var as $id ) {\n\n\t\t\t$variation = $product->get_child( $id )->variation_data;\n\t\t\t$taxes = array();\n\n\t\t\tforeach ( $variation as $k => $v ) :\n\n\t\t\t\tif ( strstr ( $k, 'tax_' ) ) {\n\t\t\t\t\t$tax = substr( $k, 4 );\n\t\t\t\t\t$taxes[] = sprintf('[%s: %s]', $tax, !empty($v) ? $v : 'Any ' . $tax );\n\t\t\t\t}\n\n\t\t\tendforeach;\n\n\t\t\tif ( !strstr (get_the_title($id), 'Child Variation' ) )\n\t\t\t\tcontinue;\n\n\t\t\t$title = sprintf('%s - %s', get_the_title($post->ID), implode( $taxes, ' ' ) );\n\t\t\tif ( !empty($title) )\n\t\t\t\t$wpdb->update( $wpdb->posts, array('post_title' => $title), array('ID' => $id) );\n\n\t\t}\n\n\t}\n\t\n\t// Convert coupon options to new 'shop_coupon' custom post type and create posts\n\t$args = array(\n\t\t'numberposts'\t=> -1,\n\t\t'post_type'\t\t=> 'shop_coupon',\n\t\t'post_status'\t=> 'publish'\n\t);\n\t$new_coupons = (array) get_posts( $args );\n\tif ( empty( $new_coupons )) { /* probably an upgrade from 1.2.3 or less, convert options based coupons */\n\t\t$coupons = get_option( 'jigoshop_coupons' );\n\t\t$coupon_data = array(\n\t\t\t'post_status' => 'publish',\n\t\t\t'post_type' => 'shop_coupon',\n\t\t\t'post_author' => 1,\n\t\t\t'post_name' => '',\n\t\t\t'post_content' => '',\n\t\t\t'comment_status' => 'closed'\n\t\t);\n\t\tif ( ! empty( $coupons )) foreach ( $coupons as $coupon ) {\n\t\t\t$coupon_data['post_name'] = $coupon['code'];\n\t\t\t$coupon_data['post_title'] = $coupon['code'];\n\t\t\t$post_id = wp_insert_post( $coupon_data );\n\t\t\tupdate_post_meta( $post_id, 'type', $coupon['type'] );\n\t\t\tupdate_post_meta( $post_id, 'amount', $coupon['amount'] );\n\t\t\tupdate_post_meta( $post_id, 'include_products', $coupon['products'] );\n\t\t\tupdate_post_meta( $post_id, 'date_from', ($coupon['date_from'] <> 0) ? $coupon['date_from'] : '' );\n\t\t\tupdate_post_meta( $post_id, 'date_to', ($coupon['date_to'] <> 0) ? $coupon['date_to'] : '' );\n\t\t\tupdate_post_meta( $post_id, 'individual_use', ($coupon['individual_use'] == 'yes') );\n\t\t}\n\t} else { /* if CPT based coupons from RC1, convert data for incorrect products meta */\n\t\tforeach ( $new_coupons as $id => $coupon ) {\n\t\t\t$product_ids = get_post_meta( $coupon->ID, 'products', true );\n\t\t\tif ( $product_ids <> '' ) update_post_meta( $coupon->ID, 'include_products', $product_ids );\n\t\t\tdelete_post_meta( $coupon->ID, 'products', $product_ids );\n\t\t}\n\t}\n\t\n\tflush_rewrite_rules( true );\n\n}",
"public function cleanProductsInCatalogPriceRule(Varien_Event_Observer $observer) {\n /**\n * @var $engine Brim_PageCache_Model_Engine\n * @var $rule Mage_CatalogRule_Model_Rule\n */\n\n $engine = Mage::getSingleton('brim_pagecache/engine');\n\n if (!$engine->isEnabled()) {\n return;\n }\n\n $engine->devDebug(__METHOD__);\n\n $tags = array();\n $rule = $observer->getEvent()->getRule();\n foreach ($rule->getMatchingProductIds() as $productId) {\n $tags[] = Brim_PageCache_Model_Engine::FPC_TAG . '_PRODUCT_' . $productId;\n }\n $engine->devDebug($tags);\n Mage::app()->getCacheInstance()->clean($tags);\n }",
"protected function warning()\n\t{\n\t\t\\IPS\\Output::i()->output = \\IPS\\Theme::i()->getTemplate( 'store' )->productOptionsChanged(\n\t\t\tnew \\IPS\\Patterns\\ActiveRecordIterator(\n\t\t\t\t\\IPS\\Db::i()->select( '*', 'nexus_packages', \\IPS\\Db::i()->in( 'p_id', explode( ',', \\IPS\\Request::i()->ids ) ) ),\n\t\t\t\t'IPS\\nexus\\Package'\n\t\t\t)\n\t\t);\n\t}",
"public function catalogProductLoadAfter($observer)\n\t{\n\t\tif (! Mage::app()->getStore()->isAdmin())\n\t\t{\n\t\t\t$product = $observer->getEvent()->getProduct();\n\n\t\t\tif ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t * Set the default simple product if an id is specified via query string\n\t\t\t\t */\n\t\t\t\tif ($defaultSimpleProduct = (int) Mage::app()->getRequest()->getParam(self::SELECTION_VAR_NAME, 0))\n\t\t\t\t{\n\t\t\t\t\t$childrenIds = $product->getTypeInstance(true)->getChildrenIds($product->getId());\n\t\t\t\t\tif ($childrenIds && isset($childrenIds[0]) && in_array($defaultSimpleProduct, $childrenIds[0]))\n\t\t\t\t\t{\n\t\t\t\t\t\t$product->setBcpDefaultProductSku(\n\t\t\t\t\t\t Mage::helper('bcp')->getSkuByProductId($defaultSimpleProduct)\n );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/*\n\t\t\t\t * Set the default simple product if none is set to the cheapest\n\t\t\t\t */\n\t\t\t\tif (! $product->getBcpDefaultProductSku() && Mage::helper('bcp')->getUseCheapestChildAsDefault($product))\n\t\t\t\t{\n\t\t\t\t\t/*\n\t\t\t\t\t * According to the system configuration the cheapest simple product should be used as the default, but none is set.\n\t\t\t\t\t *\n\t\t\t\t\t * This is a little resource intensive, the prefered method would be to re-save all products.\n\t\t\t\t\t */\n\t\t\t\t\t$cheapestChild = Mage::helper('bcp')->getCheapestChildProduct($product);\n\t\t\t\t\tif ($cheapestChild && $cheapestChild->getId())\n\t\t\t\t\t{\n\t\t\t\t\t\t$product->setBcpDefaultProductSku($cheapestChild->getSku());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Set the product visibility and update the products attributes\n\t\t\t */\n\t\t\t$request = Mage::app()->getRequest();\n\t\t\tif (\n\t\t\t\t$request->getActionName() == 'gallery' &&\n\t\t\t\t$request->getControllerName() == 'product' &&\n\t\t\t\t$request->getModuleName() == 'catalog'\n\t\t\t)\n\t\t\t{\n\t\t\t\t$product->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_SEARCH);\n\t\t\t};\n\n\t\t\t/*\n\t\t\t * Whenever the configurable product is displayed, we want to show the selected default simple products values.\n\t\t\t * This also triggers the event for external modules to set values on the configurable product.\n\t\t\t * Thats the reason we also need this in the product detail view.\n\t\t\t */\n\t\t\t$this->_updateConfigurableProductAttributes($product);\n\t\t}\n\t}",
"private function _get_filters_section_settings() {\r\n\r\n // Get all product categories\r\n $termArgs = array(\r\n 'taxonomy' => 'product_cat',\r\n 'hide_empty' => false\r\n );\r\n $productTermsObject = get_terms( $termArgs );\r\n $productTerms = array();\r\n\r\n if ( !is_wp_error( $productTermsObject ) ) {\r\n\r\n foreach( $productTermsObject as $term )\r\n $productTerms[ $term->slug ] = $term->name;\r\n\r\n }\r\n\r\n foreach ( WWOF_Product_Listing_Helper::get_all_products( 'ID , post_title' ) as $post ){\r\n $product = wc_get_product( $post->ID );\r\n $allProducts[ WWOF_Functions::wwof_get_product_id( $product ) ] = '[ID : ' . WWOF_Functions::wwof_get_product_id( $product ) . '] ' . $post->post_title;\r\n }\r\n\r\n // Add \"None\" category selection for \"no default\" option\r\n $productTerms2 = array_merge( array ('none' => __( 'No Default' , 'woocommerce-wholesale-order-form' ) ), $productTerms );\r\n\r\n return array(\r\n\r\n array(\r\n 'title' => __( 'Filters Options', 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'title',\r\n 'desc' => '',\r\n 'id' => 'wwof_filters_main_title'\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Product Category Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'multiselect',\r\n 'desc' => __( 'Only display products belonging to the selected category' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_filters_product_category_filter',\r\n 'class' => 'chosen_select',\r\n 'css' => 'min-width:300px;',\r\n 'custom_attributes' => array(\r\n 'multiple' => 'multiple',\r\n 'data-placeholder' => __( 'Select Some Product Categories...' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'options' => $productTerms\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Exclude Product Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'multiselect',\r\n 'desc' => __( 'Exclude selected products' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_filters_exclude_product_filter',\r\n 'class' => 'chosen_select',\r\n 'css' => 'min-width:300px;',\r\n 'custom_attributes' => array(\r\n 'multiple' => 'multiple',\r\n 'data-placeholder' => __( 'Select Some Products...' , 'woocommerce-wholesale-order-form' )\r\n ),\r\n 'options' => $allProducts\r\n ),\r\n\r\n array(\r\n 'title' => __( 'Default Product Category on Search Filter' , 'woocommerce-wholesale-order-form' ),\r\n 'type' => 'select',\r\n 'desc' => __( 'Select a product category to which product are under will be loaded by default in the order form.' , 'woocommerce-wholesale-order-form' ),\r\n 'desc_tip' => true,\r\n 'id' => 'wwof_general_default_product_category_search_filter',\r\n 'class' => 'chosen_select',\r\n 'options' => $productTerms2,\r\n 'default' => 'none'\r\n ),\r\n\r\n array(\r\n 'type' => 'sectionend',\r\n 'id' => 'wwof_filters_sectionend'\r\n )\r\n\r\n );\r\n\r\n }",
"public function clearProducts()\n\t{\n\t\t$sql=\"SET FOREIGN_KEY_CHECKS = 0\";\n\t\t$this->exec_stmt($sql);\n\t\t$tables=array(\"catalog_product_bundle_option\",\n\t\t\t\t\t \"catalog_product_bundle_option_value\",\n\t\t\t\t\t \"catalog_product_bundle_selection\",\n\t\t\t\t\t \"catalog_product_entity_datetime\",\n\t\t\t\t\t \"catalog_product_entity_decimal\",\n\t\t\t\t\t \"catalog_product_entity_gallery\",\n\t\t\t\t\t \"catalog_product_entity_int\",\n\t\t\t\t\t \"catalog_product_entity_media_gallery\",\n\t\t\t\t\t \"catalog_product_entity_media_gallery_value\",\n\t\t\t\t\t \"catalog_product_entity_text\",\n\t\t\t\t\t \"catalog_product_entity_tier_price\",\n\t\t\t\t\t \"catalog_product_entity_varchar\",\n\t\t\t\t\t \"catalog_product_entity\",\n\t\t\t\t\t \"catalog_product_option\",\n\t\t\t\t\t \"catalog_product_option_price\",\n\t\t\t\t\t \"catalog_product_option_title\",\n\t\t\t\t\t \"catalog_product_option_type_price\",\n\t\t\t\t\t \"catalog_product_option_type_title\",\n\t\t\t\t\t \"catalog_product_option_type_value\",\t\t\n\t\t\t\t\t \"catalog_product_super_attribute_label\",\n\t\t\t\t\t \"catalog_product_super_attribute_pricing\",\n\t\t\t\t\t \"catalog_product_super_attribute\",\n\t\t\t\t\t \"catalog_product_super_link\",\n\t\t\t\t\t \"catalog_product_relation\",\n\t\t\t\t\t \"catalog_product_enabled_index\",\n\t\t\t\t\t \"catalog_product_website\",\n\t\t\t\t\t \"catalog_category_product_index\",\n\t\t\t\t\t \"catalog_category_product\",\n\t\t\t\t\t \"cataloginventory_stock_item\",\n\t\t\t\t\t \"cataloginventory_stock_status\");\n\n\n\t\tforeach($tables as $table)\n\t\t{\n\t\t\t$this->exec_stmt(\"TRUNCATE TABLE `\".$this->tablename($table).\"`\");\n\t\t}\n\n\t\t$sql=\"SET FOREIGN_KEY_CHECKS = 1\";\n\n\t\t$this->exec_stmt($sql);\n\t}",
"function admin_init() {\n\t\t$conditions = array('Product.supplier_id' => array(4, 5)); // Alliance - updatovat sukl a pdk\n\t\t\n\t\t// chci nastavit, ze chci updatovat active a dostupnost\n\t\t$products = $this->ProductPropertiesProduct->Product->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('Product.id')\n\t\t));\n\n\t\t$productIds = Set::extract('/Product/id', $products);\n\n\t\t$properties = $this->ProductPropertiesProduct->ProductProperty->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'OR' => array(\n\t\t\t\t\tarray('ProductProperty.name' => 'Product.sukl'),\n\t\t\t\t\tarray('ProductProperty.name' => 'Product.pdk_code')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('ProductProperty.id')\n\t\t));\n\n\t\t$save = array();\n\t\t\n\t\tforeach ($products as $product) {\n\t\t\tforeach ($properties as $property) {\n\t\t\t\t$update = true;\n\t\t\t\t$save[] = array(\n\t\t\t\t\t'product_id' => $product['Product']['id'],\n\t\t\t\t\t'product_property_id' => $property['ProductProperty']['id'],\n\t\t\t\t\t'update' => $update\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$this->ProductPropertiesProduct->saveAll($save);\n\t\t\n\t\tdie('hotovo');\n\t}",
"public function validateCatalogProduct()\n {\n if (!$this->validateNoWebsiteGeneric([self::ACTION_NEW, self::ACTION_DELETE, self::ACTION_DUPLICATE])) {\n return;\n }\n }",
"function wcfmu_products_filter_menu() {\r\n\tglobal $WCFM, $WCFMu, $wp_query;\r\n\t\r\n\t$wcfmu_products_menus = apply_filters( 'wcfmu_products_menus', array( 'all' => __( 'All', 'wc-frontend-manager-ultimate'), \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'publish' => __( 'Published', 'wc-frontend-manager-ultimate'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'draft' => __( 'Draft', 'wc-frontend-manager-ultimate'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'pending' => __( 'Pending', 'wc-frontend-manager-ultimate')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\r\n\t\r\n\t$product_status = ! empty( $_GET['product_status'] ) ? sanitize_text_field( $_GET['product_status'] ) : 'all';\r\n\t$count_products = wp_count_posts( 'product' );\r\n\t$count_products->all = $count_products->publish + $count_products->pending + $count_products->draft;\r\n\t?>\r\n\t<ul class=\"wcfm_products_menus\">\r\n\t\t<?php\r\n\t\t$is_first = true;\r\n\t\tforeach( $wcfmu_products_menus as $wcfmu_products_menu_key => $wcfmu_products_menu) {\r\n\t\t\t?>\r\n\t\t\t<li class=\"wcfm_products_menu_item\">\r\n\t\t\t\t<?php\r\n\t\t\t\tif($is_first) $is_first = false;\r\n\t\t\t\telse echo \" | \";\r\n\t\t\t\t?>\r\n\t\t\t\t<a class=\"<?php echo ( $wcfmu_products_menu_key == $product_status ) ? 'active' : ''; ?>\" href=\"<?php echo get_wcfm_products_url( $wcfmu_products_menu_key ); ?>\"><?php echo $wcfmu_products_menu . ' ('. $count_products->$wcfmu_products_menu_key .')'; ?></a>\r\n\t\t\t</li>\r\n\t\t\t<?php\r\n\t\t}\r\n\t\t?>\r\n\t</ul>\r\n\t\r\n\t<div class=\"wcfm_products_filter_wrap wcfm_filters_wrap\">\r\n\t<?php\t\r\n\t// Category Filtering\r\n\t$product_categories = get_terms( 'product_cat', 'orderby=name&hide_empty=0&parent=0' );\r\n\t$categories = array();\r\n\t\r\n\techo '<select id=\"dropdown_product_cat\" name=\"dropdown_product_cat\" class=\"dropdown_product_cat\" style=\"width: 150px;\">';\r\n\t echo '<option value=\"\" selected=\"selected\">' . __( 'Select a category', 'wc-frontend-manager-ultimate' ) . '</option>';\r\n\t\tif ( $product_categories ) {\r\n\t\t\t$WCFM->library->generateTaxonomyHTML( 'product_cat', $product_categories, $categories );\r\n\t\t}\r\n\techo '</select>';\r\n\t\r\n\t// Type filtering\r\n\t$product_types = apply_filters( 'wcfm_product_types', array('simple' => __('Simple Product', 'wc-frontend-manager'), 'variable' => __('Variable Product', 'wc-frontend-manager'), 'grouped' => __('Grouped Product', 'wc-frontend-manager'), 'external' => __('External/Affiliate Product', 'wc-frontend-manager') ) );\r\n\t$output = '<select name=\"product_type\" id=\"dropdown_product_type\" style=\"width: 160px;\">';\r\n\t$output .= '<option value=\"\">' . __( 'Show all product types', 'wc-frontend-manager-ultimate' ) . '</option>';\r\n\t\r\n\tforeach ( $product_types as $product_type_name => $product_type_label ) {\r\n\t\t$output .= '<option value=\"' . $product_type_name . '\">' . $product_type_label . '</option>';\r\n\t\r\n\t\tif ( 'simple' == $product_type_name ) {\r\n\t\t\t\r\n\t\t\t$product_type_options = apply_filters( 'wcfm_non_allowd_product_type_options', array( 'virtual' => 'virtual', 'downloadable' => 'downloadable' ) ); \r\n\t\t\t\r\n\t\t\tif( !empty( $product_type_options['downloadable'] ) ) {\r\n\t\t\t\t$output .= '<option value=\"downloadable\" > → ' . __( 'Downloadable', 'wc-frontend-manager-ultimate' ) . '</option>';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif( !empty( $product_type_options['virtual'] ) ) {\r\n\t\t\t\t$output .= '<option value=\"virtual\" > → ' . __( 'Virtual', 'wc-frontend-manager-ultimate' ) . '</option>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t$output .= '</select>';\r\n\t\r\n\techo apply_filters( 'woocommerce_product_filters', $output );\r\n\t\r\n\t\r\n\t$is_marketplace = wcfm_is_marketplace();\r\n\t$user_arr = array( '' => __('All Vendors', 'wc-frontend-manager' ) );\r\n\tif( $is_marketplace ) {\r\n\t\tif( !wcfm_is_vendor() ) {\r\n\t\t\tif( $is_marketplace == 'wcpvendors' ) {\r\n\t\t\t\t$vendors = WC_Product_Vendors_Utils::get_vendors();\r\n\t\t\t\tif( !empty( $vendors ) ) {\r\n\t\t\t\t\tforeach ( $vendors as $vendor ) {\r\n\t\t\t\t\t\t$user_arr[$vendor->term_id] = esc_html( $vendor->name );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$args = array(\r\n\t\t\t\t\t'role__in' => array( 'dc_vendor', 'vendor' ),\r\n\t\t\t\t\t'orderby' => 'login',\r\n\t\t\t\t\t'order' => 'ASC',\r\n\t\t\t\t\t'count_total' => false,\r\n\t\t\t\t\t'fields' => array( 'ID', 'display_name' )\r\n\t\t\t\t ); \r\n\t\t\t\t$all_users = get_users( $args );\r\n\t\t\t\tif( !empty( $all_users ) ) {\r\n\t\t\t\t\tforeach( $all_users as $all_user ) {\r\n\t\t\t\t\t\t$user_arr[$all_user->ID] = $all_user->display_name;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\r\n\t\t\t$WCFM->wcfm_fields->wcfm_generate_form_field( array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dropdown_vendor\" => array( 'type' => 'select', 'options' => $user_arr, 'attributes' => array( 'style' => 'width: 150px;' ) )\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) );\r\n\t\t}\r\n\t}\r\n\t\r\n\techo '</div>';\r\n}"
] |
[
"0.61981714",
"0.57942134",
"0.57595116",
"0.5728889",
"0.5536832",
"0.5514402",
"0.5495427",
"0.54748386",
"0.5456363",
"0.54441965",
"0.5434492",
"0.5411341",
"0.5400371",
"0.53919846",
"0.5370955",
"0.5361951",
"0.53572994",
"0.5349074",
"0.5347654",
"0.533975",
"0.533648",
"0.5326024",
"0.52951795",
"0.52934164",
"0.5287102",
"0.52579844",
"0.52466035",
"0.5242516",
"0.5230183",
"0.5226855"
] |
0.720093
|
0
|
Get attribute this fillout is related to
|
public function getAttribute()
{
return $this->attribute;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getIdentifyingAttribute();",
"public function getAttribute(): string\n {\n return $this->attribute;\n }",
"public function getCustomAttributesAttribute()\n {\n return $this->custom_attributes()->get();\n }",
"public function __get($attribute)\n {\n if ( isset($this->attributes[$attribute]) ) return $this->attributes[$attribute];\n }",
"public function getAttr(): string\r\n {\r\n return $this->attr;\r\n }",
"public function __get($attribute)\n {\n return array_get($this->attributes, $attribute);\n }",
"public function __get($attribute) {\n return $this->getAttribute($attribute);\n }",
"public function get_attribute($field){\n\t\treturn $this->{$field};\n\t}",
"public function getAttribute()\r\n {\r\n return $this->getElement()->getEntityAttribute();\r\n }",
"public function getAttrib() {\n return $this->attrib;\n }",
"public function get($attribute);",
"public function getFile_att()\n {\n return $this->file_att;\n }",
"public function getAttribute(): string|null\n {\n return $this->attribute;\n }",
"public function getPropertyDetails(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Model\\Attributes' );\n }",
"public function readAttribute($attribute) {}",
"public function __GET($attr){\n\n\t\t return $this->$attr;\n\t\t}",
"public function __get($attribute)\r\n {\r\n if ($attribute == 'tag') {\r\n return $this->attributes[0];\r\n }\r\n return array_key_exists($attribute, $this->attributes) ? $this->attributes[$attribute] : null;\r\n }",
"public function getAttribute($attribute)\n {\n return $this->attributes[$attribute];\n }",
"public function get($attr) {\n return array_key_exists($attr, $this->_private_attributes) ? $this->_private_attributes[$attr] : null;\n }",
"public function getAttribute($attribute)\n {\n return $this->{$attribute};\n }",
"public function __attribute($name)\n {\n return $this->__attributes[$name];\n }",
"public function getAttributeToEditProperty()\n {\n return Attribute::find($this->editAttributeId);\n }",
"public function __get($name)\n {\n return $this->attributes[$name];\n }",
"public function __get($attribute)\n {\n if(property_exists($this, $attribute)) {\n return $this->{$attribute};\n }\n return null;\n }",
"public function getAttribute($name) {\n\t\tif (isset ( $this->$name ))\treturn $this->$name;\n\t}",
"public function getAttribute($name) {\n\t\tif (property_exists($this, $name))\n\t\t\treturn $this->$name;\n\t\telse if ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t}",
"public function __get($name) {\n\t\tif ($this->hasAttribute($name))\n\t\t\treturn $this->_attributes[$name];\n\t\telse\n\t\t\treturn parent::__get($name);\n\t}",
"public function getAttribute($name)\n\t{\n\t\tif(property_exists($this,$name))\n\t\t\treturn $this->$name;\n\t\telseif(isset($this->_attributes[$name])) {\n\t\t\treturn $this->_attributes[$name];\n\t\t}\n\t}",
"public function get($atributo) {\r\n\t\t\treturn $this->$atributo;\r\n\t\t}",
"public function __get($attr)\n {\n return $this->get($attr);\n }"
] |
[
"0.7040517",
"0.6969623",
"0.69377625",
"0.6904616",
"0.6889881",
"0.68839025",
"0.6825785",
"0.6743421",
"0.6736131",
"0.6705434",
"0.66750336",
"0.6618226",
"0.6595473",
"0.6573022",
"0.6550089",
"0.65021974",
"0.6491478",
"0.64845604",
"0.64464784",
"0.64333034",
"0.64221543",
"0.63458955",
"0.63377804",
"0.63314354",
"0.6319607",
"0.6312632",
"0.63060194",
"0.62988335",
"0.62966895",
"0.6285401"
] |
0.7423581
|
1
|
Get bid of the related attribute
|
public function getBid()
{
return $this->getAttribute()->getBid();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function bid()\n {\n return $this->hasOne('App\\Bid', 'id', 'bid_id')->first();\n }",
"public function getBidId(){\n return $this->bidId; \n }",
"public function getB()\n {\n return $this->B;\n }",
"public function getB()\n {\n return $this->b;\n }",
"public function getID_B()\n {\n return $this->ID_B;\n }",
"public function bids()\n {\n return $this->hasMany('App\\Bidding', 'id_bid', 'id');\n }",
"public function bids() \n {\n \treturn $this->hasMany('App\\Bid');\n }",
"function get_bid($bid){\n\t\t$this->bid = $bid;\n\t}",
"public function getIdAttribute()\n {\n return $this->attributes['bag_id'];\n }",
"public function Bids()\n {\n return $this->hasMany('App\\Bid');\n }",
"public function getId_batiment()\n {\n return $this->Id_batiment;\n }",
"public function getB() {\n return $this->x;\n }",
"function getBidFloor()\n {\n return $this->bidFloor;\n }",
"public function bid($price)\n {\n $bidRand = $this->bidRang->all();\n foreach($bidRand as $key => $value) {\n if($price >= $value->from && $price <= $value->to) {\n $bid = $value->bid;\n }\n }\n return $bid;\n }",
"public function findBidBybidderID($id){\r\n $this->db->query( \"SELECT auctions.isActive, bids.bidderID\r\n FROM\r\n auctions as auctions\r\n LEFT OUTER JOIN\r\n (SELECT bidID, bidderID, auctionID\r\n FROM bids as bids\r\n WHERE bidderID= :id) as bids\r\n ON\r\n auctions.auctionID = bids.auctionID\r\n WHERE\r\n auctions.isActive = 1 and bids.bidderID= :id\");\r\n // bind values\r\n $this->db->bind(':id', $id);\r\n \r\n $bid = $this->db->resultSet();\r\n\r\n // check rows\r\n if($this->db->rowCount() > 0){\r\n return $bid;\r\n }\r\n else{\r\n return false;\r\n }\r\n }",
"public function birds()\n {\n return $this->belongsTo('App\\Birds', 'bird_batch_id', 'batch_id');\n }",
"public function orderBonusBudget()\n {\n return $this->belongsTo('App\\Models\\Ad3d\\OrderBonusBudget\\QcOrderBonusBudget', 'bonus_id', 'bonus_id');\n }",
"public function getBU()\n {\n $value = $this->get(self::BU);\n return $value === null ? (integer)$value : $value;\n }",
"public function getBulan()\n {\n return $this->hasOne(Bulan::className(), ['id' => 'id_bulan']);\n }",
"public function getBLID() {\n\t\treturn $this->blid;\n\t}",
"public function getBb()\n {\n return $this->bb;\n }",
"function bidList()\n {\n return $this->p_bidList;\n }",
"public function getBaiViet()\n {\n return $this->hasOne(BaiViet::className(), ['id' => 'BaiViet_id']);\n }",
"public function getAuctionBidCount()\n {\n return $this->auctionBidCount;\n }",
"public function getmaxbid ($itemid){\n //returns the max bid for an itel\n $itemid = mysql_real_escape_string( $itemid);\n $sql = \"SELECT MAX(bidAmount)\n FROM bid \n WHERE itemid= '$itemid'\";\n $bidarray = mysql_fetch_array(mysql_query($sql));\n $bid = $bidarray[0];\n return $bid; \n }",
"public function bet()\n {\n return $this->hasOne('TopBetta\\\\Models\\\\BetModel', 'bet_transaction_id');\n }",
"public function getBidModifier()\n {\n return isset($this->bid_modifier) ? $this->bid_modifier : 0.0;\n }",
"public static function get_latest_bid( $post_id ) {\n global $wpdb;\n return $wpdb->get_var( $wpdb->prepare( 'SELECT bid FROM '.$wpdb -> prefix .'wauc_auction_log WHERE auction_id = %d ORDER BY date DESC', $post_id ) );\n }",
"public function getCouponAwardByBid($bid)\n {\n $sql = \"SELECT a.bid,a.id,a.count,t.type FROM casino_award AS a,casino_award_type AS t \n \t\tWHERE a.id=t.id AND t.type=2 AND bid=:bid \";\n return $this->_rdb->fetchAll($sql, array('bid' => $bid));\n }",
"public function getBook()\n {\n return $this->hasOne(Book::className(), ['id' => 'book_id']);\n }"
] |
[
"0.7679489",
"0.72444826",
"0.6588604",
"0.6468497",
"0.63224006",
"0.6229576",
"0.61816615",
"0.615477",
"0.6086161",
"0.6037028",
"0.6033735",
"0.5998887",
"0.5998323",
"0.59348416",
"0.59070176",
"0.5851722",
"0.58379775",
"0.5811908",
"0.57385486",
"0.5737315",
"0.5725076",
"0.56717026",
"0.56364286",
"0.5636239",
"0.5628052",
"0.5620442",
"0.5619963",
"0.56086385",
"0.559951",
"0.55548805"
] |
0.8099031
|
0
|
Set participation this fillout is related to Set participation this fillout is related to. Normally a fillout is only related to either a participation or an participant, not both
|
public function setParticipation(Participation $participation = null)
{
$this->participation = $participation;
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function set($identifier, $participation);",
"public function participate(Request $request, int $event_id, int $participation_id=null)\n {\n #testing if user is check()\n if (Auth::guest()) {\n Session::flash('authErr');\n return back();\n } elseif (Auth::user()->phone == '') {\n Session::flash('partFail', 'Veuillez vérifier votre numéro de téléphone pour continuer');\n return back();\n }\n $event = Event::findOrFail($event_id);\n #testing if event participation is expired\n if(!$event->dead_line > now()) {\n Session::flash('partFail', 'Date de participation finale est depasé');\n return back();\n }\n $this->createParticipation($event, $request);\n\n Session::flash('partSuccess', 'Votre demande a été déposer');\n\n Mail::send('emails.participation_email', ['event'=>$event], function ($message) {\n $message->to(Auth::user()->email);\n $message->from(env('MAIL_USERNAME'));\n $message->subject('Soumission d\\'une demande de participation');\n });\n return back();\n \n }",
"public function getParticipation()\n {\n return $this->participation;\n }",
"public function getParticipation()\n {\n return $this->participation;\n }",
"public function setCoParticipante($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (string) $v;\n\t\t}\n\n\t\tif ($this->co_participante !== $v) {\n\t\t\t$this->co_participante = $v;\n\t\t\t$this->modifiedColumns[] = J019tParticipantesPeer::CO_PARTICIPANTE;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function setProfession($profession)\n {\n $this->profession = $profession;\n }",
"public function update(ParticipanteRequest $request,$id)\n\t{\n try {\n\n //Verificación de los permisos del usuario para poder realizar esta acción\n $permisos = [];\n $usuario_actual = Auth::user();\n $roles = $usuario_actual->roles()->get();\n foreach($roles as $rol){\n $permisos = $rol->perms()->get();\n }\n $si_puede = false;\n foreach($permisos as $permiso){\n if(($permiso->name) == 'editar_perfil'){\n $si_puede = true;\n }\n }\n\n if($si_puede) { // Si el usuario posee los permisos necesarios continua con la acción\n\n $data['errores'] = '';\n $usuario = User::find($id); // Se obtienen los datos del participante que se desea editar\n $participante = Participante::where('id_usuario', '=', $id)->get(); // Se obtiene el resto de los datos del participante que se desea editar\n\n $email = $request->email;\n // Se verifica si el correo ingresado es igual al anterior y si no lo es se verifica\n // que no conicida con los de las base de datos ya que debe ser único\n if (!($email == $usuario->email)) {\n\n $existe = DB::table('users')->where('email', '=', $email)->first();\n\n // Si el correo conicide con alguno de la base de datos se redirige al participante al\n // formulario de edición indicandole el error\n if ($existe) {\n $data['errores'] = \"El correo ya existe, ingrese uno diferente\";\n $data['datos'] = Participante::where('id_usuario', '=', $id)->get(); // Se obtienen los datos del participante\n $data['email']= User::where('id', '=', $id)->get(); // Se obtiene el correo principal del participante;\n\n return view('participantes.editar-perfil', $data);\n }\n }\n\n // Se editan los datos del participante con los datos ingresados en el formulario\n $usuario->nombre = $request->nombre;\n $usuario->apellido = $request->apellido;\n $usuario->email = $email;\n\n\n\n $usuario->save(); // Se guardan los nuevos datos en la tabla Users\n\n\n // Se verifica si se colocó una imagen en el formulario\n if ($request->hasFile('imagen')) {\n $imagen = $request->file('imagen');\n } else {\n $imagen = $participante[0]->foto;\n }\n\n // Se editan los datos del participante deseado con los datos ingresados en el formulario\n $participante[0]->nombre = $request->nombre;\n $participante[0]->apellido = $request->apellido;\n $participante[0]->documento_identidad = $request->documento_identidad;\n $participante[0]->telefono = $request->telefono;\n $participante[0]->foto = $imagen;\n $participante[0]->celular = $request->celular;\n $participante[0]->correo_alternativo = $request->correo_alternativo;\n $participante[0]->twitter = Input::get('twitter');\n $participante[0]->ocupacion = Input::get('ocupacion');\n $participante[0]->titulo_pregrado = Input::get('titulo');\n $participante[0]->universidad = Input::get('univ');\n\n $participante[0]->save(); // Se guardan los nuevos datos en la tabla Participentes\n\n\n // Si se actualizaron con exito los datos del usuario, se actualizan los roles del usuario.\n if ($usuario->save()) {\n\n if ($participante[0]->save()) {\n $data['errores'] = '';\n Session::set('mensaje','Datos guardados satisfactoriamente.');\n $data['datos'] = Participante::where('id_usuario', '=', $id)->get(); // Se obtienen los datos del participante\n $data['email']= User::where('id', '=', $id)->get(); // Se obtiene el correo principal del participante;\n return view('participantes.ver-perfil', $data);\n\n } else { // Si el usuario no se ha actualizo con exito en la tabla Participante\n // se redirige al formulario de creación y se le indica al usuario el error\n Session::set('error', 'Ha ocurrido un error inesperado');\n $data['datos'] = Participante::where('id_usuario', '=', $id)->get(); // Se obtienen los datos del participante\n $data['email']= User::where('id', '=', $id)->get(); // Se obtiene el correo principal del participante;\n\n return view('participantes.editar-perfil', $data);\n }\n // Si el usuario no se ha actualizo con exito en la tabla Users\n // se redirige al formulario de edicion y se le indica al usuario el error\n } else {\n Session::set('error', 'Ha ocurrido un error inesperado');\n $data['datos'] = Participante::where('id_usuario', '=', $id)->get(); // Se obtienen los datos del participante\n $data['email']= User::where('id', '=', $id)->get(); // Se obtiene el correo principal del participante;\n\n return view('participantes.editar-perfil', $data);\n }\n }else{ // Si el usuario no posee los permisos necesarios se le mostrará un mensaje de error\n\n return view('errors.sin_permiso');\n\n }\n }\n catch (Exception $e) {\n return view('errors.error')->with('error',$e->getMessage());\n }\n\n\t}",
"public function setRespondent($id) {\n\t\tif (0) deb(\"survey1.setRespondent(): id:\", $id);\n\t\t$this->person = new Person($id);\n\t\tif (0) deb(\"survey1.setRespondent(): Person data:\", $this->person);\n\t}",
"public function setListParticipations($value)\n {\n $this->_fields['ListParticipations']['FieldValue'] = $value;\n return $this;\n }",
"public function setParticipant(Participant $participant = null)\n {\n $this->participant = $participant;\n\n return $this;\n }",
"private function updateCandidat($line, $election, $commune)\n {\n $candidatInfos = explode(';', $line);\n for ($i = 0; $i < 3; $i++) {\n if (!array_key_exists($i, $candidatInfos)) {\n return false;\n }\n }\n\n $nuance = $this->nuanceAvant ? $candidatInfos[0] : $candidatInfos[1];\n $nom = $this->nuanceAvant ? $candidatInfos[1] : $candidatInfos[0];\n\n if ('liste' === $this->electionType) {\n $candidat = new ListeCandidate(\n $election,\n $nuance,\n $nom\n );\n } elseif ('uninominale' === $this->electionType) {\n $candidat = new PersonneCandidate(\n $election,\n $nuance,\n null,\n $nom\n );\n }\n\n $slice = array_values(\n array_filter(\n $election->getCandidats(),\n function ($c) use ($candidat) {\n return ($candidat->getNom() === $c->getNom());\n }\n )\n );\n\n if (0 === count($slice)) {\n $election->addCandidat($candidat);\n } else {\n $candidat = $slice[0];\n }\n\n $election->setVoixCandidat($candidatInfos[2], $candidat, $commune);\n }",
"public function addParticipant(ParticipantInterface $participant): self;",
"public function __construct(ConferenceToAffiliateMeeting $conferenceToAffiliateMeeting)\n {\n $this->conferenceToAffiliateMeeting = $conferenceToAffiliateMeeting;\n }",
"public function setCreatedBy(ParticipantInterface $participant): self;",
"public function attend()\n {\n return $this->belongsTo(EventParticipant::class, 'event_participant_id')\n \t->with('participant');\n }",
"public function createParticipant(ParticipateRequest $request) {\n \t$participant = new Participant;\n \t$participant -> id_event = $request -> input('id_event');\n \t$participant -> id_user = $request -> input('id_user');\n\n \t$participant -> save();\n\n \treturn redirect('publicevents/'.$participant->id_event);\n }",
"public function testSetCalculParticip() {\n\n $obj = new Employes();\n\n $obj->setCalculParticip(true);\n $this->assertEquals(true, $obj->getCalculParticip());\n }",
"private function createParticipation(Event $event, Request $request)\n {\n $user = Auth::user();\n $part = new Participation();\n $fileName = str_replace(' ', '_', $user->getFullName());\n $path = $event->storage . 'participations/'.$fileName;\n $validator = $this->valideRequest($request);\n if($validator->fails()) {\n Session::flash('partFail', '*');\n return back()->withErrors($validator->errors());\n }\n #validation passes\n if($request->files->has('abstract')) {\n $part->uploadFile($request->file('abstract'), 'abstract_'.$fileName, $path);\n }\n $part->uploadFile($request->file('participation'), 'participation_'.$fileName, $path);\n\n $this->zipParticipationFiles($path);\n\n $part = Participation::create([\n 'event_id' => $event->id,\n 'participant_id' => $user->id,\n 'title' => $request->title,\n 'affiliation' => $request->affiliation,\n 'session' => $request->all()['session'],\n 'authors' => $request->authors,\n 'file_name' => $user->getFullName(),\n 'file' => $path.'.zip'\n ]);\n $this->notify('create', $part, $user);\n }",
"public function setFather($father)\n {\n $this->father = $father;\n }",
"protected function createPartnerOrganization(ParticipatingOrganization $participatingOrganization)\n {\n $value = $participatingOrganization->data();\n\n if ($this->needsToBeCleaned()) {\n if ($data = $this->cleanData->where('identifier', $participatingOrganization->identifier())->first()) {\n $value['name'] = [['narrative' => $data->validnames, 'language' => $data->validlang]];\n $value['type'] = $data->validtype;\n $value['country'] = $data->validcountry;\n } else {\n $name = array_get($value, 'narrative.0.narrative', '');\n $language = array_get($value, 'narrative.0.language', '');\n $value['name'] = [['narrative' => trim($name), 'language' => $language]];\n $value['type'] = array_get($value, 'organization_type', '');\n $value['country'] = $participatingOrganization->get('country') ? $participatingOrganization->get('country') : $this->getCountry($participatingOrganization->identifier());\n }\n } else {\n $name = array_get($value, 'narrative.0.narrative', '');\n $language = array_get($value, 'narrative.0.language', '');\n $value['name'] = [['narrative' => trim($name), 'language' => $language]];\n $value['type'] = array_get($value, 'organization_type', '');\n $value['country'] = $participatingOrganization->get('country') ? $participatingOrganization->get('country') : $this->getCountry($participatingOrganization->identifier());\n }\n\n $value['organization_id'] = $this->reportingOrganization->id;\n $value['used_by'] = [+ $this->activityId];\n $value['is_reporting_org'] = false;\n $value['is_publisher'] = boolval(array_get($value, 'is_publisher', false));\n\n return $this->organizationRepository->storeOrgData($value);\n }",
"public function setChallongeParticipantId()\n {\n $challonge = new Challonge(env('CHALLONGE_API_KEY'));\n $tournament = $challonge->getTournament($this->eventTournament->challonge_tournament_id);\n if (!$response = $tournament->addParticipant(['participant[name]' => $this->name])) {\n return false;\n }\n $this->challonge_participant_id = $response->id;\n $this->save();\n return true;\n }",
"public function setOtherParticipant(?OtherParticipant $otherParticipant): self\n {\n if ($otherParticipant === null && $this->otherParticipant !== null) {\n $this->otherParticipant->setLegalPerson(null);\n }\n\n // set the owning side of the relation if necessary\n if ($otherParticipant !== null && $otherParticipant->getLegalPerson() !== $this) {\n $otherParticipant->setLegalPerson($this);\n }\n\n $this->otherParticipant = $otherParticipant;\n\n return $this;\n }",
"public function set_profil($_profil)\n {\n $this->_profil = $_profil;\n\n return $this;\n }",
"public function handleParticipate($matchId, $playerId, $isParticipate)\n {\n\t// checks if player is participating in match\n\tif (!$isParticipate) {\n\t // chcecks if match don't have 11 players participating\n\t if ($this->model->getPlayersMatches()->where('match_id', $matchId)->count('*') < 11) {\n\t\t// if match has <11 players, player will be added\n\t\t$this->model->getPlayersMatches()->insert(array('player_id' => $playerId, 'match_id' => $matchId, 'number' => $this->availableNumber($matchId)));\n\t } else {\n\t\t// otherwise nothing will happen\n\t\t$this->presenter->flashMessage('Nelze přidat více hráčů než 11!', 'error');\n\t }\n\t} else {\n\t // Kdyz zaznam existuje, tak se odebere\n\t $this->model->getPlayersMatches()->where('player_id = ? AND match_id = ?', $playerId, $matchId)->delete();\n\t}\n\tif ($this->presenter->isAjax()) {\n\t $this->invalidateControl();\n\t} else {\n\t $this->presenter->redirect('this');\n\t}\n }",
"public function addParticipant(AbstractConversationEntity $conversation, MessageUserInterface $participant);",
"private function notify(string $type, Participation $existing, User $user)\n {\n if (str_is('create', $type)) {\n Notif::create([\n 'participation_id' => $existing->id,\n 'context' => $user->getFullName() .Notif::NEW_PARTICIPATION\n ]);\n } else if (str_is('update', $type)){\n Notif::create([\n 'participation_id' => $existing->id,\n 'context' => $user->getFullName() .Notif::UPDATE_PARTICIPATION\n ]);\n } else {\n throw new \\Exception('participation notification accepts update or create as parameters');\n }\n }",
"public function participant()\n {\n return $this->hasOne(Participant::class, 'participantId');\n }",
"public function testSetPrenomConjoint() {\n\n $obj = new Employes();\n\n $obj->setPrenomConjoint(\"prenomConjoint\");\n $this->assertEquals(\"prenomConjoint\", $obj->getPrenomConjoint());\n }",
"public function setProyectorActivo( $proyector ) {\n $this->proyector_activo=$proyector;\n $proyecActual=new Properties();\n $proyecActual->load(file_get_contents(\"./pantallaActiva.properties\"));\n if(strcmp($proyector, \"\")==0)\n $this->proyector_activo=$proyecActual->getProperty(\"Proyector.activo\");\n $proyecActual->setProperty(\"Proyector.activo\",$this->proyector_activo);\n file_put_contents('./pantallaActiva.properties', $proyecActual->toString(true));\n }",
"public function testSetLieuTravailConjoint() {\n\n $obj = new Employes();\n\n $obj->setLieuTravailConjoint(\"lieuTravailConjoint\");\n $this->assertEquals(\"lieuTravailConjoint\", $obj->getLieuTravailConjoint());\n }"
] |
[
"0.6300845",
"0.55099416",
"0.5343477",
"0.5343477",
"0.5001674",
"0.49595976",
"0.4757026",
"0.4753071",
"0.46700305",
"0.46393725",
"0.4632013",
"0.46174696",
"0.46047103",
"0.4551655",
"0.4519518",
"0.45098805",
"0.4507411",
"0.44699717",
"0.44683743",
"0.44329447",
"0.44275025",
"0.4360299",
"0.4359233",
"0.43567318",
"0.4354273",
"0.43419516",
"0.43380877",
"0.43288517",
"0.4326676",
"0.4325349"
] |
0.59556377
|
1
|
Get participation this fillout is related to
|
public function getParticipation()
{
return $this->participation;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getParticipant()\n {\n return $this->participant;\n }",
"public function getParticipant()\n {\n return $this->participant;\n }",
"public function getParticipant()\n\t{\n\t\treturn $this->getContext()->getParticipant();\n\t}",
"public function getCoParticipante()\n\t{\n\t\treturn $this->co_participante;\n\t}",
"public function getRelatedParty()\n {\n return $this->relatedParty;\n }",
"public function participant()\n {\n return $this->hasOne(Participant::class, 'participantId');\n }",
"public function participant()\n {\n return $this->hasMany(Participant::class);\n }",
"public function getPlayer()\n {\n return $this->participation->getPlayer();\n }",
"public function profesor()\n {\n return $this->belongsTo(Profesor::class);\n }",
"public function attend()\n {\n return $this->belongsTo(EventParticipant::class, 'event_participant_id')\n \t->with('participant');\n }",
"public function getConversation()\n {\n return $this->conversation;\n }",
"public function getParty(): ?UserActivityParty\n {\n return $this->party;\n }",
"public function founder()\n\t{\n\t\treturn $this->hasOne('Founder');\n\t}",
"public function getParentRelationship()\n {\n return auth()->user()->ministryDiscussions();\n }",
"public function GetJournalPersonAssociation() {\n\t\t\treturn CommunicationList::GetJournalPersonAssociationForId($this->intId);\n\t\t}",
"public function participant()\n {\n return $this->belongsTo('App\\Teacher', 'teacher_id');\n }",
"public function getParty()\n {\n return $this->party;\n }",
"public function getMeeting()\n {\n return $this->hasOne(Meeting::className(), ['id' => 'meeting_id']);\n }",
"public function profesor()\n\t{\n\n\t\treturn $this->belongsTo(Profesor::class,'id_profesor','id');\n\n\t}",
"public function getActivity() {\n return $this->activity;\n }",
"public function getAssociation()\n {\n\n }",
"public function participants()\n {\n return $this->hasMany( 'App\\Participant' );\n }",
"public function participants()\n {\n return $this->hasMany('App\\Models\\Participant');\n }",
"public function RosterRelation()\n {\n return $this->professional->roster;\n }",
"public function getActivity()\n\t{\n\t\treturn $this->activity;\n\t}",
"public function getConductMeeting()\n {\n return $this->conductMeeting;\n }",
"public function adopter()\n {\n return $this->belongsTo('App\\Person', 'adopter_id');\n }",
"public function conference()\n {\n return $this->belongsTo(Conference::class);\n }",
"public function getRelatedRecord(): IActivityPeriodRelated\n {\n return $this->card;\n }",
"public function hasParticipant() {\n return $this->_has(1);\n }"
] |
[
"0.65261936",
"0.65261936",
"0.65157956",
"0.6278628",
"0.62113637",
"0.6134019",
"0.6000006",
"0.5910217",
"0.58522767",
"0.5808622",
"0.58062255",
"0.57796293",
"0.57787335",
"0.5766304",
"0.5757657",
"0.57290936",
"0.5678475",
"0.56509584",
"0.56212366",
"0.55770296",
"0.5558365",
"0.5556403",
"0.55410415",
"0.55373484",
"0.55371064",
"0.553518",
"0.5523193",
"0.5497895",
"0.5495154",
"0.5467767"
] |
0.7549915
|
1
|
Get participant this fillout is related to
|
public function getParticipant()
{
return $this->participant;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getParticipant()\n\t{\n\t\treturn $this->getContext()->getParticipant();\n\t}",
"public function participant()\n {\n return $this->hasOne(Participant::class, 'participantId');\n }",
"function getAuthenticatedParticipant();",
"public function participant()\n {\n return $this->hasMany(Participant::class);\n }",
"public function participant()\n {\n return $this->belongsTo('App\\Teacher', 'teacher_id');\n }",
"public function getCreatedBy(): ?ParticipantInterface;",
"private static function getParticipant($userId) {\n return CRUDApiMisc::getFirstWherePropertyEquals(new ParticipantDateApi(), 'user_id', $userId);\n }",
"public function show(Participant $participant)\n {\n // Return the participant\n return $participant;\n }",
"public function getParty(): ?UserActivityParty\n {\n return $this->party;\n }",
"public function getRelatedParty()\n {\n return $this->relatedParty;\n }",
"public function getParticipant(Request $request)\n {\n $dataRequest = $request->all();\n $data = $this->service->getParticipant($request['id']);\n return $data;\n }",
"public function getPerson() {\n return $this->getPersoner()->getSingle();\n }",
"public function getPlayer()\n {\n return $this->participation->getPlayer();\n }",
"public function getParticipation()\n {\n return $this->participation;\n }",
"public function getParticipation()\n {\n return $this->participation;\n }",
"public function getParticipantLabel()\n\t{\n\t\treturn $this->getContext()->getParticipantLabel();\n\t}",
"public function getPatient()\n {\n return $this->patient;\n }",
"public function getPatient()\n {\n return $this->patient;\n }",
"public function getPatient() {\n return $this->patient;\n }",
"public function getParty()\n {\n return $this->party;\n }",
"public function getPerson() {\n return $this->person;\n }",
"public function getPerson() {\n return $this->person;\n }",
"public function getPartyReference()\n {\n return $this->partyReference;\n }",
"public function getMeeting()\n {\n return $this->hasOne(Meeting::className(), ['id' => 'meeting_id']);\n }",
"public function getAnsweredBy()\n {\n if (array_key_exists(\"answeredBy\", $this->_propDict)) {\n if (is_a($this->_propDict[\"answeredBy\"], \"\\Beta\\Microsoft\\Graph\\Model\\ParticipantInfo\") || is_null($this->_propDict[\"answeredBy\"])) {\n return $this->_propDict[\"answeredBy\"];\n } else {\n $this->_propDict[\"answeredBy\"] = new ParticipantInfo($this->_propDict[\"answeredBy\"]);\n return $this->_propDict[\"answeredBy\"];\n }\n }\n return null;\n }",
"public function getPerson()\n {\n return $this->hasOne(Person::className(), ['id' => 'person_id']);\n }",
"public function getRecord()\n {\n return $this->options['peoplefinder']->getByNUID($this->nu_id);\n }",
"public function getPlayer() {\n\t\tif($this->practice)\n\t\t\treturn $this->practice->golfer;\n\n\t\treturn $this->registration->competition->rule->team_score ? $this->registration->team : $this->registration->golfer;\n\t}",
"public function getRecipient() {\n\t\treturn $this -> data['recipient'];\n\t}",
"public function getActorNote() {\n $result = TingOpenformatMethods::parseFields($this->_getDetails(), array('actorNote' => array('actorElement')));\n return (is_array($result)) ? reset($result) : $result;\n }"
] |
[
"0.7337075",
"0.70987356",
"0.6454078",
"0.62658966",
"0.6194423",
"0.61616534",
"0.5980916",
"0.5971064",
"0.5970895",
"0.5969184",
"0.596007",
"0.59462607",
"0.59209406",
"0.5864516",
"0.5864516",
"0.57761467",
"0.57717115",
"0.57717115",
"0.57318264",
"0.57267815",
"0.5709769",
"0.5709769",
"0.55815053",
"0.55591637",
"0.5554083",
"0.55482507",
"0.55428743",
"0.552256",
"0.54905534",
"0.5485566"
] |
0.75281656
|
1
|
Transform fillout to string; Useful for textual display in ui Transform fillout to string; Useful for textual display in ui. Will return label of selected item if this fillout belongs to a choice field
|
public function __toString()
{
$value = $this->getValue();
if ($value === null) {
return '';
}
$attribute = $this->getAttribute();
if ($attribute->getFieldType() == FormChoiceType::class) {
$options = array_flip($attribute->getFieldTypeChoiceOptions(true));
if (is_array($value)) {
//multiple option, multiple values
foreach ($value as &$option) {
$option = $options[$option];
}
} elseif (isset($options[$value])) {
//multiple option, single value
$value = [$options[$value]];
} else {
return (string)$value;
}
return implode(', ', $value);
}
return (string)$value;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function _prepareForHtml() {\n\t\t$options = $this->_configuration['config']['items'];\n\t\tif (is_array($options)) {\n\t\t\tforeach ($options as $option) {\n\t\t\t\tif ($this->_value == $option[1]) {\n\t\t\t\t\treturn $this->_getLllValue($option[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn '';\n\t\t}\n\t\tif ($this->_configuration['config']['foreign_table']) {\n\t\t\t$labelField = $GLOBALS['TCA'][$this->_configuration['config']['foreign_table']]['ctrl']['label'];\n\t\t\t$options = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n\t\t\t\t\"uid,{$labelField}\",\n\t\t\t\t$this->_configuration['config']['foreign_table'],\n\t\t\t\t'1=1' . $this->_configuration['config']['foreign_where']\n\t\t\t);\n\t\t\t$values = array();\n\t\t\tforeach ($options as $option) {\n\t\t\t\tif (is_array($this->_value)) {\n\t\t\t\t\tif (in_array($option['uid'], $this->_value)) {\n\t\t\t\t\t\t$values[] = $option[$labelField];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn implode(', ', $values);\n\t\t}\n\t}",
"protected function get_label($value, $item) \n\t{ \n\t\treturn ( isset($value->as) ? $value->as : $item );\n\t}",
"public function __toString(){\n return (string)$this->title;\n // to show the id of the Title in the select\n // return $this->id;\n }",
"public function __toString()\n {\n return $this->getLabel();\n }",
"public function __toString(){\n return $this->nom4;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function __toString(){\n // to show the name of the Category in the select\n return $this->libelle;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function __toString(){\n // to show the name of the Category in the select\n return $this->libelle;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function __toString(){\n return $this->code_four;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function __toString()\n {\n return $this->nom;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"function acadp_get_custom_field_display_text( $value, $field ) {\n\n\t$display_text = '';\n\n\t$field_meta = get_post_meta( $field->ID );\n\n\tif( 'select' == $field_meta['type'][0] || 'radio' == $field_meta['type'][0] ) {\n\n\t\t$choices = explode( \"\\n\", $field_meta['choices'][0] );\n\n\t\tforeach( $choices as $choice ) {\n\n\t\t\tif( false !== strpos( $choice, ':' ) ) {\n\n\t\t\t\t$_choice = explode( ':', $choice );\n\t\t\t\t$_choice = array_map( 'trim', $_choice );\n\n\t\t\t\t$_value = $_choice[0];\n\t\t\t\t$_label = $_choice[1];\n\n\t\t\t} else {\n\n\t\t\t\t$_value = trim( $choice );\n\t\t\t\t$_label = $_value;\n\n\t\t\t}\n\n\t\t\tif ( trim( $value ) == $_value ) {\n\n\t\t\t\t$display_text = $_label;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t} else if( 'checkbox' == $field_meta['type'][0] ) {\n\n\t\t$choices = explode( \"\\n\", $field_meta['choices'][0] );\n\n\t\t$values = explode( \"\\n\", $value );\n\t\t$values = array_map( 'trim', $values );\n\t\t$_values = array();\n\n\t\tforeach( $choices as $choice ) {\n\n\t\t\tif( false !== strpos( $choice, ':' ) ) {\n\n\t\t\t\t$_choice = explode( ':', $choice );\n\t\t\t\t$_choice = array_map( 'trim', $_choice );\n\n\t\t\t\t$_value = $_choice[0];\n\t\t\t\t$_label = $_choice[1];\n\n\t\t\t} else {\n\n\t\t\t\t$_value = trim( $choice );\n\t\t\t\t$_label = $_value;\n\n\t\t\t}\n\n\t\t\tif ( in_array( $_value, $values ) ) {\n\t\t\t\t$_values[] = $_label;\n\t\t\t}\n\n\t\t}\n\n\t\t$display_text = implode( ', ', $_values );\n\n\t} else if( 'url' == $field_meta['type'][0] && ! filter_var( $value, FILTER_VALIDATE_URL ) === FALSE ) {\n\n\t\t$nofollow = ! empty( $field_meta['nofollow'][0] ) ? ' rel=\"nofollow\"' : '';\n\t\t$display_text = sprintf( '<a href=\"%1$s\" target=\"%2$s\"%3$s>%1$s</a>', $value, $field_meta['target'][0], $nofollow );\n\n\t} else {\n\t\t$display_text = $value;\n\t}\n\n\treturn $display_text;\n\n}",
"public function __toString(){\n return $this->type;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"function f_app_lov_return_label($lov)\n {\n//############################################ HELP #############################################################################\n/*\n $lov[\"name\"] = \"procesi\"; \t\t\t//DS -> sherben vetem per funksionin lov_name_default_values();\n $lov[\"obj_or_label\"] = \"label\"; \t\t\t//DS -> sherben vetem per funksionin lov_name_default_values(); pranon vetem vlerat object, label; default = object;\n $lov[\"type\"] = \"dinamik\"; \t\t//*DS -> pranon vlerat dinamik, statik;\n $lov[\"tab_name\"] = \"proces\"; \t\t//*D -> per tipin=\"dinamik\" emri tabeles ku do behet select | per tipin=\"statik\" sduhet;\n $lov[\"id\"] = \"id_proces\"; \t\t//*DS -> per tipin=\"dinamik\" emri i fushes qe ruan kodin | per tipin=\"statik\" lista e kodeve te ndara me ndaresin perkates, default ,;\n $lov[\"field_name\"] = \"name_proces\"; \t\t//*DS -> per tipin=\"dinamik\" emri i fushes qe ruan emertimin, mund te perdoret p.sh: Concat(id_proces, ' ', name_proces) | per tipin=\"statik\" lista e emertimeve te ndara me ndaresin perkates, default ,;\n\n $lov[\"layout_forma\"] = \"\"; \t\t//DS -> ka kuptim vetem kur kthehet me shume se nje etikete; ne rast se vendoset vlera 'table' elementet strukturohen ne nje tabele; vlera te ndryshme jane: <br> = elementet thyhen njeri poshte tjetrit;   = elementet ndahen me nje ose me shume spacio; default = <br>; ;\n\n $lov[\"distinct\"] = \"F\"; \t\t//D -> per tipin=\"dinamik\", pranon vlerat T,F (pra true ose false), default = 'F', pra ti beje distinct vlerat apo jo;\n\n $lov[\"filter\"] = \"WHERE id_proces < 30\";//D -> per tipin=\"dinamik\" kushti i filtrimit te te dhenave, default = '', p.sh: WHERE status = 1 AND id > 0 (mos haroni 'WHERE'); kur kjo ka vlere $lov[\"id_select\"] i shtohet si fitrim shtese;\n $lov[\"filter_plus\"] = \"\"; //D -> per tipin=\"dinamik\" kusht filtrimi shtese, default = '', p.sh: AND status = 1 AND id > 0 (mos haroni qe 'WHERE' ne kete rast nuk duhet sepse duhet ta kete variabli $filter); meret parasysh vetem kur $filter != ''; filtrimi i vlerave kryhet: $filter.\" \".$filter_plus\n\n $lov[\"id_select\"] = \"1\"; \t\t//DS -> vlerat e kodit per te cilat duhet te meren emertimet te ndara me ndaresin perkates default ,(presje); bosh kur i duam te gjitha vlerat; kur eshte vetem nje vlere vendoset vetem vlera e kodit pa presje; selektimi behet me id IN ($lov[\"id_select\"]), per id te tipit stringe mos haroni ti mbyllni ne thonjeza teke;\n $lov[\"order_by\"] = \"name_proces\"; \t\t//D -> emri i kolones qe do perdoret per order, default = $lov[\"name\"] | per tipin=\"statik\" sduhet;\n\n $lov[\"ndares_vlerash\"] = \",\"; \t\t//S -> stringa qe ndan vlerat e listes statike (kod dhe emertim), default = ,(presje);\n $lov[\"class_etiketa\"] = \"\"; \t\t//DS -> emri i klases ne style per etiketat, vetem ne rastet kur strukturohen ne tabele; po spati vlere nuk meret parasysh;\n $lov[\"isdate\"] = \"\"; \t\t//D -> pranon vlerat T,F (pra true ose false), default = 'F'; perdoret kur etiketa eshte e tipit date;\n $lov[\"asc_desc\"] = \"\"; \t\t//D -> per orderin, pranon vlerat ASC,DESC; default = 'ASC';;\n*/\n//###############################################################################################################################\n\n $lov_array_id = \"\";\n $lov_array_name = \"\";\n\n IF (!isset($lov[\"ndares_vlerash\"]) OR ($lov[\"ndares_vlerash\"]==\"\"))\n {$lov[\"ndares_vlerash\"] = \",\";}\n\n //PER LISTEN DINAMIKE ---------------------------------------------------------------------------------------------------------\n IF ($lov[\"type\"] == \"dinamik\")\n {\n IF (!isset($lov[\"order_by\"]) OR ($lov[\"order_by\"]==\"\"))\n {$lov[\"order_by\"] = $lov[\"field_name\"];}\n\n IF (!isset($lov[\"asc_desc\"]) OR ($lov[\"asc_desc\"]==\"\"))\n {$lov[\"asc_desc\"] = \" ASC\";}\n\n $filter = \"\";\n IF (ISSET($lov[\"filter\"]) AND ($lov[\"filter\"] != \"\"))\n {\n $filter = $lov[\"filter\"];\n \n IF (ISSET($lov[\"filter_plus\"]) AND ($lov[\"filter_plus\"] != \"\"))\n {$filter .= \" \".$lov[\"filter_plus\"];}\n }\n\n IF ((isset($lov[\"id_select\"])) AND ($lov[\"id_select\"] != \"\"))\n {\n IF ($filter == \"\")\n {$filter = \" WHERE \".$lov[\"id\"].\" IN (\".$lov[\"id_select\"].\") \";}\n ELSE\n {$filter .= \" AND \".$lov[\"id\"].\" IN (\".$lov[\"id_select\"].\") \";}\n }\n\n $lov_distinct = \"\";\n IF (ISSET($lov[\"distinct\"]) AND ($lov[\"distinct\"] == \"T\"))\n {$lov_distinct = \"DISTINCT\";}\n\n IF ($lov[\"isdate\"] == \"T\")\n {$sql = \"SELECT \".$lov_distinct.\" \".$lov[\"id\"].\" as id_as, IF(\".$lov[\"field_name\"].\" IS NULL, '',DATE_FORMAT(\".$lov[\"field_name\"].\",'%d.%m.%Y')) AS fusha_as_as, \".$lov[\"field_name\"].\" as field_name_order FROM \".$lov[\"tab_name\"].\" \".$filter.\" ORDER BY field_name_order \".$lov[\"asc_desc\"];}\n ELSE\n {$sql = \"SELECT \".$lov_distinct.\" \".$lov[\"id\"].\" as id_as, IF(\".$lov[\"field_name\"].\" IS NULL, '',\".$lov[\"field_name\"].\") AS fusha_as_as FROM \".$lov[\"tab_name\"].\" \".$filter.\" ORDER BY \".$lov[\"order_by\"].\" \".$lov[\"asc_desc\"];}\n\n $i = -1;\n $rs = WebApp::execQuery($sql);\n $rs->MoveFirst();\n while (!$rs->EOF())\n {\n $id = $rs->Field(\"id_as\");\n $name = $rs->Field(\"fusha_as_as\");\n\n $i = $i + 1;\n $lov_array_id[$i] = $id;\n $lov_array_name[$i] = $name;\n \n $lov_array_id_id[$id] = $id;\n $lov_array_id_name[$id] = $name;\n\n $rs->MoveNext();\n }\n }\n //PER LISTEN DINAMIKE =========================================================================================================\n\n //PER LISTEN STATIKE ----------------------------------------------------------------------------------------------------------\n IF ($lov[\"type\"] == \"statik\")\n {\n $lov_array_id_temp = EXPLODE($lov[\"ndares_vlerash\"], $lov[\"id\"]);\n $lov_array_name_temp = EXPLODE($lov[\"ndares_vlerash\"], $lov[\"field_name\"]);\n\n IF ((ISSET($lov[\"id_select\"])) AND ($lov[\"id_select\"] != \"\"))\n {\n $kaloje_kushtin_stristr = \"N\";\n }\n ELSE\n {\n $kaloje_kushtin_stristr = \"Y\";\n }\n\n $k = -1;\n $id_select_txt = $lov[\"ndares_vlerash\"].$lov[\"id_select\"].$lov[\"ndares_vlerash\"];\n FOR ($i=0; $i < count($lov_array_id_temp); $i++)\n {\n $lov_array_id_txt = $lov[\"ndares_vlerash\"].$lov_array_id_temp[$i].$lov[\"ndares_vlerash\"];\n\n IF (STRISTR($id_select_txt, $lov_array_id_txt) OR ($kaloje_kushtin_stristr == \"Y\"))\n {\n $k = $k + 1;\n $lov_array_id[$k] = $lov_array_id_temp[$i];\n $lov_array_name[$k] = $lov_array_name_temp[$i];\n\n $lov_array_id_id[$lov_array_id_temp[$i]] = $lov_array_id_temp[$i];\n $lov_array_id_name[$lov_array_id_temp[$i]] = $lov_array_name_temp[$i];\n }\n }\n }\n //PER LISTEN STATIKE ==========================================================================================================\n\n //FORMOHET HTML E LOV ---------------------------------------------------------------------------------------------------------\n IF (($lov[\"all_data_array\"] == \"Y\") OR ($lov[\"only_ids\"] == \"Y\"))\n {\n IF ($lov[\"all_data_array\"] == \"Y\")\n {\n $lov_html = $lov_array_id_name;\n }\n \n IF ($lov[\"only_ids\"] == \"Y\")\n {\n $lov_html = $lov_array_id_id;\n }\n }\n ELSE\n {\n $lov_html = \"\";\n\n IF (!isset($lov[\"class_etiketa\"]) OR ($lov[\"class_etiketa\"]==\"\"))\n {$lov[\"class_etiketa\"] = \"\";}\n ELSE\n {$lov[\"class_etiketa\"] = \"class='\".$lov[\"class_etiketa\"].\"'\";}\n\n IF (!isset($lov[\"layout_forma\"]) OR ($lov[\"layout_forma\"]==\"\"))\n {$lov[\"layout_forma\"] = \"<br>\";}\n\n IF ($lov[\"layout_forma\"] == \"table\")\n {$lov_html .= \"<Table border=0 cellspacing=0 cellpadding=0>\";}\n\n FOR ($i=0; $i < count($lov_array_id); $i++)\n {\n IF ($lov[\"layout_forma\"] == \"table\")\n {\n $lov_html .= \"<TR><TD \".$lov[\"class_etiketa\"].\">\".$lov_array_name[$i].\"</TD></TR>\";\n }\n ELSE\n {\n IF ($lov[\"layout_forma\"] == \"<br>\")\n {\n IF ($i == 0)\n {$lov_html .= $lov_array_name[$i];}\n ELSE\n {$lov_html .= $lov[\"layout_forma\"].$lov_array_name[$i];}\n }\n ELSE\n {\n $lov_html .= $lov[\"layout_forma\"].$lov_array_name[$i];\n }\n }\n }\n \n IF ($lov[\"layout_forma\"] == \"table\")\n {\n $lov_html .= \"</Table>\";\n }\n \n }\n //FORMOHET HTML E LOV =========================================================================================================\n\n RETURN $lov_html;\n }",
"public function summarise() {\n if (trim($this->text) != '') {\n return get_string('summarisechoice', 'qtype_ddimageortext', $this);\n } else {\n return get_string('summarisechoiceno', 'qtype_ddimageortext', $this->no);\n }\n }",
"public function __toString(): ?string {\n return $this->id;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"function getOptionLabel($listFile,$selectedValue)\n{\n\t$f=fopen($listFile,\"r\");\n\twhile (!feof($f)){\n\t\t$d=fgets($f);\n\t\t$start=strpos($d,\"\\\"\")+1;\n\t\t$end=strrpos($d,\"\\\"\");\n\t\t$val=substr($d,$start,$end-$start);\n\t\t\n\t\tif ($val==$selectedValue){\n\t\t\n\t\t\t$lstart=strpos($d,\">\")+1;\n\t\t\t$lend=strrpos($d,\"<\");\n\t\t\t$Label=substr($d,$lstart,$lend-$lstart);\n\t\t\tbreak;\n\t\t}\n\n\t}\n\tfclose($f);\n\treturn $Label;\n}",
"public function __toString(){\n // to show the name of the Category in the select\n return $this->nombre;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function text() {\n\tif( count($this->selectList) > 0 && isset($this->selectList[0])) return htmlspecialchars($this->selectList[0]->getCurrentHtml());\n\t return htmlspecialchars($this->getCurrentHtml());\n }",
"public function __toString(){\n return $this->getName();\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function get_label();",
"public function get_label();",
"public function __toString(){\n return $this->nomConsole;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function label() {\n\t\t\t\n\t\t\t$option = get_theme_option('blog_options', 'post_link_option');\n\n\t\t\tswitch ($option) {\n\t\t\t\tcase '1':\n\t\t\t\t\n\t\t\t\t\t$output = __('Read more', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t\n\t\t\t\t\t$output = __('Continue reading', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t\n\t\t\t\t\t$output = __('See full article', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t\n\t\t\t\t\t$output = __('Read this post', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t\n\t\t\t\t\t$output = __('Learn more', 'theme translation');\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t\t$output = empty($list_link) ? __('Read more', 'theme translation') : $list_link;\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn $output;\n\t\t}",
"public function format_selection($p_ip_id)\n {\n global $g_comp_database;\n\n if (empty($p_ip_id))\n {\n return _L(\"LC__CMDB__BROWSER_OBJECT__NONE_SELECTED\");\n } // if\n\n // We need a DAO for the object name.\n $l_dao_ip = new isys_cmdb_dao_category_g_ip($g_comp_database);\n $l_quick_info = new isys_ajax_handler_quick_info();\n\n $l_row = $l_dao_ip->get_ip_by_id($p_ip_id);\n\n $p_object_type = $l_dao_ip->get_objTypeID($l_row[\"isys_catg_ip_list__isys_obj__id\"]);\n\n $l_editmode = ($_POST[C__GET__NAVMODE] == C__NAVMODE__EDIT || isys_glob_get_param(\"editMode\") == C__EDITMODE__ON);\n\n $l_title = _L($l_dao_ip->get_objtype_name_by_id_as_string($p_object_type)) . \" >> \" . $l_dao_ip->get_obj_name_by_id_as_string(\n $l_row[\"isys_catg_ip_list__isys_obj__id\"]\n ) . \" >> \" . $l_row[\"isys_cats_net_ip_addresses_list__title\"];\n if (!$l_editmode) return $l_quick_info->get_quick_info($l_row['isys_catg_ip_list__isys_obj__id'], $l_title, C__LINK__OBJECT);\n else return $l_title;\n }",
"public function __toString(){\n return $this->name;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function __toString(){\n return $this->name;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"public function show()\n {\n if ((string) $this->item->language == 'true') {\n $fields = '';\n $optionsName = $this->options['name'];\n foreach (Language::languages() as $language) {\n $nameLanguage = $this->name . '_' . $language;\n $this->options['name'] = str_replace($this->name, $nameLanguage, $optionsName);\n $this->options['labelLanguage'] = $language['name'];\n $this->options['value'] = $this->values[$nameLanguage];\n $this->options['class'] = 'form_field_' . $nameLanguage;\n $fields .= FormField_File::create($this->options);\n }\n return $fields;\n } else {\n return FormField_File::create($this->options);\n }\n }",
"public function __toString(){\n return $this->nom;\n // to show the id in the select\n // return $this->id;\n }",
"public function __toString() {\n return $this->getText();\n }",
"public function __toString(){\n // to show the name of the Category in the select\n return $this->multiplicate;\n return $this->nom;\n return $this->valeur;\n // to show the id of the Category in the select\n // return $this->id;\n }",
"function get_label($labelitem)\n{\n\tglobal $labelMenu; #from the included labels file\n\t\n\t$label = $labelitem;\n\tif (isset($labelMenu[$labelitem]))\n\t{\n\t\t$label = $labelMenu[$labelitem];\n\t\tif ($label == '[EMPTY]')\n\t\t{\n\t\t\t$label = $labelitem;\n\t\t}\n\t}\n\t\n\t$num_args = func_num_args() - 1;\n\tif ($num_args <= 0)\n\t{\n\t\treturn $label;\n\t}\n\t\n\t$parsed_label = '';\n\t$end = 0;\n\twhile (($beg = strpos($label, '[', $end)) !== false)\n\t{\n\t\t$parsed_label .= substr($label, $end, $beg - $end);\n\t\t++$beg;\n\t\t\n\t\t$end = strpos($label, ']', $beg);\n\t\tif ($end === false)\n\t\t{\n\t\t\t$parsed_label .= substr($label, $beg - 1);\n\t\t\treturn $parsed_label;\n\t\t}\n\t\t\n\t\t$index = substr($label, $beg, $end - $beg);\n\t\tif (is_numeric($index) && $index < $num_args && $index >= 0)\n\t\t{\n\t\t\t$parsed_label .= func_get_arg($index + 1);\n\t\t\t++$end;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$parsed_label .= '[';\n\t\t\t$end = $beg;\n\t\t}\n\t}\n\t$parsed_label .= substr($label, $end);\n\t\n\treturn $parsed_label;\n}"
] |
[
"0.54673785",
"0.54182124",
"0.53790206",
"0.52586955",
"0.5227055",
"0.52079403",
"0.52079403",
"0.5183315",
"0.51819694",
"0.5179986",
"0.516425",
"0.5160249",
"0.51145136",
"0.5106517",
"0.5099532",
"0.5081568",
"0.508047",
"0.50752467",
"0.5069373",
"0.5069373",
"0.50672436",
"0.50588024",
"0.505487",
"0.5034201",
"0.5034201",
"0.5020897",
"0.5020546",
"0.5013214",
"0.5009075",
"0.5008687"
] |
0.5650873
|
0
|
Get user operating system.
|
public function getUserOS()
{
return $this->userOS ?: $this->userOS = @$this->os[mb_strtolower(PHP_OS)];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getOs() : string\n {\n return $this->os;\n }",
"function fetch_os()\n\t{\n\t\t$useragent = strtolower($this->my_getenv('HTTP_USER_AGENT'));\n\t\t\n\t\tif ( strstr( $useragent, 'mac' ) )\n\t\t{\n\t\t\treturn 'mac';\n\t\t}\n\t\t\n\t\tif ( preg_match( '#wi(n|n32|ndows)#', $useragent ) )\n\t\t{\n\t\t\treturn 'windows';\n\t\t}\n\t\t\n\t\treturn 'unknown';\n\t}",
"static public function getOS(): string\n {\n return php_uname('s');\n }",
"public function getClientOs()\n\t{\n\t\t$userAgent = $this->getUserAgent();\n\n\t\tif (preg_match('/Linux/', $userAgent))\n\t\t{\n\t\t\treturn 'Linux';\n\t\t}\n\t\telseif (preg_match('/Win/', $userAgent))\n\t\t{\n\t\t\treturn 'Windows';\n\t\t}\n\t\telseif (preg_match('/Mac/', $userAgent))\n\t\t{\n\t\t\treturn 'Mac';\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 'Other';\n\t\t}\n\t}",
"public static function getOS()\n {\n switch (true) {\n case stristr(PHP_OS, 'DAR'): return 'OSX';\n case stristr(PHP_OS, 'WIN'): return 'WIN';\n case stristr(PHP_OS, 'LINUX'): return 'LINUX';\n default : return 'UNKNOWN';\n }\n }",
"public function getOS()\n {\n return $this->getParam(self::SOFTWARE_OS_PARAM_NAME);\n }",
"public function getOS() { \n \n $server_data = $_SERVER['HTTP_USER_AGENT'];\n\n $os_platform = \"Unknown OS Platform\";\n\n $os_array = array(\n '/windows nt 10/i' => 'Windows',\n '/windows nt 6.3/i' => 'Windows',\n '/windows nt 6.2/i' => 'Windows',\n '/windows nt 6.1/i' => 'Windows',\n '/windows nt 6.0/i' => 'Windows',\n '/windows nt 5.2/i' => 'Windows',\n '/windows nt 5.1/i' => 'Windows',\n '/windows xp/i' => 'Windows',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n\n foreach ($os_array as $regex => $value) { \n\n if (preg_match($regex, $server_data)) {\n $os_platform = $value;\n }\n } \n\n return $os_platform;\n }",
"function get_os () {\n $uname = php_uname('s');\n if ($uname == \"Darwin\") {\n return OS_MAC;\n }\n if ($uname == \"Linux\") {\n return OS_LINUX;\n }\n if (strtoupper(substr($uname, 0, 3)) === 'WIN') {\n return OS_WIN;\n }\n\n throw new \\Exception(\"Did not recognize operating system. uname: '$uname'\");\n}",
"public function getOperatingSystem(): int\n {\n switch (true) {\n case stristr(PHP_OS, 'DAR'):\n return self::OS_OSX;\n case stristr(PHP_OS, 'WIN'):\n return self::OS_WIN;\n case stristr(PHP_OS, 'LINUX'):\n return self::OS_LINUX;\n default:\n return self::OS_UNKNOWN;\n }\n }",
"public function getOS()\n {\n return $this->parser->getOS();\n }",
"public function sistema_operativo(){\n\t\t$useragent = $_SERVER['HTTP_USER_AGENT'];\n\t\tif (strstr($useragent,'Win')) {\n\t\t\t$os='Windows';\n\t\t} else if (strstr($useragent,'Mac')) {\n\t\t\t$os='Mac';\n\t\t} else if (strstr($useragent,'Linux')) {\n\t\t\t$os='Linux';\n\t\t} else if (strstr($useragent,'Unix')) {\n\t\t\t$os='Unix';\n\t\t} else {\n\t\t\t$os='Altro';\n\t\t}\n\t\t\n\t\treturn $os;\n\t}",
"protected function getOperatingSystem()\n {\n $osRaw = strtolower(PHP_OS);\n \n if (strpos($osRaw, 'linux') !== false) {\n return RequestAbstract::OS_LINUX;\n } else if (strpos($osRaw, 'windows') !== false) {\n return RequestAbstract::OS_WINDOWS;\n } else {\n return RequestAbstract::OS_UNKNOWN;\n }\n }",
"protected function getSystem()\n {\n $uname = strtolower( php_uname() );\n\n if (str_contains( $uname, 'darwin' )) {\n return 'macosx';\n } elseif (str_contains( $uname, 'win' )) {\n return 'windows';\n } elseif (str_contains( $uname, 'linux' )) {\n return PHP_INT_SIZE === 4 ? 'linux-i686' : 'linux-x86_64';\n } else {\n throw new \\RuntimeException( 'Unknown operating system.' );\n }\n }",
"function determineOs() {\n\t\n\t$ret\t\t\t= \"undef\";\n\t\n\tob_start();\n\teval(\"phpinfo();\");\n\t$info \t\t\t= ob_get_contents();\n\tob_end_clean();\n\t\n\tforeach(explode(\"\\n\", $info) as $line) \t{\n\t \n\t if(strpos($line, \"System\")!== false) {\n\t \n\t $show \t= trim(str_replace(\"System\",\"\", strip_tags($line)));\n\t \n\t }\n\t}\n\t\n\tif( preg_match('/WIN/i', $show) ) {\n\t \n\t $ret\t= \"windows\";\n\t} else {\n\t $ret\t= \"unix\";\n\t}\n\n\treturn( $ret );\n}",
"public function getOsName()\n {\n return $this->os;\n }",
"public static function setOS(){\n\t\tif (preg_match(\"#Linux#\", $_SERVER['HTTP_USER_AGENT'])) {\n self::$os_system = \"unix\";\n\t\t}\n\t\telse if (preg_match(\"#Macintosh#\", $_SERVER['HTTP_USER_AGENT'])) {\n self::$os_system = \"mac\";\n\t\t}\n\t\telse if (preg_match(\"#iPhone#\", $_SERVER['HTTP_USER_AGENT'])) {\n self::$os_system = \"iphone\";\n\t\t}\n\t\telse {\n\t\t self::$os_system = \"windows\";\n\t\t}\n\t\treturn($_SERVER['HTTP_USER_AGENT']);\n\t}",
"protected function getOperatingSystem() {}",
"public function getOperatingSystem() {\n\t\t$event = $this->Controller->Event->trigger('findOperatingSystem');\n\t\tif (isset($event['findOperatingSystem'][$this->Controller->plugin]) && is_string($event['findOperatingSystem'][$this->Controller->plugin])) {\n\t\t\treturn $event['findOperatingSystem'][$this->Controller->plugin];\n\t\t}\n\n\t\t$agent = env( 'HTTP_USER_AGENT' );\n\t\tConfigure::load('operating_systems');\n\t\t$operatingSystems = Configure::read('OperatingSystems');\n\n\t\tforeach ( $operatingSystems as $key => $value) {\n\t\t\tif ( preg_match( \"/$value/i\", $agent ) ) {\n\t\t\t\treturn $operatingSystems[$key];\n\t\t\t}\n\t\t}\n\n\t\treturn 'Unknown';\n\t}",
"public function getOperatingSystem() {\n\t\ttry {\n\t\t\t// Setup\n\t\t\t$result = '';\n\t\t\t$cmd = 'sw_vers';\n\t\t\t\n\t\t\t// Execute Command/Parse Results\n\t\t\tself::execute($cmd, $output);\n\t\t\t\n\t\t\t$name = explode(':', $output[0]);\n\t\t\t$name = trim($name[1]);\n\t\t\t\n\t\t\t$version = explode(':', $output[1]);\n\t\t\t$version = trim($version[1]);\n\t\t\t\n\t\t\t$result = $name . ' (' . $version . ')';\n\t\t\treturn $result;\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t}\n\t}",
"function getOS($request) {\n $user_agent = $request->server('HTTP_USER_AGENT');\n $os_platform = $user_agent . \" - Unknown OS Platform\";\n $os_array = array(\n '/windows nt 10/i' => 'Windows 10',\n '/windows nt 6.3/i' => 'Windows 8.1',\n '/windows nt 6.2/i' => 'Windows 8',\n '/windows nt 6.1/i' => 'Windows 7',\n '/windows nt 6.0/i' => 'Windows Vista',\n '/windows nt 5.2/i' => 'Windows Server 2003/XP x64',\n '/windows nt 5.1/i' => 'Windows XP',\n '/windows xp/i' => 'Windows XP',\n '/windows nt 5.0/i' => 'Windows 2000',\n '/windows me/i' => 'Windows ME',\n '/win98/i' => 'Windows 98',\n '/win95/i' => 'Windows 95',\n '/win16/i' => 'Windows 3.11',\n '/macintosh|mac os x/i' => 'Mac OS X',\n '/mac_powerpc/i' => 'Mac OS 9',\n '/linux/i' => 'Linux',\n '/ubuntu/i' => 'Ubuntu',\n '/iphone/i' => 'iPhone',\n '/ipod/i' => 'iPod',\n '/ipad/i' => 'iPad',\n '/android/i' => 'Android',\n '/blackberry/i' => 'BlackBerry',\n '/webos/i' => 'Mobile'\n );\n foreach ($os_array as $regex => $value)\n if (preg_match($regex, $user_agent))\n $os_platform = $value;\n return $os_platform;\n }",
"public static function findServerOS()\n {\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\n return 'WIN';\n }\n\n return 'LINUX';\n }",
"public function getUserAgentPlatform()\n {\n return UTIL_Browser::getPlatform($_SERVER['HTTP_USER_AGENT']);\n }",
"function getOS($userAgent) {\n // Create list of operating systems with operating system name as array key \n\t$oses = array (\n\t\t'iPhone' => '(iPhone)',\n\t\t'Windows 3.11' => 'Win16',\n\t\t'Windows 95' => '(Windows 95)|(Win95)|(Windows_95)', // Use regular expressions as value to identify operating system\n\t\t'Windows 98' => '(Windows 98)|(Win98)',\n\t\t'Windows 2000' => '(Windows NT 5.0)|(Windows 2000)',\n\t\t'Windows XP' => '(Windows NT 5.1)|(Windows XP)',\n\t\t'Windows 2003' => '(Windows NT 5.2)',\n\t\t'Windows Vista' => '(Windows NT 6.0)|(Windows Vista)',\n\t\t'Windows 7' => '(Windows NT 6.1)|(Windows 7)',\n\t\t'Windows NT 4.0' => '(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)',\n\t\t'Windows ME' => 'Windows ME',\n\t\t'Open BSD'=>'OpenBSD',\n\t\t'Sun OS'=>'SunOS',\n\t\t'Linux'=>'(Linux)|(X11)',\n\t\t'Safari' => '(Safari)',\n\t\t'Macintosh'=>'(Mac_PowerPC)|(Macintosh)',\n\t\t'QNX'=>'QNX',\n\t\t'BeOS'=>'BeOS',\n\t\t'OS/2'=>'OS/2',\n\t\t'Search Bot'=>'(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp/cat)|(msnbot)|(ia_archiver)'\n\t);\n\n\tforeach($oses as $os=>$pattern){ // Loop through $oses array\n // Use regular expressions to check operating system type\n\t\tif(eregi($pattern, $userAgent)) { // Check if a value in $oses array matches current user agent.\n\t\t\treturn $os; // Operating system was matched so return $oses key\n\t\t}\n\t}\n\treturn 'Unknown'; // Cannot find operating system so return Unknown\n}",
"public function getOsVersion()\n {\n return $this->os_version;\n }",
"public function getOsVersion() : string\n {\n return $this->osVersion;\n }",
"function getOSType()\r\n{\r\n\tglobal $garEnvConfig;\r\n\r\n\treturn $garEnvConfig[\"OS_TYPE\"];\r\n}",
"function platform(){\n\n\t\treturn (new user_agent)->platform();\n\n\t}",
"public static function getOperatingSystems()\n\t\t{\n\t\t\treturn self::$operatingSystems;\n\t\t}",
"public function platform(): string;",
"public function getName()\n {\n return PHP_OS;\n }"
] |
[
"0.7973787",
"0.7908422",
"0.7847648",
"0.78456306",
"0.7811429",
"0.76915485",
"0.7686457",
"0.76827884",
"0.76729727",
"0.7636006",
"0.7588123",
"0.75578225",
"0.7519697",
"0.7516318",
"0.7448239",
"0.74341",
"0.7356072",
"0.72741103",
"0.7218641",
"0.7206432",
"0.7075052",
"0.7060692",
"0.7059543",
"0.7057463",
"0.70522296",
"0.7038821",
"0.6929653",
"0.6915735",
"0.6854541",
"0.68177867"
] |
0.862494
|
0
|
Desinstallation/suppression des tables generator_decla
|
function generator_decla_vider_tables($nom_meta_base_version) {
effacer_meta($nom_meta_base_version);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function generateDatabase()\n {\n $this->generateUserTable();\n $this->generateEmployerTable();\n $this->generateCandidateTable();\n $this->generateGuidTable();\n $this->generateWorkExperienceTable();\n $this->generateShortListTable();\n $this->generateQualTypeTable();\n $this->generateQualLevelTable();\n $this->generateQualificationsTable();\n $this->generateFieldTable();\n $this->generateSubFieldTable();\n $this->generateSkillTable();\n $this->generatePreferencesTable();\n }",
"function fatherly_create_generator_tables()\n{\n global $wpdb;\n $charset_collate = $wpdb->get_charset_collate();\n require_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\n // Create table to store names of the generators and have an id associated with it\n $generator = $wpdb->prefix . 'generator';\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$generator'\") != $generator) {\n $sql = \"CREATE TABLE `$generator` (\n `post_id` BIGINT(20) NOT NULL,\n `generator_name` text NOT NULL,\n PRIMARY KEY(`post_id`)\n ) $charset_collate;\";\n dbDelta($sql);\n }\n // Create table with generator output that references the key from the first table\n $generation = $wpdb->prefix . 'generation';\n if ($wpdb->get_var(\"SHOW TABLES LIKE '$generation'\") != $generation) {\n $sql2 = \"CREATE TABLE `$generation` (\n `id` BIGINT(20) NOT NULL AUTO_INCREMENT,\n `generator_post_id` BIGINT(20),\n `generation` text NOT NULL,\n PRIMARY KEY(`id`),\n FOREIGN KEY(`generator_post_id`) REFERENCES `$generator`(`post_id`)\n ) $charset_collate;\";\n dbDelta($sql2);\n }\n}",
"public function compileAdminTables() {}",
"private function generateTables()\n\t\t{\n\t\t\tif ($this->connectFail == False)\n\t\t\t{\n\t\t\t\t/*\n\t\t\t\t*\tdatabase schema access\n\t\t\t\t*/\n\n\t\t\t\t$content = file_get_contents('dbase.sql');\n\t\t\t\t$queries = explode(\";\\n\\n\", $content);\n\n\t\t\t\tforeach ($queries as $key => $query)\n\t\t\t\t{\n\t\t\t\t\t$er = False;\n\t\t\t\t\t$df = $this->execQuery($query);\n\n\t\t\t\t\t#print $df.\"\\n\".$er.PHP_EOL;\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }",
"protected function generateDbTables()\n\t{\n\t\t$dbTables = $this->getDbTables();\n\t\t\n\t\t//get the describe of the table\n\t\tforeach ($dbTables as $table) {\n\t\t\t$describeTable = $this->describeTable($table);\n\t\t\t\n\t\t\tif ($describeTable) {\n\t\t\t\t$primaryKey = $this->getPrimaryKey($describeTable);\n\t\t\t\t$code = $this->generateDbTableCode($table, $primaryKey);\n\t\t\t\t$this->saveDbTableFile($code);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}",
"function final_extract_uninstall ()\n{\n\tglobal $CONFIG, $superCage, $thisplugin;\n\n\tif ($superCage->post->keyExists('drop')) {\n\t\tcpg_db_query(\"DROP TABLE IF EXISTS {$CONFIG['TABLE_FINAL_EXTRACT_CONFIG']}\");\n\t\tcpg_db_query(\"DELETE FROM {$CONFIG['TABLE_CONFIG']} WHERE name='fex_enable';\");\n\t} else {\n\t\treturn 1;\n\t}\n\treturn true;\n}",
"private function dropAndCreateTables(){\n \n $migration = new MikeMigration($this::genPrefix(10));\n $save = 0;\n\n // Prepare Dropped Tables\n if($this->droppedTables){\n $save++;\n foreach($this->droppedTables as $item){\n\n $migration->up(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n $migration->down($this::prepareTableBlueprint($item));\n\n \n // Delete Model\n Storage::disk('models')->delete($this->appNamePath.'/'.$item[\"name\"].'.php');\n // Delete Controller\n Storage::disk('controllers')->delete($this->appNamePath.'/'.$item[\"name\"].'Controller.php');\n // Delete Routes\n //...\n\n }\n }\n // Prepare New Tables \n if($this->newTables){\n $save++;\n foreach($this->newTables as $item){\n\n\n $migration->up($this::prepareTableBlueprint($item));\n\n $migration->down(\"\\t\\t\" . 'Schema::dropIfExists(\"'.$this->appPrefix.'_'.$item[\"name\"].'\"); ');\n\n }\n }\n // If Exist Dropped pr New Tables \n if($save > 0){\n $migration->save();\n }\n \n\n\n }",
"public static function generateDatabase()\n\t{\n\t\t$entities\t=\tself::getEntities();\n\t\t$query\t\t=\tself::$current_db->query('SHOW TABLES');\n\t\t$tables\t\t=\tarray();\n\n\t\twhile($table = $query->fetch(\\PDO::FETCH_NUM))\n\t\t\t$tables[]\t=\tstrtolower($table[0]);\n\n\t\tforeach($entities as $entity)\n\t\t{\n\t\t\tif( ! in_array(strtolower($entity::getTableName()), $tables))\n\t\t\t\t$entity::createTable();\n\t\t\telse\n\t\t\t\t$entity::updateTable();\n\t\t}\n\t}",
"public function actionGeneratorall() {\n //$sql = \"select hoscode from chospital_amp where already = 1\";\n $sql = \"select hoscode from chospital_amp where already = 1\";\n $hosData = $this->query_all_db2($sql);\n\n //find cumulative table from mas_mapp_main table with comment value 2\n $sql = \"select * from mas_mapp_main\";\n $cuTable = $this->query_all_db2($sql);\n\n foreach ($cuTable as $cData) {\n $table = $cData['MAIN_TABLE'];\n $sql = \"truncate $table\";\n $this->exec_sql($sql, 2);\n }\n\n foreach ($hosData as $hData) {\n $db_name = 'jhcisdb_' . $hData['hoscode'];\n $db = 'db' . $hData['hoscode'];\n \n $sql = \"call create_f43_table()\";\n $this->exec_sql_db($sql, $db);\n \n foreach ($cuTable as $cData) {\n $table = $cData['MAIN_TABLE'];\n $DATE_START = $cData['DATESTART'];\n $DATE_END = $cData['DATEEND'];\n $mapp_sql = trim($cData['MAPP_QUERY']);\n\n if ($table == 'f43_dental') {\n $sql = \"call cal_table_dental_tmp('$table')\";\n $this->exec_sql_db($sql, $db);\n }else if($table == 'f43_appointment'){\n $sql = \"call cal_table_appointment_tmp('$table')\";\n $this->exec_sql_db($sql, $db);\n }else {\n //generate data from jhcis version to f43 version\n $sql = \"call cal_table_tmp_newver1(\\\"\" . $table . \"\\\",\\\"(\" . $mapp_sql . \")\\\",\\\"\" . $DATE_START . \"\\\",\\\"\" . $DATE_END . \"\\\")\";\n $this->exec_sql_db($sql, $db);\n }\n\n //insert f43 from jhcis database to 43f_generate database\n $sql = \"call replace_into_table('$db_name','$table')\";\n $this->exec_sql($sql, 2);\n\n //drop f43 table in jhcis database\n //$sql = \"call cal_table_tmp_drop('$table','$db_name')\";\n //$this->exec_sql($sql, 2);\n }\n }\n\n return 'All';\n }",
"public function post_uninstall(){\n // include SQL data for uninstallation\n include($this->root_path.'plugins/dynamictemplate/includes/sql.php');\n\n for ($i = 1; $i <= count($dynamictemplateSQL['uninstall']); $i++)\n $this->db->query($dynamictemplateSQL['uninstall'][$i]);\n }",
"public function uninstall(){\n MergeRequestComment::dropTable();\n MergeRequest::dropTable();\n CommitCache::dropTable();\n Repo::dropTable();\n Project::dropTable();\n }",
"protected function _doGenerate()\n {\n if (null === $this->_opts->table) {\n $this->_getLogger()->info(\n 'No table option given, generating all tables'\n );\n\n $tables = array_keys($this->_schema);\n } else {\n $tables = $this->_opts->getAsArray('table');\n }\n\n foreach ($tables as $table) {\n $this->_getLogger()->info('Generating ' . $table . ' DAO');\n $this->_generateDao($table);\n }\n }",
"protected function dropDatabaseTable(): void\n {\n /** @var Connection $connection */\n $connection = $this->container->get(Connection::class);\n\n if (method_exists($connection, 'executeStatement')) {\n $connection->executeStatement('SET FOREIGN_KEY_CHECKS=0;');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_order`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_serial`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_media`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_download_history`');\n $connection->executeStatement('DROP TABLE IF EXISTS `sas_product_esd_video`');\n $connection->executeStatement('ALTER TABLE `product` DROP COLUMN `esd`');\n $connection->executeStatement('SET FOREIGN_KEY_CHECKS=1;');\n } else {\n $connection->exec('SET FOREIGN_KEY_CHECKS=0;');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_order`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_serial`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_media`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_download_history`');\n $connection->exec('DROP TABLE IF EXISTS `sas_product_esd_video`');\n $connection->exec('ALTER TABLE `product` DROP COLUMN `esd`');\n $connection->exec('SET FOREIGN_KEY_CHECKS=1;');\n }\n }",
"function monitor_vider_tables($nom_meta_base_version) {\n\n\tsql_drop_table('spip_monitor');\n\tsql_drop_table('spip_monitor_log');\n\tsql_drop_table('spip_monitor_stats');\n\tsql_drop_table('spip_monitor_stats_plugins');\n\tsql_drop_table('spip_monitor_evenements');\n\tsql_alter('TABLE spip_syndic DROP COLUMN date_ping');\n\tsql_alter('TABLE spip_syndic DROP COLUMN statut_log');\n\tsql_alter('TABLE spip_syndic DROP COLUMN statut_stats');\n\tsql_alter('TABLE spip_syndic DROP COLUMN monitor_evenements');\n\teffacer_meta('monitor');\n\teffacer_meta($nom_meta_base_version);\n}",
"public function uninstall() {\n $this->load->model('extension/module/export_yml');\n $this->model_extension_module_export_yml->uninstallPromCategoryTable();\n $this->model_extension_module_export_yml->uninstallPromProductTable();\n }",
"function uninstall() {\r\n SQLExec('DROP TABLE IF EXISTS products');\r\n SQLExec('DROP TABLE IF EXISTS product_categories');\r\n SQLExec('DROP TABLE IF EXISTS shopping_list_items');\r\n parent::uninstall();\r\n }",
"public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }",
"public static function dropTables()\n\t{\n\t}",
"private function activateCreateAlterTables()\n {\n $PluginDbStructure = new \\RdDownloads\\App\\Models\\PluginDbStructure();\n $schemas = $PluginDbStructure->get();\n unset($PluginDbStructure);\n\n if (is_array($schemas) && !empty($schemas) && !is_null($this->getDbVersion())) {\n global $wpdb;\n // require file that needs for use dbDelta() function.\n require_once ABSPATH . '/wp-admin/includes/upgrade.php';\n\n foreach ($schemas as $index => $item) {\n if (isset($item['statement']) && isset($item['tablename'])) {\n $sql = str_replace('%TABLE%', $item['tablename'], $item['statement']);\n\n if (isset($item['is_multisite']) && $item['is_multisite'] === true) {\n // if set to multisite table then it will create prefix_sitenumber_tablename.\n $prefix = $wpdb->prefix;\n } else {\n // if set not to multisite then it will create prefix_tablename.\n $prefix = $wpdb->base_prefix;\n }\n\n $sql = str_replace('%PREFIX%', $prefix, $sql);\n dbDelta($sql);\n unset($sql);\n\n if (function_exists('maybe_convert_table_to_utf8mb4')) {\n maybe_convert_table_to_utf8mb4($prefix . $item['tablename']);\n }\n unset($prefix);\n }\n }// endforeach;\n unset($index, $item);\n }\n\n unset($schemas);\n }",
"function createDBTables() {\n $installer = new TrelloInstaller();\n return $installer->install();\n }",
"public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE reparaciones_estados DROP FOREIGN KEY FK_2DE8BAD0AB0096FA');\n $this->addSql('ALTER TABLE reparaciones_pagos DROP FOREIGN KEY FK_B4D9E502AB0096FA');\n $this->addSql('ALTER TABLE reparaciones_pagos_detalle DROP FOREIGN KEY FK_37BAF0B363FB8380');\n $this->addSql('CREATE TABLE combos_galeria (id INT AUTO_INCREMENT NOT NULL, id_combo_id INT NOT NULL, url VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, habilitado SMALLINT NOT NULL, INDEX IDX_D779D131BBBE6B76 (id_combo_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE materiales (id INT AUTO_INCREMENT NOT NULL, id_unidad_medida_id INT NOT NULL, nombre VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, codigo_barras VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, costo DOUBLE PRECISION DEFAULT \\'NULL\\', stock_actual INT NOT NULL, INDEX IDX_BC062AC9E16A5625 (id_unidad_medida_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE productos_galeria (id INT AUTO_INCREMENT NOT NULL, id_producto_id INT NOT NULL, url VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, habilitado SMALLINT NOT NULL, INDEX IDX_A10E30966E57A479 (id_producto_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE servicios (id INT AUTO_INCREMENT NOT NULL, nombre VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, descripcion LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, habilitado TINYINT(1) NOT NULL, eliminado TINYINT(1) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE servicios_galeria (id INT AUTO_INCREMENT NOT NULL, id_servicio_id INT NOT NULL, url VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, habilitado SMALLINT NOT NULL, INDEX IDX_9D252E9669D86E10 (id_servicio_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE servicios_productos (id INT AUTO_INCREMENT NOT NULL, id_servicio_id INT NOT NULL, id_producto_id INT NOT NULL, INDEX IDX_962C75C069D86E10 (id_servicio_id), INDEX IDX_962C75C06E57A479 (id_producto_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE servicios_reparaciones (id INT AUTO_INCREMENT NOT NULL, id_servicio_id INT NOT NULL, nombre VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, precio DOUBLE PRECISION NOT NULL, tiempo_estimado INT DEFAULT NULL, descripcion LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, habilitado SMALLINT NOT NULL, eliminado SMALLINT NOT NULL, INDEX IDX_7C7310B369D86E10 (id_servicio_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE servicios_reparaciones_materiales (id INT AUTO_INCREMENT NOT NULL, reparacion_id INT NOT NULL, material_id INT NOT NULL, cantidad INT NOT NULL, INDEX IDX_C5B3814AB0096FA (reparacion_id), INDEX IDX_C5B3814E308AC6F (material_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE combos_galeria ADD CONSTRAINT FK_D779D131BBBE6B76 FOREIGN KEY (id_combo_id) REFERENCES combos (id)');\n $this->addSql('ALTER TABLE materiales ADD CONSTRAINT FK_BC062AC9E16A5625 FOREIGN KEY (id_unidad_medida_id) REFERENCES unidades_medida (id)');\n $this->addSql('ALTER TABLE productos_galeria ADD CONSTRAINT FK_A10E30966E57A479 FOREIGN KEY (id_producto_id) REFERENCES productos (id)');\n $this->addSql('ALTER TABLE servicios_galeria ADD CONSTRAINT FK_9D252E9669D86E10 FOREIGN KEY (id_servicio_id) REFERENCES servicios (id)');\n $this->addSql('ALTER TABLE servicios_productos ADD CONSTRAINT FK_962C75C069D86E10 FOREIGN KEY (id_servicio_id) REFERENCES servicios (id)');\n $this->addSql('ALTER TABLE servicios_productos ADD CONSTRAINT FK_962C75C06E57A479 FOREIGN KEY (id_producto_id) REFERENCES productos (id)');\n $this->addSql('ALTER TABLE servicios_reparaciones ADD CONSTRAINT FK_7C7310B369D86E10 FOREIGN KEY (id_servicio_id) REFERENCES servicios (id)');\n $this->addSql('ALTER TABLE servicios_reparaciones_materiales ADD CONSTRAINT FK_C5B3814AB0096FA FOREIGN KEY (reparacion_id) REFERENCES servicios_reparaciones (id)');\n $this->addSql('ALTER TABLE servicios_reparaciones_materiales ADD CONSTRAINT FK_C5B3814E308AC6F FOREIGN KEY (material_id) REFERENCES materiales (id)');\n $this->addSql('DROP TABLE reparaciones');\n $this->addSql('DROP TABLE reparaciones_estados');\n $this->addSql('DROP TABLE reparaciones_pagos');\n $this->addSql('DROP TABLE reparaciones_pagos_detalle');\n $this->addSql('ALTER TABLE caja CHANGE usuario_apertura_id usuario_apertura_id INT DEFAULT NULL, CHANGE usuario_cierre_id usuario_cierre_id INT DEFAULT NULL, CHANGE cierre cierre DATETIME DEFAULT \\'NULL\\', CHANGE saldo_estimado saldo_estimado DOUBLE PRECISION DEFAULT \\'NULL\\', CHANGE saldo_final saldo_final DOUBLE PRECISION DEFAULT \\'NULL\\'');\n $this->addSql('ALTER TABLE clientes CHANGE telefono telefono VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE direccion direccion VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE cuit cuit INT DEFAULT NULL, CHANGE razon_social razon_social VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`');\n $this->addSql('ALTER TABLE clientes_almacenes CHANGE id_cliente_id id_cliente_id INT DEFAULT NULL, CHANGE id_almacen_id id_almacen_id INT DEFAULT NULL');\n $this->addSql('ALTER TABLE compras CHANGE proveedor_id proveedor_id INT DEFAULT NULL, CHANGE almacen_id almacen_id INT DEFAULT NULL, CHANGE precio precio DOUBLE PRECISION DEFAULT \\'NULL\\', CHANGE recepcion recepcion DATETIME DEFAULT \\'NULL\\'');\n $this->addSql('ALTER TABLE cotizaciones CHANGE id_cliente_id id_cliente_id INT DEFAULT NULL, CHANGE creador_id creador_id INT DEFAULT NULL, CHANGE almacen_id almacen_id INT DEFAULT NULL, CHANGE hasta hasta DATE DEFAULT \\'NULL\\', CHANGE descuento descuento DOUBLE PRECISION DEFAULT \\'NULL\\'');\n $this->addSql('ALTER TABLE cotizaciones_productos ADD cantidad INT NOT NULL, ADD precio_actual DOUBLE PRECISION NOT NULL, ADD costo_actual DOUBLE PRECISION NOT NULL, ADD reserva_mercaderia TINYINT(1) NOT NULL');\n $this->addSql('ALTER TABLE movimientos_caja CHANGE caja_id caja_id INT DEFAULT NULL, CHANGE creador_id creador_id INT DEFAULT NULL, CHANGE observaciones observaciones VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`');\n $this->addSql('ALTER TABLE productos CHANGE codigo_barras codigo_barras VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE imagen imagen VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE diametro diametro DOUBLE PRECISION DEFAULT \\'NULL\\', CHANGE largo largo DOUBLE PRECISION DEFAULT \\'NULL\\', CHANGE ancho ancho DOUBLE PRECISION DEFAULT \\'NULL\\', CHANGE color color VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE material material VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE iva iva DOUBLE PRECISION DEFAULT \\'NULL\\'');\n $this->addSql('ALTER TABLE proveedores CHANGE cuit cuit VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE telefono telefono VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE mail mail VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE direccion direccion VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`');\n $this->addSql('ALTER TABLE proveedores_productos CHANGE costo costo DOUBLE PRECISION DEFAULT \\'NULL\\'');\n $this->addSql('ALTER TABLE unidades_medida CHANGE corto corto VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`');\n $this->addSql('ALTER TABLE usuarios CHANGE roles roles LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_bin`, CHANGE direccion direccion VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`');\n $this->addSql('ALTER TABLE ventas CHANGE cliente_id cliente_id INT DEFAULT NULL');\n $this->addSql('ALTER TABLE ventas_pagos CHANGE comprobante comprobante VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE url_comprobante url_comprobante VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`, CHANGE observaciones observaciones VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT \\'NULL\\' COLLATE `utf8mb4_unicode_ci`');\n }",
"public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }",
"public function getDownSQL()\n\t{\n\t\treturn array (\n 'propel' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP INDEX `collector_U_1` ON `collector`;\nDROP INDEX `collector_U_2` ON `collector`;\nDROP INDEX `collector_U_3` ON `collector`;\nDROP INDEX `collector_U_4` ON `collector`;\nDROP INDEX `collector_U_5` ON `collector`;\nDROP INDEX `collector_U_6` ON `collector`;\n\nCREATE INDEX `facebook_id` ON `collector` (`facebook_id`);\nCREATE INDEX `collector_FI_1` ON `collector` (`session_id`);\nCREATE UNIQUE INDEX `collector_U_1` ON `collector` (`email`);\nCREATE UNIQUE INDEX `collector_U_2` ON `collector` (`graph_id`);\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}",
"public function getDownSQL()\n\t{\n\t\treturn array (\n 'propel' => '\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\nALTER TABLE `command` CHANGE `std_out_file` `std_out_file` VARCHAR(50);\nALTER TABLE `command` CHANGE `std_err_file` `std_err_file` VARCHAR(50);\nALTER TABLE `command` CHANGE `exit_file` `exit_file` VARCHAR(50);\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n\t}",
"public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }",
"function deinstallPackageDyntables() {\n @unlink('/usr/local/www/diag_dhcp_leases.php');\n @unlink('/usr/local/www/javascript/dyntables.js');\n @rename('/usr/local/pkg/diag_dhcp_leases.php.org', '/usr/local/www/diag_dhcp_leases.php');\n}",
"function uninstall() {\n SQLExec('DROP TABLE IF EXISTS lagartoservers');\n SQLExec('DROP TABLE IF EXISTS lagartoendpoints');\n parent::uninstall();\n }",
"public function getDownSQL()\n {\n return array (\n 'cungfoo' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `demande_identifiant_i18n`;\n\nDROP TABLE IF EXISTS `top_camping_i18n`;\n\nDROP TABLE IF EXISTS `demande_annulation_i18n`;\n\nALTER TABLE `activite_i18n` DROP `seo_title`;\n\nALTER TABLE `activite_i18n` DROP `seo_description`;\n\nALTER TABLE `activite_i18n` DROP `seo_h1`;\n\nALTER TABLE `activite_i18n` DROP `seo_keywords`;\n\nALTER TABLE `avantage_i18n` DROP `seo_title`;\n\nALTER TABLE `avantage_i18n` DROP `seo_description`;\n\nALTER TABLE `avantage_i18n` DROP `seo_h1`;\n\nALTER TABLE `avantage_i18n` DROP `seo_keywords`;\n\nALTER TABLE `baignade_i18n` DROP `seo_title`;\n\nALTER TABLE `baignade_i18n` DROP `seo_description`;\n\nALTER TABLE `baignade_i18n` DROP `seo_h1`;\n\nALTER TABLE `baignade_i18n` DROP `seo_keywords`;\n\nALTER TABLE `bon_plan_categorie_i18n` DROP `seo_title`;\n\nALTER TABLE `bon_plan_categorie_i18n` DROP `seo_description`;\n\nALTER TABLE `bon_plan_categorie_i18n` DROP `seo_h1`;\n\nALTER TABLE `bon_plan_categorie_i18n` DROP `seo_keywords`;\n\nALTER TABLE `bon_plan_i18n` DROP `seo_title`;\n\nALTER TABLE `bon_plan_i18n` DROP `seo_description`;\n\nALTER TABLE `bon_plan_i18n` DROP `seo_h1`;\n\nALTER TABLE `bon_plan_i18n` DROP `seo_keywords`;\n\nALTER TABLE `categorie_i18n` DROP `seo_title`;\n\nALTER TABLE `categorie_i18n` DROP `seo_description`;\n\nALTER TABLE `categorie_i18n` DROP `seo_h1`;\n\nALTER TABLE `categorie_i18n` DROP `seo_keywords`;\n\nALTER TABLE `category_type_hebergement_i18n` DROP `seo_title`;\n\nALTER TABLE `category_type_hebergement_i18n` DROP `seo_description`;\n\nALTER TABLE `category_type_hebergement_i18n` DROP `seo_h1`;\n\nALTER TABLE `category_type_hebergement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `departement_i18n` DROP `seo_title`;\n\nALTER TABLE `departement_i18n` DROP `seo_description`;\n\nALTER TABLE `departement_i18n` DROP `seo_h1`;\n\nALTER TABLE `departement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `edito_i18n` DROP `seo_title`;\n\nALTER TABLE `edito_i18n` DROP `seo_description`;\n\nALTER TABLE `edito_i18n` DROP `seo_h1`;\n\nALTER TABLE `edito_i18n` DROP `seo_keywords`;\n\nALTER TABLE `etablissement_i18n` DROP `seo_title`;\n\nALTER TABLE `etablissement_i18n` DROP `seo_description`;\n\nALTER TABLE `etablissement_i18n` DROP `seo_h1`;\n\nALTER TABLE `etablissement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `event_i18n` DROP `seo_title`;\n\nALTER TABLE `event_i18n` DROP `seo_description`;\n\nALTER TABLE `event_i18n` DROP `seo_h1`;\n\nALTER TABLE `event_i18n` DROP `seo_keywords`;\n\nALTER TABLE `idee_weekend_i18n` DROP `seo_title`;\n\nALTER TABLE `idee_weekend_i18n` DROP `seo_description`;\n\nALTER TABLE `idee_weekend_i18n` DROP `seo_h1`;\n\nALTER TABLE `idee_weekend_i18n` DROP `seo_keywords`;\n\nALTER TABLE `mise_en_avant_i18n` DROP `seo_title`;\n\nALTER TABLE `mise_en_avant_i18n` DROP `seo_description`;\n\nALTER TABLE `mise_en_avant_i18n` DROP `seo_h1`;\n\nALTER TABLE `mise_en_avant_i18n` DROP `seo_keywords`;\n\nALTER TABLE `multimedia_etablissement_i18n` DROP `seo_title`;\n\nALTER TABLE `multimedia_etablissement_i18n` DROP `seo_description`;\n\nALTER TABLE `multimedia_etablissement_i18n` DROP `seo_h1`;\n\nALTER TABLE `multimedia_etablissement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `multimedia_type_hebergement_i18n` DROP `seo_title`;\n\nALTER TABLE `multimedia_type_hebergement_i18n` DROP `seo_description`;\n\nALTER TABLE `multimedia_type_hebergement_i18n` DROP `seo_h1`;\n\nALTER TABLE `multimedia_type_hebergement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `pays_i18n` DROP `seo_title`;\n\nALTER TABLE `pays_i18n` DROP `seo_description`;\n\nALTER TABLE `pays_i18n` DROP `seo_h1`;\n\nALTER TABLE `pays_i18n` DROP `seo_keywords`;\n\nALTER TABLE `personnage_i18n` DROP `seo_title`;\n\nALTER TABLE `personnage_i18n` DROP `seo_description`;\n\nALTER TABLE `personnage_i18n` DROP `seo_h1`;\n\nALTER TABLE `personnage_i18n` DROP `seo_keywords`;\n\nALTER TABLE `point_interet_i18n` DROP `seo_title`;\n\nALTER TABLE `point_interet_i18n` DROP `seo_description`;\n\nALTER TABLE `point_interet_i18n` DROP `seo_h1`;\n\nALTER TABLE `point_interet_i18n` DROP `seo_keywords`;\n\nALTER TABLE `region_i18n` DROP `seo_title`;\n\nALTER TABLE `region_i18n` DROP `seo_description`;\n\nALTER TABLE `region_i18n` DROP `seo_h1`;\n\nALTER TABLE `region_i18n` DROP `seo_keywords`;\n\nALTER TABLE `region_ref_i18n` DROP `seo_title`;\n\nALTER TABLE `region_ref_i18n` DROP `seo_description`;\n\nALTER TABLE `region_ref_i18n` DROP `seo_h1`;\n\nALTER TABLE `region_ref_i18n` DROP `seo_keywords`;\n\nALTER TABLE `service_complementaire_i18n` DROP `seo_title`;\n\nALTER TABLE `service_complementaire_i18n` DROP `seo_description`;\n\nALTER TABLE `service_complementaire_i18n` DROP `seo_h1`;\n\nALTER TABLE `service_complementaire_i18n` DROP `seo_keywords`;\n\nALTER TABLE `situation_geographique_i18n` DROP `seo_title`;\n\nALTER TABLE `situation_geographique_i18n` DROP `seo_description`;\n\nALTER TABLE `situation_geographique_i18n` DROP `seo_h1`;\n\nALTER TABLE `situation_geographique_i18n` DROP `seo_keywords`;\n\nALTER TABLE `tag_i18n` DROP `seo_title`;\n\nALTER TABLE `tag_i18n` DROP `seo_description`;\n\nALTER TABLE `tag_i18n` DROP `seo_h1`;\n\nALTER TABLE `tag_i18n` DROP `seo_keywords`;\n\nALTER TABLE `thematique_i18n` DROP `seo_title`;\n\nALTER TABLE `thematique_i18n` DROP `seo_description`;\n\nALTER TABLE `thematique_i18n` DROP `seo_h1`;\n\nALTER TABLE `thematique_i18n` DROP `seo_keywords`;\n\nALTER TABLE `theme_i18n` DROP `seo_title`;\n\nALTER TABLE `theme_i18n` DROP `seo_description`;\n\nALTER TABLE `theme_i18n` DROP `seo_h1`;\n\nALTER TABLE `theme_i18n` DROP `seo_keywords`;\n\nALTER TABLE `type_hebergement_capacite_i18n` DROP `seo_title`;\n\nALTER TABLE `type_hebergement_capacite_i18n` DROP `seo_description`;\n\nALTER TABLE `type_hebergement_capacite_i18n` DROP `seo_h1`;\n\nALTER TABLE `type_hebergement_capacite_i18n` DROP `seo_keywords`;\n\nALTER TABLE `type_hebergement_i18n` DROP `seo_title`;\n\nALTER TABLE `type_hebergement_i18n` DROP `seo_description`;\n\nALTER TABLE `type_hebergement_i18n` DROP `seo_h1`;\n\nALTER TABLE `type_hebergement_i18n` DROP `seo_keywords`;\n\nALTER TABLE `ville_i18n` DROP `seo_title`;\n\nALTER TABLE `ville_i18n` DROP `seo_description`;\n\nALTER TABLE `ville_i18n` DROP `seo_h1`;\n\nALTER TABLE `ville_i18n` DROP `seo_keywords`;\n\nALTER TABLE `vos_vacances_i18n` DROP `seo_title`;\n\nALTER TABLE `vos_vacances_i18n` DROP `seo_description`;\n\nALTER TABLE `vos_vacances_i18n` DROP `seo_h1`;\n\nALTER TABLE `vos_vacances_i18n` DROP `seo_keywords`;\n\nDROP TABLE IF EXISTS `seo`;\n\nDROP TABLE IF EXISTS `seo_i18n`;\n\nALTER TABLE `destination_i18n` CHANGE `seo_title` `seo_title` VARCHAR(255) DEFAULT \\'\\';\n\nALTER TABLE `destination_i18n` CHANGE `seo_h1` `seo_h1` VARCHAR(255) DEFAULT \\'\\';\n\nALTER TABLE `metadata_i18n` CHANGE `seo_title` `seo_title` VARCHAR(255) DEFAULT \\'\\';\n\nALTER TABLE `metadata_i18n` CHANGE `seo_h1` `seo_h1` VARCHAR(255) DEFAULT \\'\\';\n\nALTER TABLE `destination_i18n` DROP `seo_h1`;\n\nALTER TABLE `destination_i18n` DROP `seo_keywords`;\n\nALTER TABLE `metadata_i18n` DROP `seo_h1`;\n\nALTER TABLE `metadata_i18n` DROP `seo_keywords`;\n\nALTER TABLE `metadata_i18n` DROP `seo_title`;\n\nALTER TABLE `metadata_i18n` DROP `seo_description`;\n\nALTER TABLE `destination_i18n` DROP `seo_title`;\n\nALTER TABLE `destination_i18n` DROP `seo_description`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }",
"function kkm_uninstall($sql_only = false) {\r\n\tglobal $wpdb, $install_sql;\r\n\t$tables = array();\r\n\t$views = array();\r\n\t\r\n\t//Tables\r\n\tpreg_match_all('/create +table +(?:if not exists +)?`(.*?)`/i', $install_sql, $preg_res, PREG_SET_ORDER);\r\n\tforeach ($preg_res as $res) {\r\n\t\t$tables[] = $res[1];\r\n\t}\r\n\t$tables = array_reverse($tables); //Tables should be dropped in reverse order due to foreign key constraints\r\n\t\r\n\t//Views\r\n\tpreg_match_all('/create +(?:or replace +)?view +`(.*?)`/i', $install_sql, $preg_res, PREG_SET_ORDER);\r\n\tforeach ($preg_res as $res) {\r\n\t\t$views[] = $res[1];\r\n\t}\r\n\t\r\n\tif (!empty($tables)) {\r\n\t\t$wpdb->query('drop table if exists `'.implode('`,`', $tables).'`;');\r\n\t}\r\n\tif (!empty($views)) {\r\n\t\t$wpdb->query('drop view if exists `'.implode('`,`', $views).'`;');\r\n\t}\r\n\t\r\n\t//Delete files from the filesystem\r\n\tif (!$sql_only) {\r\n\t\t//TODO\r\n\t}\r\n}"
] |
[
"0.6039941",
"0.5992911",
"0.59460634",
"0.5909256",
"0.58505386",
"0.5832736",
"0.57886827",
"0.5715586",
"0.5712637",
"0.56999105",
"0.56890905",
"0.56463367",
"0.56144863",
"0.5610201",
"0.56066674",
"0.56023306",
"0.55771494",
"0.5574981",
"0.5551421",
"0.5523845",
"0.55227506",
"0.55138516",
"0.549998",
"0.54987323",
"0.54926914",
"0.5478454",
"0.54739505",
"0.54631954",
"0.54590195",
"0.54587805"
] |
0.6137524
|
0
|
Test the inheritance of the AbstractConfiguration class.
|
public function testInheritance()
{
AbstractConfigurationInstance::$allowedKeys = [];
$config = new AbstractConfigurationInstance();
static::assertInstanceOf(JsonSerializable::class, $config);
static::assertInstanceOf(IConfiguration::class, $config);
static::assertInstanceOf(AbstractConfiguration::class, $config);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testAbstract() {\n $config = new Config();\n $this->assertInstanceOf('Nimbles\\Core\\Collection', $config);\n }",
"abstract protected function defineConfiguration();",
"public function setUp()\n {\n // to avoid side effects from inherited configuration contents\n ConfigurationManager::setConfiguration(new Configuration());\n }",
"abstract public function configure();",
"protected function getConfiguration() {}",
"public function testGetConfiguration() {\n\n $obj = new WBWJQueryDataTablesExtension();\n\n $this->assertInstanceOf(Configuration::class, $obj->getConfiguration([], $this->containerBuilder));\n }",
"abstract protected function configure();",
"abstract protected function configure();",
"public function testGetConfig()\n {\n $sut = new TestFixtureConfigTrait;\n $result = $sut->getConfig();\n $this->assertInstanceOf('\\MvcLite\\Config', $result);\n }",
"protected function setUpConfigurationData() {}",
"public function testCustomConfiguration() {\n\t\t$old = Router::config();\n\t\t$config = ['classes' => [\n\t\t\t'route' => 'my\\custom\\Route',\n\t\t\t'configuration' => 'lithium\\net\\http\\Configuration'\n\t\t], 'unicode' => true];\n\n\t\tRouter::config($config);\n\t\t$this->assertEqual($config, Router::config());\n\n\t\tRouter::config($old);\n\t\t$this->assertEqual($old, Router::config());\n\t}",
"abstract public function generateConfiguration();",
"protected function initializeConfiguration() {}",
"public function getConfiguration();",
"public function getConfiguration();",
"public function getConfiguration();",
"public function getConfiguration() {}",
"public function getConfiguration() {}",
"public function testExtends(){\n $conf = $this->getConfig('env-test-dev');\n $conf->setGroup('test');\n\n $value = $conf->get('config');\n\n $this->assertTrue(is_array($value));\n\n $value = $conf->get('emptyvar');\n $this->assertFalse($value);\n\n $value = $conf->get('emptyvar',true);\n $this->assertTrue(empty($value));\n\n $value = $conf->get('undefined_var');\n $this->assertFalse($value);\n\n $value = $conf->get('undefined_var',true);\n $this->assertFalse($value);\n\n\n $conf->setGroup('test-extend-file');\n $value = $conf->get('world');\n $this->assertEquals($value,'hello');\n\n\n $conf->setGroup('unexistent_group');\n $this->assertFalse($conf->get('world'));\n }",
"public function testOrgApacheSlingCaconfigImplDefDefaultConfigurationInheritanceStra()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.sling.caconfig.impl.def.DefaultConfigurationInheritanceStrategy';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testConstruct()\n {\n $configuration = new Configuration();\n $this->assertInstanceOf(\n 'Pagantis\\OrdersApiClient\\Model\\Order\\Configuration\\Channel',\n $configuration->getChannel()\n );\n $this->assertInstanceOf(\n 'Pagantis\\OrdersApiClient\\Model\\Order\\Configuration\\Urls',\n $configuration->getUrls()\n );\n }",
"public function testValidateConfiguration()\n\t{\n\t\t$method = $this->setAccessibleMethod('validateConfig');\n\n\t\t$results = $method->invoke($this->dbConfiguration->newInstance([\n\t\t\t'default' => 'default',\n\t\t\t'connections' => [\n\t\t\t\t'default' => [\n\t\t\t\t\t'hostname' => 'localhost',\n\t\t\t\t\t'driver' => 'mysql',\n\t\t\t\t\t'database' => 'database'\n\t\t\t\t]\n\t\t\t]\n\t\t]));\n\n\t\t$this->assertSame(null, $results);\n\t}",
"public function testDefaultsApplying()\n {\n $cfg = new ConfigLoader(realpath(__DIR__ . '/../config/database-config.ini'), $this->config);\n $ro = new \\ReflectionObject($cfg);\n $prop = $ro->getProperty('configs');\n $prop->setAccessible(true);\n $value = $prop->getValue($cfg);\n\n $this->assertTrue(is_scalar($value['main']['dbClassImpl']));\n }",
"public function testThatCanGetConfigTreeBuilder()\n{\n$configuration = new Configuration();\n$this->assertInstanceOf('Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder', $configuration->getConfigTreeBuilder());\n}",
"public function testConfig()\n {\n $connection = new MockConnection($this->mockConnector, $this->mockCompiler);\n $this->assertEquals('mock', $connection->config('driver'));\n }",
"public function testConfigLoaded()\n {\n $this->assertClassHasAttribute('credentials', '\\interview\\Config_Database');\n }",
"public function it_can_be_configured()\n {\n $this->beConstructedWith(self::CONFIG_BASIC);\n $this->getWrappedObject();\n }",
"public function setUp()\n {\n $this->setApplicationConfig(\n include __DIR__ . '/../../TestConfiguration.php'\n );\n parent::setUp();\n }",
"public static function getConfiguration();",
"public function configure();"
] |
[
"0.708422",
"0.70011544",
"0.6797106",
"0.6752929",
"0.67355007",
"0.6720633",
"0.66240704",
"0.66240704",
"0.6567616",
"0.6450353",
"0.64374095",
"0.6332026",
"0.6322394",
"0.6279407",
"0.6279407",
"0.6279407",
"0.6272342",
"0.6271856",
"0.62573683",
"0.6217386",
"0.61964464",
"0.61758",
"0.6143759",
"0.6135283",
"0.60634357",
"0.6052052",
"0.60471195",
"0.6035867",
"0.5977104",
"0.5964827"
] |
0.8526012
|
0
|
Test unknown configuration key for set().
|
public function testUnknownConfigurationKeyForSet()
{
AbstractConfigurationInstance::$allowedKeys = ['asemoqTU'];
(new AbstractConfigurationInstance())->set('JDsUJLrq', '84VUPgAS2i');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testInvalidValueForSet($value)\n {\n AbstractConfigurationInstance::$allowedKeys = ['FsgNGucN'];\n (new AbstractConfigurationInstance())->set('FsgNGucN', $value);\n }",
"public abstract function setConfig($key, $value);",
"public function testNonScalarValue()\n {\n $cfg = new Config();\n $this->setExpectedException(InvalidArgumentException::class);\n $cfg->set('newkey', new stdClass);\n }",
"function _set($key,$value){\n switch($key){\n case 'value': case 'val': $this->set($value); return TRUE;\n case 'settings': $this->set_settings($value); return TRUE;\n case 'key': $this->set_key($value); return TRUE;\n }\n return FALSE;\n }",
"public function testCacheKeyInvalidTypeBoolean(): void\n {\n $value = '99 bottles of beer on the wall';\n $key = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->set($key, $value);\n }",
"public function hasConfig($key);",
"public function set(string $key, $value) : bool;",
"public function configure($key, $value){\r\n\t\t// checking for that key is exists//\r\n\t\tif(key_exists($key, $this->config)){\r\n\t\t\t//check for type\t\t\r\n\t\t\t$this->config[$key] = $value;\r\n\t\t\treturn TRUE;\r\n\t\t}\r\n\t\t//key not exists//\r\n\t\t\r\n\t\treturn FALSE;\r\n\t}",
"static function is_set($src, $key){\n\t\tif(isset($src[$key]) || array_key_exists($key, $src)){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function hasConfig(string $key): bool;",
"public function testNonStrings($key)\n {\n $store = new \\Loom\\Settable();\n $this->assertNull($store->set($key, \"myvalue\"));\n $this->assertEmpty($store->get());\n }",
"public function testGetSetConfig()\n {\n $this->config->set('foo', 'baz');\n $this->assertEquals($this->config->get('foo'), 'baz');\n }",
"public function testGettingUnsetConfigurationKey()\n {\n AbstractConfigurationInstance::$allowedKeys = ['SXOtJQme'];\n static::assertNull((new AbstractConfigurationInstance())->get('SXOtJQme'));\n }",
"final public static function set(int $key,$value):bool\n {\n return assert_options($key,$value) !== false;\n }",
"function is_Set($key)\n {\n return isset($this->keyvalList[$key]);\n }",
"public function testCanCheckForExistingKeys($key, $internalKey, $value) {\n $this->assertFalse($this->container->has($key));\n $this->assertFalse($this->container->has($internalKey));\n $this->assertSame($this->container, $this->container->set($key, $value));\n $this->assertTrue($this->container->has($key));\n $this->assertTrue($this->container->has($internalKey));\n }",
"public function testConfigHasApiKey()\n\t{\n\t\t$this->assertTrue(isset($this->config['apiKey']));\n\t\t$this->assertTrue(empty($this->config['apiKey']));\n\t}",
"public function setConfig($key, $value);",
"abstract public function set($key, $value);",
"abstract public function set($key, $value);",
"function ini_safe_set($key, $value) {\n\t// some hosts disable ini_set for security \n\t// lets check so see if its disabled\n\tif(($disable_functions = ini_get('disable_functions')) !== false) {\n\t\t// if it is disabled then return as there is nothing we can do\n\t\tif(strpos($disable_functions, 'ini_set') !== false) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t// lets set it because we can!\n\treturn ini_set($key, $value);\n}",
"private function validateConfigKey($key)\n {\n if ( ! is_scalar($key) ) {\n $this->throwException(new \\InvalidArgumentException('Key needs to be a valid scalar!'));\n }\n }",
"abstract public function set ($key, $value);",
"public function testAddKey()\n {\n $akey = 'akey';\n $this->config->aKey = 'akey';\n $this->assertEqual($this->config->aKey, 'akey');\n $this->assertStrictlyEqual($this->config->aKey, $akey);\n }",
"static function set($key, $value){\n \n if (!array_key_exists($key, self::$dades)) //array_key_exists comprueba si existe\n { \n self::$dades[$key] = $value; \n return true; //si existe le pasamos true\n \n }else\n { \n return false; //si existe le pasamos false \n } \n \n }",
"public function testSetKeyPairInvalidArgumentKeyContainsColon(): void\n {\n $key = 'key:key';\n $value = 'Test Value';\n $this->expectException(\\InvalidArgumentException::class);\n $this->testNotStrict->set($key, $value);\n }",
"function set($key = '', $value)\n {\n }",
"public function set($key, $value){\n \n $key = $this->_getKey($key);\n \n if(!is_string($key)){\n throw new \\InvalidArgumentException(\"key must be a string\");\n }\n \n if(!$key) {\n return false;\n }\n \n return parent::set($key, $value);\n }",
"public function set($key, $value = null): bool;",
"public function test_OffsetSetException_WrongValueType()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to set 'a' to '30' for Config_Dir '{$this->dir}': Creating a section requires setting an array or Config_File object.\");\n $config = new Config_Dir($this->dir, array('ext'=>'mock')); \n $config['a'] = 30;\n }"
] |
[
"0.65555",
"0.6426069",
"0.63175976",
"0.6261107",
"0.62466943",
"0.6234555",
"0.61278987",
"0.61248803",
"0.60766",
"0.6051142",
"0.6043123",
"0.6039018",
"0.6033855",
"0.5983492",
"0.59351486",
"0.5892226",
"0.58840126",
"0.58713716",
"0.5863587",
"0.5863587",
"0.58582014",
"0.5850498",
"0.5834811",
"0.5829797",
"0.5815238",
"0.5803737",
"0.5801795",
"0.5801275",
"0.57951",
"0.57529944"
] |
0.80243826
|
0
|
Test get()ting an unset configuration key.
|
public function testGettingUnsetConfigurationKey()
{
AbstractConfigurationInstance::$allowedKeys = ['SXOtJQme'];
static::assertNull((new AbstractConfigurationInstance())->get('SXOtJQme'));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testUnknownConfigurationKeyForSet()\n {\n AbstractConfigurationInstance::$allowedKeys = ['asemoqTU'];\n (new AbstractConfigurationInstance())->set('JDsUJLrq', '84VUPgAS2i');\n }",
"public function test__unset()\n {\n $struct = $this->_newStruct();\n unset($struct->foo);\n $this->assertFalse(isset($struct->foo));\n try {\n $invalid = $struct->foo;\n $this->fail('Should have thrown a NO_SUCH_PROPERTY exception.');\n } catch (Solar_Exception_NoSuchProperty $e) {\n // pass\n }\n \n $struct = $this->_newStruct();\n unset($struct['foo']);\n $this->assertFalse(isset($struct['foo']));\n try {\n $invalid = $struct['foo'];\n $this->fail('Should have thrown a NO_SUCH_PROPERTY exception.');\n } catch (Solar_Exception_NoSuchProperty $e) {\n // pass\n }\n }",
"function get($key) {\n\t\t/* stub */\n\t\treturn false;\n\t}",
"public function testMissReturnsNull(): void\n {\n $key = 'I do not exist';\n $a = $this->testNotStrict->get($key);\n $this->assertNull($a);\n }",
"public function testForget()\n\t{\n\t\t$container = new Container();\n\t\t$container['param'] = 'value';\n\n\t\t$this->assertTrue(isset($container['param']));\n\n\t\tunset($container['param']);\n\n\t\t$this->assertFalse(isset($container['param']));\n\n\t\t$container->set('foo', 'bar');\n\n\t\t$this->assertTrue($container->has('foo'));\n\n\t\t$container->forget('foo');\n\n\t\t$this->assertFalse($container->has('foo'));\n\t}",
"public function testMagicGetForwardsNonOverriddenValues($key)\n {\n $this->request->expects($this->once())\n ->method('__get')\n ->will($this->returnValue(NULL));\n\n $this->assertNull($this->class->$key);\n }",
"public function testOffsetGetMissingKey()\n {\n self::assertNull($this->container->offsetGet('this key does not exist in the container'));\n }",
"public function testGetEmptyKey()\n {\n $data = [\n '' => 'some value'\n ];\n $result = Hash::get($data, '');\n $this->assertSame($data[''], $result);\n }",
"public /*void*/ function __unset(/*scalar*/ $key){}",
"public function testOffsetUnset()\n {\n $bag = new ArrayAttributeBag('foobar_storageKey');\n $bag->set('foo', 'bar');\n\n unset($bag['foo']);\n\n $this->assertFalse($bag->has('foo'));\n }",
"public function testOffsetUnset()\n {\n $struct = $this->_newStruct();\n $this->assertTrue($struct->offsetExists('foo'));\n $struct->offsetUnset('foo');\n $this->assertFalse($struct->offsetExists('foo'));\n }",
"public function test_get_non_existent() {\n $this->_cut->get(1);\n }",
"public function testDeleteAKey(): void\n {\n $this->testNotStrict->set('Test Key 1', 'foo 1');\n $this->testNotStrict->set('Test Key 2', 'foo 2');\n $this->testNotStrict->set('Test Key 3', 'foo 3');\n $bool = $this->testNotStrict->has('Test Key 1');\n $this->assertTrue($bool);\n $bool = $this->testNotStrict->has('Test Key 2');\n $this->assertTrue($bool);\n $bool = $this->testNotStrict->has('Test Key 3');\n $this->assertTrue($bool);\n $this->testNotStrict->delete('Test Key 2');\n $bool = $this->testNotStrict->has('Test Key 1');\n $this->assertTrue($bool);\n $bool = $this->testNotStrict->has('Test Key 2');\n $this->assertFalse($bool);\n $bool = $this->testNotStrict->has('Test Key 3');\n $this->assertTrue($bool);\n }",
"public function testConfigHasApiKey()\n\t{\n\t\t$this->assertTrue(isset($this->config['apiKey']));\n\t\t$this->assertTrue(empty($this->config['apiKey']));\n\t}",
"public function __unset($key);",
"public function __unset($key);",
"public function testGetBoolFalse(): void\n {\n // 0\n $_SERVER['MY_KEY'] = 0;\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // false\n $_SERVER['MY_KEY'] = false;\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // '0'\n $_SERVER['MY_KEY'] = '0';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'false'\n $_SERVER['MY_KEY'] = 'false';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'no'\n $_SERVER['MY_KEY'] = 'no';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'off'\n $_SERVER['MY_KEY'] = 'off';\n $this->assertFalse(Env::getBool('MY_KEY'));\n\n // 'unknown'\n $_SERVER['MY_KEY'] = 'unknown';\n $this->assertFalse(Env::getBool('MY_KEY'));\n }",
"public function unsetValue($key);",
"public function get ($key) {\n return false;\n }",
"public function forget(string $key): bool;",
"function config($key) {\n global $config;\n\n return !empty($config[$key]) ? $config[$key] : false;\n}",
"public function without($key);",
"public function testOffsetGet()\n {\n $struct = $this->_newStruct();\n \n $actual = $struct->offsetGet('foo');\n $expect = 'bar';\n $this->assertSame($actual, $expect);\n \n try {\n $actual = $struct->offsetGet('noSuchKey');\n $this->fail('Should have thrown a NO_SUCH_PROPERTY exception.');\n } catch (Solar_Exception_NoSuchProperty $e) {\n // pass\n }\n }",
"public function testDoesNotHaveValue()\n {\n $repository = new Repository($this->values);\n\n $this->assertFalse($repository->has('foobar'));\n $this->assertFalse($repository->has('assoc.z'));\n $this->assertFalse($repository->has('array.10'));\n\n $repository->setSeparator('-');\n\n $this->assertFalse($repository->has('assoc-r'));\n $this->assertFalse($repository->has('array-10'));\n }",
"function get($key) {\n\n $get = \\M\\Config::get('GET');\n if (isset($get[$key])) {\n return $get[$key];\n } else {\n\n return false;\n }\n}",
"public function testRemoveOnNotExistingKey()\n {\n $this->filter->value('test')->remove();\n\n $result = $this->filter->filter([]);\n\n $this->assertEquals([], $result);\n }",
"public function testConfigReset()\n {\n\n Config::setKind('house');\n Config::setLocale('RU');\n Config::setSkip(3);\n\n Config::reset();\n\n $this->assertEquals(null, Config::get('kind'));\n $this->assertEquals(null, Config::get('skip'));\n $this->assertEquals(null, Config::get('lang'));\n\n }",
"public function testClear() {\n\t\t$value='ipsum lorum';\n\t\t$this->instance->set('1_value1', $value);\n\t\t$this->instance->set('1_value2', $value);\n\t\t$this->instance->set('2_value1', $value);\n\t\t$this->instance->set('3_value1', $value);\n\n\t\t$this->assertTrue($this->instance->clear('1_'));\n\n\t\t$this->assertFalse($this->instance->hasKey('1_value1'));\n\t\t$this->assertFalse($this->instance->hasKey('1_value2'));\n\t\t//$this->assertTrue($this->instance->hasKey('2_value1'));\n\t\t//$this->assertTrue($this->instance->hasKey('3_value1'));\n\n\t\t$this->assertTrue($this->instance->clear());\n\n\t\t$this->assertFalse($this->instance->hasKey('1_value1'));\n\t\t$this->assertFalse($this->instance->hasKey('1_value2'));\n\t\t$this->assertFalse($this->instance->hasKey('2_value1'));\n\t\t$this->assertFalse($this->instance->hasKey('3_value1'));\n\t}",
"public function testMagicGetMethodWhenGetEmpty($key, $value)\n {\n $this->assertEquals($value, $this->class->$key);\n }",
"public function unsetProperty($key)\n\t{\n\t\tif(array_key_exists($key, $this->properties))\n\t\t{\n\t\t\tunset($this->properties[$key]);\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}"
] |
[
"0.6237493",
"0.622818",
"0.6222418",
"0.6204521",
"0.6200154",
"0.5994132",
"0.5942739",
"0.58634716",
"0.57995206",
"0.5774974",
"0.5769001",
"0.5761976",
"0.575048",
"0.5743165",
"0.57411367",
"0.57411367",
"0.5706908",
"0.5675809",
"0.56694114",
"0.56210077",
"0.56160146",
"0.5605748",
"0.56012136",
"0.5589428",
"0.55830234",
"0.55734575",
"0.5565378",
"0.5564304",
"0.5556397",
"0.5554673"
] |
0.7552855
|
0
|
Test invalid value for set().
|
public function testInvalidValueForSet($value)
{
AbstractConfigurationInstance::$allowedKeys = ['FsgNGucN'];
(new AbstractConfigurationInstance())->set('FsgNGucN', $value);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setInvalid();",
"public function testSetValueInvalid()\n {\n $this->expectException(\\InvalidArgumentException::class);\n\n $this->uut->setValue(new ArrayValue());\n }",
"public function testSetInvalidProperty() {\n $permission = new GroupPermission();\n $permission->set('invalid property', 'a value');\n }",
"public function testValueIsInvalid()\n {\n $init = 'foo';\n $set = array('test');\n $str = new \\Pv\\PEnum($init, null, $set);\n }",
"public function testMagicMethodIssetThrowsException()\n\t{\n\t\t$stub = new \\Orchestra\\Support\\Form\\Fieldset(function ($f) {});\n\n\t\t$invalid = isset($stub->invalid_property) ? true : false;\n\t}",
"public function testMagicMethodIssetThrowsException()\n {\n $this->expectException('InvalidArgumentException');\n\n $stub = new Grid($this->getContainer(), []);\n\n isset($stub->invalidProperty) ? true : false;\n }",
"final public static function set(int $key,$value):bool\n {\n return assert_options($key,$value) !== false;\n }",
"public function testSetInvalidRestrictAccessValue() {\n $permission = new GroupPermission();\n $permission->set('restrict access', 'invalid value');\n }",
"public function testSettingInvalidTs()\n {\n $this->expectException(\\InvalidArgumentException::class);\n $groupsMark = new GroupsMark();\n $groupsMark->setTs(null);\n }",
"public function testIsValidException()\n\t{\n\t\t$data = $this->getMock('Blackbox_Data', array());\n\t\t$data->expects($this->never())->method('__set');\n\t\t$data->expects($this->never())->method('__unset');\n\n\t\t$this->target->isValid($data, $this->state_data);\n\t}",
"public function testNonScalarValue()\n {\n $cfg = new Config();\n $this->setExpectedException(InvalidArgumentException::class);\n $cfg->set('newkey', new stdClass);\n }",
"public static function isInvalid($value)\n {\n }",
"public function setValid($value)\n {\n return $this->set(self::VALID, $value);\n }",
"public function testIsValidNoValue()\n {\n $this->assertTrue($this->uut->isValid());\n }",
"abstract protected function validateValue($value);",
"public function testCacheKeyInvalidTypeBoolean(): void\n {\n $value = '99 bottles of beer on the wall';\n $key = true;\n $this->expectException(\\TypeError::class);\n $this->testNotStrict->set($key, $value);\n }",
"public function testIfWrongValueThrows() : void\n {\n\n $this->expectException(FieldValueInproperException::class);\n\n // Create Field.\n $field = new EnumField('test_name');\n $field->setModel(( new Model() )->setName('test'));\n $field->setValues('one', 'two', 'three');\n\n // Test.\n $this->assertFalse($field->isValueValid('four'));\n }",
"private function validateValue($value)\n {\n if (is_null($value)) {\n throw new \\InvalidArgumentException(\"Value cannot be null\");\n }\n }",
"public function testMagicMethodSetThrowsException()\n {\n $this->expectException('InvalidArgumentException');\n\n $stub = new Grid($this->getContainer(), []);\n\n $stub->invalidProperty = ['foo'];\n }",
"abstract protected function isValidValue($value);",
"protected static function validateValue($value) {\n parent::validateValue($value);\n $key = static::getKey($value);\n if ($key === false) {\n throw new \\InvalidArgumentException('Invalid value');\n }\n }",
"function __set($key,$val){\n if($this->_set($key,$val)==TRUE) return $this->_ok();\n return $this->_err(array(2,$key));\n }",
"public function testValueValid() {\n $config = [\n 'success' => 1,\n 'data' => 'example'\n ];\n $this->assertEmpty($this->getValidator()->validate($config));\n }",
"public function testIsValidNoConstraints()\n {\n $this->assertTrue($this->uut->setValue(new ScalarValue('foo'))->isValid());\n }",
"abstract protected function checkValue( &$value );",
"public function testSetKeyPairInvalidArgumentKeyContainsAtmark(): void\n {\n $key = 'key@key';\n $value = 'Test Value';\n $this->expectException(\\InvalidArgumentException::class);\n $this->testNotStrict->set($key, $value);\n }",
"public function testFaultyProperties()\n {\n $international = new International();\n\n try {\n $international->setProduct(str_repeat('a', 10));\n $this->fail('BpostInvalidValueException not launched');\n } catch (BpostInvalidValueException $e) {\n // Nothing, the exception is good\n } catch (Exception $e) {\n $this->fail('BpostInvalidValueException not caught');\n }\n\n // Exceptions were caught,\n $this->assertTrue(true);\n }",
"public function testSetMaxLengthFailsWithStringValue() {\r\n\t\ttry {\r\n\t\t\t// first test negative number length is not allowed - should throw exception\r\n\t\t\t$this->testObject->setMaxLength ( 'abc' );\r\n\t\t} \r\n\r\n\t\tcatch ( Exception $expected ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t\r\n\t\t$this->fail ( 'an expected exception has not been raised.' );\r\n\t}",
"public function it_cannot_reject_empty_values_through_setter()\n {\n $object = new Testee(self::TEST_NULL_VALUE);\n $object->setValue('');\n $this->assertTrue($object->isEmpty());\n }",
"private static function setInvalidFlag($flag) {\n self::$_elements[self::$_inputElement]['inValid'] = $flag;\n }"
] |
[
"0.79281205",
"0.7043785",
"0.6871941",
"0.6676211",
"0.65778095",
"0.654286",
"0.6418724",
"0.6404766",
"0.63856095",
"0.63595635",
"0.62854904",
"0.6283781",
"0.62742513",
"0.6249829",
"0.62242323",
"0.62035245",
"0.61329883",
"0.6106675",
"0.6058078",
"0.60500604",
"0.60258055",
"0.59859073",
"0.59843427",
"0.59654087",
"0.59642977",
"0.595947",
"0.5950751",
"0.5947906",
"0.5930399",
"0.5928913"
] |
0.74581975
|
1
|
Test valid configuration parameters for the constructor.
|
public function testInvalidConfigurationForConstructor($config)
{
new AbstractConfigurationInstance($config);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function testConstructor()\n {\n $configuration = new GenerationConfiguration();\n\n $this->assertEquals(4, $configuration->getMinLength());\n $this->assertEquals(8, $configuration->getMaxLength());\n $this->assertEquals(true, $configuration->isLowercase());\n $this->assertEquals(true, $configuration->isUppercase());\n $this->assertEquals(true, $configuration->isDigits());\n $this->assertEquals(true, $configuration->isPunctuation());\n $this->assertEquals(false, $configuration->isBrackets());\n $this->assertEquals(false, $configuration->isSpace());\n $this->assertEquals(false, $configuration->isSpecialCharacters());\n $this->assertEquals(null, $configuration->getExtraCharacters());\n }",
"function __construct()\n {\n $arguments = func_num_args();\n\n if ($arguments != 1) {\n throw new InvalidConfigurationException(\"Invalid arguments. Use config array\");\n } else {\n $this->config = func_get_arg(0);\n\n if(!is_array($this->config))\n throw new InvalidConfigurationException(\"Invalid arguments. Use config array\");\n\n if(!array_key_exists('login', $this->config))\n throw new InvalidConfigurationException(\"Invalid arguments. The config array is missing the 'login' key\");\n\n if(!array_key_exists('password', $this->config))\n throw new InvalidConfigurationException(\"Invalid arguments. The config array is missing the 'password' key\");\n }\n }",
"public function testConstruct()\n {\n $configuration = new Configuration();\n $this->assertInstanceOf(\n 'Pagantis\\OrdersApiClient\\Model\\Order\\Configuration\\Channel',\n $configuration->getChannel()\n );\n $this->assertInstanceOf(\n 'Pagantis\\OrdersApiClient\\Model\\Order\\Configuration\\Urls',\n $configuration->getUrls()\n );\n }",
"public function setUp()\n {\n $this->config = array(\n 's1' => 'string',\n 's2' => 'str',\n 'i1' => 'integer',\n 'i2' => 'int',\n 'i3' => '+integer',\n 'i4' => '+int',\n 'i5' => '-integer',\n 'i6' => '-int',\n 'f1' => 'float',\n 'f2' => '+float',\n 'f3' => '-float',\n 'b' => 'boolean',\n 'a' => 'array',\n 'm' => array(true, 'false'),\n 'r' => '/^member/',\n );\n $this->helper = new ConfigValidator($this->config);\n }",
"public function testValidateConfiguration()\n\t{\n\t\t$method = $this->setAccessibleMethod('validateConfig');\n\n\t\t$results = $method->invoke($this->dbConfiguration->newInstance([\n\t\t\t'default' => 'default',\n\t\t\t'connections' => [\n\t\t\t\t'default' => [\n\t\t\t\t\t'hostname' => 'localhost',\n\t\t\t\t\t'driver' => 'mysql',\n\t\t\t\t\t'database' => 'database'\n\t\t\t\t]\n\t\t\t]\n\t\t]));\n\n\t\t$this->assertSame(null, $results);\n\t}",
"public function test_construct_withValidParameters()\n {\n $route = new Route('GET', '/home', 'test');\n $this->assertSame(\n 'test',\n $route->getTarget(),\n 'Target specified in constructor must be returned via getTarget() method.'\n );\n $this->assertSame(\n [],\n $route->getParams(),\n 'Route from an URI pattern without parameters must return an empty array via getParams() method.'\n );\n }",
"public function testConstruct() {\n $data = array(\n 'a' => 1,\n 'b' => array(\n 'c' => 2\n ),\n 'd' => new Config(array('e' => 4))\n );\n\n $config = new Config($data, array(\n 'readonly' => true\n ));\n\n $this->assertEquals(1, $config->a);\n $this->assertInstanceOf('Nimbles\\App\\Config', $config->b);\n $this->assertEquals(2, $config->b->c);\n $this->assertEquals(4, $config->d->e);\n\n $this->setExpectedException('Nimbles\\Core\\Collection\\Exception\\ReadOnly');\n $config->f = 'foo';\n }",
"public abstract function validateConfig($config);",
"function __construct() {\n if (getenv('VANTIV_DEVHUB_LICENSE')) {\n $config_array = [\n 'api_version' => 1,\n 'base_url' => 'https://apis.cert.vantiv.com',\n 'license' => getenv('VANTIV_DEVHUB_LICENSE')\n ];\n $this->config = new TestConfiguration($config_array);\n }\n else {\n $config = realpath(dirname(dirname(__FILE__))) . '/config.ini';\n if (file_exists($config)) {\n $config_array = parse_ini_file($config);\n $this->config = new TestConfiguration($config_array);\n }\n else {\n throw new \\Exception(\"Error: missing test config.ini. Please copy tests/example.config.ini to tests/config.ini and customize with your app's license.\");\n }\n }\n }",
"abstract public function __construct( $config );",
"public function it_rejects_invalid_options()\n {\n $this->beConstructedWith(self::CONFIG_INVALID_OPTION);\n $this->shouldThrow($this->invalidConfig)->duringInstantiation();\n }",
"public function testConstruct() {\n\n $obj = new SyntaxHighlighterConfig();\n\n $this->assertFalse($obj->getBloggerMode());\n $this->assertNull($obj->getStrings());\n $this->assertFalse($obj->getStripBrs());\n $this->assertEquals(\"pre\", $obj->getTagName());\n }",
"public function createObjectCanDoConstructorInjectionWithDifficultArguments() {\n\t\t$firstValue = \"Hir hier deser d'Sonn am, fu dem Ierd d'Liewen, ze schéinste Kirmesdag hannendrun déi.\";\n\t\t$secondValue = 'Oho ha halo\\' maksimume, \"io fari jeso naŭ plue\" om backslash (\\\\)nea komo triliono postpostmorgaŭ.';\n\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(1, $firstValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, $secondValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE)\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\t\t$this->assertEquals($firstValue, $object->argument1, 'The first value (string with quotes) has not been constructor-injected although it should have been.');\n\t\t$this->assertEquals($secondValue, $object->argument2, 'The second value (string with double quotes and backslashes) has not been constructor-injected although it should have been.');\n\t}",
"private function _checkConfig() {\n // Ftp configuration can be namespaced with the 'ftp' keyword\n if (isset($this->_config['ftp']))\n $this->_config = $this->_config['ftp'];\n\n // Check each configuration entry\n if (empty($this->_config) || !is_array($this->_config))\n throw new \\InvalidArgumentException(\"Configuration should be an array\");\n else if (empty($this->_config['host']))\n throw new \\InvalidArgumentException(\"Ftp server host not specified in configuration\");\n else if (empty($this->_config['port']))\n throw new \\InvalidArgumentException(\"Ftp server port not specified in configuration\");\n else if (empty($this->_config['user']))\n throw new \\InvalidArgumentException(\"Ftp user not specified in configuration\");\n else if (empty($this->_config['private_key']))\n throw new \\InvalidArgumentException(\"Ftp user ssh private key not specified in configuration\");\n else if (!is_readable($this->_baseDir.'/'.$this->_config['private_key']))\n throw new \\InvalidArgumentException(\"Ftp user ssh private key not found or not readable at: \".$this->_baseDir.'/'.$this->_config['private_key']);\n else if (empty($this->_config['public_key']))\n throw new \\InvalidArgumentException(\"Ftp user ssh public key not specified in configuration\");\n else if (!is_readable($this->_baseDir.'/'.$this->_config['public_key']))\n throw new \\InvalidArgumentException(\"Ftp user ssh public key not found or not readable at: \".$this->_baseDir.'/'.$this->_config['public_key']);\n }",
"function __construct() {\n\t\t$this->parameter_check=False;\n\t}",
"private function validateConfig()\n {\n // Throw error when username is missing from the config files.\n if (! config('mailcamp.username')) {\n throw new MailcampException('Mailcamp API error: No username is specified for connecting with Mailcamp.');\n }\n\n // Throw error when token is missing from the config files.\n if (! config('mailcamp.token')) {\n throw new MailcampException('Mailcamp API error: No token is specified for connecting with Mailcamp.');\n }\n\n // Throw error when endpoint is missing from the config files.\n if (! config('mailcamp.endpoint')) {\n throw new MailcampException('Mailcamp API error: No endpoint is specified for connecting with Mailcamp.');\n }\n\n // Set connection details.\n $this->config = new \\stdClass();\n $this->config->username = config('mailcamp.username');\n $this->config->token = config('mailcamp.token');\n $this->config->endpoint = config('mailcamp.endpoint');\n }",
"public function __construct() { \n require __DIR__ . '/Config/parameters.php'; //⚠️️ DIR = cste magiq qui retourne chemin du doss ds lequel on est depuis la racine\n $this -> parameters = $parameters; // je mets ça ds ' protected $parameters; '\n /*⚠️️ Au moment où j'instancie cette classe, je récupère le fichier parameters.php, \n et je stocke tous les parameters de mon application dans la propriété $parameters */\n }",
"public function checkConfig();",
"public function __construct($config)\n {\n // Throw exceptions on essentials\n $this->checkAndSetEssentials($config);\n\n // optionals\n $this->checkAndSetOverrides($config);\n }",
"public function __construct(array $config = array());",
"public function testConstructor()\n\t{\n\t\t$modes = [false,\n\t\t true];\n\t\t$types = [\n\t\t\tBuilder::TYPE_COMPANY,\n\t\t\tBuilder::TYPE_COMPANY,\n\t\t];\n\t\tforeach ($modes as $mode) {\n\t\t\tforeach ($types as $type) {\n\t\t\t\t$builder = new Builder($type, $mode);\n\t\t\t\t$this->assertEquals($type, $this->getProtectedMember($builder, 'recipient_type'));\n\t\t\t\t$this->assertEquals($mode, $this->getProtectedMember($builder, 'strict_mode'));\n\t\t\t}\n\t\t}\n\t}",
"public static function provideValidConfigurationForConstructor()\n {\n $conf = new stdClass();\n $conf->zadgcjmt = 'wntQeayy41';\n return [\n [$conf],\n [json_encode($conf)],\n [json_decode(json_encode($conf), true)]\n ];\n }",
"public function __construct()\n {\n if (11 == func_num_args()) {\n $this->valid = func_get_arg(0);\n $this->country = func_get_arg(1);\n $this->providerType = func_get_arg(2);\n $this->countryCode = func_get_arg(3);\n $this->hostname = func_get_arg(4);\n $this->providerDomain = func_get_arg(5);\n $this->city = func_get_arg(6);\n $this->providerWebsite = func_get_arg(7);\n $this->ip = func_get_arg(8);\n $this->region = func_get_arg(9);\n $this->providerDescription = func_get_arg(10);\n }\n }",
"public function __construct() {\n if (self::$siteKey === null || self::$siteKey === '' || self::$secretKey === null || self::$secretKey === '')\n die('siteKey or secretKey can not be empty .');\n\n if (self::$verifyUrl === null || self::$verifyUrl === '')\n die('verifyUrl can not be empty .');\n\n if (self::$apiUrl === null || self::$apiUrl === '')\n die('apiUrl can not be empty .');\n }",
"public function testConstructor()\n\t{\n\t\t$params = array('param' => 'value');\n\n\t\t$container = new Container($params);\n\n\t\t$this->assertSame($params['param'], $container['param']);\n\t}",
"public function __construct()\n {\n $this->setRequiredFields($this->_aDefaultRequiredFields);\n\n $aRequiredFields = oxRegistry::getConfig()->getConfigParam('aMustFillFields');\n if (is_array($aRequiredFields)) {\n $this->setRequiredFields($aRequiredFields);\n }\n }",
"public function __construct($config)\n {\n }",
"public function testConstructor()\n {\n $param = new PythoPhant_Reflection_FunctionParam('string', 'myVar', 'array()');\n $this->assertEquals('string', $param->getType());\n $this->assertEquals('myVar', $param->getName());\n $this->assertAttributeEquals('array()', 'default', $param);\n }",
"public function validateAndPrepare(){\n if (!isset($this->extras['copyconf-parameters'])) {\n throw new \\InvalidArgumentException('The parameter handler needs to be configured through the extra.copyconf-parameters setting.');\n }\n\n $this->configs = $this->extras['copyconf-parameters'];\n\n if (!is_array($this->configs)) {\n throw new \\InvalidArgumentException('The extra.copyconf-parameters setting must be an array or a configuration object.');\n }\n\n foreach (array('dist_ext', 'reg_exp', 'backup_mode', 'backup_dir') as $var){\n if (isset($this->configs[$var]) && !empty($this->configs[$var])){\n $this->$var = $this->configs[$var];\n }\n }\n }",
"public function createObjectCanDoConstructorInjectionWithNumericValues() {\n\t\t$secondValue = 99;\n\t\t$thirdValue = 3.14159265359;\n\t\t$objectConfiguration = new \\F3\\FLOW3\\Object\\Configuration\\Configuration('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments');\n\t\t$objectConfiguration->setArguments(array(\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(2, $secondValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t\tnew \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument(3, $thirdValue, \\F3\\FLOW3\\Object\\Configuration\\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE),\n\t\t));\n\n\t\t$object = $this->objectBuilder->createObject('F3\\FLOW3\\Tests\\Object\\Fixture\\ClassWithOptionalArguments', $objectConfiguration);\n\t\t$this->assertEquals($secondValue, $object->argument2, 'The second straight numeric value has not been constructor-injected although it should have been.');\n\t\t$this->assertEquals($thirdValue, $object->argument3, 'The third straight numeric value has not been constructor-injected although it should have been.');\n\t}"
] |
[
"0.75349885",
"0.7293292",
"0.71996367",
"0.6703363",
"0.66785157",
"0.6660085",
"0.6654025",
"0.656387",
"0.6559569",
"0.6548109",
"0.6412955",
"0.63954806",
"0.6332192",
"0.6328614",
"0.6327635",
"0.6313655",
"0.63116765",
"0.63032496",
"0.62949",
"0.6273584",
"0.6261028",
"0.6259207",
"0.6222943",
"0.6212183",
"0.62105983",
"0.61921054",
"0.6188888",
"0.6183356",
"0.61621106",
"0.61616755"
] |
0.740688
|
1
|
Data provider of ConfigTypeA configuration for jsonDecode().
|
public static function provideJsonDecodeConfigTypeA()
{
return [
[[ConfigTypeA::JSON_ASHOST => 'ItulITyML1'], '{"'.ConfigTypeA::JSON_ASHOST.'":"ItulITyML1"}'],
[[ConfigTypeA::JSON_SYSNR => '5345'], '{"'.ConfigTypeA::JSON_SYSNR.'":"5345"}'],
[[ConfigTypeA::JSON_GWHOST => '6sqPJLVVgS'], '{"'.ConfigTypeA::JSON_GWHOST.'":"6sqPJLVVgS"}'],
[[ConfigTypeA::JSON_GWSERV => 'pzkPI1ZV7f'], '{"'.ConfigTypeA::JSON_GWSERV.'":"pzkPI1ZV7f"}']
];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function provideJsonDecodeConfigTypeB()\n {\n return [\n [[ConfigTypeB::JSON_MSHOST => '4htV2O3BMH'], '{\"'.ConfigTypeB::JSON_MSHOST.'\":\"4htV2O3BMH\"}'],\n [[ConfigTypeB::JSON_R3NAME => 'XmJsmqU3ua'], '{\"'.ConfigTypeB::JSON_R3NAME.'\":\"XmJsmqU3ua\"}'],\n [[ConfigTypeB::JSON_GROUP => 'Tczw3KTagh'], '{\"'.ConfigTypeB::JSON_GROUP.'\":\"Tczw3KTagh\"}']\n ];\n }",
"public function testJsonDecodeConfigTypeA($array, $json)\n {\n $config = AbstractConfiguration::jsonDecode($json);\n static::assertInstanceOf(ConfigTypeA::class, $config);\n static::assertSame($array, $config->toArray());\n }",
"public static function jsonDecode($json)\n {\n $config = static::jsonToArray($json);\n if (array_key_exists(ConfigTypeA::JSON_ASHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_SYSNR, $config)\n || array_key_exists(ConfigTypeA::JSON_GWHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_GWSERV, $config)\n ) {\n return new ConfigTypeA($config);\n }\n if (array_key_exists(ConfigTypeB::JSON_MSHOST, $config)\n || array_key_exists(ConfigTypeB::JSON_R3NAME, $config)\n || array_key_exists(ConfigTypeB::JSON_GROUP, $config)\n ) {\n return new ConfigTypeB($config);\n }\n throw new InvalidArgumentException(\n 'Cannot automatically determine the configuration type from the'\n . ' given configuration keys!'\n );\n }",
"public function convertNestedToValuedConfigurationDataProvider() {}",
"public function loadConfig($data);",
"protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }",
"public function curlConfig(): GetDataFromApiClass;",
"public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"WafConfig\",$param) and $param[\"WafConfig\"] !== null) {\n $this->WafConfig = new WafConfig();\n $this->WafConfig->deserialize($param[\"WafConfig\"]);\n }\n\n if (array_key_exists(\"RateLimitConfig\",$param) and $param[\"RateLimitConfig\"] !== null) {\n $this->RateLimitConfig = new RateLimitConfig();\n $this->RateLimitConfig->deserialize($param[\"RateLimitConfig\"]);\n }\n\n if (array_key_exists(\"AclConfig\",$param) and $param[\"AclConfig\"] !== null) {\n $this->AclConfig = new AclConfig();\n $this->AclConfig->deserialize($param[\"AclConfig\"]);\n }\n\n if (array_key_exists(\"BotConfig\",$param) and $param[\"BotConfig\"] !== null) {\n $this->BotConfig = new BotConfig();\n $this->BotConfig->deserialize($param[\"BotConfig\"]);\n }\n\n if (array_key_exists(\"SwitchConfig\",$param) and $param[\"SwitchConfig\"] !== null) {\n $this->SwitchConfig = new SwitchConfig();\n $this->SwitchConfig->deserialize($param[\"SwitchConfig\"]);\n }\n\n if (array_key_exists(\"IpTableConfig\",$param) and $param[\"IpTableConfig\"] !== null) {\n $this->IpTableConfig = new IpTableConfig();\n $this->IpTableConfig->deserialize($param[\"IpTableConfig\"]);\n }\n\n if (array_key_exists(\"ExceptConfig\",$param) and $param[\"ExceptConfig\"] !== null) {\n $this->ExceptConfig = new ExceptConfig();\n $this->ExceptConfig->deserialize($param[\"ExceptConfig\"]);\n }\n\n if (array_key_exists(\"DropPageConfig\",$param) and $param[\"DropPageConfig\"] !== null) {\n $this->DropPageConfig = new DropPageConfig();\n $this->DropPageConfig->deserialize($param[\"DropPageConfig\"]);\n }\n\n if (array_key_exists(\"TemplateConfig\",$param) and $param[\"TemplateConfig\"] !== null) {\n $this->TemplateConfig = new TemplateConfig();\n $this->TemplateConfig->deserialize($param[\"TemplateConfig\"]);\n }\n\n if (array_key_exists(\"SlowPostConfig\",$param) and $param[\"SlowPostConfig\"] !== null) {\n $this->SlowPostConfig = new SlowPostConfig();\n $this->SlowPostConfig->deserialize($param[\"SlowPostConfig\"]);\n }\n }",
"public function convertValuedToNestedConfigurationDataProvider() {}",
"protected function _getApiTypeConfig($code)\n {\n $typeConfig = Mage::getConfig()->getNode(sprintf('klarna/api_types/%s', $code));\n if (!$typeConfig) {\n throw new Klarna_Kco_Model_Api_Exception(sprintf('API type \"%s\" does not exist!', $code));\n }\n\n $config = $typeConfig->asArray();\n unset($config['@']);\n\n $configObject = new Varien_Object($config);\n\n Mage::dispatchEvent(\n 'kco_load_api_config',\n array('options' => $configObject)\n );\n\n return $configObject;\n }",
"private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}",
"protected function _getJsonConfig($type)\n {\n $config = trim(Mage::getStoreConfig('markdown/' . $type . '/config'));\n if (empty($config)) {\n return false;\n }\n $decoded = json_decode($config);\n return $decoded instanceof stdClass ? rawurlencode($config) : false;\n }",
"public function decode($config, $array = false)\n {\n return json_decode($config, $array);\n }",
"public function getConfig()\n {\n return [\n 'payment' => [\n EWallet::CODE => [\n 'redirectUrl' => $this->helperData->getEWalletRedirectUrl(),\n 'subtypes' => [\n [\n 'name' => 'pagseguro',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/pagseguro-logo.png')\n ],\n [\n 'name' => 'paypal',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/paypal-logo.png')\n ],\n ]\n ]\n ]\n ];\n }",
"abstract protected function getConfig();",
"public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }",
"public function getConfig()\n {\n\n $this->config = new ClassMarshaller();\n $this->config->serialization = new Serialization\\ClassSerialization();\n $this->config->deserialization = new Deserialization\\ClassDeserialization();\n\n /**\n * @var \\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonInclude $includer\n */\n $includer = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonInclude');\n $this->config->serialization->include = $this->_getIncluderValue($includer);\n\n /**\n * Work out what the class' \"name\" is, just in case inheritence is needed.\n * @var \\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonTypeName $typeNamer\n */\n $typeNamer = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonTypeName');\n $name = null;\n if (isset($typeNamer)) {\n $name = $typeNamer->getName();\n }\n if (empty($name)) {\n // Default to the unqualified class name\n $name = $this->rClass->getName();\n }\n $this->config->deserialization->name = $name;\n\n /**\n * @var Annotations\\JsonTypeInfo $typeInfo\n * @var Annotations\\JsonSubTypes $subTypes\n */\n $typeInfo = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonTypeInfo');\n $subTypes = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonSubTypes');\n $this->config->deserialization->typeInfo = $this->_getDeserializationTypeInfo($typeInfo, $subTypes);\n $this->config->serialization->typeInfo = $this->_getSerializationTypeInfo($typeInfo, $subTypes);\n\n $methods = $this->rClass->getMethods(\\ReflectionMethod::IS_PUBLIC);\n\n foreach ($methods as $method) {\n $this->_configureMethod($method);\n }\n\n $properties = $this->rClass->getProperties(\\ReflectionProperty::IS_PUBLIC & ~\\ReflectionProperty::IS_STATIC);\n foreach ($properties as $property) {\n $this->_configureProperty($property);\n }\n\n /**\n * @var \\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonIgnoreProperties|null $ignorer\n */\n $ignorer = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonIgnoreProperties');\n if (!empty($ignorer)) {\n // The ignorer config affects which properties we will consider.\n $this->config->deserialization->ignoreUnknown = $ignorer->getIgnoreUnknown();\n $this->config->deserialization->ignoreProperties = $ignorer->getNames();\n }\n\n\n return $this->config;\n\n }",
"abstract public function getConfig();",
"public function getConfigService();",
"private function initConfig()\n {\n return $this->config = [\n 'api' => 'https://api.gfycat.com/v1',\n ];\n }",
"function jsonSerialize()\n {\n $data = $this->data;\n foreach ($this->config as $name => $c) {\n if (is_callable($c['serializer'])) {\n $data[$name] = call_user_func($c['serializer'], $data['name']);\n }\n }\n return $data;\n }",
"static public function config_data($provider = null) {\n $impl = self::instance();\n return $impl->get_resource('config data', $provider);\n }",
"public function loadConfig() {\n return (object)$this->config;\n }",
"function __construct() {\n\tparent::__construct();\n\t$this->config = json_decode(file_get_contents(CONFIG_DIR . \"controllers/playlist.config.json\"), false);\n }",
"function getConfigObj(){\n $fh = fopen($GLOBALS['configFileName'],'r')\n\t\t\tor die(\"Unable to open file!\");\n\n $configJson = fread($fh, filesize($GLOBALS['configFileName']));\n fclose($fh);\n // print($configJson);\n // $configObj = json_decode($configJson);\n // var_dump($configObj); //->{'devices'}[0]->{'name'};\n return json_decode($configJson);\n }",
"public function _initConfig() {\r\n $this->config = Yaf\\Application::app()->getConfig();\r\n Yaf\\Registry::set(\"config\", $this->config);\r\n\r\n //申明, 凡是以Foo和Local开头的类, 都是本地类\r\n $this->loader = Yaf\\Loader::getInstance();\r\n $this->loader->registerLocalNamespace([\"fly\"]);\r\n }",
"private function getGiftOptionsConfigJson()\n {\n return $this->configProvider->getConfig();\n }",
"public function testJsonDecodeConfigTypeB($array, $json)\n {\n $config = AbstractConfiguration::jsonDecode($json);\n static::assertInstanceOf(ConfigTypeB::class, $config);\n static::assertSame($array, $config->toArray());\n }",
"abstract protected function loadConfig();",
"function get_settings_config_data() {\n $config = $this->config;//get instance config\n\n //if config doesn't exist - create it\n if (!isset($config)) {\n $config = new stdClass();\n }\n\n //if data doesn't exist = make it an empty array\n if (!isset($config->data))\n $config->data = array();\n\n //return config\n return $config;\n }"
] |
[
"0.6211345",
"0.59510255",
"0.57608414",
"0.57460463",
"0.5730279",
"0.57141906",
"0.5609703",
"0.5574615",
"0.5561733",
"0.5522167",
"0.54687077",
"0.54447937",
"0.54251397",
"0.5312214",
"0.52961165",
"0.5278268",
"0.5276254",
"0.5262003",
"0.52612954",
"0.5246548",
"0.523452",
"0.52046144",
"0.5194926",
"0.5169559",
"0.516605",
"0.5160868",
"0.5147162",
"0.5142379",
"0.51383257",
"0.5137002"
] |
0.7564685
|
0
|
Test jsonDecode() for configuration type A.
|
public function testJsonDecodeConfigTypeA($array, $json)
{
$config = AbstractConfiguration::jsonDecode($json);
static::assertInstanceOf(ConfigTypeA::class, $config);
static::assertSame($array, $config->toArray());
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function provideJsonDecodeConfigTypeA()\n {\n return [\n [[ConfigTypeA::JSON_ASHOST => 'ItulITyML1'], '{\"'.ConfigTypeA::JSON_ASHOST.'\":\"ItulITyML1\"}'],\n [[ConfigTypeA::JSON_SYSNR => '5345'], '{\"'.ConfigTypeA::JSON_SYSNR.'\":\"5345\"}'],\n [[ConfigTypeA::JSON_GWHOST => '6sqPJLVVgS'], '{\"'.ConfigTypeA::JSON_GWHOST.'\":\"6sqPJLVVgS\"}'],\n [[ConfigTypeA::JSON_GWSERV => 'pzkPI1ZV7f'], '{\"'.ConfigTypeA::JSON_GWSERV.'\":\"pzkPI1ZV7f\"}']\n ];\n }",
"public function testJsonDecodeConfigTypeB($array, $json)\n {\n $config = AbstractConfiguration::jsonDecode($json);\n static::assertInstanceOf(ConfigTypeB::class, $config);\n static::assertSame($array, $config->toArray());\n }",
"public static function jsonDecode($json)\n {\n $config = static::jsonToArray($json);\n if (array_key_exists(ConfigTypeA::JSON_ASHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_SYSNR, $config)\n || array_key_exists(ConfigTypeA::JSON_GWHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_GWSERV, $config)\n ) {\n return new ConfigTypeA($config);\n }\n if (array_key_exists(ConfigTypeB::JSON_MSHOST, $config)\n || array_key_exists(ConfigTypeB::JSON_R3NAME, $config)\n || array_key_exists(ConfigTypeB::JSON_GROUP, $config)\n ) {\n return new ConfigTypeB($config);\n }\n throw new InvalidArgumentException(\n 'Cannot automatically determine the configuration type from the'\n . ' given configuration keys!'\n );\n }",
"public static function _json_decode($a) { \n if (TRUE !== function_exists('json_decode')) {\n\t\t$m = array();\n\t\tpreg_match_all('#\"(.*?)\"#si', $a, $m);\n\t\treturn (isset($m[1]) && sizeof($m[1])>0) ? $m[1] : FALSE;\n\t} else {\n\t\treturn json_decode($a);\t\n\t}\t\n }",
"public function testDecode()\n {\n $json = $this->_newJson();\n \n $before = '{ \"test\": { \"foo\": \"bar\" } }';\n \n $actual = var_export($json->decode($before), 1);\n \n $expect = \"stdClass::__set_state(array(\\n\"\n . \" 'test' => \\n\"\n . \" stdClass::__set_state(array(\\n\"\n . \" 'foo' => 'bar',\\n\"\n . \" )),\\n\"\n . \"))\";\n \n $this->assertSame($actual, $expect);\n }",
"public function testNonSpecificJson($json)\n {\n AbstractConfiguration::jsonDecode($json);\n }",
"public static function provideJsonDecodeConfigTypeB()\n {\n return [\n [[ConfigTypeB::JSON_MSHOST => '4htV2O3BMH'], '{\"'.ConfigTypeB::JSON_MSHOST.'\":\"4htV2O3BMH\"}'],\n [[ConfigTypeB::JSON_R3NAME => 'XmJsmqU3ua'], '{\"'.ConfigTypeB::JSON_R3NAME.'\":\"XmJsmqU3ua\"}'],\n [[ConfigTypeB::JSON_GROUP => 'Tczw3KTagh'], '{\"'.ConfigTypeB::JSON_GROUP.'\":\"Tczw3KTagh\"}']\n ];\n }",
"public function test_parser_factory()\n {\n $json = ParserFactory::getParser('json');\n \n $this->assertEquals(\n [\n \"a\" => 1,\n \"b\" => 2,\n \"c\" => 3,\n \"d\" => 4,\n \"e\" => 5,\n ], \n $json->decode('{\"a\":1,\"b\":2,\"c\":3,\"d\":4,\"e\":5}')\n );\n }",
"function testDecodeWithSyntaxError() {\n\t\t$this->setExpectedException('JSON_SyntaxError');\n\t\tJSON_Processor::decode('{\"bar\":\"baz\"');\n }",
"public function decode($json);",
"public function it_works_with_json_configuration()\n {\n $this->test_process('json');\n }",
"public function decode($config, $array = false)\n {\n return json_decode($config, $array);\n }",
"public function testJSON()\n {\n $parser = new JSONParser();\n\n $this->assertInstanceOf(Parser::class, $parser);\n }",
"function decode($x) {\n return NULL === ($obj = json_decode($x, FALSE)) ? $this->error('Parse error.', -32700) : $obj;\n }",
"public function deserialize($json);",
"public function testJson()\n {\n $jsonGrammar = $this->grammar->parse($this->json_parser);\n\n $result = $jsonGrammar->parse(\" { \\\"string\\\" : true, \\\"\\\\\\\"\\\" : false, \\\"\\\\u9874asdh\\\" : [ null, { }, -9488.44E+093 ] } \");\n }",
"private function decode($json, $asArray = true)\n {\n return json_decode((string) $json, $asArray);\n }",
"public function testIsJson(): void\n {\n $this->processSimpleTests('isJson', static::$tests);\n }",
"protected function _json_decode($str, $asArray = false)\n {\n $str = $this->_reduce_string($str);\n \n switch (strtolower($str)) {\n case 'true':\n // JSON_checker test suite claims\n // \"A JSON payload should be an object or array, not a string.\"\n // Thus, returning bool(true) is invalid parsing, unless\n // we're nested inside an array or object.\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return true;\n } else {\n return null;\n }\n break;\n \n case 'false':\n // JSON_checker test suite claims\n // \"A JSON payload should be an object or array, not a string.\"\n // Thus, returning bool(false) is invalid parsing, unless\n // we're nested inside an array or object.\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return false;\n } else {\n return null;\n }\n break;\n \n case 'null':\n return null;\n \n default:\n $m = array();\n \n if (is_numeric($str) || ctype_digit($str) || ctype_xdigit($str)) {\n // Return float or int, or null as appropriate\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return ((float) $str == (integer) $str)\n ? (integer) $str\n : (float) $str;\n } else {\n return null;\n }\n break;\n \n } elseif (preg_match('/^(\"|\\').*(\\1)$/s', $str, $m)\n && $m[1] == $m[2]) {\n // STRINGS RETURNED IN UTF-8 FORMAT\n $delim = substr($str, 0, 1);\n $chrs = substr($str, 1, -1);\n $utf8 = '';\n $strlen_chrs = strlen($chrs);\n \n for ($c = 0; $c < $strlen_chrs; ++$c) {\n \n $substr_chrs_c_2 = substr($chrs, $c, 2);\n $ord_chrs_c = ord($chrs{$c});\n \n switch (true) {\n case $substr_chrs_c_2 == '\\b':\n $utf8 .= chr(0x08);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\t':\n $utf8 .= chr(0x09);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\n':\n $utf8 .= chr(0x0A);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\f':\n $utf8 .= chr(0x0C);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\r':\n $utf8 .= chr(0x0D);\n ++$c;\n break;\n \n case $substr_chrs_c_2 == '\\\\\"':\n case $substr_chrs_c_2 == '\\\\\\'':\n case $substr_chrs_c_2 == '\\\\\\\\':\n case $substr_chrs_c_2 == '\\\\/':\n if (($delim == '\"' && $substr_chrs_c_2 != '\\\\\\'') ||\n ($delim == \"'\" && $substr_chrs_c_2 != '\\\\\"')) {\n $utf8 .= $chrs{++$c};\n }\n break;\n \n case preg_match('/\\\\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):\n // single, escaped unicode character\n $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))\n . chr(hexdec(substr($chrs, ($c + 4), 2)));\n $utf8 .= $this->_utf162utf8($utf16);\n $c += 5;\n break;\n \n case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):\n $utf8 .= $chrs{$c};\n break;\n \n case ($ord_chrs_c & 0xE0) == 0xC0:\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 2);\n ++$c;\n break;\n \n case ($ord_chrs_c & 0xF0) == 0xE0:\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 3);\n $c += 2;\n break;\n \n case ($ord_chrs_c & 0xF8) == 0xF0:\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 4);\n $c += 3;\n break;\n \n case ($ord_chrs_c & 0xFC) == 0xF8:\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 5);\n $c += 4;\n break;\n \n case ($ord_chrs_c & 0xFE) == 0xFC:\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 6);\n $c += 5;\n break;\n \n }\n \n }\n \n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return $utf8;\n } else {\n return null;\n }\n \n } elseif (preg_match('/^\\[.*\\]$/s', $str) || preg_match('/^\\{.*\\}$/s', $str)) {\n // array, or object notation\n \n if ($str{0} == '[') {\n $stk = array(self::IN_ARR);\n $this->_level = self::IN_ARR;\n $arr = array();\n } else {\n if ($asArray) {\n $stk = array(self::IN_OBJ);\n $obj = array();\n } else {\n $stk = array(self::IN_OBJ);\n $obj = new stdClass();\n }\n $this->_level = self::IN_OBJ;\n }\n \n array_push($stk, array('what' => self::SLICE,\n 'where' => 0,\n 'delim' => false));\n \n $chrs = substr($str, 1, -1);\n $chrs = $this->_reduce_string($chrs);\n \n if ($chrs == '') {\n if (reset($stk) == self::IN_ARR) {\n return $arr;\n \n } else {\n return $obj;\n \n }\n }\n \n $strlen_chrs = strlen($chrs);\n \n for ($c = 0; $c <= $strlen_chrs; ++$c) {\n \n $top = end($stk);\n $substr_chrs_c_2 = substr($chrs, $c, 2);\n \n if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == self::SLICE))) {\n // found a comma that is not inside a string, array, etc.,\n // OR we've reached the end of the character list\n $slice = substr($chrs, $top['where'], ($c - $top['where']));\n array_push($stk, array('what' => self::SLICE, 'where' => ($c + 1), 'delim' => false));\n //print(\"Found split at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n if (reset($stk) == self::IN_ARR) {\n $this->_level = self::IN_ARR;\n // we are in an array, so just push an element onto the stack\n array_push($arr, $this->_json_decode($slice));\n \n } elseif (reset($stk) == self::IN_OBJ) {\n $this->_level = self::IN_OBJ;\n // we are in an object, so figure\n // out the property name and set an\n // element in an associative array,\n // for now\n $parts = array();\n \n if (preg_match('/^\\s*([\"\\'].*[^\\\\\\][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"name\":value pair\n $key = $this->_json_decode($parts[1]);\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*(\\w+)\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // name:value pair, where name is unquoted\n $key = $parts[1];\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*([\"\\'][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"\":value pair\n //$key = $this->_json_decode($parts[1]);\n // use string that matches ext/json\n $key = '_empty_';\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n }\n \n }\n \n } elseif ((($chrs{$c} == '\"') || ($chrs{$c} == \"'\")) && ($top['what'] != self::IN_STR)) {\n // found a quote, and we are not inside a string\n array_push($stk, array('what' => self::IN_STR, 'where' => $c, 'delim' => $chrs{$c}));\n //print(\"Found start of string at {$c}\\n\");\n \n } elseif (($chrs{$c} == $top['delim']) &&\n ($top['what'] == self::IN_STR) &&\n ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\\\'))) % 2 != 1)) {\n // found a quote, we're in a string, and it's not escaped\n // we know that it's not escaped becase there is _not_ an\n // odd number of backslashes at the end of the string so far\n array_pop($stk);\n //print(\"Found end of string at {$c}: \".substr($chrs, $top['where'], (1 + 1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($chrs{$c} == '[') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a left-bracket, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_ARR, 'where' => $c, 'delim' => false));\n //print(\"Found start of array at {$c}\\n\");\n \n } elseif (($chrs{$c} == ']') && ($top['what'] == self::IN_ARR)) {\n // found a right-bracket, and we're in an array\n $this->_level = null;\n array_pop($stk);\n //print(\"Found end of array at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($chrs{$c} == '{') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a left-brace, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_OBJ, 'where' => $c, 'delim' => false));\n //print(\"Found start of object at {$c}\\n\");\n \n } elseif (($chrs{$c} == '}') && ($top['what'] == self::IN_OBJ)) {\n // found a right-brace, and we're in an object\n $this->_level = null;\n array_pop($stk);\n //print(\"Found end of object at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($substr_chrs_c_2 == '/*') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a comment start, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_CMT, 'where' => $c, 'delim' => false));\n $c++;\n //print(\"Found start of comment at {$c}\\n\");\n \n } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == self::IN_CMT)) {\n // found a comment end, and we're in one now\n array_pop($stk);\n $c++;\n \n for ($i = $top['where']; $i <= $c; ++$i)\n $chrs = substr_replace($chrs, ' ', $i, 1);\n \n //print(\"Found end of comment at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n }\n \n }\n \n if (reset($stk) == self::IN_ARR) {\n return $arr;\n \n } elseif (reset($stk) == self::IN_OBJ) {\n return $obj;\n \n }\n \n }\n }\n }",
"function json_decode($data, $output_as_array) {\n\t\t\t$json_mode = $output_as_array ? SERVICES_JSON_LOOSE_TYPE : null;\n\t\t\t$json = new Services_JSON($json_mode);\n\t\t\treturn($json->decode($data));\n\t\t}",
"public function decode($encodedValue, $asArray = false)\n {\n $first_char = substr(ltrim($encodedValue), 0, 1);\n if ($first_char != '{' && $first_char != '[') {\n return null;\n }\n \n if (!$this->_config['bypass_ext'] && function_exists('json_decode')) {\n return json_decode($encodedValue, (bool) $asArray);\n }\n \n // Fall back to PHP-only method\n $this->_level = 0;\n $checker = Solar::factory('Solar_Json_Checker');\n if ($checker->isValid($encodedValue)) {\n return $this->_json_decode($encodedValue, (bool) $asArray);\n } else {\n return null;\n }\n }",
"public function testSerializationDeserialization()\n {\n $obj = new LookupDataEntry(self::getJson());\n $this->assertNotNull($obj);\n $this->assertNotNull($obj->getKey());\n $this->assertNotNull($obj->getValue());\n $this->assertEquals(self::getJson(), $obj->toJson());\n return $obj;\n }",
"protected function decode($value) {\n\t\tif (defined('JSON_PARSER_NOTSTRICT')) {\n\t\t\treturn json_decode($value, false, 512, JSON_PARSER_NOTSTRICT);\n\t\t}\n\t\treturn json_decode($value);\n\t}",
"public static function DecodeJson (& $jsonStr);",
"public function decode($data) {}",
"public function decode($data) {}",
"public function decode($data) {}",
"public function decode($data) {}",
"public function decode($data) {}",
"public static function maybe_decode_json( $value ) {\n\t\tif ( self::is_json( $value ) ) {\n\t\t\treturn json_decode( $value, ARRAY_A );\n\t\t}\n\n\t\treturn $value;\n\t}"
] |
[
"0.7098414",
"0.7013134",
"0.65999025",
"0.64418674",
"0.63207453",
"0.6243967",
"0.59370196",
"0.5880755",
"0.58506066",
"0.5845046",
"0.5837098",
"0.5687643",
"0.5659686",
"0.5568346",
"0.5469558",
"0.5429082",
"0.5401638",
"0.53582543",
"0.5305189",
"0.52824074",
"0.52606034",
"0.52358365",
"0.5175763",
"0.5148849",
"0.5139325",
"0.5139325",
"0.5139325",
"0.5139325",
"0.5139325",
"0.51375455"
] |
0.7812988
|
0
|
Data provider of ConfigTypeB configuration for jsonDecode().
|
public static function provideJsonDecodeConfigTypeB()
{
return [
[[ConfigTypeB::JSON_MSHOST => '4htV2O3BMH'], '{"'.ConfigTypeB::JSON_MSHOST.'":"4htV2O3BMH"}'],
[[ConfigTypeB::JSON_R3NAME => 'XmJsmqU3ua'], '{"'.ConfigTypeB::JSON_R3NAME.'":"XmJsmqU3ua"}'],
[[ConfigTypeB::JSON_GROUP => 'Tczw3KTagh'], '{"'.ConfigTypeB::JSON_GROUP.'":"Tczw3KTagh"}']
];
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function provideJsonDecodeConfigTypeA()\n {\n return [\n [[ConfigTypeA::JSON_ASHOST => 'ItulITyML1'], '{\"'.ConfigTypeA::JSON_ASHOST.'\":\"ItulITyML1\"}'],\n [[ConfigTypeA::JSON_SYSNR => '5345'], '{\"'.ConfigTypeA::JSON_SYSNR.'\":\"5345\"}'],\n [[ConfigTypeA::JSON_GWHOST => '6sqPJLVVgS'], '{\"'.ConfigTypeA::JSON_GWHOST.'\":\"6sqPJLVVgS\"}'],\n [[ConfigTypeA::JSON_GWSERV => 'pzkPI1ZV7f'], '{\"'.ConfigTypeA::JSON_GWSERV.'\":\"pzkPI1ZV7f\"}']\n ];\n }",
"public function testJsonDecodeConfigTypeB($array, $json)\n {\n $config = AbstractConfiguration::jsonDecode($json);\n static::assertInstanceOf(ConfigTypeB::class, $config);\n static::assertSame($array, $config->toArray());\n }",
"public static function jsonDecode($json)\n {\n $config = static::jsonToArray($json);\n if (array_key_exists(ConfigTypeA::JSON_ASHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_SYSNR, $config)\n || array_key_exists(ConfigTypeA::JSON_GWHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_GWSERV, $config)\n ) {\n return new ConfigTypeA($config);\n }\n if (array_key_exists(ConfigTypeB::JSON_MSHOST, $config)\n || array_key_exists(ConfigTypeB::JSON_R3NAME, $config)\n || array_key_exists(ConfigTypeB::JSON_GROUP, $config)\n ) {\n return new ConfigTypeB($config);\n }\n throw new InvalidArgumentException(\n 'Cannot automatically determine the configuration type from the'\n . ' given configuration keys!'\n );\n }",
"protected function loadConfig() : \\codename\\core\\config {\r\n return new \\codename\\core\\config\\json('config/model/' . $this->schema . '_' . $this->table . '.json', true, true);\r\n }",
"public function convertNestedToValuedConfigurationDataProvider() {}",
"public function decode($config, $array = false)\n {\n return json_decode($config, $array);\n }",
"public function deserialize($param)\n {\n if ($param === null) {\n return;\n }\n if (array_key_exists(\"WafConfig\",$param) and $param[\"WafConfig\"] !== null) {\n $this->WafConfig = new WafConfig();\n $this->WafConfig->deserialize($param[\"WafConfig\"]);\n }\n\n if (array_key_exists(\"RateLimitConfig\",$param) and $param[\"RateLimitConfig\"] !== null) {\n $this->RateLimitConfig = new RateLimitConfig();\n $this->RateLimitConfig->deserialize($param[\"RateLimitConfig\"]);\n }\n\n if (array_key_exists(\"AclConfig\",$param) and $param[\"AclConfig\"] !== null) {\n $this->AclConfig = new AclConfig();\n $this->AclConfig->deserialize($param[\"AclConfig\"]);\n }\n\n if (array_key_exists(\"BotConfig\",$param) and $param[\"BotConfig\"] !== null) {\n $this->BotConfig = new BotConfig();\n $this->BotConfig->deserialize($param[\"BotConfig\"]);\n }\n\n if (array_key_exists(\"SwitchConfig\",$param) and $param[\"SwitchConfig\"] !== null) {\n $this->SwitchConfig = new SwitchConfig();\n $this->SwitchConfig->deserialize($param[\"SwitchConfig\"]);\n }\n\n if (array_key_exists(\"IpTableConfig\",$param) and $param[\"IpTableConfig\"] !== null) {\n $this->IpTableConfig = new IpTableConfig();\n $this->IpTableConfig->deserialize($param[\"IpTableConfig\"]);\n }\n\n if (array_key_exists(\"ExceptConfig\",$param) and $param[\"ExceptConfig\"] !== null) {\n $this->ExceptConfig = new ExceptConfig();\n $this->ExceptConfig->deserialize($param[\"ExceptConfig\"]);\n }\n\n if (array_key_exists(\"DropPageConfig\",$param) and $param[\"DropPageConfig\"] !== null) {\n $this->DropPageConfig = new DropPageConfig();\n $this->DropPageConfig->deserialize($param[\"DropPageConfig\"]);\n }\n\n if (array_key_exists(\"TemplateConfig\",$param) and $param[\"TemplateConfig\"] !== null) {\n $this->TemplateConfig = new TemplateConfig();\n $this->TemplateConfig->deserialize($param[\"TemplateConfig\"]);\n }\n\n if (array_key_exists(\"SlowPostConfig\",$param) and $param[\"SlowPostConfig\"] !== null) {\n $this->SlowPostConfig = new SlowPostConfig();\n $this->SlowPostConfig->deserialize($param[\"SlowPostConfig\"]);\n }\n }",
"public function convertValuedToNestedConfigurationDataProvider() {}",
"private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}",
"public function getConfig()\n {\n\n $this->config = new ClassMarshaller();\n $this->config->serialization = new Serialization\\ClassSerialization();\n $this->config->deserialization = new Deserialization\\ClassDeserialization();\n\n /**\n * @var \\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonInclude $includer\n */\n $includer = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonInclude');\n $this->config->serialization->include = $this->_getIncluderValue($includer);\n\n /**\n * Work out what the class' \"name\" is, just in case inheritence is needed.\n * @var \\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonTypeName $typeNamer\n */\n $typeNamer = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonTypeName');\n $name = null;\n if (isset($typeNamer)) {\n $name = $typeNamer->getName();\n }\n if (empty($name)) {\n // Default to the unqualified class name\n $name = $this->rClass->getName();\n }\n $this->config->deserialization->name = $name;\n\n /**\n * @var Annotations\\JsonTypeInfo $typeInfo\n * @var Annotations\\JsonSubTypes $subTypes\n */\n $typeInfo = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonTypeInfo');\n $subTypes = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonSubTypes');\n $this->config->deserialization->typeInfo = $this->_getDeserializationTypeInfo($typeInfo, $subTypes);\n $this->config->serialization->typeInfo = $this->_getSerializationTypeInfo($typeInfo, $subTypes);\n\n $methods = $this->rClass->getMethods(\\ReflectionMethod::IS_PUBLIC);\n\n foreach ($methods as $method) {\n $this->_configureMethod($method);\n }\n\n $properties = $this->rClass->getProperties(\\ReflectionProperty::IS_PUBLIC & ~\\ReflectionProperty::IS_STATIC);\n foreach ($properties as $property) {\n $this->_configureProperty($property);\n }\n\n /**\n * @var \\Weasel\\JsonMarshaller\\Config\\Annotations\\JsonIgnoreProperties|null $ignorer\n */\n $ignorer = $this->annotationReader->getSingleClassAnnotation(self::_ANS . 'JsonIgnoreProperties');\n if (!empty($ignorer)) {\n // The ignorer config affects which properties we will consider.\n $this->config->deserialization->ignoreUnknown = $ignorer->getIgnoreUnknown();\n $this->config->deserialization->ignoreProperties = $ignorer->getNames();\n }\n\n\n return $this->config;\n\n }",
"public function loadConfig($data);",
"public function curlConfig(): GetDataFromApiClass;",
"public function getConfig()\n {\n return [\n 'payment' => [\n EWallet::CODE => [\n 'redirectUrl' => $this->helperData->getEWalletRedirectUrl(),\n 'subtypes' => [\n [\n 'name' => 'pagseguro',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/pagseguro-logo.png')\n ],\n [\n 'name' => 'paypal',\n 'image' => $this->assetRepository->getUrl('Uol_BoaCompra::images/paypal-logo.png')\n ],\n ]\n ]\n ]\n ];\n }",
"public function getConfiguration()\n {\n $configuration = parent::getConfiguration();\n $configuration['debug'] = isset($configuration['debug']) ? $configuration['debug'] : false;\n $configuration['fileUri'] = $this->container->getParameter(\"mapbender.uploads_dir\") . \"/data-store\";\n\n if (isset($configuration[\"schemes\"]) && is_array($configuration[\"schemes\"])) {\n foreach ($configuration[\"schemes\"] as $key => &$scheme) {\n if (is_string($scheme['dataStore'])) {\n $storeId = $scheme['dataStore'];\n $dataStore = $this->container->getParameter('dataStores');\n $scheme['dataStore'] = $dataStore[ $storeId ];\n $scheme['dataStore'][\"id\"] = $storeId;\n //$dataStore = new DataStore($this->container, $configuration['source']);\n }\n if (isset($scheme['formItems'])) {\n $scheme['formItems'] = $this->prepareItems($scheme['formItems']);\n }\n }\n }\n return $configuration;\n }",
"public function testJsonDecodeConfigTypeA($array, $json)\n {\n $config = AbstractConfiguration::jsonDecode($json);\n static::assertInstanceOf(ConfigTypeA::class, $config);\n static::assertSame($array, $config->toArray());\n }",
"abstract protected function getConfig();",
"abstract public function getConfig();",
"protected function _getJsonConfig($type)\n {\n $config = trim(Mage::getStoreConfig('markdown/' . $type . '/config'));\n if (empty($config)) {\n return false;\n }\n $decoded = json_decode($config);\n return $decoded instanceof stdClass ? rawurlencode($config) : false;\n }",
"public function loadConfig() {\n return (object)$this->config;\n }",
"private function initConfig()\n {\n return $this->config = [\n 'api' => 'https://api.gfycat.com/v1',\n ];\n }",
"private function getGiftOptionsConfigJson()\n {\n return $this->configProvider->getConfig();\n }",
"public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}",
"function getConfigObj(){\n $fh = fopen($GLOBALS['configFileName'],'r')\n\t\t\tor die(\"Unable to open file!\");\n\n $configJson = fread($fh, filesize($GLOBALS['configFileName']));\n fclose($fh);\n // print($configJson);\n // $configObj = json_decode($configJson);\n // var_dump($configObj); //->{'devices'}[0]->{'name'};\n return json_decode($configJson);\n }",
"protected function getPlateformeConfig()\r\n {\r\n return $this->config;\r\n }",
"protected function _postConstruct()\n {\n $this->_adapters = (array) $this->_config['adapters'];\n }",
"abstract protected function loadConfig();",
"protected function _getApiTypeConfig($code)\n {\n $typeConfig = Mage::getConfig()->getNode(sprintf('klarna/api_types/%s', $code));\n if (!$typeConfig) {\n throw new Klarna_Kco_Model_Api_Exception(sprintf('API type \"%s\" does not exist!', $code));\n }\n\n $config = $typeConfig->asArray();\n unset($config['@']);\n\n $configObject = new Varien_Object($config);\n\n Mage::dispatchEvent(\n 'kco_load_api_config',\n array('options' => $configObject)\n );\n\n return $configObject;\n }",
"function jsonSerialize()\n {\n $data = $this->data;\n foreach ($this->config as $name => $c) {\n if (is_callable($c['serializer'])) {\n $data[$name] = call_user_func($c['serializer'], $data['name']);\n }\n }\n return $data;\n }",
"public function getConfig() {}",
"protected function getConfigService()\n {\n return $this->services['config'] = new \\phpbb\\config\\db(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['cache.driver']) ? $this->services['cache.driver'] : ($this->services['cache.driver'] = new \\phpbb\\cache\\driver\\file())) && false ?: '_'}, 'phpbb_config');\n }"
] |
[
"0.700561",
"0.61816907",
"0.61342406",
"0.6119167",
"0.58669263",
"0.5859454",
"0.5794197",
"0.5656938",
"0.56465954",
"0.56271636",
"0.5615811",
"0.5600631",
"0.55964565",
"0.5532361",
"0.54648674",
"0.54581505",
"0.5412989",
"0.5404486",
"0.54007584",
"0.5400697",
"0.5389647",
"0.53759336",
"0.53486896",
"0.53362536",
"0.533621",
"0.5324622",
"0.530973",
"0.52507114",
"0.52438504",
"0.52386403"
] |
0.75461996
|
0
|
Test jsonDecode() for configuration type B.
|
public function testJsonDecodeConfigTypeB($array, $json)
{
$config = AbstractConfiguration::jsonDecode($json);
static::assertInstanceOf(ConfigTypeB::class, $config);
static::assertSame($array, $config->toArray());
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function provideJsonDecodeConfigTypeB()\n {\n return [\n [[ConfigTypeB::JSON_MSHOST => '4htV2O3BMH'], '{\"'.ConfigTypeB::JSON_MSHOST.'\":\"4htV2O3BMH\"}'],\n [[ConfigTypeB::JSON_R3NAME => 'XmJsmqU3ua'], '{\"'.ConfigTypeB::JSON_R3NAME.'\":\"XmJsmqU3ua\"}'],\n [[ConfigTypeB::JSON_GROUP => 'Tczw3KTagh'], '{\"'.ConfigTypeB::JSON_GROUP.'\":\"Tczw3KTagh\"}']\n ];\n }",
"public function testJsonDecodeConfigTypeA($array, $json)\n {\n $config = AbstractConfiguration::jsonDecode($json);\n static::assertInstanceOf(ConfigTypeA::class, $config);\n static::assertSame($array, $config->toArray());\n }",
"public static function jsonDecode($json)\n {\n $config = static::jsonToArray($json);\n if (array_key_exists(ConfigTypeA::JSON_ASHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_SYSNR, $config)\n || array_key_exists(ConfigTypeA::JSON_GWHOST, $config)\n || array_key_exists(ConfigTypeA::JSON_GWSERV, $config)\n ) {\n return new ConfigTypeA($config);\n }\n if (array_key_exists(ConfigTypeB::JSON_MSHOST, $config)\n || array_key_exists(ConfigTypeB::JSON_R3NAME, $config)\n || array_key_exists(ConfigTypeB::JSON_GROUP, $config)\n ) {\n return new ConfigTypeB($config);\n }\n throw new InvalidArgumentException(\n 'Cannot automatically determine the configuration type from the'\n . ' given configuration keys!'\n );\n }",
"public function testDecode()\n {\n $json = $this->_newJson();\n \n $before = '{ \"test\": { \"foo\": \"bar\" } }';\n \n $actual = var_export($json->decode($before), 1);\n \n $expect = \"stdClass::__set_state(array(\\n\"\n . \" 'test' => \\n\"\n . \" stdClass::__set_state(array(\\n\"\n . \" 'foo' => 'bar',\\n\"\n . \" )),\\n\"\n . \"))\";\n \n $this->assertSame($actual, $expect);\n }",
"public function testNonSpecificJson($json)\n {\n AbstractConfiguration::jsonDecode($json);\n }",
"public static function provideJsonDecodeConfigTypeA()\n {\n return [\n [[ConfigTypeA::JSON_ASHOST => 'ItulITyML1'], '{\"'.ConfigTypeA::JSON_ASHOST.'\":\"ItulITyML1\"}'],\n [[ConfigTypeA::JSON_SYSNR => '5345'], '{\"'.ConfigTypeA::JSON_SYSNR.'\":\"5345\"}'],\n [[ConfigTypeA::JSON_GWHOST => '6sqPJLVVgS'], '{\"'.ConfigTypeA::JSON_GWHOST.'\":\"6sqPJLVVgS\"}'],\n [[ConfigTypeA::JSON_GWSERV => 'pzkPI1ZV7f'], '{\"'.ConfigTypeA::JSON_GWSERV.'\":\"pzkPI1ZV7f\"}']\n ];\n }",
"function testDecodeWithSyntaxError() {\n\t\t$this->setExpectedException('JSON_SyntaxError');\n\t\tJSON_Processor::decode('{\"bar\":\"baz\"');\n }",
"public function decode($config, $array = false)\n {\n return json_decode($config, $array);\n }",
"public static function _json_decode($a) { \n if (TRUE !== function_exists('json_decode')) {\n\t\t$m = array();\n\t\tpreg_match_all('#\"(.*?)\"#si', $a, $m);\n\t\treturn (isset($m[1]) && sizeof($m[1])>0) ? $m[1] : FALSE;\n\t} else {\n\t\treturn json_decode($a);\t\n\t}\t\n }",
"public function decode($json);",
"public function test_parser_factory()\n {\n $json = ParserFactory::getParser('json');\n \n $this->assertEquals(\n [\n \"a\" => 1,\n \"b\" => 2,\n \"c\" => 3,\n \"d\" => 4,\n \"e\" => 5,\n ], \n $json->decode('{\"a\":1,\"b\":2,\"c\":3,\"d\":4,\"e\":5}')\n );\n }",
"public function it_works_with_json_configuration()\n {\n $this->test_process('json');\n }",
"protected function decode($value) {\n\t\tif (defined('JSON_PARSER_NOTSTRICT')) {\n\t\t\treturn json_decode($value, false, 512, JSON_PARSER_NOTSTRICT);\n\t\t}\n\t\treturn json_decode($value);\n\t}",
"function decode($x) {\n return NULL === ($obj = json_decode($x, FALSE)) ? $this->error('Parse error.', -32700) : $obj;\n }",
"private function decode($json, $asArray = true)\n {\n return json_decode((string) $json, $asArray);\n }",
"function decode($json) {\n\t\t// Use the native function if possible\n\t\tif (function_exists('json_decode')) return json_decode($json);\n\n\t\t// Otherwise fall back on the JSON services library\n\t\t$jsonServices = $this->_getJsonServices();\n\t\treturn $jsonServices->decode($json);\n\t}",
"public function deserialize($json);",
"public static function DecodeJson (& $jsonStr);",
"protected function _json_decode($str, $asArray = false)\n {\n $str = $this->_reduce_string($str);\n \n switch (strtolower($str)) {\n case 'true':\n // JSON_checker test suite claims\n // \"A JSON payload should be an object or array, not a string.\"\n // Thus, returning bool(true) is invalid parsing, unless\n // we're nested inside an array or object.\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return true;\n } else {\n return null;\n }\n break;\n \n case 'false':\n // JSON_checker test suite claims\n // \"A JSON payload should be an object or array, not a string.\"\n // Thus, returning bool(false) is invalid parsing, unless\n // we're nested inside an array or object.\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return false;\n } else {\n return null;\n }\n break;\n \n case 'null':\n return null;\n \n default:\n $m = array();\n \n if (is_numeric($str) || ctype_digit($str) || ctype_xdigit($str)) {\n // Return float or int, or null as appropriate\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return ((float) $str == (integer) $str)\n ? (integer) $str\n : (float) $str;\n } else {\n return null;\n }\n break;\n \n } elseif (preg_match('/^(\"|\\').*(\\1)$/s', $str, $m)\n && $m[1] == $m[2]) {\n // STRINGS RETURNED IN UTF-8 FORMAT\n $delim = substr($str, 0, 1);\n $chrs = substr($str, 1, -1);\n $utf8 = '';\n $strlen_chrs = strlen($chrs);\n \n for ($c = 0; $c < $strlen_chrs; ++$c) {\n \n $substr_chrs_c_2 = substr($chrs, $c, 2);\n $ord_chrs_c = ord($chrs{$c});\n \n switch (true) {\n case $substr_chrs_c_2 == '\\b':\n $utf8 .= chr(0x08);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\t':\n $utf8 .= chr(0x09);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\n':\n $utf8 .= chr(0x0A);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\f':\n $utf8 .= chr(0x0C);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\r':\n $utf8 .= chr(0x0D);\n ++$c;\n break;\n \n case $substr_chrs_c_2 == '\\\\\"':\n case $substr_chrs_c_2 == '\\\\\\'':\n case $substr_chrs_c_2 == '\\\\\\\\':\n case $substr_chrs_c_2 == '\\\\/':\n if (($delim == '\"' && $substr_chrs_c_2 != '\\\\\\'') ||\n ($delim == \"'\" && $substr_chrs_c_2 != '\\\\\"')) {\n $utf8 .= $chrs{++$c};\n }\n break;\n \n case preg_match('/\\\\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):\n // single, escaped unicode character\n $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))\n . chr(hexdec(substr($chrs, ($c + 4), 2)));\n $utf8 .= $this->_utf162utf8($utf16);\n $c += 5;\n break;\n \n case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):\n $utf8 .= $chrs{$c};\n break;\n \n case ($ord_chrs_c & 0xE0) == 0xC0:\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 2);\n ++$c;\n break;\n \n case ($ord_chrs_c & 0xF0) == 0xE0:\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 3);\n $c += 2;\n break;\n \n case ($ord_chrs_c & 0xF8) == 0xF0:\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 4);\n $c += 3;\n break;\n \n case ($ord_chrs_c & 0xFC) == 0xF8:\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 5);\n $c += 4;\n break;\n \n case ($ord_chrs_c & 0xFE) == 0xFC:\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 6);\n $c += 5;\n break;\n \n }\n \n }\n \n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return $utf8;\n } else {\n return null;\n }\n \n } elseif (preg_match('/^\\[.*\\]$/s', $str) || preg_match('/^\\{.*\\}$/s', $str)) {\n // array, or object notation\n \n if ($str{0} == '[') {\n $stk = array(self::IN_ARR);\n $this->_level = self::IN_ARR;\n $arr = array();\n } else {\n if ($asArray) {\n $stk = array(self::IN_OBJ);\n $obj = array();\n } else {\n $stk = array(self::IN_OBJ);\n $obj = new stdClass();\n }\n $this->_level = self::IN_OBJ;\n }\n \n array_push($stk, array('what' => self::SLICE,\n 'where' => 0,\n 'delim' => false));\n \n $chrs = substr($str, 1, -1);\n $chrs = $this->_reduce_string($chrs);\n \n if ($chrs == '') {\n if (reset($stk) == self::IN_ARR) {\n return $arr;\n \n } else {\n return $obj;\n \n }\n }\n \n $strlen_chrs = strlen($chrs);\n \n for ($c = 0; $c <= $strlen_chrs; ++$c) {\n \n $top = end($stk);\n $substr_chrs_c_2 = substr($chrs, $c, 2);\n \n if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == self::SLICE))) {\n // found a comma that is not inside a string, array, etc.,\n // OR we've reached the end of the character list\n $slice = substr($chrs, $top['where'], ($c - $top['where']));\n array_push($stk, array('what' => self::SLICE, 'where' => ($c + 1), 'delim' => false));\n //print(\"Found split at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n if (reset($stk) == self::IN_ARR) {\n $this->_level = self::IN_ARR;\n // we are in an array, so just push an element onto the stack\n array_push($arr, $this->_json_decode($slice));\n \n } elseif (reset($stk) == self::IN_OBJ) {\n $this->_level = self::IN_OBJ;\n // we are in an object, so figure\n // out the property name and set an\n // element in an associative array,\n // for now\n $parts = array();\n \n if (preg_match('/^\\s*([\"\\'].*[^\\\\\\][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"name\":value pair\n $key = $this->_json_decode($parts[1]);\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*(\\w+)\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // name:value pair, where name is unquoted\n $key = $parts[1];\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*([\"\\'][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"\":value pair\n //$key = $this->_json_decode($parts[1]);\n // use string that matches ext/json\n $key = '_empty_';\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n }\n \n }\n \n } elseif ((($chrs{$c} == '\"') || ($chrs{$c} == \"'\")) && ($top['what'] != self::IN_STR)) {\n // found a quote, and we are not inside a string\n array_push($stk, array('what' => self::IN_STR, 'where' => $c, 'delim' => $chrs{$c}));\n //print(\"Found start of string at {$c}\\n\");\n \n } elseif (($chrs{$c} == $top['delim']) &&\n ($top['what'] == self::IN_STR) &&\n ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\\\'))) % 2 != 1)) {\n // found a quote, we're in a string, and it's not escaped\n // we know that it's not escaped becase there is _not_ an\n // odd number of backslashes at the end of the string so far\n array_pop($stk);\n //print(\"Found end of string at {$c}: \".substr($chrs, $top['where'], (1 + 1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($chrs{$c} == '[') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a left-bracket, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_ARR, 'where' => $c, 'delim' => false));\n //print(\"Found start of array at {$c}\\n\");\n \n } elseif (($chrs{$c} == ']') && ($top['what'] == self::IN_ARR)) {\n // found a right-bracket, and we're in an array\n $this->_level = null;\n array_pop($stk);\n //print(\"Found end of array at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($chrs{$c} == '{') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a left-brace, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_OBJ, 'where' => $c, 'delim' => false));\n //print(\"Found start of object at {$c}\\n\");\n \n } elseif (($chrs{$c} == '}') && ($top['what'] == self::IN_OBJ)) {\n // found a right-brace, and we're in an object\n $this->_level = null;\n array_pop($stk);\n //print(\"Found end of object at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($substr_chrs_c_2 == '/*') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a comment start, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_CMT, 'where' => $c, 'delim' => false));\n $c++;\n //print(\"Found start of comment at {$c}\\n\");\n \n } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == self::IN_CMT)) {\n // found a comment end, and we're in one now\n array_pop($stk);\n $c++;\n \n for ($i = $top['where']; $i <= $c; ++$i)\n $chrs = substr_replace($chrs, ' ', $i, 1);\n \n //print(\"Found end of comment at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n }\n \n }\n \n if (reset($stk) == self::IN_ARR) {\n return $arr;\n \n } elseif (reset($stk) == self::IN_OBJ) {\n return $obj;\n \n }\n \n }\n }\n }",
"public function decode($encodedValue, $asArray = false)\n {\n $first_char = substr(ltrim($encodedValue), 0, 1);\n if ($first_char != '{' && $first_char != '[') {\n return null;\n }\n \n if (!$this->_config['bypass_ext'] && function_exists('json_decode')) {\n return json_decode($encodedValue, (bool) $asArray);\n }\n \n // Fall back to PHP-only method\n $this->_level = 0;\n $checker = Solar::factory('Solar_Json_Checker');\n if ($checker->isValid($encodedValue)) {\n return $this->_json_decode($encodedValue, (bool) $asArray);\n } else {\n return null;\n }\n }",
"public static function Decode($json, $toAssoc = false) {\n if(substr($json, 0, 3) == pack(\"CCC\", 0xEF, 0xBB, 0xBF)) $json = substr($json, 3);\n \n try {\n $result = json_decode(trim($json), $toAssoc);\n $state = json_last_error();\n if ($state !== JSON_ERROR_NONE) {\n $error = JSON::getErrorMessage($state);\n throw new JsonDecodeException(\"JSON Error ({$state}): {$error}\"); \n }\n } catch (JsonDecodeException $e){\n $line = trim(date(\"[d/m @ H:i:s]\") . $e->getMessage()) . \"\\n\";\n if (preg_match('/<html[^>]{0,}>/i', $json)) {\n $message = preg_match('/<title>(.*)<\\/title>/i', $json);\n $line = trim(\"Error: \" . $message[1]) . \"\\n\";\n } else {\n $line = trim(\"Debug:\\n-->\\n\" . $json) . \"\\n<--\\n\";\n } \n error_log($line, 3, LOG_FILE);\n return false;\n }\n \n return $result;\n }",
"public function testJson()\n {\n $jsonGrammar = $this->grammar->parse($this->json_parser);\n\n $result = $jsonGrammar->parse(\" { \\\"string\\\" : true, \\\"\\\\\\\"\\\" : false, \\\"\\\\u9874asdh\\\" : [ null, { }, -9488.44E+093 ] } \");\n }",
"public static function maybe_decode_json( $value ) {\n\t\tif ( self::is_json( $value ) ) {\n\t\t\treturn json_decode( $value, ARRAY_A );\n\t\t}\n\n\t\treturn $value;\n\t}",
"public function decode() \n\t{\n\t\treturn json_decode(file_get_contents(self::BOOKCASE), true, self::DEPTH, JSON_BIGINT_AS_STRING);\n\t}",
"function decode_json($json) {\n\t$json = stripslashes($json);\n\n\tif(get_magic_quotes_gpc()) {\n\t}\n\treturn is_string($json) ? json_decode(str_replace('\\\"', '\"', $json), true) : $json;\n}",
"public function testIsJson(): void\n {\n $this->processSimpleTests('isJson', static::$tests);\n }",
"public function testJSON()\n {\n $parser = new JSONParser();\n\n $this->assertInstanceOf(Parser::class, $parser);\n }",
"public function testBailsWithBrokenJson()\n {\n new JsonArray('{\"foo\": \"bar\",}');\n }",
"public function testUserCanRetrieveABrandJSON()\n {\n $response = $this->getJsonRequest()->get('/brand/' . $this->brand->id);\n\n $response->assertStatus(Response::HTTP_OK);\n $response->assertJsonStructure($this->structure);\n }",
"private function decodeJson( $content ) {\n\n\t\t$content = preg_replace( '/[\\x00-\\x1F\\x80-\\xFF]/', '', $content );\n\n\t\treturn json_decode( $content, true );\n\t}"
] |
[
"0.7113866",
"0.7047182",
"0.6887644",
"0.6606072",
"0.6230817",
"0.61335796",
"0.6078064",
"0.6044948",
"0.6000642",
"0.5843041",
"0.56589377",
"0.5606569",
"0.5528076",
"0.5470798",
"0.54222554",
"0.539709",
"0.5396047",
"0.5370912",
"0.5366884",
"0.53646106",
"0.5361973",
"0.53298193",
"0.53273755",
"0.53203505",
"0.5304445",
"0.5303421",
"0.52942765",
"0.5238431",
"0.5227455",
"0.5212953"
] |
0.80289006
|
0
|
Test decoding a JSON that is not type specific.
|
public function testNonSpecificJson($json)
{
AbstractConfiguration::jsonDecode($json);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function testDecodeWithSyntaxError() {\n\t\t$this->setExpectedException('JSON_SyntaxError');\n\t\tJSON_Processor::decode('{\"bar\":\"baz\"');\n }",
"function is_JSON(...$args) \n{\n json_decode(...$args);\n return json_last_error() === JSON_ERROR_NONE;\n}",
"public function decode($json);",
"public function testDecode()\n {\n $json = $this->_newJson();\n \n $before = '{ \"test\": { \"foo\": \"bar\" } }';\n \n $actual = var_export($json->decode($before), 1);\n \n $expect = \"stdClass::__set_state(array(\\n\"\n . \" 'test' => \\n\"\n . \" stdClass::__set_state(array(\\n\"\n . \" 'foo' => 'bar',\\n\"\n . \" )),\\n\"\n . \"))\";\n \n $this->assertSame($actual, $expect);\n }",
"private function varIsJson($json): void {\r\n $json_obj = json_decode($json);\r\n $this->varIsObject($json_obj, 'json');\r\n }",
"private function isJson($string) {\n json_decode($string);\n return (json_last_error() == JSON_ERROR_NONE);\n }",
"function is_json( $string ){\n if( is_string( $string ) ){\n \n @json_decode( $string );\n return ( json_last_error() == JSON_ERROR_NONE );\n \n } else {\n \n return false;\n \n }\n}",
"function scrappy_isJson($string) {\n return ((is_string($string) &&\n (is_object(json_decode($string)) ||\n is_array(json_decode($string))))) ? true : false;\n}",
"private function safeDecode(string $json)\n {\n $decoded = json_decode($json, true);\n if (json_last_error() !== JSON_ERROR_NONE) {\n $err = json_last_error_msg();\n throw new JsonFormatException(\n \"Unable to parse invalid JSON ($err): $json\",\n JsonPath::root()\n );\n }\n return $decoded;\n }",
"public function testInvalidJson()\n {\n $this->parser->parse('{\"$eq\": [\"benchmark\", foo__');\n }",
"private function isJson($string) {\n\t\tjson_decode($string);\n\t\treturn (json_last_error() == \"JSON_ERROR_NONE\");\n\t}",
"function isJSON($string)\n{\n return (is_null(json_decode($string))) ? false : true;\n}",
"function isJSON($string){\n return is_string($string) && is_array(json_decode($string, true)) ? true : false;\n}",
"public function testJson()\n {\n $jsonGrammar = $this->grammar->parse($this->json_parser);\n\n $result = $jsonGrammar->parse(\" { \\\"string\\\" : true, \\\"\\\\\\\"\\\" : false, \\\"\\\\u9874asdh\\\" : [ null, { }, -9488.44E+093 ] } \");\n }",
"public function deserialize($json);",
"function decode($json) {\n\t\t// Use the native function if possible\n\t\tif (function_exists('json_decode')) return json_decode($json);\n\n\t\t// Otherwise fall back on the JSON services library\n\t\t$jsonServices = $this->_getJsonServices();\n\t\treturn $jsonServices->decode($json);\n\t}",
"protected function decodeJson(string $json): mixed\n {\n return json_decode($json, $this->decodesToArray, $this->depth, JSON_THROW_ON_ERROR);\n }",
"public static function isJson($str) {}",
"private function isValidJson($string) {\n json_decode($string);\n return (json_last_error() == JSON_ERROR_NONE);\n }",
"function cargo_is_json( $obj ) {\n\treturn is_string( $obj ) && is_array( json_decode( $obj, true ) ) && json_last_error() === JSON_ERROR_NONE;\n}",
"public function testInvalidJsonProcessing()\n {\n $mock = new MockHandler(\n [\n new Response(200, [], '{\"malformedJSON\":[]]}'),\n ]\n );\n $handler = HandlerStack::create($mock);\n $client = new Client(['handler' => $handler]);\n\n // We want a proper exception, not a fatal error nor a silent fail.\n $this->expectException(JsonDecodingError::class);\n (new TestService(new ApiClient($client)))->getTest();\n }",
"public static function decode(?string $json)\n {\n // The typehint is left as ?string for backwards compatibility\n if ($json === NULL) {\n throw new InvalidJSONException('Invalid JSON: Cannot decode a null value');\n }\n\n $result = json_decode($json, TRUE);\n\n if (json_last_error() !== JSON_ERROR_NONE) {\n throw new InvalidJSONException('Invalid JSON: '.json_last_error_msg());\n }\n\n return $result;\n }",
"private static function isValidJson($val) {\n $json = json_decode($val, true);\n if ($json === null || $json === true || $json === false) {\n throw new Exception(\"Couldn't decode JSON response!\");\n }\n\n return $json;\n }",
"public static function decode_json( $json_string, $assoc = false ) {\n\t\t\t// will cause 502 issue when redirect.\n\t\t\treturn version_compare( phpversion(), '5.6.0' ) >= 0\n\t\t\t? json_decode( $json_string, $assoc, 512, JSON_BIGINT_AS_STRING )\n\t\t\t: json_decode( $json_string, $assoc, 512 );\n\t\t}",
"function is_json(string $string): bool\n {\n json_decode($string);\n return json_last_error() === JSON_ERROR_NONE;\n }",
"protected function _json_decode($str, $asArray = false)\n {\n $str = $this->_reduce_string($str);\n \n switch (strtolower($str)) {\n case 'true':\n // JSON_checker test suite claims\n // \"A JSON payload should be an object or array, not a string.\"\n // Thus, returning bool(true) is invalid parsing, unless\n // we're nested inside an array or object.\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return true;\n } else {\n return null;\n }\n break;\n \n case 'false':\n // JSON_checker test suite claims\n // \"A JSON payload should be an object or array, not a string.\"\n // Thus, returning bool(false) is invalid parsing, unless\n // we're nested inside an array or object.\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return false;\n } else {\n return null;\n }\n break;\n \n case 'null':\n return null;\n \n default:\n $m = array();\n \n if (is_numeric($str) || ctype_digit($str) || ctype_xdigit($str)) {\n // Return float or int, or null as appropriate\n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return ((float) $str == (integer) $str)\n ? (integer) $str\n : (float) $str;\n } else {\n return null;\n }\n break;\n \n } elseif (preg_match('/^(\"|\\').*(\\1)$/s', $str, $m)\n && $m[1] == $m[2]) {\n // STRINGS RETURNED IN UTF-8 FORMAT\n $delim = substr($str, 0, 1);\n $chrs = substr($str, 1, -1);\n $utf8 = '';\n $strlen_chrs = strlen($chrs);\n \n for ($c = 0; $c < $strlen_chrs; ++$c) {\n \n $substr_chrs_c_2 = substr($chrs, $c, 2);\n $ord_chrs_c = ord($chrs{$c});\n \n switch (true) {\n case $substr_chrs_c_2 == '\\b':\n $utf8 .= chr(0x08);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\t':\n $utf8 .= chr(0x09);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\n':\n $utf8 .= chr(0x0A);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\f':\n $utf8 .= chr(0x0C);\n ++$c;\n break;\n case $substr_chrs_c_2 == '\\r':\n $utf8 .= chr(0x0D);\n ++$c;\n break;\n \n case $substr_chrs_c_2 == '\\\\\"':\n case $substr_chrs_c_2 == '\\\\\\'':\n case $substr_chrs_c_2 == '\\\\\\\\':\n case $substr_chrs_c_2 == '\\\\/':\n if (($delim == '\"' && $substr_chrs_c_2 != '\\\\\\'') ||\n ($delim == \"'\" && $substr_chrs_c_2 != '\\\\\"')) {\n $utf8 .= $chrs{++$c};\n }\n break;\n \n case preg_match('/\\\\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)):\n // single, escaped unicode character\n $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2)))\n . chr(hexdec(substr($chrs, ($c + 4), 2)));\n $utf8 .= $this->_utf162utf8($utf16);\n $c += 5;\n break;\n \n case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F):\n $utf8 .= $chrs{$c};\n break;\n \n case ($ord_chrs_c & 0xE0) == 0xC0:\n // characters U-00000080 - U-000007FF, mask 110XXXXX\n //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 2);\n ++$c;\n break;\n \n case ($ord_chrs_c & 0xF0) == 0xE0:\n // characters U-00000800 - U-0000FFFF, mask 1110XXXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 3);\n $c += 2;\n break;\n \n case ($ord_chrs_c & 0xF8) == 0xF0:\n // characters U-00010000 - U-001FFFFF, mask 11110XXX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 4);\n $c += 3;\n break;\n \n case ($ord_chrs_c & 0xFC) == 0xF8:\n // characters U-00200000 - U-03FFFFFF, mask 111110XX\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 5);\n $c += 4;\n break;\n \n case ($ord_chrs_c & 0xFE) == 0xFC:\n // characters U-04000000 - U-7FFFFFFF, mask 1111110X\n // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8\n $utf8 .= substr($chrs, $c, 6);\n $c += 5;\n break;\n \n }\n \n }\n \n if (in_array($this->_level, array(self::IN_ARR, self::IN_OBJ))) {\n return $utf8;\n } else {\n return null;\n }\n \n } elseif (preg_match('/^\\[.*\\]$/s', $str) || preg_match('/^\\{.*\\}$/s', $str)) {\n // array, or object notation\n \n if ($str{0} == '[') {\n $stk = array(self::IN_ARR);\n $this->_level = self::IN_ARR;\n $arr = array();\n } else {\n if ($asArray) {\n $stk = array(self::IN_OBJ);\n $obj = array();\n } else {\n $stk = array(self::IN_OBJ);\n $obj = new stdClass();\n }\n $this->_level = self::IN_OBJ;\n }\n \n array_push($stk, array('what' => self::SLICE,\n 'where' => 0,\n 'delim' => false));\n \n $chrs = substr($str, 1, -1);\n $chrs = $this->_reduce_string($chrs);\n \n if ($chrs == '') {\n if (reset($stk) == self::IN_ARR) {\n return $arr;\n \n } else {\n return $obj;\n \n }\n }\n \n $strlen_chrs = strlen($chrs);\n \n for ($c = 0; $c <= $strlen_chrs; ++$c) {\n \n $top = end($stk);\n $substr_chrs_c_2 = substr($chrs, $c, 2);\n \n if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == self::SLICE))) {\n // found a comma that is not inside a string, array, etc.,\n // OR we've reached the end of the character list\n $slice = substr($chrs, $top['where'], ($c - $top['where']));\n array_push($stk, array('what' => self::SLICE, 'where' => ($c + 1), 'delim' => false));\n //print(\"Found split at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n if (reset($stk) == self::IN_ARR) {\n $this->_level = self::IN_ARR;\n // we are in an array, so just push an element onto the stack\n array_push($arr, $this->_json_decode($slice));\n \n } elseif (reset($stk) == self::IN_OBJ) {\n $this->_level = self::IN_OBJ;\n // we are in an object, so figure\n // out the property name and set an\n // element in an associative array,\n // for now\n $parts = array();\n \n if (preg_match('/^\\s*([\"\\'].*[^\\\\\\][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"name\":value pair\n $key = $this->_json_decode($parts[1]);\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*(\\w+)\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // name:value pair, where name is unquoted\n $key = $parts[1];\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n } elseif (preg_match('/^\\s*([\"\\'][\"\\'])\\s*:\\s*(\\S.*),?$/Uis', $slice, $parts)) {\n // \"\":value pair\n //$key = $this->_json_decode($parts[1]);\n // use string that matches ext/json\n $key = '_empty_';\n $val = $this->_json_decode($parts[2]);\n \n if ($asArray) {\n $obj[$key] = $val;\n } else {\n $obj->$key = $val;\n }\n }\n \n }\n \n } elseif ((($chrs{$c} == '\"') || ($chrs{$c} == \"'\")) && ($top['what'] != self::IN_STR)) {\n // found a quote, and we are not inside a string\n array_push($stk, array('what' => self::IN_STR, 'where' => $c, 'delim' => $chrs{$c}));\n //print(\"Found start of string at {$c}\\n\");\n \n } elseif (($chrs{$c} == $top['delim']) &&\n ($top['what'] == self::IN_STR) &&\n ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\\\'))) % 2 != 1)) {\n // found a quote, we're in a string, and it's not escaped\n // we know that it's not escaped becase there is _not_ an\n // odd number of backslashes at the end of the string so far\n array_pop($stk);\n //print(\"Found end of string at {$c}: \".substr($chrs, $top['where'], (1 + 1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($chrs{$c} == '[') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a left-bracket, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_ARR, 'where' => $c, 'delim' => false));\n //print(\"Found start of array at {$c}\\n\");\n \n } elseif (($chrs{$c} == ']') && ($top['what'] == self::IN_ARR)) {\n // found a right-bracket, and we're in an array\n $this->_level = null;\n array_pop($stk);\n //print(\"Found end of array at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($chrs{$c} == '{') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a left-brace, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_OBJ, 'where' => $c, 'delim' => false));\n //print(\"Found start of object at {$c}\\n\");\n \n } elseif (($chrs{$c} == '}') && ($top['what'] == self::IN_OBJ)) {\n // found a right-brace, and we're in an object\n $this->_level = null;\n array_pop($stk);\n //print(\"Found end of object at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n } elseif (($substr_chrs_c_2 == '/*') &&\n in_array($top['what'], array(self::SLICE, self::IN_ARR, self::IN_OBJ))) {\n // found a comment start, and we are in an array, object, or slice\n array_push($stk, array('what' => self::IN_CMT, 'where' => $c, 'delim' => false));\n $c++;\n //print(\"Found start of comment at {$c}\\n\");\n \n } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == self::IN_CMT)) {\n // found a comment end, and we're in one now\n array_pop($stk);\n $c++;\n \n for ($i = $top['where']; $i <= $c; ++$i)\n $chrs = substr_replace($chrs, ' ', $i, 1);\n \n //print(\"Found end of comment at {$c}: \".substr($chrs, $top['where'], (1 + $c - $top['where'])).\"\\n\");\n \n }\n \n }\n \n if (reset($stk) == self::IN_ARR) {\n return $arr;\n \n } elseif (reset($stk) == self::IN_OBJ) {\n return $obj;\n \n }\n \n }\n }\n }",
"public static function DecodeJson (& $jsonStr);",
"private function validateJson($json)\n {\n $isJson = json_decode($json);\n\n if ($isJson instanceof \\stdClass) {\n return true;\n }\n\n return false;\n }",
"function isJson()\n {\n $json = @call_user_func_array('json_decode', func_get_args());\n\n return json_last_error() ? false : $json;\n }",
"function is_json($str)\n {\n if (!is_string($str)) {\n return false;\n }\n\n json_decode($str);\n return json_last_error() == JSON_ERROR_NONE;\n }"
] |
[
"0.69497246",
"0.65844285",
"0.65788585",
"0.653992",
"0.651317",
"0.64169556",
"0.6400858",
"0.63747215",
"0.6362822",
"0.6330598",
"0.62812257",
"0.62739426",
"0.62430686",
"0.61888146",
"0.61712384",
"0.6140634",
"0.61226857",
"0.6091207",
"0.6083912",
"0.60808814",
"0.60771894",
"0.6055086",
"0.6035187",
"0.6027019",
"0.6021701",
"0.6013907",
"0.60005534",
"0.5991185",
"0.59879035",
"0.5983482"
] |
0.73973954
|
0
|
/=====================Votes Related Code============================= Implements entityname_form(). Entity API will call this form for crud operations.
|
function cb_votes_form($form, &$form_state, $entity = NULL) {
$form = array();
$options = array();
$results = db_select('cb_options', 'o')
->fields('o', array('id', 'cb_option'))
->execute()
->fetchAll();
foreach($results as $row) {
$options[$row->id] = $row->cb_option;
}
$form['cb_option_id'] = array(
'#title' => t('Select Option'),
'#type' => 'select',
'#options' => $options,
'#default_value' => isset($entity->cb_option_id) ? $entity->cb_option_id : '',
'#description' => t('Choose option to which this vote casts to'),
'#required' => TRUE,
);
$form['vote'] = array(
'#title' => t('Preference'),
'#type' => 'textfield',
'#default_value' => isset($entity->vote) ? $entity->vote : '',
'#description' => t('Preference'),
'#required' => TRUE,
);
field_attach_form('cb_votes', $entity, $form, $form_state);
$form['actions'] = array(
'#type' => 'actions',
'submit' => array(
'#type' => 'submit',
'#value' => isset($entity->id) ? t('Update') : t('Save'),
),
);
return $form;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function voteAction()\n {\n\n }",
"function thumb_vote_form_submit($form, $form_state){\n $entity_info = entity_get_info();\n \n \n $entity_types = array();\n \n foreach($entity_info as $k => $i){\n foreach($form_state['values']['thumbvote_entity_types_'.$k] as $enttype){\n if($enttype){\n $entity_types[] = $enttype;\n }\n }\n }\n variable_set('thumbvote_entity_types',$entity_types);\n}",
"public function edit(Vote $vote)\n {\n //\n }",
"public function edit(Vote $vote)\n {\n //\n }",
"public function edit(vote $vote)\n {\n //\n }",
"static function add_voting(): void {\r\n\t\tself::add_acf_inner_field(self::roles, self::voting, [\r\n\t\t\t'label' => 'Automatic voting rights?',\r\n\t\t\t'type' => 'true_false',\r\n\t\t\t'instructions' => 'As opposed to earned.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '25',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'message' => '',\r\n\t\t\t'default_value' => 0,\r\n\t\t\t'ui' => 1,\r\n\t\t]);\r\n\t}",
"function travel_type_form($form, &$form_state, $entity_type, $op = 'edit') {\n // Handle the case when cloning is performed.\n if ($op == 'clone') {\n $entity_type->label .= ' (cloned)';\n $entity_type->type = '';\n }\n\n // Describe all properties of the entity which shall be shown on the form.\n $form['label'] = array(\n '#title' => t('Label'),\n '#type' => 'textfield',\n '#default_value' => $entity_type->label,\n '#description' => t('The human-readable name of this entity type.'),\n '#required' => TRUE,\n '#size' => 30,\n );\n $form['type'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($entity_type->type) ? $entity_type->type : '',\n '#maxlength' => 32,\n //'#disabled' => $entity_type->isLocked() && $op != 'clone',\n '#machine_name' => array(\n 'exists' => 'travel_type_load_multiple',\n 'source' => array('label'),\n ),\n '#description' => t('A unique machine-readable name for this entity type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n $form['description'] = array(\n '#type' => 'textarea',\n '#default_value' => isset($entity_type->description) ? $entity_type->description : '',\n '#description' => t('Description about the entity type.'),\n );\n\n // Add some buttons.\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save entity type'),\n '#weight' => 40,\n );\n //if (!$entity_type->isLocked() && $op != 'add' && $op != 'clone') {\n $entity_id = entity_id('travel', $entity);\n if (!empty($entity_id)) {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete entity type'),\n '#weight' => 45,\n '#limit_validation_errors' => array(),\n '#submit' => array('travel_type_form_submit_delete'),\n );\n }\n\n return $form;\n}",
"function custom_entity_generate_form($form, $form_state, $name) {\n $form['entity_label'] = array(\n '#type' => 'value',\n '#value' => $name,\n );\n $form['kill_entities'] = array(\n '#type' => 'checkbox',\n '#title' => t('<strong>Delete all @name</strong> before generating new @name.', ['@name' => $name]),\n '#default_value' => FALSE,\n );\n\n $form['num_entities'] = array(\n '#type' => 'textfield',\n '#title' => t('How many @name would you like to generate?', ['@name' => $name]),\n '#default_value' => 50,\n '#size' => 10,\n );\n\n $form['title_length'] = array(\n '#type' => 'textfield',\n '#title' => t('Max word length of titles'),\n '#default_value' => 4,\n '#size' => 10,\n );\n\n unset($options);\n $options[LANGUAGE_NONE] = t('Language neutral');\n if (module_exists('locale')) {\n $options += locale_language_list();\n }\n $form['add_language'] = array(\n '#type' => 'select',\n '#title' => t('Set language on @name', ['@name' => $name]),\n '#multiple' => TRUE,\n '#disabled' => !module_exists('locale'),\n '#description' => t('Requires locale.module'),\n '#options' => $options,\n '#default_value' => array(LANGUAGE_NONE => LANGUAGE_NONE),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Generate'),\n );\n $form['#redirect'] = FALSE;\n\n return $form;\n}",
"public function addEntityFields(FormBuilderInterface $builder, array $options)\n {\n \n $listEntries = $this->listHelper->getEntries('vehicle', 'vehicleType');\n $choices = [];\n $choiceAttributes = [];\n foreach ($listEntries as $entry) {\n $choices[$entry['text']] = $entry['value'];\n $choiceAttributes[$entry['text']] = ['title' => $entry['title']];\n }\n $builder->add('vehicleType', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\ChoiceType', [\n 'label' => $this->__('Vehicle type') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('please select which type fits best')\n ],\n 'help' => $this->__('please select which type fits best'),\n 'empty_data' => 'Auto',\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('Choose the vehicle type')\n ],'choices' => $choices,\n 'choices_as_values' => true,\n 'choice_attr' => $choiceAttributes,\n 'multiple' => false,\n 'expanded' => false\n ]);\n \n $builder->add('titleImage', 'RK\\ParkHausModule\\Form\\Type\\Field\\UploadType', [\n 'label' => $this->__('Title image') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('This image will be used as the title image. It shoud have a ratio of 3:1 and min 1200px. Bigger than 1800px will be reduced automatically.')\n ],\n 'help' => $this->__('This image will be used as the title image. It shoud have a ratio of 3:1 and min 1200px. Bigger than 1800px will be reduced automatically.'),\n 'attr' => [\n 'class' => ' validate-nospace validate-upload',\n 'title' => $this->__('Enter the title image of the vehicle')\n ],'required' => false,\n 'entity' => $options['entity'],\n 'allowed_extensions' => 'gif, jpeg, jpg, png',\n 'allowed_size' => 0\n ]);\n \n $builder->add('copyrightTitleImage', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Copyright title image') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('Please fill the copyright. If you got the image from someone else please be fair and name him here.')\n ],\n 'help' => $this->__('Please fill the copyright. If you got the image from someone else please be fair and name him here.'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the copyright title image of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('vehicleImage', 'RK\\ParkHausModule\\Form\\Type\\Field\\UploadType', [\n 'label' => $this->__('Vehicle image') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('This image should be in landscape format. It will represent your vehicle. In the album you can add multiple additional images.')\n ],\n 'help' => $this->__('This image should be in landscape format. It will represent your vehicle. In the album you can add multiple additional images.'),\n 'attr' => [\n 'class' => ' validate-nospace validate-upload',\n 'title' => $this->__('Enter the vehicle image of the vehicle')\n ],'required' => false,\n 'entity' => $options['entity'],\n 'allowed_extensions' => 'gif, jpeg, jpg, png',\n 'allowed_size' => 0\n ]);\n \n $builder->add('copyrightVehicleImage', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Copyright vehicle image') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('Please fill the copyright. If you got the image from someone else please be fair and name him here.')\n ],\n 'help' => $this->__('Please fill the copyright. If you got the image from someone else please be fair and name him here.'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the copyright vehicle image of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('vehicleDescriptionTeaser', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextareaType', [\n 'label' => $this->__('Vehicle description teaser') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('Vehicle description with max 500 char. It will been shown in the list overview and added in front of the rest of the vehicle description.')\n ],\n 'help' => $this->__('Vehicle description with max 500 char. It will been shown in the list overview and added in front of the rest of the vehicle description.'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 500,\n 'class' => '',\n 'title' => $this->__('Enter the vehicle description teaser of the vehicle')\n ],'required' => true\n ]);\n \n $builder->add('vehicleDescription', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextareaType', [\n 'label' => $this->__('Vehicle description') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('This is the text which follows the teaser text at the display page. You can use max 5000 char.')\n ],\n 'help' => $this->__('This is the text which follows the teaser text at the display page. You can use max 5000 char.'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 5000,\n 'class' => '',\n 'title' => $this->__('Enter the vehicle description of the vehicle')\n ],'required' => false\n ]);\n \n $builder->add('manufacturer', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Manufacturer') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('if you do not know the manufacturer please type unknown.')\n ],\n 'help' => $this->__('if you do not know the manufacturer please type unknown.'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the manufacturer of the vehicle')\n ],'required' => true,\n ]);\n \n $builder->add('manufacturerImage', 'RK\\ParkHausModule\\Form\\Type\\Field\\UploadType', [\n 'label' => $this->__('Manufacturer image') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('Here you can place an image from the OEM who manufactured the vehicle. It will be used in the print version.')\n ],\n 'help' => $this->__('Here you can place an image from the OEM who manufactured the vehicle. It will be used in the print version.'),\n 'attr' => [\n 'class' => ' validate-upload',\n 'title' => $this->__('Enter the manufacturer image of the vehicle')\n ],'required' => false,\n 'entity' => $options['entity'],\n 'allowed_extensions' => 'gif, jpeg, jpg, png',\n 'allowed_size' => 0\n ]);\n \n $builder->add('model', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Model') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('vehicle version')\n ],\n 'help' => $this->__('vehicle version'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the model of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('built', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Built') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('the year or month.year of your vehicle built')\n ],\n 'help' => $this->__('the year or month.year of your vehicle built'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the built of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('engine', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Engine') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('e.g. Otto, Diesel, Wankel, or specific type of engine, ...')\n ],\n 'help' => $this->__('e.g. Otto, Diesel, Wankel, or specific type of engine, ...'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the engine of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('displacement', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Displacement') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('how much ccm')\n ],\n 'help' => $this->__('how much ccm'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the displacement of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('cylinders', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Cylinders') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('how many cylinders')\n ],\n 'help' => $this->__('how many cylinders'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the cylinders of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('compression', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Compression') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('compression in bar')\n ],\n 'help' => $this->__('compression in bar'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the compression of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('fuelManagement', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Fuel management') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('e.g. injection type, carburetor manufacturor and size ...')\n ],\n 'help' => $this->__('e.g. injection type, carburetor manufacturor and size ...'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the fuel management of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('fuel', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Fuel') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('z.B. Benzine, Diesel or 1:25')\n ],\n 'help' => $this->__('z.B. Benzine, Diesel or 1:25'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the fuel of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('horsePower', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Horse power') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('you can use hp or kw')\n ],\n 'help' => $this->__('you can use hp or kw'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the horse power of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('maxSpeed', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Max speed') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('you can use km/h or mph')\n ],\n 'help' => $this->__('you can use km/h or mph'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the max speed of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('weight', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Weight') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('typical in kg')\n ],\n 'help' => $this->__('typical in kg'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the weight of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('brakes', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Brakes') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('tell us something about your brakes')\n ],\n 'help' => $this->__('tell us something about your brakes'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the brakes of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('gearbox', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Gearbox') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('shifter or automatic? Specific type?')\n ],\n 'help' => $this->__('shifter or automatic? Specific type?'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the gearbox of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('rim', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Rim') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('if you have special rim installed')\n ],\n 'help' => $this->__('if you have special rim installed'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the rim of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('tire', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Tire') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('sice of tire or something specific about your tires')\n ],\n 'help' => $this->__('sice of tire or something specific about your tires'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the tire of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('interior', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Interior') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('do you have a special interieur?')\n ],\n 'help' => $this->__('do you have a special interieur?'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the interior of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('infoField1', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Info field 1') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('If there is something special what you can not fill into one of the other fields you may want to place it here.')\n ],\n 'help' => $this->__('If there is something special what you can not fill into one of the other fields you may want to place it here.'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the info field 1 of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('infoField2', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Info field 2') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('If there is something special what you can not fill into one of the other fields you may want to place it here.')\n ],\n 'help' => $this->__('If there is something special what you can not fill into one of the other fields you may want to place it here.'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the info field 2 of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('infoField3', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\TextType', [\n 'label' => $this->__('Info field 3') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('If there is something special what you can not fill into one of the other fields you may want to place it here.')\n ],\n 'help' => $this->__('If there is something special what you can not fill into one of the other fields you may want to place it here.'),\n 'empty_data' => '',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Enter the info field 3 of the vehicle')\n ],'required' => false,\n ]);\n \n $builder->add('showVehicleOwner', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType', [\n 'label' => $this->__('Show vehicle owner') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('If not checked the registered user will not been shown to the public. Only IG members are able to see.')\n ],\n 'help' => $this->__('If not checked the registered user will not been shown to the public. Only IG members are able to see.'),\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('show vehicle owner ?')\n ],'required' => false,\n ]);\n \n $builder->add('titleTextColor', 'RK\\ParkHausModule\\Form\\Type\\Field\\ColourType', [\n 'label' => $this->__('Title text color') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('Please change if white is not fitting due to the color of the title image. Preferred you should use #000000 in case.')\n ],\n 'help' => $this->__('Please change if white is not fitting due to the color of the title image. Preferred you should use #000000 in case.'),\n 'empty_data' => '#ffffff',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => ' validate-nospace validate-htmlcolour rkparkhausmoduleColourPicker',\n 'title' => $this->__('Choose the title text color of the vehicle')\n ],'required' => true,\n ]);\n \n $builder->add('stillMyOwn', 'Symfony\\Component\\Form\\Extension\\Core\\Type\\CheckboxType', [\n 'label' => $this->__('Still my own') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('If you do not own the vehicle anymore you do have two options. You may wont to delete the vehicle or you uncheck this option. If unchecked the vehicle is marked as \"not in Parkhaus anymore\"')\n ],\n 'help' => $this->__('If you do not own the vehicle anymore you do have two options. You may wont to delete the vehicle or you uncheck this option. If unchecked the vehicle is marked as \"not in Parkhaus anymore\"'),\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('still my own ?')\n ],'required' => false,\n ]);\n }",
"private function formVotingOptions()\n {\n $content = '';\n $count = 1;\n extract($this->language[$this->selectLanguage()]);\n foreach ($this->votingOptions AS $option)\n {\n $content .= '\n <dt><label for=\"votingText\">' . $txtVotingOption. ' #' . $count++ . '</label></dt>\n <dd><input type=\"text\" name=\"votingOptions[]\" value=\"' . $option . '\" /></dd>';\n }\n return $content;\n }",
"function related_products_metaboxes() {\n add_meta_box(\n 'related_products',\n 'Choose Related Products',\n 'related_products_list_html',\n 'rfib_products',\n 'normal',\n 'default'\n );\n}",
"public function edit(Voter $voter)\n {\n //\n }",
"function editRelated()\n\t{\n\t\t$id=$_GET['prodid'];\n\n\t\tif(((int)$id)>0)\n\t\t{\n\t\t\t$sql = \"SELECT \t* FROM products_table \";\n\t\t\t$query = new Bin_Query();\n\t\t\t$query->executeQuery($sql);\n\t\t\t\n\t\t\t$sql='select cross_product_ids from cross_products_table where product_id='.$id;\n\t\t\t$obj=new Bin_Query();\n\t\t\t$obj->executeQuery($sql);\n\t\t\t$p_id=$obj->records[0];\n\t\t\t$value=explode(\",\",$p_id['cross_product_ids']);\n\t\t\treturn Display_DManageProducts::editRelated($query->records,$value);\n\t\t}\t\n\t\t\t//return '<div class=\"exc_msgbox\">No Products Found! Please Click Product Entry Link to Add Products!</div>';\n\n\n\t\n\t}",
"public function createAddForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(),$entity,array(\n 'action' => $this->generateUrl('rsp_create'),\n 'method'=> 'POST'\n ));\n \n \n $form->add('Add','submit',array(\n //'attr'=>array('onClick'=>'return checksubmit(this)')\n ));\n return $form;\n }",
"function recordVote()\n{\n\n //add voter and vote to database\n\n //mark voter as voted\n\n}",
"function handleEditRelatedPerson(EventContext $context)\n {\n $this->storeProgramItem();\n $related_person = RelatedPerson::getRelatedPerson(fmGetVar('related_person_id'));\n $_SESSION['current_related_person'] = $related_person;\n\n $context->setForward(dirname(__FILE__) . \"/related_person_editor.php\");\n }",
"function firstentity_person_edit($form , &$form_state , $person) {\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => 'name',\n '#default_value' => $person->name\n );\n\n $form['person'] = array(\n '#type' => 'value',\n '#value' => $person\n );\n $form['personality'] = array(\n '#type' => 'value',\n '#value' => $person->personality\n );\n field_attach_form( 'person' , $person , $form , $form_state );\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['save'] = array(\n '#type' => 'submit',\n '#value' => 'save'\n );\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => 'delete',\n '#submit' => array('firstentity_person_edit_delete')\n );\n return $form;\n}",
"function travel_form($form, &$form_state, $entity) {\n // Store the entity in the form.\n $form_state['entity'] = $entity;\n\n // Describe all properties of the entity which shall be shown on the form.\n $wrapper = entity_metadata_wrapper('travel', $entity);\n\n $form['transport'] = array(\n '#type' => 'textfield',\n '#required' => TRUE,\n '#title' => t('Transport:'),\n '#default_value' => $wrapper->transport->value(),\n '#weight' => -20,\n );\n\n $form['source_from'] = array(\n '#type' => 'textfield',\n '#required' => TRUE,\n '#title' => t('Source From:'),\n '#default_value' => $wrapper->source_from->value(),\n '#weight' => -16,\n );\n $form['destination_to'] = array(\n '#type' => 'textfield',\n '#title' => t('Destination To:'),\n '#default_value' => $wrapper->destination_to->value(),\n '#weight' => -10,\n );\n\n // Add fields of the entity to the form.\n field_attach_form('travel', $entity, $form, $form_state);\n\n // Add some buttons.\n $submit = array();\n if (!empty($form['#submit'])) {\n $submit += $form['#submit'];\n }\n $form['actions'] = array(\n '#weight' => 100,\n );\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save entity'),\n '#submit' => $submit + array('travel_form_submit'),\n );\n $entity_id = entity_id('travel', $entity);\n if (!empty($entity_id)) {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n '#submit' => array('travel_form_submit_delete'),\n );\n }\n\n return $form;\n}",
"function ting_visual_relation_slide_form($form, &$form_state, $slide_id = NULL) {\n $slide = FALSE;\n // If this is the edit form load the slide settings from the database.\n if (isset($slide_id)) {\n $slide = db_select('ting_visual_relation_slides', 'tvrs')\n ->fields('tvrs')\n ->condition('tvrs.slide_id', $slide_id)\n ->execute()\n ->fetchObject();\n // Save the slide for later use\n $form_state['slide'] = $slide;\n }\n $form['add_slide'] = array(\n '#type' => 'fieldset',\n '#title' => t('Add slide'),\n );\n // Slide name\n $form['add_slide']['name'] = array(\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#description' => t('Enter the human readable name of the slide'),\n '#default_value' => $slide ? $slide->name : '',\n );\n // Relation browser type\n $form['add_slide']['type'] = array(\n '#type' => 'select',\n '#title' => t('Relation browser type'),\n '#description' => t('Select the type of relation browser slide to create'),\n '#options' => ting_visual_relation_types(),\n '#default_value' => $slide ? $slide->type : 'external',\n );\n // Datawell PID - Only visable when type external or circular is selected.\n $form['add_slide']['datawell_pid'] = array(\n '#type' => 'textfield',\n '#title' => t('Datawell PID'),\n '#description' => t('Enter the datawell PID the browser should be based on'),\n '#default_value' => $slide ? $slide->datawell_pid : '',\n '#states' => array(\n 'visible' => array(\n ':input[name=\"type\"]' => array(\n array('value' => 'external'),\n array('value' => 'circular'),\n ),\n ),\n ),\n );\n // Search query - Only visible when type structural is selected.\n $form['add_slide']['search_query'] = array(\n '#type' => 'textfield',\n '#title' => t('Search query'),\n '#description' => t('Enter the search query the browser should be based on'),\n '#default_value' => $slide ? $slide->search_query : '',\n '#states' => array(\n 'visible' => array(\n ':input[name=\"type\"]' => array('value' => 'structural'),\n ),\n ),\n );\n // Form actions\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => $slide ? t('Update') : t('Save'),\n );\n // Should only be included if user is editing an existing slide.\n if ($slide) {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n '#submit' => array('ting_visual_relation_slide_form_delete'),\n );\n }\n $form['actions']['cancel'] = array(\n '#type' => 'submit',\n '#value' => t('Cancel'),\n '#submit' => array('ting_visual_relation_slide_form_cancel'),\n // Bypass form-validation since this is a cancel-button\n '#limit_validation_errors' => array(),\n '#weight' => 40,\n );\n return $form;\n}",
"function mongo_node_bundle_edit_form($form, $form_state, $entity_type, $bundle) {\n\n $set = mongo_node_settings();\n\n $form = array();\n\n $form['label'] = array(\n '#type' => 'textfield',\n '#title' => t('Entity type'),\n '#default_value' => $set[$entity_type]['bundles'][$bundle]['label'],\n '#description' => t('The human readable name of the entity.'),\n );\n\n $form['name'] = array(\n '#type' => 'machine_name',\n '#required' => FALSE,\n '#default_value' => $bundle,\n '#machine_name' => array(\n 'exists' => '_mongo_node_bundle_exists',\n 'source' => array('label'),\n ),\n );\n\n $description = isset($set[$entity_type]['bundles'][$bundle]['description']) ? $set[$entity_type]['bundles'][$bundle]['description'] : '';\n $form['description'] = array(\n '#type' => 'textarea',\n '#title' => t('Description'),\n '#default_value' => $description,\n '#description' => t('Describe this bundle.'),\n );\n\n // Save entity type and bundle.\n $form['bundle_type'] = array(\n '#type' => 'value',\n '#value' => array(\n 'entity_type' => $entity_type,\n 'bundle' => $bundle,\n ),\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n return $form;\n}",
"function mongo_node_type_edit_form($form, $form_state, $entity_type) {\n $set = mongo_node_settings();\n $form = array();\n\n $form['label'] = array(\n '#type' => 'textfield',\n '#title' => t('Entity type'),\n '#default_value' => $set[$entity_type]['label'],\n '#description' => t('The human readable name of the entity.'),\n );\n\n $form['name'] = array(\n '#type' => 'machine_name',\n '#required' => FALSE,\n '#default_value' => $entity_type,\n '#machine_name' => array(\n 'exists' => '_mongo_node_type_exists',\n 'source' => array('label'),\n ),\n );\n\n // Send entity type.\n $form['entity_type'] = array(\n '#type' => 'value',\n '#value' => $entity_type,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n return $form;\n}",
"function VoterVote()\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\techo \"<table><form method='post'>\r\n\t\t\t\t\t\t <h3>Step 2:</b>Cast your ballot</h3>\r\n\t\t\t\t\t\t <p>In order to cast your vote, look up the candidate - TAN from your Voting-Tan-List you received.\\n Afterwards enter the Ballot-Cast-Tan from the other letter.</p>\r\n\t\t\t\t\t\t <tr><td>Voting-Tan:</td><td><input type='text' name='VotingTan' id='V' alt='Enter here the Voting-TAN'></td></tr>\r\n\t\t\t\t\t\t <tr><td>Ballot-Tan:</td><td><input type='text' name='BallotTan' id='B' alt='Enter here the Ballot-TAN'></td></tr>\r\n\t\t\t\t\t\t <tr><td></td><td><input type='button' onclick='CastVote()' value='Cast the ballot' alt='Click to cast the ballot'></td></tr>\r\n\t\t\t\t\t\t <tr></tr>\r\n\t\t\t\t\t </form></table>\";\r\n\t\t\t}",
"public function addVersioningFields(FormBuilderInterface $builder, array $options = []): void\n {\n \n $listEntries = $this->listHelper->getEntries('appSettings', 'revisionHandlingForPage');\n $choices = [];\n $choiceAttributes = [];\n foreach ($listEntries as $entry) {\n $choices[$entry['text']] = $entry['value'];\n $choiceAttributes[$entry['text']] = ['title' => $entry['title']];\n }\n $builder->add('revisionHandlingForPage', ChoiceType::class, [\n 'label' => $this->__('Revision handling for page') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('Adding a limitation to the revisioning will still keep the possibility to revert pages to an older version. You will loose the possibility to inspect changes done earlier than the oldest stored revision though.')\n ],\n 'help' => $this->__('Adding a limitation to the revisioning will still keep the possibility to revert pages to an older version. You will loose the possibility to inspect changes done earlier than the oldest stored revision though.'),\n 'empty_data' => 'unlimited',\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('Choose the revision handling for page.')\n ],\n 'required' => true,\n 'choices' => $choices,\n 'choice_attr' => $choiceAttributes,\n 'multiple' => false,\n 'expanded' => false\n ]);\n \n $listEntries = $this->listHelper->getEntries('appSettings', 'maximumAmountOfPageRevisions');\n $choices = [];\n $choiceAttributes = [];\n foreach ($listEntries as $entry) {\n $choices[$entry['text']] = $entry['value'];\n $choiceAttributes[$entry['text']] = ['title' => $entry['title']];\n }\n $builder->add('maximumAmountOfPageRevisions', ChoiceType::class, [\n 'label' => $this->__('Maximum amount of page revisions') . ':',\n 'empty_data' => '25',\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('Choose the maximum amount of page revisions.')\n ],\n 'required' => false,\n 'placeholder' => $this->__('Choose an option'),\n 'choices' => $choices,\n 'choice_attr' => $choiceAttributes,\n 'multiple' => false,\n 'expanded' => false\n ]);\n \n $builder->add('periodForPageRevisions', DateIntervalType::class, [\n 'label' => $this->__('Period for page revisions') . ':',\n 'empty_data' => 'P1Y0M0DT0H0M0S',\n 'attr' => [\n 'maxlength' => 255,\n 'class' => '',\n 'title' => $this->__('Choose the period for page revisions.')\n ],\n 'required' => false,\n 'labels' => [\n 'years' => $this->__('Years'),\n 'months' => $this->__('Months'),\n 'days' => $this->__('Days'),\n 'hours' => $this->__('Hours'),\n 'minutes' => $this->__('Minutes'),\n 'seconds' => $this->__('Seconds')\n ],\n 'placeholder' => [\n 'years' => $this->__('Years'),\n 'months' => $this->__('Months'),\n 'days' => $this->__('Days'),\n 'hours' => $this->__('Hours'),\n 'minutes' => $this->__('Minutes'),\n 'seconds' => $this->__('Seconds')\n ],\n 'input' => 'string',\n 'widget' => 'choice',\n 'with_years' => true,\n 'with_months' => true,\n 'with_weeks' => false,\n 'with_days' => true,\n 'with_hours' => true,\n 'with_minutes' => true,\n 'with_seconds' => true\n ]);\n \n $builder->add('showPageHistory', CheckboxType::class, [\n 'label' => $this->__('Show page history') . ':',\n 'label_attr' => [\n 'class' => 'tooltips',\n 'title' => $this->__('Whether to show the version history to editors or not.')\n ],\n 'help' => $this->__('Whether to show the version history to editors or not.'),\n 'attr' => [\n 'class' => '',\n 'title' => $this->__('The show page history option')\n ],\n 'required' => false,\n ]);\n }",
"function mongo_node_bundle_create_form($form, $form_state, $entity_type) {\n $form = array();\n\n $form['label'] = array(\n '#type' => 'textfield',\n '#title' => t('Entity type'),\n '#description' => t('The human readable name of the entity.'),\n );\n\n $form['name'] = array(\n '#type' => 'machine_name',\n '#required' => FALSE,\n '#machine_name' => array(\n 'exists' => '_mongo_node_bundle_exists',\n 'source' => array('label'),\n ),\n );\n\n $form['description'] = array(\n '#type' => 'textarea',\n '#title' => t('Description'),\n '#description' => t('Describe this bundle.'),\n );\n\n $form['entity_type'] = array(\n '#type' => 'value',\n '#value' => $entity_type,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n return $form;\n}",
"function mongo_node_form($form, &$form_state, $entity, $entity_type) {\n $form = array();\n\n $form_state['entity_type'] = $entity_type;\n if (!isset($form_state[$entity_type])) {\n $form_state[$entity_type] = $entity;\n }\n else {\n $entity = $form_state[$entity_type];\n }\n\n // Get title label name from properties if exists\n static $settings = array();\n if(empty($settings)) {\n $settings = mongo_node_settings();\n }\n $title = isset($settings[$entity_type]['properties']['title']['label']) ? $settings[$entity_type]['properties']['title']['label'] : t('Title');\n\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => $title,\n '#required' => TRUE,\n '#default_value' => isset($entity->title) ? $entity->title : '',\n );\n\n $form['#attributes']['class'][] = 'mongo-node-form';\n if (!empty($entity->type)) {\n // TODO -- add entity type with bundle.\n $form['#attributes']['class'][] = 'mongo-node-' . $entity->type . '-form';\n }\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n '#weight' => 5,\n '#submit' => array('mongo_node_form_submit'),\n );\n\n $form['#validate'][] = 'mongo_node_form_validate';\n field_attach_form($entity_type, $entity, $form, $form_state);\n\n return $form;\n}",
"function islandora_related_content_form_islandora_related_content_form_alter(&$form, &$formstate){\n $hooks = array();\n\n // Object\n $object = islandora_object_load($formstate['islandora']['object']);\n if(array_intersect(array('fedora-system:ContentModel-3.0'), $object->models))\n {\n unset($form['Add']);\n unset($form['View']);\n }\n\n\n\n // Related CModel\n $related_cmodel_id = $formstate['islandora']['cmodel'];\n $related_cmodel_types = islandora_cmodel_types($related_cmodel_id);\n\n $rcm_count = 0;\n // Iterate through array of types and make the function safe version of them.\n foreach($related_cmodel_types as $rcm){\n $rcm_str_replaced = str_replace(array(':', '.', '-'), '_', $rcm);\n $related_cmodel_types[$rcm_count] = $rcm_str_replaced;\n\n // Hook function string.\n $hook = \"form_islandora_related_{$rcm_str_replaced}_content_form\";\n drupal_alter($hook, $form, $formstate);\n $rcm_count++;\n }\n\n $object_models = islandora_object_models($object);\n\n // Iterate through the Object's CModels, making them function safe.\n foreach($object_models as $ocm){\n $object_cmodel = str_replace(array(':', '.', '-'), '_', $ocm);\n\n drupal_alter(\"form_islandora_{$object_cmodel}_related_content_form\", $form, $formstate);\n\n foreach($related_cmodel_types as $rcm){\n $hook = \"form_islandora_{$object_cmodel}_related_{$rcm}_content_form\";\n drupal_alter($hook, $form, $formstate);\n }\n }\n}",
"public function create2Action(Request $request)\n {\n $rdv=new Rdv();\n// $service=new Service();\n// $service->setName(\"lavage\");\n\n //prepare the form with the function: createForm()\n $form=$this->createForm(ReserveType::class,$rdv);\n //extract the form answer from the received request\n $form=$form->handleRequest($request);\n\n //if this form is valid\n if($form->isSubmitted() && $form->isValid()){\n $rdv->setStatus(\"nondisponible\");\n// $name_service = $rdv->getIdService();\n //create an entity manager object\n $em=$this->getDoctrine()->getManager();\n $form->getData();\n dump($rdv->getStatus());\n// $em=$this->getDoctrine()->getRepository(Rdv::class)->setStatus(\"nondisponible\");\n// $rdv->setStatus(\"nondisponible\");\n// $form->setStatus(\"nondisponible\");\n// $find=$this->getDoctrine()->getRepository(Rdv::class)->findBy($dateRdv);\n// $array_service = $em->getRepository(Service::class)->findByIdService($name_service);\n// if($array_service!=null)\n// {\n// $rdv->setIdService($array_service[0]);\n// $rdv->setService($array_service[0]);\n //persist the object $club in the ORM\n $em->persist($rdv);\n //update the data base with flush\n $em->flush();\n //redirect the route after the add\n// return $this->redirectToRoute('test');\n// >add('postedBy', HiddenType::class, array(\n// 'data' => $options['idservice']\n//$form = $this->createForm(NewsType::class, $news, array(\n// 'postedBy' => $this->getUser()->getFullname(),\n//);\n }\n return $this->render('@TaxiCo/Rdv/front.html.twig', array(\n 'form'=>$form->createView()\n ));\n }",
"public function form( $instance ) {\n\n $title = !empty($instance['title']) ? $instance['title'] : 'Related content';\n $limit = isset($instance['limit']) ? $instance['limit'] : -1;\n $type = isset($instance['type']) ? $instance['type'] : 'dataset';\n\t\t$template = isset($instance['template']) ? $instance['template'] : 'default';\n $max_height = isset($instance['max_height']) ? $instance['max_height'] : '200';\n\t\t?>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id('title');?>\"><?php _e('Title:');?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('title');?>\" name=\"<?php echo $this->get_field_name('title');?>\" type=\"text\" value=\"<?php _e($title,'odm');?>\">\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'type' ); ?>\"><?php _e( 'Select content type:' ); ?></label>\n\t\t\t<select class='widefat type' id=\"<?php echo $this->get_field_id('type'); ?>\" name=\"<?php echo $this->get_field_name('type'); ?>\" type=\"text\">\n\t\t\t\t<?php foreach ( $this->types as $key => $available_type ): ?>\n\t\t\t\t\t<option <?php if ($type == $available_type[\"label\"]) { echo \" selected\"; } ?> value=\"<?php echo $key ?>\"><?php echo $available_type[\"label\"] ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p>\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'template' ); ?>\"><?php _e( 'Select layout:' ); ?></label>\n\t\t\t<select class='widefat template' id=\"<?php echo $this->get_field_id('template'); ?>\" name=\"<?php echo $this->get_field_name('template'); ?>\" type=\"text\">\n\t\t\t\t<?php\n $current_type = $this->types[$type];\n foreach ( $current_type[\"templates\"] as $key => $available_template ): ?>\n\t\t\t\t\t<option <?php if ($template == $available_template) { echo \" selected\"; } ?> value=\"<?php echo $available_template ?>\"><?php echo $available_template ?></option>\n\t\t\t\t<?php endforeach; ?>\n\t\t\t</select>\n\t\t</p>\n\t\t<?php $limit = !empty($instance['limit']) ? $instance['limit'] : -1 ?>\n\t\t<p class=\"<?php echo $this->get_field_id('limit');?>\">\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'limit' ); ?>\"><?php _e( 'Select max number of posts to list (-1 to show all):' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('limit');?>\" name=\"<?php echo $this->get_field_name('limit');?>\" type=\"number\" value=\"<?php echo $limit;?>\">\n\t\t</p>\n\t\t\t<?php $max_height = !empty($instance['max_height']) ? $instance['max_height'] : '200' ?>\n\t\t<p class=\"<?php echo $this->get_field_id('max_height');?>\">\n\t\t\t<label for=\"<?php echo $this->get_field_id( 'max_height' ); ?>\"><?php _e( 'Define the max height of container:' ); ?></label>\n\t\t\t<input class=\"widefat\" id=\"<?php echo $this->get_field_id('max_height');?>\" name=\"<?php echo $this->get_field_name('max_height');?>\" type=\"number\" value=\"<?php echo $max_height;?>\">\n\t\t</p>\n\n\t\t<script type=\"text/javascript\">\n\t\t\tjQuery(function($) {\n\t\t\t\tvar $select_template = \"<?php echo $this->get_field_id('template'); ?>\";\n\t\t\t\tdisplay_max_height();\n\t\t\t\t$('#'+$select_template).change(function(){\n\t\t\t\t\tdisplay_max_height();\n\t\t\t\t});\n\n\t\t\t\tfunction display_max_height (){\n\t\t\t\t\tvar $p_limit = \"<?php echo $this->get_field_id('limit');?>\";\n\t\t\t\t\tvar $p_max_height = \"<?php echo $this->get_field_id('max_height');?>\";\n\t\t\t\t\tif($('#'+$select_template).val() == \"html\"){\n\t\t\t\t\t\t$('.'+$p_limit).hide();\n\t\t\t\t\t\t$('.'+$p_max_height).show();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$('.'+$p_limit).show();\n\t\t\t\t\t\t$('.'+$p_max_height).hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t </script>\n\n\t\t<?php\n\t}",
"public function initialize($entity = null, $options = null)\n {\n if (isset($options['edit']) && $options['edit']) {\n $id = new Hidden('id');\n } else {\n $id = new Text('id');\n }\n\n $this->add($id);\n\n // //id reseller\n // $id_reseller= new Text('id_reseller', [\n // 'placeholder' => 'Id Reseller'\n // ]);\n //\n // $id_reseller->setLabel('Reseller');\n // // $id_reseller->addValidators([\n // // new PresenceOf([\n // // 'message' => 'Id Reseller is required'\n // // ])\n // // ]);\n // $this->add($id_reseller);\n\n //nama agen\n $nama_agen = new Text('nama_agen', [\n 'placeholder' => 'Nama Agen'\n ]);\n\n $nama_agen->setLabel('Nama Agen');\n\n $nama_agen->addValidators([\n new PresenceOf([\n 'message' => 'Nama Agen is required'\n ])\n ]);\n\n $this->add($nama_agen);\n\n\n //merk\n $merk = new Text('merk', [\n 'placeholder' => 'Merk'\n ]);\n\n $merk->setLabel('Merk');\n $merk->addValidators([\n new PresenceOf([\n 'message' => 'Merk is required'\n ])\n ]);\n\n $this->add($merk);\n\n\n //serial number\n $serial_number = new Text('serial_number', [\n 'placeholder' => 'Serial Number'\n ]);\n\n $serial_number->setLabel('Serial Number');\n $serial_number->addValidators([\n new PresenceOf([\n 'message' => 'Serial Number is required'\n ])\n ]);\n\n $this->add($serial_number);\n\n\n //lokasi\n $lokasi = new Text('lokasi', [\n 'placeholder' => 'Lokasi'\n ]);\n\n $lokasi->setLabel('Lokasi');\n $lokasi->addValidators([\n new PresenceOf([\n 'message' => 'Lokasi is required'\n ])\n ]);\n\n $this->add($lokasi);\n\n\n //alamat\n $alamat = new Text('alamat', [\n 'placeholder' => 'Alamat'\n ]);\n\n $alamat->setLabel('Alamat');\n $alamat->addValidators([\n new PresenceOf([\n 'message' => 'Alamat is required'\n ])\n ]);\n\n $this->add($alamat);\n\n // Save\n $this->add(new Submit('Save', [\n 'class' => 'btn btn-success',\n 'id'=> 'submit'\n ]));\n\n // Save\n $this->add(new Submit('Search', [\n 'class' => 'btn btn-success',\n 'id'=> 'submit'\n ]));\n\n //id_doctor\n $findreseller = Users::find([\"profilesId = '5'\"]);\n $id_reseller = new Select('id_reseller', $findreseller, [\n 'using' => [\n 'id',\n 'name'\n ],\n 'useEmpty' => true,\n 'emptyText' => '----Select Reseller----',\n 'emptyValue' => ''\n ]);\n $id_reseller->setLabel('Reseller *');\n $this->add($id_reseller);\n\n }",
"public function edit(Price $price)\n {\n //\n }"
] |
[
"0.54787713",
"0.54379183",
"0.5366913",
"0.5366913",
"0.52219754",
"0.51439965",
"0.5115387",
"0.5080923",
"0.505851",
"0.49843076",
"0.49732405",
"0.49355572",
"0.49202976",
"0.48252505",
"0.48140332",
"0.48010814",
"0.47893086",
"0.4786434",
"0.47717184",
"0.47531012",
"0.47464147",
"0.47307533",
"0.47281963",
"0.4720965",
"0.4708865",
"0.469468",
"0.46816882",
"0.4675056",
"0.46612647",
"0.46548054"
] |
0.6509009
|
0
|
Get's a category by it's ID
|
public function get($category_id);
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getCategory(int $id)\n {\n }",
"public function getCategory($id) {\n\t\treturn $this->query ( \"SELECT * FROM categorie WHERE cat_id = $id\" );\n\t}",
"public function getCategoryById($id){ //print_r($id); die;\n $query = $this->db->get_where('category',array('id' => $id));\n return $query->row(); // print_r($query);\n }",
"public function retrieveCategory($id) {\n return $this->categoriesDB->retrieveByCategoryId($id);\n }",
"public function getCategory($id){\n $category = Product::find($id)->category_id;\n return $category;\n }",
"function _get_cat($id) {\r\n $qry = $this->db->where('cat_id', $id)\r\n ->get($this->_cat);\r\n return $qry->row();\r\n }",
"public function actionGet($id) {\n\t\treturn $this->txget ( $id, \"app\\models\\Category\" );\n\t}",
"static function get_category_by_id($category){\n\t\treturn self::$db->where('id',$category)->get('categories')->results();\n\t}",
"public function getCategoryById($id)\n\t{\n\t\treturn $this->find($id);\n\t}",
"public static function getCategory($id)\n {\n \t$query = \"SELECT * FROM categories WHERE id = :id\";\n \t$result = DB::select($query, ['id' => $id]);\n\n \treturn $result;\n }",
"public function getCategoryById($id)\n {\n return Category::findOrFail($id);\n }",
"public function getCategoryById($id) {\n $query = \"SELECT * FROM \" . self::$TABLE . \" WHERE id = $id LIMIT 1\";\n $resultSet = parent::executeQuery($query);\n \n $array = $this->getRecordAsArray($resultSet);\n return $this->arrayToObject($array);\n }",
"function getCategory($id_category){\n $db = db();\n $db->begin();\n $data = $db->exec('SELECT * FROM m_song WHERE fk_id_category = '.$id_category);\n\n return $data;\n }",
"function get_category_by_id($cate_id) {\n App::import(\"Model\", \"Category\");\n $model = new Category();\n $categoryInfo = $model->findById($cate_id);\n return $categoryInfo['Category']['title'];\n }",
"function get_by_cat($id)\n {\n $this->db->where('cat_id', $id);\n return $this->db->get($this->table)->result();\n }",
"public function find($id)\n {\n return Category::findOrFail($id);\n }",
"public function show($id)\n {\n return Category::find($id);\n }",
"public function show($id)\n {\n return Category::find($id);\n }",
"public function getCategory($id){\n\t\t\t$q = $this->mysqlRow('SELECT * FROM `'.$GLOBALS['db']['db_prefix'].'category` WHERE c_id=\"'.mysql_real_escape_string($id).'\"');\n\t\t\tif($q != ''){\n\t\t\t\treturn new CatCategory($q['c_id'], $q['name'], $q['webname'], $q['status'], $q['desc'], $q['img'], $q['service_root']);\n\t\t\t} else return null;\n\t\t}",
"function find_category($db, $id){\n\n\t$ID_cat = (int)$id;\n\n\t$sql = \"SELECT * FROM categories WHERE ID_cat = $ID_cat\";\n\n\t$category = mysqli_query($db, $sql);\n\n\t$result = mysqli_fetch_assoc($category);\n\n\treturn $result;\n}",
"public function show($id)\n {\n return $this->category->find($id);\n }",
"function get_category_by_id($category_id)\n\t\t{\n\t\t\tif(!$category_id)\n\t\t\t\treturn \"\";\n\t\t\t$query = \" SELECT id,name,name_display,is_comment, alias, display_tags,display_title,display_sharing,display_comment,display_category,display_created_time,display_related,updated_time\n\t\t\t\t\t\tFROM \".$this->table_category .\" \n\t\t\t\t\t\tWHERE id = $category_id \";\n\t\t\tglobal $db;\n\t\t\t$sql = $db->query($query);\n\t\t\t$result = $db->getObject();\n\t\t\treturn $result;\n\t\t}",
"function get_category_by_id($cate_id) {\n App::import(\"Model\", \"Category\");\n $model = new Category();\n $categoryInfo = $model->findById($cate_id);\n return (!empty($categoryInfo['Category']['title']))?$categoryInfo['Category']['title']:\"\";\n }",
"public static function getCategoryById($id) {\n self::checkConnection();\n settype($id, 'integer');\n $sql = sprintf(\"SELECT * FROM category WHERE id = %d\", $id);\n $results = self::$connection->execute($sql);\n if (count($results) >= 1) {\n return new Category($results[0]);\n } else {\n return null;\n }\n }",
"public function show($id)\n {\n return $this->categoryService->getCategory($id);\n }",
"public function findCategoryById($id)\n {\n $category = Category::select('id', 'name')\n ->with([\n 'bookshelf' => function($q) {\n $q->select('id', 'name', 'category_id');\n }\n ])\n ->where('id', $id)\n ->first();\n\n // return data yang di cari\n return $category;\n }",
"public function findByIdWithCategory($id);",
"public function show($id) {\n $cat = Category::find($id);\n }",
"public function category_by_id($id)\n {\n $query = \"SELECT *\n FROM \" . $this->db_table_prefix . \"categories\n \t WHERE id = $id\";\n $result = $this->commonDatabaseAction($query);\n// if (mysql_num_rows($result) > 0)\n if ($this->rowCount > 0)\n {\n// return mysql_fetch_assoc($result);\n return $this->sqlAssoc;\n }\n else\n {\n return array();\n }\n }",
"public function findById($id)\n\t{\n\t\t$id = intval($id);\n\t\t$query = \"SELECT * FROM category WHERE id = \".$id;\n\n\t\t$result = $this->database->query($query);\n\t\tif ( $result )\n\t\t{\n\t\t\t$category = $result->fetchObject(\"Category\", array($this->database));\n\t\t\tif ( $category )\n\t\t\t{\n\t\t\t\treturn $category;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Catégorie introuvable.\");\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Erreur - Base de données.\");\n\t\t}\n\t}"
] |
[
"0.831528",
"0.815478",
"0.8076016",
"0.8030953",
"0.8029721",
"0.7989801",
"0.79873145",
"0.79703295",
"0.7863992",
"0.78259456",
"0.7785587",
"0.77702606",
"0.7758154",
"0.7732127",
"0.7731799",
"0.769028",
"0.76718855",
"0.76718855",
"0.7644957",
"0.7634002",
"0.76294965",
"0.7619523",
"0.7616777",
"0.75748616",
"0.7567849",
"0.75614417",
"0.75550044",
"0.7535132",
"0.7532074",
"0.75080156"
] |
0.83462447
|
0
|
Extracts all phrases from trans directives in the given string.
|
private function extractPhrasesFromTransDirective(string $data): void
{
$results = [];
preg_match_all(Filter::CONSTRUCTION_PATTERN, $data, $results, PREG_SET_ORDER);
for ($i = 0, $count = count($results); $i < $count; $i++) {
if ($results[$i][1] === Filter::TRANS_DIRECTIVE_NAME) {
$directive = [];
if (preg_match(Filter::TRANS_DIRECTIVE_REGEX, $results[$i][2], $directive) !== 1) {
continue;
}
$quote = $directive[1];
$this->_addPhrase($quote . $directive[2] . $quote);
} elseif (in_array($results[$i][1], ['depend', 'if'], true) && isset($results[$i][3])) {
// make sure to process trans directives nested inside depend / if directives
$this->extractPhrasesFromTransDirective($results[$i][3]);
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function get_phrases_list($string) {\n $result = array();\n // create our dom\n $this->html = str_get_html('<span lang=\"xx\">' . $string . '</span>');\n // mark translateable elements\n $this->translate_tagging($this->html->root);\n foreach ($this->html->nodes as $ep) {\n if ($ep->tag == 'phrase') {\n $result[$ep->phrase] = $ep->phrase;\n }\n }\n return $result;\n }",
"public function getPhrases()\r\n\t{\r\n\t\tif (!$this->initiated)\r\n\t\t\t$this->init();\r\n\t\treturn $this->phrases;\r\n\t}",
"private function extractGettextStrings()\n {\n $translation = null;\n $translationObjects = array();\n $lookupDirectories = array(\n Strata::getVendorPath() . 'strata-mvc' . DIRECTORY_SEPARATOR . 'strata' . DIRECTORY_SEPARATOR . 'src',\n Strata::getSrcPath(),\n Strata::getThemesPath(),\n );\n\n foreach ($lookupDirectories as $directory) {\n $translationObjects = $this->recurseThroughDirectory($directory);\n\n // Merge all translation objects into a bigger one\n foreach ($translationObjects as $t) {\n if (is_null($translation)) {\n $translation = $t;\n } else {\n $translation->mergeWith($t);\n }\n }\n }\n\n return $translation;\n }",
"public function phrases()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_phrase->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_phrase_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_phrase_vars($vars);\n\n return ee()->load->view('phrase/index', $vars, TRUE);\n }",
"protected function getPassPhrases() {\n\t\tif(!isset($this->passPhrases)) {\n\t\t\t$this->passPhrases = array();\n\t\t}\n\t\treturn $this->passPhrases;\n\t}",
"public function extractTextFromString($string) {\n $config = new Config();\n $config->setHorizontalOffset(\"\");\n $config->setFontSpaceLimit(-60);\n $parser = new \\Smalot\\PdfParser\\Parser([], $config);\n $pdf = $parser->parseContent($string);\n $text = $pdf->getText();\n return preg_replace(\"/\\r|\\n|\\t/\", \"\", $text);\n }",
"public function extract()\n {\n $this->_strings = array();\n \n $skip_tokens = array('*');\n \n foreach ($this->_routes as $route)\n {\n /* @var $route sfRoute */\n $pattern = $route->getPattern();\n foreach ($route->getTokens() as $token)\n {\n if ($token[0] == 'text' && !in_array($token[2], $skip_tokens))\n {\n $this->_strings[] = $token[2];\n }\n }\n }\n \n return $this->_strings;\n }",
"public function getValidationPhrases() : array;",
"protected function extract_strings() {\n\t\t$translations = new Translations();\n\n\t\t// Add existing strings first but don't keep headers.\n\t\tif ( ! empty( $this->merge ) ) {\n\t\t\t$existing_translations = new Translations();\n\t\t\tPo::fromFile( $this->merge, $existing_translations );\n\t\t\t$translations->mergeWith( $existing_translations, Merge::ADD | Merge::REMOVE );\n\t\t}\n\n\t\tPotGenerator::setCommentBeforeHeaders( $this->get_file_comment() );\n\n\t\t$this->set_default_headers( $translations );\n\n\t\t// POT files have no Language header.\n\t\t$translations->deleteHeader( Translations::HEADER_LANGUAGE );\n\n\t\t// Only relevant for PO files, not POT files.\n\t\t$translations->setHeader( 'PO-Revision-Date', 'YEAR-MO-DA HO:MI+ZONE' );\n\n\t\tif ( $this->domain ) {\n\t\t\t$translations->setDomain( $this->domain );\n\t\t}\n\n\t\tunset( $this->main_file_data['Version'], $this->main_file_data['License'], $this->main_file_data['Domain Path'], $this->main_file_data['Text Domain'] );\n\n\t\t$is_theme = isset( $this->main_file_data['Theme Name'] );\n\n\t\t// Set entries from main file data.\n\t\tforeach ( $this->main_file_data as $header => $data ) {\n\t\t\tif ( empty( $data ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$translation = new Translation( '', $data );\n\n\t\t\tif ( $is_theme ) {\n\t\t\t\t$translation->addExtractedComment( sprintf( '%s of the theme', $header ) );\n\t\t\t} else {\n\t\t\t\t$translation->addExtractedComment( sprintf( '%s of the plugin', $header ) );\n\t\t\t}\n\n\t\t\t$translations[] = $translation;\n\t\t}\n\n\t\ttry {\n\t\t\tif ( ! $this->skip_php ) {\n\t\t\t\t$options = [\n\t\t\t\t\t// Extract 'Template Name' headers in theme files.\n\t\t\t\t\t'wpExtractTemplates' => $is_theme,\n\t\t\t\t\t// Extract 'Title' and 'Description' headers from pattern files.\n\t\t\t\t\t'wpExtractPatterns' => $is_theme,\n\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t'extensions' => [ 'php' ],\n\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t];\n\t\t\t\tPhpCodeExtractor::fromDirectory( $this->source, $translations, $options );\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_blade ) {\n\t\t\t\t$options = [\n\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t'extensions' => [ 'blade.php' ],\n\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t];\n\t\t\t\tBladeCodeExtractor::fromDirectory( $this->source, $translations, $options );\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_js ) {\n\t\t\t\tJsCodeExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'js', 'jsx' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\n\t\t\t\tMapCodeExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'map' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_block_json ) {\n\t\t\t\tBlockExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'schema' => JsonSchemaExtractor::BLOCK_JSON_SOURCE,\n\t\t\t\t\t\t'schemaFallback' => JsonSchemaExtractor::BLOCK_JSON_FALLBACK,\n\t\t\t\t\t\t// Only look for block.json files, nothing else.\n\t\t\t\t\t\t'restrictFileNames' => [ 'block.json' ],\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'json' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( ! $this->skip_theme_json ) {\n\t\t\t\t// This will look for the top-level theme.json file, as well as\n\t\t\t\t// any JSON file within the top-level styles/ directory.\n\t\t\t\tThemeJsonExtractor::fromDirectory(\n\t\t\t\t\t$this->source,\n\t\t\t\t\t$translations,\n\t\t\t\t\t[\n\t\t\t\t\t\t'schema' => JsonSchemaExtractor::THEME_JSON_SOURCE,\n\t\t\t\t\t\t'schemaFallback' => JsonSchemaExtractor::THEME_JSON_FALLBACK,\n\t\t\t\t\t\t'include' => $this->include,\n\t\t\t\t\t\t'exclude' => $this->exclude,\n\t\t\t\t\t\t'extensions' => [ 'json' ],\n\t\t\t\t\t\t'addReferences' => $this->location,\n\t\t\t\t\t]\n\t\t\t\t);\n\t\t\t}\n\t\t} catch ( \\Exception $e ) {\n\t\t\tWP_CLI::error( $e->getMessage() );\n\t\t}\n\n\t\tforeach ( $this->exceptions as $file => $exception_translations ) {\n\t\t\t/** @var Translation $exception_translation */\n\t\t\tforeach ( $exception_translations as $exception_translation ) {\n\t\t\t\tif ( ! $translations->find( $exception_translation ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->subtract_and_merge ) {\n\t\t\t\t\t$translation = $translations[ $exception_translation->getId() ];\n\t\t\t\t\t$exception_translation->mergeWith( $translation );\n\t\t\t\t}\n\n\t\t\t\tunset( $translations[ $exception_translation->getId() ] );\n\t\t\t}\n\n\t\t\tif ( $this->subtract_and_merge ) {\n\t\t\t\tPotGenerator::toFile( $exception_translations, $file );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! $this->skip_audit ) {\n\t\t\t$this->audit_strings( $translations );\n\t\t}\n\n\t\treturn $translations;\n\t}",
"public function getTranslationsArray() {\r\n\t\treturn preg_split('#/#', $this->translation, null, PREG_SPLIT_NO_EMPTY);\r\n\t}",
"function ParseTagString($sTagString)\n{\n\t$arTags = array();\t\t// Array of Output\n\t$cPhraseQuote = null;\t// Record of the quote that opened the current phrase\n\t$sPhrase = null;\t\t// Temp storage for the current phrase we are building\n\t\n\t// Define some constants\n\tstatic $sTokens = \" \\r\\n\\t\";\t// Space, Return, Newline, Tab\n\tstatic $sQuotes = \"'\\\"\";\t\t// Single and Double Quotes\n\t\n\t// Start the State Machine\n\tdo\n\t{\n\t\t// Get the next token, which may be the first\n\t\t$sToken = isset($sToken)? strtok($sTokens) : strtok($sTagString, $sTokens);\n\t\t\n\t\t// Are there more tokens?\n\t\tif ($sToken === false)\n\t\t{\n\t\t\t// Ensure that the last phrase is marked as ended\n\t\t\t$cPhraseQuote = null;\n\t\t}\n\t\telse\n\t\t{\t\t\n\t\t\t// Are we within a phrase or not?\n\t\t\tif ($cPhraseQuote !== null)\n\t\t\t{\n\t\t\t\t// Will the current token end the phrase?\n\t\t\t\tif (substr($sToken, -1, 1) === $cPhraseQuote)\n\t\t\t\t{\n\t\t\t\t\t// Trim the last character and add to the current phrase, with a single leading space if necessary\n\t\t\t\t\tif (strlen($sToken) > 1) $sPhrase .= ((strlen($sPhrase) > 0)? ' ' : null) . substr($sToken, 0, -1);\n\t\t\t\t\t$cPhraseQuote = null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// If not, add the token to the phrase, with a single leading space if necessary\n\t\t\t\t\t$sPhrase .= ((strlen($sPhrase) > 0)? ' ' : null) . $sToken;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Will the current token start a phrase?\n\t\t\t\tif (strpos($sQuotes, $sToken[0]) !== false)\n\t\t\t\t{\n\t\t\t\t\t// Will the current token end the phrase?\n\t\t\t\t\tif ((strlen($sToken) > 1) && ($sToken[0] === substr($sToken, -1, 1)))\n\t\t\t\t\t{\n\t\t\t\t\t\t// The current token begins AND ends the phrase, trim the quotes\n\t\t\t\t\t\t$sPhrase = substr($sToken, 1, -1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Remove the leading quote\n\t\t\t\t\t\t$sPhrase = substr($sToken, 1);\n\t\t\t\t\t\t$cPhraseQuote = $sToken[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$sPhrase = $sToken;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// If, at this point, we are not within a phrase, the prepared phrase is complete and can be added to the array\n\t\tif (($cPhraseQuote === null) && ($sPhrase != null))\n\t\t{\n\t\t\t$sPhrase = strtolower($sPhrase);\n\t\t\tif (!in_array($sPhrase, $arTags)) $arTags[] = $sPhrase;\n\t\t\t$sPhrase = null;\n\t\t}\n\t}\n\twhile ($sToken !== false);\t// Stop when we receive FALSE from strtok()\n\treturn $arTags;\n}",
"protected function audit_strings( $translations ) {\n\t\tforeach ( $translations as $translation ) {\n\t\t\t/** @var Translation $translation */\n\n\t\t\t$references = $translation->getReferences();\n\n\t\t\t// File headers don't have any file references.\n\t\t\t$location = $translation->hasReferences() ? '(' . implode( ':', $references[0] ) . ')' : '';\n\n\t\t\t// Check 1: Flag strings with placeholders that should have translator comments.\n\t\t\tif (\n\t\t\t\t! $translation->hasExtractedComments() &&\n\t\t\t\tpreg_match( self::SPRINTF_PLACEHOLDER_REGEX, $translation->getOriginal(), $placeholders ) >= 1\n\t\t\t) {\n\t\t\t\t$message = sprintf(\n\t\t\t\t\t'The string \"%1$s\" contains placeholders but has no \"translators:\" comment to clarify their meaning. %2$s',\n\t\t\t\t\t$translation->getOriginal(),\n\t\t\t\t\t$location\n\t\t\t\t);\n\t\t\t\tWP_CLI::warning( $message );\n\t\t\t}\n\n\t\t\t// Check 2: Flag strings with different translator comments.\n\t\t\tif ( $translation->hasExtractedComments() ) {\n\t\t\t\t$comments = $translation->getExtractedComments();\n\n\t\t\t\t// Remove plugin header information from comments.\n\t\t\t\t$comments = array_filter(\n\t\t\t\t\t$comments,\n\t\t\t\t\tfunction ( $comment ) {\n\t\t\t\t\t\t/** @var ParsedComment|string $comment */\n\t\t\t\t\t\t/** @var string $file_header */\n\t\t\t\t\t\tforeach ( $this->get_file_headers( $this->project_type ) as $file_header ) {\n\t\t\t\t\t\t\tif ( 0 === strpos( ( $comment instanceof ParsedComment ? $comment->getComment() : $comment ), $file_header ) ) {\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn $comment;\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t$unique_comments = array();\n\n\t\t\t\t// Remove duplicate comments.\n\t\t\t\t$comments = array_filter(\n\t\t\t\t\t$comments,\n\t\t\t\t\tfunction ( $comment ) use ( &$unique_comments ) {\n\t\t\t\t\t\t/** @var ParsedComment|string $comment */\n\t\t\t\t\t\tif ( in_array( ( $comment instanceof ParsedComment ? $comment->getComment() : $comment ), $unique_comments, true ) ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$unique_comments[] = ( $comment instanceof ParsedComment ? $comment->getComment() : $comment );\n\n\t\t\t\t\t\treturn $comment;\n\t\t\t\t\t}\n\t\t\t\t);\n\n\t\t\t\t$comments_count = count( $comments );\n\n\t\t\t\tif ( $comments_count > 1 ) {\n\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\"The string \\\"%1\\$s\\\" has %2\\$d different translator comments. %3\\$s\\n%4\\$s\",\n\t\t\t\t\t\t$translation->getOriginal(),\n\t\t\t\t\t\t$comments_count,\n\t\t\t\t\t\t$location,\n\t\t\t\t\t\timplode( \"\\n\", $unique_comments )\n\t\t\t\t\t);\n\t\t\t\t\tWP_CLI::warning( $message );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$non_placeholder_content = trim( preg_replace( '`^([\\'\"])(.*)\\1$`Ds', '$2', $translation->getOriginal() ) );\n\t\t\t$non_placeholder_content = preg_replace( self::SPRINTF_PLACEHOLDER_REGEX, '', $non_placeholder_content );\n\n\t\t\t// Check 3: Flag empty strings without any translatable content.\n\t\t\tif ( '' === $non_placeholder_content ) {\n\t\t\t\t$message = sprintf(\n\t\t\t\t\t'Found string without translatable content. %s',\n\t\t\t\t\t$location\n\t\t\t\t);\n\t\t\t\tWP_CLI::warning( $message );\n\t\t\t}\n\n\t\t\t// Check 4: Flag strings with multiple unordered placeholders (%s %s %s vs. %1$s %2$s %3$s).\n\t\t\t$unordered_matches_count = preg_match_all( self::UNORDERED_SPRINTF_PLACEHOLDER_REGEX, $translation->getOriginal(), $unordered_matches );\n\t\t\t$unordered_matches = $unordered_matches[0];\n\n\t\t\tif ( $unordered_matches_count >= 2 ) {\n\t\t\t\t$message = sprintf(\n\t\t\t\t\t'Multiple placeholders should be ordered. %s',\n\t\t\t\t\t$location\n\t\t\t\t);\n\t\t\t\tWP_CLI::warning( $message );\n\t\t\t}\n\n\t\t\tif ( $translation->hasPlural() ) {\n\t\t\t\tpreg_match_all( self::SPRINTF_PLACEHOLDER_REGEX, $translation->getOriginal(), $single_placeholders );\n\t\t\t\t$single_placeholders = $single_placeholders[0];\n\n\t\t\t\tpreg_match_all( self::SPRINTF_PLACEHOLDER_REGEX, $translation->getPlural(), $plural_placeholders );\n\t\t\t\t$plural_placeholders = $plural_placeholders[0];\n\n\t\t\t\t// see https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#plurals\n\t\t\t\tif ( count( $single_placeholders ) < count( $plural_placeholders ) ) {\n\t\t\t\t\t// Check 5: Flag things like _n( 'One comment', '%s Comments' )\n\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t'Missing singular placeholder, needed for some languages. See https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#plurals %s',\n\t\t\t\t\t\t$location\n\t\t\t\t\t);\n\t\t\t\t\tWP_CLI::warning( $message );\n\t\t\t\t} else {\n\t\t\t\t\t// Reordering is fine, but mismatched placeholders is probably wrong.\n\t\t\t\t\tsort( $single_placeholders );\n\t\t\t\t\tsort( $plural_placeholders );\n\n\t\t\t\t\t// Check 6: Flag things like _n( '%s Comment (%d)', '%s Comments (%s)' )\n\t\t\t\t\tif ( $single_placeholders !== $plural_placeholders ) {\n\t\t\t\t\t\t$message = sprintf(\n\t\t\t\t\t\t\t'Mismatched placeholders for singular and plural string. %s',\n\t\t\t\t\t\t\t$location\n\t\t\t\t\t\t);\n\t\t\t\t\t\tWP_CLI::warning( $message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function translateTags($s)\n{\n\tpreg_match_all($this->TAG_PATTERN, $s, $tags, PREG_SET_ORDER);\n\tif (!$tags) return $s;\n\tforeach($tags as $tag) {\n\t\t$trans[$tag[0]] = $this->translate($tag[1]);\n\t}\n\treturn strtr($s, $trans);\n}",
"function variables_from_string($markup) {\r\n\t\t$regexp = new LiquidRegexp('/\\s*('.LIQUID_QUOTED_FRAGMENT.')\\s*/');\r\n\t\t$parts = explode(',', $markup);\r\n\t\t$result = array();\r\n\t\t\r\n\t\tforeach($parts as $part) {\r\n\t\t\t$regexp->match($part);\r\n\t\t\t\r\n\t\t\tif ($regexp->matches[1]) {\r\n\t\t\t\t$result[] = $regexp->matches[1];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t\t\r\n\t}",
"function smarty_modifier_translate($string) {\n return Zend_Registry::get('Zend_Translate')->_($string);\n }",
"function getTranslationString($str) {\n\t\treturn $this->getArrayValue($this->translationStrings, $str);\n\t}",
"public function interpolateTalesVarsInString($string)\n {\n return PHPTAL_Php_TalesInternal::parseString($string, false, ($this->getTalesMode() === 'tales') ? '' : 'php:' );\n }",
"public function translate($string)\n {\n return call_user_func_array([$this->translator, 'translate'], func_get_args());\n }",
"function getPhrases($segs, $find, $ps){\n\t\t $pHTML=0;$phrases=array();\n\t\t for ($i = 0; $i < count($segs); $i++) {\n\t\t \t//vérifie si on traite le premier élément\n\t\t\t\tif($i==0){\n\t\t\t\t\t//on récupère le début de la phrase\n\t\t\t\t\t$deb = $this->cutStr($segs[$i],$this->nbCaract,\"\",\"dg\");\n\t\t\t\t\t//dans le cas d'un termPositions c'est lucène qui calcule la position\n\t\t\t\t\tif($find)$p = -1; else $p = $ps[$i];\n\t\t\t\t\t//on récupère la position manuelle \t\n\t\t\t\t\t$pHTML += strlen($segs[$i]);\n\t\t\t\t\t//on récupère le mot trouvé\n\t\t\t\t\t$FinFind = strpos($segs[$i+1], \"</find>\");\n\t\t\t\t\t$mot = substr($segs[$i+1], 0, $FinFind);\n\t\t\t\t\t//on récupère la fin de la phrase\n\t\t\t\t\t$fin = $this->cutStr(substr($segs[$i+1], $FinFind),$this->nbCaract,\"\");\n\t\t\t\t}else{\n\t\t\t\t\t//on récupère le début de la phrase\n\t\t\t\t\t$deb = $this->cutStr($segs[$i-1],$this->nbCaract,\"\",\"dg\");\n\t\t\t\t\tif($find)$p = -1; else $p = $ps[$i-1];\n\t\t\t\t\t//on récupère le mot trouvé\n\t\t\t\t\t$FinFind = strpos($segs[$i], \"</find>\");\n\t\t\t\t\t$mot = substr($segs[$i], 0, $FinFind);\n\t\t\t\t\t//on calcule la position manuelle\n\t\t\t\t\t$pHTML += strlen($mot)+strlen($segs[$i-1]);\n\t\t\t\t\t//on récupère la fin de la phrase\n\t\t\t\t\t$fin = $this->cutStr(substr($segs[$i], $FinFind),$this->nbCaract,\"\");\n\t\t\t\t\t//on supprime le find du segment\n\t\t\t\t\t$segs[$i] = substr($segs[$i], $find);\n\t\t\t\t}\n\t\t\t\t\n\t \t\t$phrases[] = array(\"p\"=>$p, \"pHTML\"=> $pHTML, \"deb\"=> $deb,\"fin\"=> $fin,\"mot\"=> $mot);\n\t \t\t$i++;\n\t\t\t\t\n\t\t }\n\t\treturn $phrases;\n\t}",
"public function getStrings ()\n {\n return $this->translate;\n }",
"function splitPhrase($texte){\r\n //le regex signifie tt ce qui commence par une lettre minuscule ou majuscule suivi\r\n //de tt autre caractere different de . ? et ! ou de . suivi de chiffre 0 ou plusieurs fois\r\n //termine par . ! ou ?\r\n $tableau = [];\r\n preg_match_all('#[A-Za-z]([^.!?]|[.][0-9])*[.!?]#',$texte,$texteCoup);\r\n $lesPhrases = $texteCoup[0];\r\n foreach($lesPhrases as $phrase){\r\n $phrase=trim($phrase);\r\n //les expessions qu'on doit remplacer\r\n $regex=['#[ ]+#', '#[ ]?[\\'][ ]?#', '#[ ]?[,]#', '#[ ]?[;][ ]?#', '#[(][ ]+#','#[ ]+[)]#',\r\n '#[ ]+[.]#', '#[ ][?]#', '#[ ][!]#'];\r\n //leurs remplacants\r\n $remplace=[' ', \"'\", \", \", \"; \",\"(\", \")\", \".\", \"?\", \"!\"];\r\n for($j=0;$j<laTaille($regex);$j++){\r\n $phrase = preg_replace($regex[$j],$remplace[$j],$phrase);\r\n }\r\n $phrase=ucfirst($phrase);\r\n if(laTaille($phrase)<=200){\r\n $tableau[]=$phrase;\r\n } \r\n }\r\n return $tableau;\r\n}",
"protected function get_translations_array( \\PostFinanceCheckout\\Sdk\\Model\\DatabaseTranslatedString $translated_string ) {\n\t\t$translations = array();\n\t\tforeach ( $translated_string->getItems() as $item ) {\n\t\t\t$translation = $item->getTranslation();\n\t\t\tif ( ! empty( $translation ) ) {\n\t\t\t\t$translations[ $item->getLanguage() ] = $item->getTranslation();\n\t\t\t}\n\t\t}\n\n\t\treturn $translations;\n\t}",
"public function getTranslations()\n {\n if (!$this->translations) {\n return '';\n }\n\n // match key='value' pairs\n $matches = preg_match_all('/(\\w+)\\s*=\\s*([\"\\'])((?:(?!\\2).)*)\\2/', $this->translations, $translations, PREG_SET_ORDER);\n\n if (strlen($this->translations) > 0 && $matches == 0) {\n throw new InvalidFormatException(\"Translations should follow the format: <key1>='<value1>', <key2>='<value2>'.\");\n }\n\n $results = '';\n\n foreach ($translations as $translation) {\n if (sizeof($translation) != 4) continue; //should throw an exception here\n $results .= str_repeat(\" \", 4) . \"'{$translation[1]}' => '{$translation[3]}',\" . PHP_EOL;\n }\n\n return $results;\n }",
"public function getTwords() {\n $this->tlist = getTranslatables($this->langtag);\n }",
"function tag_phrase($string, $start, $end) {\n $phrase = trim(substr($string, $start, $end - $start));\n $phrasefixed = trim(str_replace(' ', ' ', $phrase));\n// $logstr = str_replace(array(chr(1),chr(2),chr(3),chr(4)), array('[1]','[2]','[3]','[4]'), $string);\n// tp_logger (\"p:$phrasefixed, s:$logstr, st:$start, en:$end, gt:{$this->in_get_text}, gti:{$this->in_get_text_inner}\");\n if ($this->in_get_text > $this->in_get_text_inner) {\n tp_logger('not tagging ' . $phrase . ' assumed gettext translated', 4);\n return;\n }\n if ($phrase) {\n tp_logger('tagged phrase: ' . $phrase, 4);\n $node = new simple_html_dom_node($this->html);\n $node->tag = 'phrase';\n $node->parent = $this->currentnode;\n $this->currentnode->nodes[] = $node;\n $node->_[HDOM_INFO_OUTER] = '';\n $node->phrase = $phrasefixed;\n $this->prefetch_phrases[$phrasefixed] = true;\n $node->start = $start;\n $node->len = strlen($phrase);\n if ($this->srclang)\n $node->srclang = $this->srclang;\n if ($this->inbody)\n $node->inbody = $this->inbody;\n if ($this->inselect)\n $node->inselect = true;\n }\n }",
"protected abstract function getTranslations();",
"function sentence_tokenize($text){\r\n\t\tif (preg_match_all('/[\"\\']*.+?([.?!\\n\\r]+[\"\\']*\\s+|$)/si', $text, $matches, PREG_SET_ORDER)){\r\n\t\t\t$rez = array();\r\n\t\t\tforeach ($matches as $match){\r\n\t\t\t\tarray_push($rez, trim($match[0]));\r\n\t\t\t}\r\n\t\t\treturn $rez;\r\n\t\t} else { \r\n\t\t\treturn array($text);\r\n\t\t}\r\n\t}",
"public static function getTranslations(array $strings) {\n $r = [];\n foreach ($strings as $string) {\n $r[$string] = lang::get($string);\n }\n return $r;\n }",
"private function getSearchTerms($phrase) {\n\t\t// Discard anything after a comma in the phrase\n\t\t$commaPos = stripos($phrase, ',');\n\t\tif ($commaPos !== false) {\n\t\t\t$phrase = substr($phrase, 0, $commaPos);\n\t\t}\n\t\t\n\t\t// Replace all periods with a space\n\t\t$phrase = str_replace('.', ' ', $phrase);\n\t\t\n\t\t$terms = explode(' ', $phrase);\n\t\t\n\t\t// Add the entire phrase as a term\n\t\tif (!in_array($phrase, $terms)) {\n\t\t\tarray_unshift($terms, $phrase);\n\t\t}\n\t\t\n\t\t// Sanitize\n\t\t$cleanTerms = array();\n\t\tforeach ($terms as $term) {\n\t\t\t$term = strtolower(trim($term));\n\t\t\tif (!empty($term)) {\n\t\t\t\t$cleanTerms[] = $term;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Abbreviations\n\t\tforeach (self::$searchAbbreviations as $abbrv => $wholeWord) {\n\t\t\tif (in_array($abbrv, $cleanTerms)) {\n\t\t\t\t$cleanTerms[] = $wholeWord;\n\t\t\t}\n\t\t\telse if (in_array($wholeWord, $cleanTerms)) {\n\t\t\t\t$cleanTerms[] = $abbrv;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $cleanTerms;\n\t}",
"public function translate(string $text);"
] |
[
"0.67545146",
"0.5741423",
"0.5378221",
"0.5274673",
"0.5246807",
"0.5241071",
"0.51732606",
"0.51410455",
"0.51396614",
"0.5134297",
"0.50704837",
"0.50429124",
"0.5037841",
"0.49648082",
"0.4949761",
"0.493935",
"0.49296102",
"0.48385417",
"0.48164445",
"0.47224882",
"0.4691037",
"0.46631405",
"0.46620935",
"0.4653113",
"0.46470225",
"0.46356857",
"0.4609015",
"0.45909938",
"0.45843136",
"0.457517"
] |
0.7217142
|
0
|
Sets the property that this task will modify.
|
public function setProperty($property)
{
$this->property = $property;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function set_property(){\n }",
"public function setProperty($property, $value = null);",
"public function __set($property, $value) {}",
"public function __set($property, $value){\n $this->$property = $value;\n }",
"public function set($property, $value);",
"public function __set($property, $value) {\r\n\t\tswitch($property) {\r\n\t\t\tcase 'view':\r\n\t\t\t\t$this->view = $value;\r\n\t\t\t\t$this->install($this->view);\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 'script':\r\n\t\t\t\t$this->script .= $value;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tdefault:\r\n PropertyHelper::Error($property);\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) \n {\n $this->$property = $value;\n }",
"public function __set($property, $value) {\r\n $param = '_' . $property;\r\n $this->$param = $value;\r\n }",
"function __set($property, $value)\n {\n $this->setValue($value);\n }",
"public function __set($property, $value){\n \n if(property_exists($this, $property))\n $this->$property = $value;\n else\n $this->errors[] = \"Failed to set $property to $value!\";\n }",
"public function __set($property, $value)\n {\n $this->resource->{$property} = $value;\n }",
"public function set(string $property, $value);",
"public function __set($property, $value)\n {\n switch ($property) {\n\n case 'name':\n if(!empty($value) && is_string($value)) {\n $this->name = $value;\n $this->changed = true;\n break;\n } else {\n echo 'Wrong type of property, it should be string';\n break;\n }\n \n case 'status':\n if(!empty($value) && is_int($value)) {\n $this->status = $value;\n $this->changed = true;\n break;\n } else {\n echo 'Wrong type of property, it should be integer';\n break;\n }\n \n }\n }",
"public function __set($property, $value) {\r\n $this->set($property, $value);\r\n }",
"public function __set($property, $value) \n {\n \tif (property_exists($this, $property)) {\n \t\t$this->$property = $value;\n \t}\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n {\n $this->$property = $value;\n }",
"public function __set($property, $value)\n\t{\n\t\t$this->$property = $value;\n\t}",
"public function __set($property, $value)\n\t{\n\t\t$this->$property = $value;\n\t}",
"function set($property, $value) {\n $this->{$property} = $value;\n }",
"public function __set($prop, $value)\n {\n $this->assignee[$prop] = $value;\n }",
"public function __set($property, $value)\n\t{\n\t\tif (property_exists($this, $property))\n\t\t{\n\t\t\t$this->$property = $value;\n\t\t}\n\t\telse echo \"error\";\n\t}",
"public function setProperty(?string $value): void {\n $this->getBackingStore()->set('property', $value);\n }"
] |
[
"0.6881103",
"0.66365576",
"0.6594813",
"0.6542739",
"0.64731663",
"0.6468631",
"0.6467995",
"0.6467995",
"0.6467995",
"0.6467995",
"0.6467995",
"0.645704",
"0.6447505",
"0.6373147",
"0.6369735",
"0.63291675",
"0.63274723",
"0.6325837",
"0.62944186",
"0.629273",
"0.629273",
"0.629273",
"0.629273",
"0.629273",
"0.6280496",
"0.6280496",
"0.6279876",
"0.62596375",
"0.62486005",
"0.6247209"
] |
0.691382
|
1
|
Displays a form to create a new Location entity.
|
public function newAction()
{
$entity = new Location();
$form = $this->createForm(new LocationType(), $entity);
return $this->render('ACInst3LocationBundle:Location:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView()
));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function createAction()\n {\n $entity = new Location();\n $request = $this->getRequest();\n $form = $this->createForm(new LocationType(), $entity);\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_location_show', array('id' => $entity->getId())));\n \n }\n\n return $this->render('ACInst3LocationBundle:Location:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function create()\n {\n return view('admin.location.add');\n }",
"public function create()\n {\n return view('admin.locations.add');\n }",
"public function create()\n {\n return view('admin.locations.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('locations.create');\n\t}",
"public function create()\n {\n return view('exports.locations.create');\n }",
"public function create()\n {\n return view('locations.create');\n }",
"public function create()\n {\n return view('locations.create');\n }",
"public function create()\n {\n return view('locations.create');\n }",
"public function create()\n {\n return view('admin.experiences.locations.create');\n }",
"public function create()\n {\n $locations = Location::where('parent', 0)->get();\n return view('locations.create', compact('locations'));\n }",
"public function getCreateLocation()\n {\n return view('admin.world_expansion.create_edit_location', [\n 'location' => new Location,\n 'types' => LocationType::all()->pluck('name','id')->toArray(),\n 'locations' => Location::all()->pluck('name','id')->toArray(),\n 'ch_enabled' => Settings::get('WE_character_locations'),\n 'user_enabled' => Settings::get('WE_user_locations')\n ]);\n }",
"public function create()\n {\n //\n return view('location.create');\n }",
"public function newAction() {\n $entity = new Gasolina();\n $form = $this->createForm(new GasolinaType(), $entity);\n\n return $this->render('TxinbometroBundle:Gasolina:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function newFormAction()\n {\n $entity = new BaseEntity();\n $form = $this->createForm(BaseType::class, $entity);\n\n return $this->render('backOffice/area/new.html.twig', array(\n 'form' => $form->createView(),\n ));\n }",
"public function actionCreate()\n {\n $model = new ListRegionType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $getParams = Yii::$app->getRequest()->get();\n $model->generateDefaults($getParams);\n return $this->render('form', ['model' => $model]);\n }\n }",
"public function getCreateLocationType()\n {\n return view('admin.world_expansion.create_edit_location_type', [\n 'type' => new LocationType\n ]);\n }",
"public function create()\n\t{\n\t\treturn view('admin.place.create');\n\t}",
"public function create()\n {\n \\App::setLocale(\\Session::get('lang'));\n return view('location.create');\n }",
"public function create()\n {\n return $this->form->render('mconsole::places.form');\n }",
"public function newAction()\n {\n $entity = new Area();\n $form = $this->createForm(new AreaType(), $entity);\n\n return $this->render('SystemAdministracionBundle:Area:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n\t\t\t'error'\t\t=> NULL,\n ));\n }",
"function showLocations() {\n if(isset($_REQUEST['newloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->description = $_REQUEST['description'];\n $loc->save();\n }else if (isset($_REQUEST['delloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->id = $_REQUEST['id'];\n $loc->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Locations';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of locations and stick it in the template array\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $locList = Sysinventory_Location::generateLocationList();\n $tpl['PAGER'] = $locList;\n\n // make the form for adding a new location\n $form = new PHPWS_Form('add_location');\n $form->addText('description');\n $form->setLabel('description','Description');\n $form->addSubmit('submit','Create Location');\n $form->setAction('index.php?module=sysinventory&action=edit_locations');\n $form->addHidden('newloc','add');\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_location.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }",
"function showLocations() {\n if(isset($_REQUEST['newloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->description = $_REQUEST['description'];\n $loc->save();\n }else if (isset($_REQUEST['delloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->id = $_REQUEST['id'];\n $loc->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Locations';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of locations and stick it in the template array\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $locList = Sysinventory_Location::generateLocationList();\n $tpl['PAGER'] = $locList;\n\n // make the form for adding a new location\n $form = new PHPWS_Form('add_location');\n $form->addText('description');\n $form->setLabel('description','Description');\n $form->addSubmit('submit','Create Location');\n $form->setAction('index.php?module=sysinventory&action=edit_locations');\n $form->addHidden('newloc','add');\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_location.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }",
"public function newAction() {\n\n $entity = $this->get('admin.helper.ClothingType')->createNew();\n $form = $this->createForm(new ClothingTypes('add',$entity), $entity);\n return $this->render('LoveThatFitAdminBundle:ClothingType:new.html.twig', array(\n 'form' => $form->createView()));\n }",
"public function create()\n {\n //\n $organizations = Organization::pluck('name', 'id');\n return view('manage.location.locations_create', compact('organizations'));\n }",
"public function create()\n {\n //\n return view('admin.maps.create');\n }",
"public function create()\n {\n return view('admin.street.create');\n }",
"function displayAddLocation() {\r\n\t\techo'\r\n<h1>Locatie toevoegen</h1>\r\n<form method=\"post\" action=\"index.php?action=insertlocation\">\r\n<table>\r\n<tr>\r\n<td>Adres:</td>\r\n<td><input type=\"text\" name=\"StreetAddress\"></td>\r\n</tr>\r\n<tr>\r\n<td>Postcode:</td>\r\n<td><input type=\"text\" name=\"PostalCode\"></td>\r\n</tr>\r\n<tr>\r\n<td>Stad:</td>\r\n<td><input type=\"text\" name=\"City\"></td>\r\n</tr>\r\n<tr>\r\n<td>Provincie:</td>\r\n<td><input type=\"text\" name=\"StateProvince\"></td>\r\n</tr>\r\n<tr>\r\n<td></td>\r\n<td><button type=\"submit\">Opslaan</button></td>\r\n</tr>\r\n</table>\r\n</form>';\r\n\t}",
"public function create()\n {\n $form = \\FormBuilder::create(PlaceForm::class,[\n 'url' => route('admin.places.store'),\n 'method' => 'POST'\n ]);\n\n return view('admin.places.create', compact('form'));\n }",
"public function create(VillageFormBuilder $form,Request $request)\n {\n // return $form->render();\n if($this->request->action == \"save\") {\n if ($form->hasFormErrors()) {\n return back();\n }\n $form->make();\n return $this->redirect->to('/admin/location/village?neighborhood='.$request->parent_neighborhood_id);\n }\n\n return $this->view->make('visiosoft.module.location::location/admin-sub-location');\n }"
] |
[
"0.87142384",
"0.76258236",
"0.7563376",
"0.75444967",
"0.75136906",
"0.7467955",
"0.7405486",
"0.7405486",
"0.7405486",
"0.71626866",
"0.7010789",
"0.6951086",
"0.69398147",
"0.68823814",
"0.68157285",
"0.6785195",
"0.67776614",
"0.6757236",
"0.67503303",
"0.66935736",
"0.6690835",
"0.6683613",
"0.6683613",
"0.6656271",
"0.66273695",
"0.6619464",
"0.66082174",
"0.6584938",
"0.6582056",
"0.65797764"
] |
0.860036
|
1
|
Creates a new Location entity.
|
public function createAction()
{
$entity = new Location();
$request = $this->getRequest();
$form = $this->createForm(new LocationType(), $entity);
$form->bindRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getEntityManager();
$em->persist($entity);
$em->flush();
return $this->redirect($this->generateUrl('admin_location_show', array('id' => $entity->getId())));
}
return $this->render('ACInst3LocationBundle:Location:new.html.twig', array(
'entity' => $entity,
'form' => $form->createView()
));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function create(StoreLocationRequest $request)\r\n {\r\n $opening_hours = $this->formatOpeningHours($request);\r\n $disabled_dates = $this->formatDisabledDates($request);\r\n\r\n $location = $this->location->create([\r\n 'name' => $request->get('name'),\r\n 'disabled_weekdays' => $request->get('disabled_weekdays'),\r\n 'disabled_dates' => $disabled_dates,\r\n 'opening_hours' => $opening_hours,\r\n 'order' => (int)$request->get('order'),\r\n 'max_weight' => (int)$request->get('max_weight'),\r\n 'interval' => (int)$request->get('interval'),\r\n 'json' => array()\r\n ]);\r\n\r\n $location->refresh();\r\n\r\n if (is_array($request->get('services'))) {\r\n $location->services()->attach($request->get('services')); \r\n }\r\n\r\n return $location;\r\n }",
"public function create(SalesLocationsCreateOrUpdateEvent $event)\n {\n $saleLocation = new SalesLocationsModel();\n\n $saleLocation\n ->setDispatcher($event->getDispatcher())\n\n ->setCompany($event->getCompany())\n ->setFirstname($event->getFirstname())\n ->setLastname($event->getLastname())\n ->setAddress1($event->getAddress1())\n ->setAddress2($event->getAddress2())\n ->setAddress3($event->getAddress3())\n ->setZipcode($event->getZipcode())\n ->setCity($event->getCity())\n ->setCountryId($event->getCountry())\n ->setPhone($event->getPhone())\n ->setCellphone($event->getCellphone())\n ->setVisible($event->getVisible())\n\n ->save()\n ;\n\n $event->setSaleLocation($saleLocation);\n }",
"public function store(StoreLocationRequest $request)\n {\n\n $location = Location::create($request->all());\n\n $location->save();\n\n return new LocationResource($location);\n }",
"public function create() {\n return GeolocationsModel::create($this->creationDate,$this->userAgent,$this->sellerId,$this->saleId ? $this->saleId: null,$this->latitude,$this->longitude);\n }",
"public function store(Request $request): Location\n {\n $data = $request->validate([\n \"name\" => \"required|string\",\n \"team_id\" => \"required|string\",\n ]);\n\n /* We get the user from the request */\n $user = $request->user();\n\n /* We fetch the foreign keys from the request */\n $team = Team::findOrFail($request['team_id']);\n\n /* We check that the user can create a new location in that team */\n if (!$user->hasTeamPermission($team, 'location:write') ||\n !$user->tokenCan('location:write')\n ) {\n throw new AuthorizationException();\n }\n\n return Location::create([\n \"name\" => $data['name'],\n \"team_id\" => $team->id,\n ]);\n }",
"public function newAction()\n {\n $entity = new Location();\n $form = $this->createForm(new LocationType(), $entity);\n\n return $this->render('ACInst3LocationBundle:Location:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function createOrUpdate(StoreLocationRequest $request)\r\n {\r\n if ($request->has('id') && $request->has('update')) {\r\n return $this->update($request);\r\n }\r\n\r\n return $this->create($request);\r\n }",
"public function testInsertValidLocation() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"location\");\n\n\t\t// create a new Location and insert to into mySQL\n\t\t$location = new Location(null, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\n// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoLocation = Location::getLocationByLocationId($this->getPDO(), $location->getLocationId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"location\"));\n\t\t$this->assertEquals($pdoLocation->getLocationProfileId(), $this->profile->getProfileId());\n\t\t$this->assertEquals($pdoLocation->getLocationAttention(), $this->payAttention);\n\t\t$this->assertEquals($pdoLocation->getLocationCity(), $this->sinCity);\n\t\t$this->assertEquals($pdoLocation->getLocationName(), $this->granjalada);\n\t\t$this->assertEquals($pdoLocation->getLocationState(), $this->stateOfMind);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetOne(), $this->warZone);\n\t\t$this->assertEquals($pdoLocation->getLocationStreetTwo(), $this->aptTwo);\n\t\t$this->assertEquals($pdoLocation->getLocationZipCode(), $this->whatHood);\n\t}",
"public function create($location): void\n {\n $sql = \"INSERT INTO {$this->table} (description) \";\n $sql .= \"VALUES (:description);\";\n\n DBConnection::getInstance()\n ->prepare($sql)\n ->execute([\n \"description\" => $location->getDescription()\n ]);\n\n $location->setId($this->getInsertedId());\n }",
"public function testLocationCreationValidParameters()\n {\n $user = User::all()->random();\n\n $this->actingAs($user, 'api')\n ->post(\"api/location\", [\n 'branch' => 'Twofold Asperger-Academy',\n 'room' => '431',\n 'shelf' => '3',\n 'compartment' => '4',\n 'description' => 'This is a description where the location is.'\n ]);\n $this->seeStatusCode(200);\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'code' => 'required|unique:locations,code',\n ]);\n\n $geometry = explode(',', rtrim(substr($request->input('geometry'),1),')'));\n // dd(floatval($geometry[0]));\n $location = new Location();\n $location->name = $request->input('name');\n $location->code = $request->input('code');\n $location->place_id = $request->input('place_id');\n $location->lat = floatval($geometry[1]);\n $location->lng = floatval($geometry[0]);\n if($request->input('parent') == NULL){\n $location->parent = 0;\n }else\n {\n $location->parent = $request->input('parent');\n }\n $location->save();\n\n\n return redirect()->route('locations.index')\n ->with('success','Location created successfully');\n }",
"public function store(Request $request)\n {\n $location = new location();\n $location->name_location = $request->name_location;\n $location->lat = $request->lat;\n $location->lng=$request->lng;\n $location->save();\n return redirect('location');\n }",
"public function createEntity();",
"public function store(Request $request)\n {\n $loc = new Location();\n\n $loc->name = request('name');\n\n $loc->save();\n\n return redirect(\"/locations\")->with('success','State created successfully!');\n }",
"public function save(GameLocation $entity)\n {\n $em = $this->getEntityManager();\n\n $em->persist($entity);\n $em->flush();\n }",
"public function store(Request $request)\n {\n $validated = $request->validate(['location_key' => 'required']);\n $traveler = $this::getTraveler();\n\n $location = Location::firstOrCreate([\n 'location_key' => $validated['location_key']\n ]);\n\n $traveler->update([\n 'location_id' => $location->id,\n 'last_seen' => now()\n ]);\n\n return new LocationResource($location);\n }",
"public function createLocation(CreateLocationRequest $body): ApiResponse\n {\n $_reqBuilder = $this->requestBuilder(RequestMethod::POST, '/v2/locations')\n ->auth('global')\n ->parameters(HeaderParam::init('Content-Type', 'application/json'), BodyParam::init($body));\n\n $_resHandler = $this->responseHandler()->type(CreateLocationResponse::class)->returnApiResponse();\n\n return $this->execute($_reqBuilder, $_resHandler);\n }",
"public function createLocation($locations, $flat, $flong, $tlat, $tlong){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"])\n\t\t\t||$user[\"status\"]!=DBConfig::$userStatus[\"admin\"])\n\t\t\treturn false;\n\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") creates location '$locations' at $flat | $flong - $tlat | $tlong\");\n\t\t$query = Queries::createlocation($locations, $flat, $flong, $tlat, $tlong);\n\t\treturn $this->query($query);\n\t}",
"public function createLocation($data)\n {\n \n $locationVo = $this->buildLocationVo($data); \n $transmitterVo = $this->buildTransmitterVo($data);\n $imageVo = $this->buildImageVo($data, CImageBoProcess::TYPE_LOCATION);\n \n // Set the validation.\n $this->responseVo->setValidation($locationVo->getValidation());\n \n /**\n * Next check that the data is valid and try to insert new records.\n */\n if ($locationVo->isValid())\n {\n // Next write the data to the databse\n $daoResultLocation = MLocationDao::insertLocation($locationVo, $imageVo->getImageId());\n $daoResultTransmitter = MLocationDao::insertTransmitter($transmitterVo, $daoResultLocation->getData()[0]['LocationId']);\n \n if ($daoResultLocation->getStatus() === FDatabaseVoResult::SUCCESS && $daoResultTransmitter->getStatus() === FDatabaseVoResult::SUCCESS)\n {\n // Set the response message\n $this->responseVo->setData($daoResultLocation->getData());\n $this->responseVo->appendData($daoResultTransmitter->getData());\n $this->responseVo->setMessage('Location created.', FWebVoResponse::SUCCESS);\n }\n else\n {\n // Set the response message\n $this->responseVo->setMessage($daoResultLocation->getMessage(), FWebVoResponse::ERROR);\n }\n }\n else\n {\n $this->responseVo->setMessage('Location data failed validation.', FWebVoResponse::ERROR);\n }\n \n return $this->responseVo;\n }",
"public function testLocationCreationRequiredParameters()\n {\n $user = User::all()->random();\n\n $this->actingAs($user, 'api')\n ->post(\"api/location\", [\n 'branch' => 'Twofold Asperger-Academy',\n 'room' => '431',\n ]);\n $this->seeStatusCode(200);\n }",
"public function testInsertInvalidLocation() {\n\t\t// create a Location with a non null location id and watch it fail\n\t\t$location = new Location(RootsTableTest::INVALID_KEY, $this->profile->getProfileId(), $this->payAttention, $this->sinCity, $this->granjalada, $this->stateOfMind, $this->warZone, $this->aptTwo, $this->whatHood);\n\t\t$location->insert($this->getPDO());\n\t}",
"public function store(Request $request)\n {\n $request->validate([\n 'name'=>'required' \n ]);\n\n $location = new Location([\n 'name' => $request->get('name') \n ]);\n $location->save();\n return redirect('/locations')->with('success', 'Location saved!');\n }",
"public function store(Request $request, Location $location)\n {\n $owner_id = auth()->user()->id;\n $company_id = CarCompany::where('owner_id', '=', $owner_id)->first()->id;\n\n $validatedData = $request->validate([\n 'location' => 'required|string',\n ]);\n\n $values = [\n 'location' => $request->input('location'),\n 'company_id' => $company_id\n ];\n $location->insert($values);\n\n return redirect()->back()->with('alert', 'Added successfully');\n }",
"public function testLocationCreationWithoutLogin()\n {\n $this->post(\"api/location\", [\n 'branch' => 'Twofold Asperger-Academy',\n 'room' => '431',\n ]);\n $this->seeStatusCode(401);\n }",
"public function getCreateLocation()\n {\n return view('admin.world_expansion.create_edit_location', [\n 'location' => new Location,\n 'types' => LocationType::all()->pluck('name','id')->toArray(),\n 'locations' => Location::all()->pluck('name','id')->toArray(),\n 'ch_enabled' => Settings::get('WE_character_locations'),\n 'user_enabled' => Settings::get('WE_user_locations')\n ]);\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make(Input::all(), Location::$rules);\n \n \t\tif ($validator->passes()) {\n \t\t$location = new Location;\n \t\t\t$location->name = Input::get('name');\n \t\t\t$location->save();\n \n \t\t\treturn Redirect::to('app/locations')->with('message', 'Succesfully added');\n \t\t} \n \t\telse {\n \t\treturn Redirect::to('app/locations/create')->with('message', 'The following errors occurred')->withErrors($validator)->withInput(); \n \t\t}\n\t}",
"public function run()\n {\n $location = Location::create([\n 'name' => '1 - V1 Visita 1',\n 'description' => ''\n ]);\n }",
"public function create()\n\t{\n\t\treturn View::make('locations.create');\n\t}",
"public function store(Request $request)\n {\n //\n $this->validate($request, [\n 'name' => 'required|unique:organizations,name',\n 'organization' => 'required|numeric',\n 'description' => 'required',\n ]);\n\n $location = Location::create([\n 'name' => $request->input('name'),\n 'organization_id' => $request->input('organization'),\n 'description' => $request->input('description'),\n ]);\n\n return redirect()->route('locations.index')->with('success', \"The Location <strong>$location->name</strong> has successfully been created.\");\n \n }",
"public function create()\n {\n return view('admin.locations.create');\n }"
] |
[
"0.69916123",
"0.66480774",
"0.6589519",
"0.65444726",
"0.65089387",
"0.6419852",
"0.6213203",
"0.6177304",
"0.6140012",
"0.6101402",
"0.60635626",
"0.6063185",
"0.60584146",
"0.60576546",
"0.6040598",
"0.59959024",
"0.5989737",
"0.59752536",
"0.59625214",
"0.59613264",
"0.5930884",
"0.5880299",
"0.58679205",
"0.5867176",
"0.5865365",
"0.5864497",
"0.58613086",
"0.58398634",
"0.583141",
"0.5830742"
] |
0.7728399
|
0
|
Displays a form to edit an existing Location entity.
|
public function editAction($id)
{
$em = $this->getDoctrine()->getEntityManager();
$entity = $em->getRepository('ACInst3LocationBundle:Location')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Location entity.');
}
$editForm = $this->createForm(new LocationType(), $entity);
$deleteForm = $this->createDeleteForm($id);
return $this->render('ACInst3LocationBundle:Location:edit.html.twig', array(
'entity' => $entity,
'edit_form' => $editForm->createView(),
'delete_form' => $deleteForm->createView(),
));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function editLocationAction() {\n\n //USER VALIDATION\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n $this->view->resource_type = $resource_type = $this->_getParam('resource_type');\n\n switch ($resource_type) {\n case 'group':\n $resource_id = 'group_id';\n break;\n\n case 'event':\n $resource_id = 'event_id';\n break;\n case 'user':\n $resource_id = 'user_id';\n break;\n }\n\n $this->view->resource_id = $resource_id = $this->_getParam($resource_id);\n $this->view->seao_locationid = $seao_locationid = $this->_getParam('seao_locationid');\n $this->view->resource = $resource = Engine_Api::_()->getItem($resource_type, $resource_id);\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if ($viewer->getIdentity() != $resource->user_id) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n $value['id'] = $seao_locationid;\n $this->view->location = $location = Engine_Api::_()->getDbtable('locationitems', 'seaocore')->getLocations($value);\n\n //Get form\n if (!empty($location)) {\n\n $this->view->form = $form = new Seaocore_Form_Location(array(\n 'item' => $resource,\n 'location' => $location->location\n ));\n\n if (!$this->getRequest()->isPost()) {\n $form->populate($location->toarray()\n );\n return;\n }\n\n //FORM VALIDAITON\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //FORM VALIDAITON\n if ($form->isValid($this->getRequest()->getPost())) {\n\n $values = $form->getValues();\n unset($values['submit']);\n unset($values['location']);\n\n $seLocationsTable = Engine_Api::_()->getDbtable('locationitems', 'seaocore');\n $seLocationsTable->update($values, array('locationitem_id =?' => $seao_locationid));\n }\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved.'));\n }\n $this->view->location = Engine_Api::_()->getDbtable('locationitems', 'seaocore')->getLocations($value);\n }",
"public function edit(Location $location)\n {\n //\n }",
"public function edit(Location $location)\n {\n //\n }",
"public function location_edit() {\n\t\treturn view( 'provider.location.index' );\n\t}",
"public function edit($id)\n\t{\n\t\t// get the user\n\t\t$location = Location::find($id);\n\n\t\t// show the edit form and pass the type\n\t\treturn View::make('locations.edit')\n\t\t\t->with('location', $location);\n\t}",
"public function edit(location $location)\n {\n //\n }",
"public function edit(Location $location)\n {\n return view('locations.edit', compact('location'));\n }",
"public function edit($id)\n\t{\n\t\t$location = $this->location->find($id);\n\t\treturn View::make('admin.location.edit')->with('location',$location);\n\t}",
"public function updateAction($id)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('ACInst3LocationBundle:Location')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Location entity.');\n }\n\n $editForm = $this->createForm(new LocationType(), $entity);\n $deleteForm = $this->createDeleteForm($id);\n\n $request = $this->getRequest();\n\n $editForm->bindRequest($request);\n\n if ($editForm->isValid()) {\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_location_edit', array('id' => $id)));\n }\n\n return $this->render('ACInst3LocationBundle:Location:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Location();\n $form = $this->createForm(new LocationType(), $entity);\n\n return $this->render('ACInst3LocationBundle:Location:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }",
"public function edit(Location $location)\n {\n\n return view('locations.edit',[\n 'location' => $location,\n ]);\n }",
"public function edit(Location $location)\n {\n return $this->view\n ->with('location', $location)\n ->with('locations', $this->location->all()->load('language'));\n }",
"public function edit($id)\n {\n $location = Location::find($id);\n return view('admin.locations.edit', compact('location'));\n }",
"public function edit(Locacao $locacao)\n {\n //\n }",
"public function edit(Location $location,$id)\n {\n $state=State::all();\n $location=Ho_details::find($id);\n return view('admin.master.ho_details.edit',compact('state','location'));\n }",
"public function edit($id)\n {\n $location = Location::find($id);\n return view('locations.edit',compact('location'));\n }",
"function showLocations() {\n if(isset($_REQUEST['newloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->description = $_REQUEST['description'];\n $loc->save();\n }else if (isset($_REQUEST['delloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->id = $_REQUEST['id'];\n $loc->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Locations';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of locations and stick it in the template array\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $locList = Sysinventory_Location::generateLocationList();\n $tpl['PAGER'] = $locList;\n\n // make the form for adding a new location\n $form = new PHPWS_Form('add_location');\n $form->addText('description');\n $form->setLabel('description','Description');\n $form->addSubmit('submit','Create Location');\n $form->setAction('index.php?module=sysinventory&action=edit_locations');\n $form->addHidden('newloc','add');\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_location.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }",
"function showLocations() {\n if(isset($_REQUEST['newloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->description = $_REQUEST['description'];\n $loc->save();\n }else if (isset($_REQUEST['delloc'])) {\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $loc = new Sysinventory_Location;\n $loc->id = $_REQUEST['id'];\n $loc->delete();\n }\n\n // set up some stuff for the page template\n $tpl = array();\n $tpl['PAGE_TITLE'] = 'Edit Locations';\n $tpl['HOME_LINK'] = PHPWS_Text::moduleLink('Back to menu','sysinventory');\n\n // create the list of locations and stick it in the template array\n PHPWS_Core::initModClass('sysinventory','Sysinventory_Location.php');\n $locList = Sysinventory_Location::generateLocationList();\n $tpl['PAGER'] = $locList;\n\n // make the form for adding a new location\n $form = new PHPWS_Form('add_location');\n $form->addText('description');\n $form->setLabel('description','Description');\n $form->addSubmit('submit','Create Location');\n $form->setAction('index.php?module=sysinventory&action=edit_locations');\n $form->addHidden('newloc','add');\n\n $form->mergeTemplate($tpl);\n\n $template = PHPWS_Template::process($form->getTemplate(),'sysinventory','edit_location.tpl');\n\n Layout::addStyle('sysinventory','style.css');\n Layout::add($template);\n\n }",
"public function edit($id)\n {\n $location = Location::find($id);\n return view('locations.edit', compact('location'));\n }",
"public function edit($id){\n \n $location = Location::find($id);\n return view('location.edit',['location'=> $location]);\n \n\n }",
"public function edit($id)\n {\n $location = Location::find($id);\n if(is_null($location))\n return view('admin.404');\n\n return view('admin.location.edit', compact('location'));\n }",
"public function edit($id)\n {\n $location = $this->productLocation->findLocationById($id);\n\n return view('exports.locations.edit', ['location' => $location]);\n }",
"public function edit($id)\n {\n //\n $location = Location::findOrFail($id);\n $organizations = Organization::pluck('name', 'id');\n\n return view('manage.location.locations_edit', compact('location', 'organizations'));\n }",
"public function edit($id)\n {\n //\n $location=Location::find($id);\n\n return view('location.edit')->with('location',$location);\n\n }",
"public function edit($id)\n {\n $location = Location::find($id);\n\n if( isset($location) ) {\n if (auth()->user()->id !== $location->user_id) {\n return redirect('/locations')->with('error', 'Unauthorized Page');\n }\n return view('locations.edit')->with('location',$location);\n } else {\n return redirect('/locations')->with('error', \"Location doesn't exist.\");\n }\n }",
"public function edit(InventoryLocation $location)\n {\n $departments = $this->departmentService->getDepartmentsForDropdown();\n return view('ims::inventory_location.edit', compact('location', 'departments'));\n }",
"public function editLocation($id)\n {\n // $locations = Location::where('id',$id)->first();\n\n // return view('locationPointOfInterest.edit',compact('locations'));\n }",
"public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }",
"public function edit($id)\n {\n $convention = Convention::find($id);\n $location = Location::find($convention->location_id);\n return view('calendar.convention.location.edit')\n ->with('convention' , $convention)->with('location', $location);\n }",
"public function edit($id)\n {\n $location = Location::find($id);\n $default_lang = Language::where('is_default', 1)->first()->code;\n $g_languages = Language::where('is_public', 1)->get();\n\n return view('admin.locations.edit', compact(\n 'location',\n 'default_lang',\n 'g_languages'\n ));\n }"
] |
[
"0.7889716",
"0.7687307",
"0.7687307",
"0.73811734",
"0.7247507",
"0.72196907",
"0.71161896",
"0.70301527",
"0.7003214",
"0.6994773",
"0.69815624",
"0.69404525",
"0.6904966",
"0.6843878",
"0.6842627",
"0.6828383",
"0.6817343",
"0.6817343",
"0.67741597",
"0.6767378",
"0.6698211",
"0.6653086",
"0.6646562",
"0.6627204",
"0.65479505",
"0.65461475",
"0.6536208",
"0.65256983",
"0.65253204",
"0.65187335"
] |
0.77660495
|
1
|
caluclate the percentage change between the values
|
protected function calculateChange()
{
$difference = (int) $this->value['value'] - (int) $this->previous;
// Prevent division by zero
if ($difference !== 0) {
$this->change = round(($difference / $this->value['value']) * 100, 2);
} else {
$this->change = 0;
}
if($this->previous && (int) $this->previous > 0){
$this->changeLabel = abs($this->change) . '% ' . ($this->change > 0? 'Increase' : 'Decrease');
}else{
$this->changeLabel = 'No Prior Data';
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function percentChanged()\n {\n if ($this->value == 0) {\n $value = $this->previous;\n } elseif ($this->previous == 0) {\n $value = $this->value;\n } else {\n $value = ($this->previous - $this->value) / $this->previous;\n }\n\n return round(abs($value) * 100, 2) * ($this->value >= $this->previous ? 1 : -1);\n }",
"function calculateChangePercent($close,$prevClose){\n $percentageChange=round(($close-$prevClose)*100/$close,2);\n return $percentageChange;\n}",
"public function fix_percentage() {\n\t\t// Iterate each Antimicrobic\n\t\tfor ($i = 0; $i < $this->antimicrobics->size; $i++) {\n\t\t\t$value = $this->antimicrobics->get($i)->get_value();\n\n\t\t\t// Iterate each value and subtract his previous;\n\t\t\t$ticks = array_keys($value);\n\t\t\tend($ticks);\n\t\t\twhile ($tick = current($ticks)) {\n\t\t\t\t\n\t\t\t\t$prev_tick = prev($ticks);\n\t\t\t\tif ( (false !== $prev_tick) && ($value[$tick] !== 0) )\n\t\t\t\t\t$this->antimicrobics->get($i)->value[$tick] -= $value[$prev_tick];\n\t\t\t}\t\n\t\t}\n\t}",
"public function setPercentChange()\n {\n \n $previous = $this->last()->last->value;\n\n $this->each(function($item) use (&$previous){\n $current = $item->last->value;\n \n if(!isset($item->percentChange))\n $item->percentChange = self::percentChange($current, $previous); \n \n $previous = $item->last->value;\n }); \n \n }",
"function percentage($collection){\n\n $number = 10;\n $new_number = count_products($collection);\n\n $new_value = $new_number - $number;\n\n $percentage = abs(($new_value / $number) * 100);\n\n \n if ($new_number < $number){\n\n return $percentage . '% decrease';\n\n }else if($new_number == $number){\n\n return $percentage . '%';\n }\n \n else {\n\n return $percentage . '% increase';\n\n }\n \n}",
"public function getAmountAsPercentage();",
"function calculatePercentLow($previousClose, $low)\n{\n\n}",
"public function spread () {\n $low = min($this->values);\n $high = max($this->values);\n return round(((1 - ($low/$high)) * 100), 3);\n }",
"public function positivePercent(){\n\t\treturn round($this->positive*100/($this->positive+$this->negative+$this->indeterminate), 2);\n\t}",
"function porcentaje($valor){\t\n $porcentaje = $valor *100;\n return number_format($porcentaje,0,',','.').' %';\n\n}",
"function valore_reale_maggiorazione_percentuale_gas($id_ordine,$id_gas){\r\n \r\n $magg = valore_percentuale_maggiorazione_mio_gas($id_ordine,$id_gas);\r\n return (float)(valore_totale_mio_gas($id_ordine,$id_gas)/100)*$magg;\r\n \r\n}",
"function fuc_discount($product, $percentage){\r\n $discountValue = $product / 100 * $percentage;\r\n $totalValue = $product - $discountValue; \r\n return $totalValue;\r\n\r\n}",
"function promedio($total,$cantidad){\n return number_format($cantidad*100/$total,0);\n}",
"public function getPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }",
"function valore_totale_mio_ordine_lordo($idu,$usr){\r\n$mio_o = valore_totale_mio_ordine($idu,$usr);\r\n//echo \"mio=\".$mio_o.\"<br>\";\r\n\r\n$vto = valore_totale_ordine_qarr($idu);\r\n\r\n//echo \"vto=\".$vto.\"<br>\"; \r\nif ($vto>0){ \r\n$perc = (float)($mio_o/$vto)*100;\r\n\r\n$tras = valore_trasporto($idu,$perc);\r\n//echo \"perc=\".$perc.\"<br>\";\r\n//echo \"tras=\".$tras.\"<br>\"; \r\n$gest =valore_gestione($idu,$perc);\r\n//echo \"perc=\".$perc.\"<br>\"; \r\n//echo $perc;\r\nreturn (float)round($mio_o + $tras + $gest,4);\r\n}else{\r\nreturn \"\"; \r\n\t\r\n}\r\n}",
"public function getPercentage()\n {\n return $this->percentage;\n }",
"function RelativeChange($selected_period, $previous_period) {\n\t// Calculates the relative change between selected and previous periods. Uses percent with locale number format.\n\tif($previous_period<>0) {\n\t\treturn locale_number_format(($selected_period-$previous_period)*100/$previous_period, $_SESSION['CompanyRecord']['decimalplaces']) . '%';\n\t} else {\n\t\treturn _('N/A');\n\t}\n}",
"private function calcolaValutazione()\n {\n\n $media=0;\n $i=0;\n foreach ($this->valutazioni as &$value){\n $media=$media+$value->getvoto();\n $i++;}\n $this->valutazione=$media/$i;\n\n }",
"public function getPerfection(): float\n {\n return round($this->getTotal() / 45, 3) * 100;\n }",
"function kira2($dulu,$kini)\n{\n return @number_format((($kini-$dulu)/$dulu)*100,0,'.',',');\n //@$kiraan=(($kini-$dulu)/$dulu)*100;\n}",
"public function calculate_discount_percentage() {\n extract($_POST);\n $disc_rate = ($discount_amount / $class_fees) * 100;\n $fees_due = $class_fees - $discount_amount;\n $subsidy_per = ($subsidy * 100) / $fees_due;\n $result = $this->classtraineemodel->calculate_net_due($gst_onoff, $subsidy_after_before, $fees_due, $subsidy, $gst_rate);\n $arr = array();\n if ($result < 0) {\n $arr['label'] = \"NEGATIVE Total Fees Due NOT ALLOWED. Please correct Discount AND/ OR Subsidy Amounts.\";\n $arr['amount'] = \"\";\n } else {\n $arr['label'] = \"\";\n $arr['amount'] = number_format($result, 4, '.', '');\n $arr['disc_rate'] = number_format($disc_rate, 4, '.', '');\n $arr['subsidy_per'] = number_format($subsidy_per, 4, '.', '');\n $gst_amount = $this->classtraineemodel->calculate_gst($gst_onoff, $subsidy_after_before, $fees_due, $subsidy, $gst_rate);\n $arr['gst_amount'] = number_format($gst_amount, 4, '.', '');\n }\n echo json_encode($arr);\n exit();\n }",
"private function calculate(): float\n {\n return $this->conversionMultiple / $this->getUnitValue($this->to);\n }",
"public function calculateTotalPercentage()\n {\n return round((($this->totalcovered + $this->totalmaybe) / $this->totallines) * 100, 2);\n }",
"public static function getPercentage($old, $new)\n {\n $percentage = (($new - $old) / $old) * 100;\n return round($percentage, 0) . '%';\n }",
"public function getPercent()\n {\n return $this->helper->getPercent();\n }",
"public function getTotalPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getTotalSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getTotalSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }",
"public function getPercent() {\n return $this->percent;\n }",
"function discount_percent($sell_price,$price)\n {\n $rs_off=$price-$sell_price;\n $percentage=floor($rs_off*100/$price);\n return $percentage;\n }",
"public function getPercent()\n {\n return $this->readOneof(2);\n }",
"function percentage_rate_class($value, $base = 50)\n {\n if(!is_numeric($value)) {\n $value = 0;\n }\n\n $percentage = (float)$value;\n\n if($percentage == 100) {\n return 'excelent';\n }\n\n if($percentage == 0) {\n return 'neutral';\n }\n\n if($percentage < $base) {\n return 'poor';\n }\n\n return 'ok';\n }"
] |
[
"0.78573775",
"0.72289646",
"0.6914509",
"0.6815351",
"0.6688321",
"0.6641185",
"0.66389483",
"0.6512807",
"0.6445858",
"0.6409126",
"0.6306492",
"0.62967336",
"0.62613595",
"0.6222472",
"0.6210998",
"0.6140415",
"0.61319536",
"0.6129944",
"0.6107734",
"0.6078935",
"0.60312015",
"0.6028545",
"0.6005667",
"0.59955025",
"0.5969235",
"0.5961006",
"0.595921",
"0.59074026",
"0.5883716",
"0.5878158"
] |
0.768961
|
1
|
/ GENERADOR DE URLS NIKKENCHALLENGE
|
public function nikkenChallengeUrl(){
ini_set('max_execution_time', 300);
$conexion=DB::connection('sqlsrvInconcert');
$abiurl = $conexion->table('DistributorMasterData')
->select('NumeroAbi')
->get();
foreach ($abiurl as $item){
//echo("el abi: ".$item->NumeroAbi." accede a su link: https://services.nikken.com.mx/nikkenChallenge/".base64_encode($item->NumeroAbi)."<br>");
$conexion->table('DistributorMasterData')
->where('NumeroAbi', $item->NumeroAbi)
->where('NikkenChallenge', '')
->update(['NikkenChallenge' => "https://services.nikken.com.mx/nikkenChallenge/".base64_encode($item->NumeroAbi)]);
}
\DB::disconnect('sqlsrvInconcert');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function createURL($key_word, $tipo_pasto){\r\n $url = \"http://localhost:5028/rec/?q=\" . $key_word .'&';\r\n\r\n/*\r\n if($tipo_dieta == 'balanced')\r\n $url = $url . \"diet=balanced&\";\r\n if($tipo_dieta == 'high-protein')\r\n $url = $url . \"diet=high-protein&\";\r\n if($tipo_dieta == 'high-fiber')\r\n $url = $url . \"diet=high-fiber&\";\r\n if($tipo_dieta == 'low-carb')\r\n $url = $url . \"diet=low-carb&\";\r\n if($tipo_dieta == 'low-fat')\r\n $url = $url . \"diet=low-fat&\";\r\n if($tipo_dieta == 'low-sodium')\r\n $url = $url . \"diet=low-sodium&\";\r\n\r\n if($etichette_salutari == 'vegan')\r\n $url = $url . \"health=vegan&\" ;\r\n if($etichette_salutari == 'vegetarian')\r\n $url = $url . \"health=vegetarian&\" ;\r\n if($etichette_salutari == 'egg-free')\r\n $url = $url . \"health=egg-free&\" ;\r\n if($etichette_salutari == 'fish-free')\r\n $url = $url . \"health=fish-free&\" ;\r\n if($etichette_salutari == 'gluten-free')\r\n $url = $url . \"health=gluten-free&\" ;\r\n\r\n if($tipo_pasto == 'Breakfast')\r\n $url = $url.'mealType=Breakfast&';\r\n if($tipo_pasto == 'Launch')\r\n $url = $url.'mealType=Launch&';\r\n if($tipo_pasto == 'Dinner')\r\n $url = $url.'mealType=Dinner&';\r\n if($tipo_pasto == 'Sneak')\r\n $url = $url.'mealType=Sneak&';\r\n if($tipo_pasto == 'Teatime')\r\n $url = $url.'mealType=Teatime&';\r\n*/ \r\n if($tipo_pasto == 'Starter')\r\n \t$url = $url.'dishType=Starter&';\r\n if($tipo_pasto == 'Biscuits and cookies')\r\n $url = $url.'dishType=Biscuitsandcookies&';\r\n if($tipo_pasto == 'Bread')\r\n $url = $url.'dishType=Bread&';\r\n if($tipo_pasto == 'Cereals')\r\n $url = $url.'dishType=Cereals&';\r\n if($tipo_pasto == 'Condimentsandsauces')\r\n $url = $url.'dishType=Condimentsandsauces&';\r\n if($tipo_pasto == 'Desserts')\r\n $url = $url.'dishType=Desserts&';\r\n if($tipo_pasto == 'Egg')\r\n $url = $url.'dishType=Egg&';\r\n if($tipo_pasto == 'Main course')\r\n $url = $url.'dishType=Maincourse&';\r\n if($tipo_pasto == 'Omelet')\r\n $url = $url.'dishType=Omelet&';\r\n if($tipo_pasto == 'Pancake')\r\n $url = $url.'dishType=Pancake&';\r\n if($tipo_pasto == 'Preps')\r\n $url = $url.'dishType=Preps&';\r\n if($tipo_pasto == 'Preserve')\r\n $url = $url.'dishType=Preserve&';\r\n if($tipo_pasto == 'Salad')\r\n $url = $url.'dishType=Salad&';\r\n if($tipo_pasto == 'Sandwiches')\r\n $url = $url.'dishType=Sandwiches&';\r\n if($tipo_pasto == 'Soup')\r\n $url = $url.'dishType=Soup&';\r\n \r\n \r\n $url = $url . \"n=10&lang=en\";\r\n\r\n return $url;\r\n\r\n}",
"private function mkup() {\n $url = $_POST['url']; $end = $_POST['end'];\n $this->ur1 = $url.$end;\n $urlq = parse_url($url, PHP_URL_QUERY);\n if(strpos($urlq, '[t]') !== false) {\n $word = substr(str_shuffle('abcdefghijklmnopqrstuvwxyz0123456789'), 0, 6);\n\n ## URL Parser ##\n $key = $this->hex(chr(rand(97,122)));\n $syntax = 'aes_decrypt(aes_encrypt(concat('.$this->hex($word.':::').',%1$s,'.$this->hex(':::'.$word).'),'.$key.'),'.$key.')';\n $urlq = str_replace('[t]', $syntax, $urlq).'%2$s'.$end;\n $this->url = str_replace(parse_url($url, PHP_URL_QUERY), $urlq, $url);\n\n ## Pattern Maker ##\n $page = $this->getPage(sprintf($this->url, $this->hex($word), ''));\n $pattern = '/'.$word.':::(.+?):::'.$word.'/';\n preg_match($pattern, $page, $result);\n if($result[1] == $word) {\n $this->pattern = $pattern;\n } else {\n $this->end(2);\n }\n } else {\n $this->end(1);\n }\n }",
"public function generate_url()\n {\n }",
"protected function _executeGenerateSimulatedUrl() {\n // Init\n $ret = '';\n\n $pid = (int)$this->_postVar['pid'];\n\n if (!empty($pid)) {\n $page = \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', $pid);\n\n if (!empty($page)) {\n\n if (\\TYPO3\\CMS\\Core\\Utility\\ExtensionManagementUtility::isLoaded('realurl')) {\n // Disable caching for url\n $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['enableUrlDecodeCache'] = 0;\n $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['enableUrlEncodeCache'] = 0;\n $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']['disablePathCache'] = 1;\n }\n\n $this->_initTsfe($page, NULL, $page, NULL);\n\n $ret = $GLOBALS['TSFE']->cObj->typolink_URL(array('parameter' => $page['uid']));\n\n if (!empty($ret)) {\n $ret = \\TQ\\TqSeo\\Utility\\GeneralUtility::fullUrl($ret);\n }\n }\n }\n\n if (!empty($ret)) {\n $ret = array(\n 'url' => $ret,\n );\n } else {\n $ret = array(\n 'error' => $GLOBALS['LANG']->getLL('error.url_generation_failed'),\n );\n }\n\n return $ret;\n }",
"function generate_url_key($length){\n\t\t$pattern = \"1234567890abcdefghijklmnopqrstuvwxyz\";\n\n\t\t$result = '';\n\t\tfor($i = 0; $i < $length; $i++) {\n\t\t\t$result .= $pattern{rand(0,35)};\n\t\t}\n\n\t\treturn $result;\t\n\t}\t\n\t\n\t/**\n\t * Returns a string formatted so it can \n\t * be used as a valid part of URL.\n\t *\n\t * @see\t\thttp://www.php.net/strtr\n\t *\n\t * @param\tstring\t$value\n\t * @return\tstring\n\t */\n\tfunction make_url_string($value) {\n\n\t\t// Lower\n\t\t$result = strtolower($value); \n\n\t\t// Replace special chars\n\t\t$char_search = array('�', '�', '�', '�', '�', '�', '�');\n\t\t$char_replace = array('oe', 'ae', 'ue', 'oe', 'ae', 'ue','ss');\n\t\t$result = trim(str_replace($char_search, $char_replace, $result));\n\t\t$result = str_replace(array('!', '\"', '#', '$', '%', '&', '\\'', '(', ')', '*', '+', ',', '.', '/', ':', ';', '_', '@', '\\\\', '<', '=', '>', '?', '[', ']', '^', '`', '{', '|', '}', '~'), ' ', $result);\n\n\n\t\t// Verify characters\n\t\t$result = preg_replace('/([^a-z0-9]+)/', '-', $result);\n\n\n\t\t// Reduce hyphen to one\n\t\t$result = preg_replace(\"#([\\-])+#\", \"\\\\1\", $result);\n\n\n\t\t// No invalid characters at the begin and the end\n\t\twhile(strlen($result) > 0 && substr($result, 0, 1) == '-') {\n\t\t\t$result = substr($result, 1);\n\t\t}\n\n\t\twhile(strlen($result) > 0 && (substr($result, -1) == '-' || in_array(substr($result, -1), $char_search))) {\n\t\t\t$result = substr($result, 0, strlen($result) - 1);\n\t\t}\n\n\t\treturn $result;\t\n\t}\t\n}",
"function newSeq4($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n\n\n $a0 = intval(rand(50, 150));\n while ($a0 == 0) {\n $a0 = intval(rand(50, 150));\n }\n\n $a1 = intval(rand(-150, -50));\n while ($a1 == 0) {\n $a1 = intval(rand(-150, -50));\n }\n\n $r = intval(rand(-6, 6));\n\n while ($r == 0) {\n $r = intval(rand(-6, 6));\n }\n\n $m = intval(rand(2, 4));\n $a = [$a0, $a1];\n //An = (An-1 + An-2) *R\n for ($i = 2; $i <= 6; $i++) {\n $a[] = $r * ($a[$i - 2] + $a[$i - 1]);\n }\n\n $title = '';\n //An = (An-1 + An-2) *R\n for ($i = 0; $i < 6; $i++) {//miss 7\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n // 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[6];\n //An = (An-1 + An-2) *R, 填中间\n $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n // hint An = R*(An-1 + An-2)\n\n if ($r > 0) {\n $hint = \"A[n]=$r*(A[n-1] + A[n-2])\";\n } else {\n $hint = \"A[n]=($r)*(A[n-1] + A[n-2])\";\n }\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n\n}",
"public function urlUret3(){\n //generateUrl de olan name php bin/console debug:router ile bulduk\n //page den sonra olan kisimlari ekleyerek ne aradimizi netlestirmis olduk\n // 3. parametre olarak \"UrlGeneratorInterface\" bize verecegi URL turunu belirleyebiliyoruz\n $url=$this->generateUrl(\"post_listeleme_yeni\",[\n 'page'=>'99',\n ]);\n\n\n $fullurl=$this->generateUrl(\"post_listeleme_yeni\",[\n 'page'=>'99',\n 'category'=>'health',\n 'age'=>25,\n 'height'=>170\n ],UrlGeneratorInterface::RELATIVE_PATH);\n\n\n return new JsonResponse([\"Generate URL\"=>$url , \"Full URL: \"=> $fullurl]);\n }",
"public function testDemoteAutomatchUrlUsingGET()\n {\n }",
"public function exampleUrlsForTokenAnonymization() {}",
"function newSeq9($num, $post = false)\n{\n\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n $a0 = intval(rand(-150, -50));\n while ($a0 == 0) {\n $a0 = intval(rand(-150, -50));\n }\n\n $a1 = intval(rand(25, 125));\n while ($a1 == 0) {\n $a1 = intval(rand(25, 125));\n }\n\n\n $m = intval(rand(2, 6));\n\n $a = [$a0, $a1];\n\n for ($i = 2; $i <= 8; $i++) {\n if ($i % 2 == 1) {\n $a[] = intval(rand(-55, 55));\n } else {\n $a[] = $a0 - $a[$i - 1];\n }\n }\n\n $title = '';\n //A2n-1 + A2n = A0\n for ($i = 0; $i < 8; $i++) {\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n// 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[8];\n //A2n-1 + A2n = A0 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n //A2n-1 + A2n = A0\n\n $hint = \"A[2n-1] + A[2n] = A[0], n is greater than zero\";\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n}",
"function newSeq3($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n\n\n $r = intval(rand(-80, 80));\n while ($r == 0) {\n $r = intval(rand(-80, 80));\n }\n\n $b = $r < 0 ?\n intval(rand(80, 150))\n : intval(rand(-150, -80));\n\n\n $c = $r < 0 ?\n intval(rand(80, 150))\n : intval(rand(-150, -80));\n\n $p = intval(rand(1, 3));\n $m = intval(rand(1, 5));\n $title = '';\n for ($i = 0; $i < 7; $i++) {\n //An = Rn^p + Bn +C,, 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $data = $r * pow($i, $p) + $b * $i + $c;\n\n if ($i == 0) {\n $title = $title . \"$data\";\n } else {\n $title = $title . \",$data\";\n }\n }\n\n //An = Rn^p + Bn +C,, 填末尾\n $title = $title . \",?\";\n $res = $r * pow(7, $p) + $b * 7 + $c;\n //An = Rn^p + Bn +C,, 填中间\n// $res = $r * pow($m, $p) + $b * $m + $c;\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n $hint = \"A[n]=$r*n^$p\";\n\n if ($b > 0) {\n $hint = $hint . \"+$b*n\";\n } else {\n $hint = $hint . \"$b*n\";\n }\n\n\n if ($c > 0) {\n $hint = $hint . \"+$c\";\n } else {\n $hint = $hint . \"$c\";\n }\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n\n curl_close($hp->ch);\n\n\n}",
"function newSeq2($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n $r = intval(rand(-80, 80));\n while ($r == 0) {\n $r = intval(rand(-80, 80));\n }\n\n $b = $r < 0 ?\n intval(rand(80, 150))\n : intval(rand(-150, -80));\n\n $p = intval(rand(1, 3));\n\n $m = intval(rand(1, 5));\n\n $title = '';\n for ($i = 0; $i < 7; $i++) {\n //An = Rn^p + B, 填中间\n// if($i == $m){\n// $title = $title . \",?\";\n// continue;\n// }\n\n $data = $r * pow($i, $p) + $b;\n if ($i == 0) {\n $title = $title . \"$data\";\n } else {\n $title = $title . \",$data\";\n }\n }\n\n// An = Rn^p + B, 填末尾\n $title = $title . \",?\";\n $res = $r * pow(7, $p) + $b;\n //An = Rn^p + B, 填中间\n// $res = $r* pow($m,$p) + $b;\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n if ($b == 0) {\n $hint = \"A[n]=$r*n^$p\";\n } else if ($b > 0) {\n $hint = \"A[n]=$r*n^$p+$b\";\n } else {\n $hint = \"A[n]=$r*n^$p$b\";\n\n }\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n\n curl_close($hp->ch);\n\n\n}",
"function newSeq6($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n\n\n $a0 = intval(rand(-30, -20));\n while ($a0 == 0) {\n $a0 = intval(rand(-30, -20));\n }\n\n $a1 = intval(rand(20, 30));\n while ($a1 == 0) {\n $a1 = intval(rand(20, 30));\n }\n\n\n $r = intval(rand(-5, 5));\n while ($r == 0) {\n $r = intval(rand(-5, 5));\n }\n\n $b = $r > 0 ?\n intval(rand(-40, -20))\n : intval(rand(20, 40));\n\n\n $m = intval(rand(2, 4));\n $a = [$a0, $a1];\n //An = (An-1 + An-2) *R\n for ($i = 2; $i <= 6; $i++) {\n $a[] = $r * ($a[$i - 2] + $a[$i - 1]) + $b;\n }\n\n $title = '';\n //An = (An-1 + An-2) *R +b\n for ($i = 0; $i < 6; $i++) {//miss 7\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n // 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[6];\n// An = (An-1 + An-2) *R + b, 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n // hint An = R*(An-1 + An-2)\n\n if ($r > 0) {\n $hint = \"A[n]=$r*(A[n-1] + A[n-2])\";\n } else {\n $hint = \"A[n]=($r)*(A[n-1] + A[n-2])\";\n }\n\n if ($b > 0) {\n $hint = $hint . \"+$b\";\n } else {\n $hint = $hint . \"$b\";\n }\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n\n}",
"private static function generateUrlPrams(){\n\t\t$url = [] ;\n\t\tif ( isset($_GET['urlFromHtaccess']) ){\n\t\t\t$url = explode('/' , trim($_GET['urlFromHtaccess']) );\n\t\t}\n\t\tself::$url = $url ;\n\t}",
"function _build_url() {\n\t\t// Add transaction ID for better detecting double requests in AUTH server\n\t\tif($GLOBALS['config']['application']['tid'] == '') $GLOBALS['config']['application']['tid'] = rand(0, 10000);\n\n\t\t$url = $this->url.'&action='.$this->action.'&tid='.$GLOBALS['config']['application']['tid'];\n\t\t\n\t\treturn $url;\n\t}",
"function newSeq5($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n\n\n $a0 = intval(rand(-30, -20));\n while ($a0 == 0) {\n $a0 = intval(rand(-30, -20));\n }\n\n $a1 = intval(rand(20, 30));\n while ($a1 == 0) {\n $a1 = intval(rand(20, 30));\n }\n\n $a2 = intval(rand(-30, 30));\n while ($a2 == 0) {\n $a2 = intval(rand(-30, 30));\n }\n\n $r = intval(rand(-5, 5));\n while ($r == 0) {\n $r = intval(rand(-5, 5));\n }\n\n $m = intval(rand(2, 4));\n $a = [$a0, $a1, $a2];\n //An = (An-1 + An-2) *R\n for ($i = 3; $i <= 6; $i++) {\n $a[] = $r * ($a[$i - 3] + $a[$i - 2] + $a[$i - 1]);\n }\n\n $title = '';\n //An = (An-1 + An-2) *R\n for ($i = 0; $i < 6; $i++) {//miss 7\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n // 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[6];\n// An = (An-1 + An-2 +An-3) *R, 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n\n if ($r > 0) {\n $hint = \"A[n]=$r*(A[n-1] + A[n-2] + A[n-3])\";\n } else {\n $hint = \"A[n]=($r)*(A[n-1] + A[n-2] + A[n-3])\";\n }\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n\n}",
"function newSeq8($num, $post = false)\n{\n\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n $a0 = intval(rand(-9, 9));\n while ($a0 == 0) {\n $a0 = intval(rand(-9, 9));\n }\n\n $a1 = intval(rand(-9, 9));\n while ($a1 == 0) {\n $a1 = intval(rand(-9, 9));\n }\n\n $b = $a1 > 0 ? intval(rand(-150, -50)) : intval(rand(50, 150));\n\n\n $p = intval(rand(1, 2));\n\n $m = intval(rand(2, 4));\n\n $a = [$a0, $a1];\n\n for ($i = 2; $i <= 5; $i++) {\n $a[] = pow($a[$i - 2], $p) + $b;\n }\n\n $title = '';\n //An = (An-1)^p + B\n for ($i = 0; $i < 5; $i++) {//miss 7\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n// 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[5];\n// An = (An-1)^p + B 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n //An = (An-1)^p + B\n\n $hint = \"A[n]=A[n-2]^$p\";\n\n if ($b > 0) {\n $hint = $hint . \"+$b\";\n } else {\n $hint = $hint . \"$b\";\n }\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n\n}",
"protected static function generate_challenge()\r\n {\r\n // Complexity setting is used as character count\r\n static::$response = static::random(\\max(1, static::$config['complexity']));\r\n \\Session::instance()->set(static::$sessionname, array('code' => static::$response, 'time' => \\TIME));\r\n }",
"function newSeq7($num, $post = false)\n{\n\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n $a0 = intval(rand(-8, 8));\n while ($a0 == 0) {\n $a0 = intval(rand(-8, 8));\n }\n\n $b = $a0 > 0 ? intval(rand(-50, -30))\n : intval(rand(1, 60));\n\n\n $p = intval(rand(1, 2));\n\n $m = intval(rand(1, 2));\n\n $a = [$a0];\n\n for ($i = 1; $i <= 3; $i++) {\n $a[] = pow($a[$i - 1], $p) + $b;\n }\n\n $title = '';\n //An = (An-1)^p + B\n for ($i = 0; $i < 3; $i++) {//miss 7\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n// 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[3];\n// An = (An-1)^p + B 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n //An = (An-1)^p + B\n\n $hint = \"A[n]=A[n-1]^$p\";\n\n if ($b > 0) {\n $hint = $hint . \"+$b\";\n } else {\n $hint = $hint . \"$b\";\n }\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n\n}",
"function testgoogle(){\n\t\n\t\t$file = array('com');\n\t\t\n\t\tforeach ($file as $zone){\n\t\t\n\t\t\t$cool = explode(' ', $zone);\n\t\t\t$newzone[] = $cool[1];\n\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t//print_r($newzone);\n\t\t\n\t\t//die();\n\t\t$this->evaltest();\n\t\n\t\t//echo '<h1>Проверили шеллы</h1>';\n\t\t//flush();\n\t\t\n\t\tshuffle($this->serv);\n\t\t\n\t\t$this->serv = array('127.0.0.1/get.php?key=sdfadsgh4513sdGG435341FDGWWDFGDFHDFGDSFGDFSGDFG');\n\t\t\n\t\t//print_r($this->serv);\n\n\t\t//die();\n\n\t\t$keys = $this->Yakey->query(\"SELECT * FROM `cities` LIMIT 2222,1\");\n\t\t\n\t\t$domens = explode(',', 'us,de,ca,fr,it,au');\n\n\t\tforeach ($keys as $value){\n\t\t\t\n\t\t\tforeach ($domens as $dom)$goodkeys[] = '\"'.$value['cities']['name'].'\" site:'.$dom.' inurl:php inurl:id';\t\t\t\n\t\t\n\t\t}\n\t\t\n\t//\tprint_r($goodkeys);\n\t//\tdie();\n\t\t//print_r($this->serv);\n\t\t\n\t\t$cmh = curl_multi_init();\n \n\t\t$tasks = array();\n\t\t\n\t\t$count_serv = count($this->serv);\n\t\t$count_keys = count($goodkeys);\n\t\t\n\t\t$servers = $this->serv;\n\t\t\n\t\t$code = str_replace('urlproxyfile', \"'\".urlproxyfile.\"'\", file_get_contents('google.php'));\n\t\t$this->code = str_replace(array('<?php','?>'), '', $code);\n\n\t\t//echo $newzone[array_rand($newzone)];\n\t\t//die();\n\n\t\tfor($i=0;$i<1;$i++){\n\t\t\t\n\n\t\n\t\t\t$kk = array_shift($goodkeys);\n\t\t\t$ss = array_shift($servers);\n\t\t\t\t\t\n\t\t\t$ch = $this->streamSHells($ss,$kk,'com');\n\n\t\t\t$tasks[$kk.':::'.$ss] = $ch;\n\t\t\tcurl_multi_add_handle($cmh, $ch);\n\t\t\t\n\t\t\t//break;\n\t\t}\n\t\t\n\t\n\n\t\t$active = null;\n\n\n\t\tdo {\n\t\t\t\n\t\t\t$mrc = curl_multi_exec($cmh, $active);\n\t\t}\n\n\t\twhile ($mrc == CURLM_CALL_MULTI_PERFORM);\n \n\t\twhile ($active && ($mrc == CURLM_OK)) {\n\t\n\t\n\t\t\tif (curl_multi_select($cmh) != -1) {\n\t\t\n\t\tdo {\n\t\t\t\n\t\t\t$mrc = curl_multi_exec($cmh, $active);\n\n\t\t\t$info = curl_multi_info_read($cmh);\n\n\t\t\tif ($info['msg'] == CURLMSG_DONE) {\n\t\t\t\t$ch = $info['handle'];\n\t\n\t\t\t\t$url = array_search($ch, $tasks);\n\t\t\t\n\t\t\t\t$tasks[$url] = curl_multi_getcontent($ch);\n\t\t\t\n\t\t\t\t$dann = explode(':::', $url);\n\t\t\t\tif(strstr($tasks[$url], 'bedaaa')){\n\t\t\t\t\t\n\t\t\t\t\techo '<H1>БЕДА!!!!!У НАС КАПЧА</H1>';\n\t\t\t\t\tfile_put_contents('kapchaaaaaa.txt', $dann[1].'\n\t\t\t\t\t'.$tasks[$url]);\n\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\n\t//header('Content-Type: image/jpeg');\n\t\t\t\t\t\n\t\t\t\techo $tasks[$url];\n\t\t\t\tdie();\n\t\t\t\t//die();\n\t\t\t\t$get = base64_decode($tasks[$url]);\n\t\t\t\t\n\n\t\t\t\t\n\t\t\t\t$file = unserialize($get);\n\n\t\t\t//\tprint_r($file);\n\t\t\t\t\n\t\t\t//\tdie();\n\t\t\t\n\t\t\t\t//$this->$file\n\t\t\t\t//$this->saveurl($file);\n\t\t\t\t\n\t\t\t\techo $url.'<br/>';\n\t\t\t\tflush();\n\n\t\n\t\t\t\t}\n\n\t\t\t\t\tcurl_multi_remove_handle($cmh, $ch);\n\t\t\t\t\n\t\t\t\t\tcurl_close($ch);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\t\tif(count($goodkeys)>0){\n\t\t\n\t\t\t\tif(count($servers)==0)$servers = $this->serv;\n\t\t\t\t\n\t\t\t\t$kk = array_shift($goodkeys);\n\t\t\t$ss = array_shift($servers);\n\t\t\t\t\t\n\t\t\t//$ch = $this->streamSHells($ss,$kk,$newzone[array_rand($newzone)]);\n\n\t\t//\t$tasks[$kk.':::'.$ss] = $ch;\n\t\t///\tcurl_multi_add_handle($cmh, $ch);\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\n\t\t\t\n\t\t}\n\t\twhile ($mrc == CURLM_CALL_MULTI_PERFORM);\n\t}\n}\n \n\tcurl_multi_close($cmh);\n\n\n\t\t\tlist($msec, $sec) = explode(chr(32), microtime());\n\t\techo '<h1>--'.round(($sec + $msec) - $this->timework, 4).'</h1>';\n\t\n\t\tdie('ok');\n\t\t\n\t\t\n\t\t\n\t\t\n\t\tdie();\n\t}",
"function editSeq2($num, $post = false)\n{\n $hp = new Http();\n\n\n for ($id = 10417; $id <= 10616; $id++) {\n\n $r = intval(rand(-80, 80));\n while ($r == 0) {\n $r = intval(rand(-80, 80));\n }\n $b = intval(rand(-80, 80));\n $p = intval(rand(1, 4));\n\n $m = intval(rand(1, 5));\n\n $title = '';\n for ($i = 0; $i < 7; $i++) {\n //An = Rn^p + B, 填中间\n// if($i == $m){\n// $title = $title . \",?\";\n// continue;\n// }\n\n $data = $r * pow($i, $p) + $b;\n if ($i == 0) {\n $title = $title . \"$data\";\n } else {\n $title = $title . \",$data\";\n }\n }\n\n// An = Rn^p + B, 填末尾\n $title = $title . \",?\";\n $res = $r * pow(7, $p) + $b;\n //An = Rn^p + B, 填中间\n// $res = $r* pow($m,$p) + $b;\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-train-seq';\n if ($b == 0) {\n $hint = \"A[n]=$r*n^$p\";\n } else if ($b > 0) {\n $hint = \"A[n]=$r*n^$p+$b\";\n } else {\n $hint = \"A[n]=$r*n^$p$b\";\n\n }\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo 'id' . $id;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem/' . $id, $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n\n curl_close($hp->ch);\n\n\n}",
"public function testRejectAutomatchUrlUsingGET()\n {\n }",
"function randomUrl($type = 'alphanumeric', $length = 4){\n $str = '';\n switch($type):\n case 'alphanumeric':\n $possible = \"23456789bcdfghjkmnpqrstvwxyzBCDFGHJKMNPQRSTVWXYZ\";\n break;\n case 'alpha':\n $possible = \"abcdefghijklmnopqrstuvwxyz\";\n break;\n case 'numeric':\n $possible = \"0123456789\";\n break;\n endswitch;\n \n $i = 0;\n while ($i < $length) {\n $str .= substr( $possible, mt_rand( 0, strlen( $possible )-1 ), 1 );\n $i++;\n }\n return $str;\n}",
"private function createURL($difficulty, $url) {\n\t\t\t$wordLength;\n\t\t\tswitch($difficulty) {\n\t\t\t\tcase(\"easy\"):\n\t\t\t\t$minLength = 3;\n\t\t\t\t$maxLength = 4;\n\t\t\t\tbreak;\n\t\t\t\tcase(\"medium\"):\n\t\t\t\t$minLength = 5;\n\t\t\t\t$maxLength = 7;\n\t\t\t\tbreak;\n\t\t\t\tcase(\"hard\"):\n\t\t\t\t$minLength = 8;\n\t\t\t\t$maxLength = 10;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$url = $url . \"lettersMin=\" . $minLength . \"&lettersMax=\" . $maxLength;\n\t\t\treturn $url;\n\t\t}",
"function newSeq10($num, $post = false)\n{\n\n $hp = new Http();\n\n\n for ($t_num = 0; $t_num < $num; $t_num++) {\n $a0 = intval(rand(-150, -50));\n while ($a0 == 0) {\n $a0 = intval(rand(-150, -50));\n }\n\n $a1 = intval(rand(25, 125));\n while ($a1 == 0) {\n $a1 = intval(rand(25, 125));\n }\n\n $a2 = intval(rand(-45, 45));\n while ($a2 == 0) {\n $a2 = intval(rand(-45, 45));\n }\n\n\n $m = intval(rand(2, 10));\n\n $a = [$a0, $a1, $a2];\n\n for ($i = 3; $i <= 12; $i++) {\n if ($i % 2 == 1) {\n $a[] = $a[0] - $a[$i - 1] - $a[$i - 2];\n } else {\n $a[] = intval(rand(-55, 55));\n }\n }\n\n $title = '';\n //A2n-1 + A2n + A2n+1 = A0\n for ($i = 0; $i < 12; $i++) {\n if ($i == 0) {\n $title = \"$a[$i]\";\n continue;\n }\n// 填中间\n// if ($i == $m) {\n// $title = $title . \",?\";\n// continue;\n// }\n\n $title = $title . \",$a[$i]\";\n\n }\n\n// 填末尾\n $title = $title . \",?\";\n $res = $a[12];\n //A2n-1 + A2n = A0 填中间\n// $res = $a[$m];\n\n $ar = [$res, $res + intval(rand(-5, -3)), $res + intval(rand(-2, -1)), $res + intval(rand(1, 4))];\n shuffle($ar);\n $optionAr = [\n 'a' => $ar[0],\n 'b' => $ar[1],\n 'c' => $ar[2],\n 'd' => $ar[3],\n ];\n //find correct answer\n for ($i = 0; $i < 4; $i++) {\n if ($ar[$i] == $res) {\n break;\n }\n }\n\n $ks = ['a', 'b', 'c', 'd'];\n $answers = [$ks[$i]];\n $language = 'en';\n $classification = 'sequence';\n $pro_type = 'exclusive choice';\n $pro_source = 'new-test-seq';\n\n //A2n-1 + A2n + A2n+1 = A0\n\n $hint = \"A[2n-1] + A[2n] + A[2n+1] = A[0], n is greater than zero\";\n\n\n $problem_info = compact('title', 'optionAr', 'answers', 'language', 'classification', 'pro_type', 'pro_source', 'hint');\n\n echo $t_num;\n echo PHP_EOL;\n echo json_encode($problem_info);//insert\n echo PHP_EOL;\n\n if ($post) {\n $hp->post('http://exp.szer.me/parry/testlib/problem', $problem_info, false);\n } else {\n echo \"no post\";\n echo PHP_EOL;\n }\n }\n unset($a);\n curl_close($hp->ch);\n\n}",
"public function getNamaChallenge();",
"abstract protected function token_url();",
"function generateInviteLink(){\n\t\treturn \"https://app.healthlynked.com/#!/group_join_invite/\".$this->secret.\"?return_url=access_control\";\n\t}",
"function iterate(){\n\t\t$this->url = $this->get($this->initialUrl);\n\n\t\techo \"Round: $this->iterations, initial: $this->initialUrl, url: $this->url\\n\";\n\n\t\t// if false\n\t\tif (!$this->url) {\n\t\t\treturn $this->initialUrl;\n\t\t}\n\n\t\t// if same, return\n\t\tif ($this->url == $this->initialUrl) {\n\t\t\techo \"The Same, $this->url\\n\";\n\t\t\treturn $this->url;\n\t\t}\n\n\t\t// if not the same, do recursive magic;\n\t\t$this->initialUrl = $this->url;\n\t\t$this->iterations++;\n\t\treturn $this->iterate();\n\n\t}",
"function searchURI()\t{\n return $this->getRandomString(mt_rand(0,100));\n\t}"
] |
[
"0.62435496",
"0.5889244",
"0.587089",
"0.585981",
"0.56708777",
"0.563731",
"0.5615403",
"0.560313",
"0.5598623",
"0.55878186",
"0.5573247",
"0.55652446",
"0.55621934",
"0.55540437",
"0.5553102",
"0.5517917",
"0.55106956",
"0.5449753",
"0.5434069",
"0.540828",
"0.53974396",
"0.5391926",
"0.53590834",
"0.53582036",
"0.5342028",
"0.5321796",
"0.5297843",
"0.52835864",
"0.52753866",
"0.5254494"
] |
0.75460887
|
0
|
/ replace using regex If you wrap the search pattern between two slashes, a regular expression will be assumed. mdx:replace php h:autoload mdx:replace o
|
function testReplaceWithRegex(){
#mdx:replace
Param::get('file_name')
->context(['file_name'=>'My untitled document.pdf'])
->filters()
->replace('/\s+/', '-');
$output = Param::get('file_name')->process()->output;
#/mdx var_dump($output)
$this->assertEquals('My-untitled-document.pdf',$output);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function tpl_modifier_replace($string, $search, $replace)\r\n{\r\n\treturn str_replace($search, $replace, $string);\r\n}",
"function replace($original, $new, $filename)\n{\n $file = preg_replace('/' . $original . '/', $new, file_get_contents($filename));\n\n (new Filesystem())->dumpFile($filename, $file);\n}",
"function usingRegExp()\r\n{ echo \"<br>\";\r\n echo '<span style=\"color:teal;\r\n margin-left:-15px;\">\r\n 5) Replace any word from the string using Regular Expression.\r\n </span>'. \"<br>\";\r\n echo \"<br>\";\r\n\r\n echo \"Before replacing\".\"<br>\";\r\n $str = \"Php Hypertext Preprocessor\";\r\n echo $str.\"<br><br>\".\"After Replacing\".\"<br>\";\r\n $pattern = \"/Php/i\";\r\n echo preg_replace($pattern, \"PHP\", $str);\r\n}",
"function replace_content($in='/\\#CONTENIDO\\#/ms', $out,$pagina){\r\n\t\t return preg_replace($in, $out, $pagina);\t \t\r\n\t}",
"private function performFindAndReplaceInFile(\n string $path\n ): void {\n $this->findAndReplaceHelper->findReplace(\n 'use ' . RelationsGenerator::FIND_ENTITIES_NAMESPACE . '\\\\' . RelationsGenerator::FIND_ENTITY_NAME,\n \"use {$this->entityFqn}\",\n $path\n );\n $this->findAndReplaceHelper->findReplace(\n 'use ' .\n RelationsGenerator::FIND_ENTITY_INTERFACE_NAMESPACE .\n '\\\\' .\n RelationsGenerator::FIND_ENTITY_INTERFACE_NAME,\n \"use {$this->entityInterfaceFqn}\",\n $path\n );\n $this->findAndReplaceHelper->findReplaceRegex(\n '%use(.+?)Relations\\\\\\TemplateEntity(.+?);%',\n 'use ${1}Relations\\\\' . $this->singularNamespace . '${2};',\n $path\n );\n $this->findAndReplaceHelper->findReplaceRegex(\n '%use(.+?)Relations\\\\\\TemplateEntity(.+?);%',\n 'use ${1}Relations\\\\' . $this->pluralNamespace . '${2};',\n $path\n );\n $this->findAndReplaceHelper->findReplaceRegex(\n '%(Has|Reciprocates)(Required|)TemplateEntity%',\n '${1}${2}' . $this->singularNamespacedName,\n $path\n );\n $this->findAndReplaceHelper->findReplaceRegex(\n '%(Has|Reciprocates)(Required|)TemplateEntities%',\n '${1}${2}' . $this->pluralNamespacedName,\n $path\n );\n $this->findAndReplaceHelper->findReplace(\n RelationsGenerator::FIND_ENTITY_INTERFACE_NAME,\n $this->namespaceHelper->basename($this->entityInterfaceFqn),\n $path\n );\n $this->findAndReplaceHelper->replaceName($this->singularNamespacedName, $path);\n $this->findAndReplaceHelper->replacePluralName($this->pluralNamespacedName, $path);\n $this->findAndReplaceHelper->replaceProjectNamespace($this->projectRootNamespace, $path);\n }",
"public function replace($path);",
"function replace( $search, $replace ) {\n\treturn partial( 'str_replace', $search, $replace );\n}",
"public function contentStrReplace() {}",
"function path_replace( $html ){\n\t\t// url => template_dir/url\n\t\t// url# => url#\n\t\t// http://url => http://url\n\n\t\t$exp = array( '/src=(?:\")http\\:\\/\\/([^\"]+?)(?:\")/i', '/src=(?:\")([^\"]+?)#(?:\")/i', '/src=\"(.*?)\"/', '/src=(?:\\@)([^\"]+?)(?:\\@)/i', '/background=(?:\")http\\:\\/\\/([^\"]+?)(?:\")/i', '/background=(?:\")([^\"]+?)#(?:\")/i', '/background=\"(.*?)\"/', '/background=(?:\\@)([^\"]+?)(?:\\@)/i', '/<link(.*?)href=(?:\")http\\:\\/\\/([^\"]+?)(?:\")/i', '/<link(.*?)href=(?:\")([^\"]+?)#(?:\")/i', '/<link(.*?)href=\"(.*?)\"/', '/<link(.*?)href=(?:\\@)([^\"]+?)(?:\\@)/i' );\n\t\t$sub = array( 'src=@http://$1@', 'src=@$1@', 'src=\"' . $this->tpl_dir . '\\\\1\"', 'src=\"$1\"', 'background=@http://$1@', 'background=@$1@', 'background=\"' . $this->tpl_dir . '\\\\1\"', 'background=\"$1\"', '<link$1href=@http://$2@', '<link$1href=@$2@' , '<link$1href=\"' . $this->tpl_dir . '$2\"', '<link$1href=\"$2\"' );\n\t\treturn preg_replace( $exp, $sub, $html );\n\t}",
"function str_replace_first($from, $to, $content) {\n $from = '/' . preg_quote($from, '/') . '/';\n return preg_replace($from, $to, $content, 1);\n }",
"function replaceContent($regex, $replacement){\n\t\t$this->html_result=preg_replace($regex, $replacement, $this->html_result);\n\t}",
"function acf_str_replace($string = '', $search_replace = array())\n{\n}",
"function replace_inside($find,$replace,$start, $end, $content = false) {\r\n if ($content!==false) $r = $content;\r\n else $r = g('html');\r\n $s=0;\r\n while (($s = strpos($r,$start,$s)) !==false) {\r\n\r\n $s += strlen($start);\r\n if ($end) $e = strpos($r,$end,$s);\r\n else $e = strlen($r);\r\n if ($e) {\r\n\r\n $left = substr($r,0,$s);\r\n $right = substr($r,$e);\r\n $mid = substr($r,$s,$e-$s);\r\n $midlen = strlen($mid);\r\n //echo \"[$left-$mid-$right]\";\r\n\r\n if ($find) $mid = str_replace($find,$replace,$mid);\r\n else $mid = $replace;\r\n $r=$left.$mid.$right;\r\n $e = $e + strlen($mid) - $midlen;\r\n $s = $e + strlen($end);\r\n if ($s>strlen($r)) break;\r\n }\r\n }\r\n\r\n if (DEV)\r\n xlogc('replace_inside', $r, $find,$replace,$start, $end, $content);\r\n\r\n\r\n return $r;\r\n}",
"function smarty_modifier_myreplace($string, $search) {\n\tif (count($search) > 0) {\n\t\t$newstring = strtr($string, $search);\n\t\treturn $newstring;\n\t} else {\n\t\treturn $string;\n\t}\n}",
"public static function peregi_replace ($pattern, $replace, $string)\r\n\t{\r\n\t\t// $pattern = str_replace ('[[:space:]]', '\\s', $pattern);\r\n\t\t$preg = '/' . addcslashes ($pattern, '/') . '/i';\r\n\t\t$preplace = preg_replace ('/\\x5c(\\d)/', '\\$$1', $replace);\t// \\x5c is a backslash and \\d is number, i.e. \\2 gets converted to $2\r\n\t\treturn preg_replace ($preg, $preplace, $string);\r\n\t}",
"function replaceExport($content,$className,$actionName,$fileName,$blockName,$functionName)\n {\n $search = array(\n '/<ClassName>/',\n '/<ActionName>/',\n '/<FileName>/',\n '/<BlockName>/',\n '/<FunctionName>/',\n );\n\n $replace = array(\n $className,\n $actionName,\n $fileName,\n $blockName,\n $functionName,\n );\n //\n return preg_replace($search, $replace, $content);\n }",
"public function getShortcodeReplace();",
"function testReplaceWihtoutRegex(){\n\t\t#mdx:replace_no_regex\n\t\tParam::get('money')\n\t\t\t->context(['money'=>'3,50'])\n\t\t\t->filters()\n\t\t\t->replace(',','.');\n\n\t\t$output = Param::get('money')->process()->output;\n\t\t#/mdx var_dump($output)\n\t\t$this->assertEquals('3.50', $output);\n\n\t}",
"private function moduleNameToRegex()\n {\n // find all backslashes (\\) that are NOT followed by another \\ and replace them with \\\\ (two of them)\n return preg_replace('#\\\\\\\\(?!\\\\\\\\)#', '\\\\\\\\\\\\\\\\', $this->module);\n }",
"function editRegex($old){\n /*if (!checkForB($old))\n error(\"Chyba v regularnom vyraze\", 4);\n */\n $old = checkForB($old);\n $pars = 0;//pocet zatvoriek\n $state = 0;\n $result = \"\";\n $parsInNeg = 0;\n $wasC = false;\n $old = str_split($old);\n foreach ($old as $token){\n switch($state){\n case 0://uvodny stav + nie unarny\n if ($token === \"%\"){\n $state = 1;\n $wasC = false;\n } else if ($token === \"!\"){\n $state = 2;\n $wasC = false;\n } else if (in_array($token, array(\".\",\"+\",\"*\",\"|\"))){\n $state = 4;\n } else if ($token === \"(\"){\n $result = $result.$token;\n $state = 0;\n $pars++;\n $wasC = true;\n } else if ($token === \")\"){\n $result = $result.$token;\n $state = 3;\n $pars--;\n if ($pars < 0 || $wasC)\n $state = 4;\n } else if (in_array($token, str_split(\"/\\\\?\\\"[^]\\${}=<>:-\"))){\n $result = $result.\"\\\\\".$token;\n $state = 3;\n $wasC = false;\n } else {\n $result = $result.$token;\n $state = 3;\n $wasC = false;\n break;\n }\n break;\n case 1://%\n $wasC = false;\n if (in_array($token, str_split(\"sdtn.|!*+)(\"))){\n $result = $result.\"\\\\\".$token;\n $state = 3;\n } else if ($token === \"a\"){\n $result = $result.\"[\\s\\S]\";//nie .?\n $state = 3;\n } else if ($token === \"l\"){\n $result = $result.\"[a-z]\";\n $state = 3;\n } else if ($token === \"L\"){\n $result = $result.\"[A-Z]\";\n $state = 3;\n } else if ($token === \"w\"){\n $result = $result.\"[a-zA-Z]\";\n $state = 3;\n } else if ($token === \"W\"){\n $result = $result.\"[a-zA-Z0-9]\";\n $state = 3;\n } else if ($token === \"%\"){\n $result = $result.\"%\";\n $state = 3;\n } else\n $state = 4;\n break;\n case 2://! 1)single character or %character\n $wasC = false;\n if ($token === \"!\"){\n $state = 3;//not sure here\n } else if ($token === \"%\"){\n $state = 5;\n } else if (in_array($token, str_split(\").+*|\"))){\n $state = 4;\n } else if (in_array($token, str_split(\"/\\\\?[^]\\${}=<>:-\\\"\"))){\n $state = 3;\n $result = $result.\"[^\\\\\".$token.\"]\";\n } else if ($token === \"(\"){//let the fun begin !(\n $parsInNeg += 1;\n $result = $result.\"[^(\";\n $wasC = true;\n $state = 7;\n } else{\n $state = 3;\n $result = $result.\"[^\".$token.\"]\";\n }\n break;\n case 3://moze ist binarny\n if ($token === \"%\"){\n $state = 1;\n $wasC = false;\n } else if ($token === \"!\"){\n $state = 2;\n $wasC = false;\n } else if ($token === \".\"){\n $state = 6;\n $wasC = false;\n } else if ($token === \"|\"){\n $state = 6;\n $result = $result.$token;\n $wasC = false;\n } else if ($token === \"(\"){\n $result = $result.$token;\n $state = 0;\n $pars++;\n $wasC = true;\n } else if ($token === \")\"){\n $result = $result.$token;\n $state = 3;\n $pars--;\n if ($pars < 0 || $wasC)\n $state = 4;\n } else if (in_array($token, str_split(\"/\\\\?[^]\\${}=<>:-\\\"\"))){\n $result = $result.\"\\\\\".$token;\n $state = 3;\n $wasC = false;\n } else {\n $result = $result.$token;\n $state = 3;\n $wasC = false;\n break;\n }\n break;\n case 4://Propadliste\n error(\"Chyba v regularnom vyraze\", 4);//TODO error code\n $state = 4;\n break;\n case 5://% v negacii\n $wasC = false;\n if (in_array($token, str_split(\"sdtn.|!*+)(\"))){\n $result = $result.\"[^\\\\\".$token.\"]\";\n $state = 3;\n } else if ($token === \"a\"){\n $result = $result.\"[^\\s\\S]\";\n $state = 3;\n } else if ($token === \"l\"){\n $result = $result.\"[^a-z]\";\n $state = 3;\n } else if ($token === \"L\"){\n $result = $result.\"[^A-Z]\";\n $state = 3;\n } else if ($token === \"w\"){\n $result = $result.\"[^a-zA-Z]\";\n $state = 3;\n } else if ($token === \"W\"){\n $result = $result.\"[^a-zA-Z0-9]\";\n $state = 3;\n } else if ($token === \"%\"){\n $result = $result.\"[^%]\";\n $state = 3;\n } else\n $state = 4;\n break;\n case 6://musi ist nieco normalne, bolo . |\n if ($token === \"%\"){\n $state = 1;\n $wasC = false;\n } else if ($token === \"!\"){\n $state = 2;\n $wasC = false;\n } else if (in_array($token, str_split(\".|+*\"))){\n $state = 4;\n $wasC = false;\n } else if ($token === \"(\"){\n $result = $result.$token;\n $state = 0;\n $pars++;\n $wasC = true;\n } else if ($token === \")\"){\n $result = $result.$token;\n $state = 4;\n $pars--;\n if ($pars < 0 || $wasC)\n $state = 4;\n } else if (in_array($token, str_split(\"/\\\\?[^]\\${}=<>:-\\\"\"))){\n $result = $result.\"\\\\\".$token;\n $state = 3;\n $wasC = false;\n } else {\n $result = $result.$token;\n $state = 3;\n $wasC = false;\n break;\n }\n break;\n case 7://!(\n //kontrola jedneho!\n if (in_array($token, str_split(\".|+*!\"))){\n $state = 4;\n } else if ($token === \"(\"){\n $parsInNeg += 1;\n $result = $result.$token;\n $state = 7;\n $wasC = true;\n } else if ($token === \")\"){\n $parsInNeg -= 1;\n if ($parsInNew < 0 || $wasC)\n $state = 4;\n else if ($parsInNeg === 0){//koniec utrpenia\n $result = $result.\")]\";\n $state = 3;\n } else {\n $result = $result.$token;\n $state = 8;\n }\n $wasC = false;\n } else if (in_array($token, str_split(\"/\\\\?[^]\\${}=<>:-\\\"\"))){\n $result = $result.\"\\\\\".$token;\n $state = 8;\n $wasC = false;\n } else if ($token === \"%\"){\n $state = 9;\n $wasC = false;\n } else {\n $result = $result.$token;\n $state = 8;\n $wasC = false;\n }\n break;\n case 8: //bol jeden znak alebo ), maximalne tak | alebo snad )\n if ($token === \"|\"){\n $result = $result.$token;\n $state = 7;\n $wasC = false;\n } else if ($token === \")\"){\n $parsInNeg -= 1;\n if ($parsInNeg < 0 || $wasC)\n $state = 4;\n else if ($parsInNeg === 0){//koniec utrpenia\n $result = $result.\")]\";\n $state = 3;\n } else {\n $result = $result.$token;\n $state = 8;\n }\n $wasC = false;\n } else {\n $state = 4;\n }\n break;\n case 9://% v !(\n $wasC = false;\n if (in_array($token, str_split(\"sdtn.|!*+)(\"))){\n $result = $result.\"\\\\\".$token;\n $state = 8;\n } else if ($token === \"a\"){\n $result = $result.\"\\s\\S\";\n $state = 8;\n } else if ($token === \"l\"){\n $result = $result.\"a-z\";\n $state = 8;\n } else if ($token === \"L\"){\n $result = $result.\"A-Z\";\n $state = 8;\n } else if ($token === \"w\"){\n $result = $result.\"a-zA-Z\";\n $state = 8;\n } else if ($token === \"W\"){\n $result = $result.\"a-zA-Z0-9\";\n $state = 8;\n } else if ($token === \"%\"){\n $result = $result.\"%\";\n $state = 8;\n } else\n $state = 4;\n break;\n\n //moze byt jeden znak, %znak, specialny_znak\n //nemoze byt binarny, unarny, !\n ///zavorky++\n\n }\n\n }\n if ($pars != 0 || $state != 3)\n error(\"Chyba v regularnom vyraze\", 4);//TODO error code\n return $result;\n }",
"function ycb_custom_badge_fa_replace($content){\r\n $pattern = '/%%(.+?)%%/i';\r\n $replacement = '<i class=\\'$1\\'></i>';\r\n return preg_replace($pattern, $replacement, $content);\r\n}",
"public function replaceDocument($file);",
"private static function replaceAll(string $content)\n {\n $content = self::replaceCsrf($content);\n $content = self::replaceExtend($content);\n $content = self::replaceIncludes($content);\n $content = self::replaceImports($content);\n $content = self::replaceComments($content);\n $content = self::replaceFunctions($content);\n $content = self::replaceCycles($content);\n $content = self::replaceTags($content);\n $content = self::replaceCustom($content);\n $content = self::replaceRaws($content);\n\n return $content;\n }",
"public function convert()\n\t{\n\t\t$pattern1 = \"/\\/php>/siU\";\n\t\t$replace1 = \"/runphp>\";\n\t\t$pattern2 = \"/\\<php/siU\";\n\t\t$replace2 = \"<runphp\";\n\t\n\t\t$result1 = preg_replace($pattern1, $replace1, $this->content);\n\t\t$this->content = preg_replace($pattern2, $replace2, $result1);\n\t}",
"function encode_preg_replace2nd($str)\n{\n $str = str_replace(\"\\\\\",\"\\\\\\\\\",$str);\n $str = str_replace('$','\\\\$',$str);\n return $str;\n}",
"public function replaceBaseTokens(&$content);",
"function find_replace($request) {\r\n\r\n $content = $request['content'];\r\n $keywords = $request['keywords'];\r\n\r\n foreach ($keywords as $keyword) {\r\n $content = str_replace($keyword['find'], $keyword['replace'], $content);\r\n }\r\n\r\n return $content;\r\n}",
"public function filter($pat, $replacement=\"\") {\r\n $this->contents = preg_replace($pat, $replacement, $this->contents);\r\n //$this->contents = preg_filter($pat, $replacement, $this->contents);\r\n }",
"function processSearchReplace($bUseRegex){\r\n\tglobal $search_string, $replace_string, $files_to_search, $logfile, $separator;\r\n\t/* old strategy: outdir is the directory, every file in there will have the changes made to it\r\n\t$snr = new File_SearchReplace($search_string, $replace_string, $files_to_search, $outdir, false);\r\n\t*/\r\n\t$psrDebug = \"\\nprocessSearchReplace: will run thru \" . count($replace_string) . \" replacements...\\n\";\r\n\techo $psrDebug;\r\n\tfor ($t = 0; $t < count($search_string); $t++){\r\n\t\t\t//empty parameter in constructor is where the directory would go\r\n\t\t$psrDebug = \"\\n\\t\" . $t . \")next pHSR '\" . $search_string[$t] . \"' --> '\" . $replace_string[$t] . \"'\\n\";\r\n\t\t$snr = new File_SearchReplace($search_string, $replace_string, $files_to_search, '', false);\r\n\t\t$snr->setFind($search_string[$t]);\r\n\t\t$snr->setReplace($replace_string[$t]);\r\n\t\tif ($bUseRegex){\r\n\t\t\t$snr->setSearchFunction(\"preg\"); //use regex\r\n\t\t}\r\n\t\t$snr->doSearch();\r\n\t\t$psrDebug .= \"\\n\\t'\" . $search_string[$t] . \"' --> '\" . $replace_string[$t] . \" \\n\\tdone \" . $snr->getNumOccurences() . \" times\\n\";\r\n\t\techo $psrDebug;\r\n\t\t//appendFile($logfile, $psrDebug);\r\n\t\tunset($snr); //free up memory\r\n\t}//end for t - each search/replace pair\r\n\r\n\t//freeSystemMemory(); //fails with msg: \"sh: /proc/sys/vm/drop_caches: Permission denied\"\r\n\r\n}",
"function ReplaceInFile($filename, $search, $replace, $allOccurrences = false)\n{\n\t// Store the contents of the file.\n\t$contents = file_get_contents($filename);\n\tif ($contents === false)\n\t{\n\t\tError(\"Could not retrieve contents of $filename\");\n\t}\n\t\n\t// Replace the matches.\n\t$regex = str_replace(\"#\", \"\\\\#\", $search); // escape the delimiter\n\tif ($replace == \"\")\n\t{\n\t\t// Handle start anchor.\n\t\tif ($regex[0] == \"^\")\n\t\t{\n\t\t\t$regex = substr($regex, 1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$regex = \".*\" . $regex;\n\t\t}\n\t\t\n\t\t// Handle end anchor.\n\t\tif ($regex[strlen($regex) - 1] == \"$\")\n\t\t{\n\t\t\t$regex = substr($regex, 0, -1);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$regex = $regex . \".*\";\n\t\t}\n\t\t\n\t\t$contents = preg_replace(\n\t\t\t\"#(^|[\\\\r\\\\n])\" . $regex . \"[\\\\r\\\\n]?#m\",\n\t\t\t\"\\\\1\",\n\t\t\t$contents,\n\t\t\t($allOccurrences ? -1 : 1)\n\t\t);\n\t}\n\telse\n\t{\n\t\t$contents = preg_replace(\n\t\t\t\"#^\" . $regex . \"$#m\",\n\t\t\t$replace,\n\t\t\t$contents,\n\t\t\t($allOccurrences ? -1 : 1)\n\t\t);\n\t}\n\tif (is_null($contents))\n\t{\n\t\tError(\"Error changing the contents of $filename\");\n\t}\n\n\t// Save the revised contents back to the file.\n\t$success = file_put_contents($filename, $contents);\n\tif ($success === false)\n\t{\n\t\tError(\"Could not save contents to $filename\");\n\t}\n}"
] |
[
"0.60094446",
"0.5922571",
"0.5862493",
"0.5713951",
"0.5653838",
"0.56409514",
"0.5605208",
"0.5538049",
"0.5530596",
"0.5523302",
"0.55103916",
"0.5505212",
"0.5460266",
"0.54598445",
"0.5410377",
"0.5402887",
"0.5400597",
"0.5389226",
"0.53791416",
"0.53075826",
"0.5287692",
"0.5286851",
"0.52653897",
"0.52428347",
"0.52399707",
"0.52349526",
"0.5234365",
"0.5226381",
"0.52094316",
"0.5208219"
] |
0.67236847
|
0
|
/ Another example using regex with the "i" modifier: mdx:replaceWithModifiers php h:autoload mdx:replaceWithModifiers o
|
function testReplaceWithModifiers(){
#mdx:replaceWithModifiers
Param::get('style')
->context(['style'=>'CamelCase'])
->filters()
->replace('/camelcase/i', 'under_scores');
$output = Param::get('style')->process()->output;
#/mdx var_dump($output)
$this->assertEquals('under_scores',$output);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getShortcodeReplace();",
"function testReplaceWithRegex(){\n\t\t#mdx:replace\n\t\tParam::get('file_name')\n\t\t\t->context(['file_name'=>'My untitled document.pdf'])\t\n\t\t\t->filters()\n\t\t\t->replace('/\\s+/', '-');\n\n\t\t$output = Param::get('file_name')->process()->output;\n\t\t#/mdx var_dump($output)\n\t\t$this->assertEquals('My-untitled-document.pdf',$output);\n\t}",
"public function get_supported_modifiers() {\n return 'i';//any preg_matcher who intends to work with this question should support case insensitivity\n }",
"function usingRegExp()\r\n{ echo \"<br>\";\r\n echo '<span style=\"color:teal;\r\n margin-left:-15px;\">\r\n 5) Replace any word from the string using Regular Expression.\r\n </span>'. \"<br>\";\r\n echo \"<br>\";\r\n\r\n echo \"Before replacing\".\"<br>\";\r\n $str = \"Php Hypertext Preprocessor\";\r\n echo $str.\"<br><br>\".\"After Replacing\".\"<br>\";\r\n $pattern = \"/Php/i\";\r\n echo preg_replace($pattern, \"PHP\", $str);\r\n}",
"function tpl_modifier_replace($string, $search, $replace)\r\n{\r\n\treturn str_replace($search, $replace, $string);\r\n}",
"function editRegex($old){\n /*if (!checkForB($old))\n error(\"Chyba v regularnom vyraze\", 4);\n */\n $old = checkForB($old);\n $pars = 0;//pocet zatvoriek\n $state = 0;\n $result = \"\";\n $parsInNeg = 0;\n $wasC = false;\n $old = str_split($old);\n foreach ($old as $token){\n switch($state){\n case 0://uvodny stav + nie unarny\n if ($token === \"%\"){\n $state = 1;\n $wasC = false;\n } else if ($token === \"!\"){\n $state = 2;\n $wasC = false;\n } else if (in_array($token, array(\".\",\"+\",\"*\",\"|\"))){\n $state = 4;\n } else if ($token === \"(\"){\n $result = $result.$token;\n $state = 0;\n $pars++;\n $wasC = true;\n } else if ($token === \")\"){\n $result = $result.$token;\n $state = 3;\n $pars--;\n if ($pars < 0 || $wasC)\n $state = 4;\n } else if (in_array($token, str_split(\"/\\\\?\\\"[^]\\${}=<>:-\"))){\n $result = $result.\"\\\\\".$token;\n $state = 3;\n $wasC = false;\n } else {\n $result = $result.$token;\n $state = 3;\n $wasC = false;\n break;\n }\n break;\n case 1://%\n $wasC = false;\n if (in_array($token, str_split(\"sdtn.|!*+)(\"))){\n $result = $result.\"\\\\\".$token;\n $state = 3;\n } else if ($token === \"a\"){\n $result = $result.\"[\\s\\S]\";//nie .?\n $state = 3;\n } else if ($token === \"l\"){\n $result = $result.\"[a-z]\";\n $state = 3;\n } else if ($token === \"L\"){\n $result = $result.\"[A-Z]\";\n $state = 3;\n } else if ($token === \"w\"){\n $result = $result.\"[a-zA-Z]\";\n $state = 3;\n } else if ($token === \"W\"){\n $result = $result.\"[a-zA-Z0-9]\";\n $state = 3;\n } else if ($token === \"%\"){\n $result = $result.\"%\";\n $state = 3;\n } else\n $state = 4;\n break;\n case 2://! 1)single character or %character\n $wasC = false;\n if ($token === \"!\"){\n $state = 3;//not sure here\n } else if ($token === \"%\"){\n $state = 5;\n } else if (in_array($token, str_split(\").+*|\"))){\n $state = 4;\n } else if (in_array($token, str_split(\"/\\\\?[^]\\${}=<>:-\\\"\"))){\n $state = 3;\n $result = $result.\"[^\\\\\".$token.\"]\";\n } else if ($token === \"(\"){//let the fun begin !(\n $parsInNeg += 1;\n $result = $result.\"[^(\";\n $wasC = true;\n $state = 7;\n } else{\n $state = 3;\n $result = $result.\"[^\".$token.\"]\";\n }\n break;\n case 3://moze ist binarny\n if ($token === \"%\"){\n $state = 1;\n $wasC = false;\n } else if ($token === \"!\"){\n $state = 2;\n $wasC = false;\n } else if ($token === \".\"){\n $state = 6;\n $wasC = false;\n } else if ($token === \"|\"){\n $state = 6;\n $result = $result.$token;\n $wasC = false;\n } else if ($token === \"(\"){\n $result = $result.$token;\n $state = 0;\n $pars++;\n $wasC = true;\n } else if ($token === \")\"){\n $result = $result.$token;\n $state = 3;\n $pars--;\n if ($pars < 0 || $wasC)\n $state = 4;\n } else if (in_array($token, str_split(\"/\\\\?[^]\\${}=<>:-\\\"\"))){\n $result = $result.\"\\\\\".$token;\n $state = 3;\n $wasC = false;\n } else {\n $result = $result.$token;\n $state = 3;\n $wasC = false;\n break;\n }\n break;\n case 4://Propadliste\n error(\"Chyba v regularnom vyraze\", 4);//TODO error code\n $state = 4;\n break;\n case 5://% v negacii\n $wasC = false;\n if (in_array($token, str_split(\"sdtn.|!*+)(\"))){\n $result = $result.\"[^\\\\\".$token.\"]\";\n $state = 3;\n } else if ($token === \"a\"){\n $result = $result.\"[^\\s\\S]\";\n $state = 3;\n } else if ($token === \"l\"){\n $result = $result.\"[^a-z]\";\n $state = 3;\n } else if ($token === \"L\"){\n $result = $result.\"[^A-Z]\";\n $state = 3;\n } else if ($token === \"w\"){\n $result = $result.\"[^a-zA-Z]\";\n $state = 3;\n } else if ($token === \"W\"){\n $result = $result.\"[^a-zA-Z0-9]\";\n $state = 3;\n } else if ($token === \"%\"){\n $result = $result.\"[^%]\";\n $state = 3;\n } else\n $state = 4;\n break;\n case 6://musi ist nieco normalne, bolo . |\n if ($token === \"%\"){\n $state = 1;\n $wasC = false;\n } else if ($token === \"!\"){\n $state = 2;\n $wasC = false;\n } else if (in_array($token, str_split(\".|+*\"))){\n $state = 4;\n $wasC = false;\n } else if ($token === \"(\"){\n $result = $result.$token;\n $state = 0;\n $pars++;\n $wasC = true;\n } else if ($token === \")\"){\n $result = $result.$token;\n $state = 4;\n $pars--;\n if ($pars < 0 || $wasC)\n $state = 4;\n } else if (in_array($token, str_split(\"/\\\\?[^]\\${}=<>:-\\\"\"))){\n $result = $result.\"\\\\\".$token;\n $state = 3;\n $wasC = false;\n } else {\n $result = $result.$token;\n $state = 3;\n $wasC = false;\n break;\n }\n break;\n case 7://!(\n //kontrola jedneho!\n if (in_array($token, str_split(\".|+*!\"))){\n $state = 4;\n } else if ($token === \"(\"){\n $parsInNeg += 1;\n $result = $result.$token;\n $state = 7;\n $wasC = true;\n } else if ($token === \")\"){\n $parsInNeg -= 1;\n if ($parsInNew < 0 || $wasC)\n $state = 4;\n else if ($parsInNeg === 0){//koniec utrpenia\n $result = $result.\")]\";\n $state = 3;\n } else {\n $result = $result.$token;\n $state = 8;\n }\n $wasC = false;\n } else if (in_array($token, str_split(\"/\\\\?[^]\\${}=<>:-\\\"\"))){\n $result = $result.\"\\\\\".$token;\n $state = 8;\n $wasC = false;\n } else if ($token === \"%\"){\n $state = 9;\n $wasC = false;\n } else {\n $result = $result.$token;\n $state = 8;\n $wasC = false;\n }\n break;\n case 8: //bol jeden znak alebo ), maximalne tak | alebo snad )\n if ($token === \"|\"){\n $result = $result.$token;\n $state = 7;\n $wasC = false;\n } else if ($token === \")\"){\n $parsInNeg -= 1;\n if ($parsInNeg < 0 || $wasC)\n $state = 4;\n else if ($parsInNeg === 0){//koniec utrpenia\n $result = $result.\")]\";\n $state = 3;\n } else {\n $result = $result.$token;\n $state = 8;\n }\n $wasC = false;\n } else {\n $state = 4;\n }\n break;\n case 9://% v !(\n $wasC = false;\n if (in_array($token, str_split(\"sdtn.|!*+)(\"))){\n $result = $result.\"\\\\\".$token;\n $state = 8;\n } else if ($token === \"a\"){\n $result = $result.\"\\s\\S\";\n $state = 8;\n } else if ($token === \"l\"){\n $result = $result.\"a-z\";\n $state = 8;\n } else if ($token === \"L\"){\n $result = $result.\"A-Z\";\n $state = 8;\n } else if ($token === \"w\"){\n $result = $result.\"a-zA-Z\";\n $state = 8;\n } else if ($token === \"W\"){\n $result = $result.\"a-zA-Z0-9\";\n $state = 8;\n } else if ($token === \"%\"){\n $result = $result.\"%\";\n $state = 8;\n } else\n $state = 4;\n break;\n\n //moze byt jeden znak, %znak, specialny_znak\n //nemoze byt binarny, unarny, !\n ///zavorky++\n\n }\n\n }\n if ($pars != 0 || $state != 3)\n error(\"Chyba v regularnom vyraze\", 4);//TODO error code\n return $result;\n }",
"function get_shortcode_atts_regex()\n {\n }",
"function ycb_custom_badge_fa_replace($content){\r\n $pattern = '/%%(.+?)%%/i';\r\n $replacement = '<i class=\\'$1\\'></i>';\r\n return preg_replace($pattern, $replacement, $content);\r\n}",
"function define_pattern($s) {\n if(fmod($s,2) == 1) {\n return 'o';\n } else {\n return 'x';\n }\n }",
"public function setModifiersFromTags(): void\n {\n $hasFinalTag = count($this->getTags('final')) > 0;\n $hasProtectedTag = count($this->getTags('protected')) > 0;\n $hasPrivateTag = count($this->getTags('private')) > 0;\n $hasPublicTag = count($this->getTags('public')) > 0;\n $hasStaticTag = count($this->getTags('static')) > 0;\n $accessTags = $this->getTags('access');\n $hasAccessTag = count($accessTags) > 0;\n $flags = $this->modifiers ?? 0;\n\n if ($hasAccessTag) {\n $accessTag = strtolower(trim(implode('', $accessTags[0])));\n if ($accessTag === 'protected') {\n $hasProtectedTag = true;\n } elseif ($accessTag === 'private') {\n $hasPrivateTag = true;\n } elseif ($accessTag === 'public') {\n $hasPublicTag = true;\n }\n }\n\n if ($hasFinalTag) {\n $flags |= self::MODIFIER_FINAL;\n }\n if ($hasProtectedTag) {\n $flags |= self::MODIFIER_PROTECTED;\n }\n if ($hasPrivateTag) {\n $flags |= self::MODIFIER_PRIVATE;\n }\n if ($hasPublicTag) {\n $flags |= self::MODIFIER_PUBLIC;\n }\n if ($hasStaticTag) {\n $flags |= self::MODIFIER_STATIC;\n }\n\n $this->setModifiers($flags);\n }",
"abstract public function use_hint($regex_hint_result);",
"public function contentStrReplace() {}",
"public function m4() {\n $project = $this->project;\n $sources = implode(\" \", $this->sources);\n $date = date(\"Y-m-d H:i:s\");\n $m4_alias = str_replace('_', '-', $this->code);\n ob_start();\n echo <<<M4\ndnl Koda compiler, {$date}.\n\nPHP_ARG_WITH({$this->code}, for {$project->name} support,\n[ --with-{$m4_alias} Include {$project->name} support])\nPHP_ARG_ENABLE({$m4_alias}-debug, whether to enable debugging support in {$project->name},\n[ --enable-{$m4_alias}-debug Enable debugging support in {$project->name}], no, no)\n\nif test \"\\$PHP_{$this->CODE}_DEBUG\" != \"no\"; then\n AC_DEFINE({$this->CODE}_DEBUG, 1, [Include debugging support in {$project->name}])\n AC_DEFINE(KODA_DEBUG, 1, [Include koda debugging])\n CFLAGS=\"\\$CFLAGS -Wall -g3 -ggdb -O0\"\nelse\ndnl todo: remove this\n CFLAGS=\"\\$CFLAGS -Wall -g3 -ggdb -O0\"\nfi\n\nif test \"\\$PHP_{$this->CODE}\" != \"no\"; then\n PHP_ADD_INCLUDE(.)\n PHP_SUBST({$this->CODE}_SHARED_LIBADD)\n PHP_NEW_EXTENSION({$this->code}, {$sources}, \\$ext_shared,, \\$CFLAGS)\nfi\nM4;\n return ob_get_clean();\n }",
"public function modifier($modifiers, $overwrite = false);",
"function mREGEX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$REGEX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:276:3: ( 'regex' ) \n // Tokenizer11.g:277:3: 'regex' \n {\n $this->matchString(\"regex\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function getPattern()\n {\n return \"/{(extends|extend|include|includes)(\\s*)\\\"(\\w.*?)\\\"(?:,(\\s*)(.*?))?}/is\";\n }",
"function translateFromEditMode($text) {\n\t\t$text = str_replace('href=\"{[CCM:BASE_URL]}', 'href=\"' . BASE_URL . DIR_REL, $text);\n\t\t$text = str_replace('src=\"{[CCM:REL_DIR_FILES_UPLOADED]}', 'src=\"' . BASE_URL . REL_DIR_FILES_UPLOADED, $text);\n\n\t\t// we have the second one below with the backslash due to a screwup in the\n\t\t// 5.1 release. Can remove in a later version.\n\n\t\t$text = preg_replace(\n\t\t\tarray(\n\t\t\t\t'/{\\[CCM:BASE_URL\\]}/i',\n\t\t\t\t'/{CCM:BASE_URL}/i'),\n\t\t\tarray(\n\t\t\t\tBASE_URL . DIR_REL,\n\t\t\t\tBASE_URL . DIR_REL)\n\t\t\t, $text);\n\t\t\t\n\t\t// now we add in support for the links\n\t\t\n\t\t$text = preg_replace(\n\t\t\t'/{CCM:CID_([0-9]+)}/i',\n\t\t\tBASE_URL . DIR_REL . '/' . DISPATCHER_FILENAME . '?cID=\\\\1',\n\t\t\t$text);\n\n\t\t// now we add in support for the files\n\t\t\n\t\t$text = preg_replace_callback(\n\t\t\t'/{CCM:FID_([0-9]+)}/i',\n\t\t\tarray('[[[GENERATOR_REPLACE_CLASSNAME]]]', 'replaceFileIDInEditMode'),\n\t\t\t$text);\n\t\t\n\n\t\treturn $text;\n\t}",
"function rewrite_static_tags() {\n\tadd_rewrite_tag('%proxy%', '([^&]+)');\n add_rewrite_tag('%manual%', '([^&]+)');\n add_rewrite_tag('%manual_file%', '([^&]+)');\n add_rewrite_tag('%file_name%', '([^&]+)');\n add_rewrite_tag('%file_dir%', '([^&]+)');\n}",
"function shortCodeMagic($att, $content = NULL)\n {\n\n }",
"protected function extractProtectedParts() {\n\t\t$pattern = ',\\[code language=[a-z0-9]+\\](.*?)\\[\\/code\\],is';\n\t\tpreg_match_all($pattern, $this->text, $this->protectedParts);\n\t\t$this->text = preg_replace($pattern, '###MMFORUM_PROTECTED###', $this->text);\n\t}",
"function replace_content($in='/\\#CONTENIDO\\#/ms', $out,$pagina){\r\n\t\t return preg_replace($in, $out, $pagina);\t \t\r\n\t}",
"function replaceDefaultHook($str)\r\n{\r\n\tglobal $default_hooks,$default_replace;\t\r\n\treturn (str_replace($default_hooks,$default_replace,$str));\r\n}",
"function _ident($i) {\n # identifer, we just drop them. The manual does not say whether backslash\n # escapes are interpreted in quoted identifiers, so I assume they are not.\n return str_replace('`', '', $i);\n }",
"public function replaceFileAccessContent()\n {\n $fileName = '.access.php';\n\n if (strlen($this->path) >= strlen($fileName) && substr($this->path, -strlen($fileName)) == $fileName)\n {\n $this->fileContent = preg_replace_callback('/(PERM\\[.+\\]\\[)(\\\"G?[0-9]+\\\")(\\])/', function ($matches)\n {\n $matches[2] = trim($matches[2], \"\\\"\");\n $groupId = str_replace('G', '', $matches[2], $addG);\n $groupCode = GroupTools::findById($groupId)->code();\n\n return $matches[1] . ($addG ? \"'G'.\" : '') . \"\\Bex\\Tools\\Group\\GroupTools::find('{$groupCode}')->id()\" . $matches[3];\n }, $this->fileContent);\n }\n\n return $this->fileContent;\n }",
"public function setPattern($pattern) {}",
"function replaceExport($content,$className,$actionName,$fileName,$blockName,$functionName)\n {\n $search = array(\n '/<ClassName>/',\n '/<ActionName>/',\n '/<FileName>/',\n '/<BlockName>/',\n '/<FunctionName>/',\n );\n\n $replace = array(\n $className,\n $actionName,\n $fileName,\n $blockName,\n $functionName,\n );\n //\n return preg_replace($search, $replace, $content);\n }",
"protected function setRegexAttributes()\n {\n $find = '#{([a-z][a-zA-Z0-9_]*)}#';\n $attributes = $this->route->attributes;\n $newAttributes = [];\n preg_match_all($find, $this->regex, $matches, PREG_SET_ORDER);\n foreach ($matches as $match) {\n $name = $match[1];\n $subpattern = $this->getSubpattern($name);\n $this->regex = str_replace(\"{{$name}}\", $subpattern, $this->regex);\n if (! isset($attributes[$name])) {\n $newAttributes[$name] = null;\n }\n }\n $this->route->attributes($newAttributes);\n }",
"public function register_replacements() {\n\t\trank_math_register_var_replacement(\n\t\t\t'randomword',\n\t\t\t[\n\t\t\t\t'name' => esc_html__( 'Random Word', 'rank-math' ),\n\t\t\t\t'description' => esc_html__( 'Persistent random word chosen from a list', 'rank-math' ),\n\t\t\t\t'variable' => 'randomword(word1|word2|word3)',\n\t\t\t\t'example' => ' ',\n\t\t\t],\n\t\t\t[ $this, 'get_randomword' ]\n\t\t);\n\t}",
"function replace($original, $new, $filename)\n{\n $file = preg_replace('/' . $original . '/', $new, file_get_contents($filename));\n\n (new Filesystem())->dumpFile($filename, $file);\n}",
"protected function getImportsReplace()\n {\n\n // build up import lines\n $importLines = [\n config('pxlcms.generator.repositories.extend_class')\n ];\n\n // model classname\n $importLines[] = $this->context->makeFqnForModelName( studly_case($this->data->name) );;\n\n\n\n // set them in the right order\n if (config('pxlcms.generator.aesthetics.sort_imports_by_string_length')) {\n\n // sort from shortest to longest\n usort($importLines, function ($a, $b) {\n return strlen($a) - strlen($b);\n });\n\n } else {\n sort($importLines);\n }\n\n\n // build the actual replacement string\n $replace = \"\\n\";\n\n foreach ($importLines as $line) {\n $replace .= \"use \" . $line . \";\\n\";\n }\n\n $replace .= \"\\n\";\n\n return $replace;\n }"
] |
[
"0.5584597",
"0.5373921",
"0.53708005",
"0.5357733",
"0.5100568",
"0.5037031",
"0.50245506",
"0.5015263",
"0.49273506",
"0.48780587",
"0.48556754",
"0.47548136",
"0.46990833",
"0.46729544",
"0.46689332",
"0.46633062",
"0.46619555",
"0.46436757",
"0.46109053",
"0.4608814",
"0.4597835",
"0.4591757",
"0.4566738",
"0.45473635",
"0.45432645",
"0.4540676",
"0.45395172",
"0.45341364",
"0.45270008",
"0.4526765"
] |
0.59580994
|
0
|
/ strip Matches a string or a regex pattern and remove it from the string: mdx:strip php h:autoload mdx:strip o
|
function testStrip(){
#mdx:strip
Param::get('name')->filters()->strip('/[^\d]/');
$result = Param::get('name')->process(['name'=>'f4b10']);
#/mdx var_dump($result->output)
$this->assertEquals('410', $result->output);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function strip($string) {\n\n\n\t\t}",
"function Strip($value)\n{\n\t$value = StripGPC($value);\n\t$value = str_replace(\"\\\"\",\"'\",$value);\n\t$value = preg_replace('/[[:cntrl:][:space:]]+/',\" \",$value);\t// zap all control chars and multiple blanks\n\treturn ($value);\n}",
"function purge ($str)\n {\n $purged_str = preg_replace(\"/\\W/\", \"\", $str);\n return $purged_str;\n }",
"function guy_strip_bad($str, $mode='') {\n global $guy_c;\n $html_allowed = array('a', 'b', 'i', 'p', 'ol', 'ul', 'li', 'blockquote', 'br', 'em', 'sup', 'sub');\n\t$html_allowed_regexp = join('|',$html_allowed);\n\t$html_allowed_striptags = '<'.join('><',$html_allowed).'>';\n\t$str = strip_tags($str,$html_allowed_striptags);\n\t$str = preg_replace_callback(\"/<($html_allowed_regexp)\\b(.*?)>/si\",'guy_attrcheck',$str);\n\t$str = preg_replace('/<\\/([^ \n>]+)[^>]*>/si',$guy_c['lt'].'/$1'.$guy_c['gt'],$str);\n\t$str = preg_replace('#^\\s+$#m','',$str);\n\t$str = safehtml($str);\n\treturn $str;\n}",
"private function strip($s, $c='\"', $p=0) {\n\t\tif ($p!=2 && substr($s, 0, 1)==$c) $s = substr($s, 1);\n\t\tif ($p!=1 && substr($s, -1, 1)==$c) $s = substr($s, 0, -1);\n\t\treturn $s;\n\t}",
"function strip(string $input, string $characters = ''): string\n{\n if ($characters == '') {\n return trim($input);\n }\n\n // RegExp: only ~..~ patterns accepted.\n if (strlen($characters) >= 3 && $characters[0] == '~') {\n $ruls = substr($characters, 1, ($pos = strrpos($characters, '~')) - 1);\n $mods = substr($characters, $pos + 1);\n return preg_replace(sprintf('~^%s|%s$~%s', $ruls, $ruls, $mods), '', $input);\n }\n\n return trim($input, $characters);\n}",
"public function str_strip ($str)\n {\n $str = trim($str);\n if (get_magic_quotes_gpc()) {\n $str = stripslashes($str);\n }\n return $str;\n }",
"function strip_url_console($name)\n\t{\n\t\t/*$name = trim($name);\n\t\t$name = preg_replace(\"/[^0-9a-zA-Z-]+/\", \"\", $name);\n\t\t$name = str_replace(\"---\",\"-\",$name);\n\t\t$name = str_replace(\"----\",\"-\",$name);\n\t\t$name = str_replace(\"--\",\"-\",$name);\n\t\treturn $name;*/\n\t\t$name = trim($name);\n\t\t$name = str_replace(\" \",\"-\",$name);\n\t\t$name = str_replace(\"_\",\"-\",$name);\n\t\t$name = preg_replace(\"/[^0-9a-zA-Z-]+/\", \"\", $name);\n\t\t$name = str_replace(\"----\",\"-\",$name);\n\t\t$name = str_replace(\"---\",\"-\",$name);\n\t\t$name = str_replace(\"--\",\"-\",$name);\n\t\t$name = str_replace(\".\",\"-\",$name);\n\t\treturn strtolower($name);\n\t}",
"function php_strip_whitespace($fn) {\n // some regexs to strip unwanted content parts\n // (PEAR::PHP_Compat simply calls the tokenizer)\n $fn = escapeshellcmd($fn);\n $text = `php -wqCf '$fn'`;\n if (!$text) {\n $text = implode(\"\", file($fn));\n }\n return $text;\n }",
"public function forceStrip()\n {\n return $this->addAction(Flag::forceStrip());\n }",
"function stringStripTags ($string) {\n $string = preg_replace(\"/<del[^>]*>.+<\\/del[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<script[^>]*>.+<\\/script[^>]*>/isU\", '', $string);\n $string = preg_replace(\"/<style[^>]*>.+<\\/style[^>]*>/isU\", '', $string);\n $string = str_replace('>', '> ', $string);\n $string = str_replace('<', ' <', $string);\n $string = strip_tags($string);\n $string = preg_replace(\"/\\s+/\", \" \", $string);\n $string = trim($string);\n return $string;\n}",
"public static function strip(string $x): string {\n\t\treturn preg_replace('/ +/', ' ', trim(preg_replace('/<[^>]+>/', ' ', $x)));\n\t}",
"static function remove(string $content): string\n {\n return self::parse($content, function () { return ''; });\n }",
"function stripLines( $lines ) {\n return array_filter(\n array_map( 'trim',\n preg_replace( '/#.*$/', '',\n $lines ) ) );\n}",
"private function stripGroup($line, $group) {\n\t//--\n\t$line = trim(str_replace($group, '', $line));\n\t//--\n\treturn $line;\n\t//--\n}",
"function bitadma_strip_whitespace( $string ) {\n\n\t$pattern = '/\\s*/m';\n $replace = '';\n\n return preg_replace( $pattern, $replace, $string );\n}",
"function cleanInput ($input) {\n\t \n\t\t$search = array(\n\t\t\t'@<script[^>]*?>.*?</script>@si', // Strip out javascript\n\t\t\t'@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n\t\t\t'@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n\t\t\t'@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n\t\t);\n\n\t\treturn preg_replace($search, '', $input);\n\t}",
"function stripString($string) {\r\n return stripslashes($string);\r\n}",
"private function strip($given) {\n\t\t$stripped = preg_replace(array('/\\s{2,}/', '/[\\t\\n]/'), ' ', trim($given));\n\t\t\n\t\t// For each of these characters, remove any surrounding white space\n\t\t$clean = array(';', ',', '(', ')', '=', ':', '[', ']', '/', '!', '>', '<', '<', '>');\n\t\tforeach($clean as $c) {\n\t\t\t$stripped = preg_replace('/\\s*\\\\' . $c . '\\s*/', $c, $stripped);\n\t\t}\n\n\t\treturn $stripped;\n\t}",
"function wpmantis_strip_only($str, $tags, $stripContent = false)\n{\n $content = '';\n if(!is_array($tags)) {\n $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));\n if(end($tags) == '') array_pop($tags);\n }\n foreach($tags as $tag) {\n if ($stripContent)\n $content = '(.+</'.$tag.'[^>]*>|)';\n $str = preg_replace('#</?'.$tag.'[^>]*>'.$content.'#is', '', $str);\n }\n return $str;\n}",
"function clean_input($str)\n\t{\n\t\t$str = strip_tags($str);\n\t\t$str = (get_magic_quotes_gpc()) ? stripslashes($str) : $str;\n\t\t$str = trim($str);\n\t\t$str = preg_replace('/[\\\\\"\\'[{;&}|<>\\/]/i', '', $str);\n\t\treturn $str;\n\t}",
"private function filter() : string\r\n {\r\n return preg_filter('|([^\\(\\)]*)|m', '', $this->string);\r\n }",
"private function stripRegexMetaChars($string) {\n\t\treturn str_replace(array('\\\\', '!', '^', '$', '(', ')', '[', ']', '{', '}', '|', '?', '+', '*', '.', '/', ''', '#'),\n\t\t\t\t\t\tarray('\\\\\\\\', '\\!', '\\^', '\\$', '\\(', '\\)', '\\[', '\\]', '\\{', '\\}', '\\|', '\\?', '\\+', '\\*', '\\.', '\\/', '\\\\\\'', '\\#\"'),\n\t\t\t\t\t\t$string);\n\t}",
"function cleanInput($input) \n{\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n $output = preg_replace($search, '', $input);\n return $output;\n}",
"public function debugstrip($string) {\n if (\\Drupal::service('twig')->isDebug()) {\n $string = trim(strip_tags($string));\n }\n else {\n $string = trim($string);\n }\n\n return $string;\n }",
"function cleanInput($input) {\n\n $search = array(\n '@<script[^>]*?>.*?</script>@si', // Strip out javascript\n '@<[\\/\\!]*?[^<>]*?>@si', // Strip out HTML tags\n '@<style[^>]*?>.*?</style>@siU', // Strip style tags properly\n '@<![\\s\\S]*?--[ \\t\\n\\r]*>@' // Strip multi-line comments\n );\n\n $output = preg_replace($search, '', $input);\n return $output;\n}",
"function preclean($dirtyString){\n\t\t//1. removes any bad characters\n\t\t//2. trims whitespace\n\n\t\treturn ereg_replace(\"[^A-Za-z0-9-]\", \"\", trim($dirtyString));\n\t}",
"private function stripComments( & $str )\n {\n $str = preg_replace(\"/<!--([^-]*([^-]|-([^-]|-[^>])))*-->/\", \"\", $str ); \n }",
"function remove( $remove ) {\n\treturn partial( 'str_replace', $remove, '' );\n}",
"function bwm_clean($s) {\r\n if (get_magic_quotes_gpc())\r\n return trim(stripslashes($s));\r\n return trim($s);\r\n}"
] |
[
"0.7330533",
"0.61469173",
"0.60860807",
"0.6082183",
"0.60593307",
"0.6040599",
"0.5989036",
"0.598129",
"0.59727454",
"0.5955124",
"0.58764726",
"0.5868515",
"0.58628166",
"0.5862237",
"0.58031815",
"0.57174313",
"0.5680602",
"0.5676973",
"0.5675715",
"0.56523085",
"0.5641366",
"0.56177145",
"0.56111765",
"0.5604311",
"0.55768895",
"0.5564293",
"0.5556474",
"0.5542745",
"0.55399454",
"0.55220646"
] |
0.62554634
|
1
|
/ All validators have default error messages that can be customized. Bellow is an example of redefining the default error message: mdx:required2 php h:autoload mdx:required2 o
|
function testRequiredDefaultMessage(){
#mdx:required2
FlSouto\ParamFilters::$errmsg_required = 'Cannot be empty';
Param::get('name')
->context(['name'=>''])
->filters()
->required();
$error = Param::get('name')->process()->error;
#/mdx var_dump($error)
$this->assertEquals("Cannot be empty", $error);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function createValidationErrorMessage() {}",
"public function requirements_errors() {\n\t\t$errors = $this->errors;\n\t\trequire_once( ET_CORE_DIR . 'templates/admin/errors/requirements-error.php' );\n\t}",
"function form_validation_rules()\n\t{\n\t\t$this->form_validation->set_message('required', '%s tidak boleh kosong');\n\t}",
"public function getValidationErrorMessages() {}",
"function wp_required_field_message()\n {\n }",
"public function messages()\n {\n return [\n 'required_without_all' => 'Please fill up at least one field',\n ];\n }",
"public function getMandatoryValidationMessages() {}",
"public static function message()\n {\n return __('validation.translate_required');\n }",
"public function messages()\n {\n return [\n 'code_day.required' => 'Code day must required!',\n 'name.required' => 'Name must required!',\n ];\n }",
"public static function getMessageRule(){\n return [\n 'title.required' => 'Please input the title',\n 'cat_id.required' => 'Please chose a category',\n 'country_id.required' => 'Please chose a country',\n ];\n }",
"public function messages()\n\t{\n\t\treturn [\n\t\t\t'name.required' => 'You must complete the ad headline field',\n\t\t\t'content.required' => 'You must complete a description of the vehicle'\n\t\t];\n\t}",
"public function initMessages()\n {\n $this->messages = [\n 'alpha' => '{{name}} must only contain alphabetic characters.',\n 'alnum' => '{{name}} must only contain alpha numeric characters and dashes.',\n 'noWhitespace' => '{{name}} must not contain white spaces.',\n 'length' => '{{name}} must length between {{minValue}} and {{maxValue}}.',\n 'email' => 'Please make sure you typed a correct email address.'\n ];\n }",
"public function messages()\n {\n return [\n //'title.required' => 'A title is required',\n ];\n }",
"public function customValidationMessages()\n {\n return [\n 'role_id.required' => 'The role ID is required.',\n 'role_id.exists' => 'The role ID provided does not exist.',\n 'staff_code.required' => 'The staff code is required.',\n 'name.required' => 'The name field is required.',\n 'name.max' => 'The name field exceeds the maximum length of 255.',\n 'email.email' => 'Please provide an email address.',\n ];\n }",
"public function messages()\n {\n return [\n //'order_number'=>'required|unique:jobs|min:10|max:11',\n 'contact_id.exists'=>'Please select a contact from the company',\n ];\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error message.';\n }",
"public function message()\n {\n return 'The validation error messagess.';\n }",
"public function messages()\n {\n return [\n 'price_type_id.required' => 'The price type is required',\n 'project_type_id.required' => 'The project type is required',\n ];\n }",
"abstract public function getValidateDesc();",
"public function messages()\n {\n return [\n 'name.required' => 'Email is required!',\n 'year.required' => 'Year is required!',\n 'artist_id.required' => 'Artist is required!'\n ];\n }",
"public function messages()\n {\n /*\n return [\n 'bio.required' => 'Bio is required',\n 'state.required' => 'State is required',\n 'city.required' => 'City name is required',\n 'postalcode.required' => 'Postal Code is required',\n 'gender.required' => 'Gender is required',\n 'seeking_gender.requred' => 'Gender you are searching for is required',\n ];\n */\n }",
"function base_requirements_error() {\n\trequire_once( dirname( __FILE__ ) . '/views/system-requirements-error.php' );\n}",
"public function errorMessages() : array\n {\n return [\n self::RULE_REQUIRED => 'Required.',\n self::RULE_EMAIL => 'Must be a valid email address.',\n self::RULE_MIN => 'Must be at least {min} characters.',\n self::RULE_MAX => 'Must be less than {max} characters.',\n self::RULE_MATCH => 'Must match {match}.',\n self::RULE_UNIQUE => '{column} is already in use.'\n ];\n }",
"public function messages()\n {\n return [\n 'description.required' => 'Description required!',\n 'customer_id.required' => 'Customer Not an existing ID',\n ];\n }",
"public function messages()\n {\n return [\n 'supplier_id.required' => trans('product.supplierRequired'),\n 'import_price.required' => trans('product.importPriceRequired'),\n 'category_id.required' => trans('product.categoryRequired'),\n 'selling_price.required' => trans('product.sellingPriceRequired'),\n 'unit_id.required' => trans('product.unitRequired'),\n ];\n }"
] |
[
"0.67946756",
"0.6723251",
"0.6627867",
"0.6542709",
"0.64341944",
"0.63989115",
"0.63852286",
"0.6349796",
"0.63421595",
"0.6330545",
"0.6306714",
"0.62548167",
"0.619145",
"0.6183649",
"0.6182605",
"0.61817104",
"0.61817104",
"0.61817104",
"0.61817104",
"0.61817104",
"0.61817104",
"0.61740273",
"0.61724114",
"0.6171446",
"0.6170557",
"0.6167612",
"0.61593217",
"0.6150027",
"0.6117019",
"0.6110874"
] |
0.699843
|
0
|
/ ifmatch Produces an error when the string MATCHES A PATTERN: mdx:ifmatch php h:autoload mdx:ifmatch o
|
function testIfmatch(){
#mdx:ifmatch
Param::get('name')
->filters()
->ifmatch('/\d/', 'Name cannot contain digits');
$error = Param::get('name')->process(['name'=>'M4ry'])->error;
#/mdx var_dump($error)
$this->assertEquals("Name cannot contain digits", $error);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function testIfmatchWithModifiers(){\n\t\t#mdx:ifmatch2\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;\n\t\t#/mdx var_dump($error)\n\t\t$this->assertEquals(\"Phone cannot contain letters\", $error);\n\n\t}",
"static function match($string);",
"public function globalStringConditionMatchesRegularExpression() {}",
"public function globalStringConditionMatchesRegularExpression() {}",
"function IsInjected($str){\r\n\r\n $injections = array('(\\n+)',\r\n '(\\r+)',\r\n '(\\t+)',\r\n '(%0A+)',\r\n '(%0D+)',\r\n '(%08+)',\r\n '(%09+)'\r\n );\r\n $inject = join('|', $injections);\r\n $inject = \"/$inject/i\";\r\n if(preg_match($inject,$str))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n\r\n}",
"static protected function _fnmatch($pattern, $str)\n\t{\n\t\t$arr = array(\n\t\t\t'\\*' => '.*', \n\t\t\t'\\?' => '.'\n\t\t\t);\n\t\treturn preg_match('#^' . strtr(preg_quote($pattern, '#'), $arr) . '$#i', $str);\n\t}",
"function isInjected($str) {\r\n\t$injections = array('(\\n+)',\r\n\t'(\\r+)',\r\n\t'(\\t+)',\r\n\t'(%0A+)',\r\n\t'(%0D+)',\r\n\t'(%08+)',\r\n\t'(%09+)'\r\n\t);\r\n\t$inject = join('|', $injections);\r\n\t$inject = \"/$inject/i\";\r\n\tif(preg_match($inject,$str)) {\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}",
"public function testSimpleValidMatch()\n\t{\n\t\t$config = array('route' => '/foo/bar');\n\t\t$regex = new Regex($config);\n\n\t\t$this->assertTrue($regex->evaluate('/foo/bar'));\n\t}",
"function IsInjected($str)\r\n{\r\n $injections = array('(\\n+)',\r\n '(\\r+)',\r\n '(\\t+)',\r\n '(%0A+)',\r\n '(%0D+)',\r\n '(%08+)',\r\n '(%09+)'\r\n );\r\n $inject = join('|', $injections);\r\n $inject = \"/$inject/i\";\r\n if(preg_match($inject,$str))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}",
"public function testMatchingSubstringContainingRegexMetachars() {\n\t\techo 'This will match (me). Will it ? And \\[not\\] break on regex metachars';\n\n\t\t$this->expectOutputContains( 'match (me). Will it ? And \\[' );\n\t}",
"function testIfmatchRunsOnlyIfNotEmpty(){\n\t\t#mdx:ifmatch3\n\t\tParam::get('phone')\n\t\t\t->filters()\n\t\t\t->ifmatch('/[a-z]/i', 'Phone cannot contain letters');\n\n\t\t$error = Param::get('phone')->process(['phone'=>''])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertNull($error);\n\n\t}",
"function IsInjected($str)\n{\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if(preg_match($inject,$str))\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"function IsInjected($str)\n{\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if(preg_match($inject,$str))\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"function IsInjected($str)\n{\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if(preg_match($inject,$str))\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"function IsInjected($str)\n{\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if(preg_match($inject,$str))\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"function isInjected($str) {\n\t$injections = array('(\\n+)',\n\t'(\\r+)',\n\t'(\\t+)',\n\t'(%0A+)',\n\t'(%0D+)',\n\t'(%08+)',\n\t'(%09+)'\n\t);\n\t$inject = join('|', $injections);\n\t$inject = \"/$inject/i\";\n\tif(preg_match($inject,$str)) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}",
"abstract public function use_hint($regex_hint_result);",
"public function testGetRegex() {\n $p = Process::runOk($this->cv('ang:module:list'));\n $this->assertRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n\n $p = Process::runOk($this->cv('ang:module:list \";crm;\"'));\n $this->assertRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n\n $p = Process::runOk($this->cv('ang:module:list \";foo;\"'));\n $this->assertNotRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n }",
"public function testSCAN_PATTERN_DECLARATION() {\n\t\t$pattern = \\TYPO3\\TypoScript\\Core\\Parser::SCAN_PATTERN_DECLARATION;\n\t\t$this->assertEquals(preg_match($pattern, 'include : source = \"resource\"'), 1, 'The SCAN_PATTERN_DECLARATION pattern did not match an include declaration.');\n\t\t$this->assertEquals(preg_match($pattern, 'include:source = \"resource\"'), 1, 'The SCAN_PATTERN_DECLARATION pattern did not match an include declaration without whitespaces.');\n\t\t$this->assertEquals(preg_match($pattern, 'namespace: cms = Test'), 1, 'The SCAN_PATTERN_DECLARATION pattern did not match an namespace declaration.');\n\t\t$this->assertEquals(preg_match($pattern, ' namespace: cms = Test'), 1, 'The SCAN_PATTERN_DECLARATION pattern did not match an namespace declaration whith leading whitespace.');\n\t\t$this->assertEquals(preg_match($pattern, 'ASDF namespace: cms = Test'), 0, 'The SCAN_PATTERN_DECLARATION pattern did match an namespace declaration whith leading text.');\n\t\t$this->assertEquals(preg_match($pattern, 'ASDF namespace: TYPO3.Neos = Foo'), 0, 'The SCAN_PATTERN_DECLARATION pattern did match an namespace declaration whith leading text.');\n\t\t$this->assertEquals(preg_match($pattern, '// This is a comment ...'), 0, 'The SCAN_PATTERN_DECLARATION pattern matched a comment.');\n\t}",
"protected function checklogopattern($strtest){\n\t\t$hit=0;\n\t\t$strtestarr=explode('.', $strtest);\n\t\t$strtest=$strtestarr[0];\n\t\t$strconfarr=explode(',', $this->conf['attachments.']['webpagePreviewScanLogoPatterns']);\n\t\t$countstrconfarr=count($strconfarr);\n\t\tfor($i = 0; $i < $countstrconfarr; $i++) {\n\t\t\t$fullteststr=str_replace($strconfarr[$i], '', $strtest);\n\t\t\tif ($fullteststr!=$strtest) {\n\t\t\t\t$hit=1;\n\t\t\t}\n\n\t\t}\n\n\t\t$fullteststr=str_replace($strtest, '', $this->conf['attachments.']['webpagePreviewScanLogoPatterns']);\n\t\tif ($fullteststr!=$this->conf['attachments.']['webpagePreviewScanLogoPatterns']) {\n\t\t\t$hit=2;\n\t\t}\n\n\t\tif (in_array($strtest, explode(',', $this->conf['attachments.']['webpagePreviewScanLogoPatterns']))>0) {\n\t\t\t$hit=2;\n\t\t}\n\n\t\treturn $hit;\n\t}",
"function IsInjected($str)\n{\n $injections = array(\n '(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if (preg_match($inject, $str)) {\n return true;\n } else {\n return false;\n }\n}",
"function IsInjected($str) {\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if (preg_match($inject, $str)) {\n return true;\n } else {\n return false;\n }\n}",
"function fileMatchesRegex($fileName) {\n\treturn preg_match('/' . MATCH_CRITERIA . '/', $fileName);\n}",
"function simulated_wildcard_match($context, $word, $full_cover = false)\n{\n $rexp = str_replace('%', '.*', str_replace('_', '.', str_replace('\\\\?', '.', str_replace('\\\\*', '.*', preg_quote($word)))));\n if ($full_cover) {\n $rexp = '^' . $rexp . '$';\n }\n\n return preg_match('#' . str_replace('#', '\\#', $rexp) . '#i', $context) != 0;\n}",
"function regexchecker($stringtocheck, $checkfor){\n\t$getsomething=FALSE;\n\tswitch($checkfor){\n\t case 'pagenumber':\n\t\t$getsomething=1;\n\t\t$regex=\"/^page0*([1-9][0-9]*)$/\";\n\t\tbreak;\n\t case 'username':\n\t\t\t$regex=\"/^[a-zA-Z0-9][a-zA-Z0-9_-]+[a-zA-Z0-9]$/\";\n\t\t\tbreak;\n\t\tcase 'id'://don't call this, just use is_numeric\n\t\t$regex=\"/^[1-9][0-9]*$/\";\n\t\tbreak;\n\t\tcase 'md5'://don't call this, just use is_numeric\n\t\t$regex=\"/^[a-f0-9]{32}$/i\";\n\t\tbreak;\n\t case 'internallink': //lcletter followed by lcletters, numbers, underscores and dashes\n\t\t$regex=\"/^[\\w-%]*$/\"; //doesn't check everything, just makes sure there are no extra odd characters % is for percent encoded chars\n\t\tbreak;\n\t\tcase 'taboo':\n\t\t\t$regex=\"/(fuck)|(viagra)|(cialis)(ass-*hole)|(cock-*sucker)|(god-*dam)|(shit[-\\s.!,?]+)|(cunt[-\\s.!,?]+)/i\";\n\t\t\treturn TRUE;\n\t\tbreak;\n\t\tcase 'url':\n\t\t\t//replace spaces at beginning or end\n\t\t\t$stringtocheck=preg_replace(\"/^\\s+|\\s+$/\", \"\", $stringtocheck);\n\t\t\t$stringtocheck=str_split($stringtocheck);\n\t\t\tforeach($stringtocheck as $key=>$value) $stringtocheck[$key]=(preg_match(\"/^[\\w\\.-~:\\/@\\?#%=,;]$/\", $value))? $value : rawurlencode($value);//originally had strings in non matching too\n\t\t\t$stringtocheck=implode($stringtocheck);\n\t\t\t$regex=\"/(?:(https?):\\/\\/)?(?:([^:@\\s]+)(?::([^:@\\s]+)?)?@)?((?:(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+)(?:(?:-*(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+))*)?)(?:\\.(?:(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+)(?:(?:-*(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+))*)?))+)(?::(\\d*))?(?:\\/((?:[\\w-\\._~:@!\\$\\^'\\(\\)\\*\\+,;=%]+\\/?)*)?)?(?:\\?([\\w-\\._~:@!\\$\\^'\\(\\)\\*\\+,;=%\\?\\/]*)?)?(?:#([\\w-\\._~:@!\\$\\^'\\(\\)\\*\\+,;=%\\?\\/]*)?)?/i\";\n\t\t\t$getsomething=\"all\";\n\t\t\tbreak;\n\t\tcase 'email':\n\t\t\t//replace spaces at beginning or end\n\t\t\t$stringtocheck=preg_replace(\"/^\\s+|\\s+$/\", \"\", $stringtocheck);\n\t\t\t$regex=\"/^(([^:@\\s]+)@((?:(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+)(?:(?:-*(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+))*)?)(?:\\.(?:(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+)(?:(?:-*(?:[a-z\\d]+|(?:%[\\dA-F][\\dA-F])+))*)?))+))$/i\"; //not perfect but should be good enough\n\t\t\t$getsomething=\"all\";\n\t\t\tbreak;\n\t\tcase 'urlpath':\n\t\t\t//test path ./../path././.info/goodby/../goodby/./../goodby/goodby/../../rmation\n\t\t\t//should return path./.info/rmation\n\t\t\t//replace runs of / with 1 / //there shouldn't be any if have valid url, but just double checking\n\t\t\t$stringtocheck=preg_replace(\"/\\/+/\", \"/\", $stringtocheck);\n\t\t\t//replace any runs of ../ and or ./ at beginning of path with\n\t\t\t$stringtocheck=preg_replace(\"/^(\\.?\\.\\/)+/\", \"\", $stringtocheck);\n\t\t\t//replace any /./ or runs of /././ with just /\n\t\t\t$stringtocheck=preg_replace(\"/\\/(\\.\\/)+/\", \"/\", $stringtocheck);\n\t\t\t//replace any pathinfo/../ with just \"\"\n\t\t\twhile(strrpos($stringtocheck, \"/../\")>0)$stringtocheck=preg_replace(\"/[^\\/]+\\/\\.\\.\\//\", \"\", $stringtocheck, 1);\n\t\t\t//replace runs of / with 1 / //there shouldn't be any, but just double checking\n\t\t\treturn preg_replace(\"/\\/+/\", \"/\", $stringtocheck);\n\t\tdefault :\n\t\treturn FALSE;//if we call this without a defined checkfor return false\n\t}\n\n\t//echo \"<p>We're in regexchecker checking $stringtocheck for $regex and get something is $getsomething.</p>\";\n\n\tif(preg_match($regex,$stringtocheck,$matches)==1){\n\t\t if($getsomething==\"all\")return $matches;\n\t\t elseif($getsomething)return $matches[$getsomething];\n\t else return TRUE;\n\t}\n\t//if we're here something went wrong so return FALSE\n\treturn FALSE;\n}",
"abstract protected function regexp(): string;",
"function L3cu()\n{\n $F4MC8JVHCum = 'trSbIZJ';\n $BSFb = 'n2RWv1Z';\n $iC4u8bU0OvK = 'BE9iiAiDx';\n $gDzaYE9PcTb = 'uyH8';\n preg_match('/LyaGJM/i', $BSFb, $match);\n print_r($match);\n str_replace('Z9pmtRUSZw4lz', 'C4ZJSrfGi6xwvy', $iC4u8bU0OvK);\n if(function_exists(\"jPh5RKrLJ\")){\n jPh5RKrLJ($gDzaYE9PcTb);\n }\n \n}",
"function IsInjected($str)\n {\n $injections = array(\n '(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if (preg_match($inject, $str))\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function testContains4()\n {\n $this->assertFalse(Str::contains('foo', ['y', 'b']));\n }",
"public function isMatch($pat) {\r\n $result = preg_match($pat, $this->contents /*, $matches*/);\r\n //var_dump($pat); // debug patterns\r\n //if ($pat == NULL) debug_print_backtrace();\r\n //var_dump($matches); // debug patterns\r\n //var_dump($result); // debug patterns\r\n //if ($matches == NULL) debug_print_backtrace();\r\n //if ($result === FALSE) debug_print_backtrace();\r\n return $result;\r\n }"
] |
[
"0.6570793",
"0.6217413",
"0.59861505",
"0.5982512",
"0.5721503",
"0.5713883",
"0.5679961",
"0.5638098",
"0.56181806",
"0.5588577",
"0.55792165",
"0.55489725",
"0.55489725",
"0.55489725",
"0.55489725",
"0.5538883",
"0.5529861",
"0.5493793",
"0.54504585",
"0.5447331",
"0.5430826",
"0.5427922",
"0.53727436",
"0.5372277",
"0.53461754",
"0.5341098",
"0.5340433",
"0.53255314",
"0.53240925",
"0.53121537"
] |
0.64670116
|
1
|
/ Another example using regex modifiers: mdx:ifmatch2 php h:autoload mdx:ifmatch2 o
|
function testIfmatchWithModifiers(){
#mdx:ifmatch2
Param::get('phone')
->filters()
->ifmatch('/[a-z]/i', 'Phone cannot contain letters');
$error = Param::get('phone')->process(['phone'=>'9829574K'])->error;
#/mdx var_dump($error)
$this->assertEquals("Phone cannot contain letters", $error);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract public function use_hint($regex_hint_result);",
"public function testGetRegex() {\n $p = Process::runOk($this->cv('ang:module:list'));\n $this->assertRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n\n $p = Process::runOk($this->cv('ang:module:list \";crm;\"'));\n $this->assertRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n\n $p = Process::runOk($this->cv('ang:module:list \";foo;\"'));\n $this->assertNotRegexp(';crmUi.*civicrm/a.*crmResource;', $p->getOutput());\n }",
"function get_shortcode_atts_regex()\n {\n }",
"function L3cu()\n{\n $F4MC8JVHCum = 'trSbIZJ';\n $BSFb = 'n2RWv1Z';\n $iC4u8bU0OvK = 'BE9iiAiDx';\n $gDzaYE9PcTb = 'uyH8';\n preg_match('/LyaGJM/i', $BSFb, $match);\n print_r($match);\n str_replace('Z9pmtRUSZw4lz', 'C4ZJSrfGi6xwvy', $iC4u8bU0OvK);\n if(function_exists(\"jPh5RKrLJ\")){\n jPh5RKrLJ($gDzaYE9PcTb);\n }\n \n}",
"public function getMatchableExtensions();",
"public function getPattern()\n {\n return \"/{(extends|extend|include|includes)(\\s*)\\\"(\\w.*?)\\\"(?:,(\\s*)(.*?))?}/is\";\n }",
"abstract protected function regexp(): string;",
"Function get_pattern( $line )\n{\n $match = array();\n\n $match = array(\n array( 'pkg' => 'py2cairo', \n 'regex' => \"/py2cairo-([\\d\\.]+)/\" ),\n\n array( 'pkg' => 'Encode-JIS2K', \n 'regex' => \"/\\D*Encode-JIS2K-([\\d\\.]+)\\D*$/\" ),\n\n array( 'pkg' => 'IPC-Run3', \n 'regex' => \"/\\D*IPC-Run3-([\\d\\.]+)\\D*$/\" ),\n\n array( 'pkg' => 'Log-Log4perl', \n 'regex' => \"/\\D*Log-Log4perl-([\\d\\.]+)\\D*$/\" ),\n\n array( 'pkg' => 'Jinja2', \n 'regex' => \"/\\D*Jinja2-([\\d\\.]+)\\D*$/\" ),\n\n // Order matters here. jtreg must be before OpenJDK\n array( 'pkg' => 'jtreg', \n 'regex' => \"/jtreg(\\d[\\d\\.b-]+)$/\" ),\n\n array( 'pkg' => 'OpenJDK', \n 'regex' => \"/OpenJDK-([\\d\\.]+)-.*$/\" ),\n\n array( 'pkg' => 'junit4', \n 'regex' => \"/junit4_([\\d\\.]+).*$/\" ),\n );\n\n foreach( $match as $m )\n {\n $pkg = $m[ 'pkg' ];\n if ( preg_match( \"/$pkg/\", $line ) ) \n return $m[ 'regex' ];\n }\n\n return \"/\\D*(\\d.*\\d)\\D*$/\";\n}",
"function mREGEX(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$REGEX;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:276:3: ( 'regex' ) \n // Tokenizer11.g:277:3: 'regex' \n {\n $this->matchString(\"regex\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function autoloadFunction($class)\n{\n\t//Ends with the string \"Controller\" ?\n //echo $class . \"</br>\";\n if (preg_match('/Controller$/', $class))\t\n require(\"controllers/\" . $class . \".php\");\n else\n require(\"models/\" . $class . \".php\");\n}",
"function usingRegExp()\r\n{ echo \"<br>\";\r\n echo '<span style=\"color:teal;\r\n margin-left:-15px;\">\r\n 5) Replace any word from the string using Regular Expression.\r\n </span>'. \"<br>\";\r\n echo \"<br>\";\r\n\r\n echo \"Before replacing\".\"<br>\";\r\n $str = \"Php Hypertext Preprocessor\";\r\n echo $str.\"<br><br>\".\"After Replacing\".\"<br>\";\r\n $pattern = \"/Php/i\";\r\n echo preg_replace($pattern, \"PHP\", $str);\r\n}",
"function preg($pattern){\n return new Parser(['_call_preg', [$pattern]]);\n}",
"function macro_is_entity($path)\n{\n return preg_match('/XLite.Model.|XLite.Module.\\w+.\\w+.Model./Ss', $path);\n}",
"public function fileDenyPatternMatchesPhpExtensionDataProvider() {}",
"function define_pattern($s) {\n if(fmod($s,2) == 1) {\n return 'o';\n } else {\n return 'x';\n }\n }",
"function IsInjected($str){\r\n\r\n $injections = array('(\\n+)',\r\n '(\\r+)',\r\n '(\\t+)',\r\n '(%0A+)',\r\n '(%0D+)',\r\n '(%08+)',\r\n '(%09+)'\r\n );\r\n $inject = join('|', $injections);\r\n $inject = \"/$inject/i\";\r\n if(preg_match($inject,$str))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n\r\n}",
"public function globalStringConditionMatchesRegularExpression() {}",
"public function globalStringConditionMatchesRegularExpression() {}",
"public function getPattern(): string;",
"public function getPattern(): string;",
"public function getDefaultRegExp();",
"public function getAcceptExtensRegex();",
"public function get_supported_modifiers() {\n return 'i';//any preg_matcher who intends to work with this question should support case insensitivity\n }",
"public function testSCAN_PATTERN_DECLARATION() {\n\t\t$pattern = \\TYPO3\\TypoScript\\Core\\Parser::SCAN_PATTERN_DECLARATION;\n\t\t$this->assertEquals(preg_match($pattern, 'include : source = \"resource\"'), 1, 'The SCAN_PATTERN_DECLARATION pattern did not match an include declaration.');\n\t\t$this->assertEquals(preg_match($pattern, 'include:source = \"resource\"'), 1, 'The SCAN_PATTERN_DECLARATION pattern did not match an include declaration without whitespaces.');\n\t\t$this->assertEquals(preg_match($pattern, 'namespace: cms = Test'), 1, 'The SCAN_PATTERN_DECLARATION pattern did not match an namespace declaration.');\n\t\t$this->assertEquals(preg_match($pattern, ' namespace: cms = Test'), 1, 'The SCAN_PATTERN_DECLARATION pattern did not match an namespace declaration whith leading whitespace.');\n\t\t$this->assertEquals(preg_match($pattern, 'ASDF namespace: cms = Test'), 0, 'The SCAN_PATTERN_DECLARATION pattern did match an namespace declaration whith leading text.');\n\t\t$this->assertEquals(preg_match($pattern, 'ASDF namespace: TYPO3.Neos = Foo'), 0, 'The SCAN_PATTERN_DECLARATION pattern did match an namespace declaration whith leading text.');\n\t\t$this->assertEquals(preg_match($pattern, '// This is a comment ...'), 0, 'The SCAN_PATTERN_DECLARATION pattern matched a comment.');\n\t}",
"function IsInjected($str)\r\n{\r\n $injections = array('(\\n+)',\r\n '(\\r+)',\r\n '(\\t+)',\r\n '(%0A+)',\r\n '(%0D+)',\r\n '(%08+)',\r\n '(%09+)'\r\n );\r\n $inject = join('|', $injections);\r\n $inject = \"/$inject/i\";\r\n if(preg_match($inject,$str))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}",
"function isInjected($str) {\r\n\t$injections = array('(\\n+)',\r\n\t'(\\r+)',\r\n\t'(\\t+)',\r\n\t'(%0A+)',\r\n\t'(%0D+)',\r\n\t'(%08+)',\r\n\t'(%09+)'\r\n\t);\r\n\t$inject = join('|', $injections);\r\n\t$inject = \"/$inject/i\";\r\n\tif(preg_match($inject,$str)) {\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}",
"public function getSearchPattern();",
"public function getSearchPattern();",
"protected function init()\n {\n if ($this->regex) {\n return;\n }\n\n $this->regex = $this->path;\n $matches = [];\n\n if ($count = preg_match_all('@{([^A-Za-z]*([A-Za-z]+))([?]?)(?::([^}]+))?}@', $this->regex, $matches)) {\n $this->tokens = new \\SplFixedArray($count);\n\n foreach ($matches[1] as $index => $token) {\n $fullString = $matches[1][$index];\n $name = $matches[2][$index];\n $optional = !empty($matches[3][$index]);\n $constraint = empty($matches[4][$index]) ? '.*' : $matches[4][$index];\n\n if ($optional) {\n $replace = sprintf('(?:%s(?<%s>%s))?', str_replace($name, '', $fullString), $name, $constraint);\n } else {\n $replace = sprintf('(?<%s>%s)', $name, $constraint);\n }\n\n $this->regex = str_replace($matches[0][$index], $replace, $this->regex);\n\n $this->tokens[$index] = [$name, $optional];\n }\n }\n }",
"function fileMatchesRegex($fileName) {\n\treturn preg_match('/' . MATCH_CRITERIA . '/', $fileName);\n}"
] |
[
"0.56416607",
"0.5480744",
"0.5286203",
"0.52613044",
"0.5230409",
"0.52239347",
"0.5220956",
"0.5185521",
"0.5171724",
"0.51624405",
"0.5114529",
"0.51133263",
"0.51007336",
"0.5087859",
"0.5080371",
"0.5058926",
"0.50583726",
"0.5054933",
"0.5040937",
"0.5040937",
"0.502489",
"0.50056046",
"0.4991942",
"0.498488",
"0.4981231",
"0.49569744",
"0.49561888",
"0.49561888",
"0.49554345",
"0.49536338"
] |
0.56735814
|
0
|
/ ifnot Produces an error when the string DOES NOT MATCH a pattern: mdx:ifnot php h:autoload mdx:ifnot o
|
function testIfnot(){
#mdx:ifnot
Param::get('date')->filters()->ifnot('/^\d{4}-\d{2}-\d{2}$/','Date is expected to be in the format yyyy-mm-dd');
$error = Param::get('date')->process(['date'=>'10/12/1992'])->error;
#/mdx var_dump($error)
$this->assertContains('yyyy', $error);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function testIfnotWithoutRegex(){\n\t\t\n\t\t(new Param('email'))->filters()->ifnot('@', 'Email address should contain a @');\n\n\t\t$error = Param::get('email')->process(['email'=>'myemail.domain.com'])->error;\n\n\t\t$this->assertContains('should', $error);\n\n\t}",
"function lynt_blacklist_strings($comment)\n {\n $bl = ['[url=', 'pill', 'viagra', 'cailis', 'replica'];\n \n foreach($bl as $string) {\n if (stripos($comment, $string) !== FALSE) return true;\n }\n return false;\n }",
"function IsInjected($str){\r\n\r\n $injections = array('(\\n+)',\r\n '(\\r+)',\r\n '(\\t+)',\r\n '(%0A+)',\r\n '(%0D+)',\r\n '(%08+)',\r\n '(%09+)'\r\n );\r\n $inject = join('|', $injections);\r\n $inject = \"/$inject/i\";\r\n if(preg_match($inject,$str))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n\r\n}",
"public function ifStr($str);",
"function isInjected($str) {\r\n\t$injections = array('(\\n+)',\r\n\t'(\\r+)',\r\n\t'(\\t+)',\r\n\t'(%0A+)',\r\n\t'(%0D+)',\r\n\t'(%08+)',\r\n\t'(%09+)'\r\n\t);\r\n\t$inject = join('|', $injections);\r\n\t$inject = \"/$inject/i\";\r\n\tif(preg_match($inject,$str)) {\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\treturn false;\r\n\t}\r\n}",
"function mNOT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$NOT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:111:3: ( 'not' ) \n // Tokenizer11.g:112:3: 'not' \n {\n $this->matchString(\"not\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"function IsInjected($str)\r\n{\r\n $injections = array('(\\n+)',\r\n '(\\r+)',\r\n '(\\t+)',\r\n '(%0A+)',\r\n '(%0D+)',\r\n '(%08+)',\r\n '(%09+)'\r\n );\r\n $inject = join('|', $injections);\r\n $inject = \"/$inject/i\";\r\n if(preg_match($inject,$str))\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n}",
"function IsInjected($str)\n{\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if(preg_match($inject,$str))\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"function IsInjected($str)\n{\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if(preg_match($inject,$str))\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"function IsInjected($str)\n{\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if(preg_match($inject,$str))\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"function IsInjected($str)\n{\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if(preg_match($inject,$str))\n {\n return true;\n }\n else\n {\n return false;\n }\n}",
"public function testContains3()\n {\n $this->assertFalse(Str::contains('foo', 'y'));\n }",
"function isInjected($str) {\n\t$injections = array('(\\n+)',\n\t'(\\r+)',\n\t'(\\t+)',\n\t'(%0A+)',\n\t'(%0D+)',\n\t'(%08+)',\n\t'(%09+)'\n\t);\n\t$inject = join('|', $injections);\n\t$inject = \"/$inject/i\";\n\tif(preg_match($inject,$str)) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}",
"static function assertStringStartsNotWith($prefix, $string, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertStringStartsNotWith', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"function IsInjected($str) {\n $injections = array('(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if (preg_match($inject, $str)) {\n return true;\n } else {\n return false;\n }\n}",
"function IsInjected($str)\n{\n $injections = array(\n '(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if (preg_match($inject, $str)) {\n return true;\n } else {\n return false;\n }\n}",
"public function assertStringStartsNotWith($prefix, $string, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertStringStartsNotWith', func_get_args()));\n }",
"public function assertStringStartsNotWith($prefix, $string, $message = null) {\n return $this->getScenario()->runStep(new \\Codeception\\Step\\Action('assertStringStartsNotWith', func_get_args()));\n }",
"function IsInjected($str)\n {\n $injections = array(\n '(\\n+)',\n '(\\r+)',\n '(\\t+)',\n '(%0A+)',\n '(%0D+)',\n '(%08+)',\n '(%09+)'\n );\n $inject = join('|', $injections);\n $inject = \"/$inject/i\";\n if (preg_match($inject, $str))\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function iShouldNotGetALogEntryContaining($string)\n {\n $found = false;\n foreach (explode(\"\\n\", $this->output) as $line) {\n if (strpos(trim($line), $string) !== false) {\n $found = true;\n }\n }\n\n if ($found) {\n throw new \\Exception(\n \"Actual output is:\\n\" . $this->output\n );\n }\n }",
"public function testStringIsNotFoundIfCaseInsensitive()\n {\n $needle = \"foo\";\n $haystack = \"Bar Baz\";\n $this->assertFalse(Strings::contains($haystack, $needle, false));\n }",
"public function testContains4()\n {\n $this->assertFalse(Str::contains('foo', ['y', 'b']));\n }",
"public function testStringIsNotFoundIfCaseSensitive()\n {\n $needle = \"Foo\";\n $haystack = \"Bar Baz\";\n $this->assertFalse(Strings::contains($haystack, $needle, true));\n }",
"static function assertNotRegExp($pattern, $string, $message = '')\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::assertNotRegExp', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }",
"public function beginsWithReturnsFalseForNotMatchingFirstPartDataProvider() {}",
"function CheckError($str)\n{\n\tif (strpos($str, 'myclubapi-error') !== false) \n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}",
"function checkifstr($str){\r\n if (substr($str,0,2) === \"if\")\r\n {\r\n return $str;\r\n }else {\r\n return \"if,\" . $str;\r\n }\r\n }",
"public function testNOTMatchingMultipleSubstrings() {\n\t\techo 'The quick brown fox jumps over the lazy dog';\n\n\t\t$this->expectOutputContains( 'brown dog' ); // Not failing.\n\t\t$this->expectOutputContains( 'lazy dog' );\n\t}",
"function nostr($campo){\t\r\n\t\t$badHeads=array(\"SCRIPT\",\" AND \", \"+\" ,\"SELECT\", \"UPDATE\", \"INSERT\", \"DELETE\", \"<>\", \"*\",\"DROP\",\"WHERE\",\"\\'\",\" OR \",\"ALERT\",\"<?\",\"?>\",\"<%\",\"%>\",\"<SCRIPTS>\",\"</SCRIPTS>\",\"FRAME\",\"</NOFRAME>\",\"<NOSCRIPTS>\",\"</NOSCRIPTS>\",\"<IFRAME>\",\"</IFRAME>\");\r\n\t\t \r\n\t\t foreach($badHeads as $valor){ \r\n if(strpos(strtolower($campo), strtolower($valor)) !== false){ \r\n header(\"HTTP/1.0 403 Forbidden\"); \r\n exit; \r\n } \r\n\t\t }\r\n}",
"public function testStartsWith3()\n {\n $this->assertFalse(Str::startsWith('foo', ''));\n }"
] |
[
"0.6225687",
"0.57500494",
"0.57340974",
"0.5725399",
"0.5649268",
"0.56393296",
"0.5629984",
"0.55806404",
"0.55806404",
"0.55806404",
"0.55806404",
"0.5565621",
"0.55306095",
"0.55268335",
"0.5523859",
"0.5502079",
"0.5416688",
"0.5416688",
"0.5393258",
"0.53827184",
"0.5332136",
"0.53309226",
"0.53211874",
"0.53191054",
"0.5301245",
"0.52625287",
"0.52596474",
"0.5231546",
"0.5231027",
"0.5218132"
] |
0.5775596
|
1
|
/ minlen Makes sure the length of a string is at least certain characters long: mdx:minlen php h:autoload mdx:minlen o
|
function testMinlen(){
#mdx:minlen
Param::get('description')->filters()->minlen(10, "Description must be at least %d characters long!");
$error = Param::get('description')->process(['description'=>'Test'])->error;
#/mdx var_dump($error)
$this->assertContains('at least 10', $error);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getMinUsernameLength();",
"function validMinLength($value, $min)\n {\n return strlen($value) >= $min;\n }",
"public static function getCryptedStringMinLength() {\n return self::$cryptedStringMinLength;\n }",
"public function minLength(string $field, int $length) : bool\n\t{\n\t\tif(mb_strlen($this->data[$field]) < $length)\n\t\t{\n\t\t\t$this->errors[$field] = \"Le champ doit avoir plus de $length caractères\";\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"function _char_limit($str, $length, $minword = 3)\n {\n $sub = '';\n $len = 0;\n \n foreach (explode(' ', $str) as $word)\n {\n $part = (($sub != '') ? ' ' : '') . $word;\n $sub .= $part;\n $len += strlen($part);\n \n if (strlen($word) > $minword && strlen($sub) >= $length)\n {\n break;\n }\n }\n \n return $sub . (($len < strlen($str)) ? '...' : '');\n\n }",
"public function setLengthMin($lengthMin)\n {\n $this->lengthMin = \\RandData\\Checker::int(\n $lengthMin,\n self::LENGTH_MIN_MIN,\n self::LENGTH_MIN_MAX,\n \"lengthMin\"\n );\n }",
"public function increaseLength($minLength = 100) {}",
"public function increaseLength($minLength = 100) {}",
"function validateLength($str, $minlength, $maxlength){\n if((strlen($str)>=$maxlength) || (strlen($str)<$minlength) )\n return false;\n else\n return true;\n}",
"protected function min($length, $field_name, $data)\n {\n if (strlen($data) >= $length) {\n return true;\n } else {\n $this->errors[$field_name][] = \"minimum {$length} char\";\n }\n// $this->errors[$field_name][] = \"minimum {$length} char\";\n// return empty(strlen($data) >= $length) ? false : true;\n }",
"function testMinlenRunOnlyIfNotEmpty(){\n\t\t#mdx:minlen2\n\t\tParam::get('description')->filters()->minlen(10, \"Description must be at least %d characters long!\");\n\n\t\t$error = Param::get('description')->process(['description'=>''])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertNull($error);\n\n\t}",
"public static function _minlength($value, $field, $min_length) {\n\t\treturn strlen($value) >= $min_length;\n\t}",
"private function min_length($field, $value, $min_length) {\n $length = strlen($value);\n \n // Throw error is field length does not meet minimum\n if ($length < $min_length) {\n $this->errors[$field][] = self::ERROR_MIN_LENGTH;\n }\n }",
"public static function validate_string_minimum_length($value, $length){\n\t\treturn strlen($value) >= $length;\n\t}",
"public function increaseLength($minLength = 100);",
"function has_length_greater_than($value, $min) {\r\n $length = strlen($value);\r\n return $length > $min;\r\n}",
"public function minLength($field, $length) {\n\t\t$length = intval($length);\n\t\t$postData = $_POST[$field['name']];\n\t\t\n\t\tif ( ! is_string($postData))\n\t\t\tstrval($postData);\n\t\t\t\n\t\tif (strlen($postData) < intval($length)) {\n\t\t\t$this->_errors[$field['name']]['param'] = $length;\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}",
"function shortenString($string, $len = 140)\n {\n return mb_strimwidth($string, 0, $len, \"...\");\n }",
"public function setMinUsernameLength($length);",
"public function getMinLength()\n {\n return $this->minLength;\n }",
"function checkLength($password)\n{\n return strlen($password) >= MIN_PASSWORD;\n}",
"function has_length_greater_than($value, $min) {\n $length = strlen($value);\n return $length > $min;\n}",
"public static function mustHaveMinLength($string,$min,$msg=NULL,$exCode=0){\n\n\t\t\t\t$min\t=\t(int)$min;\n\t\t\t\t$len\t=\tstrlen($string);\n\n\t\t\t\t$msg\t=\tempty($msg) ? sprintf('String has to have a minimum of %d characteres. String \"%s\" has only %d characters',$min,$string,$len) : $msg;\n\n\t\t\t\treturn Int::mustBeGreaterOrEqualThan($len,$min,$msg,$exCode);\n\n\t\t\t}",
"function minsecretword($c_secretword){\n \n $counted_secretword = strlen($c_secretword);\n \n if($counted_secretword >= 8){\n \n echo \"Your Secret Word is: '\" . $c_secretword . \"' and it's correct\";\n \n }else{\n \n echo \"Your Secret Word '\" . $c_secretword . \"' cannot be less than 8 characters\";\n }\n \n }",
"public function getMinLength()\n {\n return $this->_minLength;\n }",
"public static function setPasswordMinLength($length){\n Configuration::where('id', 1)\n ->update(['password_min_length' => $length]);\n }",
"function has_length_greater_than($value, $min) {\n $length = strlen($value);\n return $length > $min;\n}",
"function has_length_greater_than( $value, $min ) {\n $length = strlen( $value );\n return $length > $min;\n}",
"function acf_strlen($str)\n{\n}",
"function checkStringLength($checkMe){\n\t// for now just ensure it's a string and cut it if it's too long\n\tglobal $STRING_LIMIT;\n\tif(sizeof($checkMe)<$STRING_LIMIT){\n\t\t// if the string is shorter than the limit return true for a good check\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t\t// after this return the snipString method should be called to cut off the string shorter(CLIENT APPROVAL NEEDED) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n\t}\n\n}"
] |
[
"0.68786466",
"0.68634623",
"0.6836843",
"0.6689429",
"0.66735303",
"0.666466",
"0.6662986",
"0.66625714",
"0.6604913",
"0.65787333",
"0.6555711",
"0.6550713",
"0.65391636",
"0.6516242",
"0.6515862",
"0.6514986",
"0.6513819",
"0.6488231",
"0.64805984",
"0.64676654",
"0.6450884",
"0.6446541",
"0.6437238",
"0.6435088",
"0.6423086",
"0.6388055",
"0.6374024",
"0.63736725",
"0.6367242",
"0.6352666"
] |
0.7478836
|
0
|
/ maxval Makes sure an integer is not more than certain value: mdx:maxval php h:autoload mdx:maxval o
|
function testMaxval(){
#mdx:maxval
Param::get('age')->filters()->maxval(150, "Age cannot be more than %d!");
$error = Param::get('age')->process(['age'=>200])->error;
#/mdx var_dump($error)
$this->assertContains("more than 150", $error);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getMaxValue();",
"public function getMaxValue();",
"function validate_maxVal($val, $max) {\n\tif (is_numeric($val) && $val <= $max) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}",
"function validMax($value, $max)\n {\n return $value <= $max;\n }",
"public function setMaxValue($maxValue);",
"abstract public function maxMax(): int;",
"private function process_max($value, $max) {\n if (is_numeric($value) === false) {\n if (is_array($value)) {\n $value = count($value);\n } else {\n $value = strlen($value);\n }\n }\n if ($value > $max) {\n return false;\n } else {\n return true;\n }\n }",
"function getMaxValue() { return $this->readMaxValue(); }",
"function getMaxValue() { return $this->readMaxValue(); }",
"function getMax() { return $this->readMaxValue(); }",
"public static function get_max_value() {\n return self::MAX_VALUE;\n }",
"function exibeAtualMax(){\n $nmin= (($this->atual * $this->numpage) - $this->numpage)+1;\n return $nmax= ($this->numpage + $nmin)-1;\n }",
"public function setMaximumValue(int $maximumValue): void;",
"public static function _max($value, $field, $max) {\n\t\treturn $value <= $max;\n\t}",
"private function max($value, $max = 0)\n {\n if (!is_numeric($max) || !is_int((int)$max)) {\n return false;\n }\n // for string or number\n if (is_string($value) || is_numeric($value)) {\n return strlen($value) <= (int)$max;\n }\n // for array\n if (is_array($value)) {\n return count($value) <= (int)$max;\n }\n // for file (size in kilobytes)\n return is_file($value) && ((filesize($value) / 1024) <= (int)$max);\n }",
"public function getMaxValue()\n {\n return $this->get('MaxValue');\n }",
"function max_val ( $str, $val )\n\t{\n\t\tif ( preg_match( \"/[^0-9.]/\", $val ) )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn ( $str <= $val ) ? TRUE : FALSE;\n\t}",
"public function getMax(): int;",
"abstract protected function getMaxParameter(): int;",
"public function getMax();",
"public function filterMaxValue(int $max);",
"function _checkMaxLimt()\r\n {\r\n if ($this->data[$this->name]['max_limit'] >= $this->data[$this->name]['min_limit']) {\r\n return true;\r\n }\r\n return false;\r\n }",
"function max() { return $this->max; }",
"public function setMax( int $max ): void {\n\t\t\t$this->maximum = $max;\n\t\t}",
"function maxValLimit ($arr, $limit) {\n /* if no such value, or $arr is not an array, return -1 */\n if (is_array ($arr)) {\n sort ($arr); \n for ($i = count ($arr) - 1; $i >= 0; $i--) {\n if ($arr[$i] <= $limit) {\n return ($arr[$i]);\n break;\n }\n }\n }\n return (-1);\n}",
"function validMaxLength($value, $max)\n {\n return strlen($value) <= $max;\n }",
"function getNota_max()\n {\n if (!isset($this->inota_max) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_max;\n }",
"function getNota_max()\n {\n if (!isset($this->inota_max) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->inota_max;\n }",
"public function max($value) {\n return $this->setProperty('max', $value);\n }",
"public function max($value) {\n return $this->setProperty('max', $value);\n }"
] |
[
"0.759315",
"0.759315",
"0.7413394",
"0.7289483",
"0.7074745",
"0.70396864",
"0.6948957",
"0.6907804",
"0.6904527",
"0.6826311",
"0.67519176",
"0.6743134",
"0.6718416",
"0.6707187",
"0.66933966",
"0.6685585",
"0.66532564",
"0.66177243",
"0.65958714",
"0.65947866",
"0.65839285",
"0.65521497",
"0.65424716",
"0.6429917",
"0.6375984",
"0.6348232",
"0.6332754",
"0.6332754",
"0.6330074",
"0.6330074"
] |
0.7650484
|
0
|
/ minval Makes sure the integer, if provided, is at least larger than X: mdx:minval php h:autoload mdx:minval o
|
function testMinval(){
#mdx:minval
Param::get('age')->filters()->minval(1, "Age cannot be less than %d!");
$error = Param::get('age')->process(['age'=>0])->error;
#/mdx var_dump($error)
$this->assertContains("less than 1", $error);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setMinValue($minValue);",
"abstract public function minMin(): int;",
"private function process_min($value, $min) {\n if (is_numeric($value) === false) {\n if (is_array($value)) {\n $value = count($value);\n } else {\n $value = strlen($value);\n }\n }\n \n if ($value < $min) {\n return false;\n } else {\n return true;\n }\n }",
"function testMinvalRunsOnlyIfNotEmpty(){\n\t\t#mdx:minval2\n\t\tParam::get('age')->filters()->minval(1, \"Age cannot be less than %d!\");\n\t\t$error = Param::get('age')->process(['age'=>null])->error;\n\t\t#/mdx var_dump($error)\n\n\t\t$this->assertNull($error);\n\n\t}",
"public function setMin( int $min ): void {\n\t\t\t$this->minimum = abs( $min );\n\t\t}",
"function min_val ( $str, $val )\n\t{\n\t\tif ( preg_match( \"/[^0-9.]/\", $val ) )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn ( $str >= $val ) ? TRUE : FALSE;\n\t}",
"abstract protected function getMinParameter(): int;",
"public function setMinimumValue(int $minimumValue): void;",
"public function getMin(): int;",
"private function min($value, $min = 0)\n {\n if (!is_numeric($min) || !is_int((int)$min)) {\n return false;\n }\n\n // for string or number\n if (is_string($value) || is_numeric($value)) {\n return strlen($value) >= (int)$min;\n }\n // for array\n if (is_array($value)) {\n return count($value) >= (int)$min;\n }\n // for file (size in kilobytes)\n return is_file($value) && ((filesize($value) / 1024) >= (int)$min);\n }",
"public function getMinValue();",
"public function getMinValue();",
"public function GetMinVal()\n\t{\n\t\tif (function_exists('bcpow')) {\n\t\t\treturn round(bcpow(10, $this->scale[0], 15), 14);\n\t\t}\n\n\t\treturn round(pow(10, $this->scale[0]), 14);\n\t}",
"public function getMin();",
"public static function _min($value, $field, $min) {\n\t\treturn $value >= $min;\n\t}",
"public function setXMin($xMin) {}",
"public function testMin()\n {\n $this->assertEquals(0, EggDropperCalculator::calculate(0, 0));\n $this->assertEquals(0, EggDropperCalculator::calculate(1, 0));\n $this->assertEquals(1, EggDropperCalculator::calculate(0, 1));\n $this->assertEquals(1, EggDropperCalculator::calculate(1, 1));\n $this->assertEquals(0, EggDropperCalculator::calculate(2, 0));\n $this->assertEquals(0, EggDropperCalculator::calculate(0, 2));\n $this->assertEquals(1, EggDropperCalculator::calculate(2, 1));\n $this->assertEquals(2, EggDropperCalculator::calculate(1, 2));\n }",
"public function min($value) {\n return $this->setProperty('min', $value);\n }",
"public function min($value) {\n return $this->setProperty('min', $value);\n }",
"public static function minimum($parameters=null) {}",
"protected function validateMin($value, $parameters){\n\t\treturn $value >= $parameters[0] && $this->validateNumber($value);\n\t}",
"public function __construct($min)\n {\n $this->min = $min;\n }",
"function validMinLength($value, $min)\n {\n return strlen($value) >= $min;\n }",
"private function handleValueMinInclusive(Generator\\ClassGenerator $generator, PHPProperty $prop, PHPClass $class) \n {\n if (!$checks = $this->getAvailableChecks( $prop, $class, 'minInclusive' )) {\n return;\n }\n // add from `protected function _checkRestrictions($value)`\n $methodBody = \"\";\n foreach ($checks as $minInclusive) {\n $methodBody .= \"RestrictionUtils::checkMinInclusive(\\$this->value, {$minInclusive['value']});\" . PHP_EOL;\n }\n $method = $generator->getMethod('validate');\n $method->setBody( $method->getBody() . $methodBody );\n }",
"function setMin($min) {\n $this->field['min'] = (int) $min;\n\n return $this;\n }",
"function sugar_valid_int($value, $min=1, $max=65535) {\n $options = array(\n 'options' => array(\n 'min_range' => $min,\n 'max_range' => $max,\n ),\n );\n return filter_var($value, FILTER_VALIDATE_INT, $options);\n}",
"public function setMinimum($value) {\r\n $this->internalSetMinimum($value);\r\n }",
"public function testMinInvalidArgumentException()\n {\n $max = $this->ascendingSequence->getMax();\n $this->ascendingSequence->setMin($max + 1);\n $this->fail(\"Should not be able to set min > max.\");\n }",
"public function min(): Option;",
"public static function minValue()\n {\n if (self::$PHPIntSize === 4) {\n // 32 bit\n return static::createFromTimestamp(~PHP_INT_MAX); // @codeCoverageIgnore\n }\n\n // 64 bit\n return static::create(1, 1, 1, 0, 0, 0);\n }"
] |
[
"0.65573484",
"0.65040654",
"0.64603764",
"0.6447109",
"0.64443517",
"0.63674784",
"0.634811",
"0.6340255",
"0.63124",
"0.62927294",
"0.6254534",
"0.6254534",
"0.61396027",
"0.60436636",
"0.6024867",
"0.6009585",
"0.5995945",
"0.59954125",
"0.59954125",
"0.5989762",
"0.5983006",
"0.59657955",
"0.5956714",
"0.5925055",
"0.5924443",
"0.5924249",
"0.5894144",
"0.589164",
"0.58434933",
"0.5825942"
] |
0.72456443
|
0
|
$this>client = new \Swoole\Client($sockType,SWOOLE_SOCK_ASYNC);
|
public function __construct($sockType=SWOOLE_SOCK_TCP)
{
$this->client =new \Swoole\Async\Client($sockType);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function test_client(){\n$client = new swoole_client(SWOOLE_SOCK_TCP, SWOOLE_SOCK_SYNC); //同步阻塞\nif(!$client->connect('127.0.0.1', 9501))\n{\n\texit(\"connect fail\\n\");\n}\nif(empty($argv[1]))\n{\n\t$loop = 1;\n}\nelse\n{\n\t$loop = intval($argv[1]);\n}\n\nfor($i=0; $i<$loop; $i++)\n{\n $client->send(str_repeat(\"A\", 600).$i);\n $data = $client->recv(7000, 0);\n if($data === false)\n {\n echo \"recv fail\\n\";\n break;\n }\n //echo \"recv[$i]\",$data,\"\\n\";\n}\n\n//echo \"len=\".strlen($data).\"\\n\";\n// $client->send(\"HELLO\\0\\nWORLD\");\n// $data = $client->recv(9000, 0);\n$client->close();\nvar_dump($data);\nunset($client);\n}",
"protected function socketPerform() {}",
"public function createSocket()\n {\n //Create TCP/IP sream socket\n $this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);\n //reuseable port\n socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1);\n\n //bind socket to specified host\n socket_bind($this->socket, 0, $this->port);\n\n //listen to port\n socket_listen($this->socket);\n\n //create & add listning socket to the list\n $this->clients[0] = [\n $this->socket\n ];\n }",
"public function getSocket();",
"protected function _generateSocket() {\n\t}",
"public function setEventLoop(\\Phalcon\\Websocket\\EventLoopInterface $eventloop){ }",
"public static function tcp_server(): void\n {\n sock::$type = 'tcp:server';\n sock::$host = '0.0.0.0';\n sock::$port = 1000;\n $ok = sock::create();\n\n if (!$ok) exit('TCP Server creation failed!');\n\n //Set Client list alone\n $client = [];\n\n do {\n //Copy client list to read list\n $read = $client;\n\n //Listen to TCP port\n sock::listen($read);\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read TCP Data\n $msg = sock::read($read, $client);\n\n var_dump($msg);\n\n //Regroup data\n $data = [];\n\n //example: from message and send back to client\n foreach ($msg as $key => $value) {\n //Client socket resource\n $data[$key]['sock'] = $client[$key];\n //Message to be sent\n $data[$key]['msg'] = 'Hello, dear sender!';\n $data[$key]['msg'] .= PHP_EOL;\n $data[$key]['msg'] .= 'I received your message, and now send it back.';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= '====================================================================';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= $value['msg'];\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= '====================================================================';\n $data[$key]['msg'] .= PHP_EOL . PHP_EOL;\n $data[$key]['msg'] .= 'Thanks for your test!';\n }\n\n //Send data back and maintain clients\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }",
"function server_loop($address, $port)\n{\n GLOBAL $__server_listening;\n\n if(($sock = socket_create(AF_INET, SOCK_STREAM, 0)) < 0)\n {\n echo \"failed to create socket: \".socket_strerror($sock).\"\\n\";\n exit();\n }\n\n if(($ret = socket_bind($sock, $address, $port)) < 0)\n {\n echo \"failed to bind socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n if( ( $ret = socket_listen( $sock, 0 ) ) < 0 )\n {\n echo \"failed to listen to socket: \".socket_strerror($ret).\"\\n\";\n exit();\n }\n\n socket_set_nonblock($sock);\n \n echo \"waiting for clients to connect\\n\";\n\n while ($__server_listening)\n {\n $connection = @socket_accept($sock);\n if ($connection === false)\n {\n usleep(100);\n }elseif ($connection > 0)\n {\n handle_client($sock, $connection);\n }else\n {\n echo \"error: \".socket_strerror($connection);\n die;\n }\n }\n}",
"public static function tcp_server(): void\n {\n sock::$type = 'tcp:server';\n sock::$host = '0.0.0.0';\n sock::$port = self::port;\n $ok = sock::create();\n\n if (!$ok) exit('TCP Server creation failed!');\n\n //Set Client list alone\n $client = [];\n\n do {\n //Copy client list to read list\n $read = $client;\n\n //Listen to TCP port\n sock::listen($read);\n\n //Accept new connection\n sock::accept($read, $client);\n\n //Read TCP Data\n $msg = sock::read($read, $client);\n\n var_dump($msg);\n\n $data = [];\n\n //example: from message and send back to client\n foreach ($client as $k => $v) {\n foreach ($msg as $key => $value) {\n $data[$k]['sock'] = $v;\n $data[$k]['msg'] = $key !== $k ? $value['msg'] : 'OK! ' . count($client) . ' players are online waiting!';\n }\n }\n\n //Send data back and maintain clients\n $result = sock::write($data, $client);\n\n var_dump($result);\n\n } while (true);\n }",
"function set_socket_blocking($stream, $mode)\n{\n}",
"public function iniciar_socket(){\n\t\t$this->socket= new PHPWebSocket();\t\n\t\t\n\t\t$this->socket->bind('message', 'wsOnMessage');\n\t\t$this->socket->bind('open', 'wsOnOpen');\n\t\t$this->socket->bind('close', 'wsOnClose'); \n\n\n\t\treturn $this->socket->wsStartServer('192.168.1.104','9300');\n\t//\treturn $this->socket->wsStartServer('10.20.0.68','8180');\n\t\t\n\n\t}",
"abstract public function initClient();",
"public function __construct()\n {\n $this->http = new swoole_http_server(self::HOST, self::PORT);\n\n $this->http->set([\n \"enable_static_handler\" => true,\n \"document_root\" => \"/home/alex/study/thinkphp/public/static/\",\n 'worker_num' => 2,\n 'task_worker_num' => 2,\n\n ]);\n\n $this->http->on(\"WorkerStart\", [$this, 'onWorkerStart']);\n $this->http->on(\"request\", [$this, 'onRequest']);\n $this->http->on(\"task\", [$this, 'onTask']);\n $this->http->on(\"finish\", [$this, 'onFinish']);\n $this->http->on(\"close\", [$this, 'onClose']);\n\n\n $this->http->start();\n }",
"function socket_set_blocking($stream, $mode)\n{\n}",
"public function connect(): mixed;",
"public function __construct()\n {\n $this->client = new Client([\n 'base_uri' => env('CHAT_STREAM_URL', 'http://192.168.0.6:5000/')\n ]);\n }",
"public function open_socket(){\n //Create the server socket\n if($this->socket === null){\n \n //Create socket\n if (($this->socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) === false) {\n echo \"Socket_create() failed: reason: \" . socket_strerror(socket_last_error()) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_KEEPALIVE, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n if(socket_set_option($this->socket, SOL_SOCKET, SO_REUSEADDR, 1) === FALSE){\n echo \"Socket_set_option() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_bind($this->socket, $this->host, $this->port) === false) {\n echo \"Socket_bind() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n\n if (socket_listen($this->socket, 5) === false) {\n echo \"Socket_listen() failed: reason: \" . socket_strerror(socket_last_error($this->socket)) . \"\\n\";\n }\n \n }\n return $this->socket;\n }",
"function TcpClient($remoteHost=null, $portNum=0) \r\n{ \r\n$this->Host = strval($remoteHost); \r\n$this->Port = intval(max(0, $portNum)); //** ensure port >= than zero. \r\n}",
"public function initListeningEvent()\n {\n if(!$this->server instanceof \\Swoole\\WebSocket\\Server){\n throw new \\Exception('swoole的websocket服务还未开启');\n }\n try{\n $processor = new LoginCommonCallServiceProcessor(new LoginCommonService($this->server));\n $tFactory = new TTransportFactory();\n $pFactory = new TBinaryProtocolFactory();\n $transport = new ServerTransport($this->server);\n $server = new \\src\\Thrift\\Server\\Server($processor, $transport, $tFactory, $tFactory, $pFactory, $pFactory);\n $server->serve();\n }catch (\\TException $e){\n throw new \\Exception('thrift启动失败');\n }\n }",
"public function __construct()\n {\n $this->client = new Client();\n }",
"public function listen() :void {\n\n echo \"Starting websocket server on... \" . $this->address . \":\" . $this->port;\n \n socket_listen($this->server);\n socket_set_nonblock($this->server);\n $this->clients[] = new WebSocket($this->server);\n\n do {\n\n $read = array_map(function($ws) {return $ws->socket;}, $this->clients);\n $write = null; \n $except = null;\n\n $ready = socket_select($read, $write, $except, 0);\n if ($ready === false) {\n if ($this->onError !== null) {\n $callback = $this->onError;\n $callback(\"[\".socket_last_error().\"]\".\" \".socket_strerror(socket_last_error()));\n }\n\n return;\n }\n\n if ($ready < 1) continue;\n\n // check if there is a client trying to connect.\n if (in_array($this->server, $read)) {\n if (($client = socket_accept($this->server)) !== false) {\n\n // send websocket handshake headers.\n if (!$this->sendHandshakeHeaders($client)) {\n continue;\n }\n\n // add the new client to the $clients array.\n $ws = new WebSocket($client);\n $this->clients[] = $ws;\n\n // call \"connection\" event handler for each new client.\n if ($this->onConnect !== null) {\n $callback = $this->onConnect;\n $callback($ws);\n }\n\n // remove the listening socket from the clients-with-data array.\n $key = array_search($this->server, $read);\n unset($read[$key]);\n }\n }\n\n foreach ($read as $key => $client) {\n\n $buffer = \"\";\n $bytes = @socket_recv($client, $buffer, 2048, 0);\n\n // check if the client is disconnected.\n if ($bytes === false) {\n\n // remove client from $clients array\n // and call disconnect event handler.\n unset($this->clients[$key]);\n if ($this->onDisconnect !== null) {\n $callback = $this->onDisconnect;\n $callback();\n }\n\n continue;\n }\n\n $ws = $this->clients[$key];\n $callback = $ws->onMessage;\n if ($callback !== null) {\n $callback($ws, $this->unmask($buffer));\n }\n }\n } while (true);\n socket_close($this->server);\n }",
"function connect()\n\t{\n\t\t\n\t\t$this->sock = @fsockopen($this->host,$this->port,&$this->errno,&$this->errstr,30);\n\t\t@set_socket_blocking($this->sock,false);\n\t\treturn $this->sock;\n\t}",
"function handle_client($ssock, $csock)\n{\n GLOBAL $__server_listening;\n\n $pid = pcntl_fork();\n\n if ($pid == -1)\n {\n /* fork failed */\n echo \"fork failure!\\n\";\n die;\n }elseif ($pid == 0)\n {\n /* child process */\n $__server_listening = false;\n socket_close($ssock);\n interact($csock);\n socket_close($csock);\n }else\n {\n socket_close($csock);\n }\n}",
"public function run()\n {\n while(true)\n {\n $changed_sockets = $this->allsockets;\n $write = null;\n $except = null;\n @stream_select($changed_sockets, $write, $except, 0, 5000); \n foreach($changed_sockets as $socket)\n {\n if($socket == $this->master)\n {\n if(($ressource = stream_socket_accept($this->master)) === false)\n {\n $this->log('Socket error: ' . socket_strerror(socket_last_error($ressource)));\n continue;\n }\n else\n {\n $client = $this->createConnection($ressource);\n $this->clients[(int)$ressource] = $client;\n $this->allsockets[] = $ressource;\n \n if(count($this->clients) > $this->_maxClients)\n {\n $this->log('Attention: Client Limit Reached!');\n $client->onDisconnect();\n if($this->getApplication('status') !== false)\n {\n $this->getApplication('status')->statusMsg('Attention: Client Limit Reached!', 'warning');\n }\n continue;\n }\n \n $this->_addIpToStorage($client->getClientIp());\n if($this->_checkMaxConnectionsPerIp($client->getClientIp()) === false)\n {\n $this->log('Connection/Ip limit for ip ' . $client->getClientIp() . ' was reached!');\n $client->onDisconnect();\n if($this->getApplication('status') !== false)\n {\n $this->getApplication('status')->statusMsg('Connection/Ip limit for ip ' . $client->getClientIp() . ' was reached!', 'warning');\n }\n continue;\n } \n }\n }\n else\n { \n $client = $this->clients[(int)$socket];\n if(!is_object($client))\n {\n unset($this->clients[(int)$socket]);\n continue;\n }\n $data = $this->readBuffer($socket); \n $bytes = strlen($data);\n \n if($bytes === 0)\n {\n $client->onDisconnect(); \n continue;\n }\n elseif($data === false)\n {\n $this->removeClientOnError($client);\n continue;\n }\n elseif($client->waitingForData === false && $this->_checkRequestLimit($client->getClientId()) === false)\n {\n $client->onDisconnect();\n }\n else\n { \n $client->onData($data);\n }\n }\n }\n }\n }",
"static function connect(): void;",
"public function __construct()\n {\n Socket::$isServer = true;\n self::$server = new sockbase();\n self::$server->onmsg(__NAMESPACE__ . '\\SqlPool::inmsg');\n self::$server->dismsg(__NAMESPACE__ . '\\SqlPool::dis');\n $poolconf = ng169\\lib\\Option::get('pool');\n self::$pwd = $poolconf['pwd'];\n\n self::$server->start($poolconf['ip'], $poolconf['port']);\n\n // self::$server->start(\"127.0.0.1\", \"4563\");\n }",
"public function __construct()\n {\n parent::__construct();\n $this->client =new Client(); \n }",
"public function handle()\n {\n\t //创建server\n $server = new \\swoole_websocket_server(\"0.0.0.0\" , 9501);\n\n\t $server->on(\"open\" , function(Server $server , $request){\n//\t\t $this->info($request->fd . \"连接成功\");\n\t\t echo $request->fd . \"连接成功\";\n\t });\n\n\t $server->on(\"message\" , function(Server $server , $request){\n\t\t $msg = $request->data;\n\n\t\t foreach($server->connections as $fd){\n\t\t\t $server->push($fd , $msg);\n\t\t }\n\t });\n\n\t $server->on(\"close\" , function(Server $server , $request){\n//\t\t $this->info($request->fd . \"断开连接\");\n\t\t echo $request->fd . \"断开连接\";\n\t });\n\n\t $server->start();\n }",
"function tcp_connect($address, $port, $ctimeout = NULL)\n\t {\n\t\t$fp = fsockopen($address, $port, $error, $errstr, $ctimeout);\n\t\tif(!$fp) {\n\t\t\treturn false;\n\t\t}\n\n\t\t/*if(!stream_set_blocking($fp, 0)) {\n\t\t\tfclose($fp);\n\t\t\treturn false;\n\t\t}*/\n\t\treturn $fp;\n\t }",
"public function run()\n {\n $serv = new \\swoole_server($this->host, $this->port);\n $serv->set(\n array(\n 'process_name' => 'ershoufang_crawler', //swoole 进程名称\n 'worker_num' => 2,//开启的worker进程数\n 'task_worker_num' => 2,//开启的task进程数\n 'open_cpu_affinity' => true,\n 'daemonize' => false,\n 'max_request' => 10000,\n 'dispatch_mode' => 2,\n 'debug_mode' => 0,\n 'log_file' => 'swoole.log',\n 'open_tcp_nodelay' => true,\n \"task_ipc_mode\" => 2,\n 'task_max_request' => 10000\n )\n );\n\n $serv->on('Start', array($this, 'onStart'));\n $serv->on('Connect', array($this, 'onConnect'));\n $serv->on('Receive', array($this, 'onReceive'));\n $serv->on('WorkerStart', array($this, 'onWorkerStart'));\n $serv->on('Task', array($this, 'onTask'));\n $serv->on('Finish', array($this, 'onFinish'));\n $serv->on('Close', array($this, 'onClose'));\n $serv->start();\n }"
] |
[
"0.7063312",
"0.624641",
"0.6182755",
"0.5995711",
"0.5919692",
"0.58959746",
"0.5868264",
"0.583856",
"0.5824518",
"0.58102584",
"0.58051777",
"0.574779",
"0.5726777",
"0.57231367",
"0.5684255",
"0.5666827",
"0.56611747",
"0.56478536",
"0.56362146",
"0.56097066",
"0.5603998",
"0.5557753",
"0.5550775",
"0.5519826",
"0.5504855",
"0.5498277",
"0.54869866",
"0.5481735",
"0.54806685",
"0.5476827"
] |
0.7653462
|
0
|
Returns a new ChildCiSettingsQuery object.
|
public static function create($modelAlias = null, Criteria $criteria = null)
{
if ($criteria instanceof ChildCiSettingsQuery) {
return $criteria;
}
$query = new ChildCiSettingsQuery();
if (null !== $modelAlias) {
$query->setModelAlias($modelAlias);
}
if ($criteria instanceof Criteria) {
$query->mergeWith($criteria);
}
return $query;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getQuerySettings() {}",
"public function build()\n {\n return new QueryConfiguration(\n $this->drawCall,\n $this->start,\n $this->length,\n $this->searchValue,\n $this->searchRegex,\n $this->columSearches,\n $this->columnOrders\n );\n }",
"public function newQuery() {\n return new Builder($this->connection);\n }",
"protected function getSubQuery()\n {\n return $this->db\n ->table(CommentModel::TABLE)\n ->columns(CommentModel::TABLE.'.task_id')\n ->ilike(CommentModel::TABLE.'.comment', '%'.$this->value.'%');\n }",
"public function subQuery()\n {\n $subQuery = clone $this;\n $subQuery->builderCache = new Query\\BuilderCache();\n\n $subQuery->isSubQuery = true;\n\n return $subQuery;\n }",
"public function getSettings()\n {\n return new ClientSettings($this->settings);\n }",
"public function createQuery()\n {\n $query = parent::createQuery();\n $query->getQuerySettings()->setRespectStoragePage(false);\n return $query;\n }",
"public function newQuery()\n {\n return new Builder($this->connection, $this->processor);\n }",
"private function newQuery(array $additionalConfig, $overrideTopLevelKeys = false, $limitToLast = false)\n {\n $query = $this->query;\n\n if ($overrideTopLevelKeys) {\n $keys = array_keys($additionalConfig);\n foreach ($keys as $key) {\n unset($query[$key]);\n }\n }\n\n $query = $this->arrayMergeRecursive($query, $additionalConfig);\n\n return new self(\n $this->connection,\n $this->valueMapper,\n $this->parentName,\n $query,\n $limitToLast\n );\n }",
"protected function setWhere()\n {\n $foreign = $this->getForeignKey ();\n $this->query->where ( $foreign, '=', $this->parent->getKey () );\n return $this;\n }",
"public function build(): ShiftQuery\n {\n return CoreHelper::clone($this->instance);\n }",
"protected function newBaseQueryBuilder()\n {\n $conn = $this->getConnection();\n\n $grammar = $conn->getQueryGrammar();\n\n $builder = new Builder($conn, $grammar, $conn->getPostProcessor());\n\n if (isset($this->rememberFor)) {\n $builder->remember($this->rememberFor);\n }\n\n if (isset($this->rememberCacheTag)) {\n $builder->cacheTags($this->rememberCacheTag);\n }\n\n //if (isset($this->rememberCachePrefix)) {\n //ToDo: see if using server_hostname or whatever speeds this up\n $tenant = app(\\Hyn\\Tenancy\\Environment::class)->tenant();\n if(isset($tenant->id)){\n $set_tenant = $tenant->id;\n }else{\n $set_tenant = \"default\";\n }\n $builder->prefix($set_tenant);\n //}\n\n if (isset($this->rememberCacheDriver)) {\n $builder->cacheDriver($this->rememberCacheDriver);\n }\n\n return $builder;\n }",
"public function newQuery(): Builder\n {\n return new static($this->connection);\n }",
"public static function create()\n {\n return new QueryConfigurationBuilder();\n }",
"private function setCustomWhere()\n\t{\n\t\tif ($this->customQuery->where) {\n\t\t\t$this->where = array_merge_recursive($this->customQuery->where, $this->where);\n\t\t}\n\n\t\treturn $this;\n\t}",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('csSetting');\n }",
"public function newQuery()\n {\n $builder = new Builder($this->newBaseQueryBuilder());\n\n $builder->setModel($this);\n\n return $builder;\n }",
"protected function createDerivedQuery(): Query\n {\n return (clone $this->baseQuery);\n }",
"public function getProjectSettings() {\r\n $cid = $this->settingVars->aid;\r\n\r\n $settingName = $this->settingVars->menuArray['MF5']['SETTING_NAME'];\r\n $settingValue = $this->settingVars->menuArray['MF5']['SETTING_VALUE'];\r\n $settings = $this->settingVars->defaultProjectSettings;\r\n\r\n if (!empty($settingName) && !empty($settingValue)) {\r\n $table = $this->settingVars->configTable;\r\n if (isset($this->queryVars->projectConfiguration['has_private_label']) && $this->queryVars->projectConfiguration['has_private_label'] == '1')\r\n $this->defaultPrivateLable();\r\n }\r\n $settings = array_merge($settings,(is_array($this->queryVars->projectConfiguration) ? $this->queryVars->projectConfiguration : array()));\r\n\r\n $this->jsonOutput[\"settings\"] = $settings;\r\n }",
"protected function newBaseQueryBuilder()\n {\n $connection = $this->getConnection();\n\n $builder = in_array(self::class, config('autocache.models'))\n ? \\LaravelAutoCache\\Builder::class\n : \\Illuminate\\Database\\Query\\Builder::class;\n\n return new $builder($connection, $connection->getQueryGrammar(), $connection->getPostProcessor());\n }",
"public function getCategoriesForSettings() {\n \n $qb = $this->_em->createQueryBuilder();\n $qb->select('c')\n ->from('ABOMainBundle:Category', 'c')\n ->join('c.parent', 'p')\n ->addSelect('p')\n ->where('c.level = :level')\n ->setParameter('level', 2);\n \n return $qb->getQuery()->getResult();\n }",
"protected function newPivotQuery()\n {\n $query = $this->newPivotStatement ();\n return $query->where ( $this->foreignKey, $this->parent->getKey () );\n }",
"public function setSettings($settings)\n {\n $this->settings = $settings;\n\n return $this;\n }",
"public function setSettings($settings)\n {\n $this->settings = $settings;\n\n return $this;\n }",
"public function setChildSecurityAssociationParameters($val)\n {\n $this->_propDict[\"childSecurityAssociationParameters\"] = $val;\n return $this;\n }",
"protected function newBaseQueryBuilder()\n {\n return $this->getConnection()->query();\n }",
"public function newQuery()\n {\n return new self($this->connection, $this->processor);\n }",
"public function getSettingConnection()\n {\n return new Settings($this->apiEmail, $this->apiKey);\n }",
"public function query()\n {\n // Provide this objects MySQL connection\n return new Query($this->mysql, $this->parent);\n }",
"protected function defineAllMembershipsQuery()\n {\n return $this->createQueryBuilder();\n }"
] |
[
"0.53279346",
"0.525339",
"0.5217898",
"0.5189417",
"0.51439476",
"0.5102967",
"0.5058493",
"0.50323784",
"0.4997528",
"0.49874386",
"0.4948848",
"0.49377653",
"0.4897778",
"0.48725593",
"0.48587254",
"0.48484874",
"0.48410514",
"0.4840166",
"0.48382872",
"0.48380774",
"0.48167735",
"0.48073334",
"0.47903717",
"0.47903717",
"0.47863632",
"0.47655115",
"0.4758895",
"0.47485912",
"0.47450078",
"0.47444507"
] |
0.59031594
|
0
|
Filter the query on the id_setting column Example usage: $query>filterByIdSetting(1234); // WHERE id_setting = 1234 $query>filterByIdSetting(array(12, 34)); // WHERE id_setting IN (12, 34) $query>filterByIdSetting(array('min' => 12)); // WHERE id_setting > 12
|
public function filterByIdSetting($idSetting = null, $comparison = null)
{
if (is_array($idSetting)) {
$useMinMax = false;
if (isset($idSetting['min'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_ID_SETTING, $idSetting['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($idSetting['max'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_ID_SETTING, $idSetting['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_ID_SETTING, $idSetting, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function filterById($id = null, $comparison = null)\n\t{\n\t\tif (is_array($id) && null === $comparison) {\n\t\t\t$comparison = Criteria::IN;\n\t\t}\n\t\treturn $this->addUsingAlias(SettingPeer::ID, $id, $comparison);\n\t}",
"public function filterByPrimaryKey($key)\n\t{\n\t\treturn $this->addUsingAlias(SettingPeer::ID, $key, Criteria::EQUAL);\n\t}",
"public function filterByPrimaryKey($key)\n {\n\n return $this->addUsingAlias(CiSettingsTableMap::COL_ID_SETTING, $key, Criteria::EQUAL);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SchoolPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::ID, $id, $comparison);\n }",
"public function filterId(int $id): self;",
"public function filter_dynamic_setting_args($setting_args, $setting_id)\n {\n }",
"public function whereId($id);",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SearchIndexPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SearchIndexPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::ID, $id, $comparison);\n }",
"public function get_setting($id){\n\t\t$this->db->select('*')\n\t\t->from('settings')\n\t\t->where('setting_id = ', $id)\n\t\t->limit(1);\n\t\treturn $this->db->get()->result();\n\t}",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UsuarioPerfilPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UsuarioPerfilPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UsuarioPerfilPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(MigrationPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(MigrationPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MigrationPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(RemoteAppPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(RemoteAppPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(RemoteAppPeer::ID, $id, $comparison);\n }",
"function get_setting($id)\n {\n return $this->db->get_where('tbl_setting', array('id'=>$id))->row_array();\n }",
"public function filterById($id = null, $comparison = null)\n\t{\n\t\tif (is_array($id)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($id['min'])) {\n\t\t\t\t$this->addUsingAlias(ClubMeetingsPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($id['max'])) {\n\t\t\t\t$this->addUsingAlias(ClubMeetingsPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(ClubMeetingsPeer::ID, $id, $comparison);\n\t}",
"public function get_setting($id)\n {\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(PlanPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(PlanPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PlanPeer::ID, $id, $comparison);\n }",
"public function filterUser(int $id): self;",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(CardPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(CardPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CardPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(memberProfilePeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(memberProfilePeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(memberProfilePeer::ID, $id, $comparison);\n }",
"public function filter()\n\t{\n\t\treturn implode( ' AND ', array_map( function( $col ) { return \"$col=?\"; }, array_keys( $this->_id ) ) );\n\t}",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(sfGuardUserPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(SocioTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(SocioTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SocioTableMap::COL_ID, $id, $comparison);\n }",
"public function filter_dynamic_setting_class($setting_class, $setting_id, $setting_args)\n {\n }",
"function filters($filter)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM appearance WHERE id_appearance = %s\",\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($filter, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"filters\"];\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}",
"public function series_filter_params(string $id)\n {\n return $this->request(\"series/{$id}/filter/params\");\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(MateriaTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(MateriaTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MateriaTableMap::COL_ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(FreeShippingPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(FreeShippingPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(FreeShippingPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(MapTableMap::COL_ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(MapTableMap::COL_ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(MapTableMap::COL_ID, $id, $comparison);\n }"
] |
[
"0.635215",
"0.59850216",
"0.5644491",
"0.564185",
"0.5561625",
"0.5362471",
"0.5284751",
"0.5281816",
"0.5236253",
"0.5233413",
"0.51940495",
"0.5191543",
"0.514457",
"0.51338965",
"0.5127419",
"0.5123768",
"0.5123768",
"0.51018363",
"0.5074257",
"0.5055851",
"0.505235",
"0.5052047",
"0.50507724",
"0.50304854",
"0.5024102",
"0.5021399",
"0.5006126",
"0.4989572",
"0.4988385",
"0.4987753"
] |
0.6709945
|
0
|
Filter the query on the tabla column Example usage: $query>filterByTabla('fooValue'); // WHERE tabla = 'fooValue' $query>filterByTabla('%fooValue%', Criteria::LIKE); // WHERE tabla LIKE '%fooValue%'
|
public function filterByTabla($tabla = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($tabla)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_TABLA, $tabla, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function buscarPorColumna($tabla, $campo, $dato)\n{\n $dato = strtoupper($dato);\n $query = \"select * from \".$tabla.\" where upper(\".$campo.\"::character varying) like '%' || ? || '%'\";\n\n $lista = \\DB::select($query, [$dato]);\n\n return $lista;\n}",
"protected static function filtro($tabla, $tipo, $dato = null){\n\t\t$filtro = parent::filtro($tabla, $tipo, $dato);\n\t\tswitch($tipo){\n\n\t\t\tcase 'categoria':\n\t\t\t\t$dato = DB::obtener()->real_escape_string($dato);\n\t\t\t\t$filtro = array(\n\t\t\t\t\t'where' => $tabla.'.categoria = \"'.$dato.'\"',\n\t\t\t\t);\n\t\t\t\t$filtro['order'] = $tabla.'.orden ASC';\n\t\t\t\tbreak;\n\n\t\t\tcase 'nuevo':\n\t\t\tcase 'nuevos':\n\t\t\t\t$filtro = array(\n\t\t\t\t\t'where' => $tabla.'.nuevo = 1',\n\t\t\t\t\t'order' => $tabla.'.orden2 ASC',\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'relacionados':\n\t\t\t\t$filtro = array(\n\t\t\t\t\t'from' => 'JOIN productos_relacionados ON productos_relacionados.relacionado_id = '.$tabla.'.id',\n\t\t\t\t\t'where' => 'productos_relacionados.producto_id = '.intval($dato),\n\t\t\t\t\t'order' => 'productos_relacionados.orden ASC',\n\t\t\t\t);\n\t\t\t\tbreak;\n\n\t\t\tcase 'exhibidor':\n\t\t\t\t$filtro = array(\n\t\t\t\t\t'select' => 'exhibidores_productos.cantidad',\n\t\t\t\t\t'from' => 'JOIN exhibidores_productos ON exhibidores_productos.producto_id = '.$tabla.'.id',\n\t\t\t\t\t'where' => 'exhibidores_productos.exhibidor_id = '.intval($dato),\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'palabra':\n\t\t\t\t$palabra = DB::obtener()->real_escape_string(mb_strtolower($dato, 'UTF-8'));\n\t\t\t\t$filtro = array(\n\t\t\t\t\t'where' => 'LOWER('.$tabla.'.nombre) LIKE \"%'. $palabra .'%\"',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $filtro;\n\t}",
"public function filterName($table)\n {\n return trim($this->db->quote($table), \"'\");\n }",
"public function where($table,$column,$data = \"\");",
"function searchTableStatique() {\n include_once('./lib/config.php');\n $table = $_POST['table'];\n $tableStatique = Doctrine_Core::getTable($table);\n $columnNames = $tableStatique->getColumnNames();\n $req = '';\n $param = array();\n $premierPassage = true;\n foreach ($columnNames as $columnName) {\n if ($columnName != 'id') {\n $req .= $premierPassage ? $columnName.' like ? ' : 'and '.$columnName.' like ? ';\n $param[] = $_POST[$columnName].'%';\n $premierPassage = false;\n }\n }\n $search = $tableStatique->findByDql($req, $param);\n echo generateContenuTableStatiqueEntab($table, $tableStatique, $search);\n}",
"public function whereLike($table, $column, $value);",
"public function getTableWhere() {}",
"function getList($tabName, $filterName, $filterValue) {\n global $mysqli;\n\n $header=getColumns($tabName);\n \n $sql=\"SELECT * FROM $tabName WHERE $filterName='$filterValue'\";\n\t$resultado=doQuery($sql);\n\t$noColumnas = count($header);\n\t$html='<thead>';\n\tfor ($i=0; $i < count($header) ; $i++) { \n\t\t$html.=\"<th>\".$header[$i].\"</th>\";\n\t}\n\n\t$html.='</thead>';\n\t\n\tforeach ($resultado->fetch_all(MYSQLI_BOTH) as $key => $value) {\n\t\t\n\t\t$html.='<tr>';\n\t\tfor ($j=0; $j < $noColumnas ; $j++) { \n\t\t\t\n\t\t\t$html.=\"<td>\".$value[$j].\"</td>\";\n\t\t}\n\t\t$html.='</tr>';\n\t}\t\n\n return \"<table class='analyst-list'>\".$html.\"</table>\";\n}",
"public function vistaTablaModel($tabla){\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\");\t\r\n\t\t$stmt->execute();\r\n\r\n\t\t#fetchAll(): Obtiene todas las filas de un conjunto de resultados asociado al objeto PDOStatement. \r\n\t\treturn $stmt->fetchAll();\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}",
"public function datatable_setor_tunai_tabungan()\n\t{\n\t\t$aColumns = array( 'c.cif_no','c.nama','a.account_saving_no','a.amount','a.trx_date','');\n\t\t\t\t\n\t\t/* \n\t\t * Paging\n\t\t */\n\t\t$sLimit = \"\";\n\t\tif ( isset( $_GET['iDisplayStart'] ) && $_GET['iDisplayLength'] != '-1' )\n\t\t{\n\t\t\t$sLimit = \" OFFSET \".intval( $_GET['iDisplayStart'] ).\" LIMIT \".\n\t\t\t\tintval( $_GET['iDisplayLength'] );\n\t\t}\n\t\t\n\t\t/*\n\t\t * Ordering\n\t\t */\n\t\t$sOrder = \"\";\n\t\tif ( isset( $_GET['iSortCol_0'] ) )\n\t\t{\n\t\t\t$sOrder = \"ORDER BY \";\n\t\t\tfor ( $i=0 ; $i<intval( $_GET['iSortingCols'] ) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $_GET[ 'bSortable_'.intval($_GET['iSortCol_'.$i]) ] == \"true\" )\n\t\t\t\t{\n\t\t\t\t\t$sOrder .= \"\".$aColumns[ intval( $_GET['iSortCol_'.$i] ) ].\" \".\n\t\t\t\t\t\t($_GET['sSortDir_'.$i]==='asc' ? 'asc' : 'desc') .\", \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sOrder = substr_replace( $sOrder, \"\", -2 );\n\t\t\tif ( $sOrder == \"ORDER BY\" )\n\t\t\t{\n\t\t\t\t$sOrder = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* \n\t\t * Filtering\n\t\t */\n\t\t$sWhere = \"\";\n\t\tif ( isset($_GET['sSearch']) && $_GET['sSearch'] != \"\" )\n\t\t{\n\t\t\t$sWhere = \"AND (\";\n\t\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t\t{\n\t\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower( $_GET['sSearch'] ).\"%' OR \";\n\t\t\t}\n\t\t\t$sWhere = substr_replace( $sWhere, \"\", -3 );\n\t\t\t$sWhere .= ')';\n\t\t}\n\t\t\n\t\t/* Individual column filtering */\n\t\tfor ( $i=0 ; $i<count($aColumns) ; $i++ )\n\t\t{\n\t\t\tif ( $aColumns[$i] != '' )\n\t\t\t{\n\t\t\t\tif ( isset($_GET['bSearchable_'.$i]) && $_GET['bSearchable_'.$i] == \"true\" && $_GET['sSearch_'.$i] != '' )\n\t\t\t\t{\n\t\t\t\t\tif ( $sWhere == \"\" )\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere = \"AND \";\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$sWhere .= \" AND \";\n\t\t\t\t\t}\n\t\t\t\t\t$sWhere .= \"LOWER(CAST(\".$aColumns[$i].\" AS VARCHAR)) LIKE '%\".strtolower($_GET['sSearch_'.$i]).\"%' \";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$rResult \t\t\t= $this->model_transaction->datatable_setor_tunai_tabungan($sWhere,$sOrder,$sLimit); // query get data to view\n\t\t$rResultFilterTotal = $this->model_transaction->datatable_setor_tunai_tabungan($sWhere); // get number of filtered data\n\t\t$iFilteredTotal \t= count($rResultFilterTotal); \n\t\t$rResultTotal \t\t= $this->model_transaction->datatable_setor_tunai_tabungan(); // get number of all data\n\t\t$iTotal \t\t\t= count($rResultTotal);\t\n\t\t\n\t\t/*\n\t\t * Output\n\t\t */\n\t\t$output = array(\n\t\t\t\"sEcho\" => intval($_GET['sEcho']),\n\t\t\t\"iTotalRecords\" => $iTotal,\n\t\t\t\"iTotalDisplayRecords\" => $iFilteredTotal,\n\t\t\t\"aaData\" => array()\n\t\t);\n\t\t\n\t\tforeach($rResult as $aRow)\n\t\t{\n\t\t\t$row = array();\n\t\t\t$row[] = $aRow['cif_no'];\n\t\t\t$row[] = $aRow['nama'];\n\t\t\t$row[] = $aRow['account_saving_no'];\n\t\t\t$row[] = '<div align=\"right\">Rp '.number_format($aRow['amount'],0,',','.').',-</div>';\n\t\t\t$row[] = $this->format_date_detail($aRow['trx_date'],'id',false,'/');\n\t\t\t$row[] = '<div align=\"center\"><a href=\"javascript:;\" class=\"btn red mini\" trx_detail_id=\"'.$aRow['trx_detail_id'].'\" account_saving_no=\"'.$aRow['account_saving_no'].'\" nama=\"'.$aRow['nama'].'\" id=\"link-delete\">Delete</a></div>';\n\n\t\t\t$output['aaData'][] = $row;\n\t\t}\n\t\t\n\t\techo json_encode( $output );\n\t}",
"public function filtrar(&$filtro)\n {\n parent::filtrar($filtro);\n $filtro_sql = '';\n if ($filtro->filtro('id'))\n $filtro_sql .= \" AND {$this->getTableName()}.id like '%{$filtro->filtro('id')}%' \";\n if ($filtro->filtro('nombre'))\n $filtro_sql .= \" AND {$this->getTableName()}.nombre like '%{$filtro->filtro('nombre')}%' \";\n if ($filtro->filtro('descripcion'))\n $filtro_sql .= \" AND {$this->getTableName()}.descripcion like '%{$filtro->filtro('descripcion')}%' \";\n return $filtro_sql;\n }",
"public static function setSearchFilter ($qb, $filter_param, $table_name, $table_column_name, $searchtype, $ex_message, $ex_code) {\n\n $param = Validator::toArray($filter_param);\n\n foreach ($param as $values)\n {\n $orx = $qb->expr()->orX();\n $andx = $qb->expr()->andX();\n if ( Validator::isNull($values) )\n $andx->add($qb->expr()->isNull($table_name.\".\".$table_column_name));\n else if ( Validator::IsValue($values) )\n {\n if ( $searchtype == Parameters::Exact )\n $orx->add($qb->expr()->eq($table_name.\".\".$table_column_name, Validator::ToQuote(Validator::toValue($values))));\n else if ( $searchtype == Parameters::Contain )\n $orx->add($qb->expr()->like($table_name.\".\".$table_column_name, Validator::ToQuote('%'.Validator::toValue($values).'%')));\n else\n {\n $words = Validator::toArray($values, \" \");\n foreach ($words as $word)\n {\n switch ($searchtype)\n {\n case Parameters::ContainAll :\n $andx->add($qb->expr()->like($table_name.\".\".$table_column_name, Validator::ToQuote('%'.Validator::toValue($word).'%')));\n break;\n case Parameters::ContainAny :\n $orx->add($qb->expr()->like($table_name.\".\".$table_column_name, Validator::ToQuote('%'.Validator::toValue($word).'%')));\n break;\n case Parameters::StartWith :\n $orx->add($qb->expr()->like($table_name.\".\".$table_column_name, Validator::ToQuote(Validator::toValue($word).'%')));\n break;\n case Parameters::EndWith :\n $orx->add($qb->expr()->like($table_name.\".\".$table_column_name, Validator::ToQuote('%'.Validator::toValue($word))));\n break;\n }\n }\n }\n }\n else\n throw new Exception($ex_message . \" : \" . $values, $ex_code);\n\n switch ($searchtype)\n {\n case Parameters::ContainAll :\n $qb->andWhere($andx);\n break;\n default :\n $qb->andWhere($orx);\n break;\n }\n\n }\n }",
"function filterType($tbl, $tbl2, $tbl3, $col, $col2, $col3, $filter) {\n\t\tinclude('connect.php');\n\t\t$queryFilter = \"SELECT * FROM {$tbl} m, {$tbl2} g, {$tbl3} mg WHERE m.{$col} = mg.{$col} AND g.{$col2} = mg.{$col2} AND g.{$col3} = '{$filter}'\";\n\t\t$runFilter = mysqli_query($link, $queryFilter);\n\t\tif($runFilter){\n\t\t\treturn $runFilter;\n\t\t}else{\n\t\t\t$error = \"There was an error accessing this Information. Please contact your admin.\";\n\t\t\treturn $error;\n\t\t}\n\t\tmysqli_close($link);\n\t}",
"public function filter_coler($params){\n $this->db->select(\"$this->table_product.text_coler\")\n ->from($this->table_product);\n $this->db->distinct();\n if (!empty($params['keyword'])) $this->db->like(\"$this->table_product.text_coler\", $params['keyword']);\n $query = $this->db->get();//var_dump($this->db->last_query()); exit();\n return $query->result();\n }",
"public function orWhere($table,$column,$data = \"\");",
"function getListFilter($col,$key,$tahun='',$bulan='') {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'periode': \n\t\t\t\t\treturn \"datepart(year,p.tglperolehan) = '$tahun' and datepart(month,p.tglperolehan) = '$bulan' \"; \n\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once('m_unit.php');\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"infoleft >= \".(int)$row['infoleft'].\" and inforight <= \".(int)$row['inforight'];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"private function _sql_filter($table, $column, $operation, $value) {\n\t\tglobal $wpdb;\n\n\t\tif ( empty($value) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\tif ( is_array($value) ) {\n\t\t\tforeach ($value as &$v) {\n\t\t\t\t$v = $wpdb->prepare('%s', $v);\n\t\t\t}\n\n\t\t\t$value = '('. implode(',', $value) . ')';\n\t\t}\n\t\telse {\n\t\t\t$value = $wpdb->prepare('%s', $value);\n\t\t}\n\n\t\treturn sprintf(\"%s %s.%s %s %s\"\n\t\t\t, $this->join_rule\n\t\t\t, $table\n\t\t\t, $column\n\t\t\t, $operation\n\t\t\t, $value\n\t\t);\n\t}",
"private function init_andWhereFilter_localTable( $arr_piVar, $tableField )\n {\n $str_andWhere = null;\n // SWITCH : area filter versus default filter\n switch ( true )\n {\n case( is_array( $this->pObj->objCal->arr_area[ $tableField ] ) ):\n // Handle area filter\n $str_andWhere = $this->init_andWhereFilter_localTableArea( $arr_piVar, $tableField );\n break;\n // #i0117, 141223, dwildt, +\n case( in_array( $tableField, $this->treeviewTableFields ) ):\n // Handle tree view filter\n list( $table ) = explode( '.', $tableField );\n foreach ( $arr_piVar as $str_value )\n {\n $str_value = str_replace( \"'\", null, $str_value );\n $str_value = str_replace( '\"', null, $str_value );\n $arr_orValues[] = $table . '.uid' . \" LIKE '\" . $str_value . \"'\";\n $strtolower_value = \"'\" . mb_strtolower( $str_value ) . \"'\";\n $this->arr_filter_condition[ $table . '.uid' ][ 'like' ][] = $strtolower_value;\n }\n $str_andWhere = implode( ' OR ', $arr_orValues );\n if ( !empty( $str_andWhere ) )\n {\n $str_andWhere = ' (' . $str_andWhere . ')';\n }\n break;\n default:\n // Handle default filter (without area)\n foreach ( $arr_piVar as $str_value )\n {\n $str_value = str_replace( \"'\", null, $str_value );\n $str_value = str_replace( '\"', null, $str_value );\n $arr_orValues[] = $tableField . \" LIKE '\" . $str_value . \"'\";\n $strtolower_value = \"'\" . mb_strtolower( $str_value ) . \"'\";\n $this->arr_filter_condition[ $tableField ][ 'like' ][] = $strtolower_value;\n }\n $str_andWhere = implode( ' OR ', $arr_orValues );\n if ( !empty( $str_andWhere ) )\n {\n $str_andWhere = ' (' . $str_andWhere . ')';\n }\n break;\n }\n // SWITCH : area filter versus default filter\n return $str_andWhere;\n }",
"function generateColonneByTypeEnTab($table, $columnName, $recherche=false, $attribut=null, $disabled=false) {\n $columnName = strtolower($columnName);\n $retour = '';\n $disabled = $disabled ? 'disabled' : '';\n $recherche = $recherche ? 'rechercheTableStatique' : '';\n $type = $table->getTypeOfColumn($columnName);\n switch ($type) {\n case 'string':\n $retour .= '<td class=\"'.$recherche.'\" columnName='.$columnName.'>'.$attribut.'</td>';\n break;\n case 'float' :\n case 'integer' :\n if (preg_match('#^id[a-zA-Z]+#', $columnName)) {\n $columnNameId = $columnName;\n $columnName = substr($columnName, 2);\n if ($attribut != 0) {\n $cleEtrangere = Doctrine_Core::getTable($columnName)->findOneBy(\"id\", $attribut);\n $retour .= '<td columnName='.$columnNameId.' idCleEtrangere='.$cleEtrangere->id.'>'.$cleEtrangere->libelle.'</td>';\n } else {\n $retour .= '<td columnName='.$columnNameId.'></td>';\n }\n } else {\n $retour .= '<td columnName='.$columnName.'>'.$attribut.'</td>';\n }\n break;\n case 'boolean' :\n $retour .= '<td>';\n if($attribut != null && $attribut == 1) {\n $retour .= '<span class=\"checkbox checkbox_active\" value=\"1\" columnName='.$columnName.' '.$disabled.'></span></div>';\n } else {\n $retour .= '<span class=\"checkbox\" value=\"0\" columnName='.$columnName.' '.$disabled.'></span></td>';\n };\n break;\n }\n return $retour;\n}",
"private function filter() {\r\n $globalSearch = array();\r\n $columnSearch = array();\r\n\r\n $columns = $this->resource->setDatatableFields(TRUE);\r\n\r\n $dtColumns = $this->pluck($columns, 'dt');\r\n\r\n if (isset($this->resource->requestData['search']) && $this->resource->requestData['search']['value'] != '') {\r\n\r\n $str = $this->resource->requestData['search']['value'];\r\n\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n if ($requestColumn['searchable'] == 'true') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Individual column filtering\r\n if (isset($this->resource->requestData['columns'])) {\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n $str = $requestColumn['search']['value'];\r\n if ($requestColumn['searchable'] == 'true' &&\r\n $str != '') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Combine the filters into a single string\r\n $where = '';\r\n if (count($globalSearch)) {\r\n $where = '(' . implode(' OR ', $globalSearch) . ')';\r\n }\r\n if (count($columnSearch)) {\r\n $where = $where === '' ?\r\n implode(' AND ', $columnSearch) :\r\n $where . ' AND ' . implode(' AND ', $columnSearch);\r\n }\r\n\r\n return $where;\r\n }",
"public function whereEquals($table, $column, $value);",
"function m_cek_jawaban($table, $where){\n\t\t$data = $this->db->get_where($table,$where);\n\t\treturn $data;\n\t}",
"function materialFiltrados($b){\n //Construimos la consulta\n $sql=\"SELECT e.id, nombre, apellidos, materiales,fecha_entrega,talla, cantidad\n FROM empleados e inner join material_entregado m on e.id = m.empleado\n WHERE concat(nombre, ' ', apellidos) like '%\".$b.\"%' order by nombre\";\n //Realizamos la consulta\n $resultado=$this->realizarConsulta($sql);\n if($resultado!=null){\n //Montamos la tabla de resultados\n $tabla=[];\n while($fila=$resultado->fetch_assoc()){\n $tabla[]=$fila;\n }\n return $tabla;\n }else{\n return null;\n }\n }",
"function filterBy_S_A_F_E_C($SEDE, $AREA, $FACULTAD, $ESCUELA, $CARRERA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? AND car_ia = ? \");\n $parametros = array(\"iiiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA, &$CARRERA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}",
"public function nomCol($nomTabla): array {\n $campos = [];\n if ($this->conexion == null) {\n $this->conexion = $this->conexion();\n }\n $consulta = \"select * from $nomTabla\";\n $r = $this->conexion->query($consulta);\n $camposObj = $r->fetch(PDO::FETCH_ASSOC);\n foreach ($camposObj as $nomCol => $campo) {\n $campos[] = $nomCol;\n }\n return $campos;\n }",
"function get_filter_form(Table $table) {\n return $table->renderFilter();\n}",
"function filterBy_S_A_F_E($SEDE, $AREA, $FACULTAD, $ESCUELA,$TABLE_I)\n{\n global $mysqli;\n $TINS = $TABLE_I;\n $query = new Query($mysqli, \"SELECT red,nombre,apellido,CONCAT(provincia,'-',clave,'-',tomo,'-',folio)AS cedula,n_ins,sede,fac_ia,esc_ia,car_ia,fac_iia,esc_iia,car_iia,fac_iiia,esc_iiia,car_iiia\n FROM \" .$TINS. \" where sede = ? AND area_i = ? AND fac_ia = ? AND esc_ia = ? \");\n $parametros = array(\"iiii\", &$SEDE, &$AREA, &$FACULTAD, &$ESCUELA);\n $data = $query->getresults($parametros);\n\n if (isset($data[0])) {\n return $data;\n } else {\n return null;\n }\n\n}",
"function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'periode': return \"periode = '$key'\";\n\t\t\t\tcase 'sistemkuliah': return \"sistemkuliah = '$key'\";\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('unit'));\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"u.infoleft >= \".(int)$row['infoleft'].\" and u.inforight <= \".(int)$row['inforight'];\n\t\t\t\tcase 'basiskampus':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('sistemkuliah'));\n\t\t\t\t\t$sistem = mSistemkuliah::getIdByBasisKampus($conn,modul::getBasis(),modul::getKampus());\n\t\t\t\t\treturn \" sistemkuliah in ('\".implode(\"','\",$sistem).\"') \";\n\t\t\t\t\t\n\t\t\t}\n\t\t}",
"function filter($param)\r\n\t{\r\n\r\n\t\t$this->view = false;\r\n\t\t$this->layout_name = false;\r\n\r\n\t\t$_SQL = Singleton::getInstance(SQL_DRIVER);\r\n\r\n\t\t$sql = \"SELECT `\" . $param[1] . \"` FROM `\" . $param[0] . \"` WHERE `\" . $param[1] . \"` LIKE '\" . $_SQL->sql_real_escape_string($_GET['q']) . \"%' \r\n\t\t ORDER BY `\" . $param[1] . \"` LIMIT 0,100\";\r\n\t\t$res = $_SQL->sql_query($sql);\r\n\r\n\t\twhile ( $ob = $_SQL->sql_fetch_object($res) )\r\n\t\t{\r\n\t\t\techo $ob->$param[1] . \"\\n\";\r\n\t\t}\r\n\t}",
"public function listaTable($campos,$table,$condicao){\n\t\t$msg=\"\";\n\t\t$query=\"\";\n\t\t//echo $this->getConn().\"aki\";\n\t\ttry{\n\t\t\tif($condicao==\"\"){\n\t\t\t\t$case = \"\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$case=\" where \".$condicao;\n\t\t\t}\n\t\t $sql = \"SELECT \".$campos.\" from \".$table.\" \". $case; //echo $sql.\"<br>\";\n\t\t $query = $this->exeSQL($sql,$this->getConn());\n\t\t}catch(Exception $ex){\n\t\t echo $this->getStatus().$ex->getMessage().\" \".$ex->getLine(); //exibe a mensagem de erro\n\t\t}\n\t\treturn $query;\n\t}"
] |
[
"0.5801072",
"0.5722811",
"0.57218766",
"0.5603206",
"0.54908794",
"0.54207426",
"0.54166037",
"0.534392",
"0.531226",
"0.5234809",
"0.52294016",
"0.5199194",
"0.5178596",
"0.51764166",
"0.51173973",
"0.5104152",
"0.5101535",
"0.5100559",
"0.5083795",
"0.5070345",
"0.50258183",
"0.50098574",
"0.499206",
"0.49915078",
"0.49833095",
"0.4971829",
"0.49642107",
"0.49631232",
"0.49560127",
"0.49301732"
] |
0.6066924
|
0
|
Filter the query on the id_field column Example usage: $query>filterByIdField('fooValue'); // WHERE id_field = 'fooValue' $query>filterByIdField('%fooValue%', Criteria::LIKE); // WHERE id_field LIKE '%fooValue%'
|
public function filterByIdField($idField = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($idField)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_ID_FIELD, $idField, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getFieldId_Filter($id_field, $field_prefix = FALSE) {\n\t\tif( $field_prefix === FALSE )\n\t\t \treturn 'field_filter_'.$id_field;\n\t\telse\n\t\t\treturn $field_prefix.'field_filter_'.$id_field;\n\t }",
"function getFieldName_Filter($id_field, $field_prefix = FALSE) {\n\t\tif( $field_prefix === FALSE )\n\t\t \treturn 'field_filter['.$id_field.']';\n\t\telse\n\t\t\treturn $field_prefix.'[field_filter]['.$id_field.']';\n\t }",
"public final function setIdFilter($fld, $val)\n {\n $this->setFilter('id_' . $fld . '={int:id_' . $fld . '}');\n $this->setParameter('id_' . $fld, $val);\n return $this;\n }",
"public function filterId(int $id): self;",
"public static function getUiFilterField($id)\n\t{\n\t\tforeach (static::getFilterFields() as $field)\n\t\t{\n\t\t\tif ($field['id'] === $id)\n\t\t\t{\n\t\t\t\treturn $field;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public function fieldfromid($fieldid) {\n if (empty($fieldid) OR stripos($fieldid, \"field\") === false) {\n return false;\n }\n if (strpos($fieldid, \"siteField\") > 0) {\n //a siteField\n $id = substr($fieldid, 14);\n return ORM::factory(\"siteField\", $id);\n } else {\n //a normal field\n $id = substr($fieldid, 10);\n return ORM::factory(\"field\", $id);\n }\n }",
"abstract protected function foreignIDFilter($id = null);",
"public function setIDField(string $idField) {\n\t\t$this->idField = $idField;\n\t}",
"abstract protected function filterField(): string;",
"abstract protected function filterFieldvalue();",
"public function GetIn($field,$id)\r\n {\r\n $query = mysql_query(\"SELECT * FROM info WHERE id_info = '$id' \");\r\n $row = mysql_fetch_array($query);\r\n if($field == $field)\r\n return $row[$field];\r\n }",
"public function getFieldById($id = false) {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Query set up\t\n\t\t\t$return\t\t\t= ($id) ? $db->getRow('tb_field', '*', \"id = {$id}\") : false;\n\t\t\t// Return\n\t\t\treturn $return;\n\t\t}",
"function SetupLookupFilters($fld, $pageId = null) {\n\t\tglobal $gsLanguage;\n\t\t$pageId = $pageId ?: $this->PageID;\n\t\tswitch ($fld->FldVar) {\n\t\tcase \"x_tipejurnal_id\":\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$sSqlWrk = \"SELECT `id` AS `LinkFld`, `nama` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipejurnal`\";\n\t\t\t$sWhereWrk = \"\";\n\t\t\t$this->tipejurnal_id->LookupFilters = array();\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => '`id` = {filter_value}', \"t0\" => \"3\", \"fn0\" => \"\");\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$this->Lookup_Selecting($this->tipejurnal_id, $sWhereWrk); // Call Lookup selecting\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\tif ($sSqlWrk <> \"\")\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\n\t\t\tbreak;\n\t\t}\n\t}",
"function acf_search_fields($id, $fields)\n{\n}",
"protected function applyFieldConditions()\n {\n if ($this->field !== null) {\n $this->andWhere(Db::parseParam('fieldId', $this->parseFieldValue($this->field)));\n }\n }",
"function test_field_specific_search_on_user_id_field() {\n\n\t\t// Username. Three matching entries should be found.\n\t\t$search_string = 'admin';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// UserID number. Three matching entries should be found.\n\t\t$search_string = '1';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_found_tests( $msg, $items, 2, array( 'jamie_entry_key', 'jamie_entry_key_2' ) );\n\n\t\t// UserID number. No matching entries should be found.\n\t\t$search_string = '7';\n\t\t$items = self::generate_and_run_search_query( 'all_field_types', $search_string, 'user_id' );\n\t\t$msg = 'A search for ' . $search_string . ' in UserID field';\n\t\tself::run_entries_not_found_tests( $msg, $items );\n\t}",
"function SetupLookupFilters($fld, $pageId = null) {\n\t\tglobal $gsLanguage;\n\t\t$pageId = $pageId ?: $this->PageID;\n\t\tswitch ($fld->FldVar) {\n\t\tcase \"x_cat_id\":\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$sSqlWrk = \"SELECT `cat_id` AS `LinkFld`, `cat_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `categories`\";\n\t\t\t$sWhereWrk = \"{filter}\";\n\t\t\t$fld->LookupFilters = array(\"dx1\" => '`cat_name`');\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => '`cat_id` IN ({filter_value})', \"t0\" => \"3\", \"fn0\" => \"\");\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$this->Lookup_Selecting($this->cat_id, $sWhereWrk); // Call Lookup Selecting\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\tif ($sSqlWrk <> \"\")\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\n\t\t\tbreak;\n\t\tcase \"x_company_id\":\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$sSqlWrk = \"SELECT DISTINCT `company_id` AS `LinkFld`, `com_fname` AS `DispFld`, `com_lname` AS `Disp2Fld`, `com_name` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `company`\";\n\t\t\t$sWhereWrk = \"{filter}\";\n\t\t\t$fld->LookupFilters = array(\"dx1\" => '`com_fname`', \"dx2\" => '`com_lname`', \"dx3\" => '`com_name`');\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => '`company_id` IN ({filter_value})', \"t0\" => \"3\", \"fn0\" => \"\");\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$this->Lookup_Selecting($this->company_id, $sWhereWrk); // Call Lookup Selecting\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\tif ($sSqlWrk <> \"\")\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\n\t\t\tbreak;\n\t\tcase \"x_pro_model\":\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$sSqlWrk = \"SELECT `model_id` AS `LinkFld`, `name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `model`\";\n\t\t\t$sWhereWrk = \"{filter}\";\n\t\t\t$fld->LookupFilters = array(\"dx1\" => '`name`');\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => '`model_id` IN ({filter_value})', \"t0\" => \"3\", \"fn0\" => \"\");\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$this->Lookup_Selecting($this->pro_model, $sWhereWrk); // Call Lookup Selecting\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\tif ($sSqlWrk <> \"\")\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\n\t\t\tbreak;\n\t\tcase \"x_folder_image\":\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$sSqlWrk = \"SELECT DISTINCT `pro_gallery_id` AS `LinkFld`, `image` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `product_gallery`\";\n\t\t\t$sWhereWrk = \"{filter}\";\n\t\t\t$fld->LookupFilters = array(\"dx1\" => '`image`');\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => '`pro_gallery_id` IN ({filter_value})', \"t0\" => \"3\", \"fn0\" => \"\");\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$this->Lookup_Selecting($this->folder_image, $sWhereWrk); // Call Lookup Selecting\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\tif ($sSqlWrk <> \"\")\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\n\t\t\tbreak;\n\t\tcase \"x_branch_id\":\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$sSqlWrk = \"SELECT `branch_id` AS `LinkFld`, `branch_id` AS `DispFld`, `name` AS `Disp2Fld`, `image` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `branch`\";\n\t\t\t$sWhereWrk = \"{filter}\";\n\t\t\t$fld->LookupFilters = array(\"dx1\" => '`branch_id`', \"dx2\" => '`name`', \"dx3\" => '`image`');\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => '`branch_id` IN ({filter_value})', \"t0\" => \"3\", \"fn0\" => \"\");\n\t\t\t$sSqlWrk = \"\";\n\t\t\t$this->Lookup_Selecting($this->branch_id, $sWhereWrk); // Call Lookup Selecting\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\tif ($sSqlWrk <> \"\")\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\n\t\t\tbreak;\n\t\t}\n\t}",
"public function whereId($id);",
"function search($id, $model) {\n\n\t\t/**\n\t\t * Import a model from a controller\n\t\t * $instanceModel = $this->$model\n\t\t * @var string\n\t\t */\n\t\t$instanceModel = ClassRegistry::init($model);\n\t\t\n\t\t/**\n\t\t * Query to find the ID.\n\t\t * @var string\n\t\t */\n\t\t$queryId = $instanceModel->findById($id);\n\n\t\t/**\n\t\t * Return the ID.\n\t\t */\n\t\treturn $queryId;\n\n\t}",
"public static function get_fielddataid_byid( $field_id, $user_id ) {\n\t\tglobal $wpdb, $bp;\n\n\t\tif ( empty( $field_id ) || empty( $user_id ) ) {\n\t\t\t$fielddata_id = 0;\n\t\t} else {\n\n\t\t\t// Check cache first\n\t\t\t$fielddata = wp_cache_get( $field_id, 'bp_xprofile_data_' . $user_id );\n\t\t\tif ( false === $fielddata || empty( $fielddata->id ) ) {\n\t\t\t\t$fielddata_id = $wpdb->get_var( $wpdb->prepare( \"SELECT id FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d\", $field_id, $user_id ) );\n\t\t\t} else {\n\t\t\t\t$fielddata_id = $fielddata->id;\n\t\t\t}\n\t\t}\n\n\t\treturn $fielddata_id;\n\t}",
"public function findBy($field, $value);",
"function getFilteredSearch(&$field, $value)\r\n\t{\r\n\t\tif ( !in_array($field->field_type, self::$field_types) ) return;\r\n\t\t\r\n\t\t$field->parameters->set( 'display_filter_as_s', 1 ); // Only supports a basic filter of single text search input\r\n\t\treturn FlexicontentFields::getFilteredSearch($field, $value, $return_sql=true);\r\n\t}",
"public function loadFieldById($id)\r\n {\r\n return CrugeFactory::get()->getICrugeFieldLoadModel($id);\r\n }",
"function get_field($id=false, $field=false) {\n\t\tif(!$id && !$field) return false;\n\t\tglobal $wpdb;\n\t\t$query = \"SELECT wposts.$field FROM $wpdb->posts wposts WHERE wposts.ID=$id\";\n\t\t$results = $this->query($query);\n\t\tif(isset($results[0])) return $results[0]->$field;\n\t}",
"public function SelectField($fieldName,$cond_id)\r\n\t\r\n {\r\n\t\tglobal $db;\r\n if($fieldName==\"\" && $cond_id=\"\")\r\n {\r\n $sql = \"SELECT * FROM \".$this->TableName;\r\n } else\r\n {\r\n\t\t \t\r\n $sql = \"SELECT \".$fieldName.\" FROM \". $this->TableName.\" \".$cond_id;\r\n }\r\n try{\r\n $query = $db->prepare($sql);\r\n $query->execute();\r\n $arr['rows'] = $query->fetchAll(PDO::FETCH_ASSOC);\r\n $arr['err'] = false;\r\n } catch(PDOException $e){\r\n $arr['err'] = true;\r\n $arr['msg'] = $e->getMessage(); \r\n } \r\n return $arr;\r\n }",
"function SetupLookupFilters($fld, $pageId = null) {\r\n\t\tglobal $gsLanguage;\r\n\t\t$pageId = $pageId ?: $this->PageID;\r\n\t\tswitch ($fld->FldVar) {\r\n\t\tcase \"x_Titular_Original\":\r\n\t\t\t$sSqlWrk = \"\";\r\n\t\t\t$sSqlWrk = \"SELECT `Apellidos_Nombres` AS `LinkFld`, `Apellidos_Nombres` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `personas`\";\r\n\t\t\t$sWhereWrk = \"{filter}\";\r\n\t\t\t$this->Titular_Original->LookupFilters = array(\"dx1\" => \"`Apellidos_Nombres`\");\r\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => \"`Apellidos_Nombres` = {filter_value}\", \"t0\" => \"201\", \"fn0\" => \"\");\r\n\t\t\t$sSqlWrk = \"\";\r\n\t\t\t$this->Lookup_Selecting($this->Titular_Original, $sWhereWrk); // Call Lookup selecting\r\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\tif ($sSqlWrk <> \"\")\r\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\r\n\t\t\tbreak;\r\n\t\tcase \"x_NroSerie\":\r\n\t\t\t$sSqlWrk = \"\";\r\n\t\t\t$sSqlWrk = \"SELECT `NroSerie` AS `LinkFld`, `NroSerie` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `equipos`\";\r\n\t\t\t$sWhereWrk = \"{filter}\";\r\n\t\t\t$this->NroSerie->LookupFilters = array(\"dx1\" => \"`NroSerie`\");\r\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => \"`NroSerie` = {filter_value}\", \"t0\" => \"200\", \"fn0\" => \"\");\r\n\t\t\t$sSqlWrk = \"\";\r\n\t\t\t$this->Lookup_Selecting($this->NroSerie, $sWhereWrk); // Call Lookup selecting\r\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\tif ($sSqlWrk <> \"\")\r\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\r\n\t\t\tbreak;\r\n\t\tcase \"x_Nuevo_Titular\":\r\n\t\t\t$sSqlWrk = \"\";\r\n\t\t\t$sSqlWrk = \"SELECT `Apellidos_Nombres` AS `LinkFld`, `Apellidos_Nombres` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `personas`\";\r\n\t\t\t$sWhereWrk = \"{filter}\";\r\n\t\t\t$this->Nuevo_Titular->LookupFilters = array(\"dx1\" => \"`Apellidos_Nombres`\");\r\n\t\t\t$lookuptblfilter = \"`NroSerie`='0'\";\r\n\t\t\tew_AddFilter($sWhereWrk, $lookuptblfilter);\r\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => \"`Apellidos_Nombres` = {filter_value}\", \"t0\" => \"201\", \"fn0\" => \"\");\r\n\t\t\t$sSqlWrk = \"\";\r\n\t\t\t$this->Lookup_Selecting($this->Nuevo_Titular, $sWhereWrk); // Call Lookup selecting\r\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\tif ($sSqlWrk <> \"\")\r\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\r\n\t\t\tbreak;\r\n\t\tcase \"x_Id_Motivo_Reasig\":\r\n\t\t\t$sSqlWrk = \"\";\r\n\t\t\t$sSqlWrk = \"SELECT `Id_Motivo_Reasig` AS `LinkFld`, `Descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `motivo_reasignacion`\";\r\n\t\t\t$sWhereWrk = \"\";\r\n\t\t\t$this->Id_Motivo_Reasig->LookupFilters = array();\r\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => \"`Id_Motivo_Reasig` = {filter_value}\", \"t0\" => \"3\", \"fn0\" => \"\");\r\n\t\t\t$sSqlWrk = \"\";\r\n\t\t\t$this->Lookup_Selecting($this->Id_Motivo_Reasig, $sWhereWrk); // Call Lookup selecting\r\n\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\r\n\t\t\tif ($sSqlWrk <> \"\")\r\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}",
"function SetupLookupFilters($fld, $pageId = null) {\n\t\tglobal $gsLanguage;\n\t\t$pageId = $pageId ?: $this->PageID;\n\t\tif ($pageId == \"list\") {\n\t\t\tswitch ($fld->FldVar) {\n\t\t\t}\n\t\t} elseif ($pageId == \"extbs\") {\n\t\t\tswitch ($fld->FldVar) {\n\t\tcase \"x_discapacidad\":\n\t\t\t$sSqlWrk = \"\";\n\t\t\t\t$sSqlWrk = \"SELECT `id` AS `LinkFld`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `discapacidad`\";\n\t\t\t\t$sWhereWrk = \"{filter}\";\n\t\t\t\t$fld->LookupFilters = array();\n\t\t\t$fld->LookupFilters += array(\"s\" => $sSqlWrk, \"d\" => \"\", \"f0\" => '`id` IN ({filter_value})', \"t0\" => \"3\", \"fn0\" => \"\");\n\t\t\t$sSqlWrk = \"\";\n\t\t\t\t$this->Lookup_Selecting($this->discapacidad, $sWhereWrk); // Call Lookup Selecting\n\t\t\t\tif ($sWhereWrk <> \"\") $sSqlWrk .= \" WHERE \" . $sWhereWrk;\n\t\t\tif ($sSqlWrk <> \"\")\n\t\t\t\t$fld->LookupFilters[\"s\"] .= $sSqlWrk;\n\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public function findBy($value, $field = 'id')\n {\n return call_user_func_array([$this->modelClass, 'where'], [$field, $value])->first();\n }",
"abstract public function filterFields();",
"public function field($field_id) {\n\t\t$sql = 'SELECT `#__Field`.* FROM `#__Field` LEFT JOIN `#__Subevaluation_Field` ON `#__Subevaluation_Field`.`Field_id` = `#__Field`.`id` WHERE `#__Field`.`status` = 1 AND `#__Subevaluation_Field`.`Field_id` = ?';\n\t\t$result = $this->execute($sql, $field_id);\n\t\treturn $result;\n\t}"
] |
[
"0.6618918",
"0.5721618",
"0.571868",
"0.56409466",
"0.56247044",
"0.56132054",
"0.5599529",
"0.5572616",
"0.5565382",
"0.55504304",
"0.55007106",
"0.5480055",
"0.5437925",
"0.5427496",
"0.5397594",
"0.5385591",
"0.53380805",
"0.5325547",
"0.53199625",
"0.530217",
"0.5290314",
"0.5272969",
"0.52659756",
"0.52656335",
"0.5258547",
"0.5252748",
"0.52326375",
"0.5224295",
"0.5217426",
"0.52105707"
] |
0.6212728
|
1
|
Filter the query on the edit_tag column Example usage: $query>filterByEditTag('fooValue'); // WHERE edit_tag = 'fooValue' $query>filterByEditTag('%fooValue%', Criteria::LIKE); // WHERE edit_tag LIKE '%fooValue%'
|
public function filterByEditTag($editTag = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($editTag)) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_EDIT_TAG, $editTag, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function ADMIN_ARCHIVE_SEARCH_USER_TAG(){\n\t $SQL_String = \"SELECT * FROM user_tags WHERE owner=:owner AND tag_term=:tag;\";\n\t return $SQL_String;\n\t}",
"public function edit(tag $tag)\n {\n //\n }",
"public function getTag()\n\t{\n\t\treturn 'filter';\n\t}",
"private function filter($filter) {\n\t\tforeach ($filter as $key => $value) {\n\n\t\t\tif (array_key_exists('userID', $filter)) {\n\t\t\t\t$this -> db -> where('userID', $filter['userID']);\n\t\t\t}\n\t\t\tif (array_key_exists('catID', $filter)) {\n\t\t\t\t$this -> db -> where('catID', $filter['catID']);\n\t\t\t}\n\n\t\t\tif (array_key_exists('search', $filter)) {\n\t\t\t\t$array = explode(' ', $value);\n\t\t\t\tforeach ($array as $key => $value)\n\t\t\t\t\t$this -> db -> like('title', $value);\n\n\t\t\t}\n\t\t}\n\t}",
"public function edit(Tag $tag)\n {\n \t//\n }",
"public function filter($id, $filter) {\n // tags whose name begins with $filter.\n $this->index($id, $filter);\n }",
"public function edit(tags $tags)\n {\n //\n }",
"public function FilterDescription() {\n\t\t$params = $this->parseParams();\n\n\t\t$filters = array();\n\t\tif ($params['tag']) {\n\t\t\t$term = TaxonomyTerm::get_by_id('TaxonomyTerm', $params['tag']);\n\t\t\tif ($term) {\n\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_WITHIN', 'within') . ' \"' . $term->Name . '\"';\n\t\t\t}\n\t\t}\n\n\t\tif ($params['from'] || $params['to']) {\n\t\t\tif ($params['from']) {\n\t\t\t\t$from = strtotime($params['from']);\n\t\t\t\tif ($params['to']) {\n\t\t\t\t\t$to = strtotime($params['to']);\n\t\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_BETWEEN', 'between') . ' '\n\t\t\t\t\t\t. date('j/m/Y', $from) . ' and ' . date('j/m/Y', $to);\n\t\t\t\t} else {\n\t\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $from);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$to = strtotime($params['to']);\n\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $to);\n\t\t\t}\n\t\t}\n\n\t\tif ($params['year'] && $params['month']) {\n\t\t\t$timestamp = mktime(1, 1, 1, $params['month'], 1, $params['year']);\n\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_IN', 'in') . ' ' . date('F', $timestamp) . ' ' . $params['year'];\n\t\t}\n\n\t\tif ($filters) {\n\t\t\treturn $this->getUpdateName() . ' ' . implode(' ', $filters);\n\t\t}\n\t}",
"public function tagsfilterAction()\n {\n $page = $this->params()->fromQuery('page', 1);\n $filter = $this->params()->fromRoute('tag', null);\n\n // Filter posts by tag\n $query = $this->entityManager->getRepository(Post::class)->findPostsByTag($filter);\n\n $adapter = new DoctrineAdapter(new ORMPaginator($query, false));\n $paginator = new Paginator($adapter);\n $paginator->setDefaultItemCountPerPage(15);\n $paginator->setCurrentPageNumber($page);\n\n /* Change layout */\n $this->layout()->setTemplate('layout/layout-front');\n\n /* Latest 3 posts */\n $latestPosts = $this->entityManager->getRepository(Post::class)->findLatestPosts(2);\n\n /* Countries List */\n $countries = $this->entityManager->getRepository(Post::class)->getCountries();\n\n /* Cuisine Types list */\n $types = $this->entityManager->getRepository(Post::class)->getCuisineTypes();\n\n // Render the view template.\n return new ViewModel([\n 'posts' => $paginator,\n 'postManager' => $this->postManager,\n 'countries' => $countries,\n 'types' => $types,\n 'latestPosts' => $latestPosts\n ]);\n }",
"public function filter()\n\t{\n\t //$this->form_validation->set_rules('tag','Tag','required');\n\t\tif(!$this->input->post('tag'))\n\t\t{\n\t\t\t$data=$this->am->getArticleData();\n\t\t\t$data['TagData']=$this->am->getTagData();\n \t\t$data['error']='Select Any Tag First';\n\t\t\tget_view('article','Read with e_learn',$data);\n\t\t}\n\t\telse\n\t\t{\n \t\t//get all Article details\n \t\t$wherein=implode(\", \",array_values($this->input->post('tag')));\n \t\t$data=$this->am->getFilteredArticleData($wherein);\n \t\t$data['TagData']=$this->am->getTagData();\n \t\tget_view('article','Read with e_learn',$data);\n \t}\t\n\t}",
"public function edit(Filter $filter)\n {\n //\n }",
"private static function _getFilter() {}",
"public function findByTag($tag);",
"public function filter($criteria, $filter, $args=[]);",
"private function filterTerm()\n {\n if(empty($this->term)) {\n return;\n }\n\n $this->query->andWhere(\n ['or',\n ['LIKE', 'message', $this->term],\n ['LIKE', 'category', $this->term],\n ]\n );\n }",
"public function filterByEditedBy($editedBy = null, $comparison = null)\n {\n if (is_array($editedBy)) {\n $useMinMax = false;\n if (isset($editedBy['min'])) {\n $this->addUsingAlias(EgiveTableMap::COL_EGV_EDITEDBY, $editedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($editedBy['max'])) {\n $this->addUsingAlias(EgiveTableMap::COL_EGV_EDITEDBY, $editedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EgiveTableMap::COL_EGV_EDITEDBY, $editedBy, $comparison);\n }",
"public function on_filter( $query ) {\n\t global $post_type, $pagenow;\n \tif( !$pagenow == 'edit.php' || \n \t\t$post_type != $this->get_id() || \n \t\t!$query->is_main_query() ) {\n \t\treturn;\n \t}\n\n \tforeach ($this->args['columns'] as $key => $col) {\n\t\t\tif( empty( $col['filter_cb'] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif( !isset( $_GET[$key] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$col['filter_cb']( $query, $_GET[$key] );\n \t}\n\n \treturn $query;\n\t}",
"static function filter($model) {\n $cond = Session::get('filter', strtolower($model->source));\n $param = array(\n /* Relaciones */\n 'rel' => array(\n '=' => 'Igual',\n 'LIKE' => 'Parecido',\n '<>' => 'Diferente',\n '<' => 'Menor',\n '>' => 'Mayor'\n ),\n 'col' => array_diff($model->fields, $model->_at, $model->_in, $model->primary_key),\n 'model' => $model,\n 'cond' => $cond\n );\n ob_start();\n View::partial('backend/filter', false, $param);\n return ob_get_clean();\n }",
"function _search($field, $key)\n\t{\n\t\tswitch ($field)\n\t\t{\n\t\t\tcase 'name':\n\t\t\t{\n\t\t\t\t$this->db->where('MATCH(tag.name) AGAINST(\\'\"'.$this->db->escape_str($key).'\"\\' IN BOOLEAN MODE)');\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"public static function filterTag(Tag $tag, Parser $parser, array $tagsConfig, array $openTags)\n\t{\n\t\t$tagName = $tag->getName();\n\t\t$tagConfig = $tagsConfig[$tagName];\n\n\t\t// Record the tag being processed into the logger it can be added to the context of\n\t\t// messages logged during the execution\n\t\t$logger = $parser->getLogger();\n\t\t$logger->setTag($tag);\n\n\t\t// Prepare the variables that are accessible to filters\n\t\t$text = $parser->getText();\n\t\t$vars = [\n\t\t\t'innerText' => '',\n\t\t\t'logger' => $logger,\n\t\t\t'openTags' => $openTags,\n\t\t\t'outerText' => substr($text, $tag->getPos(), $tag->getLen()),\n\t\t\t'parser' => $parser,\n\t\t\t'registeredVars' => $parser->registeredVars,\n\t\t\t'tag' => $tag,\n\t\t\t'tagConfig' => $tagConfig,\n\t\t\t'tagText' => substr($text, $tag->getPos(), $tag->getLen()),\n\t\t\t'text' => $text\n\t\t];\n\t\t$endTag = $tag->getEndTag();\n\t\tif ($endTag)\n\t\t{\n\t\t\t$vars['innerText'] = substr($text, $tag->getPos() + $tag->getLen(), $endTag->getPos() - $tag->getPos() - $tag->getLen());\n\t\t\t$vars['outerText'] = substr($text, $tag->getPos(), $endTag->getPos() + $endTag->getLen() - $tag->getPos());\n\t\t}\n\t\tforeach ($tagConfig['filterChain'] as $filter)\n\t\t{\n\t\t\tif ($tag->isInvalid())\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tself::executeFilter($filter, $vars);\n\t\t}\n\n\t\t// Remove the tag from the logger\n\t\t$logger->unsetTag();\n\t}",
"private function filter() {\r\n $globalSearch = array();\r\n $columnSearch = array();\r\n\r\n $columns = $this->resource->setDatatableFields(TRUE);\r\n\r\n $dtColumns = $this->pluck($columns, 'dt');\r\n\r\n if (isset($this->resource->requestData['search']) && $this->resource->requestData['search']['value'] != '') {\r\n\r\n $str = $this->resource->requestData['search']['value'];\r\n\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n if ($requestColumn['searchable'] == 'true') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $globalSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Individual column filtering\r\n if (isset($this->resource->requestData['columns'])) {\r\n for ($i = 0, $ien = count($this->resource->requestData['columns']); $i < $ien; $i++) {\r\n $requestColumn = $this->resource->requestData['columns'][$i];\r\n $columnIdx = array_search($requestColumn['data'], $dtColumns);\r\n $column = $columns[$columnIdx];\r\n $str = $requestColumn['search']['value'];\r\n if ($requestColumn['searchable'] == 'true' &&\r\n $str != '') {\r\n\r\n $binding = '%' . $str . '%';\r\n\r\n if (strpos($column['db'], \".\") !== FALSE) {\r\n\r\n $fld = explode('.', $column['db']);\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifierChain([$fld[0], $fld[1]]) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n } else {\r\n $columnSearch[] = $this->adapter->platform->quoteIdentifier($column['db']) . \" LIKE \" . $this->adapter->platform->quoteValue($binding);\r\n }\r\n }\r\n }\r\n }\r\n // Combine the filters into a single string\r\n $where = '';\r\n if (count($globalSearch)) {\r\n $where = '(' . implode(' OR ', $globalSearch) . ')';\r\n }\r\n if (count($columnSearch)) {\r\n $where = $where === '' ?\r\n implode(' AND ', $columnSearch) :\r\n $where . ' AND ' . implode(' AND ', $columnSearch);\r\n }\r\n\r\n return $where;\r\n }",
"public function searchByTag($tagName) {\n\t\t$this->waitTillElementIsNotNull($this->tagsInputXpath);\n\t\t$inputField = $this->find(\"xpath\", $this->tagsInputXpath);\n\n\t\t/**\n\t\t * @return string\n\t\t */\n\t\t$this->assertElementNotNull(\n\t\t\t$inputField,\n\t\t\t__METHOD__ .\n\t\t\t\" xpath $this->tagsInputXpath \" .\n\t\t\t\"could not find input field\"\n\t\t);\n\t\t$inputField->focus();\n\t\t$inputField->setValue($tagName);\n\t\t$this->waitTillElementIsNotNull($this->getTagsDropDownResultsXpath());\n\t\t$tagSuggestions = $this->findAll(\"xpath\", $this->getTagsDropDownResultsXpath());\n\t\tforeach ($tagSuggestions as $tag) {\n\t\t\tif ($tag->getText() === $tagName) {\n\t\t\t\t$tag->click();\n\t\t\t}\n\t\t}\n\t}",
"public function show_logs_filter_by_tags() {\n $app = $this->app;\n $srv = new LogService($this->getEntityManager(), $app, $this->getUser());\n\n // log has no tags attached\n if (array_key_exists('tags_chk', $app->request->post()) === false) {\n $list = $srv->get_untagged_logs();\n $app->render('Logbook/filter_logs_by_tags.html.twig', array(\n 'globals' => $this->getGlobals(),\n 'log_list' => $list['logs'],\n 'tag_list' => $list['tags'],\n 'info' => 'Hieronder een overzicht van ongetagde logs.')\n );\n\n // log has tags attached\n } else {\n\n // tags attached\n $list = $srv->get_filtered_logs_and_tags();\n if (sizeof($list['logs']) < 1) {\n $app->flash('error', 'Geen resultaten gevonden.');\n $app->redirect($this->app->urlFor('log_new'));\n }\n $app->render('Logbook/filter_logs_by_tags.html.twig', array('globals' => $this->getGlobals(), 'log_list' => $list['logs'], 'tag_list' => $list['tags'], 'info' => 'Hieronder een overzicht van logs met tags: ' . $list['selected_tags_string']));\n }\n }",
"public function scopeGetTag($query, $tag = null)\n\t {\n\t\tif(is_null($tag))\n\t\t return null;\n\n\t\treturn $query->where('tags', 'like', \"%{$tag}%\");\n\t}",
"public function edit(TagBlog $tagBlog)\n {\n //\n }",
"public function actionEdit()\n\t{\n\t\t$input = $this->_input->filter(array(\n\t\t\t'tag_id' => XenForo_Input::UINT\n\t\t));\n\n\t\t$tag = $this->_getTagOrError($input['tag_id']);\n\n\t\treturn $this->_getTagAddEditResponse($tag);\n\t}",
"function getListFilter($col,$key) {\n\t\t\tswitch($col) {\n\t\t\t\tcase 'periode': return \"periode = '$key'\";\n\t\t\t\tcase 'sistemkuliah': return \"sistemkuliah = '$key'\";\n\t\t\t\tcase 'unit':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('unit'));\n\t\t\t\t\t\n\t\t\t\t\t$row = mUnit::getData($conn,$key);\n\t\t\t\t\t\n\t\t\t\t\treturn \"u.infoleft >= \".(int)$row['infoleft'].\" and u.inforight <= \".(int)$row['inforight'];\n\t\t\t\tcase 'basiskampus':\n\t\t\t\t\tglobal $conn, $conf;\n\t\t\t\t\trequire_once(Route::getModelPath('sistemkuliah'));\n\t\t\t\t\t$sistem = mSistemkuliah::getIdByBasisKampus($conn,modul::getBasis(),modul::getKampus());\n\t\t\t\t\treturn \" sistemkuliah in ('\".implode(\"','\",$sistem).\"') \";\n\t\t\t\t\t\n\t\t\t}\n\t\t}",
"public function searchByFilter($filter)\n {\n }",
"function add_field_filter($tag = '', $function_to_add = '', $priority = 10, $accepted_args = 1)\n {\n }",
"public function search()\r\n\t{\r\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\r\n\r\n\t\t$criteria=new CDbCriteria;\r\n \r\n\t\t$criteria->compare('title',$this->title,true);\r\n\t\t$criteria->compare('content',$this->content,true);\r\n\t\t$criteria->compare('status',$this->status);\r\n $criteria->compare('tags',$this->tags,true);\r\n\t\t$criteria->compare('category_id',$this->category_id);\r\n $criteria->compare('author_id',$this->author_id);\r\n \r\n if(!Yii::app()->user->checkAccess('editor'))\r\n {\r\n $criteria->addCondition('author_id ='.Yii::app()->user->id,'AND');\r\n }\r\n \r\n if(!empty($this->create_time))\r\n {\r\n list($day,$month,$year) = explode(\".\",$this->create_time);\r\n $daystart= mktime(0,0,0,(int)$month,(int)$day,(int)$year);\r\n $dayend= mktime(23,59,59,(int)$month,(int)$day,(int)$year);\r\n $criteria->addCondition($daystart.'<=create_time AND create_time<='.$dayend);\r\n }\r\n \r\n if(!empty($this->update_time))\r\n {\r\n list($day,$month,$year) = explode(\".\",$this->update_time);\r\n $daystart= mktime(0,0,0,(int)$month,(int)$day,(int)$year);\r\n $dayend= mktime(23,59,59,(int)$month,(int)$day,(int)$year);\r\n $criteria->addCondition($daystart.'<=update_time AND update_time<='.$dayend);\r\n }\r\n \r\n if(isset($_GET['tag']))\r\n $criteria->addSearchCondition('tags',$_GET['tag']);\r\n \r\n\t\treturn new CActiveDataProvider($this, array(\r\n\t\t\t'criteria'=>$criteria,\r\n 'sort'=>array(\r\n 'defaultOrder'=>'t.create_time DESC',\r\n ),\r\n\t\t));\r\n\t}"
] |
[
"0.5215258",
"0.50949854",
"0.49987856",
"0.49764317",
"0.49584097",
"0.4919894",
"0.48790652",
"0.48375517",
"0.48024943",
"0.47931054",
"0.4784671",
"0.4737964",
"0.47227564",
"0.46979043",
"0.4650294",
"0.4630326",
"0.4605882",
"0.46056673",
"0.45771214",
"0.45510325",
"0.4541625",
"0.45380545",
"0.45341286",
"0.45326385",
"0.45278484",
"0.45242935",
"0.45211753",
"0.45189476",
"0.45094907",
"0.45005128"
] |
0.5820079
|
0
|
Filter the query on the change_count column Example usage: $query>filterByChangeCount(1234); // WHERE change_count = 1234 $query>filterByChangeCount(array(12, 34)); // WHERE change_count IN (12, 34) $query>filterByChangeCount(array('min' => 12)); // WHERE change_count > 12
|
public function filterByChangeCount($changeCount = null, $comparison = null)
{
if (is_array($changeCount)) {
$useMinMax = false;
if (isset($changeCount['min'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_CHANGE_COUNT, $changeCount['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($changeCount['max'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_CHANGE_COUNT, $changeCount['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_CHANGE_COUNT, $changeCount, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function filterByChangeCount($changeCount = null, $comparison = null)\n {\n if (is_array($changeCount)) {\n $useMinMax = false;\n if (isset($changeCount['min'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_CHANGE_COUNT, $changeCount['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($changeCount['max'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_CHANGE_COUNT, $changeCount['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_CHANGE_COUNT, $changeCount, $comparison);\n }",
"abstract public function prepareFilteredCount();",
"public function countByFilter(array $filter);",
"public function getRecordsFiltered(): int;",
"function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }",
"public function actionFilter()\n {\n $userSelectData = ArrayHelper::map(User::find()->all(), 'id', 'fullname');\n $serviceOptions = Service::getOptions();\n $userFlatOptions = [];\n $params = Yii::$app->request->queryParams;\n $searchUser = $params['CounterDataSearch']['searchUser'];\n if ($searchUser) {\n $user = User::findOne($searchUser);\n if ($user) {\n $userFlatOptions = ArrayHelper::map($user->flats, 'flat', function ($model) {\n return $model->flat . ', ' . $model->house->name;\n });\n }\n }\n if (!isset($userFlatOptions[$params['CounterDataSearch']['searchFlat']])) {\n unset($params['CounterDataSearch']['searchFlat']);\n }\n \n $searchModel = new CounterDataSearch();\n $dataProvider = $searchModel->search($params);\n \n return $this->render('filter', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'userSelectData' => $userSelectData,\n 'userFlatOptions' => $userFlatOptions,\n 'serviceOptions' => $serviceOptions,\n ]);\n }",
"public function filter($criteria, $filter, $args=[]);",
"function PreciosFilter( $Filter )\n {\n $Field = PreciosField( $Filter );\n \n $where = \"\";\n if( !empty($Filter->precMin) ) $where = 'AND '.$Field.'>='.$Filter->precMin.' ';\n if( !empty($Filter->precMax) && $Filter->precMax<150) $where .= 'AND '.$Field.'<='.$Filter->precMax.' ';\n\n if( !empty($where) ) $where .= 'AND '.$Field.'>0 ';\n return $where; \n }",
"public function scopeFilter($query, $filters) {\n if( $month = $filters['month'] ) {\n\n // Carbon::parse($month)->month --> converts to month number. \n $query->whereMonth('created_at', Carbon::parse($month)->month );\n }\n\n if( $year = $filters['year'] ) {\n \n $query->whereYear('created_at', $year );\n }\n\n }",
"public function getCountProductsFiltersCategory($model)\n {\n $query = Product::query();\n\n if ($model->priceMin && $model->priceMax)\n {\n $query->whereHas('price', function ($q) use ($model) {\n $q->whereUserTypeId($model->userTypeId);\n $q->whereBetween('price', [$model->priceMin, $model->priceMax]);\n });\n }\n\n foreach ($model->parsedFilters as $name => $values) {\n $query->whereHas('properties', function ($query) use ($name, $values) {\n $query->whereHas('property_names', function ($query) use ($name) {\n $query->whereIn('slug', [$name]);\n })->whereHas('property_values', function ($query) use ($values) {\n $query->whereIn('slug', $values);\n });\n });\n }\n\n $query->join('product_category', function ($query) use ($model) {\n $query->on('products.id', '=', 'product_category.product_id')\n ->where('product_category.category_id', '=', \"\". $model->currentCategory->id . \"\");\n })->whereHas('price')->whereIsVisible(true);\n\n return $query->count();\n }",
"public function filterBefore($criteria, $filter);",
"private static function _getFilter() {}",
"public function filter($filter)\n {\n }",
"public function scopeFilter($query, $params)\n {\n if ( isset($params['reference']) && trim($params['reference']) !== '' )\n {\n $query->where('reference', 'LIKE', '%' . trim($params['reference']) . '%');\n // $query->orWhere('combinations.reference', 'LIKE', '%' . trim($params['reference'] . '%'));\n }\n\n if ( isset($params['name']) && trim($params['name']) !== '' )\n {\n $query->where('name', 'LIKE', '%' . trim($params['name'] . '%'));\n }\n\n if ( isset($params['stock']) )\n {\n if ( $params['stock'] == 0 )\n $query->where('quantity_onhand', '<=', 0);\n if ( $params['stock'] == 1 )\n $query->where('quantity_onhand', '>', 0);\n }\n\n if ( isset($params['category_id']) && $params['category_id'] > 0 )\n {\n $query->where('category_id', '=', $params['category_id']);\n }\n\n if ( isset($params['active']) )\n {\n if ( $params['active'] == 0 )\n $query->where('active', '=', 0);\n if ( $params['active'] == 1 )\n $query->where('active', '>', 0);\n }\n\n return $query;\n }",
"protected function filterQuery(&$query) {\n foreach($this->filter_params as $filter) {\n if(Input::has($filter)) {\n $val = Input::get($filter);\n $query->where($filter, '=', $val);\n }\n }\n }",
"public function having(array $filter): static\n {\n return $this->withProperty('filter', array_merge($this->filter, $filter));\n }",
"public function setFilteredCount($filteredCount)\n\t{\n\t\t$this->filteredCount = $filteredCount;\n\t}",
"public static function fetchCount(array $filter = array())\n {\n return self::count( self::definition(), $filter);\n }",
"public function applyFilter(Query $query);",
"public function filterByMinimumLength($value)\n {\n $this->query->andWhere($this->query->expr()->andX()\n ->add($this->query->expr()->isNotNull('b.length'))\n ->add($this->query->expr()->gte('b.length', $this->query->createNamedParameter($value)))\n );\n }",
"protected function filter(&$query)\n {\n if (!empty($this->filterModel)) {\n if (isset($this->filterModel->status_id)) {\n $query->andWhere(['status' => $this->filterModel->status_id]);\n }\n }\n }",
"public function rawFilter($filter) {\n\t\t$query = InventorySummary::orderBy('Client_SKU', 'asc');\n\t\tif(isset($filter['objectID']) && strlen($filter['objectID']) > 3) {\n\t\t\t$query = $query->where('objectID', 'like', $filter['objectID'] . '%');\n\t\t}\n\t\tif(isset($filter['Client_SKU']) && strlen($filter['Client_SKU']) > 3) {\n\t\t\t$query = $query->where('Client_SKU', 'like', $filter['Client_SKU'] . '%');\n\t\t}\n\t\tif(isset($filter['Description']) && strlen($filter['Description']) > 3) {\n\t\t\t$query = $query->where('Description', 'like', $filter['Description'] . '%');\n\t\t}\n\n /*\n * Pick face quantity choices\n */\n if(isset($filter['pickQty_rb'])) {\n if($filter['pickQty_rb'] == 'zero') {\n $query = $query->where('pickQty', '=', '0');\n } elseif($filter['pickQty_rb'] == 'belowMin') {\n $query = $query->where('pickQty', '<', '3');\n } elseif($filter['pickQty_rb'] == 'aboveMin') {\n $query = $query->where('pickQty', '>', '2');\n }\n }\n\n /*\n * Activity location quantity choices\n */\n if(isset($filter['actQty_rb'])) {\n if($filter['actQty_rb'] == 'zero') {\n $query = $query->where('actQty', '=', '0');\n } elseif($filter['actQty_rb'] == 'aboveZero') {\n $query = $query->where('actQty', '>', '0');\n }\n }\n\n /*\n * Reserve quantity choices\n */\n if(isset($filter['resQty_rb'])) {\n if($filter['resQty_rb'] == 'zero') {\n $query = $query->where('resQty', '=', '0');\n } elseif($filter['resQty_rb'] == 'aboveZero') {\n $query = $query->where('resQty', '>', '0');\n }\n }\n\n /*\n * Replen Priority choices\n */\n if(isset($filter['replenPrty_cb_noReplen'])\n or isset($filter['replenPrty_cb_20orBelow'])\n or isset($filter['replenPrty_cb_40orBelow'])\n or isset($filter['replenPrty_cb_60orBelow'])) {\n $query->where(function ($query) use ($filter) {\n if (isset($filter['replenPrty_cb_noReplen']) && $filter['replenPrty_cb_noReplen'] == 'on') {\n $query->orWhereNull('replenPrty')\n ->orWhere('replenPrty', '=', '0');\n }\n if (isset($filter['replenPrty_cb_20orBelow']) && $filter['replenPrty_cb_20orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['1', '20']);\n }\n if (isset($filter['replenPrty_cb_40orBelow']) && $filter['replenPrty_cb_40orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['21', '40']);\n }\n if (isset($filter['replenPrty_cb_60orBelow']) && $filter['replenPrty_cb_60orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['41', '60']);\n }\n });\n }\n //dd(__METHOD__.\"(\".__LINE__.\")\", compact('filter', 'query'));\n\n\t\tif(isset($filter['created_at']) && strlen($filter['created_at']) > 1) {\n\t\t\t$query = $query->where('created_at', 'like', $filter['created_at'] . '%');\n\t\t}\n\t\tif(isset($filter['updated_at']) && strlen($filter['updated_at']) > 1) {\n\t\t\t$query = $query->where('updated_at', 'like', $filter['updated_at'] . '%');\n\t\t}\n return $query;\n }",
"abstract public function filter(Builder $dataSource);",
"public function setFilter($filter)\n {\n parent::setFilter($filter);\n\n $minValue = $this->getOption('min_value');\n $maxValue = $this->getOption('max_value');\n\n $this->userOptions['min_value'] = $minValue ? str_replace(',', '', $minValue) : $minValue;\n $this->userOptions['max_value'] = $maxValue ? str_replace(',', '', $maxValue) : $maxValue;\n }",
"public function filterBeforeAll($filter);",
"private function getColumnFilterScript($params, $itemsCount = false)\n {\n $searchFilter = new CbLogSearchFilter();\n $dateFieldName = $searchFilter->getDateFieldNameByParams($params);\n\n return Yii::$app->view->render(\n \"/journal/filters/columnFilter\",\n [\n 'today' => Yii::t('frontend', 'Today'),\n 'tomorrow' => Yii::t('frontend', 'Tomorrow'),\n 'yesterday' => Yii::t('frontend', 'Yesterday'),\n 'lastweek' => Yii::t('frontend', 'Lastweek'),\n 'lastmonth' => Yii::t('frontend', 'Lastmonth'),\n 'lastyear' => Yii::t('frontend', 'Lastyear'),\n 'certain' => Yii::t('frontend', 'Certain'),\n 'params' => $params,\n 'pageSize' => $params['page_size'] ? $params['page_size'] : JlogDataSearch::TYPE_PAGE_SIZE,\n 'dateFieldName' => $dateFieldName,\n 'itemsCount' => $itemsCount\n ]\n );\n }",
"public function filter(Builder $dataSource)\r\n {\r\n $model = $dataSource->getModel();\r\n $filters = [];\r\n\r\n if ($this->_separated) {\r\n foreach ($this->_fields as $field => $criteria) {\r\n if ($field === self::COLUMN_ID) {\r\n $value = (int) $this->_value;\r\n if (!is_numeric($this->_value)) {\r\n continue;\r\n }\r\n $field = $model->getPrimary();\r\n } elseif ($field === self::COLUMN_NAME) {\r\n $field = $model->getNameExpr();\r\n }\r\n if (null === $this->_value) {\r\n $filter = new \\Elastica\\Query\\Filtered();\r\n $filterMissing = new \\Elastica\\Filter\\Missing($field);\r\n //$filterMissing->addParam(\"existence\", true);\r\n //$filterMissing->addParam(\"null_value\", true);\r\n $filter->setFilter($filterMissing);\r\n\r\n $filters[] = $filter;\r\n } else {\r\n if ($criteria === self::CRITERIA_EQ) {\r\n $filter = new \\Elastica\\Query\\Term();\r\n $filter->setTerm($field, $this->_value);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_NOTEQ) {\r\n $filter = new \\Elastica\\Query\\Term();\r\n $filter->setTerm($field, $this->_value);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_LIKE) {\r\n $filter = new \\Elastica\\Query\\Match();\r\n $filter->setField($field, $this->_value);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_BEGINS) {\r\n //$filter = new \\Elastica\\Query\\Prefix();\r\n //$filter->setPrefix($field, $this->_value);\r\n //$filters[] = $filter;\r\n $filter = new \\Elastica\\Query\\QueryString();\r\n $filter->setQuery($this->_value);\r\n $filter->setDefaultField($field);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_MORE) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['gt' => $this->_value]);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_LESS) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['lt' => $this->_value]);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_MORER) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['gte' => $this->_value]);\r\n $filters[] = $filter;\r\n } elseif ($criteria === self::CRITERIA_LESSER) {\r\n $filter = new \\Elastica\\Query\\Range($field, ['lte' => $this->_value]);\r\n $filters[] = $filter;\r\n }\r\n }\r\n }\r\n } else {\r\n $filters = new \\Elastica\\Query\\MultiMatch();\r\n $fields = [];\r\n foreach ($this->_fields as $field => $criteria) {\r\n if ($field === self::COLUMN_ID) {\r\n $value = (int) $this->_value;\r\n if (!is_numeric($this->_value)) {\r\n continue;\r\n }\r\n $field = $model->getPrimary();\r\n } elseif ($field === self::COLUMN_NAME) {\r\n $field = $model->getNameExpr();\r\n }\r\n $fields[] = $field;\r\n }\r\n\r\n $filters->setFields($fields);\r\n $filters->setTieBreaker(0.3);\r\n $filters->setType($filters::TYPE_BEST_FIELDS);\r\n //$filter->setType($filter::TYPE_MOST_FIELDS);\r\n $filters->setQuery($this->_value);\r\n }\r\n\r\n\r\n return $filters;\r\n }",
"public function filter();",
"public function filterByNotificationChange($notificationChange = null, $comparison = null)\n {\n if (is_string($notificationChange)) {\n $notificationChange = in_array(strtolower($notificationChange), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n }\n\n return $this->addUsingAlias(UserPeer::NOTIFICATION_CHANGE, $notificationChange, $comparison);\n }",
"public function setRowsCountBeforeLimitFilter()\n {\n $this->rowsCountBeforeLimitFilter = $this->getRowsCount();\n }"
] |
[
"0.57235837",
"0.51102656",
"0.50179183",
"0.5013139",
"0.49707618",
"0.4932423",
"0.49069062",
"0.48939055",
"0.4876388",
"0.47630152",
"0.4695796",
"0.46769795",
"0.4668075",
"0.46504813",
"0.4630418",
"0.45633188",
"0.454453",
"0.4538979",
"0.45129848",
"0.45074826",
"0.44991517",
"0.44908398",
"0.44858682",
"0.4458838",
"0.4456533",
"0.44549575",
"0.44258925",
"0.44098836",
"0.44057193",
"0.43899512"
] |
0.56375027
|
1
|
Filter the query on the id_user_modified column Example usage: $query>filterByIdUserModified(1234); // WHERE id_user_modified = 1234 $query>filterByIdUserModified(array(12, 34)); // WHERE id_user_modified IN (12, 34) $query>filterByIdUserModified(array('min' => 12)); // WHERE id_user_modified > 12
|
public function filterByIdUserModified($idUserModified = null, $comparison = null)
{
if (is_array($idUserModified)) {
$useMinMax = false;
if (isset($idUserModified['min'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_MODIFIED, $idUserModified['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($idUserModified['max'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_MODIFIED, $idUserModified['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_MODIFIED, $idUserModified, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function filterByIdUserModified($idUserModified = null, $comparison = null)\n {\n if (is_array($idUserModified)) {\n $useMinMax = false;\n if (isset($idUserModified['min'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_MODIFIED, $idUserModified['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUserModified['max'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_MODIFIED, $idUserModified['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_MODIFIED, $idUserModified, $comparison);\n }",
"public function filterUser(int $id): self;",
"public function filterUser(int|UniqueId $id): self;",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::ID, $id, $comparison);\n }",
"public function filterByModified($modified = null, $comparison = null)\n {\n if (is_array($modified)) {\n $useMinMax = false;\n if (isset($modified['min'])) {\n $this->addUsingAlias(SuitsTableMap::COL_MODIFIED, $modified['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($modified['max'])) {\n $this->addUsingAlias(SuitsTableMap::COL_MODIFIED, $modified['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SuitsTableMap::COL_MODIFIED, $modified, $comparison);\n }",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(sfGuardUserPeer::ID, $id, $comparison);\n }",
"public function filterId(int $id): self;",
"public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientPeer::UPDATED_BY, $updatedBy, $comparison);\n }",
"public function getModifiedSince($id)\n {\n return $this->_engine->read($id . '.time');\n }",
"function AdminListAddFilter($entityId, &$arFilter)\n\t{\n\t\t$arUserFields = $this->GetUserFields($entityId);\n\t\tforeach($arUserFields as $fieldName => $arUserField)\n\t\t{\n\t\t\tif(\n\t\t\t\t$arUserField['SHOW_FILTER'] != 'N' &&\n\t\t\t\t$arUserField['USER_TYPE']['BASE_TYPE'] == 'datetime'\n\t\t\t)\n\t\t\t{\n\t\t\t\t$value1 = $GLOBALS['find_' . $fieldName . '_from'];\n\t\t\t\t$value2 = $GLOBALS['find_' . $fieldName . '_to'];\n\t\t\t\tif($this->IsNotEmpty($value1) && \\Bitrix\\Main\\Type\\Date::isCorrect($value1))\n\t\t\t\t{\n\t\t\t\t\t$date = new \\Bitrix\\Main\\Type\\Date($value1);\n\t\t\t\t\t$arFilter['>=' . $fieldName] = $date;\n\t\t\t\t}\n\t\t\t\tif($this->IsNotEmpty($value2) && \\Bitrix\\Main\\Type\\Date::isCorrect($value2))\n\t\t\t\t{\n\t\t\t\t\t$date = new \\Bitrix\\Main\\Type\\Date($value2);\n\t\t\t\t\tif($arUserField['USER_TYPE_ID'] != 'date')\n\t\t\t\t\t{\n\t\t\t\t\t\t$date->add('+1 day');\n\t\t\t\t\t}\n\t\t\t\t\t$arFilter['<=' . $fieldName] = $date;\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = $GLOBALS['find_' . $fieldName];\n\t\t\t}\n\t\t\tif(\n\t\t\t\t$arUserField['SHOW_FILTER'] != 'N'\n\t\t\t\t&& $arUserField['USER_TYPE']['BASE_TYPE'] != 'file'\n\t\t\t\t&& $this->IsNotEmpty($value)\n\t\t\t)\n\t\t\t{\n\t\t\t\tif($arUserField['SHOW_FILTER'] == 'I')\n\t\t\t\t{\n\t\t\t\t\t$arFilter['=' . $fieldName] = $value;\n\t\t\t\t}\n\t\t\t\telseif($arUserField['SHOW_FILTER'] == 'S')\n\t\t\t\t{\n\t\t\t\t\t$arFilter['%' . $fieldName] = $value;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$arFilter[$fieldName] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function getColumnFilter ( &$where = array(),\n $table,\n $column,\n $columnLogicOpr,\n $minOper,\n $minValue,\n $rangeLogicOper,\n $maxOper,\n $maxValue ) {\n if ( ($minOper != \"\" and $minValue != \"\") and ( $maxValue == \"\" )) {\n $where[] = \"$columnLogicOpr \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue\";\n }\n // Assign just the max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ( $minValue == \"\") ) {\n $where[] = \"$columnLogicOpr \". self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue\";\n }\n\t// Assign both min and max limit\n if ( ($maxOper != \"\" and $maxValue != \"\") and ($minOper != \"\" and $minValue != \"\") ) {\n $where[] = \"$columnLogicOpr ( \".self::getTableAlias( $table ).\".$column \".self::assignSymbol( $minOper ).\" $minValue $rangeLogicOper \".\n self::getTableAlias ($table) . \".$column \".self::assignSymbol($maxOper).\" $maxValue )\";\n }\n }",
"public function getModifiedById()\n\t{\n\t\treturn $this->modifiedById;\n\t}",
"public function filterByIdUserCreated($idUserCreated = null, $comparison = null)\n {\n if (is_array($idUserCreated)) {\n $useMinMax = false;\n if (isset($idUserCreated['min'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUserCreated['max'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated, $comparison);\n }",
"public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::UPDATED_BY, $updatedBy, $comparison);\n }",
"public function setModifiedById($modifiedById)\n\t{\n\t\t$this->modifiedById = $modifiedById;\n\n\t\treturn $this;\n\t}",
"function filter_media( $query ) {\r\n\t\t// admins get to see everything\r\n\t\tif ( ! current_user_can( 'manage_options' ) )\r\n\t\t\t$query['author'] = get_current_user_id();\r\n\t\treturn $query;\r\n\t}",
"function hs_filter_posts_list($query)\n{\n\t global $pagenow;\n\n\t//$current_user uses the get_currentuserinfo() method to get the currently logged in user's data\n\t global $current_user;\n\t wp_get_current_user();\n \n \t//Shouldn't happen for the admin, but for any role with the edit_posts capability and only on the posts list page, that is edit.php\n \tif(!current_user_can('administrator') && current_user_can('edit_posts') && ('edit.php' == $pagenow))\n \t {\n\t\t//global $query's set() method for setting the author as the current user's id\n\t\t$query->set('author', $current_user->ID); \n \t}\n}",
"function get_editable_user_ids($user_id, $exclude_zeros = \\true, $post_type = 'post')\n {\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UsuarioPerfilPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UsuarioPerfilPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UsuarioPerfilPeer::ID, $id, $comparison);\n }",
"public function filterByIdUserCreated($idUserCreated = null, $comparison = null)\n {\n if (is_array($idUserCreated)) {\n $useMinMax = false;\n if (isset($idUserCreated['min'])) {\n $this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $idUserCreated['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUserCreated['max'])) {\n $this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $idUserCreated['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $idUserCreated, $comparison);\n }",
"public function filterByUpdatedBy($updatedBy = null, $comparison = null)\n {\n if (is_array($updatedBy)) {\n $useMinMax = false;\n if (isset($updatedBy['min'])) {\n $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($updatedBy['max'])) {\n $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::UPDATED_BY, $updatedBy, $comparison);\n }",
"public function filterByIdUser($idUser = null, $comparison = null)\n {\n if (is_array($idUser)) {\n $useMinMax = false;\n if (isset($idUser['min'])) {\n $this->addUsingAlias(ArticleTableMap::COL_ID_USER, $idUser['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUser['max'])) {\n $this->addUsingAlias(ArticleTableMap::COL_ID_USER, $idUser['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ArticleTableMap::COL_ID_USER, $idUser, $comparison);\n }"
] |
[
"0.69071525",
"0.5796098",
"0.5744311",
"0.54352045",
"0.54352045",
"0.54341865",
"0.53466713",
"0.53466713",
"0.53466713",
"0.53466713",
"0.53466713",
"0.53466713",
"0.53466713",
"0.5284945",
"0.504778",
"0.4979496",
"0.49399102",
"0.49237937",
"0.48862967",
"0.4870609",
"0.48608163",
"0.4854943",
"0.4846083",
"0.48393208",
"0.4839311",
"0.4838943",
"0.48248407",
"0.48211786",
"0.47852862",
"0.47834378"
] |
0.69056237
|
1
|
Filter the query on the id_user_created column Example usage: $query>filterByIdUserCreated(1234); // WHERE id_user_created = 1234 $query>filterByIdUserCreated(array(12, 34)); // WHERE id_user_created IN (12, 34) $query>filterByIdUserCreated(array('min' => 12)); // WHERE id_user_created > 12
|
public function filterByIdUserCreated($idUserCreated = null, $comparison = null)
{
if (is_array($idUserCreated)) {
$useMinMax = false;
if (isset($idUserCreated['min'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $idUserCreated['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($idUserCreated['max'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $idUserCreated['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $idUserCreated, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function filterByIdUserCreated($idUserCreated = null, $comparison = null)\n {\n if (is_array($idUserCreated)) {\n $useMinMax = false;\n if (isset($idUserCreated['min'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUserCreated['max'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated, $comparison);\n }",
"public function filterUser(int|UniqueId $id): self;",
"public function filterUser(int $id): self;",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(ClientPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(ClientPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::ID, $id, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(UserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(UserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserPeer::ID, $id, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy, $comparison);\n }",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"function UserID_Filtering(&$filter) {\n\n\t\t// Enter your code here\n\t}",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n\t{\n\t\tif (is_array($createdAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($createdAt['min'])) {\n\t\t\t\t$this->addUsingAlias(afGuardUserPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($createdAt['max'])) {\n\t\t\t\t$this->addUsingAlias(afGuardUserPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(afGuardUserPeer::CREATED_AT, $createdAt, $comparison);\n\t}",
"public function filterByCreated($created = null, $comparison = null)\n {\n if (is_array($created)) {\n $useMinMax = false;\n if (isset($created['min'])) {\n $this->addUsingAlias(PhotosPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($created['max'])) {\n $this->addUsingAlias(PhotosPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PhotosPeer::CREATED, $created, $comparison);\n }",
"public function filterById($id = null, $comparison = null)\n {\n if (is_array($id)) {\n $useMinMax = false;\n if (isset($id['min'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($id['max'])) {\n $this->addUsingAlias(sfGuardUserPeer::ID, $id['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(sfGuardUserPeer::ID, $id, $comparison);\n }",
"public function filterByCreated($created = null, $comparison = null)\n {\n if (is_array($created)) {\n $useMinMax = false;\n if (isset($created['min'])) {\n $this->addUsingAlias(SuitsTableMap::COL_CREATED, $created['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($created['max'])) {\n $this->addUsingAlias(SuitsTableMap::COL_CREATED, $created['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SuitsTableMap::COL_CREATED, $created, $comparison);\n }",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n {\n if (is_array($createdAt)) {\n $useMinMax = false;\n if (isset($createdAt['min'])) {\n $this->addUsingAlias(sfGuardUserPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdAt['max'])) {\n $this->addUsingAlias(sfGuardUserPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(sfGuardUserPeer::CREATED_AT, $createdAt, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(SchoolPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(SchoolPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public function filterByCreatedat($createdat = null, $comparison = null)\n {\n if (is_array($createdat)) {\n $useMinMax = false;\n if (isset($createdat['min'])) {\n $this->addUsingAlias(UserTableMap::COL_CREATEDAT, $createdat['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdat['max'])) {\n $this->addUsingAlias(UserTableMap::COL_CREATEDAT, $createdat['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(UserTableMap::COL_CREATEDAT, $createdat, $comparison);\n }",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n\t{\n\t\tif (is_array($createdAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($createdAt['min'])) {\n\t\t\t\t$this->addUsingAlias(RepositoryPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($createdAt['max'])) {\n\t\t\t\t$this->addUsingAlias(RepositoryPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(RepositoryPeer::CREATED_AT, $createdAt, $comparison);\n\t}",
"public function createQuery($filtered = TRUE) {\n\t\t$query = parent::createQuery();\n\t\tif ($filtered === TRUE) {\n\t\t\t$startDate = new \\DateTime('last Friday');\n\t\t\t$query->matching($query->greaterThan('created', $startDate));\n\t\t\t$query->setOrderings(array(\n\t\t\t\t'created' => \\TYPO3\\Flow\\Persistence\\QueryInterface::ORDER_DESCENDING\n\t\t\t));\n\n\t\t\t$customers = $this->customerRepository->findAll()->toArray();\n\n\t\t\t$ratings = array();\n\t\t\tforeach ($query->execute() as $rating) {\n\t\t\t\tif (in_array($rating->getCustomer(), $customers)) {\n\t\t\t\t\t$identifier = $this->persistenceManager->getIdentifierByObject($rating->getCustomer());\n\t\t\t\t\t$ratings[] = $rating;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$query = new \\Famelo\\ADU\\Domain\\ArrayQuery();\n\t\t\t$query->setArray($ratings);\n\t\t\treturn $query;\n\t\t}\n\t\treturn $query;\n\t}",
"public function filterByIdUser($idUser = null, $comparison = null)\n {\n if (is_array($idUser)) {\n $useMinMax = false;\n if (isset($idUser['min'])) {\n $this->addUsingAlias(ArticleTableMap::COL_ID_USER, $idUser['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUser['max'])) {\n $this->addUsingAlias(ArticleTableMap::COL_ID_USER, $idUser['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ArticleTableMap::COL_ID_USER, $idUser, $comparison);\n }",
"public function filterByUserId($userId = null, $comparison = null)\n\t{\n\t\tif (is_array($userId)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($userId['min'])) {\n\t\t\t\t$this->addUsingAlias(RepositoryPeer::USER_ID, $userId['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($userId['max'])) {\n\t\t\t\t$this->addUsingAlias(RepositoryPeer::USER_ID, $userId['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(RepositoryPeer::USER_ID, $userId, $comparison);\n\t}",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n\t{\n\t\tif (is_array($createdAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($createdAt['min'])) {\n\t\t\t\t$this->addUsingAlias(DomainCheckPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($createdAt['max'])) {\n\t\t\t\t$this->addUsingAlias(DomainCheckPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(DomainCheckPeer::CREATED_AT, $createdAt, $comparison);\n\t}",
"static function findOnlyUsersFromUserListingTable($external_table, $field_prefix, $filter, $min_state = STATE_ARCHIVED) {\n $users_table = TABLE_PREFIX . 'users';\n $user_id_field = \"{$field_prefix}_id\";\n\n $where_part = DB::prepare(\"($users_table.id = $external_table.$user_id_field AND $users_table.state >= ?)\", $min_state);\n\n if($filter) {\n $where_part .= \" AND ($filter)\";\n } // if\n\n return Users::findBySQL(\"SELECT DISTINCT $users_table.* FROM $users_table, $external_table WHERE $where_part ORDER BY CONCAT($users_table.first_name, $users_table.last_name, $users_table.email)\");\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(ContactPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(ContactPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ContactPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n\t{\n\t\tif (is_array($createdAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($createdAt['min'])) {\n\t\t\t\t$this->addUsingAlias(UnitPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($createdAt['max'])) {\n\t\t\t\t$this->addUsingAlias(UnitPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(UnitPeer::CREATED_AT, $createdAt, $comparison);\n\t}"
] |
[
"0.6449992",
"0.58028585",
"0.5778288",
"0.5585657",
"0.5537238",
"0.5537238",
"0.55337524",
"0.545457",
"0.545457",
"0.545457",
"0.545457",
"0.545457",
"0.545457",
"0.545457",
"0.5407505",
"0.539087",
"0.53890574",
"0.5380621",
"0.5344475",
"0.534397",
"0.533473",
"0.5186886",
"0.51719123",
"0.5168241",
"0.51643723",
"0.51002455",
"0.51000977",
"0.5094204",
"0.50581586",
"0.50432307"
] |
0.6490814
|
0
|
Filter the query on the date_modified column Example usage: $query>filterByDateModified('20110314'); // WHERE date_modified = '20110314' $query>filterByDateModified('now'); // WHERE date_modified = '20110314' $query>filterByDateModified(array('max' => 'yesterday')); // WHERE date_modified > '20110313'
|
public function filterByDateModified($dateModified = null, $comparison = null)
{
if (is_array($dateModified)) {
$useMinMax = false;
if (isset($dateModified['min'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_DATE_MODIFIED, $dateModified['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dateModified['max'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_DATE_MODIFIED, $dateModified['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_DATE_MODIFIED, $dateModified, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function filterByDateModified($dateModified = null, $comparison = null)\n {\n if (is_array($dateModified)) {\n $useMinMax = false;\n if (isset($dateModified['min'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_DATE_MODIFIED, $dateModified['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($dateModified['max'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_DATE_MODIFIED, $dateModified['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_DATE_MODIFIED, $dateModified, $comparison);\n }",
"public function getDateModified();",
"public function get_date_modified();",
"public function filterByDateLastEdited($dateLastEdited = null, $comparison = null)\n {\n if (is_array($dateLastEdited)) {\n $useMinMax = false;\n if (isset($dateLastEdited['min'])) {\n $this->addUsingAlias(EgiveTableMap::COL_EGV_DATELASTEDITED, $dateLastEdited['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($dateLastEdited['max'])) {\n $this->addUsingAlias(EgiveTableMap::COL_EGV_DATELASTEDITED, $dateLastEdited['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EgiveTableMap::COL_EGV_DATELASTEDITED, $dateLastEdited, $comparison);\n }",
"public function filterByIdUserModified($idUserModified = null, $comparison = null)\n {\n if (is_array($idUserModified)) {\n $useMinMax = false;\n if (isset($idUserModified['min'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_MODIFIED, $idUserModified['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUserModified['max'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_MODIFIED, $idUserModified['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_MODIFIED, $idUserModified, $comparison);\n }",
"public function getLastModifiedAudit();",
"public function getDateModified()\n {\n return $this->dateModified;\n }",
"public function getDateModified() {\n\t\t\treturn $this->date_modified;\n\t\t}",
"public function getModifiedDate()\n\t{\n\t\treturn $this->_mdate;\n\t}",
"function setDateModified($inModified) {\n\t\tif ( $inModified !== $this->_DateModified ) {\n\t\t\t$this->_DateModified = $inModified;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function setDateModified($dateModified) {\n $this->properties['dateModified'] = $dateModified;\n\n return $this;\n }",
"public function filterByLastModified($lastModified = null, $comparison = null)\n {\n if (is_array($lastModified)) {\n $useMinMax = false;\n if (isset($lastModified['min'])) {\n $this->addUsingAlias(PhotosPeer::LAST_MODIFIED, $lastModified['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastModified['max'])) {\n $this->addUsingAlias(PhotosPeer::LAST_MODIFIED, $lastModified['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PhotosPeer::LAST_MODIFIED, $lastModified, $comparison);\n }",
"public function setDateModified($data)\n {\n $this->_DateModified=$data;\n return $this;\n }",
"public function setModifiedDate($date)\n\t{\n\t\t$this->_mdate = $date;\n\n\t\treturn $this;\n\t}",
"function getDateFilter() {\n return $this->getAdditionalProperty('date_filter', self::DATE_FILTER_ANY);\n }",
"public function getModifiedDateAttribute($value){ \n return date(\"n/d/Y g:i:s A\",strtotime($this->attributes['ModifiedDate']));\n }",
"public function getModifiedItems($sLastModifiedDate, $sShortPeriod = NULL)\n {\n $aItems = array();\n \n $query = \"select * from item \";\n if ($sShortPeriod != NULL) {\n $query .= \"where last_modified > to_timestamp('$sLastModifiedDate', 'YYYY-MM-DD HH24:MI:SS')\";\n }\n else {\n $query .= \"where last_modified > to_timestamp('$sLastModifiedDate', 'YYYY-MM-DD')\";\n }\n $result = pg_query($this->dbconn, $query); \n while ($row = pg_fetch_assoc($result)) {\n $aItems[] = $row;\n }\n \n return $aItems;\n }",
"function getDateModified() {\n\t\treturn $this->_DateModified;\n\t}",
"public function setSetModifiedDate($value)\n {\n return $this->set('SetModifiedDate', $value);\n }",
"public function getDateModified()\n {\n return $this->_DateModified;\n }",
"public function filterByIdUserModified($idUserModified = null, $comparison = null)\n {\n if (is_array($idUserModified)) {\n $useMinMax = false;\n if (isset($idUserModified['min'])) {\n $this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_MODIFIED, $idUserModified['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUserModified['max'])) {\n $this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_MODIFIED, $idUserModified['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(CiSettingsTableMap::COL_ID_USER_MODIFIED, $idUserModified, $comparison);\n }",
"public function filterByLastmodifieddate($lastmodifieddate = null, $comparison = null)\n {\n if (is_array($lastmodifieddate)) {\n $useMinMax = false;\n if (isset($lastmodifieddate['min'])) {\n $this->addUsingAlias(RefundsPeer::LASTMODIFIEDDATE, $lastmodifieddate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($lastmodifieddate['max'])) {\n $this->addUsingAlias(RefundsPeer::LASTMODIFIEDDATE, $lastmodifieddate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(RefundsPeer::LASTMODIFIEDDATE, $lastmodifieddate, $comparison);\n }",
"public function filterByModified($modified = null, $comparison = null)\n {\n if (is_array($modified)) {\n $useMinMax = false;\n if (isset($modified['min'])) {\n $this->addUsingAlias(SuitsTableMap::COL_MODIFIED, $modified['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($modified['max'])) {\n $this->addUsingAlias(SuitsTableMap::COL_MODIFIED, $modified['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SuitsTableMap::COL_MODIFIED, $modified, $comparison);\n }",
"public function setModified($modified);",
"public function getModifiedOn(): \\DateTime\n {\n return $this->modifiedOn;\n }",
"public static function _sortEventsByModificationDate($a, $b)\n\t{\n\n\t\t$adate = $a->modified();\n\t\t$bdate = $b->modified();\n\n\t\t// reverse created date\n\t\treturn -strcmp($adate, $bdate);\n\n\t}",
"public function getDateModified(): DateTime\n {\n return $this->dateModified;\n }",
"public function setModifiedOn(\\DateTime $modifiedOn): self\n {\n $this->modifiedOn = $modifiedOn;\n\n return $this;\n }",
"public function getModifiedDate() : \\DateTime {\n return $this->modifiedDate;\n }",
"public function getModificationDateColumnName() {}"
] |
[
"0.6576948",
"0.6157805",
"0.60583425",
"0.558318",
"0.5516433",
"0.55121976",
"0.5495768",
"0.5490384",
"0.54829806",
"0.5472069",
"0.5449553",
"0.5406782",
"0.5352261",
"0.5340425",
"0.53399414",
"0.5334302",
"0.53255296",
"0.53182244",
"0.53135705",
"0.5313006",
"0.5308964",
"0.5306562",
"0.52956843",
"0.5278535",
"0.5263822",
"0.52506214",
"0.5240841",
"0.51929504",
"0.5182749",
"0.5157371"
] |
0.62232065
|
1
|
Filter the query on the date_created column Example usage: $query>filterByDateCreated('20110314'); // WHERE date_created = '20110314' $query>filterByDateCreated('now'); // WHERE date_created = '20110314' $query>filterByDateCreated(array('max' => 'yesterday')); // WHERE date_created > '20110313'
|
public function filterByDateCreated($dateCreated = null, $comparison = null)
{
if (is_array($dateCreated)) {
$useMinMax = false;
if (isset($dateCreated['min'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_DATE_CREATED, $dateCreated['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dateCreated['max'])) {
$this->addUsingAlias(CiSettingsTableMap::COL_DATE_CREATED, $dateCreated['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
}
}
return $this->addUsingAlias(CiSettingsTableMap::COL_DATE_CREATED, $dateCreated, $comparison);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function filterByDateCreated($dateCreated = null, $comparison = null)\n {\n if (is_array($dateCreated)) {\n $useMinMax = false;\n if (isset($dateCreated['min'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_DATE_CREATED, $dateCreated['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($dateCreated['max'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_DATE_CREATED, $dateCreated['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_DATE_CREATED, $dateCreated, $comparison);\n }",
"public function filterByCreateDate($createDate = null, $comparison = null)\n {\n if (is_array($createDate)) {\n $useMinMax = false;\n if (isset($createDate['min'])) {\n $this->addUsingAlias(AnakPeer::CREATE_DATE, $createDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createDate['max'])) {\n $this->addUsingAlias(AnakPeer::CREATE_DATE, $createDate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(AnakPeer::CREATE_DATE, $createDate, $comparison);\n }",
"public function filterByCreateDate($createDate = null, $comparison = null)\n {\n if (is_array($createDate)) {\n $useMinMax = false;\n if (isset($createDate['min'])) {\n $this->addUsingAlias(TemplateUnPeer::CREATE_DATE, $createDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createDate['max'])) {\n $this->addUsingAlias(TemplateUnPeer::CREATE_DATE, $createDate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(TemplateUnPeer::CREATE_DATE, $createDate, $comparison);\n }",
"public function filterByCreated($created = null, $comparison = null)\n {\n if (is_array($created)) {\n $useMinMax = false;\n if (isset($created['min'])) {\n $this->addUsingAlias(PhotosPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($created['max'])) {\n $this->addUsingAlias(PhotosPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PhotosPeer::CREATED, $created, $comparison);\n }",
"public function setCreated(&$var)\n {\n GPBUtil::checkMessage($var, \\Salesorders\\V1\\ListCustomerSalesOrderRequest_DateRangeFilter::class);\n $this->created = $var;\n }",
"function getDateFilter() {\n return $this->getAdditionalProperty('date_filter', self::DATE_FILTER_ANY);\n }",
"public function filterByDateCreated(DateTime $created)\n {\n $this->where('group_date_added = :group_date_added')\n ->setParameter('group_date_added',\n $created,\n $this->getGateway()->getMetaData()->getColumn('group_date_added')->getType()\n );\n\n return $this;\n }",
"public function filterByCreateDate($createDate = null, $comparison = null)\n {\n if (is_array($createDate)) {\n $useMinMax = false;\n if (isset($createDate['min'])) {\n $this->addUsingAlias(PengawasTerdaftarPeer::CREATE_DATE, $createDate['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createDate['max'])) {\n $this->addUsingAlias(PengawasTerdaftarPeer::CREATE_DATE, $createDate['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(PengawasTerdaftarPeer::CREATE_DATE, $createDate, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::CREATED_BY, $createdBy, $comparison);\n }",
"function filter_where($where = '') {\n global $popular_days;\n //posts in the last X days\n $where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-'.$popular_days.' days')) . \"'\";\n return $where;\n}",
"function setDateFilter($value) {\n return $this->setAdditionalProperty('date_filter', $value);\n }",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n\t{\n\t\tif (is_array($createdAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($createdAt['min'])) {\n\t\t\t\t$this->addUsingAlias(RepositoryPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($createdAt['max'])) {\n\t\t\t\t$this->addUsingAlias(RepositoryPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(RepositoryPeer::CREATED_AT, $createdAt, $comparison);\n\t}",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(ClientPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(ClientPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ClientPeer::CREATED_BY, $createdBy, $comparison);\n }",
"public function addDateFilter()\n\t{\n\t\t$this->_addFilter(new DataGrid\\Filters\\DateFilter());\n\t\treturn $this->getFilter();\n\t}",
"public function createQuery($filtered = TRUE) {\n\t\t$query = parent::createQuery();\n\t\tif ($filtered === TRUE) {\n\t\t\t$startDate = new \\DateTime('last Friday');\n\t\t\t$query->matching($query->greaterThan('created', $startDate));\n\t\t\t$query->setOrderings(array(\n\t\t\t\t'created' => \\TYPO3\\Flow\\Persistence\\QueryInterface::ORDER_DESCENDING\n\t\t\t));\n\n\t\t\t$customers = $this->customerRepository->findAll()->toArray();\n\n\t\t\t$ratings = array();\n\t\t\tforeach ($query->execute() as $rating) {\n\t\t\t\tif (in_array($rating->getCustomer(), $customers)) {\n\t\t\t\t\t$identifier = $this->persistenceManager->getIdentifierByObject($rating->getCustomer());\n\t\t\t\t\t$ratings[] = $rating;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$query = new \\Famelo\\ADU\\Domain\\ArrayQuery();\n\t\t\t$query->setArray($ratings);\n\t\t\treturn $query;\n\t\t}\n\t\treturn $query;\n\t}",
"public function getDateCreated();",
"public function getCreatedDate();",
"public function Filter_createdateDyn($value, $negate) {\r\n\t\t$timeStamps = TodoyuSearchFilterHelper::getDynamicDateTimestamp($value, $negate);\r\n\r\n\t\treturn $this->Filter_dateDyn($timeStamps, 'date_create', $negate);\r\n\t}",
"public function scopeOndate($query, $variable)\n\t{\n\t\tif(!is_array($variable))\n\t\t{\n\t\t\treturn $query->where('created_at', '<=', date('Y-m-d H:i:s', strtotime($variable)))->orderBy('created_at', 'desc');\n\t\t}\n\n\t\tif(!strtotime($variable[1]) && strtotime($variable[0]))\n\t\t{\n\t\t\treturn $query->where('created_at', '<=',date('Y-m-d H:i:s', strtotime($variable[0])));\n\t\t}\n\n\t\treturn $query->where('created_at', '>=', date('Y-m-d H:i:s', strtotime($variable[0])))->where('created_at', '<=', date('Y-m-d H:i:s', strtotime($variable[1])))->orderBy('created_at', 'asc');\n\t}",
"public function filterByIdUserCreated($idUserCreated = null, $comparison = null)\n {\n if (is_array($idUserCreated)) {\n $useMinMax = false;\n if (isset($idUserCreated['min'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($idUserCreated['max'])) {\n $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(EsFilesTableMap::COL_ID_USER_CREATED, $idUserCreated, $comparison);\n }",
"public function filterByCreatedBy($createdBy = null, $comparison = null)\n {\n if (is_array($createdBy)) {\n $useMinMax = false;\n if (isset($createdBy['min'])) {\n $this->addUsingAlias(SchoolPeer::CREATED_BY, $createdBy['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdBy['max'])) {\n $this->addUsingAlias(SchoolPeer::CREATED_BY, $createdBy['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::CREATED_BY, $createdBy, $comparison);\n }",
"function getDateFilterSelectedDate() {\n $on = $this->getAdditionalProperty('date_filter_on');\n \n return $on ? new DateValue($on) : null;\n }",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n {\n if (is_array($createdAt)) {\n $useMinMax = false;\n if (isset($createdAt['min'])) {\n $this->addUsingAlias(SearchIndexPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdAt['max'])) {\n $this->addUsingAlias(SearchIndexPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SearchIndexPeer::CREATED_AT, $createdAt, $comparison);\n }",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n\t{\n\t\tif (is_array($createdAt)) {\n\t\t\t$useMinMax = false;\n\t\t\tif (isset($createdAt['min'])) {\n\t\t\t\t$this->addUsingAlias(DomainCheckPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif (isset($createdAt['max'])) {\n\t\t\t\t$this->addUsingAlias(DomainCheckPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n\t\t\t\t$useMinMax = true;\n\t\t\t}\n\t\t\tif ($useMinMax) {\n\t\t\t\treturn $this;\n\t\t\t}\n\t\t\tif (null === $comparison) {\n\t\t\t\t$comparison = Criteria::IN;\n\t\t\t}\n\t\t}\n\t\treturn $this->addUsingAlias(DomainCheckPeer::CREATED_AT, $createdAt, $comparison);\n\t}",
"function filterByDate($date) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_DATE);\n $this->setAdditionalProperty('date_filter_on', (string) $date);\n }",
"public function filterByCreated($created = null, $comparison = null)\n {\n if (is_array($created)) {\n $useMinMax = false;\n if (isset($created['min'])) {\n $this->addUsingAlias(SuitsTableMap::COL_CREATED, $created['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($created['max'])) {\n $this->addUsingAlias(SuitsTableMap::COL_CREATED, $created['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SuitsTableMap::COL_CREATED, $created, $comparison);\n }",
"public function scopeFilterByStartDate( $query )\n { \n $date = request() -> get( 'start_date' );\n if( $date )\n {\n try \n {\n $date = Carbon :: parse( $date );\n $query -> whereDate( 'created_at', '>=', $date );\n }\n catch( \\Exception $e )\n {\n // Do nothing, it's ok.\n }\n }\n }",
"public function filterByCreatedAt($createdAt = null, $comparison = null)\n {\n if (is_array($createdAt)) {\n $useMinMax = false;\n if (isset($createdAt['min'])) {\n $this->addUsingAlias(SchoolPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($createdAt['max'])) {\n $this->addUsingAlias(SchoolPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(SchoolPeer::CREATED_AT, $createdAt, $comparison);\n }",
"function filter_where( $where = '' ) {\r\n\t$where .= \" AND post_date > '\" . date('Y-m-d', strtotime('-99930 days')) . \"'\";\r\n\treturn $where;\r\n}",
"public function get_date_created();"
] |
[
"0.63125324",
"0.6077479",
"0.6043178",
"0.5747704",
"0.57189393",
"0.56708753",
"0.56634086",
"0.5662145",
"0.56265926",
"0.5582111",
"0.5576224",
"0.55495435",
"0.55363125",
"0.5486501",
"0.5473681",
"0.54712594",
"0.54635626",
"0.5436502",
"0.54315645",
"0.54181457",
"0.5416612",
"0.5415087",
"0.53593343",
"0.5346785",
"0.53341705",
"0.532846",
"0.5327287",
"0.5316058",
"0.5300445",
"0.5293048"
] |
0.60877866
|
1
|
Adds a JOIN clause to the query using the CiUsuariosRelatedByIdUserCreated relation
|
public function joinCiUsuariosRelatedByIdUserCreated($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CiUsuariosRelatedByIdUserCreated');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CiUsuariosRelatedByIdUserCreated');
}
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function useCiUsuariosRelatedByIdUserCreatedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinCiUsuariosRelatedByIdUserCreated($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'CiUsuariosRelatedByIdUserCreated', '\\CiUsuariosQuery');\n }",
"public function joinCiUsuariosRelatedByIdUserModified($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('CiUsuariosRelatedByIdUserModified');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'CiUsuariosRelatedByIdUserModified');\n }\n\n return $this;\n }",
"public function joinEsUsersRelatedByIdUserCreated($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('EsUsersRelatedByIdUserCreated');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'EsUsersRelatedByIdUserCreated');\n }\n\n return $this;\n }",
"public function addJoinUser(\\Ophp\\SqlQueryBuilder_Select $query, $onColumn) {\n\t\t$query->join('LEFT JOIN `user` ON `user`.`user_id` = ' . $onColumn)\n\t\t\t\t->select('user.name as username');\n\t\treturn $query;\n\t}",
"public function useEsUsersRelatedByIdUserCreatedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinEsUsersRelatedByIdUserCreated($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'EsUsersRelatedByIdUserCreated', '\\EsUsersQuery');\n }",
"function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }",
"public function joinsfGuardUserRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('sfGuardUserRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'sfGuardUserRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function joinsfGuardUserRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('sfGuardUserRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'sfGuardUserRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function joinUserRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('UserRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'UserRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function joinUserRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('UserRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'UserRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function useUsuariosQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinUsuarios($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'Usuarios', '\\propel\\propel\\UsuariosQuery');\n }",
"public function joinUsuarioCaja($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('UsuarioCaja');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'UsuarioCaja');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"abstract protected function appendJoins(QueryBuilder $queryBuilder);",
"public function useUserRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinUserRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'UserRelatedByCreatedBy', 'UserQuery');\n }",
"public function useUserRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinUserRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'UserRelatedByCreatedBy', 'UserQuery');\n }",
"public function joinUsuarios($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Usuarios');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Usuarios');\n }\n\n return $this;\n }",
"public function useCiUsuariosRelatedByIdUserModifiedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinCiUsuariosRelatedByIdUserModified($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'CiUsuariosRelatedByIdUserModified', '\\CiUsuariosQuery');\n }",
"public function userJoin() {\n return $this->belongsToMany('App\\Model\\User', 'trip_users');\n }",
"public function usesfGuardUserRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinsfGuardUserRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'sfGuardUserRelatedByCreatedBy', 'sfGuardUserQuery');\n }",
"public function usesfGuardUserRelatedByCreatedByQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n return $this\n ->joinsfGuardUserRelatedByCreatedBy($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'sfGuardUserRelatedByCreatedBy', 'sfGuardUserQuery');\n }",
"public function joinUsuario($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Usuario');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Usuario');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function joinUsuario($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Usuario');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Usuario');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function joinEsUsersRelatedByIdUserModified($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('EsUsersRelatedByIdUserModified');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'EsUsersRelatedByIdUserModified');\n }\n\n return $this;\n }",
"function joinQuery()\n {\n }",
"public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }",
"private function buildJoins(): void {\r\n\r\n if(count($this -> joins) > 0) {\r\n\r\n $query = [];\r\n\r\n foreach($this -> joins as $join) {\r\n\r\n $parts = [];\r\n $parts[] = sprintf('%s JOIN', strtoupper($join['type']));\r\n $parts[] = $join['table'];\r\n\r\n if(null !== $join['alias']) {\r\n $parts[] = $join['alias'];\r\n }\r\n\r\n if(null !== $join['conditions']) {\r\n $parts[] = sprintf('ON %s', $join['conditions']);\r\n }\r\n\r\n $query[] = implode(' ', $parts);\r\n }\r\n\r\n $this -> query[] = implode(' ', $query);\r\n }\r\n }",
"public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }",
"public function joinCustomers()\n {\n $this->builder->join('customers', 'cus_id', 'rc_customer');\n }",
"public function joinLeasedOutUser() {\n $sqlSelect = $this->tableGateway->getSql()->select();\n\t\t$sqlSelect\n ->columns(array('Id','requestedTime','returnedTime','userId','returnedTime','assetId'));\n $sqlSelect\n ->join('UserInfoTable', 'UserInfoTable.Id = leasedoutuserTable.userId', array('firstname','email'), 'inner');\n $sqlSelect\n ->join('AssetInfoTable', 'AssetInfoTable.AssetId = leasedoutuserTable.assetId', array('AssetName','AssetStatus','AssetDesc'), 'inner');\n $statement \n = $this->tableGateway->getSql()->prepareStatementForSqlObject($sqlSelect);\n\t\t$resultSet = $statement->execute();\n\t\treturn $resultSet;\n\n }",
"public function testBuildJoinDefaultWithTwoJoinOn()\n {\n $query = $this->getQuery()\n ->table('table1')\n ->join(\n $this->getQuery()\n ->table('table2')\n ->joinOn('id', 'id')\n ->joinOn('user_id', 'type_id')\n )\n ;\n\n $this->assertSame(\n 'LEFT JOIN table2 ON table1.id = table2.id AND table1.user_id = table2.type_id',\n $query->buildJoin()\n );\n }"
] |
[
"0.6724331",
"0.6121332",
"0.60839885",
"0.5772484",
"0.57614803",
"0.5684927",
"0.56745297",
"0.56745297",
"0.55575264",
"0.55575264",
"0.5513417",
"0.5504867",
"0.5443535",
"0.54104495",
"0.54104495",
"0.5390627",
"0.53892785",
"0.53513825",
"0.5292682",
"0.5292682",
"0.5284693",
"0.5284693",
"0.528377",
"0.5269657",
"0.52342105",
"0.5231884",
"0.52216154",
"0.521679",
"0.521642",
"0.5214081"
] |
0.6981881
|
0
|
Use the CiUsuariosRelatedByIdUserCreated relation CiUsuarios object
|
public function useCiUsuariosRelatedByIdUserCreatedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCiUsuariosRelatedByIdUserCreated($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CiUsuariosRelatedByIdUserCreated', '\CiUsuariosQuery');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getUsuario()\n {\n return $this->hasOne(User::className(), ['id' => 'createdBy'])->inverseOf('comentarios');\n }",
"public function createdbyuser() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\User');\n }",
"public function filterByCiUsuariosRelatedByIdUserCreated($ciUsuarios, $comparison = null)\n {\n if ($ciUsuarios instanceof \\CiUsuarios) {\n return $this\n ->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $ciUsuarios->getIdUsuario(), $comparison);\n } elseif ($ciUsuarios instanceof ObjectCollection) {\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n\n return $this\n ->addUsingAlias(CiSettingsTableMap::COL_ID_USER_CREATED, $ciUsuarios->toKeyValue('PrimaryKey', 'IdUsuario'), $comparison);\n } else {\n throw new PropelException('filterByCiUsuariosRelatedByIdUserCreated() only accepts arguments of type \\CiUsuarios or Collection');\n }\n }",
"public function Usuarios()\n {\n return $this->belongsToMany('App\\Models\\Users', 'users_empresas');\n }",
"public function creadaPor()\n {\n return $this->belongsTo('App\\User','created_by');\n }",
"public function creadaPor()\n {\n return $this->belongsTo('App\\User','created_by');\n }",
"public function getUsuarios()\n {\n return $this->hasMany(Usuario::className(), ['perfil_cod_fk' => 'perfil_cod_pk']);\n }",
"public function getUsuarios()\n {\n return $this->hasMany(Usuario::className(), ['modulo_cod_fk' => 'modulo_cod_pk']);\n }",
"public function usuarios(){\n return $this->hasMany('App\\Models\\User');\n }",
"public function usuarios()\n {\n \treturn $this->hasMany(reciclausers::class, 'perfilId', 'id');\n \t// nombre del modelo con el que se relaciona, llave foranea, llave de la tabla.\n }",
"public function userCreation()\n {\n return $this->belongsTo('App\\User', 'created_by_id');\n }",
"public function usuarios() \n {\n \treturn $this->belongsToMany('App\\Usuario',\n 'artistas_favoritos', \n 'artista_id', \n 'usuario_id')\n ->withPivot('fecha'); // Comprobar si se debe añadir 'id'.\n }",
"public function usuarios()\n {\n return $this->belongsTo('App\\Usuario');\n }",
"public function usuarios()\n {\n return $this->hasMany('App\\Usuario', 'empresa_id', 'id');\n }",
"public function buscarUsuarios(){\n\t\t}",
"public function usuarios(){\n \treturn $this->hasMany(PerfilUsuario::class, 'id_perfil', 'id_perfil')->where('bo_activo', true)->where('bo_estado', 1);//->orderBy('email');\n }",
"public function user(){\n return $this->hasMany('App\\User');//un rol puede pertenecer a varios usuarios\n }",
"public function getUserCreated()\n {\n return $this->hasOne(User::class, ['id' => 'created_by']);\n }",
"public function agregarUsuario(){\n \n }",
"public function createdBy() {\r\n return $this->belongsTo('User', 'created_by_id');\r\n }",
"public function usuarios(){\n return $this->belongsToMany('App\\Usuarios','perfiles_usuarios','perfil_fk_pu', 'usuario_fk_pu');\n }",
"public function joinCiUsuariosRelatedByIdUserCreated($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('CiUsuariosRelatedByIdUserCreated');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'CiUsuariosRelatedByIdUserCreated');\n }\n\n return $this;\n }",
"function abmUsuarios()\n {\n $this->checkCredentials();\n $users = $this->modelUser->getAllUsers();\n $this->view->showAbmUsuarios($users);\n }",
"public function users()\r\n {\r\n return $this->belongsToMany(config('bootstrap-menu.models.user'), config('bootstrap-menu.relations.permission_user'))->withTimestamps();\r\n }",
"public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }",
"public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }",
"public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }",
"public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }",
"public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }",
"public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }"
] |
[
"0.6234588",
"0.6019955",
"0.59916526",
"0.59731495",
"0.58160204",
"0.5813709",
"0.58084846",
"0.5790911",
"0.5748267",
"0.57277983",
"0.57124907",
"0.57097965",
"0.5683381",
"0.5633634",
"0.56078935",
"0.5591406",
"0.5540929",
"0.5540869",
"0.5539503",
"0.5530947",
"0.55204296",
"0.55125034",
"0.54925895",
"0.54867",
"0.54693437",
"0.54693437",
"0.54693437",
"0.54693437",
"0.54693437",
"0.54693437"
] |
0.64074117
|
0
|
Adds a JOIN clause to the query using the CiUsuariosRelatedByIdUserModified relation
|
public function joinCiUsuariosRelatedByIdUserModified($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('CiUsuariosRelatedByIdUserModified');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'CiUsuariosRelatedByIdUserModified');
}
return $this;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function useCiUsuariosRelatedByIdUserModifiedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinCiUsuariosRelatedByIdUserModified($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'CiUsuariosRelatedByIdUserModified', '\\CiUsuariosQuery');\n }",
"public function joinEsUsersRelatedByIdUserModified($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('EsUsersRelatedByIdUserModified');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'EsUsersRelatedByIdUserModified');\n }\n\n return $this;\n }",
"public function joinCiUsuariosRelatedByIdUserCreated($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('CiUsuariosRelatedByIdUserCreated');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'CiUsuariosRelatedByIdUserCreated');\n }\n\n return $this;\n }",
"public function useEsUsersRelatedByIdUserModifiedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinEsUsersRelatedByIdUserModified($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'EsUsersRelatedByIdUserModified', '\\EsUsersQuery');\n }",
"abstract protected function appendJoins(QueryBuilder $queryBuilder);",
"function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }",
"public function useUsuariosQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinUsuarios($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'Usuarios', '\\propel\\propel\\UsuariosQuery');\n }",
"public function joinUsuarios($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('Usuarios');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'Usuarios');\n }\n\n return $this;\n }",
"public function joinsfGuardUserRelatedByUpdatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('sfGuardUserRelatedByUpdatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'sfGuardUserRelatedByUpdatedBy');\n }\n\n return $this;\n }",
"public function joinsfGuardUserRelatedByUpdatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('sfGuardUserRelatedByUpdatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'sfGuardUserRelatedByUpdatedBy');\n }\n\n return $this;\n }",
"public function joinUsuarioCaja($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('UsuarioCaja');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'UsuarioCaja');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function joinUserRelatedByUpdatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('UserRelatedByUpdatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'UserRelatedByUpdatedBy');\n }\n\n return $this;\n }",
"public function joinUserRelatedByUpdatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('UserRelatedByUpdatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'UserRelatedByUpdatedBy');\n }\n\n return $this;\n }",
"function MWX__join ($join)\n{\n global $wpdb;\n\n if (current_user_can ('edit_users'))\n return $join;\n\n return $join .= \" LEFT JOIN $wpdb->postmeta ON $wpdb->posts.ID = $wpdb->postmeta.post_id AND $wpdb->postmeta.meta_key = 'maturity'\";\n}",
"public function getProfileJoinCriteria() {\n return [\n 'INNER JOIN' => [\n Profile_User::getTable() => [\n 'ON' => [\n Profile_User::getTable() => 'users_id',\n User::getTable() => 'id'\n ]\n ]\n ],\n 'WHERE' => getEntitiesRestrictCriteria(\n Profile_User::getTable(),\n 'entities_id',\n $this->getEntity(),\n true\n )\n ];\n }",
"public function useCiUsuariosRelatedByIdUserCreatedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n return $this\n ->joinCiUsuariosRelatedByIdUserCreated($relationAlias, $joinType)\n ->useQuery($relationAlias ? $relationAlias : 'CiUsuariosRelatedByIdUserCreated', '\\CiUsuariosQuery');\n }",
"public function joinsfGuardUserRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('sfGuardUserRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'sfGuardUserRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function joinsfGuardUserRelatedByCreatedBy($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('sfGuardUserRelatedByCreatedBy');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'sfGuardUserRelatedByCreatedBy');\n }\n\n return $this;\n }",
"public function addJoin(Builder $queryBuilder) : void\n {\n $queryBuilder->join(\n $this->_relatedTable . ' AS ' . $this->name,\n $this->_baseTable . '.' . $this->_baseKey,\n '=',\n $this->name . '.' . $this->_foreignKey\n );\n }",
"public function joinEsUsersRelatedByIdUserCreated($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('EsUsersRelatedByIdUserCreated');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'EsUsersRelatedByIdUserCreated');\n }\n\n return $this;\n }",
"public function addJoinUser(\\Ophp\\SqlQueryBuilder_Select $query, $onColumn) {\n\t\t$query->join('LEFT JOIN `user` ON `user`.`user_id` = ' . $onColumn)\n\t\t\t\t->select('user.name as username');\n\t\treturn $query;\n\t}",
"function joinQuery()\n {\n }",
"public function getRelatedUserQuery($model, $relations, $user = null, $baseConditions = [], $baseParams = [], $primaryKey = null)\n {\n if ($user === null) {\n $user = \\Yii::$app->user->identity;\n }\n\n $query = new Query;\n\n if ($user === null) {\n return $query->andWhere('1=0');\n }\n\n if ($primaryKey === null) {\n $pkExpression = $this->quoteColumn('t', $model::primaryKey(), $model->getDb()->getSchema());\n if (count($model::primaryKey()) > 1) {\n $pkExpression = \"ROW($pkExpression)\";\n }\n } elseif (!is_array($primaryKey)) {\n $pkExpression = ':relationAuthorizer_pk';\n $query->params[':relationAuthorizer_pk'] = $primaryKey;\n } else {\n if (($key = key($primaryKey)) !== null && !is_numeric($key)) {\n // sort primaryKey by $model::primaryKey()\n $keys = array_flip($model::primaryKey());\n uksort(\n $primaryKey,\n function ($a, $b) use ($keys) {\n return $keys[$a] - $keys[$b];\n }\n );\n }\n $pkExpression = [];\n foreach (array_values($primaryKey) as $index => $pk) {\n $pkExpression[] = ':relationAuthorizer_pk'.$index;\n $query->params[':relationAuthorizer_pk'.$index] = $pk;\n }\n $pkExpression = 'ROW('.implode(',', $pkExpression).')';\n }\n\n /** @var ActiveQuery[] $relationQueries */\n $relationQueries = $this->getCompositeRelatedUserQuery($model, $relations, $user, $baseConditions, $baseParams);\n $conditions = ['OR'];\n foreach ($relationQueries as $relationQuery) {\n if (empty($relationQuery->where)\n || (!empty($baseConditions) && $relationQuery->where === $baseConditions)\n ) {\n continue;\n }\n $relationQuery->select($this->quoteColumn('t', $model::primaryKey(), $model->getDb()->getSchema()));\n $command = $relationQuery->createCommand($model->getDb());\n $conditions[] = $pkExpression.' IN ('.$command->getSql().')';\n $query->params = array_merge($query->params, $relationQuery->params);\n }\n if ($conditions !== ['OR']) {\n $query->where = $conditions;\n }\n return $query;\n }",
"public function joinUsuario($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Usuario');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Usuario');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function joinUsuario($relationAlias = null, $joinType = Criteria::LEFT_JOIN)\n\t{\n\t\t$tableMap = $this->getTableMap();\n\t\t$relationMap = $tableMap->getRelation('Usuario');\n\t\t\n\t\t// create a ModelJoin object for this join\n\t\t$join = new ModelJoin();\n\t\t$join->setJoinType($joinType);\n\t\t$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n\t\tif ($previousJoin = $this->getPreviousJoin()) {\n\t\t\t$join->setPreviousJoin($previousJoin);\n\t\t}\n\t\t\n\t\t// add the ModelJoin to the current object\n\t\tif($relationAlias) {\n\t\t\t$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n\t\t\t$this->addJoinObject($join, $relationAlias);\n\t\t} else {\n\t\t\t$this->addJoinObject($join, 'Usuario');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"public function joinUsuarioRelatedByUsuarioReq($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('UsuarioRelatedByUsuarioReq');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'UsuarioRelatedByUsuarioReq');\n }\n\n return $this;\n }",
"public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }",
"function editor_joins(){\n //\n //begin with an empty collection of joins \n $joins=[];\n //\n //Push the editor joins also\n foreach ($this->editor_joins as $join){\n array_push($joins, $join);\n }\n //\n //Set the new joins \n $this->joins=new joins($joins);\n }",
"function setExtraJoins($extraJoins) {\n $this->extraJoins = $extraJoins;\n }",
"public function joinJaUsuarios($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('JaUsuarios');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'JaUsuarios');\n }\n\n return $this;\n }"
] |
[
"0.68452066",
"0.6297498",
"0.6026903",
"0.59044105",
"0.56763065",
"0.5539021",
"0.55011815",
"0.5377758",
"0.5345634",
"0.5345634",
"0.5304695",
"0.5247324",
"0.5247324",
"0.52466124",
"0.5204363",
"0.5202009",
"0.51477474",
"0.51477474",
"0.510277",
"0.5097945",
"0.50921637",
"0.50844544",
"0.50817937",
"0.50694305",
"0.50694305",
"0.50677556",
"0.50512415",
"0.50447243",
"0.5023955",
"0.50131786"
] |
0.7148464
|
0
|
Use the CiUsuariosRelatedByIdUserModified relation CiUsuarios object
|
public function useCiUsuariosRelatedByIdUserModifiedQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
{
return $this
->joinCiUsuariosRelatedByIdUserModified($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'CiUsuariosRelatedByIdUserModified', '\CiUsuariosQuery');
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function filterByCiUsuariosRelatedByIdUserModified($ciUsuarios, $comparison = null)\n {\n if ($ciUsuarios instanceof \\CiUsuarios) {\n return $this\n ->addUsingAlias(CiSettingsTableMap::COL_ID_USER_MODIFIED, $ciUsuarios->getIdUsuario(), $comparison);\n } elseif ($ciUsuarios instanceof ObjectCollection) {\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n\n return $this\n ->addUsingAlias(CiSettingsTableMap::COL_ID_USER_MODIFIED, $ciUsuarios->toKeyValue('PrimaryKey', 'IdUsuario'), $comparison);\n } else {\n throw new PropelException('filterByCiUsuariosRelatedByIdUserModified() only accepts arguments of type \\CiUsuarios or Collection');\n }\n }",
"function actualizarUsuarios($id,$nombre,$apellido,$user,$pass,$rol){\n\t\t$activo = true;\n\t\t$query = \"UPDATE usuarios set nombre = '$nombre', apellido = '$apellido', user = '$user', pass='$pass', rol='$rol' where idUsuario=$id AND activo = $activo\";\n\t\t$link = conectar(); //llama a la funcion conectar de conex.php\n\t\t$result = $link->query($query); //envia el query a la BD\t\t\n\t\t$link->close();\n\t\techo json_encode($result);\n\t}",
"public function updatedUsuario()\n {\n // Notificamos al otro componente el cambio\n $this->emit('cambioUsuario', $this->usuario);\n }",
"public function atualizarUsuarios($idusuario, $nome, $email, $senha, $senha_confirma, $telefone, $dtnascimento, $habilitado, $idpermissao){\n //$conexao = $c->conexao();\n\n $sql = \"SELECT count(*) as total from tbusuarios WHERE email = '$email' \";\n $sql = $this->conexao->query($sql);\n $row = $sql->fetch_assoc();\n \n if($senha != $senha_confirma){\n return 2;\n }elseif ($senha == '' || $senha == null && $senha_confirma == '' || $senha_confirma == null ) {\n $sql = \"UPDATE tbusuarios SET nome = '$nome', email='$email', dt_nascimento='$dtnascimento', telefone='$telefone', data_modificado = NOW(), habilitado='$habilitado', idpermissao='$idpermissao' WHERE idusuario = '$idusuario' \";\n echo $this->conexao->query($sql);\n }else{\n $sql = \"UPDATE tbusuarios SET nome = '$nome', email='$email', senha='$senha', senha_confirma='$senha_confirma' dt_nascimento='$dtnascimento', telefone='$telefone', data_modificado = NOW(), habilitado='$habilitado', idpermissao='$idpermissao' WHERE idusuario = '$idusuario' \";\n\n echo $this->conexao->query($sql);\n }\n }",
"public function updatePrivilegios(Request $request){\n if(!$request->ajax() || Auth::user()->rol_id == 11)return redirect('/');\n $user = User::findOrFail($request->id);\n $user->administracion = $request->administracion;\n $user->desarrollo = $request->desarrollo;\n $user->precios = $request->precios;\n $user->obra = $request->obra;\n $user->ventas = $request->ventas;\n $user->acceso = $request->acceso;\n $user->reportes = $request->reportes;\n $user->saldo = $request->saldo;\n $user->gestoria = $request->gestoria;\n $user->postventa = $request->postventa;\n $user->comisiones = $request->comisiones;\n $user->calendario = $request->calendario;\n $user->notifications = $request->notifications;\n //Administracion\n $user->departamentos = $request->departamentos;\n $user->personas = $request->personas;\n $user->empresas = $request->empresas;\n $user->medios_public = $request->medios_public;\n $user->lugares_contacto = $request->lugares_contacto;\n $user->servicios = $request->servicios;\n $user->inst_financiamiento = $request->inst_financiamiento;\n $user->tipos_credito = $request->tipos_credito;\n $user->asig_servicios = $request->asig_servicios;\n $user->mis_asesores = $request->mis_asesores;\n $user->cuenta = $request->cuenta;\n $user->proveedores = $request->proveedores;\n $user->digital_campain = $request->digital_campain;\n $user->notaria =$request->notaria;\n //Desarrollo\n $user->fraccionamiento = $request->fraccionamiento;\n $user->etapas = $request->etapas;\n $user->modelos = $request->modelos;\n $user->lotes = $request->lotes;\n $user->asign_modelos = $request->asign_modelos;\n $user->licencias = $request->licencias;\n $user->acta_terminacion = $request->acta_terminacion;\n $user->p_etapa = $request->p_etapa;\n $user->descarga_actas = $request->descarga_actas;\n $user->ruv = $request->ruv;\n $user->seg_ruv = $request->seg_ruv;\n\n //Pago interno\n $user->seg_pago = $request->seg_pago;\n\n //Precios\n $user->agregar_sobreprecios=$request->agregar_sobreprecios;\n $user->precios_etapas = $request->precios_etapas;\n $user->precios_viviendas = $request->precios_viviendas;\n $user->sobreprecios = $request->sobreprecios;\n $user->paquetes = $request->paquetes;\n $user->promociones = $request->promociones;\n //Obra\n $user->contratistas = $request->contratistas;\n $user->ini_obra = $request->ini_obra;\n $user->aviso_obra = $request->aviso_obra;\n $user->partidas = $request->partidas;\n $user->avance = $request->avance;\n $user->estimaciones = $request->estimaciones;\n //Calculadora de lotes\n $user->calc_lotes = $request->calc_lotes;\n $user->edit_cotizacion = $request->edit_cotizacion;\n $user->opc_cotizador = $request->opc_cotizador;\n //Creditos Puente\n $user->bases = $request->bases;\n $user->solic_credito_puente = $request->solic_credito_puente;\n $user->seg_cp = $request->seg_cp;\n $user->edo_cta_bancrea = $request->edo_cta_bancrea;\n //Ventas\n $user->lotes_disp = $request->lotes_disp;\n $user->mis_prospectos = $request->mis_prospectos;\n $user->simulacion_credito = $request->simulacion_credito;\n $user->hist_simulaciones = $request->hist_simulaciones;\n $user->hist_creditos = $request->hist_creditos;\n $user->contratos = $request->contratos;\n $user->docs = $request->docs;\n $user->equipamientos = $request->equipamientos;\n $user->digital_lead = $request->digital_lead;\n $user->reubicaciones = $request->reubicaciones;\n //Rentas\n $user->admin_rentas = $request->admin_rentas;\n $user->pagos_rentas = $request->pagos_rentas;\n //Saldos\n $user->edo_cuenta = $request->edo_cuenta;\n $user->depositos = $request->depositos;\n $user->gastos_admn = $request->gastos_admn;\n $user->cobro_credito = $request->cobro_credito;\n $user->dev_exc = $request->dev_exc;\n $user->dev_cancel = $request->dev_cancel;\n $user->facturas = $request->facturas;\n $user->ingresos_concretania = $request->ingresos_concretania;\n $user->dev_virtual = $request->dev_virtual;\n //Gestoria\n $user->expediente = $request->expediente;\n $user->asig_gestor = $request->asig_gestor;\n $user->seg_tramite = $request->seg_tramite;\n $user->avaluos = $request->avaluos;\n $user->bonos_rec = $request->bonos_rec;\n $user->int_cobros = $request->int_cobros;\n //Postventa\n $user->entregas = $request->entregas;\n $user->solic_detalles = $request->solic_detalles;\n //RH\n $user->vehiculos = $request->vehiculos;\n $user->mant_vehiculos = $request->mant_vehiculos;\n $user->admin_mant_vehiculos = $request->admin_mant_vehiculos;\n $user->prestamos_personales = $request->prestamos_personales;\n $user->fondo_ahorro = $request->fondo_ahorro;\n $user->fondo_pension = $request->fondo_pension;\n //Oficina\n $user->inventarios = $request->inventarios;\n $user->prov_inventarios = $request->prov_inventarios;\n\n //Comisiones\n $user->exp_comision = $request->exp_comision;\n $user->gen_comision = $request->gen_comision;\n $user->bono_com = $request->bono_com;\n //Acceso\n $user->usuarios = $request->usuarios;\n $user->roles = $request->roles;\n //Reportes\n $user->mejora = $request->mejora;\n $user->rep_publi = $request->rep_publi;\n $user->rep_proy = $request->rep_proy;\n $user->inventario = $request->inventario;\n $user->rep_venta_canc = $request->rep_venta_canc;\n $user->rep_asesores = $request->rep_asesores;\n $user->rep_ini_term_ventas = $request->rep_ini_term_ventas;\n $user->rep_recursos_propios = $request->rep_recursos_propios;\n $user->rep_vent_modelos = $request->rep_vent_modelos;\n $user->rep_detalles_post = $request->rep_detalles_post;\n $user->rep_acumulado = $request->rep_acumulado;\n $user->rep_ingresos = $request->rep_ingresos;\n $user->rep_escrituras = $request->rep_escrituras;\n $user->rep_leads = $request->rep_leads;\n $user->rep_entregas = $request->rep_entregas;\n $user->rep_empresas = $request->rep_empresas;\n $user->save();\n\n }",
"public function update(Usuarios $usuarios) {\n\n \n try {\n $sql = sprintf(\"update usuarios set contraseña = %s, \n fecha_registro = %s, \n fecha_actualizacion = %s, \n personas_idpersonas = %s, \n \n where idusuario = %s\",\n $this->labAdodb->Param(\"contraseña\"),\n $this->labAdodb->Param(\"fecha_registro\"),\n $this->labAdodb->Param(\"fecha_actualizacion\"),\n $this->labAdodb->Param(\"personas_idpersonas\"),\n $this->labAdodb->Param(\"idusuarios\"));\n $sqlParam = $this->labAdodb->Prepare($sql);\n\n $valores = array();\n\n $valores[\"contraseña\"] = $usuarios->getcontraseña();\n $valores[\"fecha_registro\"] = $usuarios->getfecha_registro();\n $valores[\"fecha_actualizacion\"] = $usuarios->getfecha_actualizacion();\n $valores[\"personas_idpersonas\"] = $usuarios->getpersonas_idpersonas(); \n $valores[\"idusuarios\"] = $usuarios->getidusuarios();\n $this->labAdodb->Execute($sqlParam, $valores) or die($this->labAdodb->ErrorMsg());\n } catch (Exception $e) {\n throw new Exception('No se pudo actualizar el registro (Error generado en el metodo update de la clase UsuariosDao), error:'.$e->getMessage());\n }\n }",
"function updateUsuario_rol($Actualizacion,$id_usuario,$id_rol)\n\t{\n\t\t if(is_numeric($id_usuario) && is_numeric($id_rol)&&isset($Actualizacion))\n\t\t {\n\t\t\t $updateIDUser=$Actualizacion['id_usuario'];\n\t \t\t $updateIDrol=$Actualizacion['id_rol'];\n\n\t\t\t$sql = \"UPDATE usuario_rol SET id_usuario=$updateIDUser,id_rol =$updateIDrol\n\t\t\t\t\t\t\t\t\t\t\tWHERE id_usuario=$id_usuario and id_rol=$id_rol\";\n\n\t\t\t$statement=$this->conDB->Prepare($sql);\n\t\t\t$statement->Execute();\n\t\t}\n\n\t}",
"public function do_update($dados=NULL, $condicao=NULL, $redir=TRUE) {\n\t\t\n\t\tif ($dados != NULL && is_array($condicao)):\n\t\t\t//$usuario = $this->Usuarios->get_byid($condicao['id'])->row()->login;\n\t\t\t$this->db->update('usuarios', $dados, $condicao);\n\t\t\tif ($this->db->affected_rows()>0):\n\t\t\t\tauditoria('Alteração de usuários', 'Alterado cadastro do usuário');\n\t\t\t\tset_msg('msgok', 'Alteração efetuada com sucesso', 'sucesso');\n\t\t\telse:\n\t\t\t\tset_msg('msgerro', 'Erro ao atualizar dados', 'erro');\n\t\t\tendif;\n\t\t\tif ($redir) redirect(current_url());\n\t\tendif;\n\t}",
"public function actionUpdate($id)\n {\n //array para almacenar los usuarios que ya habian sido seleccionados\n $precarga=\"\";\n // instancia a los modelos\n $model = $this->findModel($id);\n $modelAC=AccionCentralizada::findOne($model->accAccionEspecifica->idAcCentr->id);\n $usuariomodel = new UserAccounts();\n //listas precargadas\n $listaaccion_centralizada = AccionCentralizada::find(['estatus' => 1])->all();\n $listaaccion_especifica = AcAcEspec::find()->where(['id_ac_centr' => $modelAC->id, 'estatus' => 1])->all();\n $ue = UnidadEjecutora::find(['estatus' => 1])\n ->select([\"unidad_ejecutora.id as id\", \"unidad_ejecutora.nombre as name\"])\n ->innerjoin('accion_centralizada_ac_especifica_uej', 'unidad_ejecutora.id=accion_centralizada_ac_especifica_uej.id_ue')\n ->where(['accion_centralizada_ac_especifica_uej.id_ac_esp' => $model->acc_accion_especifica])\n ->asArray()\n ->all();\n \n //lista de usuarios dependera de la unidad ejecutora\n $listausuarios = AcEspUej::find()\n ->select([\"user_accounts.id\", \"user_accounts.username as username\"])\n ->innerjoin('accion_centralizada_asignar', 'accion_centralizada_asignar.accion_especifica_ue=accion_centralizada_ac_especifica_uej.id')\n ->innerjoin('user_accounts', 'user_accounts.id=accion_centralizada_asignar.usuario')\n ->where(['accion_centralizada_ac_especifica_uej.id_ue' => $model->unidad_ejecutora, 'accion_centralizada_ac_especifica_uej.id_ac_esp' => $model->acc_accion_especifica])\n ->asArray()\n ->all();\n\n //buscar los usuarios ya seleccionados y agregarlos al modelo\n $usuarios=$model->UsuariosVariablesId;\n foreach ($usuarios as $key)\n {\n $precarga[]=$key['id_usuario'];\n }\n //print_r($model->UsuariosVariablesId); exit();\n //agregarlos al modelo de usuario\n $usuariomodel->id=$precarga;\n //agregar lugares\n $lugares= Ambito::find()->asarray()->all();\n \n if ($model->load(Yii::$app->request->post()))\n {\n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n if($model->save())\n {\n //si guarda procedemos a guardar los usuarios seleccionados con el metodo uejecutoras\n $usuarios=Yii::$app->request->post('UserAccounts');\n if(!empty($usuarios['id']))\n {\n foreach ($usuarios as $key => $value) \n {\n if(!$salvar=$model->uejecutoras($value))\n {\n \n $transaction->rollback();\n return $this->render('update', \n [\n 'model' => $model,\n 'listausuarios' => $listausuarios,\n 'usuariomodel' => $usuariomodel,\n 'listaaccion_centralizada' => $listaaccion_centralizada,\n 'modelAC' => $modelAC,\n 'listaaccion_especifica' => $listaaccion_especifica,\n 'lugares' => $lugares,\n 'ue' => $ue,\n ]);\n }\n }\n $transaction->commit();\n return $this->redirect(['accion-centralizada-variables/view', 'id' => $model->id]);\n }\n else\n {\n $transaction->rollback();\n return $this->render('update', \n [\n 'model' => $model,\n 'listausuarios' => $listausuarios,\n 'usuariomodel' => $usuariomodel,\n 'listaaccion_centralizada' => $listaaccion_centralizada,\n 'modelAC' => $modelAC,\n 'listaaccion_especifica' => $listaaccion_especifica,\n 'lugares' => $lugares,\n 'ue' => $ue,\n ]);\n }\n }\n else\n {\n return $this->render('update', \n [\n 'model' => $model,\n 'listausuarios' => $listausuarios,\n 'usuariomodel' => $usuariomodel,\n 'listaaccion_centralizada' => $listaaccion_centralizada,\n 'modelAC' => $modelAC,\n 'listaaccion_especifica' => $listaaccion_especifica,\n 'lugares' => $lugares,\n 'ue' => $ue,\n ]);\n\n }\n }\n else\n {\n return $this->render('update', \n [\n 'model' => $model,\n 'listausuarios' => $listausuarios,\n 'usuariomodel' => $usuariomodel,\n 'listaaccion_centralizada' => $listaaccion_centralizada,\n 'modelAC' => $modelAC,\n 'listaaccion_especifica' => $listaaccion_especifica,\n 'lugares' => $lugares,\n 'ue' => $ue,\n ]);\n }\n }",
"public function automaticModifiedBy()\n\t{\n\t\treturn User::get('id');\n\t}",
"public function editarUsuario(){\r\n $sql = \"UPDATE usuarios SET Usuario = '{$this->usuario}',\r\n NombreCompleto = '{$this->nombreCompleto}',\r\n Correo = '{$this->correo}',\r\n IdRol = '{$this->idRol}'\r\n WHERE IdUsuario = '{$this->idUsuario}'\";\r\n $res = $this->conexion->setQuery($sql);\r\n return $res;\r\n}",
"public function editarUsuario($dadosNovos){\n\t\t\t\n\t\t\t$this->load->database();\n\t\t\t\n\t\t\t//print_r($dadosNovos);\n\t\t\t\n\t\t\t$this->db->where('id_user', $dadosNovos['id_user']);\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\tif( ! $this->db->update('user', $dadosNovos))\n\t\t\t\t{\n\t\t\t\t\treturn \"erro\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn \"sucesso\";\n\t\t\t\t}\n\t\t\t\n\t\t}",
"public function joinCiUsuariosRelatedByIdUserModified($relationAlias = null, $joinType = Criteria::INNER_JOIN)\n {\n $tableMap = $this->getTableMap();\n $relationMap = $tableMap->getRelation('CiUsuariosRelatedByIdUserModified');\n\n // create a ModelJoin object for this join\n $join = new ModelJoin();\n $join->setJoinType($joinType);\n $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);\n if ($previousJoin = $this->getPreviousJoin()) {\n $join->setPreviousJoin($previousJoin);\n }\n\n // add the ModelJoin to the current object\n if ($relationAlias) {\n $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());\n $this->addJoinObject($join, $relationAlias);\n } else {\n $this->addJoinObject($join, 'CiUsuariosRelatedByIdUserModified');\n }\n\n return $this;\n }",
"public function editar_usuario($id_usuario, $nombre, $apellido, $cedula, $telefono, $email, $direccion, $cargo, $usuario, $password1, $password2, $estado, $permisos)\n {\n\n $conectar = parent::conexion();\n parent::set_names();\n require_once(\"Usuarios.php\");\n $usuarios = new Usuarios();\n //verifica si el id_usuario tiene registro asociado a compras\n $usuario_compras = $usuarios->get_usuario_por_id_compras($_POST[\"id_usuario\"]);\n //verifica si el id_usuario tiene registro asociado a ventas\n $usuario_ventas = $usuarios->get_usuario_por_id_ventas($_POST[\"id_usuario\"]);\n //si el id_usuario NO tiene registros asociados en las tablas compras y ventas entonces se puede editar todos los campos de la tabla usuarios\n if (is_array($usuario_compras) == true and count($usuario_compras) == 0 and is_array($usuario_ventas) == true and count($usuario_ventas) == 0) {\n $sql = \"update usuarios set \n nombres=?,\n apellidos=?,\n cedula=?,\n telefono=?,\n correo=?,\n direccion=?,\n cargo=?,\n usuario=?,\n password=?,\n password2=?,\n estado=?\n where \n id_usuario=?\n \";\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $_POST[\"nombre\"]);\n $sql->bindValue(2, $_POST[\"apellido\"]);\n $sql->bindValue(3, $_POST[\"cedula\"]);\n $sql->bindValue(4, $_POST[\"telefono\"]);\n $sql->bindValue(5, $_POST[\"email\"]);\n $sql->bindValue(6, $_POST[\"direccion\"]);\n $sql->bindValue(7, $_POST[\"cargo\"]);\n $sql->bindValue(8, $_POST[\"usuario\"]);\n $sql->bindValue(9, $_POST[\"password1\"]);\n $sql->bindValue(10, $_POST[\"password2\"]);\n $sql->bindValue(11, $_POST[\"estado\"]);\n $sql->bindValue(12, $_POST[\"id_usuario\"]);\n $sql->execute();\n //SE ELIMINAN LOS PERMISOS SOLO CUANDO SE ENVIE EL FORMULARIO CON SUBMIT\n //Eliminamos todos los permisos asignados para volverlos a registrar\n $sql_delete = \"delete from usuario_permiso where id_usuario=?\";\n $sql_delete = $conectar->prepare($sql_delete);\n $sql_delete->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_delete->execute();\n //$resultado=$sql_delete->fetchAll();\n //insertamos los permisos\n //almacena todos los checkbox que han sido marcados\n //este es un array tiene un name=permiso[]\n $permisos = $_POST[\"permiso\"];\n // print_r($_POST);\n $num_elementos = 0;\n while ($num_elementos < count($permisos)) {\n $sql_detalle = \"insert into usuario_permiso\n values(null,?,?)\";\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_detalle->bindValue(2, $permisos[$num_elementos]);\n $sql_detalle->execute();\n //recorremos los permisos con este contador\n $num_elementos = $num_elementos + 1;\n }\n } else {\n //si el usuario tiene registros asociados en compras y ventas entonces no se edita el nombre, apellido y cedula\n $sql = \"update usuarios set \n telefono=?,\n correo=?,\n direccion=?,\n cargo=?,\n usuario=?,\n password=?,\n password2=?,\n estado=?\n where \n id_usuario=?\n \";\n //echo $sql; exit();\n $sql = $conectar->prepare($sql);\n $sql->bindValue(1, $_POST[\"telefono\"]);\n $sql->bindValue(2, $_POST[\"email\"]);\n $sql->bindValue(3, $_POST[\"direccion\"]);\n $sql->bindValue(4, $_POST[\"cargo\"]);\n $sql->bindValue(5, $_POST[\"usuario\"]);\n $sql->bindValue(6, $_POST[\"password1\"]);\n $sql->bindValue(7, $_POST[\"password2\"]);\n $sql->bindValue(8, $_POST[\"estado\"]);\n $sql->bindValue(9, $_POST[\"id_usuario\"]);\n $sql->execute();\n //SE ELIMINAN LOS PERMISOS SOLO CUANDO SE ENVIE EL FORMULARIO CON SUBMIT\n //Eliminamos todos los permisos asignados para volverlos a registrar\n $sql_delete = \"delete from usuario_permiso where id_usuario=?\";\n $sql_delete = $conectar->prepare($sql_delete);\n $sql_delete->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_delete->execute();\n //$resultado=$sql_delete->fetchAll();\n //insertamos los permisos\n //almacena todos los checkbox que han sido marcados\n //este es un array tiene un name=permiso[]\n if (isset($_POST[\"permiso\"])) {\n $permisos = $_POST[\"permiso\"];\n }\n //print_r($_POST);\n $num_elementos = 0;\n\n while ($num_elementos < count($permisos)) {\n\n $sql_detalle = \"insert into usuario_permiso\n values(null,?,?)\";\n\n $sql_detalle = $conectar->prepare($sql_detalle);\n $sql_detalle->bindValue(1, $_POST[\"id_usuario\"]);\n $sql_detalle->bindValue(2, $permisos[$num_elementos]);\n $sql_detalle->execute();\n\n\n //recorremos los permisos con este contador\n $num_elementos = $num_elementos + 1;\n } //fin while\n\n\n } // fin else\n\n\n }",
"function editUsersManagement($id_users, $pseudo, $lastname, $firstname, $email, $roleusers){\n $managementUsersEdition = new \\Project\\Models\\ManagementUserManager();\n $managementEditionUsers = $managementUsersEdition->usersManagementEdition($id_users, $pseudo, $lastname, $firstname, $email, $roleusers); \n\n header(\"Location: administration.php?action=managementUsers&id=$id_users\");\n \n }",
"public function edit(Usuarios $usuarios) {\n//\n }",
"function actualizarUsuarios($id,$nivel)\n {\n $this->my->query(\"UPDATE usuarios set nivel = $nivel\n WHERE id = $id \")or\n die(\"Problemas al actualizar Usuarios.\".$this->my->error);\n }",
"public function getUsuarios()\n {\n return $this->hasMany(Usuario::className(), ['modulo_cod_fk' => 'modulo_cod_pk']);\n }",
"public function actualizar(){\r\n\t\t\t$user_table = Config::get()->db_user_table;\r\n\t\t\t$consulta = \"UPDATE $user_table\r\n\t\t\t\t\t\t\t SET \tid='$this->id',\r\n\t\t\t\t\t\t\t \t\tdni='$this->dni',\r\n\t\t\t\t\t\t\t \t\tnom='$this->nom', \r\n\t\t\t\t\t\t\t \t\tcognom1='$this->cognom1', \r\n\t\t\t\t\t\t\t \t\tcognom2='$this->cognom2', \r\n\t\t\t\t\t\t\t \t\tdata_naixement='$this->data_naixement',\r\n\t\t\t\t\t\t\t \t\testudis='$this->estudis',\r\n\t\t\t\t\t\t\t \t\tsituacio_laboral='$this->situacio_laboral',\r\n\t\t\t\t\t\t\t \t\tprestacio='$this->prestacio',\r\n\t\t\t\t\t\t\t \t\ttelefon_mobil='$this->telefon_mobil',\r\n\t\t\t\t\t\t\t \t\ttelefon_fix='$this->telefon_fix',\r\n\t\t\t\t\t\t\t \t\temail='$this->email',\r\n\t\t\t\t\t\t\t \t\tadmin='$this->admin',\r\n\t\t\t\t\t\t\t \t\timatge='$this->imatge'\t\t\t\t \t\t\t\t\t\t\t\t\t \t\t\r\n\t\t\t\t\t\t\t WHERE id='$this->id';\";\r\n\t\t\t\r\n\t\t\treturn Database::get()->query($consulta);\r\n\t\t\t\r\n\t\t\t\r\n\t\t}",
"public function getModifiedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'modified_user_id']);\n }",
"public function getModifiedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'modified_user_id']);\n }",
"public function getModifiedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'modified_user_id']);\n }",
"public function getModifiedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'modified_user_id']);\n }",
"public function getModifiedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'modified_user_id']);\n }",
"public function getModifiedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'modified_user_id']);\n }",
"function modificarUsuario($oldUser,$nombre,$apellidos,$usuario,$password,$poblacion,$cp,$horario, $data){\n\n //echo $oldUser . \"id usuario \";\n\n if(isset($nombre) && !empty($nombre))\n\n mysqli_query($this->mysqli,\" UPDATE usuario SET nombre= '\" . $nombre . \"' WHERE id_usuario = '\" .$oldUser .\"'\");\n\n if(isset($apellidos) && !empty($apellidos))\n\n mysqli_query($this->mysqli,\" UPDATE usuario SET apellidos= '\" . $apellidos . \"' WHERE id_usuario = '\" .$oldUser .\"'\");\n\n if(isset($usuario) && !empty($usuario)){\n\n mysqli_query($this->mysqli,\" UPDATE usuario SET usuario= '\" . $usuario . \"' WHERE id_usuario = '\" .$oldUser .\"'\");\n \n }\n\n if(isset($password) && !empty($password)){\n \n $consulta = \"UPDATE usuario SET password ='\" .$password .\"' WHERE id_usuario = '\" .$oldUser .\"'\";\n //echo $consulta .\" \";\n mysqli_query($this->mysqli,$consulta);\n //echo \"entro\".$password;\n }\n if(isset($poblacion) && !empty($poblacion))\n\n mysqli_query($this->mysqli,\" UPDATE usuario SET poblacion= '\" . $poblacion . \"' WHERE id_usuario = '\" .$oldUser .\"'\");\n\n if(isset($cp) && !empty($cp))\n\n mysqli_query($this->mysqli,\" UPDATE usuario SET cp= '\" . $cp . \"' WHERE id_usuario = '\" .$oldUser .\"'\");\n\n if(isset($horario) && !empty($horario))\n\n mysqli_query($this->mysqli,\" UPDATE usuario SET horario= '\" . $horario . \"' WHERE id_usuario = '\" .$oldUser .\"'\");\n\n if(isset($data)){\n\n mysqli_query($this->mysqli,\" UPDATE usuario SET foto= '\" . $data . \"' WHERE id_usuario = '\" .$oldUser .\"'\");\n //echo \"entro\";\n }\n\n printf(\"Filas afectadas por el Update: %d\\n\", $this->mysqli->affected_rows);\n }",
"public function getUsuario()\n {\n return $this->hasOne(User::className(), ['id' => 'createdBy'])->inverseOf('comentarios');\n }",
"function update_usuario($user_id,$params)\n {\n $this->db->where('user_id',$user_id);\n return $this->db->update('usuarios',$params);\n }",
"public function actionModificar()\n {\n $model = Yii::$app->user->identity->usuariosDatos;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->localidad === null && $model->direccion === null) {\n $model->geoloc = null;\n }\n if ($model->save() && $model->upload()) {\n Yii::$app->session->setFlash('success', Yii::t('app', 'Has actualizado tus datos correctamente'));\n }\n }\n\n return $this->render('/usuarios/update', [\n 'modelDatos' => $model,\n 'seccion' => 'personal',\n 'generos' => Utiles::translateArray(UsuariosGeneros::find()\n ->select('sexo')\n ->indexBy('id')\n ->column()),\n ]);\n }",
"function actualizar_usuario($id_colaborador,$nombre,$primer_apellido,$segundo_apellido,$usuario,$password,$email,$t_ruso,$t_arabe,$t_rumano,$t_chino,$t_polaco,$t_bulgaro,$t_ingles,$t_frances,$t_catalan,$gestion_usuarios,$gestion_palabras,$definicion_palabras,$borrar_palabras,$add_imagenes,$borrar_imagenes,$add_simbolos,$borrar_simbolos,$simbolos_especiales) {\n\n\t\t$UpdateRecords = \"UPDATE colaboradores \n\t\tSET nombre='$nombre', primer_apellido='$primer_apellido', segundo_apellido='$segundo_apellido', login='$usuario', password='$password',\n\t\testado='1', email='$email'\n\t\tWHERE id_colaborador='$id_colaborador'\";\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($UpdateRecords); \t\n\t\tmysql_close($connection);\n\t\t\n\t\t$UpdateRecords2 = \"UPDATE colaboradores_permisos\n\t\tSET traduccion_ruso='$t_ruso', traduccion_arabe='$t_arabe', traduccion_rumano='$t_rumano',\n\t\ttraduccion_chino='$t_chino',traduccion_polaco='$t_polaco',traduccion_bulgaro='$t_bulgaro',\n\t\ttraduccion_ingles='$t_ingles',traduccion_frances='$t_frances',traduccion_catalan='$t_catalan',\n\t\tgestion_usuarios='$gestion_usuarios', gestion_palabras='$gestion_palabras', definicion_palabras='$definicion_palabras', \n\t\tborrar_palabras='$borrar_palabras', add_imagenes='$add_imagenes', borrar_imagenes='$borrar_imagenes', add_simbolos='$add_simbolos',\n\t\tborrar_simbolos='$borrar_simbolos', simbolos_especiales='$simbolos_especiales'\n\t\t WHERE id_colaborador='$id_colaborador'\";\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($UpdateRecords2); \n\t\tmysql_close($connection);\n\t}"
] |
[
"0.63060963",
"0.5956425",
"0.58293396",
"0.5765294",
"0.57194716",
"0.5715164",
"0.5693652",
"0.5685324",
"0.56820637",
"0.56444573",
"0.5624681",
"0.56189823",
"0.5603897",
"0.56018496",
"0.557761",
"0.5574875",
"0.5553592",
"0.551292",
"0.55075514",
"0.5498804",
"0.5498804",
"0.5498804",
"0.5498804",
"0.5498804",
"0.5498804",
"0.5485629",
"0.54738194",
"0.54637223",
"0.5455441",
"0.5438916"
] |
0.66615415
|
0
|
Create a new personal game token for the user.
|
public function createGameToken(string $name, int $provider, int $game = null, string $type = 'auth', bool $dashes = true, array $abilities = ['*']);
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function createToken();",
"public function create_token(array $data)\n\t{\n\t\t// Create the token\n\t\tdo\n\t\t{\n\t\t\t$token = sha1(uniqid(Text::random('alnum', 32), TRUE));\n\t\t}\n\t\twhile($this->get_token($token)->loaded());\n\n\t\t// Store token in database\n\t\treturn $this->set(array(\n\t\t\t'user'\t\t => $data['user_id'],\n\t\t\t'expires'\t => $data['expires'],\n\t\t\t'user_agent' => $data['user_agent'],\n\t\t\t'token'\t\t => $token,\n\t\t))->save();\n\t}",
"public function createNewToken()\n {\n return $this->getBandrek()->generateToken();\n }",
"public function generateToken();",
"public function createToken()\n\t{\n\t\t$domain = $this->config->get('app.domain');\n\n\t\t$data = [\n\t\t\t'iss' => $domain,\n\t\t\t'aud' => $domain,\n\t\t\t'iat' => time(),\n\t\t\t'exp' => time () + $this->expiration,\n\t\t];\n\n\t\t$token = JWT::encode($data, $this->config->get('app.app_key'));\n\n\t\t$this->createAuth([\n\t\t\t'token' => $token,\n\t\t\t'expires_at' => date('Y-m-d h:i:s', $data['exp'])\n\t\t]);\n\n\t\treturn $token;\n\t}",
"protected function createNewToken($token){\n $user = auth()->user();\n $captain = false;\n $team = Team::find($user->team_id);\n if($team){\n if($team->user_id == $user->id) {\n $captain = true;\n }else{\n $captain = false;\n }\n \n $teamId = $team->id;\n }else{\n $teamId = null;\n }\n \n return response()->json([\n 'access_token' => $token,\n 'user_id' => $user->id,\n 'username' => $user->name,\n 'captain' => $captain,\n 'team_id' => $teamId,\n ]);\n }",
"public function createGooleToken($token)\n {\n $user_id = Auth::user()->id; \n $this->systemUser->find($user_id)->userGoogleSheet()->create($token);\n }",
"public function generateToken() {\n // we randomly generate an API token\n $api_token = Str::random(80);\n // we check whether the generated token already exists in the users table\n $api_token_found = User::where('api_token', $api_token)->first();\n while ($api_token_found) {\n // if the generated token is already associated with a registered user, we generates a new token\n $api_token = Str::random(80);\n // we check whether also this newly generated token already exists in the users table\n $api_token_found = User::where('api_token', $api_token)->first();\n }\n // we get the logged in user\n $user = Auth::user();\n // we associate to this user the generated token (this token will certainly be different from those of the other users)\n $user->api_token = $api_token;\n $user->save();\n return redirect()->route('admin.profile');\n }",
"public function generateToken()\n\t{\n\t\treturn Token::make();\n\t}",
"function createtoken()\n {\n $token = \"token-\" . mt_rand();\n // put in the token, created time\n $_SESSION[$token] = time();\n return $token;\n }",
"public function createToken()\n {\n $key = base64_encode(getenv('JWT_SECRET'));\n $payload = array(\n \"jti\" => base64_encode(random_bytes(32)),\n \"iat\" => time(),\n \"iss\" => getenv('BASE_URL'),\n \"nbf\" => time() + 10,\n \"exp\" => time() + (3600 * 24 * 15),\n \"data\" => [\n \"user\" => [\n \"username\" => $this->username,\n \"uuid\" => $this->uuid\n ]\n ]\n );\n try {\n return $this->container->jwt::encode($payload, $key, 'HS256');\n } catch (Exception $e) {\n return false;\n }\n }",
"function genera_token ($user, $profile)\r\n{\r\n\t$token = \"\";\r\n\r\n\t/* Aqui estaria el algoritmo para la generacion\r\n\tdel token */\r\n\r\n\treturn $token;\r\n}",
"public function token()\n {\n // echo 'pk';\n try {\n $this->heimdall->createToken();\n } catch (Exception $exception) {\n $this->heimdall->handleException($exception);\n }\n }",
"static function createToken($user, $lifespan = 172800 /* (seconds) 2 days */){\n\n\t\tif($existingVerificationToken = self::get(\"user = $user->id\")){\n\n\t\t\t$existingVerificationToken->delete();\n\t\t}\n\n\t\t$verificationToken = new self();\n\t\t$verificationToken->user = $user->id;\n\t\t$verificationToken->token = bin2hex(openssl_random_pseudo_bytes(16));\n\t\t$verificationToken->lifespan = $lifespan;\n\t\t$verificationToken->save();\n\t\treturn $verificationToken->token;\n\t}",
"public function create()\n {\n\t\t\n\t\t//this->authorize('create', Token::class);\n\t\t$jsvalidator = JsValidator::make([\n\t\t\t'user_id' => 'numeric|nullable|exits:users,id',\n\t\t\t'account' => 'numeric|required|exits:accounts,id',\n\t\t\t'name' => 'required|string|max:75',\n\t\t\t'slug' => 'nullable|string',\n\t\t\t'contract_address' => 'nullable|string|max:42',\n\t\t\t'contract_ABI_array' => 'nullable|string',\n\t\t\t'contract_Bin' => 'nullable|string',\n\t\t\t'token_price' => 'required|numeric',\n\t\t\t'symbol' => 'required|string',\n\t\t\t'decimals' => 'required|numeric',\n\t\t\t'logo' => 'required|file',\n\t\t\t'image' => 'required|file',\n\t\t\t'website' => 'required|string|url',\n\t\t\t'twitter' => 'required|string|url',\n\t\t\t'facebook' => 'required|string|url',\n\t\t\t'description' => 'required|string',\n\t\t\t'technology' => 'nullable|string',\n\t\t\t'features' => 'required|string',\n\t\t]);\n\t\t$accounts = auth()->user()->accounts;\n\t\t$page_title = \"title\";\n //$data['users'] = User::latest()->paginate(20);\n return view('admin.tokens.create',compact('jsvalidator','accounts','page_title'));\n }",
"public function create_token()\n {\n $this->load->library('wsresponse');\n $this->load->library('wschecker');\n $this->wsresponse->setOptionsResponse();\n \n $this->load->model('rest_model');\n $remote_addr = $this->wschecker->getHTTPRealIPAddr();\n $user_agent = $this->wschecker->getHTTPUserAgent();\n $prepare_str = $remote_addr . \"@@\" . $user_agent . \"@@\" . time();\n $ws_token = hash(\"SHA256\", $this->wschecker->encrypt($prepare_str));\n\n $inser_arr['vWSToken'] = $ws_token;\n $inser_arr['vIPAddress'] = $remote_addr;\n $inser_arr['vUserAgent'] = $user_agent;\n $inser_arr['dLastAccess'] = date(\"Y-m-d H:i:s\");\n $res = $this->rest_model->insertToken($inser_arr);\n if ($res) {\n $settings_arr['success'] = 1;\n $settings_arr['message'] = \"Token generated successfully..!\";\n $data_arr['ws_token'] = $ws_token;\n } else {\n $settings_arr['success'] = 0;\n $settings_arr['message'] = \"Token generation failed..!\";\n $data_arr = array();\n }\n $responce_arr['settings'] = $settings_arr;\n $responce_arr['data'] = $data_arr;\n $this->wsresponse->sendWSResponse($responce_arr);\n }",
"public function createToken(\\Navis\\UserBundle\\Entity\\User $user)\n {\n $token = sha1(time().$user->getSecretToken());\n\n $user->setAccessToken($token);\n $user->setExpiresAt(time()+300);//añado 5 minutos al tiempo de expiracion del token\n\n $this->getEntityManager()->persist($user);\n $this->getEntityManager()->flush();\n\n \n\n return $token;\n }",
"function createToken($name)\n{\n\t$token=NULL;\n\t$token=uniqid(rand(), true);\n\t$_SESSION[$name.'Token']=$token;\n\t$_SESSION[$name.'Token_time']=time();\n\treturn $token;\n}",
"public function generateToken(){\n //if(empty($_SESSION['token']) && (empty($_SESSION['tokenAge']) || (time() - (int)$_SESSION['tokenAge']) > (int)$this->maxAge)){\n if(function_exists('random_bytes')){\n $_SESSION['token'] = bin2hex(random_bytes(32));\n }elseif(function_exists('mcrypt_create_iv')){\n $_SESSION['token'] = bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM));\n }else{\n $_SESSION['token'] = bin2hex(openssl_random_pseudo_bytes(32));\n }\n $_SESSION['tokenAge'] = time();\n //} \n }",
"public function createAdminToken();",
"private function createToken()\n {\n $this->token = md5(time().uniqid());\n return true;\n }",
"public function creating(User $user)\n {\n $string = bin2hex(random_bytes(16)); // 20 chars\n $user->verification_token = $string;\n }",
"protected function create_token(Entities\\Token &$token = NULL)\n\t{\n\t\t// Create a new autologin token if not passed as argument\n\t\tif($token === NULL)\n\t\t{\n\t\t \t$token = new Entities\\Token;\n\t\t}\n\n\t\t// Set the expire time and hash of the user agent\n\t\t$token->setExpires(time() + $this->_config['lifetime']);\n\t\t$token->setUserAgent(sha1(Request::$user_agent));\n\n\t\t// Create a new token each time the token is saved\n\t\twhile (TRUE)\n\t\t{\n\t\t\t// Create a random token\n\t\t\t$hash = text::random('alnum', 32);\n\n\t\t\t// Make sure the token does not already exist\n\t\t\tif(ORM::load('Token')->findOneBy(array('hash' => $hash)) === NULL)\n\t\t\t{\n\t\t\t\t// A unique token has been found\n\t\t\t\t$token->setHash($hash);\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $token;\n\t}",
"public function testCreateToken(){\n\t\tPayU::$apiLogin = PayUTestUtil::API_LOGIN;\n\t\tPayU::$apiKey = PayUTestUtil::API_KEY;\n\t\t\n\t\tEnvironment::setPaymentsCustomUrl(PayUTestUtil::PAYMENTS_CUSTOM_URL);\n\t\t\n\t\t$parameters = PayUTestUtil::buildParametersCreateToken();\n\t\t\n\t\t$response = PayUTokens::create($parameters);\n\t\t\n\t\t$this->assertEquals(PayUResponseCode::SUCCESS, $response->code);\n\t\t$this->assertNotNull($response->creditCardToken);\n\t\t$this->assertNotNull($response->creditCardToken->creditCardTokenId);\n\t\t\t\t\n\t}",
"public function create(Token $token): void;",
"protected function create_token() {\n\t\twhile(true) {\n\t\t\t// Create a random token\n\t\t\t$token = str::random('alnum', 32);\n\n\t\t\t// Make sure the token does not already exist\n\t\t\tself::db()->use_master(YES);\n\t\t\tif (self::db()->select('user_token_id')->where('user_token_token', $token)->get($this->table_name)->count() === 0) {\n\t\t\t\t// A unique token has been found\n\t\t\t\treturn $token;\n\t\t\t}\n\t\t}\n\t}",
"static function generateToken() {\n $token = Cache::get(\"token\", false);\n if ($token) {\n return $token;\n } else {\n $time = floor(time() / 1000);\n $token = md5(bin2hex($time));\n new Cache(\"token\", $token);\n return $token;\n }\n }",
"function createToken() {\n\treturn bin2hex(openssl_random_pseudo_bytes(32));\n}",
"public function withGameToken($gameToken);",
"private function makeFakeToken()\n {\n return factory(Token::class)->make(array(\n 'user_id' => $this->getTestingUser(),\n ));\n }"
] |
[
"0.73306143",
"0.6843996",
"0.67223716",
"0.67067605",
"0.6678495",
"0.6527884",
"0.6496594",
"0.6488165",
"0.6432121",
"0.6386155",
"0.6321868",
"0.6295599",
"0.628744",
"0.62651324",
"0.61987966",
"0.6140291",
"0.6139884",
"0.6079618",
"0.60682523",
"0.6053693",
"0.60431945",
"0.6040992",
"0.60404474",
"0.6003436",
"0.59993935",
"0.59986615",
"0.59984696",
"0.5997812",
"0.59860116",
"0.59748787"
] |
0.72527367
|
1
|
Get the game token currently associated with the user.
|
public function currentGameToken();
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public static function get_token() {\n global $USER;\n $sid = session_id();\n return self::get_token_for_user($USER->id, $sid);\n }",
"public function get_current_user_token() {\n\t\t$user_id = $this->current_user->ID;\n\n\t\t$user_token = get_option( 'livechat_user_' . $user_id . '_token' );\n\t\tif ( ! $user_token ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn $user_token;\n\t}",
"public function get(): SightToken\n {\n return CompanionTokenManager::getToken();\n }",
"public function getToken(string $userToken): ?Token;",
"public function get_token() {\n\t\treturn $this->token;\n\t}",
"public function get()\n {\n if ($token = $this->cachedToken()) {\n return $token;\n }\n\n return $this->newToken();\n }",
"public function getUserToken()\n {\n return !is_null($this->authToken) ? $this->authToken : $this->cookieHelper->getRequestCookie('auth');\n }",
"public function getToken()\n {\n // if the user isn't authenticated simply return null\n $services = $this->services;\n if (!$services->get('permissions')->is('authenticated')) {\n return null;\n }\n\n // if we don't have a token; make one\n $session = $services->get('session');\n $container = new SessionContainer(static::CSRF_CONTAINER, $session);\n if (!$container['token']) {\n $session->start();\n $container['token'] = (string) new Uuid;\n $session->writeClose();\n }\n\n return $container['token'];\n }",
"public function getCurrentToken()\n {\n return $this->current_token;\n }",
"public function user()\n {\n if (!$this->user) {\n $identifier = $this->getToken();\n $this->user = $this->provider->retrieveByToken($identifier, '');\n }\n return $this->user;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->token;\n }",
"function getUserFromToken() {\n\t\treturn $this->_storage->loadUserFromToken();\n\t}",
"public function getToken() {\n return $this->token;\n }",
"public function getToken()\n {\n return $this->getApplication()->getSecurityContext()->getToken();\n }",
"public function token(): Token\n {\n return self::instance()->runner->token();\n }",
"public function getUserIdentifier(): string\n {\n return ($this->token ?? ($this->appkey ?? ''));\n }"
] |
[
"0.77432156",
"0.7330032",
"0.676562",
"0.6607328",
"0.66073275",
"0.6576862",
"0.6527524",
"0.65195495",
"0.65152436",
"0.651168",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6483023",
"0.6476725",
"0.64708376",
"0.6452902",
"0.64527875",
"0.64469814"
] |
0.7722607
|
1
|
Init the content of change state action
|
public function initChangeStateContent()
{
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"protected function initializeAction() {}",
"protected function initializeAction() {}",
"protected function initializeAction() {}",
"protected function initAction()\n {\n }",
"public function initializeAction() {\n\n\t}",
"abstract public function setState() ;",
"protected function populateState() \n\t{\n\t\t\n\t\t$app = JFactory::getApplication('com_einsatzkomponente');\n\t\t// Load state from the request userState on edit or from the passed variable on default\n if (JFactory::getApplication()->input->get('layout') == 'edit') {\n $id = JFactory::getApplication()->getUserState('com_einsatzkomponente.edit.einsatzbericht.id');\n\n } else {\n $id = JFactory::getApplication()->input->get('id');\n JFactory::getApplication()->setUserState('com_einsatzkomponente.edit.einsatzbericht.id', $id);\n }\n\t\t$this->setState('einsatzbericht.id', $id);\n\t\t// Load the parameters.\n\t\t$params = $app->getParams();\n $params_array = $params->toArray();\n if(isset($params_array['item_id'])){\n $this->setState('einsatzbericht.id', $params_array['item_id']);\n }\n\t\t$this->setState('params', $params);\n\t}",
"function getDefaultState()\r\n\t{\r\n\t}",
"protected function action_show() {\n\n $tab = $this->request->tab;\n $text = $this->request->value;\n\n $what_changed = $this->_change_tab($tab, $text);\n\n switch ($what_changed) {\n case self::TAB_SAME:\n $state = $this->request->to_state(true);\n\n log&&msg('refresh tab: leave state as:', $state);\n\n break;\n\n case self::TAB_CHANGED:\n $state = $this->_states->item($tab);\n\n log&&msg('change tab: setting state to:', $state);\n\n break;\n\n case self::TAB_NEW:\n $state = $this->request->to_state();\n\n // which default edit state?\n $state->event = tpp\\config('edit_new_tab') ? 'edit' : 'all';\n if ($state->event == 'all') {\n // edit event set the draft text as a value\n $state->value = '';\n }\n log&&msg('new tab: setting state to:', $state);\n\n break;\n\n default:\n $state = false;\n }\n return $state;\n }",
"protected function populateState()\n\t{\n\t}",
"protected function populateState()\n\t{\n\t}",
"public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::fetch('app');\n $filter_order = $app->getUserStateFromRequest('Source.filter_order','filter_order','s.name');\n $filter_order_Dir = $app->getUserStateFromRequest('Source.filter_order_Dir','filter_order_Dir','asc');\n\n //set states\n $this->state->set('Source.filter_order',$filter_order);\n $this->state->set('Source.filter_order_Dir',$filter_order_Dir);\n }",
"public function action_init()\n\t{\n\t\t$this->add_template('statusnet.tpl', dirname(__FILE__) . '/statusnet.tpl.php');\n\t}",
"public function init()\r\n {\r\n parent::init();\r\n $this->visible = true;\r\n $this->descriptionashint = true;\r\n $this->active = false;\r\n }",
"public function action_init()\n\t{\n\t\t$this->add_template( 'menus_admin', dirname( __FILE__ ) . '/menus_admin.php' );\n\t\t$this->add_template( 'menu_iframe', dirname( __FILE__ ) . '/menu_iframe.php' );\n\t\t$this->add_template( 'block.menu', dirname( __FILE__ ) . '/block.menu.php' );\n\n\t\t// formcontrol for tokens\n\t\t$this->add_template( 'text_tokens', dirname( __FILE__ ) . '/formcontrol_tokens.php' );\n\t}",
"public function init()\n\t{\n\t\tparent::init();\n\n\t\tif(isset($this->buttons['view']) && isset($this->viewButtonVisible))\n\t\t\t$this->buttons['view']['visible']=$this->viewButtonVisible;\n\t\tif(isset($this->buttons['update']) && isset($this->updateButtonVisible))\n\t\t\t$this->buttons['update']['visible']=$this->updateButtonVisible;\n\t\tif(isset($this->buttons['delete']) && isset($this->deleteButtonVisible))\n\t\t\t$this->buttons['delete']['visible']=$this->deleteButtonVisible;\n\t}",
"public function init() {\n\t\t$this->load_actions();\n\t}",
"function changeState($title = null, $menu = 'Article Manager', $type = 'Category', $newState = 'publish')\n\t{\n\t\t$this->gotoAdmin();\n\t\techo \"Changing state of \" . $type . \" \" . $title . \" in \" . $menu . \" to \" . $newState . \"\\n\";\n\t\t$this->click(\"link=\" . $menu);\n\t\t$this->waitForPageToLoad(\"30000\");\n\t\tif ($type == 'Category')\n\t\t{\n\t\t\t$this->click(\"//ul[@id='submenu']/li[2]/a\");\n\t\t\t$this->waitForPageToLoad(\"30000\");\n\t\t}\n\t\t$filter = ($menu == 'Banners') ? 'filter_state' : 'filter_published';\n\t\t$this->select($filter, \"label=All\");\n\t\t$this->waitForPageToLoad(\"30000\");\n\t\t$this->type(\"filter_search\", $title);\n\t\t$this->click(\"//button[@type='submit']\");\n\t\t$this->waitForPageToLoad(\"30000\");\n\t\t$this->toggleCheckBox($title);\n\t\t$this->click(\"//li[@id='toolbar-\" . $newState . \"']/a/span\");\n\t\t$this->waitForPageToLoad(\"30000\");\n\t\t$this->click(\"//button[@type='button']\");\n\t\t$this->waitForPageToLoad(\"30000\");\n\t\t$this->select($filter, \"label=- Select Status -\");\n\t\t$this->waitForPageToLoad(\"30000\");\n\t\t$this->gotoAdmin();\n\t}",
"public function __construct()\n {\n $this->setAction('index', array('idle', 'toggleEnabled', 'expunge'));\n }",
"public function init() {\n\t\t// Display settings page.\n\t\tadd_action( 'beehive_settings_page_content', [ $this, 'settings_page_content' ] );\n\n\t\t// Show success message.\n\t\tadd_action( 'beehive_admin_settings_processed', [ $this, 'updated_message' ] );\n\n\t\t// Render onboarding modals.\n\t\tadd_action( 'beehive_add_modals', [ $this, 'render_onboarding' ] );\n\t}",
"public function setActionState($data) {\n $this->checkActionState($data);\n $this->changeActionState($data);\n $this->refreshAuthWithAction($data->param1);\n }",
"public function state();",
"function change() {\n\t\t$mainframe = JFactory::getApplication();\n\t\t// Check for request forgeries\n\t\tdefined('_JEXEC') or die('Invalid Token');\n\t\t$option = clm_core::$load->request_string('option', '');\n\t\t$section = clm_core::$load->request_string('section', '');\n\t\t$db = JFactory::getDBO();\n\t\t$table = JTable::getInstance('saisons', 'TableCLM');\n\t\t$table->load(1);\n\t\t$pub_1 = $table->archiv;\n\t\tif ($pub_1 == \"1\") {\n\t\t\t$table->archiv = 0;\n\t\t} else {\n\t\t\t$table->archiv = 1;\n\t\t}\n\t\t$table->store();\n\t\t$table->load(2);\n\t\t$pub_2 = $table->published;\n\t\tif ($pub_2 == \"1\") {\n\t\t\t$table->published = 0;\n\t\t} else {\n\t\t\t$table->published = 1;\n\t\t}\n\t\t$table->store();\n\t\t$msg = JText::_('SAISON_MSG_STATUS');\n\t\t$this->setMessage($msg);\n\t\t$this->setRedirect('index.php?option=' . $option . '§ion=' . $section);\n\t}",
"public function init() {\n $menu = \"<li><a href=\\\" /eu-type-acteur/new \\\">Nouveau</a></li>\";\n $this->view->placeholder(\"menu\")->set($menu);\n $this->view->jQuery()->enable();\n $this->view->jQuery()->uiEnable(); \n }",
"public static function mla_admin_init_action( ) {\r\n\t\tself::$default_columns =& MLAQuery::$default_columns;\r\n\t\tself::$default_hidden_columns =& MLAQuery::$default_hidden_columns;\r\n\t\tself::$default_sortable_columns =& MLAQuery::$default_sortable_columns;\r\n\t}"
] |
[
"0.64145434",
"0.64145434",
"0.64145434",
"0.64145434",
"0.64145434",
"0.6357035",
"0.63554996",
"0.63554996",
"0.6351653",
"0.63082653",
"0.59767133",
"0.5965284",
"0.5962579",
"0.59563863",
"0.5943301",
"0.5943301",
"0.59118885",
"0.59100705",
"0.5876801",
"0.5862421",
"0.5838256",
"0.58177507",
"0.5782228",
"0.57760245",
"0.57599986",
"0.5732592",
"0.5714682",
"0.568935",
"0.5680583",
"0.56716573"
] |
0.8559462
|
0
|
Inits the content of 'update_receipt' action Called in initContent()
|
public function initUpdateReceiptContent()
{
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function initUpdateSupplyOrderContent()\n {\n }",
"protected function postProcessUpdateReceipt()\n {\n }",
"public function initContent() {\n\n parent::initContent();\n\n $this->context->smarty->assign(\n [\n 'errors' => $this->errors,\n 'nbdaysreturn' => (int) Configuration::get('EPH_ORDER_RETURN_NB_DAYS'),\n ]\n );\n $this->setTemplate(_EPH_THEME_DIR_ . 'order-return.tpl');\n }",
"public function initContent()\n {\n $aps_params = Tools::getAllValues();\n if (isset($aps_params['content_only'])) {\n if (1 == $aps_params['content_only']) {\n $this->context->smarty->assign('nobots', true);\n $this->setTemplate('module:amazonpaymentservices/views/templates/hook/payment_valu_term.tpl');\n }\n }\n parent::initContent();\n }",
"public function initContent()\n {\n $this->display_column_left = false;\n $this->display_column_right = false;\n\n // Debug\n // $cart234 = $this->context->cart;\n // $cart_methods = get_class_methods(new Cart());\n // print_r(get_object_vars($this->context));\n // $foo = $this->context->foo;\n\n // Get POST params\n // Favoring Prestashop's Tools::getValue($key, $default_value) over using the superglobals directly\n // $number_of_installments = 0; // default to 0\n // if ($_POST['number_of_installments'])\n // \t$number_of_installments = $_POST['number_of_installments'];\n $number_of_installments = Tools::getValue('number_of_installments', 0);\n\n // Call parent\n parent::initContent();\n\n // Set template to use\n $this->setTemplate('paymentConfirmation.tpl');\n\n // Get cart id\n $id_cart = $this->context->cart->id;\n\n // Set language code\n // TODO Make it a little more general?\n // Accepted values: en-US, el-GR, ru-RU, de-DE\n $language_code = $this->context->language->language_code;\n\n // Get merchant reference\n $merchant_reference = WinbankRedirectTransaction::getMerchantReferenceByCartId($id_cart);\n\n // Set params to be sent with the bank link\n $param_back_link = '';\n\n // Set URL to make POST request\n $api_url = '';\n\n // Assign cart data to smarty\n $this->context->smarty->assign(array(\n 'nb_products' => $this->context->cart->nbProducts(),\n 'total_amount' => $this->context->cart->getOrderTotal(true, Cart::BOTH),\n 'shipping_amount' => $this->context->cart->getOrderTotal(true, Cart::ONLY_SHIPPING),\n 'products_amount' => $this->context->cart->getOrderTotal(true, Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING),\n 'path' => $this->module->getPathUri(),\n 'api_url' => $api_url,\n 'number_of_installments' => $number_of_installments,\n 'acquirer_id' => Configuration::get('WINBANKREDIRECT_CRED_ACQUIRERID'),\n 'merchant_id' => Configuration::get('WINBANKREDIRECT_CRED_MERCHANTID'),\n 'pos_id' => Configuration::get('WINBANKREDIRECT_CRED_POSID'),\n 'user' => Configuration::get('WINBANKREDIRECT_CRED_USERNAME'),\n 'language_code' => $language_code,\n 'merchant_reference' => $merchant_reference,\n 'param_back_link' => $param_back_link\n ));\n }",
"public function initContent()\n\t{\n\t\tparent::initContent();\n\n\t\t$this->context->smarty->assign(array(\n\t\t\t'is_guest' => $this->context->customer->is_guest,\n\t\t\t'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(),\n\t\t\t'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()\n\t\t));\n\n\t\tif ($this->context->customer->is_guest)\n\t\t{\n\t\t\t$this->context->smarty->assign(array(\n\t\t\t\t'id_order' => $this->id_order,\n\t\t\t\t'reference_order' => $this->reference,\n\t\t\t\t'id_order_formatted' => sprintf('#%06d', $this->id_order),\n\t\t\t\t'email' => $this->context->customer->email\n\t\t\t));\n\t\t\t/* If guest we clear the cookie for security reason */\n\t\t\t$this->context->customer->mylogout();\n\t\t}\n\n\t\t$this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl');\n\t}",
"function set_comment_on_receipt() {\n $this->sale_lib->set_comment_on_receipt($this->input->post('show_comment_on_receipt'));\n }",
"public function initContent()\n {\n parent::initContent();\n\n $this->context->smarty->assign('ordersSlip', OrderSlip::getOrdersSlip((int)$this->context->cookie->id_customer));\n $this->setTemplate(_PS_THEME_DIR_.'order-slip.tpl');\n }",
"public function init(){\n $this->vvars['menu'] = 'paid';\n $this->vvars['nav'] = 'paid';\n }",
"public function receipt()\n\t{\n\t\t\n\t\t$this->templateFileName = 'receipt.tpl';\n\t\t\n\t\tif (!isset($_REQUEST['orderID']))\n\t\t{\n\t\t\tthrow new \\Exception(\"Incorrect parameters\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t// Get the order data\n\t\t\t$order = $this->dbConnection->prepareRecord(\"SELECT o.order_id, DATE_FORMAT(o.order_timestamp, '%W, %M %D, %Y') AS order_timestamp, r.description AS order_status, subtotal, tax, shipping, total, user_id, shipping_address_id, billing_address_id, payment_id FROM b_order o INNER JOIN b_reference r ON o.order_status = r.data_value AND r.data_member = 'ORDER_STATUS' WHERE order_id = ?\", $_REQUEST['orderID']);\n\t\t\t\n\t\t\t// Make sure the order is for the current user\n\t\t\tif ($order['user_id'] != $this->session->userID)\n\t\t\t{\n\t\t\t\tthrow new \\Exception(\"The order is for another user.\");\n\t\t\t}\n\n\t\t\t// Get the order lines\n\t\t\t$order_items = $this->dbConnection->prepareRecordSet(\"SELECT oi.order_id, oi.item_id, oi.item_sequence, oi.quantity, oi.price, oi.extended_price, oi.line_status, i.item_name, i.item_description, i.image_url, i.thumb_url, i.price, i.isbn, i.author, i.category_id FROM b_order_item oi INNER JOIN b_item i ON oi.item_id = i.item_id WHERE oi.order_id = ? ORDER BY oi.item_sequence\", $_REQUEST['orderID'] );\n\t\t\t\n\t\t\t// Get the addresses\n\t\t\t$shipping_address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $order['shipping_address_id']);\n\t\t\t$billing_address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $order['billing_address_id']);\n\t\t\t$payment_method = $this->dbConnection->prepareRecord(\"SELECT payment_id, payment_type, credit_card_type, payment_name, RIGHT(account_number, 4) AS account_number_last_4, LPAD(RIGHT(account_number, 4), LENGTH(account_number), 'X') AS account_number, card_expiration_month, card_expiration_year, rp.description AS payment_type_description, rc.description AS credit_card_type_description FROM b_payment INNER JOIN b_reference rp ON rp.data_member = 'PAYMENT_TYPE' AND rp.data_value = payment_type LEFT OUTER JOIN b_reference rc ON rc.data_member = 'CREDIT_CARD_TYPE' AND rc.data_value = credit_card_type WHERE payment_id = ?\", $order['payment_id']);\n\t\t\t\n\t\t\t$this->set('order', $order);\n\t\t\t$this->set('order_items', $order_items);\n\t\t\t$this->set('shipping_address', $shipping_address);\n\t\t\t$this->set('billing_address', $billing_address);\n\t\t\t$this->set('payment_method', $payment_method);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}",
"protected function updateAction()\n {\n }",
"public function edit(Receipt $receipt)\n {\n //\n }",
"public function init() {\n $this->initContent(\"Product\");\n $this->loadSession();\n }",
"public function init()\n\t\t{\n\t\t\t$this->SetHelpText(GetLang('EmailChangeHelpText'));\n\t\t\t$this->ShowSaveAndCancelButtons(false);\n\t\t}",
"public function initContent()\n {\n $this->display_column_left = false;\n $this->display_column_right = false;\n\n // Call parent init content method\n parent::initContent();\n\n // Check if currency is accepted\n if (!$this->checkCurrency()) {\n Tools::redirect('index.php?controller=order');\n }\n\n // Assign data to Smarty\n $this->context->smarty->assign(array(\n 'nb_products' => $this->context->cart->nbProducts(),\n 'cart_currency' => $this->context->cart->id_currency,\n 'currencies' => $this->module->getCurrency((int) $this->context->cart->id_currency),\n 'total_amount' => $this->context->cart->getOrderTotal(true, Cart::BOTH),\n 'path' => $this->module->getPathUri(),\n ));\n\n // Set template\n $this->setTemplate('payment.tpl');\n }",
"public function initializeAction() {\n $this->emailService->setSettings($this->settings[\"mail\"]);\n $this->emailService->setExtensionName($this->extensionName);\n }",
"public function initChangeStateContent()\n {\n }",
"protected function setContent() {}",
"public function __construct(Receipt $receipt)\n {\n $this->receipt = $receipt;\n }",
"protected function initAction()\n {\n }",
"public function update(Request $request, Receipt $receipt)\n {\n //\n }",
"public function init()\n {\n $this->_items = $this->getTable('Item');\n $this->_exhibits = $this->getTable('NeatlineExhibit');\n $this->_editions = $this->getTable('NeatlineEdition');\n\n // Get exhibit and document markup.\n $item = $this->_items->find($this->_request->id);\n $edition = $this->_editions->findByItem($item);\n $exhibit = $edition->getExhibit();\n $document = $edition->getDocumentMarkup();\n\n // Push records.\n $this->view->exhibit = $exhibit;\n $this->view->edition = $edition;\n $this->view->document = $document;\n }",
"function edit() {\n $this->wireframe->hidePrintButton();\n \n if($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n if(!$this->active_invoice->canEdit($this->logged_user)) {\n $this->response->forbidden();\n } // if\n\n $invoice_data = $this->request->post('invoice');\n if(!is_array($invoice_data)) {\n $invoice_data = array(\n 'number' => $this->active_invoice->getNumber(),\n 'due_on' => $this->active_invoice->getDueOn(),\n 'issued_on' => $this->active_invoice->getIssuedOn(),\n 'currency_id' => $this->active_invoice->getCurrencyId(),\n 'purchase_order_number' => $this->active_invoice->getPurchaseOrderNumber(),\n 'private_note' => $this->active_invoice->getPrivateNote(),\n 'company_id' => $this->active_invoice->getCompanyId(),\n 'company_address' => $this->active_invoice->getCompanyAddress(),\n 'project_id' => $this->active_invoice->getProjectId(),\n 'note' => $this->active_invoice->getNote(),\n 'language_id' => $this->active_invoice->getLanguageId(),\n 'payment_type' => $this->active_invoice->getAllowPayments(),\n 'second_tax_is_compound' => $this->active_invoice->getSecondTaxIsCompound()\n );\n if(is_foreachable($this->active_invoice->getItems())) {\n $invoice_data['items'] = array();\n foreach($this->active_invoice->getItems() as $item) {\n $invoice_data['items'][] = array(\n 'id'\t\t\t\t\t => $item->getId(),\n 'description' => $item->getDescription(),\n 'unit_cost' => $item->getUnitCost(),\n 'quantity' => $item->getQuantity(),\n 'first_tax_rate_id' => $item->getFirstTaxRateId(),\n 'second_tax_rate_id' => $item->getSecondTaxRateId(),\n 'total' => $item->getTotal(),\n 'subtotal' => $item->getSubtotal(),\n 'time_record_ids' => $item->getTimeRecordIds(),\n );\n } // foreach\n } // if\n } // if\n \n $this->response->assign('invoice_data', $invoice_data);\n $this->response->assign(Invoices::getSettingsForInvoiceForm($this->active_invoice));\n \n if ($this->request->isSubmitted()) {\n \tif (!$this->request->isAsyncCall()) {\n \t\t$this->response->badRequest();\n \t} // if\n \t\n \ttry {\n if (!is_foreachable($invoice_data['items'])) {\n throw new ValidationErrors(lang('At least one invoice item is required'));\n } // if\n\n \t\tDB::beginWork('Editing Invoice');\n\n \t\t$this->active_invoice->setAttributes($invoice_data);\n\n if ($this->active_invoice->getSecondTaxIsEnabled()) {\n $this->active_invoice->setSecondTaxIsCompound(array_var($invoice_data, 'second_tax_is_compound', false));\n } // if\n\n $this->active_invoice->setItems($invoice_data['items']);\n \t\t\n \t\tif ($this->active_invoice->isIssued()) {\n \t\t $issued_on = isset($invoice_data['issued_on']) ? new DateValue($invoice_data['issued_on']) : new DateValue();\n \t\t $this->active_invoice->setIssuedOn($issued_on);\n \t\t} //if\n\n \t\t\n \t\t$this->active_invoice->save();\n \n// TODO: resolve the issue when dialog has to be redirected to the notification page\n// $this->flash->success('\":number\" has been updated', array('number' => $this->active_invoice->getName()));\n// if ($this->active_invoice->isIssued()) {\n// $this->response->redirectTo('invoice_notify', array('invoice_id' => $this->active_invoice->getId()));\n// } else {\n// $this->response->redirectToUrl($this->active_invoice->getViewUrl()); \n// } // if\n\n \t\tDB::commit('Invoice Edited');\n\n\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t'as' => 'invoice', \n 'detailed' => true,\n ));\n \n \t} catch (Exception $e) {\n \t\tDB::rollback('Invoice Editing Failed');\n \t\t$this->response->exception($e);\n \t} // try\n \t\n } // if\n }",
"function __construct($receipt_id)\n\t{\n\t\t$this->receipt_id = $receipt_id;\n\t}",
"public function init()\n {\n $this->setMethod('post');\n $this->addElement('text', 'model', array('label' => 'Model'));\n $this->addElement('text', 'unique', array('label' => 'Numer zamówienia'));\n $this->addElement('text', 'ebay_id', array('label' => 'Numer ebay'));\n $this->addElement('text', 'invoice_id', array('label' => 'Numer faktury vat'));\n $this->addElement('text', 'color', array('label' => 'Kolor'));\n $this->addElement('text', 'frame', array('label' => 'Stelaż'));\n $this->addElement('radio', 'is_seat', array('label' => 'Fotelik', 'multiOptions' => array('0' => 'Nie', '1' => 'Tak')));\n $this->addElement('select', 'status', array('label' => 'Status zamówienia', 'multiOptions' => array(\n 'paid' => 'Opłacone',\n 'unpaid' => 'Niepłacone',\n 'sent' => 'Wysłane',\n 'other' => 'Oczekuje'\n )));\n $this->addElement('text', 'wheels', array('label' => 'Koła'));\n $this->addElement('textarea', 'bonus', array('label' => 'Dodatki', 'cols' => 50, 'rows' => 3));\n $this->addElement('textarea', 'client', array('label' => 'Klient', 'cols' => 50, 'rows' => 3));\n $this->addElement('text', 'date_of_payment', array('label' => 'Data opłacenia', 'value' => null));\n $this->addElement('text', 'date_of_receipt', array('label' => 'Data odbioru', 'value' => null));\n $this->addElement('submit', 'submit', array('label' => 'Zapisz'));\n }",
"public function initContent()\n {\n\n $shipping = $this->get_ahref('AdminFrankShipping');\n $returns = $this->get_ahref('AdminFrankReturns');\n $statics = $this->get_ahref('AdminFrankStatics');\n $settings = $this->get_ahref('AdminFrankSettings');\n parent::initContent();\n $this->context->smarty->assign(\n array(\n// 'api_statics' => $api_statics['data'],\n 'shipping' => $shipping,\n 'returns' => $returns,\n 'settings' => $settings,\n )\n );\n\n $this->setTemplate('statics.tpl');\n }",
"public function _construct() {\n parent::_construct ();\n $this->_init ( 'airhotels/customerreply' );\n }",
"public function updateAction()\n {\n }",
"public function updateCart()\n {\n $this->total = CartFcd::subtotal();\n $this->content = CartFcd::content();\n }",
"public function normalAction()\n {\n $mForm = new Qss_Model_Form();\n $appr = $mForm->getApproverByStep($this->_form->i_IFID, 2);\n $mRequest = new Qss_Model_Purchase_Request();\n $main = $mRequest->getRequestByIFID($this->_form->i_IFID);\n $sub = $mRequest->getRequestLineByIFID($this->_form->i_IFID);\n\n $this->html->main = $main;\n $this->html->sub = $sub;\n $this->html->ifid = $this->_form->i_IFID;\n $this->html->step2Appr = @$appr[0];\n $this->html->step3Appr = @$appr[1];\n }"
] |
[
"0.740102",
"0.647009",
"0.6082727",
"0.6004544",
"0.60022974",
"0.5999856",
"0.5976271",
"0.5974",
"0.56724066",
"0.56171227",
"0.5606553",
"0.56061536",
"0.5577975",
"0.55760133",
"0.5571148",
"0.55471206",
"0.55144227",
"0.5514355",
"0.54883933",
"0.5472497",
"0.54468066",
"0.5434646",
"0.5426542",
"0.5392727",
"0.53790617",
"0.53610367",
"0.535628",
"0.5354806",
"0.53543335",
"0.53501564"
] |
0.8540286
|
0
|
Ths method manage associated products to the order when updating it
|
public function manageOrderProducts()
{
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function updateProduct()\n {\n \t$quote=$this->getQuote();\n \tif($quote)\n \t{\n \t\t$detailproduct=$this->getProduct();\n \t\t$quoteproduct=$quote->getProduct();\n \t\tif(\n\t\t\t\t$quote->getPrice()!=$this->getPrice() or\n\t\t\t\t$quote->getDiscrate()!=$this->getDiscrate() or\n\t\t\t\t$quote->getDiscamt()!=$this->getDiscamt() or\n\t\t\t\t$quote->getProductId()!=$this->getProductId()\n\t\t\t)\n\t\t\t{\n\t\t\t\t$quote->setPrice($this->getPrice());\n\t\t\t\t$quote->setDiscrate($this->getDiscrate());\n\t\t\t\t$quote->setDiscamt($this->getDiscamt());\n\t\t\t\t$quote->setProductId($this->getProductId());\n\t\t\t\t$quote->calc(); //auto save\n\t\t\t\t$detailproduct->calcSalePrices();\n\t\t\t\t\n\t\t\t\t//if product changed, calc old product\n\t\t\t\tif($quoteproduct->getId()!=$detailproduct->getId())\n\t\t\t\t\t$quoteproduct->calcSalePrices();\n\t\t\t}\n \t}\n \telse\n \t{\n\t\t\t//if none, see if product quote by vendor with similar pricing exists. \n\t\t\t$quote=Fetcher::fetchOne(\"Quote\",array('total'=>$this->getUnittotal(),'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),'product_id'=>$this->getProductId()));\n\n\t\t\t//if it doesn't exist, create it, and product->calc()\n\t\t\tif(!$quote)\n\t\t\t{\n\t\t\t\tQuoteTable::createOne(array(\n\t\t\t\t\t'date'=>$this->getInvoice()->getDate(),\n\t\t\t\t\t'price'=>$this->getPrice(),\n\t\t\t\t\t'discrate'=>$this->getDiscrate(),\n\t\t\t\t\t'discamt'=>$this->getDiscamt(),\n\t\t\t\t\t'vendor_id'=>SettingsTable::fetch(\"me_vendor_id\"),\n\t\t\t\t\t'product_id'=>$this->getProductId(),\n\t\t\t\t\t'ref_class'=>\"Invoicedetail\",\n\t\t\t\t\t'ref_id'=>$this->getId(),\n\t\t\t\t\t'mine'=>1,\n\t\t\t\t\t));\n\t\t\t\t$this->getProduct()->calcSalePrices();\n\t\t\t}\n \t}\n }",
"public function updated(Order $order)\n {\n foreach (OrderProduct::where('order_id',$order->id)->get() as $orderProduct) {\n $product = Product::find($orderProduct->product_id);\n $cardController = new GlobalCardController();\n $product->count = $cardController->countProduct($orderProduct->product_id);\n $product->save();\n }\n }",
"public function action_order(Order $order, $status) {\n // dd($status);\n if($status == 3){\n $order_id = $order->id;\n $order_items = OrderItem::where('order_id' , $order_id)->get();\n for($i = 0; $i < count($order_items); $i++){\n $count = $order_items[$i]['count'];\n $product_id = $order_items[$i]['product_id'];\n if ($order->status == 2) {\n $product = Product::find($product_id);\n $product->update(['remaining_quantity' => $product->remaining_quantity + $count, 'sold_count' => $product->sold_count - $count]);\n if ($order_items[$i]['option_id'] != 0) {\n $m_option = ProductMultiOption::find($order_items[$i]['option_id']);\n $m_option->update(['remaining_quantity' => $m_option->remaining_quantity + $count, 'sold_count' => $m_option->sold_count - $count]);\n }\n }\n \n\n // $product->save();\n }\n }\n\n if($status == 2){\n $order_id = $order->id;\n $order_items = OrderItem::where('order_id' , $order_id)->get();\n for($i = 0; $i < count($order_items); $i++){\n $count = $order_items[$i]['count'];\n $product_id = $order_items[$i]['product_id'];\n $product = Product::find($product_id);\n $product->sold_count = $product->sold_count + $count;\n $product->save();\n if ($order_items[$i]['option_id'] != 0) {\n $m_option = ProductMultiOption::find($order_items[$i]['option_id']);\n $m_option->update(['sold_count' => (int)$m_option->sold_count + $count]);\n }\n }\n }\n\n $order->update(['status' => (int)$status]);\n\n\n return redirect()->back();\n }",
"public function product_update_post()\n\t\t\t\t{\n\t\t\t\t}",
"protected function processOrder ($mProductId, $iKlarnaReference, $iTelNo) {\n // Here you should implement the functionality of how the product is managed.\n }",
"public function updateOrder(Request $request){\n $ids_product_to_delete = array();\n $order_details = OrderDetails::select('id')->where('order_id','=',$request->order_id)->get()->toArray();\n foreach($order_details as $value){\n array_push($ids_product_to_delete,$value);\n }\n DB::table('order_details')->whereIn('id', $ids_product_to_delete)->delete();\n\n // Insert lại product\n $arr_product_id = $request->product_id;\n $dataInsert = array();\n $order_total_price = 0;\n foreach($arr_product_id as $key => $value){\n $product = Product::select('price')->where('id',$key)->get()->toArray();\n $arrayPush = array('order_id'=> $request->order_id,'product_id'=> $key,'quantity' => $value,'price' => $product[0]['price'],'total_price'=>$product[0]['price'] * $value);\n array_push($dataInsert,$arrayPush);\n $order_total_price = $order_total_price + ($product[0]['price'] * $value);\n }\n DB::table('order_details')->insert($dataInsert); // Query Builder\n\n $order_update = Orders::find($request->order_id);\n $order_update->total_price = $order_total_price;\n $order_update->save();\n\n $user_current_login = Auth::user()->id;\n $orderProcessing = new OrderProcessing();\n $orderProcessing->order_id = $request->order_id;\n $orderProcessing->user_id = $user_current_login;\n $orderProcessing->status = 1;\n $orderProcessing->note = 'Cập nhật lại chi tiết đơn hàng';\n $orderProcessing->order_status = $request->order_status;\n $orderProcessing->save();\n\n return response()->json(['msg' => 'Cập nhật chi tiết đơn hàng thành công!']);\n }",
"public function updated(Product $producto)\n {\n\n }",
"public function change_order_product(Request $request)\n {\n $opid = $request->input('order_product_id');\n $order_product = OrderProduct::find($opid);\n $order_id = $order_product->order_id;\n $order = Order::find($order_id);\n\n $pid = $request->input('product_id');\n $delivery_type = $request->input('delivery_type');\n\n $count_per = $custom_date = null;\n if ($delivery_type == DeliveryType::DELIVERY_TYPE_EVERY_DAY || $delivery_type == DeliveryType::DELIVERY_TYPE_EACH_TWICE_DAY) {\n $count_per = $request->input('count_per');\n } else {\n $custom_date = $request->input('custom_date');\n $custom_date = rtrim($custom_date, ',');\n }\n\n //delete current order product and delivery plans for update\n MilkManDeliveryPlan::where('order_product_id', $opid)->where(function ($query) {\n $query->where('status', MilkManDeliveryPlan::MILKMAN_DELIVERY_PLAN_STATUS_PASSED);\n $query->orWhere('status', MilkManDeliveryPlan::MILKMAN_DELIVERY_PLAN_STATUS_WAITING);\n })->delete();\n\n\n $order_ctrl = new OrderCtrl;\n\n $plans = $order_product->delivery_plans_sent_to_production_plan;\n foreach ($plans as $plan) {\n $plan->changed_plan_count = 0;\n $plan->save();\n }\n\n //old data for new product\n $factory_id = $order->factory_id;\n $station_id = $order->station_id;\n $milkman_id = $order->milkman_id;\n $order_type = $order_product->order_type;\n $customer_id = $order->customer_id;\n $product_price = $order_ctrl->get_product_price_by_cid($pid, $order_type, $customer_id);\n\n\n $total_amount = $order_product->remain_amount;\n $total_count = floor($total_amount / $product_price);\n\n if ($order_type == OrderType::ORDER_TYPE_MONTH)\n $avg = round($total_count / 30, 1);\n else if ($order_type == OrderType::ORDER_TYPE_SEASON)\n $avg = round($total_count / 90, 1);\n else\n $avg = round($total_count / 180, 1);\n\n //update order product and delivery plan\n $order_product->product_id = $pid;\n $order_product->delivery_type = $delivery_type;\n $order_product->product_price = $product_price;\n $order_product->total_count = $total_count;\n $order_product->total_amount = $total_amount;\n $order_product->avg = $avg;\n $order_product->count_per_day = $count_per;\n $order_product->custom_order_dates = $custom_date;\n $order_product->save();\n\n $order_ctrl->establish_new_plan_with_money_amount($order_product, $factory_id, $station_id, $milkman_id, $total_amount);\n\n //order changed status as waiting\n $order->status = Order::ORDER_WAITING_STATUS;\n $order->save();\n\n return response()->json(['status' => 'success']);\n }",
"public function updateProduct(request $request)\n { \n $data = $request->all();\n if(!empty($data['store_id']))\n {\n $storeId = $data['store_id'];\n $item = (object)$data;\n $checkProduct = StoreProduct::where(['product_id' => $item->id,'store_id' => $storeId])->first();\n\n $productData = [\n \"product_id\" => $item->id,\n \"store_id\" => $storeId,\n \"title\" => $item->title,\n \"vendor\" => $item->vendor,\n \"product_type\" => $item->product_type,\n \"handle\" => $item->handle,\n \"tags\" => $item->tags,\n \"published_scope\" => $item->published_scope,\n ];\n if($checkProduct) \n {\n StoreProduct::where(['product_id'=>$item->id])->update($productData);\n $storeProductsId = $checkProduct->id;\n }\n else\n {\n $responseModel = StoreProduct::create($productData);\n $storeProductsId = $responseModel->id;\n } \n \n /*\n * Update product images\n */ \n foreach ($item->variants as $items) \n { \n $items = (object)$items;\n\n $poductVariantData = [ \n \"store_products_id\" => $storeProductsId,\n \"store_id\" => $storeId,\n \"variant_id\" => $items->id,\n \"product_id\" => $items->product_id,\n \"title\" => $items->title,\n \"price\" => $items->price,\n \"compare_at_price\" => $items->compare_at_price,\n \"sku\" => $items->sku,\n \"position\" => $items->position,\n \"fulfillment_service\" => $items->fulfillment_service,\n \"inventory_management\"=> $items->inventory_management,\n \"inventory_quantity\" => $items->inventory_quantity,\n \"option1\" => $items->option1,\n \"option2\" => $items->option2,\n \"option3\" => $items->option3,\n \"image_id\" => $items->image_id,\n ];\n\n $checkVariant = StoreProductVariants::where(['product_id' => $item->id,'variant_id' => $items->id])->first();\n\n if($checkProduct) \n {\n StoreProductVariants::where(['variant_id'=>$items->id])->update($poductVariantData);\n }\n else\n {\n StoreProductVariants::create($poductVariantData);\n } \n }\n\n /*\n * Update product images\n */ \n foreach ($item->images as $itemimg) \n { \n $itemimg = (object)$itemimg;\n $post_data_image = [\n \"store_products_id\" => $storeProductsId,\n \"store_id\" => $storeId,\n \"image_id\" => $itemimg->id,\n \"product_id\" => $itemimg->product_id,\n \"src\" => $itemimg->src,\n \"alt\" => $itemimg->alt,\n \"position\" => $itemimg->position,\n ];\n\n $checkVariant = StoreProductImages::where(['product_id' => $item->id,'image_id' => $items->id])->first();\n\n if($checkProduct) \n {\n StoreProductImages::where(['image_id'=>$items->id])->update($post_data_image);\n }\n else\n {\n StoreProductImages::create($post_data_image);\n } \n }\n return response()->json(['status' =>true, 'message' =>'Data import','data' =>\"got product\"]); \n }\n else\n {\n return response()->json(['status' =>true, 'message' =>'Data not found','data'=>[]]);\n }\n }",
"public function testUpdateOrder()\n {\n }",
"public function updateProductAdvance(Request $request){\n $productId = $request->productId;\n if (isset($productId)) {\n $product = Product::find($productId);\n $proSection = ProductSections::where('productId',$productId)->first();\n\n if ($request->section) {\n $section = implode(',', $request->section);\n $product->update( [\n 'productSection' => @$section,\n \n ]);\n }\n\n if (@$proSection->productId) {\n $productSection = ProductSections::find($proSection->id);\n\n if ($request->related_product) {\n $allproduct = implode(',', $request->related_product);\n $productSection->update( [\n 'related_product' => $allproduct,\n ]);\n }\n\n if ($request->customerGroupId != '') {\n $customerGroupId = implode(',', @$request->customerGroupId); \n }\n $productSection->update( [\n 'free_shipping' => $request->free_shipping,\n 'pre_order' => $request->pre_order,\n 'pre_orderDuration' => $request->pre_orderDuration, \n 'customerGroupId' => @$customerGroupId, \n 'customerGroupPrice' => @$request->customerGroupPrice, \n ]);\n \n if ($request->hotDeal && $request->hotDiscount && $request->hotDate) {\n $productSection->update( [\n 'hotDiscount' => $request->hotDiscount,\n 'hotDate' => $request->hotDate,\n /* 'specialDiscount' => '',\n 'specialDate' => '',*/\n ]);\n }else{\n $productSection->update( [\n 'hotDiscount' => '',\n 'hotDate' => '',\n \n ]);\n }\n\n if ($request->specialDeal && $request->specialDiscount && $request->specialDate) {\n $productSection->update( [\n /* 'hotDiscount' => '',\n 'hotDate' => '',*/\n 'specialDiscount' => $request->specialDiscount,\n 'specialDate' => $request->specialDate,\n\n ]);\n\n }else{\n $productSection->update( [\n 'specialDiscount' => '',\n 'specialDate' => '',\n\n ]);\n }\n\n $countGroup = count($request->customerGroupPrice);\n DB::table('customer_group_sections')->where('productId', $productId)->delete();\n if($request->customerGroupPrice){\n $postData = [];\n for ($i=0; $i <$countGroup ; $i++) { \n $postData[] = [\n 'productId' => $productId,\n 'customerGroupId' => $request->customerGroupId[$i], \n 'customerGroupPrice' => $request->customerGroupPrice[$i]\n ];\n }\n \n CustomerGroupSections::insert($postData);\n }\n\n return redirect(route('product.edit',$productId))->with('msg','Advance Information Save Successfully')->withInput();\n }else{\n if ($request->related_product) {\n $allproduct = implode(',', $request->related_product);\n }\n $productSections = ProductSections::create( [\n 'productId' => $productId,\n 'hotDiscount' => $request->hotDiscount,\n 'hotDate' => $request->hotDate,\n 'specialDiscount' => $request->specialDiscount,\n 'specialDate' => $request->specialDate,\n 'related_product' => @$allproduct,\n ]);\n \n return redirect(route('product.edit',$productId))->with('msg','Advance Information Save Successfully')->withInput();\n }\n }else{\n return redirect(route('product.edit',$productId))->with('error_msg','Please Complete Basic Information ')->withInput(); \n } \n }",
"private function attach_order($request,$client){\n $order=$client->orders()->create([]);\n $order->products()->attach($request->products);\n $total_price=0;\n foreach ($request->products as $id=>$quantity){\n $product=Product::findOrFail($id);\n $total_price+=$quantity['quantity'] * $product->sale_price;\n $product->update([\n 'stock'=>$product->stock - $quantity['quantity']\n ]);\n }\n\n $order->update([\n 'total_price'=>$total_price\n ]);\n\n }",
"public function getUpdateProductData();",
"public function updateProduct(Product $product);",
"public function editOrderAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n $order = $this->em->getRepository('AppBundle:Order')->find($id);\n $originalProducts = new ArrayCollection();\n\n // Create an ArrayCollection of the current Tag objects in the database\n foreach ($order->getProducts() as $product) {\n $originalProducts->add($product);\n }\n\n if ($this->request->isXmlHttpRequest() && $property = $this->request->query->get('property')) {\n $newValue = 'true' === strtolower($this->request->query->get('newValue'));\n $fieldsMetadata = $this->entity['list']['fields'];\n\n if (!isset($fieldsMetadata[$property]) || 'toggle' !== $fieldsMetadata[$property]['dataType']) {\n throw new \\RuntimeException(sprintf('The type of the \"%s\" property is not \"toggle\".', $property));\n }\n\n $this->updateEntityProperty($entity, $property, $newValue);\n\n return new Response((string) $newValue);\n }\n\n $fields = $this->entity['edit']['fields'];\n\n $editForm = $this->createEditForm($entity, $fields);\n $deleteForm = $this->createDeleteForm($this->entity['name'], $id);\n\n $editForm->handleRequest($this->request);\n if ($editForm->isValid()) {\n foreach ($originalProducts as $product) {\n if (false === $entity->getProducts()->contains($product)) {\n $product->setOrder(null);\n\n $this->em->persist($product);\n\n $this->em->remove($product);\n }\n }\n\n foreach ($entity->getProducts() as $product)\n {\n $product->setOrder($entity);\n }\n\n $this->em->persist($entity);\n $this->em->flush();\n\n $refererUrl = $this->request->query->get('referer', '');\n\n return !empty($refererUrl)\n ? $this->redirect(urldecode($refererUrl))\n : $this->redirect($this->generateUrl('easyadmin', array('action' => 'list', 'entity' => $this->entity['name'])));\n }\n\n return $this->render($this->entity['templates']['edit'], array(\n 'form' => $editForm->createView(),\n 'entity_fields' => $fields,\n 'entity' => $entity,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function updateItems($products)\n {\n }",
"public function updateProductListPivot()\n {\n $model = $this->productListable;\n $products = $model->products()->get('id');\n $this->products()->sync($products->pluck('id'));\n }",
"public function store(Request $request)\n {\n //Validate Data\n// $request->validate([\n// 'code' => 'required|string|max:255|unique:products,code,' . $product->id\n// ]);\n $products = json_decode($request->products, true);\n $customer_id = $request->customer_id;\n $user_id = $request->user_id;\n $total_new_price = $request->total_new_price;\n $customer_department = $request->department;\n\n $order = new Order();\n $order->user_id = $user_id;\n $order->customer_id = $customer_id;\n $order->code = 'HW' . strtoupper(Str::random(3)) . date(\"Ymd\");\n $order->total_price = $total_new_price;\n $order->customer_department = $customer_department;\n\n if ($order->save()) {\n $customer = Customer::find($customer_id);\n $product_ids = array_column($products, 'id');\n// $customer->products()->attach($product_ids, ['order_id' => $order->id]);\n $customer->products()->syncWithoutDetaching($product_ids);\n foreach ($products as $product) {\n $order_details = new OrderDetail();\n $order_details->order_id = $order->id;\n $order_details->product_id = $product['id'];\n $order_details->new_price = $product['new_price'];\n $order_details->save();\n }\n\n return response()->json([\n 'status' => 200,\n 'message' => 'Order created successfully!',\n 'order' => Order::with('orderdetails.product')->find($order->id),\n ], 200);\n }\n return response()->json([\n 'status' => 500,\n 'message' => 'Some error occurred. Please try again!',\n ], 500);\n }",
"public static function addProductsFromOrder($orderId = 0)\n\t{\n\t\t$orderId = (int)$orderId;\n\n\t\tif (Sale\\OrderProcessingTable::hasAddedProducts($orderId))\n\t\t\treturn;\n\n\t\t$connection = Main\\Application::getConnection();\n\t\t$type = $connection->getType();\n\n\t\t// Update existing\n\t\tif ($type == \"mysql\" && $connection->isTableExists('b_sale_order_product_stat'))\n\t\t{\n\t\t\t$sqlUpdate = \"\n\t\t\t\tINSERT INTO b_sale_order_product_stat (PRODUCT_ID, RELATED_PRODUCT_ID, ORDER_DATE) \n\t\t\t\tSELECT b.PRODUCT_ID, b1.PRODUCT_ID, DATE(b.DATE_INSERT)\n\t\t\t\tFROM b_sale_basket b, b_sale_basket b1\n\t\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\t\tb.ID <> b1.ID \n \t\t\t\tON DUPLICATE KEY UPDATE CNT = CNT + 1;\n\t\t\t\";\n\t\t\t$connection->query($sqlUpdate);\n\n\t\t\t$sqlUpdate = \"UPDATE b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1\n\t\t\t\tSET p2p.CNT = p2p.CNT + 1\n\t\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\t\tb.ID <> b1.ID AND\n\t\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\t\tp2p.PRODUCT_ID = b.PRODUCT_ID AND\n\t\t\t\t\tp2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID\";\n\t\t}\n\t\telseif ($type == \"mssql\")\n\t\t{\n\t\t\t$sqlUpdate = \"UPDATE b_sale_product2product\n\t\t\t\tSET CNT = CNT + 1\n\t\t\t\tFROM b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1\n\t\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\t\tb.ID <> b1.ID AND\n\t\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\t\tp2p.PRODUCT_ID = b.PRODUCT_ID AND\n\t\t\t\t\tp2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID\";\n\t\t}\n\t\telse // Oracle\n\t\t{\n\t\t\t$sqlUpdate = \"UPDATE b_sale_product2product\n\t\t\t\tSET CNT = CNT + 1\n\t\t\t\tWHERE ID IN (\n\t\t\t\t\tSELECT p2p.ID FROM b_sale_product2product p2p, b_sale_basket b, b_sale_basket b1\n\t\t\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\t\t\tb.ID <> b1.ID AND\n\t\t\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\t\t\tp2p.PRODUCT_ID = b.PRODUCT_ID AND\n\t\t\t\t\t\tp2p.PARENT_PRODUCT_ID = b1.PRODUCT_ID\n\t\t\t\t\t)\";\n\t\t}\n\n\t\t$connection->query($sqlUpdate);\n\n\t\t// Insert new\n\t\t$sqlInsert = \"INSERT INTO b_sale_product2product (PRODUCT_ID, PARENT_PRODUCT_ID, CNT)\n\t\t\tSELECT b.PRODUCT_ID, b1.PRODUCT_ID, 1\n\t\t\tFROM b_sale_basket b, b_sale_basket b1\n\t\t\tWHERE b.ORDER_ID = b1.ORDER_ID AND\n\t\t\t\tb.ORDER_ID = $orderId AND\n\t\t\t\tb.ID <> b1.ID AND\n\t\t\t\tNOT EXISTS (SELECT 1 FROM b_sale_product2product d WHERE d.PRODUCT_ID = b.PRODUCT_ID AND d.PARENT_PRODUCT_ID = b1.PRODUCT_ID)\";\n\n\t\t$connection->query($sqlInsert);\n\n\t\tSale\\OrderProcessingTable::markProductsAdded($orderId);\n\n\t\tif (defined(\"BX_COMP_MANAGED_CACHE\"))\n\t\t{\n\t\t\t$app = Main\\Application::getInstance();\n\t\t\t$app->getTaggedCache()->clearByTag('sale_product_buy');\n\t\t}\n\t}",
"public function update(Request $request, ProductOrder $productOrder)\n {\n //\n }",
"public function applyPromotion()\n {\n $this->promotion->setOrder($this);\n }",
"public function update(Request $request, tableHasProduct $tableHasProduct)\n {\n $tableHasProduct = tableHasProduct::find($request->table_product_id);\n $tableHasProduct->quantity = $request->quantity;\n $tableHasProduct->save();\n\n\n $tableOrderlimit = tableOrderLimit::where('table_id',$request->table_id)->first();\n\n if($request->request_for == 1){\n $totalOrderdItem = $tableOrderlimit->total_orderd + 1;\n $tableOrderlimit->total_orderd = $totalOrderdItem;\n $tableOrderlimit->save();\n } else{\n $totalOrderdItem = $tableOrderlimit->total_orderd - 1;\n $tableOrderlimit->total_orderd = $totalOrderdItem;\n $tableOrderlimit->save();\n }\n\n\n\n\n\n }",
"public function updateHandlingInfo($orderArticles)\n {\n $oProduct = new Product();\n foreach ($orderArticles as $article) { \n $aHandling = $oProduct->getHandlingInfo($article['articleID']);\n $this->updateOrderArticlesHandlingInfo($aHandling, $article['articleID']); \n }\n }",
"public function testUpdateProductUsingPOST()\n {\n }",
"public function orderNew($order_id) {\n\t\t \n\t $order_qry = $this->db->query(\"SELECT * FROM `\" . DB_PREFIX . \"order_product` WHERE `order_id` = '\" . (int)$order_id . \"'\");\n foreach ($order_qry->rows as $product){\n\t \n\t\t $product_id=$product['product_id'];\n\t\t \n\t\t $mercaInfo=$this->getMercadolivreIDs($product_id);\n\t\t if(!$mercaInfo) continue;\n\t\t\n\t\t $order_product_options = $this->db->query(\"SELECT * FROM `\" . DB_PREFIX . \"order_option` WHERE `order_product_id` = '\" . (int)$product['order_product_id'] . \"'\")->rows;\n\t\t \n\t\t $oc_options=array();\n\t\t if($order_product_options){\n\t\t\t foreach($order_product_options as $order_product_option){\n\t\t\t\t $oc_options[]=strtolower(trim($order_product_option['value'])); \n\t\t } \n\t\t }\n\t\t \n\t\t $oc_combinations=$this->getMLProductAttribute($product_id,'value');\n\t\t \n\t\t \n\t\t \n\t\t if($oc_combinations){\n\t\t\t $isFound=false;\n\t\t\t foreach($oc_combinations as $oc_combination){\n\t\n\t\t\t\t\tif(!array_diff($oc_combination['attributes'],$oc_options)){\n\t\t\t\t\t\t $this->db->query(\"UPDATE \" . DB_PREFIX . \"mercadolivre_attr_combination SET quantity=(quantity-\".(int)$product['quantity'].\") WHERE id='\".(int)$oc_combination['id'].\"'\");\n\t\t\t\t\t\t $isFound=true;\n\t\t\t\t\t}\n\t\t } \n\t\t\t \n\t\t\t if($isFound){ //if found, then update ML using API too\n\t\t\t\t $product_attributes=array();\n\t\t\t\t $combinations=$this->mercadolivre->getMLProductAttribute($product_id); //get updated combinations\n\t\t\t\t foreach($combinations as $index=>$combination){\n\t\t\t\t\t \n\t\t\t\t\t\t $product_attributes[]=array(\n\t\t\t\t\t\t\t 'id'=>(float)$combination['mercaId'],\n\t\t\t\t\t\t\t 'available_quantity'=>(int)$combination['quantity']\n\t\t\t\t\t\t\t ); \n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t\t$param=array();\n\t\t\t\t\t$param['variations']=$product_attributes;\n\t\t\t\t\t$this->mercadolivre->updateProduct($param,$mercaInfo['mercaId']);\n\t\t\t } \n \n\t\t } \n\t\t else {\n\t\t \n\t\t\t $quantity=$this->db->query(\"SELECT * FROM `\".DB_PREFIX.\"product` WHERE `product_id` = '\" . (int)$product_id . \"'\")->row['quantity'];\n\t\t\t $option='';\n\t\t\t if($mercaInfo){\n\t\t\t\t$this->mercadolivreStockUpdate($mercaInfo['mercaId'],$quantity);\n\t\t\t }\n\t\t }\n } // end of foreach \n\n }",
"public function processOrder($order)\r\n {\r\n // loop for every ordered product\r\n foreach ($order as $productId => $orderedQty) {\r\n // update inventory data\r\n $this->Inventory->deductStock($productId, $orderedQty);\r\n\r\n // update product sold data\r\n $this->ProductsSold->addProductSold($productId, $orderedQty);\r\n }\r\n }",
"public function edit(ProductOrder $productOrder)\n {\n //\n }",
"public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n// qq($params);\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $related_products = $this->getRequest()->getParam('related_products');\n $related_qty = $this->getRequest()->getParam('related_qty');\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n \n $in_cart = $cart->getQuoteProductIds();\n if($product->getTypeId() == 'cartproduct') {\n $cart_product_id = $product->getId();\n if(in_array($cart_product_id, $in_cart)) {\n $this->_goBack();\n return;\n }\n }\n\n if($params['qty']) $cart->addProduct($product, $params);\n \n if (!empty($related_qty)) {\n foreach($related_qty as $pid=>$qty){\n if(intval($qty)>0){\n $product = $this->_initProduct(intval($pid));\n $related_params['qty'] = $filter->filter($qty);\n if(isset($related_products[$pid])){\n if($product->getTypeId() == 'bundle') {\n $related_params['bundle_option'] = $related_products[$pid]['bundle_option'];\n// qq($related_params);\n// die('test');\n } else {\n $related_params['super_attribute'] = $related_products[$pid]['super_attribute'];\n }\n }\n $cart->addProduct($product, $related_params);\n }\n }\n }\n \n $collection = Mage::getModel('cartproducts/products')->getCollection()\n ->addAttributeToFilter('type_id', 'cartproduct')\n ->addAttributeToFilter('cartproducts_selected', 1)\n ;\n \n foreach($collection as $p)\n {\n $id = $p->getId();\n if(isset($in_cart[$id])) continue;\n \n $cart = Mage::getSingleton('checkout/cart');\n $quote_id = $cart->getQuote()->getId();\n \n if(Mage::getSingleton('core/session')->getData(\"cartproducts-$quote_id-$id\")) continue;\n \n $p->load($id);\n $cart->getQuote()->addProduct($p, 1);\n }\n \n if($cart->getQuote()->getShippingAddress()->getCountryId() == '') $cart->getQuote()->getShippingAddress()->setCountryId('US');\n $cart->getQuote()->setCollectShippingRates(true);\n $cart->getQuote()->getShippingAddress()->setShippingMethod('maxshipping_standard')->collectTotals()->save();\n \n $cart->save();\n \n Mage::getSingleton('checkout/session')->resetCheckout();\n\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError() && $params['qty'] ){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n $model->load(Yii::$app->request->post());\n\n $postQuantityArray = Yii::$app->request->post('quantity');\n\n if (Yii::$app->request->post('remove')) {\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => Yii::$app->request->post('remove')])->one();\n if ($deliveryToProduct) {\n $deliveryToProduct->delete();\n }\n }\n\n if (is_array($postQuantityArray)) {\n foreach ($postQuantityArray as $productId => $quantity) {\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => $productId])->one();\n if ($deliveryToProduct) {\n $deliveryToProduct->quantity = $quantity;\n $deliveryToProduct->save();\n }\n }\n }\n \n if ($model->save() && Yii::$app->request->post('save') === 'Y') {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n if (Yii::$app->request->post('add') === 'Y' && Yii::$app->request->post('addProduct')) {\n $model->save();\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => Yii::$app->request->post('addProduct')])->one();\n if (!$deliveryToProduct) {\n $quantity = $model->getOrderOne()->getOrderToProducts()->where(['product' => Yii::$app->request->post('addProduct')])->exists()? \n $model->getOrderOne()->getOrderToProducts()->where(['product' => Yii::$app->request->post('addProduct')])->one()->quantity: 0;\n \n $deliveryToProduct = new DeliveryToProduct();\n $deliveryToProduct->product = Yii::$app->request->post('addProduct');\n $deliveryToProduct->delivery = $model->id;\n $deliveryToProduct->quantity = $quantity;\n $deliveryToProduct->save();\n }\n }\n\n $productQuery = $model->getDeliveryToProducts();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $productQuery,\n 'sort' => false,\n ]); \n \n return $this->render('update', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function updating(Order $Order)\n {\n //code...\n }"
] |
[
"0.7064062",
"0.70476633",
"0.67988646",
"0.6771316",
"0.6736327",
"0.67164963",
"0.66836005",
"0.66606116",
"0.6640535",
"0.66018605",
"0.65782225",
"0.6566261",
"0.65057236",
"0.650476",
"0.6469635",
"0.6466975",
"0.64204353",
"0.64116687",
"0.6354348",
"0.6345624",
"0.6342097",
"0.63400215",
"0.6339285",
"0.63149124",
"0.63048166",
"0.6294547",
"0.62897116",
"0.62684494",
"0.62610817",
"0.62504435"
] |
0.77068734
|
0
|
method call when ajax request is made for search product to add to the order
|
public function ajaxProcessSearchProduct()
{
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function ajaxAddProduct()\n\t{\n\n\t\t$modelUserCart = $this->getModel('usercart');\n\n\t\t$userId = $this->_getUserId();\n\n\n\t\t$jinput = JFactory::getApplication()->input;\n\t\t$produktID = $jinput->get('produktID');\n\t\t$quantity = $jinput->get('quantity');\n\t\t$eigenschaft = $jinput->get('eigenschaft');\n\n\n\t\tif (!JSession::checkToken('get'))\n\t\t{\n\n\t\t\techo new JResponseJson(null, JText::_('JINVALID_TOKEN'), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$modelUserCart->storeValuesFromAjax($produktID,$userId ,$quantity, $eigenschaft);\n\t\t\t$modelUserCart->getUserCart($userId);\n\n\t\t\tparent::display();\n\t\t}\n\t}",
"public function add()\n {\n // get request\n $request = $this->getRequest()->request;\n // get product ID from request\n $product_id = $request['a'];\n // get product ids from session\n $compareProducts = $this->View()->getSession('compare')?$this->View()->getSession('compare'):array();\n\n if (!in_array($product_id, $compareProducts)) {\n $compareProducts[] = $product_id;\n }\n // set products to session\n $this->View()->setSession('compare', $compareProducts);\n\n // for ajax request\n if ($request['XHR']) {\n die(json_encode([\n 'success' => true,\n 'message' => $this->View()->translating('compare_item_set'),\n 'count' => count($compareProducts),\n ]));\n }\n\n Router::redirect('compare');\n }",
"protected function addProduct(){\n\t\t\tif(Request::ajax()){\n\t\t\t\t$product = Product::find(Input::get('sku'));\n\t\t\t\t\n\t\t\t\t$return = \"<tr id='$product->sku'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='supplier' value=\" . Input::get('supplier') . \"\n\t\t\t\t\t\t\t\t<td><input type='hidden' name='sku[]' value=\" . $product->sku . \"></input>\" . $product->sku . \"</td>\n\t\t\t\t\t\t\t\t<td>\". $product->name . \"</td>\n\t\t\t\t\t\t\t\t<td class='col-md-2'>\n\t\t\t\t\t\t\t\t\t<div class='input-group'>\n <input class='form-control' type='text' name='qty[]' value=\" . Input::get('qty') . \" required>\n <div class='input-group-addon'>Unit</div>\n </div>\n </td>\n <td class='col-md-1'>Rp\" . number_format($product->stock->buy_price, 2, ',', '.') . \"</td>\n <td class='col-md-2'>\n\t\t\t\t\t\t\t\t\t<div class='input-group'>\n\t\t\t\t\t\t\t\t\t\t<div class='input-group-addon'>Rp</div>\n <input class='form-control' placeholder='Harga Beli' type='text' name='price[]' value=\". $product->stock->buy_price . \" required>\n </div>\t\n </td> \n <td class='col-md-1'><a onclick=remove_product('$product->sku') class='btn btn-danger'><i class='fa fa-trash-o'></i>Hapus</a></td>\n\t\t\t\t\t\t\t</tr>\";\n\t\t\t\treturn $return;\n\t\t\t}\n\t\t}",
"public function astra_add_cart_single_product_ajax() {\n\t\t\tadd_action( 'wp_loaded', array( 'WC_Form_Handler', 'add_to_cart_action' ), 20 );\n\n\t\t\tif ( is_callable( array( 'WC_AJAX', 'get_refreshed_fragments' ) ) ) {\n\t\t\t\tWC_AJAX::get_refreshed_fragments();\n\t\t\t}\n\n\t\t\tdie();\n\t\t}",
"public function orderAjaxHandler(Request $request)\n {\n $method = $request->input('method');\n $response = new stdClass();\n $objProductModel = Products::getInstance();\n $objOptionVariant = ProductOptionVariants::getInstance();\n $objOrderModel = Orders::getInstance();\n $objModelOrders = Orders::getInstance();\n $objModelUsers = Orders::getInstance();\n if ($method != \"\") {\n switch ($method) {\n\n case 'insert-order':\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n if ($postData) {\n $userId = '';\n $mainCartData = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n\n if (isset($postData['mainCartData'])) {\n $mainCartData = $postData['mainCartData'];\n\n }\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $objOrderModel = Orders::getInstance();\n if (json_decode($mainCartData, true)) {\n foreach (json_decode($mainCartData, true) as $key => $val) {\n if (sizeof($val) > 0) {\n $product_id[$key] = $val['product_id'];\n } else {\n $quantity[$key] = $val['quantity'];\n $product_id[$key] = $val['product_id'];\n }\n }\n $like = implode(' OR ', array_map(function ($v) {\n return 'product_id LIKE \"%' . $v . '%\"';\n }, $product_id));\n $where = ['rawQuery' => 'for_user_id = ? AND (' . $like . ') AND order_status = \"P\"', 'bindParams' => [$userId]];\n $selectOrder = $objOrderModel->getcartOrder($where);\n if ($selectOrder) {\n $updatedData = [];\n $newData = [];\n $productIDs = [];\n foreach ($selectOrder as $orderKey => $orderVal) {\n\n $productIDs[] = $orderVal->product_id;\n $updatedData[] = current(array_values(array_filter(array_map(function ($v) use ($orderVal) {\n if (in_array($orderVal->product_id, $v) && in_array($orderVal->for_user_id, $v)) {\n $orderVal->quantity = $v['quantity'] + $orderVal->quantity;\n return $orderVal;\n }\n }, json_decode($mainCartData, true)))));\n\n }\n if (!empty($updatedData)) {\n $in = implode(',', array_values(array_filter(array_map(function ($v) {\n return $v->order_id;\n }, $updatedData))));\n $case = implode(' ', array_map(function ($v) {\n return ' WHEN ' . $v->order_id . ' THEN ' . $v->quantity;\n }, $updatedData));\n\n $whereUpdated = ['rawQuery' => 'order_id IN (' . $in . ')'];\n $updatedResult = $objOrderModel->updateToOrder(['quantity' => DB::raw(\"(CASE order_id $case END)\")], $whereUpdated);\n\n }\n $productIDs = array_unique($productIDs);\n $newData = array_values(array_filter(array_map(function ($cv) use ($productIDs) {\n if (!in_array($cv['product_id'], $productIDs))\n return $cv;\n }, json_decode($mainCartData, true))));\n if (!empty($newData)) {\n $insertOrder = $objOrderModel->insertToOrder($newData);\n }\n if ((isset($insertOrder) && $insertOrder != '') || (isset($updatedResult) && $updatedResult != '')) {\n $response->code = 200;\n $response->message = isset($insertOrder) ? 'Added to cart' : 'Updated to cart';\n $response->data = null;\n\n } else {\n $response->code = 400;\n $response->message = \"Nothing Cart details.\";\n $response->data = null;\n }\n } else if (empty($selectOrder)) {\n $insertOrder = $objOrderModel->insertToOrder(json_decode($mainCartData, true));\n if ($insertOrder) {\n $response->code = 200;\n $response->message = \"Success\";\n $response->data = $insertOrder;\n } else {\n $response->code = 400;\n $response->message = \"No user Details found.\";\n $response->data = null;\n }\n }\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n case 'getCartCount': // TODO : This method is not to be used //\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n if ($postData) {\n $userId = '';\n $mainCartData = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n\n if (isset($postData['mainCartData'])) {\n $mainCartData = $postData['mainCartData'];\n\n }\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $objOrderModel = Orders::getInstance();\n $where = ['rawQuery' => 'for_user_id = ?', 'bindParams' => [$userId]];\n $cartCount = $objOrderModel->getcartOrder($where);\n if (isset($cartCount)) {\n $response->code = 200;\n $response->message = \"Success\";\n $response->data = count($cartCount);\n } else {\n $response->code = 400;\n $response->message = \"No Details found.\";\n $response->data = null;\n\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n case 'user-cart-details':\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n if ($postData) {\n $userId = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $objOrderModel = Orders::getInstance();\n $whereUserId = ['rawQuery' => 'orders.for_user_id = ? AND orders.order_status = \"P\" AND\n (product_option_variants_combination.variant_ids LIKE CONCAT(\"%\",REPLACE(SUBSTRING_INDEX(orders.product_id,\"-\",-1),\",\",\"_\"),\"%\")\n or product_option_variants_combination.variant_ids LIKE CONCAT(\"%\",REVERSE(REPLACE(SUBSTRING_INDEX(orders.product_id,\"-\",-1),\",\",\"_\")),\"%\"))',\n 'bindParams' => [$userId]];\n $selectColumn = [\n DB::raw(\"SUBSTRING_INDEX(orders.product_id,'-',1) as pid ,REPLACE(SUBSTRING_INDEX(orders.product_id,'-',-1),',','_') cid \"),\n// 'product_images.*',//todo remove comment and check functionality again\n 'products.product_name',\n 'products.price_total',\n 'products.in_stock',\n 'orders.quantity',\n 'orders.order_id',\n 'product_option_variant_relation.*',\n 'productmeta.quantity_discount',\n 'users.email', 'users.name', 'users.last_name', 'users.username', 'users.role',\n DB::raw('GROUP_CONCAT(product_option_variant_relation.variant_data SEPARATOR \"____\") AS variant_datas')\n\n ];\n $cartProductDetails = json_decode($objOrderModel->getCartProductDetails($whereUserId, $selectColumn), true);\n// dd($cartProductDetails);\n $combineVarian = [];\n $finalCartProductDetails = [];\n $subTotal = '';\n if ($cartProductDetails['code'] == 200) {\n foreach (json_decode(json_encode($cartProductDetails['data']), false) as $cartkey => $cartVal) {\n if ($cartVal->in_stock >= $cartVal->quantity) {\n $variantData = explode(\"____\", $cartVal->variant_datas);\n $varian = array_flatten(array_map(function ($v) {\n return json_decode($v);\n }, $variantData));\n\n $finalPrice = $cartVal->price_total;\n $combineVarian[] = array_values(array_filter(array_map(function ($v) use ($varian, &$finalPrice) {\n return current(array_filter(array_map(function ($value) use ($v, &$finalPrice) {\n if ($v == $value->VID) {\n $finalPrice = $finalPrice + $value->PM;\n return [$v => $value->PM];\n }\n }, $varian)));\n }, explode(\"_\", $cartVal->cid))));\n $cartVal->finalPrice = $finalPrice * $cartVal->quantity;\n\n $discountedValue = 0;\n $qtyValue = null;\n if ($cartVal->quantity_discount != '') {\n $quantityDiscount = object_to_array(json_decode($cartVal->quantity_discount));\n $quantities = array_column($quantityDiscount, 'quantity');\n\n $quantity = $cartVal->quantity;\n $tmpQTY = array_filter(array_map(function ($v) use ($quantity) {\n if ($quantity >= $v) return $v;\n }, $quantities));\n sort($tmpQTY);\n $finalQTY = end($tmpQTY);\n\n $qtyValue = current(array_values(array_filter(array_map(function ($v) use ($finalQTY) {\n if ($v['quantity'] == $finalQTY) return $v;\n }, $quantityDiscount))));\n\n $discountedValue = ($qtyValue['type'] == 1) ? $qtyValue['value'] : ($cartVal->finalPrice * $qtyValue['value'] / 100);\n $discountedPrice = $cartVal->finalPrice - $discountedValue;\n\n\n if ($discountedPrice <= 0) {\n $error[] = 'Discount not allowed';\n }\n $cartVal->discountedPrice = $discountedPrice;\n }\n\n $cartVal->shipingPrice = 9; // TODO : NEED TO GET CONFIRMATION FOR SHIPPING DETAILS//\n\n $finalCartProductDetails[] = $cartVal;\n $subTotal = $subTotal + (isset($cartVal->discountedPrice) ? $cartVal->discountedPrice : $cartVal->finalPrice);\n\n } else {\n $error[] = 'Selected quantity should be greater than In-Stock';\n }\n }\n if ($subTotal != '' && !empty($finalCartProductDetails)) {\n $finalCartProductDetails[0]->subtotal = $subTotal;\n }\n $finalCartProductDetails[0]->cartcount = count($finalCartProductDetails);\n }\n if (isset($finalCartProductDetails)) {\n $response->code = 200;\n $response->message = \"Success\";\n $response->data = $finalCartProductDetails;\n } else {\n $response->code = 400;\n $response->message = \"No Details found.\";\n $response->data = null;\n\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n case 'remove-cart-detail':\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n if ($postData) {\n $userId = '';\n $mainCartData = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $objOrderModel = Orders::getInstance();\n $whereCart = ['rawQuery' => 'order_id = ? AND for_user_id = ?', 'bindParams' => [$postData['order_id'], $userId]];\n $cartData = $objOrderModel->deleteCartOrder($whereCart);\n if (isset($cartData)) {\n $response->code = 200;\n $response->message = \"Success\";\n $response->data = $cartData;\n } else {\n $response->code = 400;\n $response->message = \"No Details found.\";\n $response->data = null;\n\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n case 'payment-product-detail':\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n $error = [];\n if ($postData) {\n $userId = '';\n $mainCartData = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n if (isset($postData['productId'])) {\n $productId = $postData['productId'];\n }\n if (isset($postData['selectedVariantId'])) {\n $selectedVariantId = $postData['selectedVariantId'];\n }\n if (isset($postData['quantityId'])) {\n $quantityId = $postData['quantityId'];\n }\n\n\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $and = (count(explode('_', $selectedVariantId)) > 1 ?\n 'product_option_variants_combination.variant_ids IN(\"' . $selectedVariantId . '\",\"' . strrev($selectedVariantId) . '\")' :\n \"product_option_variants.variant_id =\" . $selectedVariantId);\n\n// $where = ['rawQuery' => 'product_option_variants_combination.product_id = ? AND product_option_variants_combination.variant_ids IN(\"' . $selectedCombination . '\",\"' . strrev($selectedCombination) . '\")', 'bindParams' => [$productId]];\n $where = ['rawQuery' => 'product_option_variants_combination.product_id = ? AND ' . $and, 'bindParams' => [$productId]];\n\n $selectedColumn = ['products.*',\n 'productmeta.quantity_discount',\n 'users.email', 'users.name', 'users.last_name', 'users.username', 'users.role',\n// 'usermeta.addressline1','usermeta.addressline2','usermeta.zipcode',\n 'product_option_variants.*',\n 'product_images.*',\n 'product_option_variants_combination.*',\n 'product_option_variant_relation.*',\n DB::raw('GROUP_CONCAT(\n CASE\n WHEN ((SELECT COUNT(pi_id) FROM product_images WHERE product_images.for_combination_id !=\"0\")!=0)\n THEN\n CASE\n WHEN (product_images.image_type =1 AND (product_images.for_combination_id!=0 OR product_images.for_combination_id!=\"\"))\n THEN product_images.image_type\n END\n ELSE product_images.image_type\n END) AS image_types'),\n DB::raw('GROUP_CONCAT(DISTINCT\n CASE\n WHEN ((SELECT COUNT(pi_id) FROM product_images WHERE product_images.for_combination_id !=\"0\")!=0)\n THEN\n CASE\n WHEN (product_images.image_type =1 AND (product_images.for_combination_id!=0 OR product_images.for_combination_id!=\"\"))\n THEN product_images.image_url\n END\n ELSE product_images.image_url\n END) AS image_urls'),\n\n DB::raw('GROUP_CONCAT(DISTINCT product_option_variants_combination.variant_ids) AS variant_ids_combination'),\n DB::raw('GROUP_CONCAT(DISTINCT product_option_variant_relation.variant_ids) AS variant_id'),\n DB::raw('GROUP_CONCAT(DISTINCT product_option_variant_relation.variant_data SEPARATOR \"____\") AS variant_datas')\n\n ];\n $optionVariantDetailsForPopUp = $objOptionVariant->getOptionVariantDetailsForPopup($where, $selectedColumn);\n if ($optionVariantDetailsForPopUp->in_stock >= $quantityId) {\n if (isset($optionVariantDetailsForPopUp->variant_ids_combination) && $optionVariantDetailsForPopUp->variant_ids_combination != '') {\n $variantData = explode(\"____\", $optionVariantDetailsForPopUp->variant_datas);\n $varian = array_flatten(array_map(function ($v) {\n return json_decode($v);\n }, $variantData));\n\n }\n $finalPrice = $optionVariantDetailsForPopUp->price_total;\n $combineVarian = array_values(array_filter(array_map(function ($v) use ($varian, &$finalPrice) {\n return current(array_filter(array_map(function ($value) use ($v, &$finalPrice) {\n if ($v == $value->VID) {\n $finalPrice = $finalPrice + $value->PM;\n return [$v => $value->PM];\n }\n }, $varian)));\n }, explode(\"_\", $optionVariantDetailsForPopUp->variant_ids_combination))));\n $optionVariantDetailsForPopUp->finalPrice = $finalPrice * $quantityId;\n\n $discountedValue = 0;\n $qtyValue = null;\n if ($optionVariantDetailsForPopUp->quantity_discount != '') {\n// $quantityId = 8;\n $quantityDiscount = object_to_array(json_decode($optionVariantDetailsForPopUp->quantity_discount));\n $quantities = array_column($quantityDiscount, 'quantity');\n\n// $quantities = [3, 2, 8, 10, 6, 25];\n $tmpQTY = array_filter(array_map(function ($v) use ($quantityId) {\n if ($quantityId >= $v) return $v;\n }, $quantities));\n sort($tmpQTY);\n $finalQTY = end($tmpQTY);\n\n $qtyValue = current(array_values(array_filter(array_map(function ($v) use ($finalQTY) {\n if ($v['quantity'] == $finalQTY) return $v;\n }, $quantityDiscount))));\n\n $discountedValue = ($qtyValue['type'] == 1) ? $qtyValue['value'] : ($optionVariantDetailsForPopUp->finalPrice * $qtyValue['value'] / 100);\n $discountedPrice = $optionVariantDetailsForPopUp->finalPrice - $discountedValue;\n\n\n if ($discountedPrice <= 0) {\n $error[] = 'Discount not allowed';\n }\n $optionVariantDetailsForPopUp->discountedPrice = $discountedPrice;\n\n// echo $optionVariantDetailsForPopUp->finalPrice . '<br>';\n// echo $discountedPrice . '<br>';\n// echo '<pre>';\n// print_r($qtyValue);\n// print_a($tmpQTY);\n// print_a(array_column(object_to_array($quantityDiscount), 'quantity'));\n }\n $role = ['0' => 0, '1' => 5, '2' => 3];\n $data = array(\n 'for_user_id' => $userId,\n 'order_type' => 'P',\n 'product_id' => $productId,\n 'product_details' => json_encode(['product_name' => $optionVariantDetailsForPopUp->product_name, 'image_url' => $optionVariantDetailsForPopUp->image_url]),\n 'unit_price' => $optionVariantDetailsForPopUp->price_total,\n 'quantity' => $quantityId,\n 'discount_by' => array_search($optionVariantDetailsForPopUp->role, $role),\n 'discount_type' => (isset($qtyValue['type']) && $qtyValue['type'] == 1) ? 'A' : 'P',\n 'discount_value' => $discountedValue,\n 'final_price' => (isset($optionVariantDetailsForPopUp->discountedPrice) && $optionVariantDetailsForPopUp->discountedPrice != 0) ? $optionVariantDetailsForPopUp->discountedPrice : $optionVariantDetailsForPopUp->finalPrice,\n 'order_status' => 'P',\n 'created_at' => date(\"Y-m-d H:i:s\", time())\n );\n\n// print_a($data);\n } else {\n $error[] = 'Selected quantity should be greater than In-Stock';\n }\n\n if (empty($error) && !empty($data)) {\n $orderVal = $objOrderModel->insertToOrder($data);\n if ($orderVal) {\n $response->code = 200;\n $response->message = \"SUCCESS\";\n $response->data = $orderVal;\n }\n } else {\n $response->code = 198;\n $response->message = \"ERROR\";\n $response->data = $error;\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n\n //Akash M. Pai\n case \"orderHistory\"://TODO order history with pagination here\n $postData = $request->all();\n $userId = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n if ($userId != '') {\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n } else {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objModelUsers->getUsercredsWhere($whereForloginToken);\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n // NORMAL DATATABLE STARTS HERE//\n $whereForOrders = ['rawQuery' => 'order_status != ? and for_user_id = ?', 'bindParams' => ['P', $userId]];\n// $selectedColumn = ['transactions.*'];//, 'orders.order_status', 'orders.order_id'\n $allOrdersData = json_decode($objModelOrders->getAllOrdersWhere($whereForOrders), true);\n //NORMAL DATATABLE ENDS//\n\n // FILTERING STARTS FROM HERE//\n $filteringQuery = '';\n $filteringBindParams = array();\n if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'filter' && $_REQUEST['action'][0] != 'filter_cancel') {//TODO filtering in orders not done on UI\n if ($_REQUEST['order_id'] != '') {\n $filteringQuery[] = \"(`orders`.`order_id` = ?)\";\n array_push($filteringBindParams, $_REQUEST['order_id']);\n }\n if ($_REQUEST['date_from'] != '' && $_REQUEST['date_to'] != '') {\n $filteringQuery[] = \"(`order`.`added_date` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, strtotime(str_replace('-', ' ', $_REQUEST['date_from'])));\n array_push($filteringBindParams, strtotime(str_replace('-', ' ', $_REQUEST['date_to'])));\n } else if ($_REQUEST['date_from'] != '' && $_REQUEST['date_to'] == '') {\n $filteringQuery[] = \"(`order`.`added_date` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, strtotime(str_replace('-', ' ', $_REQUEST['date_from'])));//TODO check date fromat from view and in db\n array_push($filteringBindParams, strtotime(time()));\n } else if ($_REQUEST['date_from'] == '' && $_REQUEST['date_to'] != '') {\n $filteringQuery[] = \"(`order`.`added_date` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, strtotime(1000000000));\n array_push($filteringBindParams, strtotime(str_replace('-', ' ', $_REQUEST['date_to'])));\n }\n if ($_REQUEST['price_from'] != '' && $_REQUEST['price_to'] != '') {\n $filteringQuery[] = \"(`order`.`final_price` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, intval($_REQUEST['price_from']));\n array_push($filteringBindParams, intval($_REQUEST['price_to']));\n } else if ($_REQUEST['price_from'] != '' && $_REQUEST['price_to'] == '') {\n $filteringQuery[] = \"(`order`.`final_price` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, intval($_REQUEST['price_from']));\n array_push($filteringBindParams, intval(100000000));\n } else if ($_REQUEST['price_from'] == '' && $_REQUEST['price_to'] != '') {\n $filteringQuery[] = \"(`order`.`final_price` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, intval(100000000));\n array_push($filteringBindParams, intval($_REQUEST['price_to']));\n }\n // Filter Implode //\n $implodedWhere = ['whereRaw' => 1];\n if (!empty($filteringQuery)) {\n $implodedWhere['whereRaw'] = implode(' AND ', array_map(function ($filterValues) {\n return $filterValues;\n }, $filteringQuery));\n $implodedWhere['bindParams'] = $filteringBindParams;\n }\n $iTotalRecords = $iDisplayLength = intval($_REQUEST['length']);\n $iDisplayLength = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength;\n $iDisplayStart = intval($_REQUEST['start']);\n $sEcho = intval($_REQUEST['draw']);\n $columns = array('orders.order_id');//, 'orders.added_date', 'orders.order_type', 'orders.final_price', 'orders.order_status'\n $sortingOrder = \"\";\n if (isset($_REQUEST['order'])) {\n $sortingOrder = $columns[$_REQUEST['order'][0]['column']];\n }\n if ($implodedWhere['whereRaw'] != 1) {\n// $whereForOrders = ['rawQuery' => 'order_status != ?', 'bindParams' => ['OP']];\n $selectedColumn = ['*'];\n $allOrdersData = json_decode($objModelOrders->getAllOrdersWhereWithLimit($whereForOrders, $implodedWhere, $sortingOrder, $iDisplayLength, $iDisplayStart, $selectedColumn), true);\n }\n }\n // FILTERING ENDS//\n\n $returnObj = [\n 'data' => $allOrdersData['data'],\n 'message' => \"My orders\",\n 'code' => $allOrdersData['code']\n ];\n $returnCode = 200;\n } else {\n $returnObj = [\n 'data' => null,\n 'message' => \"Access Denied\",\n 'code' => 401\n ];\n $returnCode = 401;\n }\n\n echo json_encode($returnObj, true);\n break;\n\n default:\n break;\n\n }\n }\n }",
"public function actionAddProductList()\n {\n\n $order_id = Yii::app()->request->getQuery('id');\n $model = $this->_loadModel($order_id);\n if ($order_id) {\n if (!Yii::app()->request->isAjaxRequest) {\n $this->redirect(array('/admin/cart/default/update', 'id' => $order_id));\n }\n }\n if (!Yii::app()->request->isAjaxRequest) {\n $this->redirect(array('/admin/cart/default/index'));\n }\n\n $dataProvider = new ShopProduct('search');\n\n if (isset($_GET['ShopProduct']))\n $dataProvider->attributes = $_GET['ShopProduct'];\n\n $this->renderPartial('_addProduct', array(\n 'dataProvider' => $dataProvider,\n 'order_id' => $order_id,\n 'model' => $model,\n ));\n }",
"public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n// qq($params);\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $related_products = $this->getRequest()->getParam('related_products');\n $related_qty = $this->getRequest()->getParam('related_qty');\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n \n $in_cart = $cart->getQuoteProductIds();\n if($product->getTypeId() == 'cartproduct') {\n $cart_product_id = $product->getId();\n if(in_array($cart_product_id, $in_cart)) {\n $this->_goBack();\n return;\n }\n }\n\n if($params['qty']) $cart->addProduct($product, $params);\n \n if (!empty($related_qty)) {\n foreach($related_qty as $pid=>$qty){\n if(intval($qty)>0){\n $product = $this->_initProduct(intval($pid));\n $related_params['qty'] = $filter->filter($qty);\n if(isset($related_products[$pid])){\n if($product->getTypeId() == 'bundle') {\n $related_params['bundle_option'] = $related_products[$pid]['bundle_option'];\n// qq($related_params);\n// die('test');\n } else {\n $related_params['super_attribute'] = $related_products[$pid]['super_attribute'];\n }\n }\n $cart->addProduct($product, $related_params);\n }\n }\n }\n \n $collection = Mage::getModel('cartproducts/products')->getCollection()\n ->addAttributeToFilter('type_id', 'cartproduct')\n ->addAttributeToFilter('cartproducts_selected', 1)\n ;\n \n foreach($collection as $p)\n {\n $id = $p->getId();\n if(isset($in_cart[$id])) continue;\n \n $cart = Mage::getSingleton('checkout/cart');\n $quote_id = $cart->getQuote()->getId();\n \n if(Mage::getSingleton('core/session')->getData(\"cartproducts-$quote_id-$id\")) continue;\n \n $p->load($id);\n $cart->getQuote()->addProduct($p, 1);\n }\n \n if($cart->getQuote()->getShippingAddress()->getCountryId() == '') $cart->getQuote()->getShippingAddress()->setCountryId('US');\n $cart->getQuote()->setCollectShippingRates(true);\n $cart->getQuote()->getShippingAddress()->setShippingMethod('maxshipping_standard')->collectTotals()->save();\n \n $cart->save();\n \n Mage::getSingleton('checkout/session')->resetCheckout();\n\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError() && $params['qty'] ){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }",
"public function execute() {\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $data = $this->getRequest()->getParams();\n\n $cart = $objectManager->get('Magento\\Checkout\\Model\\Cart');\n $productRepository = $objectManager->get('Magento\\Catalog\\Model\\ProductRepository');\n\n $product = $productRepository->getById( $data[ 'product' ] );\n $options = [ 'qty'=>1, 'super_attribute'=>[ trim($data['superattribute']) => intval($data['attribute']) ] ];\n\n $cart->addProduct( $product, $options );\n $cart->save();\n\n echo json_encode(['response'=>true]);\n }",
"public function search_event_ajax(&$route, &$data) {\r\n\r\n $this->load->model('setting/setting');\r\n $status = $this->model_setting_setting->getSettingValue('module_search_plus_status');\r\n if ((int) $status == 0): // search is disabled so do nothing and return\r\n return null;\r\n endif;\r\n\r\n $this->load->model($this->module_path);\r\n $this->load->model('tool/image');\r\n $this->load->language('product/search');\r\n\r\n $this->module_search = $this->{$this->model};\r\n\r\n $params = $this->request->get;\r\n $params['auto_complete'] = 1;\r\n $params['return_filters'] = 1;\r\n\r\n $searchParams = $this->module_search->processParams($params);\r\n //\t$searchParams['auto_complete'] = true;\r\n $searchParams['filter_include'] = ['category_0','manufacturer'];\r\n\r\n $results = $this->module_search->findProducts($searchParams);\r\n\r\n $this->load->model('catalog/product');\r\n\r\n foreach ($results['hits'] as $productId):\r\n $result = $this->model_catalog_product->getProduct($productId);\r\n if ($result['image']) {\r\n $image = $this->model_tool_image->resize($result['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height'));\r\n } else {\r\n $image = $this->model_tool_image->resize('placeholder.png', $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_product_height'));\r\n }\r\n\r\n // $swapimage = false;\r\n\r\n $price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);\r\n\r\n if ((float) $result['special']) {\r\n $special = $this->currency->format($this->tax->calculate($result['special'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);\r\n } else {\r\n $special = false;\r\n }\r\n\r\n if ($this->config->get('config_tax')) {\r\n $tax = $this->currency->format((float) $result['special'] ? $result['special'] : $result['price'], $this->session->data['currency']);\r\n } else {\r\n $tax = false;\r\n }\r\n\r\n $rating = false;\r\n // $out_of_stock_badge = $result['quantity'] <= 0 ? $result['stock_status'] : 1;\r\n\r\n $data['products'][] = array(\r\n 'product_id' => $result['product_id'],\r\n 'thumb' => $image,\r\n 'name' => $result['name'],\r\n 'price' => $price,\r\n 'special' => $special,\r\n 'href' => $this->url->link('product/product', 'product_id=' . $result['product_id'] . $url),\r\n );\r\n\r\n endforeach;\r\n\r\n $data['url_all'] = $this->url->link('product/search', 'search=' . $searchParams['search']);\r\n\r\n // get terms\r\n /**\r\n * Get the global filters\r\n */\r\n $data['categories'] = [];\r\n\r\n foreach($results['filters']['category_0']['buckets'] as $bucket):\r\n $data['categories'][] = [\r\n 'name' => $bucket['display'],\r\n 'count' => $bucket['doc_count'],\r\n 'link' => $this->url->link('product/search','search='.$params['search'].'&category_id='.( (int) $bucket['key'] )),\r\n ];\r\n endforeach;\r\n\r\n $data['brands'] = [];\r\n\r\n foreach($results['filters']['manufacturer']['buckets'] as $bucket):\r\n $data['brands'][] = [\r\n 'name' => $bucket['display'],\r\n 'count' => $bucket['doc_count'],\r\n 'link' => $this->url->link('product/search','search='.$params['search'].'&manufacturer_id='.( (int) $bucket['key'] )),\r\n ];\r\n endforeach;\r\n\r\n $data['popular_searches'] = $this->module_search->findPopularSearches($searchParams);\r\n\r\n foreach ($data['popular_searches'] as &$term):\r\n\r\n $term['url'] = $this->url->link('product/search', 'search=' . $term['keyword'].'&popular=1');\r\n\r\n endforeach;\r\n echo json_encode( $data );\r\n return '';\r\n }",
"public function getOrder()\n {\n echo json_encode($this->Inventory_model->getProductById($_POST['idJson']));\n }",
"public function searchprocessAction() {\n\t\t$this->_helper->ajaxgrid->setConfig ( ProductsAttributes::grid() )->search ();\n\t}",
"public function actionAddProduct()\n {\n if (Yii::app()->request->isPostRequest) {\n if (Yii::app()->request->isAjaxRequest) {\n $order = $this->_loadModel($_POST['order_id']);\n $product = ShopProduct::model()->findByPk($_POST['product_id']);\n\n $find = OrderProduct::model()->findByAttributes(array('order_id' => $order->id, 'product_id' => $product->id));\n\n if ($find) {\n if (Yii::app()->request->isAjaxRequest) {\n $this->setJson(array(\n 'success' => false,\n 'message' => Yii::t('CartModule.admin', 'ERR_ORDER_PRODUCT_EXISTS'),\n ));\n } else {\n throw new CHttpException(400, Yii::t('CartModule.admin', 'ERR_ORDER_PRODUCT_EXISTS'));\n }\n }\n if (!$product) {\n if (Yii::app()->request->isAjaxRequest) {\n $this->setJson(array(\n 'success' => false,\n 'message' => Yii::t('CartModule.default', 'ERROR_PRODUCT_NO_FIND'),\n ));\n } else {\n throw new CHttpException(404, Yii::t('CartModule.default', 'ERROR_PRODUCT_NO_FIND'));\n }\n }\n\n $order->addProduct($product, $_POST['quantity'], $_POST['price']);\n $this->setJson(array(\n 'success' => true,\n 'message' => Yii::t('CartModule.admin', 'SUCCESS_ADD_PRODUCT_ORDER'),\n ));\n } else {\n throw new CHttpException(500, Yii::t('error', '500'));\n }\n } else {\n throw new CHttpException(500, Yii::t('error', '500'));\n }\n }",
"public function ajax_add_to_cart()\n {\n global $woocommerce;\n\n $id = (int) sanitize_text_field($_POST['id']);\n\n if($woocommerce->cart->add_to_cart($id)) {\n $result['type'] = 'success';\n $result['miniCart'] = self::get_cart_nav_menu_total();\n $result['cart'] = do_shortcode('[woocommerce_cart]');\n $result['isEmpty'] = false;\n\n if(0 == $woocommerce->cart->cart_contents_count) {\n $result['isEmpty'] = true;\n }\n } else {\n $result['type'] = 'error';\n }\n\n $result = json_encode($result, JSON_PRETTY_PRINT);\n\n echo $result;\n\n wp_die();\n }",
"public function ajaxProcessGetAutocompleteProducts()\n {\n $query = Tools::getValue('q', false);\n if (!$query or $query === '' || strlen($query) < 2) {\n die();\n }\n\n $sql = 'SELECT p.`id_product`, p.`reference`, pl.`name`\n\t\tFROM `'._DB_PREFIX_.'product` p\n\t\t'.Shop::addSqlAssociation('product', 'p').'\n\t\tLEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product \n\t\t AND pl.id_lang = '.(int)$this->context->language->id.\n Shop::addSqlRestrictionOnLang('pl').'\n )\n WHERE pl.`name` LIKE \"%'.pSQL($query).'%\" \n OR p.`reference` LIKE \"%'.pSQL($query).'%\" \n OR p.`id_product` LIKE \"%'.pSQL($query).'%\"\n\t\tGROUP BY p.id_product';\n\n $products = Db::getInstance()->executeS($sql);\n\n $results = array();\n foreach ($products as $product) {\n $results[] = '['.$product['reference'].'] '.$product['name'].'|'.$product['id_product'];\n }\n\n /**\n * Result:\n *\n * Product|ID\n * Next Product|ID\n * ...\n */\n die(implode(PHP_EOL, $results));\n }",
"public function ajaxProcessSearchCustomers()\n {\n }",
"public function addAction() {\r\n $cart = $this->_getCart();\r\n $params = $this->getRequest()->getParams();\r\n try {\r\n if (isset($params['qty'])) {\r\n $filter = new Zend_Filter_LocalizedToNormalized(\r\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\r\n );\r\n $params['qty'] = $filter->filter($params['qty']);\r\n }\r\n\r\n $product = $this->_initProduct();\r\n $related = $this->getRequest()->getParam('related_product');\r\n\r\n /**\r\n * Check product availability\r\n */\r\n if (!$product) {\r\n $this->_goBack();\r\n return;\r\n }\r\n\r\n $cart->addProduct($product, $params);\r\n if (!empty($related)) {\r\n $cart->addProductsByIds(explode(',', $related));\r\n }\r\n\r\n $cart->save();\r\n\r\n $this->_getSession()->setCartWasUpdated(true);\r\n\r\n /**\r\n * @todo remove wishlist observer processAddToCart\r\n */\r\n $this->getLayout()->getUpdate()->addHandle('ajaxcart');\r\n $this->loadLayout();\r\n\r\n Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\r\n );\r\n\r\n if (!$this->_getSession()->getNoCartRedirect(true)) {\r\n if (!$cart->getQuote()->getHasError()) {\r\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));\r\n $this->_getSession()->addSuccess($message);\r\n }\r\n $this->_goBack();\r\n }\r\n } catch (Mage_Core_Exception $e) {\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n\r\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\r\n $json_messages = array();\r\n foreach ($messages as $message) {\r\n $json_messages[] = Mage::helper('core')->escapeHtml($message);\r\n }\r\n\r\n $_response->setMessages($json_messages);\r\n\r\n $url = $this->_getSession()->getRedirectUrl(true);\r\n\r\n $_response->send();\r\n } catch (Exception $e) {\r\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\r\n Mage::logException($e);\r\n\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n $_response->setMessage($this->__('Cannot add the item to shopping cart.'));\r\n $_response->send();\r\n }\r\n }",
"public function quick_add_to_wishlist_ajax(Request $request)\n {\n if($request->ajax())\n {\n if(Auth::user())\n {\n $product = Product::where('id', $request->product_id)->where('is_feature', 1)->first();\n $data = $this->registered_user_wish_list($product, $request);\n }\n }\n return response()->json(['data' => $data]);\n }",
"public function controller_action_postdispatch_vesautosearch_index_ajaxgetproduct(Varien_Event_Observer $observer) {\n\t\ttry {\n\t\t\tif (df_enabled(Df_Core_Feature::LOCALIZATION) && @class_exists('Ves_Autosearch_Helper_Data')) {\n\t\t\t\t/** @var string $phrase */\n\t\t\t\t$phrase = 'No products exists';\n\t\t\t\t/** @var Mage_Core_Controller_Response_Http $response */\n\t\t\t\t$response = rm_state()->getController()->getResponse();\n\t\t\t\t$response->setBody(str_replace(\n\t\t\t\t\t$phrase, Mage::helper('ves_autosearch')->__($phrase), $response->getBody()\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e) {\n\t\t\tdf_handle_entry_point_exception($e);\n\t\t}\n\t}",
"public function addProduct()\n {\n foreach($_POST as $key => $value)\n {\n $product[$key] = filter_var($value, FILTER_SANITIZE_STRING);\n }\n\n $stmt = $this->dsn->prepare(\"SELECT * FROM products WHERE code = ? LIMIT 1\");\n $stmt->execute([$product['product_code']]);\n\n $stmt->bindColumn('name', $this->product_name);\n $stmt->bindColumn('price', $this->product_price);\n $stmt->bindColumn('image', $this->product_image);\n\n while($stmt->fetch())\n {\n $product[\"product_name\"] = $this->product_name;\n $product[\"product_price\"] = $this->product_price;\n $product[\"product_image\"] = $this->product_image;\n\n if(isset($_SESSION[\"products\"]))\n {\n if(isset($_SESSION[\"products\"][$product['product_code']]))\n {\n $_SESSION[\"products\"][$product['product_code']][\"product_qty\"] = $_SESSION[\"products\"][$product['product_code']][\"product_qty\"] + $_POST[\"product_qty\"];\n } else {\n $_SESSION[\"products\"][$product['product_code']] = $product;\n }\n } else {\n $_SESSION[\"products\"][$product['product_code']] = $product;\n }\n }\n\n $total_product = count($_SESSION[\"products\"]);\n\n die(json_encode(array('products'=>$total_product)));\n }",
"public function orderAjaxHandler(Request $request)\n {\n $inputData = $request->input();\n $method = $inputData['method'];\n $objCurl = CurlRequestHandler::getInstance();\n $url = Session::get(\"domainname\") . env(\"API_URL\") . '/' . \"order-ajax-handler\";\n $mytoken = env(\"API_TOKEN\");\n switch ($method) {\n\n case 'add-to-cart':\n $user_id = '';\n if (Session::has('fs_user')) {\n $user_id = Session::get('fs_user')['id'];\n } else if (Session::has('fs_buyer')) {//todo if this is done then user and buyer cannot operate in same browser window\n $user_id = Session::get('fs_buyer')['id'];\n }\n $productId = $request->input('prodId');\n $quantity = $request->input('quantity');\n $combinationId = isset($inputData['selected']) ? implode(\",\", $request->input('selected')) : 0;\n $cartBind['quantity'] = $quantity;\n $cartBind['product_id'] = $productId . '-' . $combinationId;\n $cartBind['for_user_id'] = $user_id;\n $data = array('api_token' => $mytoken, 'id' => $user_id, 'mainCartData' => json_encode([$cartBind]), 'method' => 'insert-order');\n $curlResponse = $objCurl->curlUsingPost($url, $data);\n if ($curlResponse->code == 200) {\n echo json_encode(['status' => 'success', 'msg' => $curlResponse->message]);\n } else {\n echo json_encode(['status' => 'error', 'msg' => 'Something went wrong, please reload the page and try again.']);\n }\n break;\n\n case 'cartDetails':\n// if (isset($_COOKIE['cart_cookie_name']) && !empty(json_decode($_COOKIE['cart_cookie_name']))) {\n// $cartCookie = json_decode($_COOKIE['cart_cookie_name']);\n// foreach ($cartCookie as $key => $value) {\n// $combinationId = implode(\"#\", array_filter(array_unique(explode(\"@\", $value->combination_id))));\n// $productId = $value->prodId;\n// $cartBind[$key]['quantity'] = $value->quantity;\n// $cartBind[$key]['product_id'] = $productId . '-' . $value->combination_id;\n//\n// }\n// $finalCartInfo = array_map(function ($values) {\n// $temp['quantity'] = $values['quantity'];\n// $temp['product_id'] = $values['product_id'];\n// return $temp;\n//\n// }, $cartBind);\n//\n// $dataForCart = array('api_token' => $mytoken, 'cookieCartData' => json_encode($finalCartInfo), 'method' => 'user-cookie-cart-details');\n// $curlResponseForCookie = $objCurl->curlUsingPost($url, $dataForCart);\n//// print_a($curlResponseForCookie);\n// if ($curlResponseForCookie->code == 200) {\n// echo json_encode($curlResponseForCookie->data);\n// }\n// } else {\n if (Session::has('fs_user')) {\n $user_id = Session::get('fs_user')['id'];\n } else if (Session::has('fs_buyer')) {//todo if this is done then user and buyer cannot operate in same browser window\n $user_id = Session::get('fs_buyer')['id'];\n }\n $data = array('api_token' => $mytoken, 'id' => $user_id, 'method' => 'user-cart-details');\n $curlResponse = $objCurl->curlUsingPost($url, $data);\n if ($curlResponse->code == 200) {\n echo json_encode($curlResponse->data);\n// }\n }\n break;\n case 'removerCartOrder':\n $user_id = '';\n if (Session::has('fs_user')) {\n $user_id = Session::get('fs_buyer')['id'];\n } else if (Session::has('fs_user')) {\n $user_id = Session::get('fs_buyer')['id'];\n }\n $order_id = $request->input('orderId');\n $data = array('api_token' => $mytoken, 'id' => $user_id, 'order_id' => $order_id, 'method' => 'remove-cart-detail');\n $curlResponse = $objCurl->curlUsingPost($url, $data);\n if ($curlResponse->code == 200) {\n echo json_encode(['status' => 'success', 'msg' => 'Removed From Cart']);\n } else {\n echo json_encode(['status' => 'error', 'msg' => 'Something went wrong, please reload the page and try again.']);\n }\n break;\n default:\n break;\n }\n\n }",
"public function actionAddProductList()\n\t{\n\t\t$order_id=Yii::app()->request->getQuery('id');\n\t\t$model = $this->_loadModel($order_id);\n\t\t$dataProvider = new StoreProduct('search');\n\n\t\tif(isset($_GET['StoreProduct']))\n\t\t\t$dataProvider->attributes = $_GET['StoreProduct'];\n\n\t\t$this->renderPartial('_addProduct', array(\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'order_id' => $order_id,\n\t\t\t'model' => $model,\n\t\t));\n\t}",
"public function postProcess()\n {\n if ($this->isXmlHttpRequest()) {\n $query = Tools::getValue('q');\n $limit = (int) Tools::getValue('limit');\n\n /** @var GamificationsProductRepository $productRepository */\n $productRepository = $this->module->getEntityManager()->getRepository('GamificationsProduct');\n $products = $productRepository->findAllProductsNamesAndIdsByQuery(\n $query,\n $limit,\n $this->context->language->id,\n $this->context->shop->id\n );\n\n die(json_encode(['products' => $products]));\n }\n\n return parent::postProcess();\n }",
"public function addProductRow(Request $request)\n {\n if ($request->ajax()) {\n $product_id = $request->input('product_id');\n $variation_id = $request->input('variation_id');\n $business_id = $request->session()->get('user.business_id');\n \n if (!empty($product_id)) {\n $index = $request->input('row_count');\n $products = $this->productUtil->getDetailsFromProduct($business_id, $product_id, $variation_id);\n $qty_available=\\DB::table('variation_location_details as vld')->join('business_locations','business_locations.id','vld.location_id')->where('vld.variation_id',$variation_id)\n ->select(\n 'business_locations.name',\n 'vld.qty_available'\n )->get();\n return view('labels.partials.show_table_rows')\n ->with(compact('products','index','qty_available'));\n }\n }\n }",
"public function manageOrderProducts()\n {\n }",
"public function insert_order_item_to_cart(Request $request)\n {\n if ($request->ajax()) {\n\n $product_id = $request->input('product_id');\n $order_type = $request->input('order_type');\n $total_count = $request->input('total_count');\n\n $delivery_type = $request->input('delivery_type');\n\n $count_per = $custom_date = null;\n if ($delivery_type == DeliveryType::DELIVERY_TYPE_EVERY_DAY || $delivery_type == DeliveryType::DELIVERY_TYPE_EACH_TWICE_DAY) {\n $count_per = $request->input('count_per');\n } else {\n $custom_date = $request->input('custom_date');\n $custom_date = rtrim($custom_date, ',');\n }\n\n $wxuser_id = session('wechat_user_id');\n $factory_id = session('factory_id');\n\n $factory = Factory::find($factory_id);\n\n $address = session('address');\n\n $product_price_template = ProductPrice::priceTemplateFromAddress($product_id, $address);\n\n if (!$product_price_template) {\n $product_price_template = ProductPrice::where('product_id', $product_id)->get()->first();\n }\n\n if ($order_type == OrderType::ORDER_TYPE_MONTH) {\n $product_price = $product_price_template->month_price;\n } else if ($order_type == OrderType::ORDER_TYPE_SEASON) {\n $product_price = $product_price_template->season_price;\n } else {\n $product_price = $product_price_template->half_year_price;\n }\n\n $total_amount = $total_count * $product_price;\n\n// $today_date = new DateTime(\"now\", new DateTimeZone('Asia/Shanghai'));\n// $gap_day = intval($factory->gap_day);\n// $start_at = $today_date->modify(\"+\" . $gap_day . \" days\");\n// $start_at = $start_at->format('Y-m-d');\n\n $start_at = $request->input('start_at');\n $start_at = new DateTime($start_at);\n $start_at = $start_at->format('Y-m-d');\n\n //add wechat order products\n $wcop = new WechatOrderProduct;\n $wcop->wxuser_id = $wxuser_id;\n $wcop->factory_id = $factory_id;\n $wcop->product_id = $product_id;\n $wcop->order_type = $order_type;\n $wcop->delivery_type = $delivery_type;\n $wcop->total_count = $total_count;\n $wcop->product_price = $product_price;\n\n if ($count_per)\n $wcop->count_per_day = $count_per;\n else\n $wcop->custom_date = $custom_date;\n\n $wcop->total_amount = $total_amount;\n $wcop->start_at = $start_at;\n $wcop->save();\n\n $wxorder_product_id = $wcop->id;\n\n //add to wxcart\n $wcc = new WechatCart;\n $wcc->wxuser_id = $wxuser_id;\n $wcc->wxorder_product_id = $wxorder_product_id;\n $wcc->save();\n\n return response()->json(['status' => 'success']);\n }\n }",
"public function buyNow(Request $request){\n if ($request->ajax()) {\n $product_id = $request->product_id;\n $size_id = $request->size_id;\n $product = Product::find($product_id);\n $price_sale = $product->price - ($product->price*$product->sale)/100;\n $image = Image::select('slug')->where('product_id',$product_id)->where('status',1)->orderBy('updated_at','desc')->first();\n $cart = Cart::add(array(\n 'id' => $product_id.$size_id,\n 'name' => $product->name,\n 'price' => $price_sale,\n 'quantity' => 1,\n 'attributes' => array('image' => $image->slug,'price_goc'=> $product->price, 'slug'=> $product->slug,'sale'=> $product->sale,'size_id' => $request->size_id, 'product_id' => $product_id)\n ));\n }\n }",
"function basel_add_to_compare() {\n\n\t\t$id = sanitize_text_field( $_GET['id'] );\n\n\t\tif ( defined( 'ICL_SITEPRESS_VERSION' ) && function_exists( 'wpml_object_id_filter' ) ) {\n\t\t\tglobal $sitepress;\n\t\t\t$id = wpml_object_id_filter( $id, 'product', true, $sitepress->get_default_language() );\n\t\t}\n\n\t\t$cookie_name = basel_compare_cookie_name();\n\n\t\tif ( basel_is_product_in_compare( $id ) ) {\n\t\t\tbasel_compare_json_response();\n\t\t}\n\n\t\t$products = basel_get_compared_products();\n\n\t\t$products[] = $id;\n\n\t\tsetcookie( $cookie_name, json_encode( $products ), 0, COOKIEPATH, COOKIE_DOMAIN, false, false );\n\n\t\t$_COOKIE[ $cookie_name ] = json_encode( $products );\n\n\t\tbasel_compare_json_response();\n\t}",
"function onAction()\n {\n global $application;\n $request = $application->getInstance('Request');\n\t$msgres = $application->getInstance(\"MessageResources\", \"messages\");\n\n // checking if wishlist product is being added\n $wl_id = $request->getValueByKey('wl_id');\n if ($wl_id > 0)\n {\n $data = modApiFunc('Wishlist', 'getWishlistRecordCartData', $wl_id);\n if (!$data)\n {\n // invalid wishlist record...\n $request = new Request();\n $request -> setView('Wishlist');\n $application -> redirect($request);\n\t\t$this->setStatusError();\n\t\t$this->setMessage('Invalid wishlist record');\n }\n\n $options_sent = $data['options_sent'];\n $prod_id = $data['entity_id'];\n }\n else\n {\n $prod_id = $request->getValueByKey('prod_id');\n\n $data=array(\n 'parent_entity' => 'product'\n ,'entity_id' => $prod_id\n ,'options' => $request->getValueByKey('po')\n ,'qty' => $request->getValueByKey('quantity_in_cart')\n \t\t ,'colorname' => $request->getValueByKey('colorname')\n\n );\n\n $options_sent = $request->getValueByKey('options_sent');\n }\n\n // setting qty=1 if quantity_in_stock is not specified\n if (!$data['qty'] && $data['qty'] !== 0)\n $data['qty'] = 1;\n\n if($data['options']==null)\n {\n $data['options']=array();\n }\n\n\n $result = modApiFunc('Cart', 'processPostedProductData', $data, $options_sent);\n\n if (!$result['is_error'])\n {\n if(!empty($result['stock_discarded_by_warning']))\n {\n modApiFunc('Session','set','StockDiscardedBy',$result['stock_discarded_by_warning']);\n }\n\n $added = modApiFunc('Cart', 'addToCart', $result['data']);\n\t $cc = modApiFunc('Cart', 'getCartContent');\n\t $cartPrice = '';\n\t $cart_id = $prod_id.\"_\".modApiFunc(\"Product_Options\", \"getCombinationHash\", $result['data']['options']);\n\t if( !empty($cc))\n\t\t foreach($cc as $product)\n\t\t\t if($product[\"CartID\"]==$cart_id)\n\t\t\t\t $cartPrice = modApiFunc(\"Localization\", \"format\", $product[\"CartItemSalePrice\"], \"currency\");\n\n\t $this->setStatusSuccess();\n\n\t $p = new CProductInfo($prod_id);\n\t $message = array(\n\t\t \"<h2>\".$msgres->getMessage('CATALOG_PRODUCT_ADDED').\"</h2>\".\n\t\t \"<div class='ajax_message_cart_prod_link'><a href='\". $p->getProductInfoLink($prod_id, $p->chooseCategoryID()) .\"'>\".$p->getProductTagValue('name').\"</a></div>\".\n \"<div class='ajax_message_cart_prod_qty'>\".$data['qty'].\" \".$msgres->getMessage('CATALOG_X').\" \".$cartPrice.\"</div>\"\n );\n\n // if a wishlist product is being added...\n if ($wl_id > 0 && $added)\n {\n modApiFunc('Wishlist', 'removeFromWishlist', $wl_id);\n\t\t$message[] = 'This product was removed from your Wishlist';\n }\n\n\t $this->setMessage($message);\n $request = new Request();\n $request->setView(CURRENT_REQUEST_URL);\n $application->redirect($request);\n }\n else\n {\n\t $this->setStatusError();\n\t $message = array();\n\n if($result['discard_by'] != 'none')\n {\n modApiFunc('Session','set','OptionsDiscardedBy',$result['discard_by']);\n\t\t$message[] = $msgres->getMessage($result['discard_by']);\n }\n if($result['stock_discarded_by'] != 'none')\n {\n\t\t modApiFunc('Session','set','StockDiscardedBy',$result['stock_discarded_by']);\n\t\t $message[] = $msgres->getMessage($result['stock_discarded_by']);\n }\n modApiFunc('Session','set','sentCombination',$result['data']['options']);\n\t $this->setMessage($message);\n $request = new Request();\n $request->setView('ProductInfo');\n $request->setAction('SetCurrentProduct');\n $request->setKey('prod_id',$prod_id);\n $request->setProductID($prod_id);\n $p = new CProductInfo($prod_id);\n $request->setCategoryID($p->chooseCategoryID());\n $application->redirect($request);\n };\n }",
"public function add_product() {\n\t\t$values=array(\"product_name\"=>$_POST['product_name'],\"description\"=>$_POST['description']);\n\t\tif($this->insert(\"products\",$values)) {\t\t\t\n\t\t\t$result=$this->runQuery('getAll','select max(id) as id from products');\n\t\t\techo json_encode($result);\n\t\t}\n\t\telse\n\t\t\techo 'Error while inserting product tbl';\n\t}",
"public function ejecutaAjax() {\n \n $ajaxController = new \\controllers\\ajaxController();\n $respuestaAjax = $ajaxController->addProducto($this->codigo, $this->producto, $this->cantidad, $this->valor);\n echo $respuestaAjax;\n }"
] |
[
"0.7071948",
"0.6952969",
"0.68157566",
"0.66390485",
"0.6581117",
"0.655834",
"0.65010923",
"0.6493552",
"0.64879346",
"0.64818233",
"0.6433269",
"0.6421531",
"0.6355081",
"0.6353782",
"0.62965786",
"0.6287022",
"0.6279978",
"0.62662184",
"0.62385595",
"0.6228116",
"0.62208533",
"0.62018085",
"0.6178352",
"0.6161301",
"0.6159874",
"0.6131792",
"0.61184144",
"0.610339",
"0.60990036",
"0.60917723"
] |
0.8057572
|
0
|
Gets the current warehouse used
|
protected function getCurrentWarehouse()
{
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getWarehouse(): ?string\n {\n return isset($this->Warehouse) ? $this->Warehouse : null;\n }",
"protected function getCurrentWarehouseId()\n\t{\n\t\tstatic $warehouse = 0;\n\n\t\tif ($warehouse == 0)\n\t\t{\n\t\t\t$warehouse = -1;\n\t\t\tif ((int)Tools::getValue('warehouse'))\n\t\t\t\t$warehouse = (int)Tools::getValue('warehouse');\n\t\t\telse if ((int)$this->context->cookie->warehouse)\n\t\t\t\t$warehouse = (int)$this->context->cookie->warehouse;\n\t\t\t$this->context->cookie->warehouse = $warehouse;\n\t\t}\n\n\t\treturn $warehouse;\n\t}",
"public function getWarehouseID()\n {\n return $this->warehouseID;\n }",
"public function getWarehouse()\n {\n return $this->hasOne(Warehouse::className(), ['warehouse_id' => 'warehouse_id']);\n }",
"public function getWarehouse()\n {\n return $this->hasOne(Warehouse::className(), ['warehouse_id' => 'warehouse_id']);\n }",
"private function _getDefaultWarehouse()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$defaultWarehouse = Factory::service(\"Warehouse\")->getDefaultWarehouse(Core::getUser());\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow new Exception(\"Invalid / No Default Warehouse Found!\");\n\t\t}\n\t\tif(!$defaultWarehouse instanceof Warehouse)\n\t\t{\n\t\t\tthrow new Exception(\"Invalid / No Default Warehouse Found!\");\n\t\t}\n\t\treturn $defaultWarehouse;\n\t}",
"public function getRestrictToWarehouse()\n {\n return $this->restrictToWarehouse;\n }",
"public function getUnfinishedWarehouse();",
"public function warehouse()\n {\n return $this->belongsTo('App\\Models\\WarehouseModel', 'warehouse_id', 'id');\n }",
"private function callWarehouse(){\n\t\t$data = $this->connection->createCommand('select id, name from warehouse where status = 1 and tenant_id = '. $this->tenant)->queryAll();\n\t\treturn $data;\n\t}",
"public function wc() {\n\t\treturn $this->woocommerce;\n\t}",
"public function warehousesList()\n {\n if(Auth::user()->activities != '')\n {\n $warehouses = Auth::user()->warehouseList;\n\n return ($warehouses);\n }\n }",
"public function warehouse()\n {\n return $this->belongsTo(Warehouse::class, 'warehouse_id');\n }",
"public function getWarehouse(ConnectionInterface $con = null)\n {\n if ($this->aWarehouse === null && (($this->intbwhse !== \"\" && $this->intbwhse !== null))) {\n $this->aWarehouse = ChildWarehouseQuery::create()->findPk($this->intbwhse, $con);\n /* The following can be used additionally to\n guarantee the related object contains a reference\n to this object. This level of coupling may, however, be\n undesirable since it could result in an only partially populated collection\n in the referenced object.\n $this->aWarehouse->addPoReceivingHeads($this);\n */\n }\n\n return $this->aWarehouse;\n }",
"public function getWarehpuseCombo()\n\t{\n return Warehouse::pluck('NAME', 'PK_NO');\n }",
"public function warehouse()\n {\n return $this->belongsToMany('App\\Warehouse', 'product_has_warehouse', 'product_id', 'warehouse_id');\n }",
"public function isWarehouseEnabled() {\n return Mage::helper('core')->isModuleEnabled('Magestore_Inventorywarehouse');\n }",
"public function getWarehouseDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $warehouseId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `warehouseId`\n FROM `warehouse`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else {\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [warehouseId],\n FROM [warehouse]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else {\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT WAREHOUSEID AS \\\"warehouseId\\\",\n FROM WAREHOUSE\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n }\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $warehouseId = $row['warehouseId'];\n }\n return $warehouseId;\n }",
"public function getWarehouseList() {\n $options = array();\n $warehouses = Mage::getModel('inventoryplus/warehouse')->getCollection();\n foreach ($warehouses as $warehouse) {\n $options[$warehouse->getId()] = $warehouse->getWarehouseName();\n }\n\n return $options;\n }",
"private function getStore()\n {\n return $this->storeManager->getStore($this->retrieveSharedCatalogStoreId());\n }",
"public function getStore()\n {\n return $this->_storeManager->getStore();\n }",
"public function getCurrent()\n\t{\n\t\treturn Mage::registry('current_product');\n\t}",
"protected function getStore() {\n return Mage::app()->getStore();\n }",
"public function getQuantite_stock()\r\n {\r\n return $this->quantite_stock;\r\n }",
"public function getStore()\n {\n $store = Mage::app()->getStore();\n if ($this->getCategory() && $this->getCategory()->getStoreId()) {\n $storeId = $this->getCategory()->getStoreId();\n $store = Mage::app()->getStore($storeId);\n }\n if ($this->getData('store')) {\n $store = $this->getData('store');\n }\n if ($this->getData('store_id')) {\n $storeId = $this->getData('store_id');\n $store = Mage::app()->getStore($storeId);\n }\n return $store;\n }",
"public function getStore()\n\t{\n\t\t//\n\t}",
"protected function setWarehouseInfoInternal()\n {\n /** @var \\Magento\\Store\\Model\\Store $store */\n $store = $this->storeManager->getStore();\n $originCountry = $this->getScopeConfigValue(Config::XML_PATH_ORIGIN_COUNTRY_ID, $store);\n $user = $this->authSession->getUser();\n $storeInfo = $this->storeInfo->getStoreInformationObject($store);\n /** @var WarehouseCountryService $countryService */\n $countryService = ServiceRegister::getService(WarehouseCountryService::CLASS_NAME);\n\n if (!$countryService->isCountrySupported($originCountry)) {\n return false;\n }\n\n $userInfo = $this->getConfigService()->getUserInfo();\n $originAddress = $this->getScopeConfigValue('shipping/origin/street_line1', $store);\n $secondaryStreetLine = $this->getScopeConfigValue('shipping/origin/street_line2', $store);\n\n if (!empty($secondaryStreetLine)) {\n $originAddress .= ' ' . $secondaryStreetLine;\n }\n\n try {\n $warehouse = Warehouse::fromArray(\n [\n 'alias' => $storeInfo->getData('name'),\n 'name' => $user && $user->getFirstName() ? $user->getFirstName() : $userInfo->firstName,\n 'surname' => $user && $user->getLastName() ? $user->getLastName() : $userInfo->lastName,\n 'country' => $originCountry,\n 'postal_code' => $this->getScopeConfigValue(Config::XML_PATH_ORIGIN_POSTCODE, $store),\n 'city' => $this->getScopeConfigValue(Config::XML_PATH_ORIGIN_CITY, $store),\n 'address' => $originAddress,\n 'phone' => $storeInfo->getData('phone'),\n 'email' => $user && $user->getEmail() ? $user->getEmail() : $userInfo->email,\n ]\n );\n } catch (FrontDtoValidationException $e) {\n return false;\n }\n\n $this->getConfigService()->setDefaultWarehouse($warehouse);\n\n return true;\n }",
"public function getShipmentWarehouseList();",
"public function getStore()\n {\n if (is_null($this->_store)) {\n $this->_store = Mage::app()->getStore();\n }\n return $this->_store;\n }",
"public function get_storage_unit()\n {\n return $this->storage_unit;\n }"
] |
[
"0.73454744",
"0.7239294",
"0.71724415",
"0.69809",
"0.69809",
"0.6886462",
"0.68531823",
"0.68510413",
"0.64947593",
"0.648541",
"0.64398164",
"0.6396506",
"0.63899237",
"0.6386626",
"0.62745625",
"0.62317425",
"0.62316275",
"0.62212265",
"0.61165124",
"0.6097368",
"0.60893005",
"0.6051638",
"0.60226196",
"0.59366256",
"0.5925873",
"0.5913793",
"0.5886633",
"0.5877691",
"0.58593065",
"0.58294207"
] |
0.83706266
|
0
|
Loads products which quantity (hysical quantity) is equal or less than $threshold
|
protected function loadProducts($threshold)
{
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getThresholdProducts(){\n\t\t\n\t\t$this->db->select('(SUM(inw_qty) - SUM(outw_qty)) AS prod_stock, P.product_name, P.pid, P.min_qty');\n\t\t$this->db->from('product_stock AS PS');\n\t\t$this->db->join(\"product AS P\", \"P.pid = PS.pid\");\n\t\t$this->db->group_by('PS.pid');\n\t\t$this->db->having('prod_stock < P.`min_qty`');\n\t\t$query_products_outof_stock = $this->db->get();\n\t\t//echo $this->db->last_query();die;\n\t\tif($query_products_outof_stock->num_rows()>0)\n\t\t{\n\t\t\treturn $query_products_outof_stock->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t}",
"private function selectProductLowStock(){\n\t\t$data = $this->connection->createCommand('select id, sku, name, minimum_quantity, quantity from product where minimum_quantity is not null and quantity <= minimum_quantity and product_type_id = 2 and tenant_id = '. $this->tenant)->queryAll();\n\t\tforeach($data as $key => $value){\t\n\t\t\t$sqlBalance = 'select * from stock_balance where product_id = '. $value['id'];\n\t\t\t$sqlBalance = $this->connection->createCommand($sqlBalance)->queryOne();\n\t\t\tif(!empty($sqlBalance['warehouse_id'])){\n\t\t\t\t$sqlBalance['warehouse_id'] = $this->connection->createCommand('select id,name from warehouse where id = '. $sqlBalance['warehouse_id'])->queryOne();\n\t\t\t\t$data[$key]['balance'] = $sqlBalance;\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}",
"function getNewIdiProductsThreshold($game_id, $round_number, $product_number){\r\n\t\t\t$umbral_db=new Model_DbTable_Games_Param_Idi_Threshold();\r\n\t\t\t$threshold=$umbral_db->getProductThreshold($game_id, $product_number);\r\n\t\t\t$availability_all=$this->getProductsAvailibilityBySomeone($game_id, $round_number);\r\n\t\t\t$availabilty=$availability_all['product_number_'.$product_number];\r\n\t\t\tif($availabilty==1){\r\n\t\t\t\t$threshold=0.96*(1-(3*($round_number/100)));\r\n\t\t\t}\r\n\t\t\treturn $threshold;\r\n\t\t}",
"function get_transactions_above_value($threshold){\n $str_query=\"select * from pos_transaction where value>='$threshold'\";\n if(!$this->query($str_query)){\n return false;\n }\n return $this->fetch();\n }",
"public function getLowQuantity()\n {\n return Item::whereColumn('minimum_quantity', '>', 'current_quantity')->get();\n }",
"function fetchAllMinimumItemCurrentStock()\r{\r $link = parent::connectToDB();\r\t$query=\"select stock.item_id,item.minimum_quantity,item.name_brand,category.name,sum(stock.current_stock) from item,category,stock where stock.item_id=item.item_id and item.category_id=category.category_id group by stock.item_id having sum(stock.current_stock)<(item.minimum_quantity)\";\r\t$result8 = mysqli_query($link, $query);\r\t$r=mysqli_num_rows($result8);\t\rif($r!=0)\r{\rreturn $result8;\r}\relse\r{\rreturn false;\r}\r}",
"public function scopeLowQuantity($query)\n {\n return $query->where('quantity', '<', 'low_threshold');\n }",
"public function testConditionOverride() {\n\t\t$products = $this->productsManager->filter(Attr::id()->lt(3))->find(Attr::category()->eq('Clothes'));\n\t\t$this->assertCount(3, $products);\n\t}",
"public function testFilterMinimumPrice()\n {\n $this->visit('/properties')\n ->type('4500000', '#minPrice')\n ->press('Update results')\n ->see('Victorian townhouse');\n $this->notSee('Five bedroom mill conversion');\n $this->notSee('Shack in the desert');\n }",
"public function ListarIngredientesStockMinimo()\n{\n\tself::SetNames();\n\t$sql = \" select * from ingredientes WHERE CAST(cantingrediente AS DECIMAL(10,5)) <= CAST(stockminimoingrediente AS DECIMAL(10,5))\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}",
"function testOppSearchByCostGreaterThan() {\n\t\t$this->setUrl('/search/advanced?r=opp&q[opp_cost][op]=GREATER+THAN&q[opp_cost][value]=500');\n\t\t$this->app->go();\n\t\t$this->assertPattern('/id=\"qb_opp_cost\"/', $this->view->output);\n\t\t$collection = $this->view->get('collection');\n\t\t$this->assertIsA($collection, 'Tactile_OpportunityCollection');\n\t\t$names = $collection->pluck('name');\n\t\t$this->assertEqual($names, array('Build a website'));\n\t}",
"function getallproducts1($warehouseid){\n \n\n $products = $this->db->query(\"SELECT a.*, \n b.id AS productid, \n b.`name` AS productname, \n b.`main_image` AS productimage, \n b.`price` AS product_price, \n b.`tax` AS product_tax, \n b.`description` AS product_description, \n b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, \n c.`image` AS cat_image, \n c.`category_id` AS category_id,\n d.`category_id` AS subcategory_id,\n d.`name` AS subcat_name, \n d.`image` AS subcat_image,\n d.`parent_id` AS parent_id,\n d.`shared_category` AS shared_category \n FROM warehouse_products a \n LEFT JOIN products b ON a.product=b.`id` \n LEFT JOIN category c ON b.`category_id` = c.`category_id` \n LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` \n WHERE a.`warehouse` = \".$warehouseid.\" \n ORDER BY c.`name`, d.`name`\")->result();\n \n $sharedproducts=array();\n foreach($products as $product){\n if($product->shared_category !=null)\n array_push($sharedproducts, $product);\n }\n \n \n if(sizeof($products)>0){\n \n $this->db->query(\"TRUNCATE TABLE `tb_filteredproducts`\");\n \n foreach($products as $row) {\n $categoryimage=$row->cat_image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$row->id.\"',\n `warehouse` = '\".$row->warehouse.\"',\n `product` = '\".$row->product.\"',\n `quantity` = '\".$row->quantity.\"',\n `min_capacity` = '\".$row->min_capacity.\"',\n `max_capacity` = '\".$row->max_capacity.\"',\n `avail_qty` = '\".$row->avail_qty.\"',\n `created_at` = '\".$row->created_at.\"',\n `updated_at` = '\".$row->updated_at.\"',\n `productid` = '\".$row->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$row->productname).\"',\n `productimage` = '\".$row->productimage.\"',\n `product_price` = '\".$row->product_price.\"',\n `product_tax` = '\".$row->product_tax.\"',\n `product_description` = '\".$row->product_description.\"',\n `productuniqueid_forimages` = '\".$row->productuniqueid_forimages.\"',\n `cat_name` = '\".$row->cat_name.\"',\n `cat_image` = '\".$row->cat_image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$row->category_id.\"',\n `subcat_name` = '\".$row->subcat_name.\"',\n `subcategory_id` = '\".$row->subcategory_id.\"',\n `subcat_image` = '\".$row->subcat_image.\"',\n `parent_id` = '\".$row->parent_id.\"',\n `shared_category` = '\".$row->shared_category.\"';\";\n \n $this->db->query($query);\n \n }\n \n foreach($sharedproducts as $shared_product){ // for one shared product\n $sharedcategory_array= array();\n $sharedcategory_array=explode(\",\",$shared_product->shared_category);\n // print_r($shared_product);\n foreach($sharedcategory_array as $oneshared_category){\n if($oneshared_category !=$shared_product->category_id){ // if the shared category id item is not same with table id(current setted category id)\n // echo $oneshared_category;\n \n $selected_category_objectarray_from_categorytable = $this->db->where('category_id', $oneshared_category)->get('category')->result();\n \n if(sizeof($selected_category_objectarray_from_categorytable)>0){ // if the shared category is not deleted from category table\n $selected_category_object_from_categorytable=$selected_category_objectarray_from_categorytable[0];\n \n $categoryimage=$selected_category_object_from_categorytable->image;\n $imageheight=\"\";\n $imagewidth=\"\";\n if(strlen($categoryimage)>0){\n list($width, $height, $type, $attr) = getimagesize(\"https://mcflydelivery.com/public/uploads/category/thumbnail/\".$categoryimage);\n $imageheight=$height;\n $imagewidth=$width;\n }\n \n $query = \"INSERT INTO `tb_filteredproducts` set \n `id` = '\".$shared_product->id.\"',\n `warehouse` = '\".$shared_product->warehouse.\"',\n `product` = '\".$shared_product->product.\"',\n `quantity` = '\".$shared_product->quantity.\"',\n `min_capacity` = '\".$shared_product->min_capacity.\"',\n `max_capacity` = '\".$shared_product->max_capacity.\"',\n `avail_qty` = '\".$shared_product->avail_qty.\"',\n `created_at` = '\".$shared_product->created_at.\"',\n `updated_at` = '\".$shared_product->updated_at.\"',\n `productid` = '\".$shared_product->productid.\"',\n `productname` = '\".str_replace(\"'\",\"\",$shared_product->productname).\"',\n `productimage` = '\".$shared_product->productimage.\"',\n `product_price` = '\".$shared_product->product_price.\"',\n `product_tax` = '\".$shared_product->product_tax.\"',\n `product_description` = '\".$shared_product->product_description.\"',\n `productuniqueid_forimages` = '\".$shared_product->productuniqueid_forimages.\"',\n `cat_name` = '\".$selected_category_object_from_categorytable->name.\"',\n `cat_image` = '\".$selected_category_object_from_categorytable->image.\"',\n `cat_imageheight` = '\".$imageheight.\"',\n `cat_imagewidth` = '\".$imagewidth.\"',\n `category_id` = '\".$selected_category_object_from_categorytable->category_id.\"',\n `subcat_name` = '\".$shared_product->subcat_name.\"',\n `subcategory_id` = '\".$shared_product->subcategory_id.\"',\n `subcat_image` = '\".$shared_product->subcat_image.\"',\n `parent_id` = '\".$shared_product->parent_id.\"',\n `shared_category` = '\".$shared_product->shared_category.\"';\";\n \n $this->db->query($query);\n \n \n }\n }\n }\n } \n \n } \n \n \n $result = $this->db->query(\"SELECT * FROM `tb_filteredproducts` ORDER BY cat_name, subcat_name\")->result();\n return $result;\n }",
"abstract public function load($qty, $from = 0);",
"public function get_products_in_purchase_of_costumer() {\n $query = $this->db->query(\"select products_in_order_of_costumers.order_number_fk, products_in_order_of_costumers.product_code_fk, products_in_order_of_costumers.quantity, products_in_order_of_costumers.price_per_unit, products.image, products.model from products inner join products_in_order_of_costumers on products_in_order_of_costumers.product_code_fk = products.product_code ORDER BY(products_in_order_of_costumers.order_number_fk)\");\n if ($query) {\n return $query->result_array();\n }\n return false;\n }",
"function getLeastAvailableProductByCategory($cat) {\r\n global $conn;\r\n $select = \"SELECT productid, name, image FROM product WHERE category='$cat' ORDER BY quantityavailable ASC LIMIT 1;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}",
"public function product_action()\n\t{\n\t\t// shut up php\n\t\terror_reporting(0);\n\t\tee()->load->helper('xml');\n\n\t\t$output = new Oxymel;\n\n\t\t// create our structure\n\t\t$output->xml->products->contains;\n\n\t\tee()->sync_db = ee()->load->database('sync_db', true);\n\n\t\t$query = ee()->sync_db\n\t\t\t->where('processed', 0)\n\t\t\t->get('products', 500);\n\n\t\t$ids_processed = array();\n\n\t\tforeach($query->result() as $row)\n\t\t{\n\n\t\t\tif($row->tax_exempt == 0)\n\t\t\t{\n\t\t\t\t$tax_exempt = \"Taxable\";\n\t\t\t}\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$tax_exempt = \"\";\n\t\t\t}\n\n\t\t\tif(!empty($row->product_category_3))\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_3;\n\t\t\t}\t\n\t\t\telseif(!empty($row->product_category_2))\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_2;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$product_category = $row->product_category_1;\n\t\t\t}\n\n\t\t\t// append a product\n\t\t\t$output\n\t\t\t\t->product->contains\n\t\t\t\t \t->title->contains->cdata($row->sku .' - ' . $row->name)->end\n\t\t\t\t \t->sku($row->sku)\n\t\t\t\t \t->name->contains->cdata($row->name)->end\n\t\t\t\t \t->price($row->price)\n\t\t\t\t \t->weight($row->weight)\n\t\t\t\t \t->length($row->length)\n\t\t\t\t \t->width($row->width)\n\t\t\t\t \t->height($row->height)\n\t\t\t\t \t->handling($row->handling)\n\t\t\t\t \t->free_shipping($row->free_shipping)\n\t\t\t\t \t->tax_exempt($tax_exempt)\n\t\t\t\t \t->category->contains->cdata($product_category)->end\n\t\t\t\t \t->product_number($row->product_number)\n\t\t\t\t \t->manufacturer->contains->cdata($row->product_manufacturer)->end\n\t\t\t\t \t->container($row->product_container)\n\t\t\t\t \t->condition($row->product_condition)\n\t\t\t\t \t->listed($row->product_listed)\n\t\t\t\t \t->location($row->product_location)\n\t\t\t\t \t->tested($row->product_tested)\n\t\t\t\t \t->cosmetic_condition->contains->cdata($row->product_cosmetic_condition)->end\n\t\t\t\t \t->keywords->contains->cdata($row->product_keywords)->end\n\t\t\t\t \t->natural_search->contains->cdata($row->product_natural_search)->end\n\t\t\t\t \t->description->contains->cdata($row->product_description)->end\n\t\t\t\t \t->image($row->product_image_filename)\n\t\t\t\t \t->stock_level($row->product_stock_level)\n\t\t\t\t \t->sell_online($row->product_sell_online)\n\t\t\t\t \t->timestamp($row->timestamp)\n\t\t\t\t->end;\t\n\n\t\t\t$ids_processed[] = $row->id;\n\n\t\t}\t\n\n\t\t// close our structure\n\t\t$output->end;\t\n\t\t\t \t\n\t\t// update processed flag on records\t\n\t\tif(count($ids_processed) > 0)\n\t\t{\n\t\t\tee()->sync_db->where_in('id', $ids_processed)->set('processed', 1)->update('products');\n\t\t}\n\n\t\theader('Content-Type: text/xml');\n\t\texit($output->to_string());\n\n\t}",
"public function _assertStoreCartHasProductsWithMinimalQuantity()\n {\n }",
"public function ListarProductosStockMinimo()\n{\n\tself::SetNames();\n\t$sql = \" select * from productos INNER JOIN categorias ON productos.codcategoria = categorias.codcategoria WHERE productos.existencia <= productos.stockminimo\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}",
"public function loadProducts()\n {\n if (!isset($this->mix_id)) {\n return false;\n }\n\n $this->products = array();\n $query = \"SELECT mg.*, sup.*, p.product_id, p.product_nr, p.name, p.paint_chemical, coat.coat_desc as coatDesc \" .\n \"FROM \" . TB_MIXGROUP . \" mg \" .\n \"JOIN \" . TB_PRODUCT . \" p ON p.product_id = mg.product_id \" .\n \"JOIN \" . TB_SUPPLIER . \" sup ON p.supplier_id = sup.supplier_id \" .\n \"JOIN \" . TB_COAT . \" coat ON coat.coat_id = coating_id \" .\n \"WHERE mg.mix_id = {$this->db->sqltext($this->mix_id)}\";\n\n $this->db->query($query);\n if ($this->db->num_rows() == 0) {\n return false;\n }\n\n $productsData = $this->db->fetch_all();\n\n $unittype = new Unittype($this->db);\n //get pfp if exist\n $pfp = $this->getPfp();\n $pfpProduct = array();\n if ($pfp) {\n $pfpProducts = $pfp->getProducts();\n }\n\n foreach ($productsData as $productData) {\n $mixProduct = new MixProduct($this->db);\n foreach ($productData as $property => $value) {\n if (property_exists($mixProduct, $property)) {\n $mixProduct->$property = $productData->$property;\n }\n }\n //\tTODO: add userfriendly records to product properties\n $mixProduct->initializeByID($mixProduct->product_id);\n\n //\tif there is a primary product then this is an pfp-based mix\n if ($mixProduct->is_primary) {\n $this->isPfp = true;\n }\n\n if ($productData->ratio) {\n $mixProduct->ratio_to_save = $productData->ratio;\n }\n\n $mixProduct->unittypeDetails = $unittype->getUnittypeDetails($mixProduct->unit_type);\n $unittypeClass = $unittype->getUnittypeClass($mixProduct->unit_type);\n\n $mixProduct->unittypeDetails['unittypeClass'] = $unittypeClass;\n $mixProduct->initUnittypeList($unittype);\n\n $mixProduct->json = json_encode($mixProduct);\n //get is Ratio \n foreach ($pfpProducts as $pfpProduct) {\n if ($pfpProduct->getProductId() == $productData->product_id) {\n if (!is_null($pfpProduct->getRatioFromOriginal()) && !is_null($pfpProduct->getRatioToOriginal())) {\n $mixProduct->isRange = true;\n $mixProduct->range_ratio = trim($pfpProduct->getRatioFromOriginal()) . '-' . trim($pfpProduct->getRatioToOriginal());\n } else {\n $mixProduct->isRange = false;\n }\n break;\n }\n }\n //\tpush to mix products\n array_push($this->products, $mixProduct);\n }\n\n return $this->products;\n }",
"public static function checkStock($partId,$quantitySelected) {\n $stocks = Stock::find()->where(['part_id' => $partId])->andWhere(['>','quantity','0'])->all();\n $data = array();\n $quantityNeeded = $quantitySelected;\n foreach ($stocks as $stock){\n $stockId = $stock->id;\n /* if quantity needed already fulfilled */\n if ( $quantityNeeded > 0 ) {\n $data['stock_id'][] = $stockId;\n $stockQuantity = $stock->quantity;\n /* if st_qty is enough for stock out */\n if ( $stockQuantity >= $quantityNeeded ) {\n /* A :: stock 11 .... selected 10 */\n /* deduct stock quantity see how much left */\n $stockQuantity -= $quantityNeeded;\n\n /* set how many quantity of stock used for this stock id */\n $data['quantity_used'][] = $quantityNeeded;\n\n /* set quantity to zero as the stock is already enough */\n $quantityNeeded = 0;\n /* A :: stockQuantity become 1 */\n\n\n } else if ( $stockQuantity < $quantityNeeded) {\n /* B :: stock 10 .... selected 11 */\n /* see how many more stock needed */\n $quantityNeeded -= $stockQuantity;\n\n /* set how many quantity of stock used for this stock id */\n $data['quantity_used'][] = $stockQuantity;\n \n /* set stockQuantity to zero as all the stock will be used for the needed */\n $stockQuantity = 0;\n /* A :: stockQuantity become 0 */\n }\n\n $data['stock_quantity'][] = $stockQuantity;\n\n }\n }\n \n return $data;\n }",
"public function getAllProducts(Request $request){\n\n $branch_id = $this->branch_id; //!important\n //dd($branch_id);\n $products = products::latest()->whereExists(function ($query) {\n $query->select(\\DB::raw(1))\n ->from('product_quantities')\n ->whereRaw(\"product_quantities.product_id = products.id\")\n ->whereRaw(\"product_quantities.branch_id = $this->branch_id\")\n ->whereRaw(\"product_quantities.quantity != 0\");\n })\n ->paginate(10);\n //dd($products);\n $products->appends(['branch_id' => $branch_id])->links();\n\n $pagination_arr = $this->getPaginationData($products);\n\n $products = ProductResource::collection($products);\n //dd($pagination_arr);\n\n return $this->setCode(200)->setData($products)->send();\n\n }",
"public function checkQuantity($productHash, $qty)\n {\n $product = $this->entityManager->getRepository(Product::class)->findOneBy(['hash' => $productHash]);\n\n $data['maxQty'] = $product->getQty();\n if ($product->getQty() >= $qty) {\n $data['status'] = true;\n return $data;\n }\n\n $data['status'] = false;\n return $data;\n }",
"function fetch_all_products ($in_stock) {\n $db = getDb();\n if ($in_stock) {\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n WHERE\n inventory_count > 0\n \");\n } else {\n $statement = $db->prepare(\"\n SELECT\n *\n FROM\n product\n \");\n }\n $statement->execute();\n $result = $statement->fetchAll(PDO::FETCH_OBJ);\n return $result;\n}",
"public function getSpecialBlockProductLowAd($args)\n {\n $view = Zikula_View::getInstance($this->name);\n $shop_id = FormUtil::getPassedValue('shop_id', null, 'REQUEST');\n\n $country_id = FormUtil::getPassedValue('country_id', null, 'REQUEST');\n $region_id = FormUtil::getPassedValue('region_id', null, 'REQUEST');\n $city_id = FormUtil::getPassedValue('city_id', null, 'REQUEST');\n $area_id = FormUtil::getPassedValue('area_id', null, 'REQUEST');\n $category_id = FormUtil::getPassedValue('category_id', null, 'REQUEST');\n $branch_id = FormUtil::getPassedValue('branch_id', null, 'REQUEST');\n $adtype = FormUtil::getPassedValue('adtype', null, 'REQUEST');\n $amount = FormUtil::getPassedValue('amount', null, 'REQUEST');\n $limit = FormUtil::getPassedValue('limit', null, 'REQUEST');\n $search = FormUtil::getPassedValue('hsearch', null, 'REQUEST');\n $search = ($search == $this->__('search for...') || $search == $this->__('search'))\n ? '' : $search;\n $aff_id = FormUtil::getPassedValue('aff_id', null, 'REQUEST');\n\n $lowad_args = array(\n 'ad_type' => 'low',\n 'country_id' => $country_id,\n 'region_id' => $region_id,\n 'city_id' => $city_id,\n 'area_id' => $area_id,\n 'shop_id' => $shop_id,\n 'category_id' => $category_id,\n 'branch_id' => $branch_id,\n 'aff_id' => $aff_id,\n 'search' => $search,\n 'limit' => $limit\n );\n\n $lowad = ModUtil::apiFunc('ZSELEX', 'user', 'getSpecialDealAd',\n $lowad_args);\n\n $productcount = count($lowad);\n $lowadCount = count($lowad);\n $data = '';\n $view->assign('lowad', $lowad);\n $view->assign('lowadCount', $lowadCount);\n $output_tpl = $view->fetch('ajax/productadlow.tpl');\n $data .= new Zikula_Response_Ajax_Plain($output_tpl);\n // return $data;\n $output [\"count\"] = $productcount;\n $output [\"data\"] = $data;\n AjaxUtil::output($output);\n }",
"public function LoadProductsForPrice()\n\t\t{\n\t\t\t$query = \"\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t\" . GetProdCustomerGroupPriceSQL() . \"\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (\" . $this->GetProductCategoryIds() . \") AND\n\t\t\t\t\t\t\tp.prodcalculatedprice >= '\".(int)$this->GetMinPrice().\"' AND\n\t\t\t\t\t\t\tp.prodcalculatedprice <= '\".(int)$this->GetMaxPrice().\"'\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t\" . $this->GetSortField() . \", p.prodname ASC\n\t\t\t\t\t\t\" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . \"\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t\";\n\n\t\t\t//$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));\n\t\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t\twhile ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n\t\t\t\t$row['prodavgrating'] = (int)$row['prodavgrating'];\n\t\t\t\t$this->_priceproducts[] = $row;\n\t\t\t}\n\t\t}",
"public function bestProductsAction()\n\t{\n $this->checkShopToken();\n\t\t\n\t\t$config = EasymarketingConfig::getInstance();\n \n $limit = Shopware()->Front()->Request()->getParam('limit');\n $most_sold_since = Shopware()->Front()->Request()->getParam('most_sold_since');\n $most_sold_since_date = date('Y-m-d H:i:s', $most_sold_since);\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t$pids = Shopware()->Db()->fetchAll(\"SELECT sacro.articleID AS id, (SELECT SUM(od.quantity) FROM s_order_details od WHERE od.articleID = sacro.articleID AND od.modus = 0) as sales\n\t\t\t\t\t\t\t\t\t\t\t\tFROM s_articles_categories_ro sacro \n INNER JOIN s_order_details od ON sacro.articleID = od.articleID\n \t\t\t\t\t\t\t\tINNER JOIN s_order o ON od.orderID = o.id\n\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN s_articles sa ON od.articleID = sa.id\n WHERE o.ordertime > '\".$most_sold_since_date.\"' AND sa.active = 1 AND (sacro.categoryID = '\".$config->getRootCategoryID().\"' OR sacro.parentCategoryID = '\".$config->getRootCategoryID().\"')\n GROUP BY sacro.articleID\n \t\t\t\t\t\t\t\tORDER BY SUM(od.quantity) DESC\n\t\t\t\t\t\t\t\t\t\t\t\tLIMIT \".$limit);\n\t\t\t\t\t\t\t\t\t\t\t\n $i = 0;\n\t\t\n\t\t$productsdata = array();\n\t\t\n\t\tif(count($pids) > 0)\n\t\t{\n\t\t\tforeach ($pids as $key => $val)\n\t\t\t{\n\t\t\t\t$productsdata[$i] = array('id' => $val['id'], 'sales' => (int)$val['sales']);\n\t\t\t\t$i++;\n\t\t\t} \n\t\t} else {\n\t\t\t$test_product_id = Shopware()->Db()->fetchOne(\"SELECT sacro.articleID AS id FROM s_articles_categories_ro sacro LEFT JOIN s_articles sa ON sa.id = sacro.articleID WHERE sa.active = 1 AND (sacro.categoryID = '\".$config->getRootCategoryID().\"' OR sacro.parentCategoryID = '\".$config->getRootCategoryID().\"') GROUP BY sacro.articleID ORDER BY sacro.articleID LIMIT 1\");\n\t\t\t$productsdata[0] = array('id' => $test_product_id['id'], 'sales' => 0);\n\t\t}\n\t\t\n $jsondata = array(\n 'limit' => $limit,\n 'most_sold_since' => $most_sold_since,\n 'products' => $productsdata\n );\n \n\t\t$this->printOutput($jsondata);\n }",
"function basel_get_compared_products_data() {\n\t\t$ids = basel_get_compared_products();\n\n\t\tif ( empty( $ids ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$args = array(\n\t\t\t'include' => $ids,\n\t\t\t'limit' => 100,\n\t\t);\n\n\t\t$products = wc_get_products( $args );\n\n\t\t$products_data = array();\n\n\t\t$fields = basel_get_compare_fields();\n\n\t\t$fields = array_filter(\n\t\t\t$fields,\n\t\t\tfunction( $field ) {\n\t\t\t\treturn 'pa_' === substr( $field, 0, 3 );\n\t\t\t},\n\t\t\tARRAY_FILTER_USE_KEY\n\t\t);\n\n\t\t$divider = '-';\n\n\t\tforeach ( $products as $product ) {\n\t\t\t$rating_count = $product->get_rating_count();\n\t\t\t$average = $product->get_average_rating();\n\n\t\t\t$products_data[ $product->get_id() ] = array(\n\t\t\t\t'basic' => array(\n\t\t\t\t\t'title' => $product->get_title() ? $product->get_title() : $divider,\n\t\t\t\t\t'image' => $product->get_image() ? $product->get_image() : $divider,\n\t\t\t\t\t'rating' => wc_get_rating_html( $average, $rating_count ),\n\t\t\t\t\t'price' => $product->get_price_html() ? $product->get_price_html() : $divider,\n\t\t\t\t\t'add_to_cart' => basel_compare_add_to_cart_html( $product ) ? basel_compare_add_to_cart_html( $product ) : $divider,\n\t\t\t\t),\n\t\t\t\t'id' => $product->get_id(),\n\t\t\t\t'image_id' => $product->get_image_id(),\n\t\t\t\t'permalink' => $product->get_permalink(),\n\t\t\t\t'dimensions' => wc_format_dimensions( $product->get_dimensions( false ) ),\n\t\t\t\t'description' => $product->get_short_description() ? $product->get_short_description() : $divider,\n\t\t\t\t'weight' => $product->get_weight() ? $product->get_weight() : $divider,\n\t\t\t\t'sku' => $product->get_sku() ? $product->get_sku() : $divider,\n\t\t\t\t'availability' => basel_compare_availability_html( $product ),\n\t\t\t);\n\n\t\t\tforeach ( $fields as $field_id => $field_name ) {\n\t\t\t\tif ( taxonomy_exists( $field_id ) ) {\n\t\t\t\t\t$products_data[ $product->get_id() ][ $field_id ] = array();\n\t\t\t\t\t$orderby = wc_attribute_orderby( $field_id ) ? wc_attribute_orderby( $field_id ) : 'name';\n\t\t\t\t\t$terms = wp_get_post_terms( $product->get_id(), $field_id, array(\n\t\t\t\t\t\t'orderby' => $orderby\n\t\t\t\t\t) );\n\t\t\t\t\tif ( ! empty( $terms ) ) {\n\t\t\t\t\t\tforeach ( $terms as $term ) {\n\t\t\t\t\t\t\t$term = sanitize_term( $term, $field_id );\n\t\t\t\t\t\t\t$products_data[ $product->get_id() ][ $field_id ][] = $term->name;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$products_data[ $product->get_id() ][ $field_id ][] = '-';\n\t\t\t\t\t}\n\t\t\t\t\t$products_data[ $product->get_id() ][ $field_id ] = implode( ', ', $products_data[ $product->get_id() ][ $field_id ] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $products_data;\n\t}",
"function products_from_request($page, $page_count){\n\tglobal $con;\n\t\n\t$args = [];\n\t$arg_types = \"\";\n\t$query = \"\n\t\tSELECT *\n\t\tFROM `products`\n\t\tINNER JOIN `categories`\n\t\t\tON `categories`.category_id = `products`.product_category\n\t\tINNER JOIN manufacturers\n\t\t\tON `manufacturers`.manufacturer_id = `products`.product_manufacturer\";\n\t\n\t// Now the dynamic part of our query, filtering logic\n\t\n\t$has_w = false;\n\t\n\t// view only products of a certain category.\n\tif(!empty($_GET['c'])){\n\t\t$args [] = &$_GET['c'];\n\t\t$query .= \" WHERE category_id = ? \";\n\t\t$arg_types .= \"i\";\n\t\t$has_w = true;\n\t}\n\t\n\t// view only products of a certain manufacturer\n\tif(!empty($_GET['m'])) {\n\t\t$args [] = &$_GET['m'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" manufacturer_id = ? \";\n\t\t$arg_types .= \"i\";\n\t\t$has_w = true;\n\t}\n\t\n\t// where the name of the product is...\n\tif(!empty($_GET['n'])) {\n\t\t$query_name = \"%\" . $_GET['n'] . \"%\";\n\t\t$args [] = &$query_name;\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_name LIKE ? \";\n\t\t$arg_types .= \"s\";\n\t\t$has_w = true;\n\t}\n\t\n\t// price range...\n\tif(!empty($_GET['p-min'])) {\n\t\t$args [] = &$_GET['p-min'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_price >= ? \";\n\t\t$arg_types .= \"d\";\n\t\t$has_w = true;\n\t}\n\t\n\tif(!empty($_GET['p-max']) ) {\n\t\t$args [] = &$_GET['p-max'];\n\t\t$query .= $has_w ? \" AND \" : \" WHERE \";\n\t\t$query .= \" product_price <= ? \";\n\t\t$arg_types .= \"d\";\n\t\t$has_w = true;\n\t}\n\t\n\t// ordering\n\t\n\tif(isset($_GET['o'])){\n\t\t$order = intval($_GET['o']);\n\t} else {\n\t\t$order = 1;\n\t}\n\t\n\tswitch($order){\n\t\tcase 1:\n\t\t\t$query .= \" ORDER BY product_name ASC \";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\t$query .= \" ORDER BY product_price DESC \";\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\t$query .= \" ORDER BY product_price ASC \";\n\t\t\tbreak;\n\t}\n\t\n\t\n\t// now we want to limit number of rows we're getting.\n\t$from = ($page - 1) * 20;\n\t$query .= \" LIMIT $from, 20 \";\n\t\n\t\n\t// Now put the query together...\n\tif(count($args) > 0){\n\t\t// the input data types string is the first argument to the bind_param \n\t\t// method, so we have to prepend it at the start of the args array\n\t\tarray_unshift($args, $arg_types);\n\t\t\n\t\t$prep = $con->prepare($query);\n\t\t\n\t\t// since the bind_param is a vararg function, we need to use some\n\t\t// funky shit... i.e., we need to be able to call the function by \n\t\t// passing an array of our arguments.\n\t\tcall_user_func_array(array($prep,'bind_param'), $args);\n\t\t\n\t\t$prep->execute();\n\t\t$result = $prep->get_result();\n\t\t$prep->close();\n\t\t\n\t} else {\n\t\t$result = $con->query($query);\n\t}\n\treturn $result;\n\t\n}",
"public function setThreshold($threshold)\n {\n $this->threshold = $threshold;\n }",
"function listRandomProducts($num) {\r\n\t\t$query = \"SELECT * FROM \".TBL_PRODUCTS.\" WHERE available = '1' AND stock > 0 ORDER BY RAND() LIMIT \".$num;\r\n\t\t$stmt = $this->connection->prepare($query);\r\n\t\t$stmt->execute();\r\n\t\t$dbarray = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n\t\t$count = $stmt->rowCount();\r\n\t\tif(!$dbarray || $count < 1){\r\n\t\t\treturn 1; // failure\r\n\t\t} else {\r\n\t\t\treturn $dbarray; // success\r\n\t\t}\r\n\t}"
] |
[
"0.6444908",
"0.60787195",
"0.59869635",
"0.5718473",
"0.54003423",
"0.53233254",
"0.52776116",
"0.5174383",
"0.50976324",
"0.50802666",
"0.50383127",
"0.5012269",
"0.50065404",
"0.49734414",
"0.4965311",
"0.49083698",
"0.4900192",
"0.4896155",
"0.48909825",
"0.48825473",
"0.48813584",
"0.4860002",
"0.48574308",
"0.48540622",
"0.48409763",
"0.48353767",
"0.48290455",
"0.48199207",
"0.47940654",
"0.4789413"
] |
0.8001712
|
0
|
__construct Return formatted offset (in hours) $separator is used as a separator between hour and minutes part of formatted value
|
function getFormattedOffset($separator = ':') {
if($this->offset == 0) {
return '';
} // if
$sign = $this->offset > 0 ? '+' : '-';
$hours = abs($this->offset) / 3600;
if($hours < 10) {
$hours = '0' . floor($hours);
} // if
$minutes = (abs($this->offset) % 3600) / 60;
if($minutes < 10) {
$minutes = '0' . $minutes;
} // if
return $sign . $hours . $separator . $minutes;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected static function _offset_str() {\n // get the offset\n $offset = get_option( 'gmt_offset', 0 );\n\n // get the sign of the offset\n $sign = $offset < 0 ? '-' : '+';\n\n // get the suffix, either :00 or :30\n $offset = abs( $offset );\n $floored = floor( $offset );\n $suffix = $offset == $floored ? ':00' : ':30';\n\n return sprintf( '%s%02s%s', $sign, $offset, $suffix );\n }",
"function getTime($offset){\n $hours = date('h');\n $minutes = (date('i') > 30) ? '30' : '00';\n $minutes = $minutes + $offset;\n if($minutes >= 60){\n $hours = $hours + (int)($minutes / 60);\n if($hours > 12)\n $hours -= 12;\n $minutes = $minutes % 60;\n }\n $minutes = ($minutes==0) ? '00' : $minutes;\n return \"$hours:$minutes\" . date('A');\n}",
"public function testSetSeparator()\n {\n $separator = 'foo';\n \n $interval = new Interval();\n \n $this->assertSame($interval, $interval->setSeparator($separator));\n $this->assertEquals($separator, $this->getProperty('separator', $interval));\n \n return;\n }",
"function __construct($hour)\n {\n $this->Hour = $hour;\n }",
"function getTime($offset = 0, $format = 'H:i:s')\n {\n return date($format, strtotime($offset.' minutes'));\n }",
"public function setSeparator($separator)\n {\n if ($separator == null) {\n throw new Exception('\"' . $separator . '\" is not a valid separator.');\n }\n $this->separator = $separator;\n return $this;\n }",
"public function setSeparator($separator);",
"public function getTime(string $field = 'created_at', string $timeSeparator = \":\"): string\n {\n return $this->getHour($field) . $timeSeparator . $this->getMinute($field);\n }",
"function setOffset($offset) {\n\t\t$this->_offset = 3600 * $offset;\n\t}",
"public static function parseString(string $value, string $separator = \":\"): Timer\n {\n [$hours, $minutes, $seconds] = array_map(\n static function ($str): int {\n return (int) $str;\n },\n explode($separator, $value)\n );\n\n return self::get()->hours($hours)->minutes($minutes)->seconds($seconds);\n }",
"function formatTimezoneOffset($offset=false) {\n\t\t$tzoffset = false;\n\t\tif (preg_match('/^[\\-+]?[0-9\\.]+$/',$offset)>0) { //must be a number\n\t\t\t//convert seconds to hours:min\n\t\t\t$n=false;\n\t\t\tif ($offset > 12 || $offset < -12) {\n\t\t\t\t$noffset = $offset/3600;\n\t\t\t} else {\n\t\t\t\t$noffset = $offset;\n\t\t\t}\n\t\t\t$n = strpos($noffset,'.');\n\t\t\tif ($n !== false) {\n\t\t\t\t$offset_hrs = substr($noffset,0,$n);\n\t\t\t\t$offset_min = (int)substr($noffset,$n+1)*6;\n\t\t\t} else {\n\t\t\t\t$offset_hrs = $noffset;\n\t\t\t\t$offset_min = 0;\n\t\t\t}\n\t\t\tif ($offset < 0) {\n\t\t\t\t$tzoffset = sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t}\n\t\t} elseif (preg_match('/^([\\-+])?(\\d{1,2})?\\:(\\d{2})/',$offset,$match)>0) {\n\t\t\tif (empty($match[2])) $match[2] = \"0\";\n\t\t\tif (!empty($match[1]) && $match[1]==\"-\") {\n\t\t\t\t$tzoffset = \"-\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t}\n\t\t}\n\t\treturn $tzoffset;\n\t}",
"public function setSeparator($sep)\n {\n $this->separator = $sep;\n return $this;\n }",
"public function getTimeFull(string $field = 'created_at', string $timeSeparator = \":\"): string\n {\n return $this->getHour($field) . $timeSeparator . $this->getMinute($field) . $timeSeparator . $this->getSecond($field);\n }",
"public function getHour(): string\n {\n return $this->toLocalizedString('H');\n }",
"public function getTimeFormatter();",
"public function separator(string $value = ''): self\n {\n $new = clone $this;\n $new->separator = $value;\n return $new;\n }",
"public function setByHour($value)\n {\n if (!$this->piecesAreInRange($value, 59)) {\n throw new InvalidArgumentException('Invalid value for BYHOUR');\n }\n\n $this->byHour = $value;\n\n return $this;\n }",
"public function __toString()\n {\n if ($this->hh <= 9) {\n $retorno = \"0\" . $this->hh . \":\";\n } else {\n $retorno = $this->hh . \":\";\n }\n\n if ($this->mm <= 9) {\n $retorno .= \"0\" . $this->mm . \":\";\n } else {\n $retorno .= $this->mm . \":\";\n }\n\n if ($this->ss <= 9) {\n $retorno .= \"0\" . $this->ss;\n } else {\n $retorno .= $this->ss;\n }\n return $retorno;\n }",
"static function time($value){\n\t\t$separator = \":\";\n\t\t$value = substr($value, 0, 8);\n\t\tif((strlen($value) == 8) && (substr($value, 2, 1) == $separator) && (substr($value, 5, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = (int) substr($value, 6, 2);\n\t\t}elseif((strlen($value) == 5) && (substr($value, 2, 1) == $separator)){\n\t\t\t$hou = (int) substr($value, 0, 2);\n\t\t\t$min = (int) substr($value, 3, 2);\n\t\t\t$sec = 0;\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t\tif(($hou < 0 || $hou > 23) || ($min < 0 || $min > 59) || ($sec < 0 || $sec > 59)){\n\t\t\treturn null;\n\t\t}else{\n\t\t\treturn str_pad($hou, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($min, 2, \"0\", STR_PAD_LEFT).$separator.str_pad($sec, 2, \"0\", STR_PAD_LEFT);\n\t\t}\n\t}",
"public static function urlSeparator($separator=null) {\r\n\t\t$class = __CLASS__;\r\n if(!empty($separator)) {\r\n $class::_object()->url_separator = $separator;\r\n }\r\n\t\treturn (isset($class::_object()->url_separator) && !empty($class::_object()->url_separator)) ? $class::_object()->url_separator:'-';\r\n\t}",
"public function setSeparator($separator) {\n $this->_separator = $separator;\n }",
"function segundos_hhmm($seg) {\n $horas = floor($seg / 3600);\n $minutos = floor($seg / 60 % 60);\n $segundos = floor($seg % 60);\n\n return sprintf('%02d:%02d:%02d', $horas, $minutos, $segundos);\n }",
"function formatHoursMinutes($float){\n\t\t$hours = floor($float);\n\t\t$minutes = ($float - $hours) * 60; //to get the number of minutes\n\t\treturn sprintf(\"%+02d:%02d\", $hours, $minutes); //sprintf - gives the ability to control the formatting through a series of codes - writes a formatted string to a variable\n\t\t//$hours goes into %+02d (1st argument) - makes sure it has 2 digits. It is going to put a - or a + in front of the $hours value \n\t\t//$minutes goes into %02d (2nd argument) - makes sure it has 2 digits. \n\t}",
"function paramDate($dt,$separator='/',$format='Y-m-d H:i') {\n\t\t \n\t\t$strs = explode($separator, $dt);\n\t\t$day = $strs[0];\n\t\t$month = $strs[1];\n\t\t$strs = explode(\" \", $strs[2]);\n\t\t$year = $strs[0];\n\t\t\n\t\t$hour = 0;\n\t\t$min = 0;\n\t\t$sec = 0;\n\t\t\n\t\tif (!empty($strs[1])) {\n\t\t\t$strs = explode(\":\", $strs[1]);\n\t\t\t$hour = $strs[0];\n\t\t\t$min = $strs[1];\n\t\t\tif(!empty($strs[2]))\n\t\t\t\t$sec = $strs[2];\n\t\t}\n\t\t \n\t\treturn '\\''. date($format, mktime($hour,$min,$sec, $month, $day, $year )) . '\\''; \n\t}",
"public function __construct($deliminator = ':') {\n\t\t$this->deliminator = $deliminator;\n\t}",
"public function formatTime()\n { \n return sprintf('%02d:%02d:%02d', ($this->totaltime / 3600), \n ($this->totaltime / 60 % 60), $this->totaltime % 60); \n }",
"public function setExpirationOffset(string $offset = self::DEFAULT_EXPIRATION_DATE_OFFSET): self\n {\n if ($this->expirationTime) {\n throw OsstException::propertyAlreadySet('Expiration time');\n }\n\n if (empty($offset)) {\n throw OsstException::emptyExpirationOffset();\n }\n\n try {\n $this->expirationTime = (new DateTimeImmutable())->modify($offset)->getTimestamp();\n\n if ($this->expirationTime <= time()) {\n throw OsstException::expirationTimeInPast($this->expirationTime);\n }\n } catch (Throwable $e) {\n throw OsstException::invalidExpirationOffset($offset, $e->getMessage(), $e);\n }\n\n return $this;\n }",
"public function timeFormat();",
"public function setSeparator($sep)\n {\n $this->setOption('separator', $sep);\n return $this;\n }",
"public function format(?string $format = null): string\n {\n $hour = (sprintf('%\\'02d', $this->parts['hour']) ?: '00');\n $minute = (sprintf('%\\'02d', $this->parts['minute']) ?: '00');\n $second = (sprintf('%\\'02d', $this->parts['second']) ?: '00');\n\n if (!$format) {\n $format = '%H' . $this->partsSeparator . '%i' . $this->partsSeparator . '%s';\n }\n\n return strtr(\n $format,\n [\n '%H' => $hour,\n '%i' => $minute,\n '%s' => $second\n ]\n );\n }"
] |
[
"0.560024",
"0.5406659",
"0.53971404",
"0.52885264",
"0.51786005",
"0.5111599",
"0.5099189",
"0.5047155",
"0.4936421",
"0.49154708",
"0.489826",
"0.48935005",
"0.4867687",
"0.48573565",
"0.48354527",
"0.4822188",
"0.48123193",
"0.47892925",
"0.46845275",
"0.46837154",
"0.46835163",
"0.4678021",
"0.4660156",
"0.46404985",
"0.46032205",
"0.4602256",
"0.4585963",
"0.45817858",
"0.4577219",
"0.45706788"
] |
0.7767719
|
0
|
getFormattedOffset Return string representation of this timezone
|
function __toString() {
return '(GMT' . $this->getFormattedOffset() . ') ' . $this->getName();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected static function _offset_str() {\n // get the offset\n $offset = get_option( 'gmt_offset', 0 );\n\n // get the sign of the offset\n $sign = $offset < 0 ? '-' : '+';\n\n // get the suffix, either :00 or :30\n $offset = abs( $offset );\n $floored = floor( $offset );\n $suffix = $offset == $floored ? ':00' : ':30';\n\n return sprintf( '%s%02s%s', $sign, $offset, $suffix );\n }",
"private function getTimeZoneOffset()\n {\n if (null === $this->offset) {\n $time = new \\DateTime('now', new \\DateTimeZone($this->localeSettings->getTimeZone()));\n $this->offset = $time->format('P');\n }\n\n return $this->offset;\n }",
"function getFormattedOffset($separator = ':') {\n if($this->offset == 0) {\n return '';\n } // if\n \n $sign = $this->offset > 0 ? '+' : '-';\n $hours = abs($this->offset) / 3600;\n if($hours < 10) {\n $hours = '0' . floor($hours);\n } // if\n $minutes = (abs($this->offset) % 3600) / 60;\n if($minutes < 10) {\n $minutes = '0' . $minutes;\n } // if\n \n return $sign . $hours . $separator . $minutes;\n }",
"function formatTimezoneOffset($offset=false) {\n\t\t$tzoffset = false;\n\t\tif (preg_match('/^[\\-+]?[0-9\\.]+$/',$offset)>0) { //must be a number\n\t\t\t//convert seconds to hours:min\n\t\t\t$n=false;\n\t\t\tif ($offset > 12 || $offset < -12) {\n\t\t\t\t$noffset = $offset/3600;\n\t\t\t} else {\n\t\t\t\t$noffset = $offset;\n\t\t\t}\n\t\t\t$n = strpos($noffset,'.');\n\t\t\tif ($n !== false) {\n\t\t\t\t$offset_hrs = substr($noffset,0,$n);\n\t\t\t\t$offset_min = (int)substr($noffset,$n+1)*6;\n\t\t\t} else {\n\t\t\t\t$offset_hrs = $noffset;\n\t\t\t\t$offset_min = 0;\n\t\t\t}\n\t\t\tif ($offset < 0) {\n\t\t\t\t$tzoffset = sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$offset_hrs, $offset_min);\n\t\t\t}\n\t\t} elseif (preg_match('/^([\\-+])?(\\d{1,2})?\\:(\\d{2})/',$offset,$match)>0) {\n\t\t\tif (empty($match[2])) $match[2] = \"0\";\n\t\t\tif (!empty($match[1]) && $match[1]==\"-\") {\n\t\t\t\t$tzoffset = \"-\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t} else {\n\t\t\t\t$tzoffset = \"+\".sprintf(\"%d:%02d\",$match[2], $match[3]);\n\t\t\t}\n\t\t}\n\t\treturn $tzoffset;\n\t}",
"function getTimeOffset()\n {\n return $this->_props['TimeOffset'];\n }",
"public function getDSTOffset();",
"public function getUtcOffset()\n {\n return $this->utcOffset;\n }",
"function erp_wp_timezone_string() {\n $timezone_string = get_option( 'timezone_string' );\n\n if ( $timezone_string ) {\n return $timezone_string;\n }\n\n $offset = (float) get_option( 'gmt_offset' );\n $hours = (int) $offset;\n $minutes = ( $offset - $hours );\n\n $sign = ( $offset < 0 ) ? '-' : '+';\n $abs_hour = abs( $hours );\n $abs_mins = abs( $minutes * 60 );\n $tz_offset = sprintf( '%s%02d:%02d', $sign, $abs_hour, $abs_mins );\n\n return $tz_offset;\n}",
"protected function getOffset(\\codename\\core\\model\\plugin\\offset $offset) : string {\r\n if ($offset->offset > 0) {\r\n return \" OFFSET \" . $offset->offset . \" \";\r\n }\r\n return '';\r\n }",
"public static function getTimezoneText($tz=null) {}",
"function getOffset() {\n\t\treturn ((float) $this->_offset) / 3600.0;\n\t}",
"public function getUtcOffset(){\n $datetime = new DateTime('now', 'UTC');\n return parent::getOffset($datetime);\n }",
"public static function getTimezoneNameByOffset($offset = -1) {\n \n $timeZoneOffset = $offset > 0 ? ($offset * 60) : $offset;\n \n $timezoneName = timezone_name_from_abbr(\"\", $timeZoneOffset, false);\n \n return $timezoneName;\n }",
"public function getTimezoneName(): string\n {\n return $this->timezone->getName();\n }",
"public function getStringOffset() {}",
"public function getFormattedAddress()\n {\n return $this->FormattedAddress;\n }",
"public function getFormattedAddress()\n {\n return $this->formattedAddress;\n }",
"public function toIso8601String()\n {\n return $this->toAtomString();\n }",
"public function format()\n {\n return sprintf('%s %s %s', $this->x(), $this->y(), $this->z());\n }",
"public function __toString() : string\n {\n return $this->toISOZonal();\n }",
"public function getTimezoneOffset()\n\t{\n\t\t$user_tz = date_default_timezone_get();\n\t\t$viewer = Engine_Api::_() -> user() -> getViewer();\n\t\tif ($viewer -> getIdentity())\n\t\t{\n\t\t\t$user_tz = $viewer -> timezone;\n\t\t}\n\t\t//user time zone\n\t\tdate_default_timezone_set($user_tz);\n\n\t\t$t1 = strtotime('2010-10-10 00:00:00');\n\t\tdate_default_timezone_set('UTC');\n\t\t$t2 = strtotime('2010-10-10 00:00:00');\n\t\treturn (int)(($t2 - $t1) / 3600);\n\t}",
"public function updated_at_formatted_rfc3339()\n {\n $date = new Carbon($this->wrappedObject->updated_at);\n\n return $date->toRfc3339String();\n }",
"public function getTimezoneOffset($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"public function getOffset() {\n return $this->offset;\n }",
"public function getTimezoneId();",
"public function toString() : string\n {\n return sprintf(\n self::TO_STRING_FORMAT,\n $this->y,\n $this->m,\n $this->d,\n $this->h,\n $this->i,\n $this->s\n );\n }",
"public function getOffset();",
"public function getOffset();",
"public function getOffset();",
"public function getOffset() {}"
] |
[
"0.76397324",
"0.64204973",
"0.616955",
"0.6162698",
"0.6105278",
"0.6023903",
"0.59751165",
"0.59748936",
"0.5970386",
"0.5819668",
"0.5817315",
"0.5813576",
"0.5809136",
"0.5655143",
"0.55860656",
"0.5585534",
"0.5533452",
"0.5505316",
"0.55053145",
"0.5421277",
"0.5381506",
"0.5374744",
"0.5358617",
"0.5357804",
"0.52961785",
"0.5295068",
"0.52803546",
"0.52803546",
"0.52803546",
"0.5267735"
] |
0.68869495
|
1
|
getOffset Set offset value
|
function setOffset($value) {
$this->offset = $value;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function setOffset($offset);",
"public function setOffset($offset);",
"public function setOffset($offset) {}",
"public function setOffset($offset) { $this->_offset = $offset; }",
"public function setOffset($var)\n {\n GPBUtil::checkInt32($var);\n $this->offset = $var;\n }",
"public function setOffset($var)\n {\n GPBUtil::checkInt64($var);\n $this->offset = $var;\n }",
"public function setOffset($value){\n \n $this->offset = $value;\n\n return $this;\n\n }",
"function getOffset() ;",
"public function getOffset();",
"public function getOffset();",
"public function getOffset();",
"public function setOffset($offset) {\n $this->offset = (int)$offset;\n }",
"public function setOffset($offset) {\n\t\t$this->offset = $offset;\n\t}",
"public function getOffset($value);",
"public function setOffset($offset, $value, $container = 'default');",
"function setOffset($offset) {\n\t\t$this->_offset = 3600 * $offset;\n\t}",
"public function setOffset($offset)\r\n {\r\n $this->offset = intval($offset);\r\n }",
"public function set($offset, $value);",
"function setOffset ($offSet, $newOffset) {\r\n $offSet = $offSet + $newOffset; \r\n return $offSet;\r\n}",
"public function getOffset() {}",
"public function getOffset() {}",
"public function getOffset() {}",
"public function setCustomOffset($offset){\n try{\n if($offset<0){\n $this->customOffset = 0;\n return true;\n }\n $this->customOffset= (int)$offset;\n }catch (Exception $ex){\n $errorObj = new ErrorObj();\n\n $errorObj->params = \"offset\";\n $errorObj->msg = \"offset int required\";\n\n array_push($this->errorManager->errorObj,$errorObj);\n return false;\n }\n\n }",
"public function getOffset($value)\r\n\t{\r\n\t}",
"function setOffset($offset) {\n if ($offset !== ($oldOffset = $this->offset)) {\n $this->offset = $offset;\n $this->updateDataControlRecords();\n }\n }",
"public function get_offset(){\r\n return $this->$new_offset;\r\n }",
"public function set($offset, $value = null);",
"public function setOffsetFor($objectId, $generation, $offset) {}",
"public function addOffset($offset) {}",
"public function get_offset()\n {\n }"
] |
[
"0.7380748",
"0.7380748",
"0.7328481",
"0.7130436",
"0.71299195",
"0.70659167",
"0.6987159",
"0.6970453",
"0.6949419",
"0.6949419",
"0.6949419",
"0.6946381",
"0.6938955",
"0.6899276",
"0.68629164",
"0.6859699",
"0.68093836",
"0.6684232",
"0.6650577",
"0.6632096",
"0.6632096",
"0.6632096",
"0.6627147",
"0.66090107",
"0.65811646",
"0.65743655",
"0.65735453",
"0.6540964",
"0.65274066",
"0.65204406"
] |
0.74511856
|
0
|
getName Set name value
|
function setName($value) {
$this->name = $value;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function _setName($name, $value) {}",
"public function set_name($name);",
"function setName($value) {\n $this->name = $value;\n }",
"function setName( $value )\n {\n $this->Name = $value;\n }",
"function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }",
"function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }",
"function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }",
"function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }",
"function setName( $value )\r\n {\r\n $this->Name = $value;\r\n }",
"public function setName($value)\r\n {\r\n $this->name = $value;\r\n }",
"public function setName($value)\r\n {\r\n $this->name = $value;\r\n }",
"public function setName($x) { $this->name = $x; }",
"function setName( &$value )\r\n {\r\n $this->Name = $value;\r\n }",
"function setName( &$value )\r\n {\r\n $this->Name = $value;\r\n }",
"public function setName($value);",
"function set_name($name) {\n $this->name = $name;\n }",
"public function setName($val)\n {\n $this->name = $val;\n }",
"public function SetName ($name);",
"protected function _setNameValue($key, $name) {}",
"public function setName($val) {\n $this->name = $val;\n }",
"function setName( &$value )\n {\n $this->Name = $value;\n }",
"public function setName($name);",
"public function setName($name);",
"public function setName($name);",
"public function setName($name);",
"public function setName($name);",
"public function setName($name);",
"public function setName($name);",
"public function setName($name);",
"public function setName($name);"
] |
[
"0.784831",
"0.7664291",
"0.75768113",
"0.7556895",
"0.7513149",
"0.7513149",
"0.7513149",
"0.7513149",
"0.7513149",
"0.7506896",
"0.7506896",
"0.75016284",
"0.74490726",
"0.74490726",
"0.7400021",
"0.7396805",
"0.7382609",
"0.73821324",
"0.7367539",
"0.7327302",
"0.73148704",
"0.7296504",
"0.7296504",
"0.7296504",
"0.7296504",
"0.7296504",
"0.7296504",
"0.7296504",
"0.7296504",
"0.7296504"
] |
0.76670605
|
1
|
Create data paths if they don't exist
|
function createDataPaths() {
foreach ($this->data_paths as $path) {
if (!file_exists($this->root . $path)) {
mkdir($this->root . $path);
}
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function checkPaths() {\n\tif(!file_exists(MODEL_PATH)) {\n\t\tmkdir(MODEL_PATH);\n\t}\n\tif(!file_exists(ENTITY_PATH)) {\n\t\tmkdir(ENTITY_PATH);\n\t}\n\tif(!file_exists(REPOSITORY_PATH)) {\n\t\tmkdir(REPOSITORY_PATH);\n\t}\n}",
"protected function createPathIfNeeded() {}",
"public function createDirectoriesIfTheyDontExist()\n {\n $directories = array(\n $this->getNewSitemapPath(),\n $this->getExistingSitemapPath()\n );\n foreach ($directories as $directory){\n if(!file_exists($directory)){\n mkdir($directory);\n }\n }\n }",
"function createDirectoryIfNonExistent() {\n if (! file_exists($this->path)) {\n mkdir($this->path);\n }\n }",
"public function mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider() {}",
"function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}",
"public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }",
"public function createDirectoriesIfTheyDontExist()\n\t{\n\t\t$directories = array(\n\t\t\t$this->getIntegrationDirectory(),\n\t\t\t$this->getProductsProcessingDirectory(),\n\t\t\t$this->getProductsProcessedDirectory(),\n\t\t\t$this->getStockProcessingDirectory(),\n\t\t\t$this->getStockProcessedDirectory()\n\t\t);\n\t\tforeach ($directories as $directory){\n\t\t\tif(!file_exists($directory)){\n\t\t\t\tmkdir($directory);\n\t\t\t}\n\t\t}\n\t}",
"private function updatePaths()\n\t{\n\t\t$hash = $this->e107->makeSiteHash($this->previous_steps['mysql']['db'],$this->previous_steps['mysql']['prefix']);\n\t\t$this->e107->site_path = $hash;\t\n\t\t\n\t\t$this->previous_steps['paths']['hash'] = $hash;\n\n\t\t$omit = array('FILES_DIRECTORY','WEB_IMAGES_DIRECTORY');\n\t\t\n\t\tforeach($this->e107->e107_dirs as $dir => $p)\n\t\t{\n\t\t\tif(in_array($dir, $omit)) { continue; }\t\n\t\t\t\n\t\t\t$this->e107->e107_dirs[$dir] = str_replace(\"[hash]\", $hash, $this->e107->e107_dirs[$dir]);\n\t\t\t\t\t\n\t\t\tif(!is_dir($this->e107->e107_dirs[$dir]))\n\t\t\t{\n\t\t\t\t@mkdir($this->e107->e107_dirs[$dir]);\t\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t}",
"protected function createNecessaryDirectoriesInDocumentRoot() {}",
"protected function createNecessaryDirectoriesInDocumentRoot() {}",
"protected function createDirectories() :void\n {\n $directories = ['Entities', 'Resources', 'Services'];\n\n foreach ($directories as $directory) {\n $directory = app_path($directory);\n\n Storage::makeDirectory($directory, true);\n Storage::put($directory . '/' . '.gitkeep', \"\");\n }\n }",
"function mscaffolding_prepare_directories($name)\n\t{\n\t\tmkdir(\"data/scaffolding/\" . $name);\n\t\tmkdir(\"data/scaffolding/\" . $name . \"/views\");\n\t}",
"protected function createDirectories() {\n\t\t@mkdir($this->getAbsoluteBasePath(), 0777, TRUE); // @ - Directories may exist\n\t}",
"function init($app_paths){\n\t\t\tforeach ($app_paths as $app_path) {\n\t\t\t\tif( file_exists($app_path) ){\n\t\t\t\t\t// \n\t\t\t\t} else {\n\t\t\t\t\tmkdir($app_path, '744');\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"protected function createOtherDirs()\n {\n $this->createDir('Database', true);\n $this->createDir('Database/Migrations', true);\n $this->createDir('Database/Seeds', true);\n $this->createDir('Filters', true);\n $this->createDir('Language', true);\n $this->createDir('Validation', true);\n }",
"public function maybeCreateJsonFolder()\n {\n $path = $this->getJsonFolder();\n\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n if (!file_exists($path . DIRECTORY_SEPARATOR . $this->type)) {\n mkdir($path . DIRECTORY_SEPARATOR . $this->type, 0777, true);\n }\n }",
"function mdl_create_directory_if_not_exists(string $dirname)\n{\n // Create the path directory if not exists\n if (!is_dir($dirname)) {\n mkdir($dirname, 0777, true);\n }\n}",
"public function test_create_exists()\n {\n Directory::create(ROOT.DS.'application');\n }",
"protected function createDirectories()\n {\n if (! is_dir(app_path('Http/Controllers/Teamwork'))) {\n mkdir(app_path('Http/Controllers/Teamwork'), 0755, true);\n }\n if (! is_dir(app_path('Listeners/Teamwork'))) {\n mkdir(app_path('Listeners/Teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork'))) {\n mkdir(base_path('resources/views/teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/emails'))) {\n mkdir(base_path('resources/views/teamwork/emails'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/members'))) {\n mkdir(base_path('resources/views/teamwork/members'), 0755, true);\n }\n }",
"public function generateDataYmlDirectoryPath()\n {\n return self::DATA_CSV_PATH.$this->generateDataSubDirectoryPath();\n }",
"protected function buildFsTree()\n {\n mkdir($this->config_path, 0755, true);\n mkdir($this->compiledViewsPath(), 0755, true);\n }",
"function createExportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t\n\t\t// create learning module directory (data_dir/lm_data/lm_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t\t// create Export subdirectory (data_dir/lm_data/lm_<id>/Export)\n\t\t$export_dir = $svy_dir.\"/export\";\n\t\tilUtil::makeDir($export_dir);\n\t\tif(!@is_dir($export_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Export Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}",
"protected function createDirectory() {}",
"private function createDiskIfNotExists(): void\n {\n if (!File::exists(config('filesystems.disks.starmap.root'))) {\n Storage::makeDirectory(config('filesystems.disks.starmap.root'));\n }\n }",
"protected function createDirectories()\n {\n if (! is_dir(app_path('Handlers'))) {\n mkdir(app_path('Handlers'), 0755, true);\n }\n\n if (! is_dir(app_path('Handlers/EventHandlers'))) {\n mkdir(app_path('Handlers/EventHandlers'), 0755, true);\n }\n\n if (! is_dir(app_path('Http/Controllers/Wechat'))) {\n mkdir(app_path('Http/Controllers/Wechat'), 0755, true);\n }\n }",
"function check_and_create_import_dir($unique_code) {\n global $CFG; \n $status = $this->check_dir_exists($CFG->dataroot.\"/temp\",true);\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import\",true);\n }\n if ($status) {\n $status = $this->check_dir_exists($CFG->dataroot.\"/temp/webworkquiz_import/\".$unique_code,true);\n }\n return $status;\n }",
"public function setInitialPaths() {}",
"protected function init()\n {\n $dir = $this->getDir();\n\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n }",
"private function checkFolderPathExist()\n {\n $folderPath = $this->getFolderPath();\n if (!file_exists($folderPath)) {\n mkdir($folderPath, 0777, true);\n }\n }"
] |
[
"0.67559695",
"0.65342903",
"0.6474291",
"0.64642096",
"0.64087284",
"0.6195741",
"0.6179369",
"0.61084855",
"0.6083956",
"0.6069642",
"0.6069642",
"0.6013155",
"0.5961295",
"0.59612215",
"0.5876574",
"0.58550024",
"0.5854584",
"0.5849277",
"0.58380944",
"0.57846564",
"0.5773357",
"0.5727249",
"0.5722201",
"0.5690346",
"0.5674917",
"0.56605303",
"0.5658425",
"0.5649367",
"0.5635677",
"0.5616296"
] |
0.8785431
|
0
|
Get a specific page part based on a separator
|
function getPageSegment($separator = null, $offset = 0) {
$page = $this->getCurrentPage();
if (!$separator) {
if (file_exists($this->getPagePath($page))) {
require_once $this->getPagePath($page);
}
return;
}
$path = $this->getPagePath($page);
$string = file_get_contents($path);
$segments = explode($separator, $string);
if(array_key_exists($offset, $segments)){
$segment = $segments[$offset];
if (substr($segment, 0, 5) !== "<?php") {
$segment = "?>" . $segment;
}
eval($segment);
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function retrieve_sep() {\n\t\treturn WPSEO_Utils::get_title_separator();\n\t}",
"public function getPageAndRootline() {}",
"function GetBetween($content, $start, $end) {\r\n\t$r = explode($start, $content);\r\n\tif (isset($r[1])) {\r\n\t\t$rcount = count($r);\r\n\t\t$r = explode($end, $r[$rcount-2]);\r\n\t\treturn $r[0];\r\n\t}\r\n\treturn '';\r\n}",
"private function retrieve_page() {\n\t\t$replacement = null;\n\n\t\t$max = $this->determine_pagenumbering( 'max' );\n\t\t$nr = $this->determine_pagenumbering( 'nr' );\n\t\t$sep = $this->retrieve_sep();\n\n\t\tif ( $max > 1 && $nr > 1 ) {\n\t\t\t/* translators: 1: current page number, 2: total number of pages. */\n\t\t\t$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'wordpress-seo' ), $nr, $max );\n\t\t}\n\n\t\treturn $replacement;\n\t}",
"public function getPage($pageNo) {\n\t\t$splitContent = explode(\"<!-- pagebreak -->\", $this->content);\t\t\n\t\treturn $splitContent[$pageNo-1];\n\t}",
"function my_document_title_separator($sep) {\n if (is_singular(array('post', 'page'))) {\n $sep = '|';\n }\n\n return $sep;\n}",
"function _kala_migrate_get_between($content, $start, $end) {\n // Explode this and let's find our stuff.\n $r = explode($start, $content);\n if (isset($r[1])){\n $r = explode($end, $r[1]);\n return $r[0];\n }\n // Return empty of nothing can be found.\n return '';\n}",
"public function getPagePath();",
"function GetBetween2($content, $start, $end) {\r\n\t$r = explode($start, $content);\r\n\tif (isset($r[1])) {\r\n\t\t$rcount = count($r);\r\n\t\t// changed from -2 to -1\r\n\t\t$r = explode($end, $r[$rcount-1]);\r\n\t\treturn $r[0];\r\n\t}\r\n\treturn '';\r\n}",
"function pageNumbers($separator=null)\n\t{\n\t\tif (empty($this->_pageDetails) || $this->_pageDetails['pageCount'] == 1) { return false; }\n\t\t$t = array();\n\t\t$text = '';\n\t\t$pc = 1;\n\t\t do \n\t\t {\n\t\t\t if($pc == $this->_pageDetails['page'])\n\t\t\t {\n\t\t\t\t$text = '<span>'.$pc.'</span>';\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tif($this->style == 'ajax')\n\t\t\t\t{\n\t\t\t\t\t$text = $this->Ajax->link($pc, array(\"fallback\"=>$this->action.\"#\",\"url\" =>$this->link.$pc,\"update\" => \"ajax_update\",\"method\"=>\"get\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$text = $this->Html->link($pc,$this->link.$pc);\n\t\t\t\t}\n\t\t\t }\n\t\t\t \n\t\t\t $t[] = $text;\n\t\t\t $pc++;\n\t\t } \n\t\t while ($pc<=$this->_pageDetails['pageCount']);\n\t\t \n\t\t $t = implode($separator, $t);\n \n\t\treturn $t;\n\t}",
"public function getSeparator();",
"private static function splitPath_getPath($page) /* WARNING: maybe we can simplify this fonction as dots are probably not used anymore */\r\n\t{\r\n\t\tif( ! strstr($page, '.') )\r\n\t\t\treturn Array($page, \"$page/\");\r\n\t\treturn Array(str_replace('.', '/', $page), '');\r\n\t}",
"function netrics_get_string_between( $start, $stop, $content ) {\n $str = explode( $start, $content );\n\n if ( isset( $str[1] ) ) {\n $str_btwn = explode( $stop, $str[1] );\n return $str_btwn[0];\n } else {\n return false;\n }\n}",
"function horizon_second_separator() {\n\t\tget_template_part('inc/partials/homepage', 'separator');\n\t}",
"function myPageNumbers($separator=null)\n\t{\n\t\tif (empty($this->_pageDetails) || $this->_pageDetails['pageCount'] == 1) { return false; }\n\t\t$t = array();\n\t\t$text = '';\n\t\t$pc = 1;\n\t\t do \n\t\t {\n\t\t\t if($pc == $this->_pageDetails['page'])\n\t\t\t {\n\t\t\t\t$text = '<span class=numberlinkon> '.$pc.'</span>';\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\tif($this->style == 'ajax')\n\t\t\t\t{\n\t\t\t\t\t$text = \" \".$this->Ajax->link($pc, $this->link.$pc, array(\"update\" => \"ajax_update\",\"method\"=>\"get\",\"class\"=>\"numberlink\"));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$text = \" \".$this->Html->link($pc,$this->link.$pc,array(\"class\"=>\"numberlink\"));\n\t\t\t\t}\n\t\t\t }\n\t\t\t \n\t\t\t $t[] = $text;\n\t\t\t $pc++;\n\t\t } \n\t\t while ($pc<=$this->_pageDetails['pageCount']);\n\t\t \n\t\t $t = implode($separator, $t);\n \n\t\treturn $t;\n\t}",
"function string_get_between($content,$start,$end){\n\t$r = explode($start, $content);\n\tif (isset($r[1])){\n\t\t$r = explode($end, $r[1]);\n\t\treturn $r[0];\n\t}\n\treturn '';\n}",
"public static function getBreadcrumbs($sep='➝')\n\t{\n\t\t$path = parse_url($_SERVER[\"REQUEST_URI\"], PHP_URL_PATH);\n\n\t\t$str = '';\n\t\t$linkURL = '';\n\n\t\t$pagesList = explode('/',ltrim($path, \"/\"));\n\n\t\t$c = count($pagesList);\n\t\tfor ($i=0; $i < $c; $i++) {\n\t\t\tunset($linkText);\n\n\t\t\t$page = array_shift($pagesList);\n\t\t\t\n\t\t\t$linkURL .= \"/$page\";\n\t\t\t\n\t\t\t$fullFilePath = BP.\"/app/views$linkURL.phtml\";\n\t\t\t\n\t\t\t# find the break point for the meta data\n\t\t\tif (file_exists($fullFilePath)) {\n\t\t\t\t$fileParts = explode(\"{endmeta}\", file_get_contents($fullFilePath), 2);\n\t\t\t\t\n\t\t\t\tif (isset($fileParts[0])) # does the template have meta data\n\t\t\t\t\t$metaDataArray = parse_ini_string($fileParts[0]);\n\t\t\t\t\n\t\t\t\tif (isset($metaDataArray['linkText']))\n\t\t\t\t\t$linkText = $metaDataArray['linkText'];\n\t\t\t\telseif (isset($metaDataArray['title']))\n\t\t\t\t\t$linkText = $metaDataArray['title'];\n\t\t\t}\n\n\t\t\tif (!isset($linkText))\n\t\t\t\t$linkText = self::ucwordss(str_replace('-',' ',$page), [\"is\", \"to\", \"the\", \"for\"]);\t\t\t\t\n\n\t\t\tif ($i+1 == $c) # last one\n\t\t\t\t$str .= ' '.$sep.' '.$linkText;\n\t\t\telse\n\t\t\t\t$str .= ' '.$sep.' <a href=\"'.$linkURL.'\">'.$linkText.'</a>';\n\t\t}\n\n\t\t$indexFileParts = explode(\"{endmeta}\", file_get_contents(BP.\"/app/views/index.phtml\"), 2);\n\t\t\t\t\n\t\tif (isset($indexFileParts[0])) # does the template have meta data\n\t\t\t$metaDataArray = parse_ini_string($indexFileParts[0]);\n\t\t\n\t\tif (isset($metaDataArray['linkText']))\n\t\t\t$linkText = $metaDataArray['linkText'];\n\t\telse\n\t\t\t$linkText = 'Home';\n\n\t\treturn '<a href=\"/\">'.$linkText.'</a>'.$str;\n\t}",
"public function getPart(string $location, int $offset, ?int $limit = null): string;",
"private function get($part)\n {\n return $this->parts[$part];\n }",
"function extractFromDelimiters($string, $start, $end)\n{\n if (strpos($string, $start) !== false) {\n $section_retrieved = substr($string, strpos($string, $start) + strlen($start));\n $section_retrieved = substr($section_retrieved, 0, strpos($section_retrieved, $end));\n return $section_retrieved;\n }\n return false;\n}",
"function wantedSection() {\n $urlParts = $this->_getPathUrl();\n return $urlParts[$this->sectionOffset];\n }",
"function urlSegment($int=''){\n $input = get('url');\n $input = explode('/', $input);\n $int--;\n return $input[$int];\n }",
"public function page(int $page): string;",
"function getSection($integrateToFooter) {\n\t\tif ($integrateToFooter) {\n\t\t\treturn t3lib_PageRenderer::PART_FOOTER;\n\t\t} else {\n\t\t\treturn t3lib_PageRenderer::PART_HEADER;\n\t\t}\n\t}",
"function get_page_by_path($page_path, $output = \\OBJECT, $post_type = 'page')\n {\n }",
"public function getPagePart($location)\n {\n global $post;\n if (locate_template('templates/page-parts/' . $post->post_name . '-' . $location . '.php') != '') {\n get_template_part('templates/page-parts/' . $post->post_name, $location);\n }\n }",
"public function getQuerySeparator();",
"public function get_page();",
"function getpage() {\n global $pages; /* so the included files know about it */\n\n $page = $_GET['page'];\n if ((preg_match('^/[a-z][a-z]/', $page)) && (in_array($page, $pages)))\n return $page;\n else\n return 'news';\n}",
"function horizon_separator() {\n\t\tget_template_part('inc/partials/homepage', 'separator');\n\t}"
] |
[
"0.57453215",
"0.5699004",
"0.564245",
"0.55057347",
"0.5493339",
"0.54912233",
"0.54887736",
"0.5403282",
"0.5386913",
"0.53800327",
"0.53039503",
"0.5279974",
"0.5261361",
"0.5247758",
"0.5232001",
"0.5230051",
"0.52015996",
"0.518301",
"0.51635355",
"0.51576906",
"0.5149027",
"0.5137124",
"0.51175934",
"0.5092231",
"0.507648",
"0.50521785",
"0.500532",
"0.49867377",
"0.4983449",
"0.49823773"
] |
0.69484967
|
0
|
Returns the blueprint selected for a page
|
function getBlueprint($page) {
if (array_key_exists($page, $this->pages)){
return $this->pages[$page][2];
}
else {
return "error";
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getBlueprint($path) {\n $blueprints = $this->toObjects();\n // If the blueprint does not exist then return null\n // As blueprints may change over time we don't throw an exception\n if (!isset($blueprints[$path])) { return null; }\n // Return the found blueprint object\n return $blueprints[$path];\n }",
"public function getPage()\n\t{\n\t $url = URL::segment(1);\n\t\treturn $this->crud->_where(\"url = $url\")\n\t\t\t\t\t->read('row')\n\t\t;\n\t}",
"protected function getName()\r\n {\r\n return app::values()->page();\r\n }",
"public function blueprintName(): string\n {\n if (!isset($_POST['blueprint'])) {\n return $this->template();\n }\n\n $post_value = $_POST['blueprint'];\n $sanitized_value = htmlspecialchars(strip_tags($post_value), ENT_QUOTES, 'UTF-8');\n\n return $sanitized_value ?: $this->template();\n }",
"public function getPageType();",
"public function getPageType();",
"public function getBlueprint() {\n return $this->blueprint;\n }",
"public function getSelectedItem()\n {\n $tab = intval($_REQUEST[\"tab\"]);\n $swagPostItems = $this->getSwagPostItems();\n return $swagPostItems[$tab];\n }",
"function active_for($url)\n{\n $url = ltrim(URL::makeRelative($url), '/');\n\n return app()->request->is($url) ? 'selected' : '';\n}",
"public function getPage() {\n return $this->getValueOrDefault('Page');\n }",
"public function get_page() {\n return $this->list_page;\n }",
"function getBlueprintPath() {\n $blueprints_path = $this->root . \"/includes/blueprints/\";\n $blueprint = $this->getBlueprint($this->getCurrentPage());\n return $blueprints_path . $blueprint . \".php\";\n }",
"public function get_page();",
"public function selected_link() {\n\t\treturn $this->sets[':default']->selected_link();\n\t}",
"public function getPage() {\n return $this->_page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"public function getPage()\n {\n return $this->page;\n }",
"function get_active_menu (string $page, string $page_active, string $class_active = \"active\") {\n return $page == $page_active ? $class_active : \"\";\n }",
"function get_active_menu (string $page, string $page_active, string $class_active = \"active\") {\n return $page == $page_active ? $class_active : \"\";\n }",
"public function getPage() {\n\t\treturn $this->page;\n\t}",
"public static function get($class)\n {\n return ModelBlueprint::exists($class) ? ModelBlueprint::$blueprints[$class] : null;\n }",
"function kleo_bp_get_component_id() {\n $current_page_id = NULL;\n $page_array = get_option('bp-pages');\n\n if (bp_is_register_page()) { /* register page */\n $current_page_id = $page_array['register'];\n } elseif( bp_is_members_component() || bp_is_user() ) { /* members component */\n $current_page_id = $page_array['members'];\n } elseif ( bp_is_activity_directory() ) { /* activity directory */\n $current_page_id = $page_array['activity'];\n } elseif ( bp_is_groups_directory() || bp_is_group_single() ) { /* groups directory */\n $current_page_id = $page_array['groups'];\n } elseif ( bp_is_activation_page() ) { /* activation page */\n $current_page_id = $page_array['activate'];\n }\n return $current_page_id;\n}",
"function cinerama_edge_get_admin_tab() {\n\t\treturn isset( $_GET['page'] ) ? cinerama_edge_strafter( $_GET['page'], 'tab' ) : null;\n\t}"
] |
[
"0.584936",
"0.55787504",
"0.54640734",
"0.54612523",
"0.54595774",
"0.54595774",
"0.5456226",
"0.5436747",
"0.5411898",
"0.52955526",
"0.5264857",
"0.5255768",
"0.5218499",
"0.5207892",
"0.52038294",
"0.51897573",
"0.51897573",
"0.51897573",
"0.51897573",
"0.51897573",
"0.51897573",
"0.51897573",
"0.51897573",
"0.51897573",
"0.5189357",
"0.5189357",
"0.5181882",
"0.5180226",
"0.51761043",
"0.517268"
] |
0.6676475
|
0
|
Returns the absolute path of a blueprint
|
function getBlueprintPath() {
$blueprints_path = $this->root . "/includes/blueprints/";
$blueprint = $this->getBlueprint($this->getCurrentPage());
return $blueprints_path . $blueprint . ".php";
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function baseRelPath()\n {\n if($this instanceof Layout)\n {\n $class = Application::getApp();\n }\n else\n {\n $class = \\get_class($this);\n }\n $reflector = new \\ReflectionClass($class);\n $parts = \\explode('\\\\', $reflector->getName());\n $parts = \\array_chunk($parts, 3, false);\n return \\strtolower(\\implode('/', $parts[0])) . '/';\n }",
"public function path(): string\n {\n return components_path($this->name);\n }",
"protected function getApplicationConfigPath()\n {\n return config_path('blueprints.php');\n }",
"public function getWebappPath();",
"public function getBlueprint($path) {\n $blueprints = $this->toObjects();\n // If the blueprint does not exist then return null\n // As blueprints may change over time we don't throw an exception\n if (!isset($blueprints[$path])) { return null; }\n // Return the found blueprint object\n return $blueprints[$path];\n }",
"public static function path()\n {\n return class_basename(get_called_class());\n }",
"public function getPath()\n {\n $controller = str_replace('\\\\', '/', $this->get('controller'));\n\n $path = (empty($controller) ? '' : $controller . '/') . $this->get('name') . '.' . $this->get('engine');\n\n return empty($this->parameters['bundle']) ? $path : '@' . $this->get('bundle') . '/resource/view/' . $path;\n }",
"protected function getAbsoluteBasePath() {}",
"protected function getLocalConfigurationPath()\n {\n return __DIR__ . '/../config/blueprints.php';\n }",
"protected function route_base() {\n\t\treturn substr( strrchr( get_class( $this ), '\\\\' ), 1 );\n\t}",
"private function basePath()\n {\n $directory = dirname((new \\ReflectionClass(self::class))->getFileName());\n\n return $directory . '/../../../../twig-bridge/src/BenGorUser/TwigBridge/Infrastructure/Ui';\n }",
"public function getBlueprint() {\n return $this->blueprint;\n }",
"public function getFullPath()\n\t{\n\t\treturn $this->getServerName() . $this->getScriptDirectory();\n\t}",
"public function getFullPath();",
"public function guessPackagePath()\n\t{\n\t\t$path = with(new \\ReflectionClass($this))->getFileName();\n\n\t\treturn realpath(dirname($path).'/../');\n\t}",
"function base_path()\n {\n $paths = getPaths();\n\n return $paths['base'];\n }",
"public function getModulePath()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[0];\r\n }",
"public function show_path()\n\t{\n\t\treturn url::site(Kohana::config('routes.base_crud_route') . inflector::plural($this->object_name) . '/show');\n\t}",
"protected function getStubPath()\n {\n // Stub path.\n $stub_path = dirname(dirname(dirname(dirname(__DIR__)))).'/resources/stubs/';\n // Return the stub path.\n return $stub_path;\n }",
"public function getFullPath(): string;",
"public function getWebPathname();",
"public function getAbsolutePath() {}",
"public function getAbsolutePath() {}",
"public function path(): string\n {\n return '/books/' . $this->id;\n }",
"public function getFullPath()\n\t{\n\t\treturn Generic::getCompletePath($this->getPath(), $this->getBasename());\n\t}",
"public function getAbsolutePath();",
"protected static function _getApiPath(){\n\t\t$params = array();\n\t\treturn static::_filter(__FUNCTION__, $params, function($self, $params) {\n\t\t\textract($params);\n\n\t\t\t$currentPath = dirname(__FILE__);\n\t\t\t$fbLib = $currentPath . '/../libraries/facebook-sdk/src/facebook.php';\n\t\t\treturn \\realpath($fbLib);\n\t\t});\n\t}",
"function app_path()\n {\n return base_path() . '/app';\n }",
"public function getFullPath()\n {\n $assetstore = $this->get('assetstore');\n\n return $assetstore->getPath().'/'.$this->getPath();\n }",
"private function getBoilerplatePath(): string\n {\n return __DIR__ . '/../boilerplate';\n }"
] |
[
"0.6636436",
"0.624166",
"0.6204595",
"0.6190389",
"0.61745155",
"0.61164665",
"0.61068994",
"0.6098502",
"0.60939884",
"0.60193497",
"0.60184896",
"0.60125136",
"0.5975249",
"0.59632146",
"0.59573877",
"0.5949806",
"0.5940894",
"0.59219027",
"0.5902524",
"0.58920044",
"0.5885308",
"0.5875833",
"0.5875833",
"0.58742094",
"0.5873806",
"0.5858127",
"0.5857277",
"0.58528644",
"0.5841764",
"0.5841233"
] |
0.8124123
|
0
|
Renders a page depending on a blueprint
|
function renderPage() {
$parameters = explode("/", $this->getCurrentPage());
$folder = $parameters[1];
if (!in_array($folder, $this->folders) && $folder !== "api") {
$name = $this->getCurrentPage();
require_once $this->getBlueprintPath();
}
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"abstract function render_page();",
"public function render_page() {\n\t\t$this->render_template();\n\t}",
"public function default_page_render()\r\n {\r\n // instances page 404\r\n include $this->bootstrap->base_controller_dir . 'Wpf_page_not_found.php';\r\n $pageNotFound = new \\WPFP\\App\\Controllers\\Wpf_page_not_found();\r\n $pageNotFound->index();\r\n }",
"public function reqBiblePage() {\n $this->instance = new Bible();\n $this->view($this->instance->getBible(false, false), 'bible', 'Bíblia');\n }",
"public function view() {\n\t\t// Find page by url slug\n\t\t$slug = $this->app->getSlug();\n\t\t$page = Page::findBySlug($slug);\n\t\t\n\t\t// If page exists render it, otherwise 404\n\t\tif ($page) {\n\t\t\t$this->title = $page->name;\n\t\t\t$this->pageData['page'] = $page;\n\t\t\t$this->render('view');\n\t\t} else {\n\t\t\t$this->noRoute();\n\t\t}\n\t}",
"public function render()\n {\n if (is_archive()) {\n // Archive stuff\n } else {\n // Get Template vars\n $context = Timber::get_context();\n $post = new \\TimberPost();\n $context['post'] = $post;\n // Render Template\n Timber::render('pages/single-book.twig', $context);\n }\n }",
"public function render() {\n\t\t$this->title = \"Pagina niet gevonden\";\n\t\techo \"\\t\\t\\t\\t\\t<h2>404</h2>\\n\\t\\t\\t\\t\\t<p>De opgegeven pagina kon niet gevonden worden</p>\";\n\t}",
"public function action_view()\n {\n // Correct page has been loaded in the before() function\n $pagename = Wi3::inst()->routing->args[0];\n $this->prepareForViewing($pagename);\n // Render page\n $renderedInAdminArea = false;\n $this->request->response = Wi3_Renderer::renderPage($pagename, $renderedInAdminArea);\n // Page caching will be handled via an Event. See bootstrap.php and the Caching plugin\n }",
"public function render(){\n require_once($_SERVER['DOCUMENT_ROOT'].\"//views/\".self::$page_name.\"/\".self::$page_name.\".php\");\n }",
"abstract protected function renderFirstView();",
"abstract protected function render_page_content(): void;",
"public function display() {\n\t\t$path = func_get_args();\n\n\t\t$count = count($path);\n\t\tif (!$count) {\n\t\t\t$this -> redirect('/');\n\t\t}\n\t\t$page = $subpage = $title_for_layout = null;\n\n\t\tif (!empty($path[0])) {\n\t\t\t$page = $path[0];\n\t\t}\n\t\tif (!empty($path[1])) {\n\t\t\t$subpage = $path[1];\n\t\t}\n\t\tif (!empty($path[$count - 1])) {\n\t\t\t$title_for_layout = Inflector::humanize($path[$count - 1]);\n\t\t}\n\t\t$this -> set(compact('page', 'subpage', 'title_for_layout'));\n\t\t$this -> render(implode('/', $path));\n\t}",
"public function HandlePage()\n\t{\n\t\tif(!gzte11(ISC_HUGEPRINT)) {\n\t\t\texit;\n\t\t}\n\n\t\t$this->SetVendorData();\n\n\t\tif($this->displaying == 'products') {\n\t\t\t$this->ShowVendorProducts();\n\t\t}\n\t\telse if($this->displaying == 'page') {\n\t\t\t$this->ShowVendorPage();\n\t\t}\n\t\telse if($this->displaying == 'profile') {\n\t\t\t$this->ShowVendorProfile();\n\t\t}\n\t\telse {\n\t\t\t$this->ShowVendors();\n\t\t}\n\t}",
"protected function getPageRenderer() {}",
"protected function render() {}",
"protected function render() {}",
"protected function render() {}",
"function go()\n {\n $this->session->layout == 'gallery' ? \n $this->data['pagebody'] = 'Roster/rosterGal' : \n $this->data['pagebody'] = 'Roster/rosterTab'; \n $this->render();\n }",
"function internship(){\n // show the internship page\n echo Template::instance()->render('views/internships.php');\n}",
"public function render()\r\n\t{\r\n\t\t$this->site->page = $this;\r\n\t\t// if noone is subscribed, we want to output our own 404\r\n\t\tif(!$this->site->event->subscribers('404'))\r\n\t\t{\r\n\t\t\t$this->site->event->subscribe('404', array($this, '_404'));\r\n\t\t}\r\n\t\tif( $this->controller === null )\r\n\t\t{\r\n\t\t\t$this->site->event->publish('404');\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(ob_get_length() > 0)\r\n\t\t\t{\r\n\t\t\t\tob_end_clean();\r\n\t\t\t}\r\n\t\t\theader(\"Connection: close\");\r\n\t\t\theader(\"X-Powered-By: \"); // Remove the header, don't need to advertise how out of date we are...\r\n\t\t\t//TODO: Figure out how to remove \"Server\" header also.. doesn't appear you can do this from inside php?\r\n\t\t\tob_start();\r\n\t\t\t$this->site->event->publish('Page::onRender');\r\n\t\t\tcall_user_func_array(array($this->controller, 'setup'), $this->controllerParams);\r\n\t\t\tcall_user_func_array(array($this->controller, $this->controllerMethod), $this->controllerParams);\r\n // are we doing a json response? if not, we assume html...\r\n if($this->site->response->json === false\r\n && $this->site->webCatalog->isRedirect === false) {\r\n $viewFile = $this->controller->viewFile;\r\n if ($viewFile === null) // if not defined, auto grab em... @todo - this fails miserably when you're using dynamic paths. For now just set it in your controller. But it should be fixed.\r\n {\r\n if ($this->requestedPath === '/' ||\r\n $this->requestedPath === ''\r\n ) {\r\n $path = 'index';\r\n } else {\r\n if (strpos($this->requestedPath, '.')) {\r\n $path = substr($this->requestedPath, 0, strpos($this->requestedPath, '.'));\r\n } else {\r\n $path = $this->requestedPath;\r\n }\r\n $path = trim($path, '/');\r\n }\r\n if ($ext = $this->site->config('template', 'extension')) {\r\n $viewFile = $path . '.' . $ext;\r\n } else {\r\n $viewFile = $path . '.tpl';\r\n }\r\n }\r\n if ($this->controller->autoRender === true) {\r\n // do we have a view file?\r\n if (is_string($this->site->config('site', 'viewPath'))) {\r\n $viewPaths = [$this->site->config('site', 'viewPath')];\r\n } else {\r\n $viewPaths = $this->site->config('site', 'viewPath');\r\n }\r\n $_404 = true; // check if a valid template\r\n foreach ($viewPaths as $i => $p) {\r\n $viewPaths[$i] = $this->site->appFolder . $p;\r\n if (is_file($viewPaths[$i] . DIRECTORY_SEPARATOR . $viewFile) === true) {\r\n $_404 = false;\r\n }\r\n }\r\n if ($_404) {\r\n $this->site->event->publish('404');\r\n } else {\r\n switch ($this->site->config('template', 'engine')) {\r\n case 'smarty':\r\n // Summon Smarty Template Engine\r\n $this->template = new Smarty();\r\n $this->template->muteExpectedErrors(); // something is conflicting with our error class. See smarty docs for this.\r\n // Absolute path to the root template dir\r\n if ($this->site->config('site', 'viewPath')) {\r\n $this->template->setTemplateDir(realpath($this->site->appFolder . $this->site->config('site', 'viewPath')));\r\n } else {\r\n $this->site->error->toss('[site] viewPath must be defined in your config!');\r\n }\r\n if ($this->site->config('smarty', 'configDir')) {\r\n $this->template->setConfigDir(realpath($this->site->appFolder . $this->site->config('smarty', 'configDir')));\r\n }\r\n // These directories need FULL WRITE ACCESS\r\n // and could be stored outside of the web root for security purposes:\r\n if ($this->site->config('smarty', 'compileDir')) {\r\n $this->template->setCompileDir(realpath($this->site->appFolder . $this->site->config('smarty', 'compileDir')));\r\n }\r\n if ($this->site->config('smarty', 'cacheDir')) {\r\n $this->template->setCacheDir(realpath($this->site->appFolder . $this->site->config('smarty', 'cacheDir')));\r\n }\r\n $this->site->event->publish('Page::SmartyPlugins');\r\n // Assign template variables from the controller\r\n if (isset($this->controller->view)) {\r\n foreach ($this->controller->view as $key => $value) {\r\n $this->template->assign($key, $value);\r\n }\r\n }\r\n // Finally, display the template...\r\n try {\r\n $this->template->display($viewFile);\r\n } catch (Exception $e) {\r\n $this->site->error->toss($e->getMessage(), E_USER_WARNING);\r\n }\r\n break;\r\n case 'twig':\r\n\r\n try {\r\n\r\n $env = $this->getTwigEnvironment();\r\n $this->site->event->publish(\"Twig::Twig_Environment\", $env);\r\n\r\n echo $this->renderTemplate($viewFile, $this->controller->view);\r\n } catch (Exception $e) {\r\n $this->site->error->toss($e->getMessage(), E_USER_WARNING);\r\n $this->site->event->publish('404');\r\n }\r\n break;\r\n default:\r\n $fname = $this->site->appFolder . $this->site->config('site', 'viewPath') . '/' . $viewFile;\r\n if ($file = realpath($fname)) {\r\n require($file);\r\n } else {\r\n $this->site->error->toss('Unable to auto render with view file: ' . $fname);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\t\t\theader(\"Content-Length: \".ob_get_length());\r\n\t\t\tob_end_flush();\r\n\t\t\tflush();\r\n\t\t\tcall_user_func_array(array($this->controller, 'shutdown'), $this->controllerParams);\r\n\t\t\t$this->site->event->publish('Page::afterRender');\r\n\t\t}\r\n\t}",
"public function renderPage(){\n try {\n // show deferred failure from initPage\n if( ! $this->ctrl ){\n throw new Loco_error_Exception( __('Page not found','loco-translate') );\n }\n // display loco admin page\n echo $this->ctrl->render();\n }\n catch( Exception $e ){\n $ctrl = new Loco_admin_ErrorController;\n try {\n $ctrl->_init( array() );\n }\n catch( Exception $_e ){\n // avoid errors during error rendering\n }\n echo $ctrl->renderError($e);\n }\n // ensure session always shutdown cleanly after render\n Loco_data_Session::close();\n }",
"public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page . '.phtml';\n\t}",
"public function display($pageName);",
"public function render() {\n\t\t$this->render_page_content();\n\t}",
"function studentResources(){\n // show the student resources page\n echo Template::instance()->render('views/studentResources.php');\n}",
"protected function render( $page_name , $data )\n\t {\n\t \t//append security headers\n\t \t$this->append_security_headers( $data );\n\t \tif( $this->_app_mode === 'json' )\n\t \t{\n\t \t\t//exits at once !\n\t \t\treturn $this->render_json( $data );\n\t \t}\n\t \t$this->load->view('admin/html/partials/head' , $data );\n\t \t$this->load->view('admin/html/' . $page_name , $data );\n\t \t//$this->load->view\n\t }",
"public function getPageRenderer() {}",
"public function getPageRenderer() {}",
"public function render()\n {\n if (file_exists('../resources/views/' . $this->view_name . '.phtml')) {\n include_once '../resources/views/' . $this->view_name . '.phtml';\n include_once '../resources/views/layouts/' . $this->layout . '.phtml';\n } else {\n die(\"THERE IS NO VIEW\");\n }\n }",
"abstract function render();"
] |
[
"0.7105096",
"0.6464701",
"0.62827325",
"0.61327416",
"0.6093963",
"0.6043877",
"0.6041936",
"0.6041167",
"0.5983265",
"0.59358984",
"0.59240687",
"0.58928615",
"0.58440727",
"0.58274853",
"0.58203477",
"0.58203477",
"0.5818994",
"0.5811174",
"0.5760676",
"0.5749378",
"0.57439893",
"0.5740418",
"0.5725456",
"0.57223564",
"0.5717001",
"0.56869185",
"0.56853443",
"0.56849235",
"0.56816316",
"0.56708324"
] |
0.72522646
|
0
|
Sets the class identity variable based on the id passed. Will iterate through users until it finds a match, then will set identity to said data.
|
private function setIdentity($id) {
$userData = false;
foreach ($this->users as $user) {
if ($user['id'] === $id) {
$userData = $user;
}
}
$this->identity = $userData;
return true;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function _setIdentity(){\n $this->_setUserData($this->getClassUser()->getIdentity());\n }",
"public static function findIdentity($id);",
"function get_id($user_id){\n\t\t$this->id = $user_id;\n\t}",
"public function setId($id) {\n $this->set('id', $id, 'user');\n }",
"public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}",
"protected function _setIdentity($id, $entity) {\r\n\t\tif (!$this->_hasIdentity($id)) {\r\n\t\t\t$this->_identityMap[$id] = $entity;\r\n\t\t}\r\n\t}",
"public function __construct($id) {\n\t\t$query = (is_numeric($id)) ? \"SELECT * FROM Users WHERE userId = :id\" : \"SELECT * FROM Users WHERE UCASE(email) = UCASE(:id)\";\n\t\t$query_params = array(':id' => $id);\n\t\t$stmt = executeSQL($query, $query_params);\n\t\t$results = $stmt->fetch();\n\n\t\tforeach ($results as $col => $data) {\n\t\t\t$this->userData[$col] = $data;\n\t\t}\n\n\t\t$this->fullName = $this->userData['fullName'];\n\t\t$this->userId = $this->userData['userId'];\n\t\t$this->scoutTeamNumber = $this->userData['teamNumber'];\n\t}",
"public static function findIdentity($id)\n {\n return User::find()->where(['id'=>$id])->one();\n }",
"public function setIduser($value)\n {\n $this->iduser = $value;\n }",
"private function setId($id)\n {\n $session = new Zend_Session_Namespace('Unodor_Account');\n $session->idaccount = $id;\n }",
"abstract public function fetchUserById($id);",
"function SetId($value) { $this->id=$value; }",
"public function setIdentifier($id)\n {\n $this->uid = (int)$id;\n }",
"public function setUserId($id)\n {\n $this->userId = $id;\n }",
"public function setIdentity($value);",
"public function setIdentity($id)\n {\n $this->_id = $id;\n return $this;\n }",
"public function getUserById($id) {\n\t\t\n\t}",
"static public function setId($id){\n \tif (self::$_id != $id){\n \t\tself::$_id = $id;\n \t\tself::regenerate();\n \t}\n }",
"static function loginUsingId($id)\n\t{\n\t\t$session = App::get('session');\n\t\t$user = DB::load('users', $id);\n\t\tif($user->group > 0) {\n\t\t\t$user['rights'] = self::loadRights((int)$user->group);\n\t\t}\n\t\tself::$user = $user;\n\t\t$session->set('user', self::$user);\n\t\tself::createSession($id);\n\t}",
"function set_identity($gender='*', $first_name='*', $last_name='*')\r\n{\r\n\t// primary identifiers\r\n\t$this->set_gender($gender);\r\n\t$this->set_first_name($first_name);\r\n\t$this->set_last_name($last_name);\r\n\t\r\n\t// secondary\r\n\t$this->full_name = $this->first_name . ' ' . $this->last_name;\r\n\t$this->set_user_name();\r\n\t$this->set_email();\r\n}",
"function get_id($id){\n\t\t$this->id = $id;\n\t}",
"public static function findIdentity($id)\n {\n // TODO: Implement findIdentity() method.\n $user = Dosen::findOne($id);\n if(count($user)){\n return new static($user);\n }\n return null;\n }",
"private function constructById(int $id){\n $connection = new Connection();\n $link = $connection->connect();\n $this->setId($id);\n $result = $link->query(\"SELECT name, surname, nickname, email, password, avatar_id FROM user WHERE id = '$this->id'\");\n $record = $result->fetch();\n if($record){\n $this->setName($record['name']);\n $this->setSurname($record['surname']);\n $this->setNickname($record['nickname']);\n $this->setEmail($record['email']);\n $this->setPassword($record['password']);\n $this->setAvatar(new Avatar($record['avatar_id'], $this));\n $this->setRolesFromDB();\n $result = $link->query(\"SELECT * FROM staff WHERE user_id = '$this->id'\");\n if($record = $result->fetch()){\n $this->setStaffId($record['id']);\n $this->setStore(new Store($record['store_id']));\n }\n }\n else{\n echo 'There\\'s no user with such Id';\n }\n $connection = null;\n }",
"public function testSetId() {\n\n $obj = new iSessions();\n\n $obj->setId(10);\n $this->assertEquals(10, $obj->getId());\n }",
"public function loadFromId($id) {\n parent::loadFromId($id);\n if (array_key_exists('userid', $this->data) && $this->data['userid'] != '') {\n $this->data['last_login_datetime']=date('Y-m-d H:i:s');\n $this->update();\n }\n }",
"public function set($id) {\n $where = (is_int($id)) ? $this->Id.' = '.addslashes($id) : $this->Ref.' = \\''.addslashes($id).'\\'';\n $query = \"SELECT * FROM {$this->Table} WHERE $where\";\n $result = $this->query($query);\n if($result == true && mysql_num_rows($result) > 0) {\n foreach (mysql_fetch_assoc($result) as $key => $value) {\n $class->$key = $value; \n }\n return $class;\n } else {\n return false;\n }\n }",
"public function setID($id);",
"private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) ;"
] |
[
"0.6654597",
"0.6404166",
"0.62064993",
"0.6159036",
"0.59898984",
"0.59032226",
"0.5898",
"0.58833015",
"0.5874396",
"0.5866208",
"0.58438534",
"0.58252287",
"0.582191",
"0.57798487",
"0.5768004",
"0.5762689",
"0.5759598",
"0.5749866",
"0.5735913",
"0.569147",
"0.5685331",
"0.5666647",
"0.56647444",
"0.563714",
"0.5630363",
"0.5622652",
"0.5621124",
"0.5619038",
"0.56161696",
"0.5614781"
] |
0.7085421
|
0
|
Removes everything in $string from $first to $last including $first and $last
|
function compress($string, $first, $last) {
while(stripos($string,$first) && stripos($string,$last)) {
$string = substr_replace($string, "", stripos($string,$first), stripos($string,$last) - stripos($string,$first) + strlen($last));
}
return $string;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function cleanString($string) {\n\t\t$string = substr_replace($string, '', -1);\n\t\t$string = substr_replace($string, '', 0, 2);\n\t\treturn $string;\n\t}",
"function delete($string, $start, $end) {\r\n // Get array of things that should be deleted from the input string\r\n $delete_array = find_all($string, $start, $end);\r\n\r\n // delete each occurrence of each array element from string;\r\n for($i = 0; $i < count($delete_array); $i ++) {\r\n $string = str_replace($delete_array, '', $string);\r\n }\r\n return $string;\r\n}",
"function str_removeFromStart (string $str, string $needle) : string {\n\t$strLen = strlen($str);\n\t$needleLen = strlen($needle);\n\n\tif($strLen >= $needleLen and str_startsWith($str, $needle)){\n\t\treturn substr($str, $needleLen);\n\t}\n\treturn $str;\n}",
"function delLastChar($string=\"\")\n{\n\t$t = substr($string, 0, -1);\n\treturn($t);\n}",
"function removeStr($string, $toRemove)\n{\n $result=\"\";\n for($i=0;$i<strlen($string);$i++){\n if ($string[$i]!= $toRemove){\n $result=$result.$string[$i];\n }\n }\n\n return $result;\n}",
"function stripWithDelimiters($string, $start, $end)\n{\n while (strpos($string, $start) !== false) {\n $section_to_remove = substr($string, strpos($string, $start));\n $section_to_remove = substr($section_to_remove, 0, strpos($section_to_remove, $end) + strlen($end));\n $string = str_replace($section_to_remove, '', $string);\n }\n return $string;\n}",
"function str_removeFromEnd (string $str, string $needle) : string {\n\t$strLen = strlen($str);\n\t$needleLen = strlen($needle);\n\n\tif($strLen >= $needleLen and str_endsWith($str, $needle)){\n\t\treturn substr($str, 0, $strLen - $needleLen);\n\t}\n\treturn $str;\n}",
"function str_removeFrom (string $str, string $needle, int $instanceCount = 0) : string {\n\tif($instanceCount <= 0){\n\t\treturn str_replace($needle, '', $str);\n\t}else{\n\t\t$moddedStr = $str;\n\t\tfor($i = 0; $i < $instanceCount; $i++){\n\t\t\t$indexOfFirst = strpos($moddedStr, $needle);\n\t\t\tif($indexOfFirst === false) break;\n\n\t\t\t$partOne = substr($moddedStr, 0, $indexOfFirst);\n\t\t\t$partTwo = substr($moddedStr, $indexOfFirst + strlen($needle));\n\n\t\t\t$moddedStr = $partOne.$partTwo;\n\t\t}\n\t\treturn $moddedStr;\n\t}\n}",
"function removePartialTags($string) {\r\n\t\t$pos_close = strpos($string, \">\");\r\n\t\tif($pos_close != false) {\r\n\t\t\t$string = substr($string, $pos_close + 1);\r\n\t\t}\r\n\t\t$pos_open = strpos($string, \"<\");\r\n\t\tif($pos_open != false) {\r\n\t\t\t$string = substr($string, 0, $pos_open);\r\n\t\t}\r\n\t\t//print('removePartialTags cleaned string: ' . $string);\r\n\t\treturn $string;\r\n\t}",
"function strip($string) {\n\n\n\t\t}",
"function stringcut($str,$a,$b){\n \t$ap=strpos($str,$a);\n \tfor($i=0;$i<strlen($str)-$ap-1;$i++){\n \tif($str[$ap+strlen($a)+$i]!=$b)\n \t$result=$result.$str[$ap+strlen($a)+$i];\n \telse\n \tbreak;\n \t}\n \treturn $result;\n \t}",
"public static function removeFirst($string = \"\", $sep = \".\", $notEmpty = false)\n {\n $subString = trim(strstr($string, $sep), $sep);\n if(empty($subString) && $notEmpty) return $string;\n\n return $subString;\n }",
"function TrimRightC(&$S, $C){\n for($i = 0 ; $i < strlen($S) ; $i++){\n if($S[$i] == $C){\n $S[$i] = '';\n }\n }\n\n\n //$S = str_replace($S , $C ,'');\n}",
"function remove(string $s): string\n{\n $str = explode(\" \", $s);\n\n foreach ($str as &$e) {\n $e = rtrim($e, \"!\");\n }\n\n return implode(\" \",$str);\n}",
"function rstrtrim($str, $remove=null)\n{\n $str = (string)$str;\n $remove = (string)$remove; \n \n if(empty($remove))\n {\n return rtrim($str);\n }\n \n $len = strlen($remove);\n $offset = strlen($str)-$len;\n while($offset > 0 && $offset == strpos($str, $remove, $offset))\n {\n $str = substr($str, 0, $offset);\n $offset = strlen($str)-$len;\n }\n \n return rtrim($str); \n \n}",
"public function remove_first_char(&$sString,$cLastChar=\"/\")\n {\n $cFirstChar = $sString{0};\n if($cFirstChar == $cLastChar)\n $sString = substr($sString,1);\n }",
"function removeFirstChar($string)\n{\n $i = 0;\n $string = substr_replace($string, '', $i, 1);\n return $string;\n}",
"function eliminaUnidores($string) {\n // Devuelve el string sin eso\n if(!empty($string)) {\n return preg_replace(\"/(\\bel)|(\\bla.)|(\\blo.)|(\\by\\b)|(\\bo\\b)/\", $string);\n }\n }",
"public function replaceBetween(string $string, string $str, string $start, string $end): string\n {\n return preg_replace('/'.preg_quote($start).'[\\s\\S]+?'.preg_quote($end).'/', $str, $string);\n }",
"protected function trimFirstLast($strWord)\n\t{\n\t\t$trimmedString = $strWord;\n\t\t$wordSize = strlen($trimmedString);\n\n\t\t/* only process if word is more than 4 characters long */\n\t\tif ($wordSize >= 4)\n\t\t{\n\t\t\t/* check first character */\n\t\t\t$firstType = $this->getCharType(substr($trimmedString, 0, 1));\n\t\t\t$secondType = $this->getCharType(substr($trimmedString, 1, 1));\n\t\t\t/* trim, if first and second chars are of different type */\n\t\t\tif ($firstType != $secondType)\n\t\t\t\t$trimmedString = substr($trimmedString, 1, $wordSize--);\n\n\t\t\t/* check last character */\n\t\t\t$lastTwoChars = substr($trimmedString, -2);\n\t\t\t$lastType = $this->getCharType(substr($lastTwoChars, -1));\n\t\t\t$secondToLastType = $this->getCharType(substr($lastTwoChars, 0, 1));\n\t\t\t/* trim, if last and second to last chars are of different type */\n\t\t\tif ($lastType != $secondToLastType)\n\t\t\t\t$trimmedString = substr($trimmedString, 0, -1);\n\n\t\t}\n\t\t\n\t\treturn $trimmedString;\n\t}",
"function reverseThisIter(string $string)\n {\n $stringArray = str_split($string);\n $length = count($stringArray);\n \n for($i = 0; $i < $length; $i++)\n {\n $newString[] = array_pop($stringArray);\n }\n \n $string = implode(\"\", $newString);\n \n return $string;\n }",
"function get_string_between($string, $start, $end){\n $string = ' ' . $string;\n $ini = strpos($string, $start);\n if ($ini == 0) return '';\n $ini += strlen($start);\n $len = strpos($string, $end, $ini) - $ini;\n return substr($string, $ini, $len);\n }",
"function substrBetween($string,$start,$end) {\n return substrAfter(substrBefore($string,$end),$start);\n}",
"function get_string_between($string, $start, $end){\n\t$string = ' ' . $string;\n\t$ini = strpos($string, $start);\n\tif ($ini == 0) return '';\n\t$ini += strlen($start);\n\t$len = strpos($string, $end, $ini) - $ini;\n\treturn substr($string, $ini, $len);\n}",
"public static function removeString( $needle, $string )\n {\n return str_replace( $needle, '', $string );\n }",
"function get_string_between($string, $start, $end){\n $string = ' ' . $string;\n $ini = strpos($string, $start);\n if ($ini == 0) return '';\n $ini += strlen($start);\n $len = strpos($string, $end, $ini) - $ini;\n return substr($string, $ini, $len);\n}",
"public static function removeStart(string $haystack, string $needle): string\n {\n return static::startsWith($haystack, $needle) ? substr($haystack, strlen($needle)) : $haystack;\n }",
"function get_string_between($string, $start, $end){\n $string = ' ' . $string;\n $ini = strpos($string, $start);\n if ($ini == 0) return '';\n $ini += strlen($start);\n $len = strpos($string, $end, $ini) - $ini;\n return substr($string, $ini, $len);\n }",
"function get_string_between($string, $start, $end)\r\n{\r\n $string = ' ' . $string;\r\n $ini = strpos($string, $start);\r\n if ($ini == 0)\r\n return '';\r\n $ini += strlen($start);\r\n $len = strpos($string, $end, $ini) - $ini;\r\n return substr($string, $ini, $len);\r\n}",
"public static function removeEnd(string $haystack, string $needle): string\n {\n return static::endsWith($haystack, $needle) ? substr($haystack, 0, -strlen($needle)) : $haystack;\n }"
] |
[
"0.6543164",
"0.6451502",
"0.62693065",
"0.6115452",
"0.60326743",
"0.60282636",
"0.5955155",
"0.5844062",
"0.5820183",
"0.57753015",
"0.5763713",
"0.573698",
"0.5713607",
"0.5709206",
"0.56904894",
"0.5658109",
"0.56528234",
"0.56277275",
"0.55814886",
"0.5554717",
"0.5497312",
"0.5484768",
"0.5477712",
"0.5466074",
"0.5457294",
"0.54550797",
"0.54504377",
"0.5449494",
"0.5446896",
"0.54286927"
] |
0.709177
|
0
|
Format Returns a formatted column for the Permit Numbers
|
public function format($data, $column = [])
{
unset($column);
$url = $this->urlHelper->fromRoute(
'admin-dashboard/admin-permits/ranges',
[
'stockId' => $data['irhpPermitStock']['id'],
'action' => 'edit',
'id' => $data['id']
]
);
$permitNumber = sprintf(
"%s%s to %s%s",
Escape::html($data['prefix']),
Escape::html($data['fromNo']),
Escape::html($data['prefix']),
Escape::html($data['toNo'])
);
return sprintf(
"<a class='govuk-link js-modal-ajax' href='%s'>%s</a>",
$url,
$permitNumber
);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function formatColumns()\n {\n $output = '[';\n foreach ($this->incorrect as $column) {\n $output .= $column . ', ';\n }\n\n // Remove last delimiter, and close the bracket.\n $output = substr($output, 0, -2);\n $output .= ']';\n\n return $output;\n }",
"public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace(' ', ' ', $separator));\n }",
"function format($cols,$name,$value='',$unit=''){\n $vlen=strlen($value.$unit)+1;\n $format='%-'.($cols-$vlen).\".\".($cols-$vlen).\"s\".'%'.($vlen).\".\".($vlen).\"s\"; //name & value+unit\n return sprintf($format,$name,$value.$unit);\n}",
"public function formatNumber($number);",
"public static function format($table_data){\r\n return (!is_numeric($table_data) && !is_bool($table_data))? \"'$table_data'\": $table_data;\r\n }",
"public static function format($data, $column = array(), $sm = null)\n {\n return str_pad($data[$column['name']], 5, '0', STR_PAD_LEFT) .\n ($data[$column['name']] === 0 ? ' (Office copy)' : '');\n }",
"public function cellFormat($row, $column) {\n\t}",
"public function format()\n {\n $registrationNumber = str_pad($this->registrationNumber, 4, '0', STR_PAD_LEFT);\n $accountNumber = str_pad($this->accountNumber, 10, '0', STR_PAD_LEFT);\n return $registrationNumber . $accountNumber;\n }",
"function eligibility_format() {\n\t$print = \"\";\n\t$prefix = \"\";\n\t$eligibility = get_field('eligibility');\n\tif (is_array($eligibility)) {\n\t\tif (!get_field('other') == \"\") {\n\t\t\t$eligibility[] .= get_field('other');\n\t\t}\n\t\tforeach ($eligibility as $value) {\n\n\t\t\t$print .= $prefix . $value;\n\t\t\t$prefix = ', ';\n\t\t}\n\t} else {\n\t\t$print = get_field('eligibility');\n\t}\n\treturn $print;\n}",
"public function format()\n {\n return sprintf('%s %s %s', $this->x(), $this->y(), $this->z());\n }",
"public function renderColumns () {\n $cols = '';\n\n foreach (self::getColumnsArray() as $key => $num) {\n if ($key == 0) $cols .= \" \";\n\n $cols .= \" $num \";\n }\n\n return $cols;\n }",
"public function toFormat(){\n $toFormat = '';\n foreach ($this->to() as $to) {\n $toFormat .= $to.', ';\n }\n return $toFormat;\n }",
"abstract function format();",
"protected function getFormat()\n {\n return 'FORMAT: 1A';\n }",
"public function format($data, $column = [])\n {\n if (!empty($data['venue'])) {\n // name and address\n return $data['venue']['name'] . ' - ' . $this->addressFormatter->format($data['venue']['address'], ['addressFields' => 'FULL']);\n } elseif (!empty($data['venueOther'])) {\n // other venue\n return $data['venueOther'];\n }\n\n return '';\n }",
"function format($value);",
"public function formattedRut()\n {\n $rut = str_replace(['.', '-'], ['', ''], $this->rut);\n $rutNoDV = substr($rut, 0, strlen($rut) - 1);\n $dv = substr($rut, strlen($rut) - 1);\n $formattedRut = number_format($rutNoDV, 0, ',', '.').'-'.$dv;\n return $formattedRut;\n }",
"public function setAlterColumnFormat()\n {\n $this->format = '{type}{length}{notnull}{append}';\n }",
"public function format($form_name, $column_header, $column_data, $rowid, $state)\n\t{\n\t\treturn htmlspecialchars((string)$column_data);\n\t}",
"public function getOutputFormat()\n {\n $formated = $this->formatTxt(0);\n $number = $this->formatTxt(0, array('display' => Zend_Currency::NO_SYMBOL));\n return str_replace($number, '%s', $formated);\n }",
"public function format()\n {\n $separator = $this->object->config('separator');\n $decimals = $this->object->config('decimals');\n $point = $this->object->config('point');\n\n $decimal_value = $this->getDecimalValue($this->object->getValue());\n\n if (setting_value('visiosoft.field_type.decimal::showDecimalMaxPrice') < intval($this->object->getValue()) and $decimal_value == 0) {\n if (!setting_value('visiosoft.field_type.decimal::showDecimal')) {\n $decimals = 0;\n }\n }\n\n return number_format($this->object->getValue(), $decimals, $point, str_replace(' ', ' ', $separator));\n }",
"public function numberFormatDataProvider() {}",
"function formatColumn($column , $db)\n\t{\n\t\tif(JString::stristr(JString::strtolower($column->cacheSqlSpec),'date'))\n\t\t\treturn \"DATE_FORMAT(\".$db->quoteName($column->cacheColumnName).\", '%d-%m-%Y') \";\n\n\t\t return parent::formatColumn($column, $db);\n\t}",
"public function format()\n {\n return sprintf('%d-%02d-%02d', $this->getYear(), $this->getMonth(), $this->getDay());\n }",
"function formatRow(){\n $this->hook('formatRow');\n }",
"public function format()\n {\n $formattedString = join('_', $this->toLower());\n if (strpos($formattedString, '_') === 0) {\n $formattedString = substr($formattedString, 1);\n }\n\n return $formattedString;\n }",
"public function getKreditAttribute()\n {\n return number_format($this->attributes['kredit'], 0, ',', '.');\n \n }",
"public function render()\n {\n $value = number_format($this->value, $this->decimals, $this->decimal_separator, $this->thousands_separator);\n\n return Str::of($value)\n ->prepend($this->before.' ')\n ->append(' '.$this->after)\n ->trim()\n ->toString();\n }",
"public function format(): string;",
"function formatNumbers($inputID)\n\t{\n\t\t$number_format = number_format($inputID);\n\t\t\n\t\techo $number_format;\n\t}"
] |
[
"0.6413763",
"0.59841925",
"0.59354436",
"0.58396673",
"0.5815402",
"0.5798107",
"0.5764414",
"0.57182413",
"0.5715479",
"0.5712546",
"0.5672686",
"0.5661048",
"0.56474286",
"0.5601294",
"0.55403566",
"0.55152494",
"0.5499738",
"0.5474863",
"0.546683",
"0.54613054",
"0.54400957",
"0.54399556",
"0.54266804",
"0.54250866",
"0.5421328",
"0.539766",
"0.53583366",
"0.53346443",
"0.5328475",
"0.53264123"
] |
0.623206
|
1
|
Creates a form to delete a update_log entity.
|
private function createDeleteForm(update_logs $update_log)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('Admin_Logs_delete', array('id' => $update_log->getId())))
->setMethod('DELETE')
->getForm()
;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('timelog_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('logger_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', SubmitType::class, array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"function delete()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete();\n\t$this->view_logs();\n}",
"private function createDeleteForm(WorkLog $workLog): FormInterface\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('worklog_delete', ['id' => $workLog->getId()]))\n ->setMethod('DELETE')\n ->getForm();\n }",
"public function createDeleteForm($id){\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('rsp_delete',array('id'=>$id)))\n ->setMethod('DELETE')\n ->add('submit','submit',array('label'=>'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_missatges_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n $session = $this->get(\"session\");\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('hall_delete', array('id' => $id, )))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm(Record $record)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('eval_record_delete', array('id' => $record->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"#[Route(path: '/{id}', name: 'logger_delete', methods: ['DELETE'])]\n public function deleteAction(Request $request, $id)\n {\n $form = $this->createDeleteForm($id);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n //process.py script: replaced namespace by ::class: ['AppUserdirectoryBundle:Logger'] by [Logger::class]\n $entity = $em->getRepository(Logger::class)->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Logger entity.');\n }\n\n $em->remove($entity);\n $em->flush();\n }\n\n return $this->redirect($this->generateUrl('logger'));\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('com_incident_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer','attr'=>array('class'=>'btn btn-danger','style'=>'width:100px;')))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('solmantenimientoidentificacion_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Borrar','attr'=>array('class'=>'btn btn-danger btn btn-danger btn-lg btn-block')))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('performance_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_sesionventatratamiento_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('timerecord_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n $translated = $this->get('translator');\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('configuracao_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => $translated->transChoice('txt.excluir',0,array(),'messagesCommonBundle'), 'attr' => array('class' => 'btn btn-danger btn-lg')))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('admin_consulta_delete', array('id' => $id)))\r\n ->setMethod('DELETE')\r\n ->add('submit', 'submit', array('label' => 'Delete'))\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm($id)\n {\n \n $form = $this->createFormBuilder(null, array('attr' => array('id' => 'entrada_detalles_eliminar_type')))\n ->setAction('')\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'icon' => 'trash', 'attr' => array('class' => 'btn-danger')))\n ->getForm()\n ;\n \n return $form;\n \n \n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('administracion_servicio_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id){\n\t\treturn $this->createFormBuilder()\n\t\t\t->setAction($this->generateUrl('reserva_delete', array('id' => $id)))\n\t\t\t->setMethod('DELETE')\n\t\t\t->add('submit', 'submit', array('label' => 'Eliminar Reserva', 'attr' => array('class'=>'btn btn-danger btn-block')))\n\t\t\t->getForm()\n\t\t;\n\t}",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('medicamentossuministrados_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Eliminar', 'attr' => array('class' => 'btn')))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('menu_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('business_admin_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'form.common.btn.delete', 'attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('business_admin_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'form.common.btn.delete', 'attr' => array('class' => 'btn btn-danger')))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('event_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('social_admin_resource_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => '删除','attr'=>[\n 'class'=>'btn btn-danger'\n ]))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('bien_delete', array('id' => $id)))\n ->setMethod('DELETE')\n // ->add('submit', 'submit', array('label' => 'Delete'))\n ->add('submit', 'submit', array('label' => 'Eliminar','attr' => array('class' => 'btn btn-danger'),))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('achats_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Supprimer'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('detailsproduits_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('empleado_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }",
"private function createDeleteForm($id)\n { \n \n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aulas_aula_delete', array('id' => $id)))\n ->setMethod('DELETE')\n ->add('submit', 'submit', array('label' => 'Delete'))\n ->getForm()\n ;\n }"
] |
[
"0.6799153",
"0.6712754",
"0.6620106",
"0.6481031",
"0.63989073",
"0.6243335",
"0.62419444",
"0.62402874",
"0.6209475",
"0.6206724",
"0.6204789",
"0.6197764",
"0.618144",
"0.61566037",
"0.61527795",
"0.61477715",
"0.61199754",
"0.61180043",
"0.6113477",
"0.60852754",
"0.60813344",
"0.607286",
"0.607286",
"0.6069863",
"0.6064011",
"0.60593164",
"0.60292286",
"0.6027627",
"0.6023563",
"0.60201895"
] |
0.82641447
|
0
|
creates a sample file with 500 records for procesing
|
public function doCreateSourceFile()
{
$exporter = new CsvExporter($this->ID);
//Write Header in temp file
$exporter->storeRecordInTempFile(array(
'first name',
'last name',
'annual salary',
'super rate (%)',
'payment start date'
));
$faker = Faker\Factory::create();
for ($i = 0; $i < 500; $i++) {
$temp = array();
$temp[] = $faker->firstName;
$temp[] = $faker->lastName;
//TODO: make this configurable
$temp[] = $faker->randomFloat(2, 10000, 250000);//generate salaries between 10k and 250k a year
$temp[] = $faker->randomFloat(2, 9, 50) . '%';//Create a super rate between 9-50%
$m = $faker->monthName;
$l = strtotime('last day of ' . $m);
$temp[] = '01 ' . $m . ' - ' . date('d M', $l);
$exporter->storeRecordInTempFile($temp);
unset($temp);
}
$name = 'dummy-source-' . date('Y-m-d') . '-Job-' . $this->ID . '.csv';
$filename = '/assets/' . $name;
$savePath = Director::baseFolder() . $filename;
$newFile = $exporter->preserveTempFile($savePath);
if ($newFile) {
$file = new File();
$file->Filename = $filename;
$file->Name = $name;
$file->Title = $name;
$file->write();
$this->SourceFileID = $file->ID;
$this->write();
return 'File generated Successfully';
}
return 'Failed to generate test file';
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}",
"public function run()\n {\n $faker = Faker\\Factory::create();\n\n for($i = 0; $i < 1000; $i++) {\n App\\TestData::create([\n 'username' => $faker->userName,\n 'name' => $faker->name,\n \n ]);\n }\n }",
"public function run()\n {\n foreach (range(1,500) as $index) {\n MedicineDiagnostic::create([\n 'diagnostic_id' => rand(1, 100),\n 'medicine_id' => rand(1, 100)\n ]);\n }\n }",
"public function testPerfWhenWritingOneMillionRowsCSV()\n {\n // getting current memory peak to avoid taking into account the memory used by PHPUnit\n $beforeMemoryPeakUsage = memory_get_peak_usage(true);\n\n $numRows = 1000000;\n $expectedMaxExecutionTime = 30; // 30 seconds\n $expectedMaxMemoryPeakUsage = 1 * 1024 * 1024; // 1MB in bytes\n $startTime = time();\n\n $fileName = 'csv_with_one_million_rows.csv';\n $this->createGeneratedFolderIfNeeded($fileName);\n $resourcePath = $this->getGeneratedResourcePath($fileName);\n\n $writer = WriterEntityFactory::createCSVWriter();\n $writer->openToFile($resourcePath);\n\n for ($i = 1; $i <= $numRows; $i++) {\n $writer->addRow(WriterEntityFactory::createRowFromArray([\"csv--{$i}1\", \"csv--{$i}2\", \"csv--{$i}3\"]));\n }\n\n $writer->close();\n\n $this->assertEquals($numRows, $this->getNumWrittenRows($resourcePath), \"The created CSV should contain $numRows rows\");\n\n $executionTime = time() - $startTime;\n $this->assertTrue($executionTime < $expectedMaxExecutionTime, \"Writing 1 million rows should take less than $expectedMaxExecutionTime seconds (took $executionTime seconds)\");\n\n $memoryPeakUsage = memory_get_peak_usage(true) - $beforeMemoryPeakUsage;\n $this->assertTrue($memoryPeakUsage < $expectedMaxMemoryPeakUsage, 'Writing 1 million rows should require less than ' . ($expectedMaxMemoryPeakUsage / 1024 / 1024) . ' MB of memory (required ' . round($memoryPeakUsage / 1024 / 1024, 2) . ' MB)');\n }",
"public static function createCSVFilesForSeeding()\n {\n self::debug(\"FaviconService -> createCSVFilesForSeeding\");\n\n $start = microtime(true);\n\n $filesToCreateDetails = self::createTrimmedCSVFile();\n $mainFileName = $filesToCreateDetails['mainFileName'];\n $filesToCreateCount = $filesToCreateDetails['filesToCreateCount'];\n $linesInEachFile = $filesToCreateDetails['linesInEachFile'];\n\n $singleFileContent = array();\n\n $count = 0;\n $fileCount = 0;;\n $allWebsites = file($mainFileName);\n\n for($i=0; $i < count($allWebsites); $i++)\n {\n if ($count <= $filesToCreateCount) {\n\n $websiteURL = trim($allWebsites[$i]);\n if(!empty($websiteURL)) {\n $singleFileContent[] = $websiteURL;\n }\n\n if(count($singleFileContent) == $linesInEachFile) {\n file_put_contents(__DIR__.\"/../data/seed\".$fileCount.\".csv\", implode(PHP_EOL, $singleFileContent));\n $fileCount++;\n $singleFileContent = array();\n }\n\n $count++;\n\n } else {\n break;\n }\n }\n\n self::debug(\"Total number of files created for seeding: $fileCount\");\n\n $totalTimeTaken = microtime(true) - $start;\n\n self::debug(\"Total time taken for creating files for seeding: $totalTimeTaken\");\n\n // return a results array\n return array(\n \"status\" => TRUE,\n \"errorMsg\" => \"\",\n \"data\" => array(\n \"seedCount\" => $fileCount\n )\n );\n }",
"private function createFile( $name, $size ) {\n\t\t$fh = fopen( \"Out/$name\", 'w' );\n\t\tfor ( $i = 0; $i < 10000 * $size; $i++ ) {\n\t\t\tfwrite( $fh, '1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111' );\n\t\t}\n\t\tfclose( $fh );\n\t}",
"public function handel($size)\n {\n $faker = Factory::create();\n\n $new_record = [];\n\n for ($i=0; $i < $size; $i++) {\n Customer::create([\n 'email' => $faker->email,\n 'first_name' => $faker->name,\n 'last_name' => $faker->name,\n 'phone_number' => $faker->phoneNumber,\n 'image' => $faker->imageUrl,\n 'location' => $faker->streetAddress,\n 'sex' => rand(0, 1) ? \"Male\" : \"Female\",\n ]);\n }\n\n return $size . \" new Record created in the database\";\n }",
"function make1mil($dir)\r\n{\r\n $file = fopen($dir, 'w');\r\n for ($i = 0; $i < 100; $i++) {\r\n $str = makeInteger();\r\n fwrite($file, $str . \"\\n\");\r\n }\r\n\r\n fclose($file);\r\n}",
"public function generate() {\n\t\tif ($this->offset == 0) {\n\t\t\t// Starting to generate a new file\n\t\t\t$this->prepareFile();\n\t\t\t$this->createFileHeadings();\n\t\t}\n\n\t\t$users = $this->getUserBatch();\n\n\t\tforeach ($users as $user) {\n\t\t\t$fields = $this->userToArray($user);\n\t\t\t$this->writeToCSV($fields);\n\t\t\t$this->usercount++;\n\t\t}\n\n\t\t$this->closeFile();\n\n\t\treturn true;\n\t}",
"function divide_exportfile_send_2quickstatements($input, $remove_traits_YN = false)\n {\n // exit;\n \n // /* set the paths\n $this->report_path = CONTENT_RESOURCE_LOCAL_PATH.\"reports/cypher/\"; //generated from CypherQueryAPI.php\n $tmp = md5(json_encode($input));\n $this->report_path .= \"$tmp/\";\n if($remove_traits_YN) $this->temp_file = $this->report_path.\"export_removal_file.qs\"; //\n else $this->temp_file = $this->report_path.\"export_file.qs\"; //orig\n // */\n if(!file_exists($this->temp_file)) exit(\"\\nInvestigate. File does not exist: [$this->temp_file\\n\");\n\n $i = 0;\n $batch_name = date(\"Y_m_d\");\n $batch_num = 0;\n $WRITE = Functions::file_open($this->tmp_batch_export, \"w\");\n foreach(new FileIterator($this->temp_file) as $line => $row) {\n if($row) $i++;\n \n /* use this block to exclude already run: manually done\n if($i < 8) continue;\n */\n\n echo \"\\n\".$row;\n fwrite($WRITE, $row.\"\\n\");\n if(($i % 25) == 0) { $batch_num++; // % 3 25 5\n echo \"\\n-----\";\n fclose($WRITE);\n self::run_quickstatements_api($batch_name, $batch_num);\n $secs = 60*1; echo \"\\nSleep $secs seconds...v1\"; sleep($secs); echo \" Continue...\\n\";\n /* sometimes running it twice is needed to remove the error\n self::run_quickstatements_api($batch_name, $batch_num); \n */\n\n // if($batch_num == 1200) exit;\n $WRITE = Functions::file_open($this->tmp_batch_export, \"w\"); //initialize again\n\n // break; //just the first 3 rows //debug only\n }\n }\n fclose($WRITE);\n $batch_num++;\n self::run_quickstatements_api($batch_name, $batch_num);\n /*\n QUICKSTATEMENTS_EOLTRAITS_TOKEN\n curl https://quickstatements.toolforge.org/api.php \\\n -d action=import \\\n -d submit=1 \\\n -d username=EOLTraits \\\n -d \"batchname=for DOI 10.1111/j.1365-2311.1965.tb02304.x\" \\\n --data-raw 'token=$2y$10$hz0sJt78sWQZavuLhlvNBev9ACNiUK3zFaF9Mu.WJFURYPXb6LmNy' \\\n --data-urlencode data@citation_export_file.qs\n */\n }",
"public function run()\n {\n for ($i=0; $i < 200; $i++) {\n\t \tCustomer::create([\n\t 'name' => Str::random(8),\n\t 'email' => Str::random(12).'@mail.com',\n\n\t ]);\n \t}\n }",
"function exportSample($type)\n{\n global $app_strings;\n\n // first grab the\n $_REQUEST['all']=true;\n\n // retrieve the export content\n $content = export($type, null, false, true);\n\n // Add a new row and add details on removing the sample data\n // Our Importer will stop after he gets to the new row, ignoring the text below\n return $content . \"\\n\" . $app_strings['LBL_IMPORT_SAMPLE_FILE_TEXT'];\n\n}",
"public function sample($size = 10);",
"public function run()\n {\n for($i=1; $i<=10; $i++){\n $user_id = random_int(1, DB::table('users')->count());\n DB::table('files')->insert([\n 'user_id' => $user_id,\n 'path' => \"https://s3.ap-northeast-2.amazonaws.com/capstone.rhythmtataki.bucket/workshop/drumSoundClip/\".$user_id.\"/\",\n 'name' => \"test\".$i.\".ogg\",\n 'type' => \"ogg\",\n 'size' => 10*$i,\n 'created_at' => now()\n ]);\n }\n }",
"public function run()\n {\n $faker = \\Faker\\Factory::create();\n for($i=0;$i<500;$i++){\n $store = new Store();\n $store->book_id=$i+1;\n $store->books_count=$faker->randomDigitNotNull;\n $store->save();\n }\n }",
"public function run()\n {\n $faker = Faker::create();\n for ($i=0; $i < 50; $i++) { \n $sourceDir_pdf = storage_path('app/public/testfile/pdf');\n $uploadDir = storage_path('app/files/megazines/');\n\t \tDB::table('megazines')->insert([\n 'user_id' => 'A',\n 'category_id' => rand(1,7),\n 'name' => $faker->name,\n 'cost' => rand(100,1200),\n 'pages' =>rand(5,60),\n 'file_name' => $faker->file($sourceDir_pdf, $uploadDir, false) ,\n 'cover_image' => $faker->image('public/images/megazines/',300,400, null, false),\n // 'synopsis' => $faker->file($sourceDir, $targetDir, false) ,\n // 'preview' => $faker->file($sourceDir, $targetDir, false) ,\n // 'ppt' => $faker->file($sourceDir, $targetDir, false) ,\n 'description' => $faker->paragraph($nbSentences = 10, $variableNbSentences = true),\n 'created_at' => Carbon::now()->setTimezone('Asia/Kolkata')->toDateTimeString(),\n 'updated_at' => Carbon::now()->setTimezone('Asia/Kolkata')->toDateTimeString(),\n\t ]);\n \t}\n }",
"protected function generateReport() {\n $path = tempnam(sys_get_temp_dir(), 'businesses-with-local-business-type');\n $fp = fopen($path, 'w');\n\n $query = \"select b.id,b.name,b.phone,b.street_address,b.city,b.state,b.zip,b.country_code,b.website,b.type,b.organisation \"\n . \"from business b \"\n . \"left join users u on u.id = b.agentId where b.type='LocalBusiness' and b.agentId > 0 and u.status not in(10,11,13) \"\n . \"order by b.id \";\n\n $stmt = $this->readConn()->query($query);\n\n $captions = false;\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n if (!$captions) {\n fputcsv($fp, array_keys($row));\n $captions = true;\n }\n fputcsv($fp, array_values($row));\n }\n\n fclose($fp);\n\n return $path;\n }",
"private function generateRandomTable($numOfRecords)\n {\n $randomArray = array();\n\n //Add random values (between 1000 and 50 000)\n for ($n = 0; $n < $numOfRecords; $n++)\n {\n $array = array();\n array_push($randomArray, rand(1000, 50000));\n }\n\n //Return example table\n return $randomArray;\n }",
"public function run()\n {\n\n foreach (range(1, 300) as $index) {\n $teacher = Teacher::inRandomOrder()->first();\n $faker = Faker\\Factory::create();\n $model = factory(\\App\\Models\\PaymentLog::class)->make();\n $model->teacher_id = $teacher->id;\n $model->paid_amount = rand(500,10000);\n $model->paid_for_month = $faker->dateTimeThisYear->format('Y-m');\n $model->paid_at = $faker->dateTimeThisYear->format('Y-m-d H:i:s');\n $model->status = 'paid';\n $model->note = '';\n factory(\\App\\Models\\PaymentLog::class)->create($model->toFillableArray());\n }\n }",
"function processData($data){\n $fileName = rand(1,10).'test.csv';\n\n $formatData = json_decode($data, true);\n $headers = $this->formatHeaders($formatData);\n $rows = $this->formatRows($formatData);\n $this->createFile(array_unique($headers), $rows, $fileName);\n }",
"public function run()\n {\n $faker = Faker\\Factory::create();\n\n\n for ($i=0; $i < 200; $i++) {\n $this->generateUser_and_5Receivers($faker); \n }\n\n for ($j=0; $j < 500; $j++){\n $this->generate_afake_transaction($faker); \n }\n \n }",
"function generate_json_file() {\n // Open new file to write\n $json_file = new SplFileObject(\"../CCNiceAudioFiles.json\", \"w\");\n $json_file->fwrite(\"[\\n\");\n\n // Retrieve all non new entries from the database\n $result = $this->get_list_of_published_files();\n\n // For each file generate json entry to be used for presentation\n foreach( $result as $i ){\n\n unset($i['newfile']);\n unset($i['flaggedfile']);\n unset($i['flagcomment']);\n unset($i['md5_sign']);\n unset($i['publishedfile']);\n unset($i['translated']);\n unset($i['downloads']);\n unset($i['filepath']);\n\n $readable_size = $this->convert_file_size($i['size']);\n $i['size'] = $readable_size;\n\n $json_file->fwrite(json_encode($i) . \",\\n\");\n }\n\n $json_file->fseek(-2, SEEK_CUR);\n\n $json_file->fwrite(\"\\n]\");\n $json_file = null;\n\n return;\n }",
"public function actionGenerateAndDownloadDatasetCreationFile() {\n $fileColumns[] = DatasetController::AGRONOMICAL_OBJECT_URI;\n $fileColumns[] = DatasetController::DATE;\n $variables = Yii::$app->request->post('variables');\n foreach ($variables as $variableAlias) {\n $fileColumns[] = $variableAlias;\n }\n\n $file = fopen('./documents/DatasetFiles/datasetTemplate.csv', 'w');\n fputcsv($file, $fileColumns, $delimiter = \";\"); \n fclose($file);\n }",
"private function createTestFiles($num_files) {\n // Create dir if doesn't exist.\n if (!is_dir($this->testsDestDir)) {\n mkdir($this->testsDestDir);\n }\n $files = glob($this->testsDestDir . '/*');\n foreach ($files as $file) {\n if (is_file($file)) {\n unlink($file);\n }\n }\n $test_code = '<?php\necho \"... \" . __FILE__;\nif ($memory_test) {\n echo \"-M\";\n for($i = 0; $i < 100000; $i++){\n $j[] = $i;\n }\n}\n';\n\n for ($testfile_index = 1; $testfile_index <= $num_files; $testfile_index++) {\n file_put_contents($this->testsDestDir . \"/testfile{$testfile_index}.php\", $test_code);\n }\n }",
"public function import_sample_data($index) {\n\t\t\t$row = 0;\n\t\t\t\n\t\t\tif (($handle = fopen(\"sample.csv\", \"r\")) !== FALSE) {\n\t\t\t\twhile (($data = fgetcsv($handle, 1000, \",\")) !== FALSE) {\n\t\t\t\t\t$row++;\n\t\t\t\t\t\n\t\t\t\t\tif( $row > 1 ) {\n\t\t\t\t\t\t$page \t\t = $data[0];\n\t\t\t\t\t\t$pageviews \t = $data[1];\n\t\t\t\t\t\t$unique \t = $data[2];\n\t\t\t\t\t\t$averagetime = $data[3];\n\t\t\t\t\t\t$bouncerate = $data[4];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$jsonstring = array (\"page\" => $page, 'pageviews' => $pageviews, 'unique' => $unique, 'averagetime' => $averagetime, 'bouncerate' => $bouncerate );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$jsonstring = json_encode($jsonstring);\n\t\t\t\t\t\t$this->push_data($index, $jsonstring);\n\t\t\t\t\t\t\n\t\t\t\t\t\techo \"$row \\n\"; \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n\t\t\t}\n\t\t}",
"public function run()\n {\n Reader::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n $reg_number = Hash::make(\"triyono\");\n for ($i = 0; $i < 10; $i++) {\n Reader::create([\n 'reg_number' => $reg_number,\n 'name' => $faker->name,\n 'location' => $faker->address,\n 'phone' => $faker->phoneNumber,\n 'photo' => $faker->name\n ]);\n }\n }",
"public function createChunkFile()\n {\n $input = fopen('php://input', 'r');\n $path = tempnam($TMP_PATH, 'opencast_');\n file_put_contents($path, $input);\n $this->setChunkPath($path);\n return true;\n }",
"public function run()\n {\n DB::table('jobs')->truncate();\n $faker = Faker::create();\n\n for ($i = 0; $i < 1000; $i++) {\n\n Job::create([\n 'title' => $faker->jobTitle(),\n 'description' => $faker->paragraph(5),\n 'raw_description' => $faker->paragraph(15),\n 'salary' => $faker->numberBetween(1000, 1000000),\n 'time_posted' => $faker->dateTime(),\n 'location' => $faker->country(),\n 'type' => $faker->word(),\n\n ]);\n\n }\n }",
"public function sampleAction()\r\n\t{\r\n\t\t$id = $this->getRequest()->getParam('feed_id');\r\n\t\t$limit = $this->getRequest()->getParam('limit');\r\n\r\n\t\t$datafeedmanager = Mage::getModel('datafeedmanager/datafeedmanager');\r\n\t\t$datafeedmanager->setId($id);\r\n\t\t$datafeedmanager->_limit=$limit;\r\n\r\n\t\t$datafeedmanager->_display=true;\r\n\r\n\t\t// if datafeedmanager record exists\r\n\t\tif ($datafeedmanager->load($id)) {\r\n\t\t\t \r\n\t\t\ttry {\r\n\t\t\t\t$content=$datafeedmanager->generateFile();\r\n\t\t\t\tif($datafeedmanager->_demo){\r\n\t\t\t\t\t $this->_getSession()->addError(Mage::helper('datafeedmanager')->__(\"Invalid license.\"));\r\n\t\t\t\t\t Mage::getConfig()->saveConfig('datafeedmanager/license/activation_code', '', 'default', '0');\r\n\t\t\t\t\t Mage::getConfig()->cleanCache();\r\n\t\t\t\t\t $this->_redirect('*/*/');\r\n\t\t\t\t}\r\n\t\t\t\telse print($content);\r\n\t\t\t}\r\n\t\t\tcatch (Mage_Core_Exception $e) {\r\n\t\t\t\t$this->_getSession()->addError($e->getMessage());\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t}\r\n\t\t\tcatch (Exception $e) {\r\n\t\t\t\t\t\r\n\t\t\t\t$this->_getSession()->addException($e, Mage::helper('datafeedmanager')->__('Unable to generate the data feed.'));\r\n\t\t\t\t$this->_redirect('*/*/');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$this->_getSession()->addError(Mage::helper('datafeedmanager')->__('Unable to find a data feed to generate.'));\r\n\t\t}\r\n\r\n\r\n\r\n\t}",
"public function run()\n {\n // genarate user accounts\n User::factory()->count(11000)->create();\n\n // generate company records with ralationship to clients records\n Company::factory()\n ->hasAttached(\n Client::factory()->count( rand(3,10) )\n )\n ->count(11000)\n ->create();\n }"
] |
[
"0.5652248",
"0.55372256",
"0.54614264",
"0.5448679",
"0.53374773",
"0.5321076",
"0.53201014",
"0.52974194",
"0.5294024",
"0.52845556",
"0.52441025",
"0.5233282",
"0.5216877",
"0.52062476",
"0.51558614",
"0.5153625",
"0.513886",
"0.5126461",
"0.5121177",
"0.5115301",
"0.51043993",
"0.5097529",
"0.5095027",
"0.50944006",
"0.5074983",
"0.5034129",
"0.50110376",
"0.50055695",
"0.5004089",
"0.499755"
] |
0.6113693
|
0
|
Render Verse, Instagram Area
|
public function instagram()
{
# Get Verses
# TODO : Make Random
$verses = $this->getDoctrine()->getRepository(Verse::class)
->findAll();
return $this->render('components/_instagram-area.html.twig', [
'verses' => $verses
]);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function ajarRenderDinamycBlock($attributes, $content) {\n return '<h1 class=\"my-3\">'.$attributes['content'].'</h1>'.\n '<img src=\"'.$attributes['mediaURL'].'\" alt=\"'.$attributes['mediaAlt'].'\" />'.\n '<hr>';\n}",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"public function render();",
"protected function render() {\n\t\t$settings = $this->get_settings_for_display();\n ?>\n\t\t<div class=\"happyden-feature-image\">\n\t\t\t\t<?php the_post_thumbnail( get_the_Id(), 'full' ); ?>\n\t\t</div>\n\t\t<?php\n\t}",
"protected function render() {}",
"protected function render() {}",
"protected function render() {}",
"public function instagram()\n {\n return view('conversation.instagram');\n }",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}",
"public function render() {}"
] |
[
"0.6009167",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.60062855",
"0.59799767",
"0.59686595",
"0.59679496",
"0.59679496",
"0.5881822",
"0.58462346",
"0.58462346",
"0.58462346",
"0.58462346",
"0.58462346",
"0.58462346"
] |
0.78845495
|
0
|
get the ajax var name on self::clientOptions
|
private function getAjaxVar()
{
return isset($this->clientOptions['ajaxVar']) ? $this->clientOptions['ajaxVar'] : 'ajax';
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected static function getAjaxName()\n\t{\n\t\tif (self::getGet('act') == 'editAll')\n\t\t{\n\t\t\treturn preg_replace('/.*_([0-9a-zA-Z]+)$/', '$1', self::getPost('name'));\n\t\t}\n\n\t\treturn self::getPost('name');\n\t}",
"protected static function getAjaxKey()\n\t{\n\t\t$strAjaxKey = str_replace('_' . self::getAjaxId(), '', self::getPost('id'));\n\n\t\tif (self::getGet('act') == 'editAll')\n\t\t{\n\t\t\t$strAjaxKey = preg_replace('/(.*)_[0-9a-zA-Z]+$/', '$1', $strAjaxKey);\n\t\t}\n\n\t\treturn $strAjaxKey;\n\t}",
"public function getAjaxID() {}",
"function GetAjaxFlagKey()\r\n\t{\r\n\t\treturn \"_psp_ajax_flag\";\r\n\t}",
"function GetAjaxSenderKey()\r\n\t{\r\n\t\treturn \"_psp_ajax_sender\";\r\n\t}",
"protected function get_option_name()\n {\n }",
"protected function getClientScriptOptions()\n\t{\n\t\t$options=TBaseValidator::getClientScriptOptions();\n\t\t$options['EventTarget'] = $this->getUniqueID();\n\t\treturn $options;\n\t}",
"public function get_name() {\r\n\t\treturn $this->options['name'];\r\n\t}",
"protected static function getAjaxId()\n\t{\n\t\treturn preg_replace('/.*_([0-9a-zA-Z]+)$/', '$1', self::getPost('id'));\n\t}",
"function ajax_get_name() {\r\n if( isset( $_POST['type'] ) && isset( $_POST['id'] ) ) {\r\n switch( $_POST['type'] ) {\r\n case 'clients':\r\n $userdata = get_userdata( $_POST['id'] );\r\n echo json_encode( array( 'status' => true, 'name' => $userdata->get('user_login') ) );\r\n break;\r\n case 'circles':\r\n $res = $this->get_group( $_POST['id'] );\r\n echo json_encode( array( 'status' => true, 'name' => $res['group_name'] ) );\r\n break;\r\n default:\r\n echo json_encode( array( 'status' => false, 'message' => 'Wrong type' ) );\r\n break;\r\n }\r\n }\r\n exit;\r\n }",
"public function getOptionsName()\n {\n return 'options' . ucfirst($this->getName());\n }",
"private function build_js_data() {\n\n\t\t$types_settings_action = Types_Ajax::get_instance()->get_action_js_name( Types_Ajax::CALLBACK_SETTINGS_ACTION );\n\n\t\treturn array(\n\t\t\t'ajaxInfo' => array(\n\t\t\t\t'fieldAction' => array(\n\t\t\t\t\t'name' => $types_settings_action,\n\t\t\t\t\t'nonce' => wp_create_nonce( $types_settings_action )\n\t\t\t\t)\n\t\t\t),\n\t\t);\n\t}",
"public function wpAjaxSlug()\n\t{\n\t\treturn $this->getSlug();\n\t}",
"protected function getClientScriptOptions()\n\t{\n\t\t$options = parent::getClientScriptOptions();\n\t\tif(($name=$this->getControlToCompare())!=='')\n\t\t{\n\t\t\tif(($control=$this->findControl($name))!==null)\n\t\t\t\t$options['ControlToCompare']=$control->getClientID();\n\t\t}\n\t\tif(($value=$this->getValueToCompare())!=='')\n\t\t\t$options['ValueToCompare']=$value;\n\t\tif(($operator=$this->getOperator())!==TValidationCompareOperator::Equal)\n\t\t\t$options['Operator']=$operator;\n\t\t$options['DataType']=$this->getDataType();\n\t\tif(($dateFormat=$this->getDateFormat())!=='')\n\t\t\t$options['DateFormat']=$dateFormat;\n\t\treturn $options;\n\t}",
"function getFormJsObjectName() {\n\t\t\tif ($this->hasForm( )) {\n\t\t\t\treturn $this->getForm( )->getJsObjectName( );\n\t\t\t}\n\n\t\t}",
"public function get_option_name() {\n\t\t$name = $this->get_input_name();\n\n\t\treturn $name . '[]';\n\t}",
"public function getSettingsAjax()\n {\n $formId = absint($_REQUEST['form_id']);\n wp_send_json_success(array(\n 'custom_css' => $this->getData($formId, '_custom_form_css'),\n 'custom_js' => $this->getData($formId, '_custom_form_js'),\n ), 200);\n }",
"public function getVarName()\n\t{\n\t\treturn 'form-'.$this->domain;\n\t}",
"public function getAjaxURL()\n {\n return AJAX_URL;\n }",
"protected function getAjaxUri() {}",
"protected function getAjaxUri() {}",
"public function ajaxAction() {\n\t\t$options = (isset($this->widgetConfiguration['option1']) ? '\"' . $this->widgetConfiguration['option1'] . '\"' : '\"\"') . ', ';\n\t\t$options .= (isset($this->widgetConfiguration['option2']) ? '\"' . $this->widgetConfiguration['option2'] . '\"' : '\"\"') . '';\n\t\treturn sprintf('SomeAjaxController::ajaxAction(%s)', $options);\n\t}",
"function voyage_mikado_set_ajax_url() {\n echo '<script type=\"application/javascript\">var MikadofAjaxUrl = \"'.admin_url('admin-ajax.php').'\"</script>';\n }",
"public function clientName()\n {\n return $this->bean->client()->name;\n }",
"function medigroup_mikado_set_ajax_url() {\n echo '<script type=\"application/javascript\">var MikadoAjaxUrl = \"'.admin_url('admin-ajax.php').'\"</script>';\n }",
"protected function getAjaxAttributes() {\n if ($this->isAjax()) {\n return [\n 'class' => ['use-ajax'],\n 'data-dialog-type' => 'dialog',\n 'data-dialog-renderer' => 'off_canvas',\n 'data-dialog-options' => Json::encode([\n 'width' => '650px',\n ]),\n ];\n }\n return [];\n }",
"public function getScriptOptions()\n {\n $params = [\n 'noCookieUrl' => $this->escapeUrl($this->getUrl('cookie/index/noCookies/')),\n 'triggers' => $this->escapeHtml($this->getTriggers())\n ];\n return json_encode($params);\n }",
"public function getName()\n {\n return $this->options['name'];\n }",
"public function getOptionName()\n {\n return $this->optionName;\n }",
"static function wck_fep_print_ajax_url() {\n\t\t/* ajax url for frontend */\n\t\techo '<script type=\"text/javascript\">var wckAjaxurl = \"'. admin_url('admin-ajax.php') .'\";</script>';\n\t}"
] |
[
"0.6479127",
"0.6108383",
"0.59873813",
"0.5898519",
"0.5782375",
"0.5756452",
"0.57536566",
"0.56845564",
"0.56514674",
"0.5632686",
"0.560963",
"0.55833215",
"0.5543889",
"0.5535903",
"0.55280155",
"0.5502585",
"0.5488254",
"0.5466468",
"0.5455532",
"0.5436809",
"0.5436809",
"0.53907466",
"0.5321289",
"0.53152645",
"0.5312728",
"0.52998555",
"0.5285328",
"0.52638817",
"0.5237363",
"0.5154316"
] |
0.7626559
|
0
|
get datetime pattern by format
|
private function getDateTimeRegexp($format)
{
// MM/dd/yyyy hh:mm:ss a
$format = preg_quote($format, '/');
$format = preg_replace('/[yMdhms]/', '\d', $format);
$format = str_replace('a', '(?:am|pm|AM|PM)', $format);
return '/' . $format . '/';
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getPattern()\n {\n// if ($this->getOption('pattern')) {\n// return $this->getOption('pattern');\n// }\n\n $pattern = $this->formatter->getPattern();\n\n // set right order with respect to locale (e.g.: de_DE=dd.MM.yy; en_US=M/d/yy)\n // lookup various formats at http://userguide.icu-project.org/formatparse/datetime\n if (preg_match('/^([yMd]+).+([yMd]+).+([yMd]+)$/', $pattern)) {\n return preg_replace(array('/y+/', '/M+/', '/d+/'), array('{{ year }}', '{{ month }}', '{{ day }}'), $pattern);\n }\n\n // default fallback\n return '{{ year }}-{{ month }}-{{ day }}';\n }",
"public function getPattern()\n\t{\n\t\t$string = $this->getViewState('Pattern','');\n\n\t\t$pattern = null;\n\n\t\t//try the subpattern of \"date time\" presets\n\t\t$subpatterns = explode(' ',$string,2);\n\t\t$datetime = array();\n\t\tif(count($subpatterns)==2)\n\t\t{\n\t\t\t$datetime[] = $this->getPreset($subpatterns[0]);\n\t\t\t$datetime[] = $this->getPreset($subpatterns[1]);\n\t\t}\n\n\t\t//we have a good subpattern\n\t\tif(count($datetime) == 2\n\t\t\t&& strlen($datetime[0]) == 1\n\t\t\t&& strlen($datetime[1]) == 1)\n\t\t{\n\t\t\t$pattern = $datetime;\n\t\t}\n\t\telse //no subpattern, try the presets\n\t\t\t$pattern = $this->getPreset($string);\n\n\t\t//no presets found, use the string as the pattern\n\t\t//and let the DateFormat handle it.\n\t\tif($pattern===null)\n\t\t\t$pattern = $string;\n\t\tif (!is_array($pattern) && strlen($pattern) == 0)\n\t\t\t$pattern = null;\n\t\treturn $pattern;\n\t}",
"public function dateTimeFormat();",
"public function getDatePattern() {\r\n\t\treturn $this->datePattern;\r\n\t}",
"function getdatepattern($date) {\n if (preg_match('/\\d{2}\\/\\d{2}\\/\\d{4}/',$date)){\n $dtpattern = \"'%m/%d/%Y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{1,2}\\/\\d{4}/',$date)) {\n $dtpattern = \"'%m/%e/%Y \";\n }\n elseif (preg_match('/\\d{1,2}\\/\\d{1,2}\\/\\d{4}/',$date)) {\n $dtpattern = \"'%c/%e/%Y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{2}\\/\\d{2}/',$date)){\n $dtpattern = \"'%m/%d/%y \";\n }\n elseif (preg_match('/\\d{2}\\/\\d{1,2}\\/\\d{2}/',$date)) {\n $dtpattern = \"'%m/%e/%y \";\n }\n elseif (preg_match('/\\d{1,2}\\/\\d{1,2}\\/\\d{2}/',$date)) {\n $dtpattern = \"'%c/%e/%y \";\n }\n \n return $dtpattern;\n }",
"public static function getSchedulePattern(): string;",
"function gettimepattern($time) {\n if (preg_match('/\\d{1,2}:\\d{1,2}:\\d{2}[\\s]{0,1}[A|P]M/',$time)){\n $tmpattern = \"%r'\";\n }\n elseif (preg_match('/\\d{2}:\\d{2}[A|P]M/',$time)) {\n $tmpattern = \"%h:%i%p'\";\n }\n elseif (preg_match('/\\d{2}:\\d{2}[\\s][A|P]M/',$time)) {\n $tmpattern = \"%h:%i %p'\";\n }\n elseif (preg_match('/\\d{1}:\\d{2}[A|P]M/',$time)) {\n $tmpattern = \"%l:%i%p'\";\n }\n elseif (preg_match('/\\d{1}:\\d{2}[\\s][A|P]M/',$time)) {\n $tmpattern = \"%l:%i %p'\";\n }\n else {\n $tmpattern = \"%T'\";\n }\n \n return $tmpattern;\n }",
"public static function convertStringDate($datetime, $pattern)\r\n\t{\r\n\t\treturn date($pattern, strtotime($datetime));\r\n\t}",
"public function getPattern();",
"public function getPattern();",
"public function getPattern() {}",
"private static function getDate($pattern, $dtime)\r\n\t{\r\n\t\t/*if( $fulltime )\r\n\t\t{\r\n\t\t\t$tPattern = 'H:i:s';\r\n\t\t\t$pattern .= ' '.$tPattern;\r\n\t\t}*/\r\n\t\treturn date( $pattern, ($dtime ? $dtime : mktime()) );\r\n\t}",
"public function getDateTimeFormat($type);",
"public function getDateTimeFormat($type);",
"public function getPattern(): string;",
"public function getPattern(): string;",
"public function getDateTimeFormat();",
"public function formatPattern(DateTimeInterface $datetime, string $pattern, Locale|string|null $locale = null): string\n {\n return $this->getFormatter($locale)->formatPattern($datetime, $pattern);\n }",
"public static function getFormat(): string;",
"public function format($format) {\n \t$spf = str_replace(array(\"d\",\"m\",\"Y\"),array(\"%3$02d\",\"%2$02d\",\"%1$04d\"),$format);\n \t\treturn sprintf($spf, $this->dt[0], $this->dt[1], $this->dt[2]);\n\t}",
"public function getTimeFormat($type = null);",
"public function getTimeFormat($type = null);",
"public function getFormat() {}",
"public function getFormat() {}",
"public function getFormat() {}",
"public function timeFormat();",
"abstract public function getFormat();",
"public function getFormat();",
"public function getFormat();",
"public function getFormat();"
] |
[
"0.72538805",
"0.6905279",
"0.65720147",
"0.63748854",
"0.63234246",
"0.6298578",
"0.6280233",
"0.5825008",
"0.581883",
"0.581883",
"0.5801467",
"0.5801198",
"0.576562",
"0.576562",
"0.56534725",
"0.56534725",
"0.5635633",
"0.5604547",
"0.5596793",
"0.55018234",
"0.54719716",
"0.54719716",
"0.54573494",
"0.54573494",
"0.54573494",
"0.54472625",
"0.5434354",
"0.53983605",
"0.53983605",
"0.53983605"
] |
0.71133804
|
1
|
Print the active filter form.
|
function display_active() {
$this->_activeform->display();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function FilterForm()\n\t{\tob_start();\n\t\techo '<form class=\"akFilterForm\"><span>Filter</span><input type=\"text\" name=\"filter\" value=\"', $this->InputSafeString($this->filter), '\" /><input type=\"submit\" class=\"submit\" value=\"Get\" /><div class=\"clear\"></div></form>';\n\t\treturn ob_get_clean();\n\t}",
"public function _report_filters_ui()\n\t{\n\t\t$filter = View::factory('actionable_filter');\n\t\t$filter->render(TRUE);\n\t}",
"function show_filter_active($filter_active)\n\t\t{\n\t\t\t$this->t->set_var(array('filter_active_up'=>$filter_active));\n\t\t\t//show the select\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'selected_active_all'\t\t=> ($filter_active == '')? 'selected=\"selected\"' : '',\n\t\t\t\t'selected_active_active'\t=> ($filter_active == 'y')? 'selected=\"selected\"' : '',\n\t\t\t\t'selected_active_inactive'\t=> ($filter_active == 'n')? 'selected=\"selected\"' : '',\n\t\t\t));\n\t\t}",
"function displayFilterMenu($filterCrieria) {\n $sessionOptions = pullUniqueValues(\"mtn_application\", \"ap_session\");\n $statusOptions = pullUniqueValues(\"mtn_application\", \"ap_status\");\n $lastNameOptions = pullUniqueValues(\"mtn_application\", \"ap_lastname\");\n\n echo \"\\n\\n<p style='margin-bottom: 1cm;'> </p>\\n\";\n echo \"<form method='post' name='filterSelection'>\\n\\n\";\n\n displaySelectionMenu(\"Filter by Session:\", \"filterSession\", $sessionOptions, $filterCrieria['ap_session']);\n displaySelectionMenu(\"Filter by Status:\", \"filterStatus\", $statusOptions, $filterCrieria['ap_status']);\n displaySelectionMenu(\"Filter by Last Name:\", \"filterLastName\", $lastNameOptions, $filterCrieria['ap_lastname']);\n\n echo \"<input type='submit' name='filter_button' value='Filter'>\\n\";\n echo \"</form>\\n\\n\";\n}",
"function god(){\n print_r( current_filter() );\n echo '<br />';\n }",
"public function output_current_filters_widget() {\n\n\t\t$product_titles = array();\n\n\t\tforeach ( $this->product_ids as $product_id ) {\n\n\t\t\t$product = wc_get_product( $product_id );\n\n\t\t\t$product_titles[] = $product instanceof WC_Product ? $product->get_formatted_name() : '#' . $product_id;\n\t\t}\n\n\t\tprintf( '<p><strong>%1$s</strong></p><p><a class=\"button\" href=\"%2$s\">%3$s</a></p>', implode( ', ', $product_titles ), esc_url( remove_query_arg( 'product_ids' ) ), __( 'Reset', 'woocommerce-cost-of-goods' ) );\n\t}",
"function FilterForm()\n\t{\tob_start();\n\t\techo \"<form class='akFilterForm' method='get' action='\", $_SERVER[\"SCRIPT_NAME\"], \"'>\\n<span>Male or Female</span>\\n<select name='morf'>\\n\";\n\t\tforeach (array(\"\"=>\"all\", \"M\"=>\"Male\", \"F\"=>\"Female\") as $option=>$text)\n\t\t{\techo \"<option value='\", $option, \"'\", $option == $_GET[\"morf\"] ? \" selected='selected'\" : \"\", \">\", $text, \"</option>\\n\";\n\t\t}\n\t\techo \"</select>\\n<span>Country</span>\\n<select name='ctry' id='ctry_select' onchange='MemberFilterCountryList();'>\\n<option value=''>all</option>\";\n\t\tforeach ($this->GetCountries(\"shortname\", true) as $option=>$text)\n\t\t{\techo \"<option value='\", $option, \"'\", $option == $_GET[\"ctry\"] ? \" selected='selected'\" : \"\", \">\", $this->InputSafeString($text), \"</option>\\n\";\n\t\t}\n\t\techo \"</select><span>Name (part)</span><input type='text' name='name' value='\", $this->InputSafeString($_GET[\"name\"]), \"' />\\n<input type='submit' class='submit' value='Apply Filter' />\\n<div class='clear'></div></form><div class='clear'></div>\";\n\t\treturn ob_get_clean();\n\t}",
"function show_filter_process()\n\t\t{\n\t\t\t$this->t->set_var('filter_process_up', $this->filter_process);\n\t\t\t// now show the filter process select\n\t\t\t$this->t->set_var('filter_process_selected_all', (!$this->filter_process)? 'selected=\"selected\"' : '');\n\t\t\t$this->t->set_block($this->template_name, 'block_filter_process', 'filter_process');\n\t\t\tforeach ($this->all_processes['data'] as $process)\n\t\t\t{\n\t\t\t\t$this->t->set_var(array(\n\t\t\t\t\t'filter_process_selected'\t=> ($process['wf_p_id'] == $this->filter_process)? 'selected=\"selected\"' : '',\n\t\t\t\t\t'filter_process_value'\t\t=> $process['wf_p_id'],\n\t\t\t\t\t'filter_process_name'\t\t=> $process['wf_name'],\n\t\t\t\t\t'filter_process_version'\t=> $process['wf_version'],\n\n\t\t\t\t));\n\t\t\t\t$this->t->parse('filter_process', 'block_filter_process', true);\n\t\t\t}\n\t\t}",
"function getFilters() {\r\n global $filterList;\r\n foreach ($filterList as $filter) {\r\n echo getSelectionOptions($filter);\r\n }\r\n echo '<button type=\"submit\" value=\"submit\">Save Filters</button>';\r\n }",
"function ShowFilterList() {\n\t\tglobal $dealers_reports;\n\t\tglobal $ReportLanguage;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\n\t\t// Field StartDate\n\t\t$sExtWrk = \"\";\n\t\t$sWrk = \"\";\n\t\tewrpt_BuildDropDownFilter($dealers_reports->StartDate, $sExtWrk, $dealers_reports->StartDate->DateFilter);\n\t\tif ($sExtWrk <> \"\" || $sWrk <> \"\")\n\t\t\t$sFilterList .= $dealers_reports->StartDate->FldCaption() . \"<br>\";\n\t\tif ($sExtWrk <> \"\")\n\t\t\t$sFilterList .= \" $sExtWrk<br>\";\n\t\tif ($sWrk <> \"\")\n\t\t\t$sFilterList .= \" $sWrk<br>\";\n\n\t\t// Show Filters\n\t\tif ($sFilterList <> \"\")\n\t\t\techo $ReportLanguage->Phrase(\"CurrentFilters\") . \"<br>$sFilterList\";\n\t}",
"function current_filter()\n {\n }",
"function dblog_filter_form($form) {\n $filters = dblog_filters();\n\n $form['filters'] = array(\n '#type' => 'fieldset',\n '#title' => t('Filter log messages'),\n '#collapsible' => TRUE,\n '#collapsed' => empty($_SESSION['dblog_overview_filter']),\n );\n foreach ($filters as $key => $filter) {\n $form['filters']['status'][$key] = array(\n '#title' => $filter['title'],\n '#type' => 'select',\n '#multiple' => TRUE,\n '#size' => 8,\n '#options' => $filter['options'],\n );\n if (!empty($_SESSION['dblog_overview_filter'][$key])) {\n $form['filters']['status'][$key]['#default_value'] = $_SESSION['dblog_overview_filter'][$key];\n }\n }\n\n $form['filters']['actions'] = array(\n '#type' => 'actions',\n '#attributes' => array('class' => array('container-inline')),\n );\n $form['filters']['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Filter'),\n );\n if (!empty($_SESSION['dblog_overview_filter'])) {\n $form['filters']['actions']['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset')\n );\n }\n return $form;\n}",
"function get_interactive_filter_display() {\n //todo: determine if this method is even needed anymore\n $result = '';\n\n if (isset($this->filter) && $this->allow_interactive_filters()) {\n $result .= $this->filter->display_add(true);\n $result .= $this->filter->display_active(true);\n }\n\n return $result;\n }",
"function edit() {\n $this->wireframe->print_button = false;\n \n \tif($this->active_filter->isNew()) {\n \t $this->httpError(HTTP_ERR_NOT_FOUND);\n \t} // if\n \t\n \tif(!$this->active_filter->canEdit($this->logged_user)) {\n \t $this->httpError(HTTP_ERR_FORBIDDEN);\n \t} // if\n \t\n \t$filter_data = $this->request->post('filter');\n \tif(!is_array($filter_data)) {\n \t $filter_data = array(\n \t 'name' => $this->active_filter->getName(),\n \t 'group_name' => $this->active_filter->getGroupName(),\n \t 'is_private' => $this->active_filter->getIsPrivate(),\n \t 'user_filter' => $this->active_filter->getUserFilter(),\n \t 'user_filter_data' => $this->active_filter->getUserFilterData(),\n \t 'date_filter' => $this->active_filter->getDateFilter(),\n \t 'date_from' => $this->active_filter->getDateFrom(),\n \t 'date_to' => $this->active_filter->getDateTo(),\n \t 'status_filter' => $this->active_filter->getStatusFilter(),\n \t 'project_filter' => $this->active_filter->getProjectFilter(),\n \t 'project_filter_data' => $this->active_filter->getProjectFilterData(),\n \t 'order_by' => $this->active_filter->getOrderBy(),\n \t 'objects_per_page' => $this->active_filter->getObjectsPerPage(),\n \t );\n \t} // if\n \t\n \t$this->smarty->assign('filter_data', $filter_data);\n \t\n \tif($this->request->isSubmitted()) {\n \t $old_name = $this->active_filter->getName();\n \t \n \t $this->active_filter->setAttributes($filter_data);\n \t \n \t $save = $this->active_filter->save();\n \t if($save && !is_error($save)) {\n \t flash_success(\"Filter ':name' has been updated\", array('name' => $old_name));\n \t $this->redirectToUrl($this->active_filter->getUrl());\n \t } else {\n \t $this->smarty->assign('errors', $save);\n \t } // if\n \t} // if\n }",
"protected abstract function printFormElements();",
"function simplenews_issue_filter_form() {\n // Current filter selections in $session var; stored at form submission\n // Example: array('newsletter' => 'all')\n $session = isset($_SESSION['simplenews_issue_filter']) ? $_SESSION['simplenews_issue_filter'] : _simplenews_issue_filter_default();\n $filters = simplenews_issue_filters();\n\n $form['filters'] = array(\n '#type' => 'fieldset',\n '#title' => t('Show only newsletters which'),\n );\n\n // Filter values are default\n $form['filters']['newsletter'] = array(\n '#type' => 'select',\n '#title' => $filters['newsletter']['title'],\n '#options' => $filters['newsletter']['options'],\n '#default_value' => $session['newsletter'],\n );\n $form['filters']['buttons']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Filter'),\n '#prefix' => '<span class=\"spacer\" />',\n );\n // Add Reset button if filter is in use\n if ($session != _simplenews_issue_filter_default()) {\n $form['filters']['buttons']['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset'),\n );\n }\n\n return $form;\n}",
"function theme_simplenews_subscription_filter_form($variables) {\n $form = $variables['form'];\n\n $output = '<div id=\"simplenews-subscription-filter\">';\n $output .= drupal_render($form['filters']);\n $output .= '</div>';\n $output .= drupal_render_children($form);\n return $output;\n}",
"private function displaySearchForm($filter)\t{\n trace('[CMD] '.__METHOD__);\n\n\t\t$formname = 'SearchForm';\n $tmplForm = $this->cObj->getSubpart($this->templateFile, '###'.strtoupper($formname).'###');\n\n\t\t$choicesArray = array();\n\t\t$disableArray = array();\n\t\t$hideArray = array();\n\n\t\t$formMarkerArray = $this->formHandler->prepareConfSubst($formname, $filter, $choicesArray, $disableArray, $hideArray);\n\n\t\t// HOOK: allow multiple hooks to manipulate formMarkerArray\n\t\tif (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['pt_gsauserreg']['pi5_hooks']['displaySearchFormHook'])) {\n\t\t\tforeach ($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['pt_gsauserreg']['pi5_hooks']['displaySearchFormHook'] as $className) {\n\t\t\t\t$hookObj = &t3lib_div::getUserObj($className);\n\t\t\t\t$formMarkerArray = $hookObj->displaySearchFormHook($this, $formMarkerArray);\n\t\t\t}\n\t\t}\n\n return $this->cObj->substituteMarkerArray($tmplForm, $formMarkerArray);\n\t}",
"public function show(Filter $filter)\n {\n //\n }",
"function get_filter_form(Table $table) {\n return $table->renderFilter();\n}",
"function dblog_filter_form_submit($form, &$form_state) {\n $op = $form_state['values']['op'];\n $filters = dblog_filters();\n switch ($op) {\n case t('Filter'):\n foreach ($filters as $name => $filter) {\n if (isset($form_state['values'][$name])) {\n $_SESSION['dblog_overview_filter'][$name] = $form_state['values'][$name];\n }\n }\n break;\n case t('Reset'):\n $_SESSION['dblog_overview_filter'] = array();\n break;\n }\n return 'admin/reports/dblog';\n}",
"function theme_simplenews_filter_form($variables) {\n $form = $variables['form'];\n\n $output = '<div id=\"simplenews-admin-filter\">';\n $output .= drupal_render($form['filters']);\n $output .= '</div>';\n $output .= drupal_render_children($form);\n return $output;\n}",
"function simplenews_subscription_filter_form() {\n // Current filter selections in $session var; stored at form submission\n // Example: array('list' => 'all', 'email' => 'hotmail')\n $session = isset($_SESSION['simplenews_subscriptions_filter']) ? $_SESSION['simplenews_subscriptions_filter'] : '';\n $session = is_array($session) ? $session : _simplenews_subscription_filter_default();\n $filters = simplenews_subscription_filters();\n\n $form['filters'] = array(\n '#type' => 'fieldset',\n '#title' => t('Show only subscription which'),\n '#collapsible' => FALSE,\n );\n\n // Filter values are default\n $form['filters']['list'] = array(\n '#type' => 'select',\n '#title' => $filters['list']['title'],\n '#options' => $filters['list']['options'],\n '#default_value' => $session['list'],\n );\n $form['filters']['email'] = array(\n '#type' => 'textfield',\n '#title' => $filters['email']['title'],\n '#default_value' => $session['email'],\n );\n $form['filters']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Filter'),\n '#prefix' => '<span class=\"spacer\" />',\n );\n // Add Reset button if filter is in use\n if ($session != _simplenews_subscription_filter_default()) {\n $form['filters']['reset'] = array(\n '#type' => 'submit',\n '#value' => t('Reset'),\n );\n }\n\n return $form;\n}",
"function ShowFilterList() {\n\t\tglobal $deals_details;\n\t\tglobal $ReportLanguage;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\n\t\t// Field dealer\n\t\t$sExtWrk = \"\";\n\t\t$sWrk = \"\";\n\t\tewrpt_BuildDropDownFilter($deals_details->dealer, $sExtWrk, \"\");\n\t\tif ($sExtWrk <> \"\" || $sWrk <> \"\")\n\t\t\t$sFilterList .= $deals_details->dealer->FldCaption() . \"<br>\";\n\t\tif ($sExtWrk <> \"\")\n\t\t\t$sFilterList .= \" $sExtWrk<br>\";\n\t\tif ($sWrk <> \"\")\n\t\t\t$sFilterList .= \" $sWrk<br>\";\n\n\t\t// Field date_start\n\t\t$sExtWrk = \"\";\n\t\t$sWrk = \"\";\n\t\tewrpt_BuildDropDownFilter($deals_details->date_start, $sExtWrk, $deals_details->date_start->DateFilter);\n\t\tif ($sExtWrk <> \"\" || $sWrk <> \"\")\n\t\t\t$sFilterList .= $deals_details->date_start->FldCaption() . \"<br>\";\n\t\tif ($sExtWrk <> \"\")\n\t\t\t$sFilterList .= \" $sExtWrk<br>\";\n\t\tif ($sWrk <> \"\")\n\t\t\t$sFilterList .= \" $sWrk<br>\";\n\n\t\t// Field status\n\t\t$sExtWrk = \"\";\n\t\t$sWrk = \"\";\n\t\tewrpt_BuildDropDownFilter($deals_details->status, $sExtWrk, \"\");\n\t\tif ($sExtWrk <> \"\" || $sWrk <> \"\")\n\t\t\t$sFilterList .= $deals_details->status->FldCaption() . \"<br>\";\n\t\tif ($sExtWrk <> \"\")\n\t\t\t$sFilterList .= \" $sExtWrk<br>\";\n\t\tif ($sWrk <> \"\")\n\t\t\t$sFilterList .= \" $sWrk<br>\";\n\n\t\t// Show Filters\n\t\tif ($sFilterList <> \"\")\n\t\t\techo $ReportLanguage->Phrase(\"CurrentFilters\") . \"<br>$sFilterList\";\n\t}",
"function show_forms()\n {\n }",
"abstract function display( $p_filter_value );",
"public function displayFilterField($form)\n\t{\n\t\t// See: https://docs.joomla.org/Talk:Checkbox_form_field_type\n\t\t?>\n\t\t<input type=\"hidden\" name=\"jform[settings][chk_filter]\" value=\"0\">\n\t\t<div class=\"control-group\">\n\t\t\t<div class=\"control-label\"><?php echo $form->getLabel('fieldname'); ?></div>\n\t\t\t<div class=\"controls\"><?php echo $form->getInput('fieldname'); ?></div>\n\t\t</div>\n\t\t<div class=\"control-group\">\t\n\t\t\t<div class=\"control-label\"><?php echo $form->getLabel('chk_filter', 'settings'); ?></div>\n\t\t\t<div class=\"controls\"><?php echo $form->getInput('chk_filter', 'settings'); ?></div>\n\t\t</div>\n\t\t<?php \n\t\techo $form->getInput('field_id');\n\t}",
"public function getFilterForm() {\n\n return $this->filterForm;\n }",
"function renderFilterCreationForm() {\n\t\t$this->pi_loadLL();\n\t\t$markerArray = array();\n\t\t$content = tslib_CObj::getSubpart($this->fileContent, '###NEWFILTER###');\n\n\t\t$markerList = array('SAVE', 'CANCEL', 'FILTER_TITLE_LABEL', 'FILTER_DESCRIPTION_LABEL');\n\t\tforeach ($markerList as $marker) {\n\t\t\t$markerArray[$marker] = $this->cObj->stdWrap($this->pi_getLL($marker, $marker, false), $this->conf['newfilter.'][strtolower($marker) . '.']);\n\t\t}\n\n\t\t// FORM URL\n\t\tif (!isset($this->conf['newfilter.']['form_url.']['parameter'])) {\n\t\t\t$this->conf['newfilter.']['form_url.']['parameter'] = $GLOBALS['TSFE']->id;\n\t\t}\n\t\t$this->conf['newfilter.']['form_url.']['returnLast'] = 'url';\n\t\t$markerArray['FORM_URL'] = $this->cObj->typolink('', $this->conf['newfilter.']['form_url.']);\n\n\t\t$content = tslib_CObj::substituteMarkerArray($content, $markerArray, '###|###');\n\n\t\treturn $content;\n\t}",
"function theme_nycc_rides_report_filters($form) {\r\n $output = '';\r\n foreach (element_children($form['status']) as $key) {\r\n $output .= drupal_render($form['status'][$key]);\r\n }\r\n $output .= '<div id=\"nycc-rides-report-buttons\">'. drupal_render($form['buttons']) .'</div>';\r\n return $output;\r\n}"
] |
[
"0.7246539",
"0.662721",
"0.64566123",
"0.64543325",
"0.64429057",
"0.63894653",
"0.6370176",
"0.6335452",
"0.6335436",
"0.6227072",
"0.62198895",
"0.618106",
"0.60684603",
"0.6020685",
"0.5991139",
"0.59891355",
"0.59694237",
"0.59673345",
"0.5944106",
"0.59317666",
"0.5927552",
"0.59213746",
"0.5915934",
"0.58983016",
"0.58746934",
"0.58526355",
"0.58197623",
"0.5782828",
"0.57619894",
"0.576185"
] |
0.6936727
|
1
|
Setup the Dusk environment.
|
protected function setupDuskEnvironment()
{
if (file_exists(base_path($this->duskFile()))) {
$this->backupEnvironment(); // Always back up the environment, no reason not to.
$this->refreshEnvironment();
}
$this->writeConfiguration();
$this->setupSignalHandler();
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function setup() {\n $driver = new \\Behat\\Mink\\Driver\\GoutteDriver();\n $this->session = new \\Behat\\Mink\\Session($driver);\n $this->session->start();\n }",
"protected function setUp(): void\n {\n $this->driver = RemoteWebDriver::createBySessionID(\n 'session-id',\n 'http://foo.bar:4444',\n null,\n null,\n true,\n new DesiredCapabilities([])\n );\n }",
"protected function setUp()\n {\n $this->setHost('localhost');\n $this->setPort(4444);\n $this->setBrowserUrl('http://localhost/');\n $this->setBrowser('firefox');\n }",
"public function setUp()\n {\n $this->uri = $this->resolveUri();\n $this->webDriver = new PHPWebDriver_WebDriver(self::WEB_DRIVER_HOST);\n $this->session = $this->webDriver->session('htmlunit');\n }",
"function setUp()\n\t{\n\t\t// $this->setBrowser(\"*firefox\");\n\t\t$this->setBrowserUrl(\"http://localhost/\");\n\t}",
"protected function setUp()\n {\n $this->setBrowser('firefox');\n $this->setBrowserUrl('http://localhost:8001/');\n }",
"public function setUpSession() \n {\n exec('mysqldump -u '.env('DB_USERNAME').' test | mysql -u '.env('DB_USERNAME').' test_testing');\n\n $this->amOnPage('/');\n $this->setCookie('selenium_request', 'true');\n }",
"protected function setUpBasicFrontendEnvironment() {}",
"public static function setUpBeforeClass()\n {\n\n\n $yaml = Yaml::parse(file_get_contents('../etc/config.yml'));\n\n self::$cred['username'] = $yaml['username'];\n self::$cred['password'] = $yaml['password'];\n\n $host = 'http://localhost:4444/wd/hub';\n\n $userAgent = 'Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19';\n\n $options = new ChromeOptions();\n $options->addArguments(array(\n '--user-agent=' . $userAgent\n ));\n\n $caps = DesiredCapabilities::chrome();\n $caps->setCapability(ChromeOptions::CAPABILITY, $options);\n\n self::$driver = RemoteWebDriver::create($host, $caps);\n }",
"function quickSetUp()\n {\n $this->setUp(null, null, null, null, null);\n }",
"protected function setUp()\n {\n // base directory for a .env file, and load it if it exists.\n $dotenvDir = __DIR__;\n for ($i = 0; $i < 4; $i++) {\n if (file_exists($dotenvDir.'/.env')) {\n $dotenv = new Dotenv($dotenvDir);\n $dotenv->load();\n break;\n }\n $dotenvDir = dirname($dotenvDir);\n }\n\n $this->memberclicks = new MemberClicks(getenv('MEMBERCLICKS_ORG_ID'), getenv('MEMBERCLICKS_CLIENT_ID'), getenv('MEMBERCLICKS_CLIENT_SECRET'));\n $this->memberclicks->auth();\n }",
"public function prepare_browser() {\n\t\t$this->setup_hooks();\n\t\t$this->setup_browser();\n\t\t$this->setup_tabs();\n\t\t$this->setup_transients();\n\t}",
"public function setUp()\n\t{\n\t\t\\Laravel\\Session::load();\n\t}",
"protected function setUp() {\n parent::setUp();\n Monkey\\setUp();\n }",
"protected function setUp(): void\n {\n //Página que vai executar o teste\n self::$driver->navigate()->to('https://www.precodogas.com.br');\n }",
"public function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\tSession::start();\n\t}",
"public function setup()\n {\n $_SESSION = array();\n $_SESSION['security'] = array(\n 'user-agent' => md5(empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']),\n 'ip' => $_SERVER['REMOTE_ADDR'],\n 'start' => time()\n );\n $_SESSION['stores'] = array();\n }",
"protected function setUp() {\n\n\t\tparent::setUp();\n\t\tMonkey::setUpWP();\n\t}",
"public function setUp() : void\n {\n parent::setUp();\n\n $this->app['request']->setLaravelSession($this->app['session']->driver('array'));\n }",
"protected function setUp() {\n\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}",
"public function setUp()\n {\n parent::setUp();\n\n Configure::write(THUMBER . '.driver', 'gd');\n Configure::write(THUMBER . '.comparingDir', TESTS . DS . 'comparing_files' . DS . 'gd' . DS);\n }",
"protected function setUp() {\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}",
"protected function setUp() {\n\t\tparent::setUp();\n\t\tMonkey\\setUp();\n\t}",
"public function setUp()\n {\n $this->_standardLib = new \\App\\OOProgramming\\StandardLibrary;\n $this->_daughter = new \\App\\OOProgramming\\Daughter;\n }",
"protected function setUp()\n {\n $configurationFactory = new \\Yana\\ConfigurationFactory();\n $configuration = $configurationFactory->loadConfiguration(CWD . 'resources/system.config.xml');\n $configuration->configdrive = YANA_INSTALL_DIR . 'config/system.drive.xml';\n $configuration['default']['user_requirements'] = array('level' => '1');\n $this->container = new \\Yana\\Core\\Dependencies\\Container($configuration);\n $schemaFactory = new \\Yana\\Db\\SchemaFactory();\n $this->schema = $schemaFactory->createSchema('check');\n $this->form = $this->_buildForm($this->schema);\n $this->object = new \\Yana\\Forms\\Setups\\Builder($this->form, $this->container);\n }",
"protected function setUp()\n {\n Kohana::config('database')->default = Kohana::config('database')\n ->unit_testing;\n Auth::instance()->login(TEST_USERNAME, TEST_PASSWORD);\n\n // Index data and start up the search daemon\n exec('indexer --all --config ' . SPHINX_CONF);\n exec('searchd --config ' . SPHINX_CONF);\n }",
"function setUp()\r\n {\r\n global $webUrl;\r\n global $SUPER_USER_NAME;\r\n global $SUPER_USER_PASSWORD;\r\n \r\n // Login the system.\r\n $this->login($SUPER_USER_NAME, $SUPER_USER_PASSWORD, \r\n \"$webUrl/login.php\"); \r\n\r\n return TRUE;\r\n }",
"protected function setUp() {\n $this->installer = new HomeNet_Installer;\n }",
"protected function setUp()\n {\n global $di;\n\n // Setup di\n $this->di = new DIFactoryConfig();\n $this->di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n // $this->di->loadServices(ANAX_INSTALL_PATH . \"/test/config/di\");\n\n // View helpers uses the global $di so it needs its value\n $di = $this->di;\n\n // Setup the controller\n $this->controller = new BookController();\n $this->controller->setDI($this->di);\n // $this->controller->initialize();\n }",
"protected function setUp(): void\n {\n global $di;\n // Init service container $di to contain $app as a service\n $di = new DIMagic();\n $di->loadServices(ANAX_INSTALL_PATH . \"/config/di\");\n $app = $di;\n $this->app = $app;\n $di->set(\"app\", $app);\n\n // Create and initiate the controller\n $this->controller = new DiceGameController();\n $this->controller->setApp($app);\n $this->controller->initialize();\n }"
] |
[
"0.7185607",
"0.7027301",
"0.69704247",
"0.6910772",
"0.6827656",
"0.6799014",
"0.64508903",
"0.6400689",
"0.63791096",
"0.63577527",
"0.6346928",
"0.624728",
"0.6204289",
"0.61977863",
"0.61550087",
"0.6151433",
"0.61458135",
"0.6144018",
"0.61388075",
"0.61267626",
"0.61108714",
"0.610142",
"0.610142",
"0.6089879",
"0.60719717",
"0.6070978",
"0.6065002",
"0.6062221",
"0.6049432",
"0.6043659"
] |
0.8297342
|
0
|
Backup the current environment file.
|
protected function backupEnvironment()
{
$fileNamesInBasePath = scandir(base_path());
foreach ($fileNamesInBasePath as $fileNameToCheck) {
if (stripos($fileNameToCheck, '.env') === 0) {
// We have a .env file that might be loaded by laravel,
// back it up if it's not the dusk file
if ($fileNameToCheck != $this->duskFile()) {
$backupFileName = ".dawn.backup{$fileNameToCheck}";
// dusk.backup.{name} means we can test for files starting with .env,
// and then to restore we look for files starting with .dawn.backup
// using dusk. also helps clarify where the file is coming from
copy(base_path($fileNameToCheck), base_path($backupFileName));
}
}
}
copy(base_path($this->duskFile()), base_path('.env')); // We should only have $this->duskFile() and .env
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"protected function restoreEnvironment()\n {\n $fileNamesInBasePath = scandir(base_path());\n foreach ($fileNamesInBasePath as $fileNameToCheck) {\n if (stripos($fileNameToCheck, '.dawn.backup') === 0) {\n\n // This is a file backup up by dusk on a previous run, just restore it\n $restoredFileName = str_ireplace('.dawn.backup', '', $fileNameToCheck);\n copy(base_path($fileNameToCheck), base_path($restoredFileName));\n unlink(base_path($fileNameToCheck));\n }\n }\n }",
"protected static function copyEnv(): void\n {\n $base = self::getBasepath();\n\n $envPath = $base . '/.env';\n $examplePath = $base . '/.env.example';\n if (file_exists($examplePath) && !file_exists($envPath)) {\n copy($examplePath, $envPath);\n }\n }",
"private function backupLevel()\n\t{\n\t\tif( realpath( $this->OutputPath ) )\n\t\t{\n\t\t\t$this->ensureDirectoryExists( $this->BackupDirectory );\n\t\t\trename( $this->OutputPath, $this->getBackupPath( $this->BackupDirectory ) );\n\t\t}\n\t}",
"public static function copyEnv()\n {\n // Get VCAP_APPLICATION\n $vcapsApplication = json_decode(getenv('VCAP_APPLICATION'), true);\n // Copy env of the appropriate space\n if (isset($vcapsApplication['space_name'])) {\n copy(\n '.env.' . strtolower($vcapsApplication['space_name']),\n '.env'\n );\n }\n }",
"protected function createEnvFile()\n {\n if (! file_exists('.env')) {\n copy('.env.example', '.env');\n $this->line('.env file successfully created');\n }\n }",
"public function actionBackup()\n {\n $user = \\Yii::$app->db->username;\n $pass = \\Yii::$app->db->password;\n $db = preg_replace('/^.*\\=(\\w+)$/', '$1', \\Yii::$app->db->dsn);\n $name = date('Y-m-d_H-i').\".sql\";\n $tables = implode(\" \", array_filter(\\Yii::$app->db->schema->tableNames, function($v){\n return !preg_match('/^data_.*$/', $v);\n }));\n exec(\"mysqldump -u$user -p$pass $db $tables > \" . \\Yii::getAlias(\"@app/runtime/$name\"));\n }",
"public function actionBackup()\n {\n $user = \\Yii::$app->db->username;\n $pass = \\Yii::$app->db->password;\n $db = preg_replace('/^.*\\=(\\w+)$/', '$1', \\Yii::$app->db->dsn);\n $name = date('Y-m-d_H-i').\".sql\";\n $tables = implode(\" \", array_filter(\\Yii::$app->db->schema->tableNames, function($v){\n return !preg_match('/^data_.*$/', $v);\n }));\n exec(\"mysqldump -u$user -p$pass $db $tables > \" . \\Yii::getAlias(\"@app/runtime/$name\"));\n }",
"public function backupData()\n {\n $this->load->dbutil();\n\n // Backup database dan dijadikan variable\n $backup = $this->dbutil->backup();\n\n // Load file helper dan menulis ke server untuk keperluan restore\n $this->load->helper('file');\n write_file('/backup/database/mybackup.zip', $backup);\n\n // Load the download helper dan melalukan download ke komputer\n $this->load->helper('download');\n force_download('mybackup.zip', $backup);\n }",
"public function backup(){\n\t\t$this->verify();\n\t\t$this->load->dbutil();\n\t\t$this->load->helper('file');\n\t\t$this->load->helper('download');\n\t\t$this->load->library('zip');\n\t\t$database_tables=['admin','behaviour','class','comments','parentlogin','resources','resources_cat','scores','studentlogin','students','subject','teachers'];\n\t\tforeach ($database_tables as $tables) {\n\t\t\t$query = $this->db->query(\"SELECT * FROM \".$tables);\n\t\t\t$data=$this->dbutil->csv_from_result($query);\n\t\t\twrite_file('../backup/'.$tables.'-'.date(\"F-d-Y\").'.csv', $data);\n\t\t\t\n\t\t}\n\t\t$this->zip->read_dir('../backup', TRUE);\n\t\t$this->zip->read_dir('../assets/myResources');\n\t\t//$this->zip->read_dir('assets/documents', FALSE);\n\t\t//$this->zip->download('officers_credential.zip');\n\t\tdelete_files('../backup/');\n\t\t$this->zip->download('backup'.date(\"F-d-Y\").'.zip');\n\t}",
"public function backupFiles()\n\t{\n\t\t$manifestData = $this->_getManifestData();\n\n\t\ttry\n\t\t{\n\t\t\tforeach ($manifestData as $row)\n\t\t\t{\n\t\t\t\tif (UpdateHelper::isManifestVersionInfoLine($row))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// No need to back up migration files.\n\t\t\t\tif (UpdateHelper::isManifestMigrationLine($row))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$rowData = explode(';', $row);\n\t\t\t\t$filePath = IOHelper::normalizePathSeparators(blx()->path->getAppPath().$rowData[0]);\n\n\t\t\t\t// If the file doesn't exist, it's a new file.\n\t\t\t\tif (IOHelper::fileExists($filePath))\n\t\t\t\t{\n\t\t\t\t\tBlocks::log('Backing up file '.$filePath, \\CLogger::LEVEL_INFO);\n\t\t\t\t\tIOHelper::copyFile($filePath, $filePath.'.bak');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n\t\t\tBlocks::log('Error updating files: '.$e->getMessage(), \\CLogger::LEVEL_ERROR);\n\t\t\tUpdateHelper::rollBackFileChanges($manifestData);\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function resetFrontendEnvironment() {\n\t\t$GLOBALS['TSFE'] = $this->tsfeBackup;\n\t\tchdir($this->workingDirectoryBackup);\n\t}",
"function backup() {\n global $host, $user, $pwd, $base, $path;\n $file = 'backup_' . date(\"Y-m-d-H:i:s\") . '.gz';\n\n system(\"mysqldump --add-drop-table --create-options --skip-lock-tables --extended-insert --quick --set-charset --host=$host --user=$user --password=$pwd $base | gzip > $path/backup/$file\");\n }",
"public function backupCurrentToken()\n {\n $stateStorage = $this->getClient()->getStateStorage();\n\n $token = $stateStorage->get($this->getStateStorageKeyName('token'));\n $stateStorage->set($this->getStateStorageKeyName('real_token'), $token);\n }",
"public function maybeBackupDatabase(BeforeScenarioScope $scope)\n {\n $db = $this->getWordpressParameter('database');\n if (! $db['restore_after_test']) {\n return;\n }\n\n /*\n * We need the logic of this method to operate only once, and have access to the Context.\n * Otherwise, we would use the (static) BeforeSuiteScope hook.\n */\n $backup_file = $this->getWordpress()->getSetting('database_backup_file');\n if ($backup_file) {\n return;\n }\n\n // Get the file to use as a backup.\n $file = ! empty($db['backup_path']) ? $db['backup_path'] : '';\n\n // If the path specified is not a file, use it as the preferred folder to store a new backup.\n if (! $file || ! is_file($file) || ! is_readable($file)) {\n $file = $this->exportDatabase(['path' => $file]);\n }\n\n // Note: $file may be either an absolute OR relative file path.\n $this->getWordpress()->setSetting('database_backup_file', $file);\n }",
"public function savebackup(){\n\n if($this->IS_DEMO){\n $this->session->set_flashdata('error', $this->config->item('app_demo_edit_err'));\n redirect($this->LIB_CONT_ROOT.'settings', 'refresh'); \n }\n set_time_limit(3600);\n $filename='dbbackup_'.date('dmy').'.gz';\n // Load the download helper and send the file to your desktop\n $this->load->helper('file');\n $this->load->helper('download');\n //create and download backup\n $this->load->dbutil();\n $backup = $this->dbutil->backup();\n force_download($filename, $backup);\n \n \n echo \"Backup downloading successful\";\n \n }",
"protected function restoreWorkingDirectory()\n {\n if ($this->cwd) {\n chdir($this->savedWorkingDirectory);\n }\n }",
"private function saveFile(): bool\n {\n return (file_put_contents($this->envPath, implode($this->env)) !== false);\n }",
"public function reset()\n {\n $this->call('cache:clear');\n copy(\n storage_path('app/example.config.json'),\n storage_path('app/config.json')\n );\n $this->info('Reset Completed!');\n }",
"public function backup() {\n $result = $this->dumpDatabase();\n $size = $this->getFilesize($this->filename);\n $this->sendMail($result, $size);\n echo $this->lang['all_done'];\n }",
"static private function database_backup() {\n // set the backup directory and filename\n $dir = mySpires::content_root() . \"/database_backups/\";\n $file = $dir . \"ajainphysics_\" . date('Y-m-d') . \".sql\";\n\n // If backup was already done, return\n if(file_exists($file) && self::quick()) return;\n\n // perform the backup\n // Set .my.cnf in the home folder\n $opts = include(__DIR__ . \"/../../../.mysqldb.php\");\n $query = \"HOME=/home/kz0qr7otxolj/ mysqldump --single-transaction {$opts->dbname} > {$file}\";\n exec($query,$output, $error);\n\n if($error) {\n self::message($error, 5);\n self::log(\"Database backup was interrupted!\", 5);\n return;\n }\n\n $backups = scandir($dir);\n foreach($backups as $backup) {\n $e = explode(\"ajainphysics_\", $backup);\n if($e[1]) {\n $e = explode(\".sql\", $e[1]);\n $backup_date = strtotime($e[0]);\n $days_past = floor((time() - $backup_date)/(60*60*24));\n\n if($days_past > 180 || ($days_past > 7 && date(\"w\", $backup_date) != 0))\n unlink($dir.$backup);\n }\n }\n\n self::log(\"I backed up your database.\");\n }",
"private function get_backup_file()\n {\n return $this->base_path . \"/TaskManager.serialized\";\n }",
"public function take_backup(){\n\t\t$this->load->dbutil();\n\n\t\t$prefs = array(\n 'tables' => array(), // Array of tables to backup.\n 'ignore' => array(), // List of tables to omit from the backup\n 'format' => 'zip', // gzip, zip, txt\n 'filename' => 'chikitsa-backup.sql', // File name - NEEDED ONLY WITH ZIP FILES\n 'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file\n 'add_insert' => TRUE, // Whether to add INSERT data to backup file\n 'newline' => \"\\n\" // Newline character used in backup file\n );\n\n\t\t// Backup your entire database and assign it to a variable\n\t\t$backup =& $this->dbutil->backup($prefs);\n\n\t\t// Load the file helper and write the file to your server\n\t\t$this->load->helper('file');\n\t\twrite_file('./chikitsa-backup.zip', $backup);\n\n\t\t// Load the download helper and send the file to your desktop\n\t\t$this->load->helper('download');\n\t\tforce_download('chikitsa-backup.zip', $backup);\n\n\t\t$this->backup();\n\t}",
"public function restore()\n\t{\n\t\t$this->files = array();\n\t}",
"public static function environmentFile(){\n return \\Illuminate\\Foundation\\Application::environmentFile();\n }",
"public function restore() {}",
"public function backupDatabase() {\r\n $this->sqlBackupFilename = 'database_' . date('YmdHis') . '_' . MD5(microtime()) . '.sql';\r\n\r\n // setup the sql backup path\r\n $sqlBackupFilePath = $this->getBackupPath() . '/' . $this->sqlBackupFilename;\r\n\r\n // setup the options\r\n $dumpSettings = array(\r\n 'add-drop-table' => true,\r\n 'exclude-table-data' => $this->skipDatabaseTableData,\r\n );\r\n\r\n // dump the database\r\n $dump = new Mysqldump('mysql:host=' . _CONFIG_DB_HOST . ';dbname=' . _CONFIG_DB_NAME, _CONFIG_DB_USER, _CONFIG_DB_PASS, $dumpSettings);\r\n $dump->start($sqlBackupFilePath);\r\n\r\n return file_exists($sqlBackupFilePath);\r\n }",
"public function backUp()\n {\n $inventory = $this->inventory;\n $this->oldInventory = $inventory;\n return;\n }",
"public function restore();",
"public function backup_database(){\n $this->load->dbutil();\n $prefs = array(\n 'tables' => array(), // Array of tables to backup.\n 'ignore' => array(), // List of tables to omit from the backup\n 'format' => 'zip', // gzip, zip, txt\n 'filename' => 'mybackup.sql', // File name - NEEDED ONLY WITH ZIP FILES\n 'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file\n 'add_insert' => TRUE, // Whether to add INSERT data to backup file\n 'newline' => \"\\n\" // Newline character used in backup file\n );\n // Backup your entire database and assign it to a variable\n $backup = $this->dbutil->backup($prefs);\n\n $filename = \"db_backup_\" . date('YmdHis') . \".zip\";\n // Load the file helper and write the file to your server\n $this->load->helper('file');\n write_file(\"C:/wamp64/www/nsmdih_cms/database/backups/\" . $filename, $backup); \n // Load the download helper and send the file to your desktop\n $this->load->helper('download');\n force_download($filename, $backup);\n\n }",
"function backup()\n {\n if($this->input->post('backup'))\n {\n $this->load->dbutil();\n \n if($this->input->post('format') == 'txt')\n {\n $extencion = 'sql'; \n }else{\n $extencion = $this->input->post('format'); \n }\n \n $prefs = array(\n 'tables' => $this->input->post('tablas'), // Array of tables to backup.\n 'ignore' => array(), // List of tables to omit from the backup\n 'format' => $this->input->post('format'), // gzip, zip, txt\n 'filename' => $this->input->post('name').'.'.$extencion, // File name - NEEDED ONLY WITH ZIP FILES\n 'add_drop' => TRUE, // Whether to add DROP TABLE statements to backup file\n 'add_insert' => TRUE, // Whether to add INSERT data to backup file\n 'newline' => \"\\n\" // Newline character used in backup file\n );\n\n // Backup your entire database and assign it to a variable\n $backup = $this->dbutil->backup($prefs);\n \n if($this->input->post('truncate'))\n {\n if(in_array('logs_usuarios', $prefs['tables']))\n {\n $this->model->truncate();\n } \n } \n \n // Load the file helper and write the file to your server\n $this->load->helper('file');\n write_file('/path/to/'.$prefs['filename'], $backup);\n \n // Load the download helper and send the file to your desktop\n $this->load->helper('download');\n force_download($prefs['filename'], $backup); \n }\n\n $db['tables'] = $this->db->list_tables();\n \n $this->armarVista('backup', $db);\n }"
] |
[
"0.6603401",
"0.6422491",
"0.60284895",
"0.57470167",
"0.5731741",
"0.5622803",
"0.5622803",
"0.56014574",
"0.5549392",
"0.55100876",
"0.5496493",
"0.539659",
"0.5323185",
"0.531341",
"0.5298305",
"0.5296291",
"0.5291173",
"0.52907807",
"0.52672464",
"0.52618814",
"0.52501285",
"0.5209091",
"0.51906455",
"0.5164884",
"0.5146014",
"0.51304346",
"0.5096993",
"0.5081205",
"0.50626487",
"0.50585616"
] |
0.7850911
|
0
|
Lists all Course models.
|
public function actionIndex() {
$searchModel = new CourseSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function index()\n {\n return course::all();\n }",
"public function getAllCourses()\n {\n $courses = $this->courseRepository->getAllCourses();\n if (isset($courses['errorMsg'])) {\n $courses = $this->makeEmptyCollection();\n }\n\n return view('front-end.courses.list', ['courses' => $courses]);\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function actionIndex()\n {\n\t\t\n /* $searchModel = new CourseSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]); */\n }",
"public function index()\n {\n return view('courses.all_courses')->with('course',course::all());\n\n }",
"public function courses(){\n $courses = Course::all();\n return View('admin.courses',compact('courses'));\n }",
"public static function courses()\n {\n return Course::all()->toArray();\n }",
"public function getAllCourses()\n {\n $courses = TableRegistry::getTableLocator()->get('Courses');\n $courses = $courses->find('all')->distinct('id')->toArray();\n return $courses;\n }",
"public function all_course_list(){\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/course_list';\n\t\t$mainData = array(\n\t\t\t'pagetitle'=> 'Lodnontec course List',\n\t\t\t'course_list'=> $this->setting_model->Get_All('course'),\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}",
"public function index()\n {\n $courses = Course::all();\n return view('admin.course.index',compact('courses'));\n }",
"public function index()\n {\n $courses = Course::orderBy('created_at', 'desc')->get();\n return view('admin.course.index', compact(\n 'courses',\n ));\n }",
"public function index()\n {\n //\n $courses = Course::where('active',true)\n ->orderBy('title','asc')\n ->get();\n return $courses;\n }",
"public function coursesCategoryList()\n { \n return CourseCategories::all();\n }",
"public function index()\n {\n $courses = Course::all();\n return view('auth.course.courses', compact('courses'));\n }",
"public function index()\n {\n $courses = Course::all();\n return view('admin.courses.index', compact('courses'));\n }",
"public function actionIndex()\n {\n $searchModel = new CoursesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $courses = Course::all();\n\n return view('courses.index', ['courses'=>$courses]);\n }",
"public function index()\n {\n $courses = Course::all();\n return view('admin.courses.courses')->with('courses',$courses);\n }",
"public static function courses(){\n return Catalog::where('active',1)\n ->where('for_sale', 1)\n ->where('litmos_deleted', 0)\n ->orderBy('name')\n ->lists( 'name', 'id');\n }",
"public function index()\n {\n $courses = Course::all();\n return view('courses.index', compact('courses'));\n }",
"public function index()\n\t{\n\t\t$this->authorize('index', Course::class);\n\n\t return Course::with([\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'user'=>function($query){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$query->select(['id','firstname','lastname']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'updatedByUser'=>function($query){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$query->select(['id','firstname','lastname']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'category'=>function($query){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$query->select(['id','name']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t])->get(['id','code','name','price','state','created_by','updated_by','category_id']);\n\n\t}",
"public function courses()\n {\n return $this->hasMany('\\T4KModels\\Course')->orderBy('title');\n }",
"public function courses() {\n $courses = Course::all();\n $data['courses'] = $courses;\n //dd($courses);\n return view('admin.courses', $data);\n }",
"public function index()\n {\n $course = Course::all();\n return view('admin/course')->with('courses',$course);\n }",
"public function index()\n {\n $courses = $this->repository->paginate();\n \n return view('course.index', compact('courses'));\n }",
"public function index()\n\t{\n\t\t$input = Request::only('sort', 'direction', 'page', 'size', 'search');\n\n\t\t$data = $this->execute(ListCommand::class, $input, [\n\t\t\tListingSanitizer::class\n\t\t]);\n\n\t\t$courses = $this->getPaginator($data);\n\n\t\treturn View::make('admin.courses.index', compact('courses'));\n\t}",
"function get_all_courses()\n\t{\n\t\t// fetch all data\n\t\treturn $this->db->query('SELECT * FROM courses')->result_array();\n\t}",
"public function index()\n {\n return Course::with('categorie')->paginate(10);\n }",
"public function index()\n {\n //\n $courses = Course::all();\n return view('course.index')->with('courses', $courses);\n }",
"public static function get_all_courses() {\n\n $context = get_context_instance(CONTEXT_SYSTEM);\n self::validate_context($context);\n require_capability('moodle/course:view', $context); \n $courses = glueserver_course_db::glueserver_get_all_courses();\n $returns = array();\n foreach ($courses as $course) {\n $course = new glueserver_course($course);\n $returns[] = $course->get_data();\n }\n return $returns;\n }"
] |
[
"0.7712203",
"0.73487234",
"0.7219559",
"0.7214283",
"0.71640027",
"0.7126516",
"0.7048838",
"0.7030167",
"0.7011372",
"0.7003652",
"0.6954217",
"0.6951784",
"0.69236356",
"0.6913192",
"0.6905824",
"0.6890306",
"0.6884599",
"0.6884178",
"0.6863142",
"0.6845178",
"0.68450785",
"0.68434477",
"0.6818493",
"0.6818391",
"0.6818063",
"0.6817669",
"0.68128717",
"0.6778958",
"0.6776277",
"0.67699134"
] |
0.7589027
|
1
|
Creates a new Course model. If creation is successful, the browser will be redirected to the 'view' page.
|
public function actionCreate() {
$model = new Course();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->id]);
}
return $this->render('create', [
'model' => $model,
]);
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function actionCreate()\n {\n $model = new Course();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect('index');\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n {\n $model = new CourseSite();\n\n if ($model->load(Yii::$app->request->post())){\n if($model->createCourseSite($model->course)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function create()\n {\n //\n return view(\"course.create\");\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Student;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Student']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Student'];\n\t\t\tif($model->save(false)){\n\t\t\t\t$studentCourse = new StudentCourse;\n\t\t\t\t$studentCourse->STUDENT_ID = $model->ID;\n\t\t\t\t$studentCourse->COURSE_ID = $_POST['StudentCourse']['COURSE_ID'];\n\t\t\t\t$studentCourse->STATUS = 1;\n\t\t\t\t$studentCourse->save(false);\n\t\t\t\t$this->redirect(array('admin'));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"protected function create(){\n \t$courseCategories = CourseCategory::getCourseCategoriesForAdmin();\n\t\t$courseSubCategories = [];\n\t\t$course= new CourseCourse;\n\t\treturn view('courseCourse.create', compact('courseCategories','courseSubCategories','course'));\n }",
"public function create()\n\t{\n\t\t$course = new Course;\n\n\t\treturn view('courses.create', compact('course'));\n\t}",
"public function create()\n {\n return view('Addcourse');\n }",
"public function create()\n {\n return view('course.createCourse');\n }",
"public function create()\n {\n return view('course.create');\n }",
"public function create()\n {\n return view('backend.course.create');\n }",
"public function create()\n {\n return view('auth.course.create');\n }",
"public function create()\n {\n return view('admin.course.create');\n }",
"public function create()\n {\n return view('admin.course.create');\n }",
"public function create()\n {\n $course = new Course();\n\n return view('courses.create', compact('course'));\n }",
"public function create()\n {\n $cls = ClassModel::all();\n $cor = Course::all();\n return view(\"{$this->viewPath}.create\", [\n 'title' => trans('main.add') . ' ' . trans('main.courses_details'),\n 'cls' => $cls,\n 'cor' => $cor,\n ]);\n }",
"public function create()\n\t{\n\t\t$this->authorize('create', Course::class);\n\n\t\t$categories = Category::all();\n\t\t$expirations = Expiry::all();\n\t\t$vatrates = VatRate::all();\n\t\treturn view('course.create', [\n\t\t\t'categories' => $categories,\n\t\t\t'expirations' => $expirations,\n\t\t\t'vatrates' => $vatrates\n\t\t]);\n\t}",
"public function create()\n {\n return View::make('CreateCourse');\n }",
"public function create()\n\t{\n\t\tif (!User::isAdmin()) {\n\t\t\t\treturn Redirect::to('dashboard');\n\t\t}\n\n\t\t$data['pagetitle'] = \"Create new Course.\";\n return Response::view('courses.create', $data)->header('Cache-Control', 'no-store, no-cache, must-revalidate');\n\t}",
"public function create()\n {\n return view('Backend.Institute.TrainingCentre.Courses.create');\n }",
"public function store()\n {\n $course = new Course;\n\n $course->coursename = Input::get('coursename');\n $course->address = Input::get('address');\n $course->city = Input::get('city');\n $course->state = Input::get('state');\n $course->zip = Input::get('zip');\n $course->phone = Input::get('phone');\n\n $course->save();\n\n return Redirect::to('/CourseTable');\n }",
"public function create()\n {\n return view('courses.create');\n }",
"public function create()\n {\n return view('courses.create');\n }",
"public function create()\n {\n return view('courses.create');\n }",
"public function create()\n {\n return view('admin.courses.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('admin.courses.create');\n\t}",
"public function create()\n {\n //$categories = ['' => 'دسته بندی ها'] + CategoryModel::orderby('id', 'desc');\n $contents = CourseModel::orderby('id', 'desc')->get();\n\n\n return View('web.admin.course.add', ['contents' => $contents]);\n }",
"public function create()\n {\n return view('admin.courses.create');\n }",
"public function create()\n {\n return view('admin.courses.create');\n }",
"public function create_course() {\n\n $data['get_all_courses'] = $this->courses_model->getCourses();\n\n \n //user access\n $data['view_access'] = $this->user_permission->has_permission('view_course' , 'access');\n $data['create_access'] = $this->user_permission->has_permission('create_course' , 'access');\n $data['edit_access'] = $this->user_permission->has_permission('edit_course' , 'access');\n \n \n // validate form input\n $this->form_validation->set_rules('course', \"Course\", 'required');\n $this->form_validation->set_rules('duration', \"Duration\", 'required');\n $this->form_validation->set_rules('fee', \"Fee\", 'required');\n\n\n if ($this->form_validation->run() == TRUE) {\n\n $status = $this->input->post('status');\n if ($status == 1) {\n $status = 1;\n } else {\n $status = 0;\n }\n\n $posted_data = array(\n 'name' => $this->input->post('course'),\n 'duration' => $this->input->post('duration'),\n 'fee' => $this->input->post('fee'),\n 'description' => $this->input->post('description'),\n 'status' => $status,\n );\n\n $new_course_id = $this->courses_model->create_course($posted_data);\n if ($new_course_id) {\n $data['message'] = $this->session->set_flashdata('message', \"Successfully added\");\n $this->load->template('index', $data);\n }\n } else {\n\n if (validation_errors()) {\n $data['message'] = validation_errors();\n $this->load->template('index', $data);\n }\n }\n }",
"public function create()\n {\n $lecturer = Lecturer::get()->where('course_id', NULL);\n return view('pages.course.create', ['lecturer'=>$lecturer]);\n }"
] |
[
"0.8770056",
"0.7849875",
"0.7742295",
"0.7704673",
"0.75669813",
"0.75093937",
"0.74525815",
"0.7439547",
"0.74310523",
"0.74187607",
"0.7366985",
"0.73551005",
"0.73551005",
"0.7339402",
"0.72946405",
"0.72837156",
"0.7261795",
"0.7248397",
"0.7248373",
"0.7214029",
"0.72081923",
"0.72081923",
"0.72081923",
"0.72067446",
"0.71998507",
"0.71893024",
"0.7181427",
"0.7181427",
"0.71811324",
"0.71712285"
] |
0.88550127
|
0
|
Finds the Course model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
|
protected function findModel($id) {
if (($model = Course::findOne($id)) !== null) {
return $model;
}
throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function findCourseById($id);",
"protected function findModel($id)\n {\n if (($model = Course::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if (($model = Courses::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"public abstract function find($primary_key, $model);",
"public function loadModel($id)\n\t{\n\t\t$model=CourseAndSkills::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Knowledgecatalogue::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }",
"protected function findModel($id)\n {\n if(($model = CourseSite::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }",
"protected function findModel($id)\n {\n if(Yii::$app->session->get('Rules')['comp_id'] ==1){\n if (($model = Customer::findOne(['id' => $id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }else{\n\n \n if (($model = Customer::findOne(['id' => $id,'comp_id' => Yii::$app->session->get('Rules')['comp_id']])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }\n }",
"public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Cooperativepartner::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Student::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,Yii::t('common','The requested page does not exist.'));\n\t\treturn $model;\n\t}",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=StudentDocument::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,Yii::t('app','The requested page does not exist.'));\r\n\t\treturn $model;\r\n\t}",
"protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }",
"public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=LicenceApplication::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Coordocs::model()->findByPk($id+0);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"function get(int $id): Course;",
"public function loadModel($id)\n\t{\n\t\t$model=Student::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id) {\n $model = Schedule::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}",
"protected function findModel($id)\n {\n if (($model = Catalog2::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"public function loadModel($id)\n\t{\n\t\t$model=Projects::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n {\n $model = Clinics::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n {\n $model = Component::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id){\n\t\t$model=Contact::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n {\n $model=CompraCartao::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }",
"public function loadModel($id)\n\t{\n\t\t$model=CollectionShop::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Clap::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}",
"public function loadModel($id)\r\n\t{\r\n\t\t$model=Klient::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}",
"public function loadModel($id)\n\t{\n\t\t$model=Roomclosure::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}"
] |
[
"0.6741456",
"0.6639675",
"0.65085816",
"0.64803505",
"0.64699465",
"0.64075273",
"0.6405327",
"0.6383287",
"0.6292137",
"0.6283532",
"0.6257562",
"0.6255696",
"0.625114",
"0.6180645",
"0.615565",
"0.61410207",
"0.61291033",
"0.6115279",
"0.6105169",
"0.6103469",
"0.6098634",
"0.6092896",
"0.6084221",
"0.6076967",
"0.60739356",
"0.60690695",
"0.605707",
"0.60560805",
"0.6056012",
"0.6042636"
] |
0.6906735
|
0
|
Create an SNS topic
|
public function createTopic($topic){
if(!array_key_exists($topic, $this->topics)){
throw new \InvalidArgumentException('Topic not in configuration');
}
$result = $this->getClient()->createTopic([
'Name' => $this->getTopic($topic)['name'],
]);
return $result;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function createTopic(Topic $topic, TopicBind ...$binds): Promise\n {\n return $this->transport->createTopic($topic, ...$binds);\n }",
"public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }",
"public function createTopic(CreateTopicRequest $request)\n {\n $response = new CreateTopicResponse($request->getTopicName());\n return $this->client->sendRequest($request, $response);\n }",
"function createTopic($name)\n\t{\n\t\tif(trim($name) == \"\")return $this->message(FORUM_URES_MEZO);\n\t\tif($this->isHavePriv(FORUM_PRIV_TOPIC_CREATE))\n\t\t\treturn mysql_query(\t\"INSERT INTO `\".$this->prefix.\"topic`(`topic_name`,`topic_cat`,`topic_created_by`,`topic_created_time`) \".\n\t\t\t\t\t\t\t\"VALUES('\".specChars($name,\"forum::createTopic\").\"',\".$this->cat_id.\",\".$this->akt_user.\",\".time().\")\");\n\t\telse return $this->message(FORUM_MESSAGE_PRIV_ERROR);\n\t}",
"public function publish(string $topic, array $messageBody = [])\n {\n if (!isset($this->snsConfig[$topic])) {\n throw new SnsException(SnsException::TYPE_SNS_CONFIG_NOT_FOUND);\n }\n\n if (false === $this->snsConfig[$topic]['enable']) {\n throw new SnsException(SnsException::TYPE_SNS_CONFIG_DISABLED);\n }\n\n $message = json_encode(\n [\n 'default' => 'Omega message',\n 'sqs' => json_encode($messageBody),\n ]\n );\n\n $payload = [\n 'TopicArn' => $this->snsConfig[$topic]['topic_arn'],\n 'Message' => $message,\n 'MessageStructure' => 'json',\n ];\n\n try {\n $result = $this->snsClient->publish($payload);\n $logMessage = sprintf(\n \"SNS Publish | Payload : %s | Response Status Code : %d\",\n json_encode($payload),\n $result->get('@metadata')['statusCode']\n );\n $this->logger->info($logMessage);\n } catch (\\Exception $e) {\n $logMessage = sprintf(\n \"SNS Publish | Payload : %s | Error : %s\",\n json_encode($payload),\n $e->getMessage()\n );\n $this->logger->error($logMessage);\n\n throw new SnsException(SnsException::TYPE_SNS_PUBLISH_FAILED);\n }\n\n return $result;\n }",
"public function publish($topic,$payload)\n {\n \treturn $this->getClient()->publish([\n \t\t'Message' => json_encode($payload),\n \t\t'TopicArn' => $this->getTopic($topic)['arn'],\n 'Subject' => $topic,\n \t]);\n }",
"public function sendEvent(string $topic, $message): void;",
"public function create()\n {\n //\n $this->message->sendMessage();\n }",
"public function subscribe()\n {\n $payload = request()->validate([\n 'topics' => 'required|array',\n 'callback' => 'required|url',\n ]);\n\n $topics = array_map(function ($topic) {\n return $this->topics->findOrCreate($topic);\n }, $payload['topics']);\n\n abort_unless(! empty($topics), 404);\n\n $subscriber = $this->subscribers->create($topics, $payload);\n\n }",
"public function testChannelsSetTopic()\n {\n }",
"public function declareTopic(string $topic): void;",
"public function create()\n {\n\n $email_id = date('Y-m-d_H-i-s') . '.' . $this->template;\n $email_data = [\n 'title' => $this->template, \n 'data' => serialize($this->data), \n 'email' => $this->to,\n 'id' => $email_id,\n 'date' => date('Y-m-d H:i:s')\n ];\n\n Storage::putYAML('statamify/emails/' . $email_id, $email_data);\n\n }",
"function publish_message($msg, $topic, $server, $port, $keepalive) {\n\t\t\t$client = new Mosquitto\\Client();\n\t\t\t$client->onConnect('connect');\n\t\t\t$client->onDisconnect('disconnect');\n\t\t\t$client->onPublish('publish');\n\t\t\t$client->connect($server, $port, $keepalive);\n\t\n\t\t\ttry {\n\t\t\t\t$client->loop();\n \t\t\t\t$mid = $client->publish($topic, $msg);\n\t\t\t\t\n\t\t\t\t}catch(Mosquitto\\Exception $e){\n\t\t\t\t\t\techo 'Exception'; \n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t $client->disconnect();\n\t\t unset($client);\t\t\t\t\t \n\t\t}",
"public function createMessage(array $parameters = []);",
"public function createTopic($user, $title, $content) {\n\t\t$topic = parent::create([\n\t\t\t\"section_id\"\t=> $this->getID(),\n\t\t\t\"title\"\t\t\t=> $title\n\t\t]);\n\n\t\t$topic->createComment($user, $content);\n\n\t\treturn $topic;\n\t}",
"public function create()\n {\n return view('admin.topic.create');\n }",
"private function addGroupTopic()\n {\n try\n {\n $request = $_POST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['topic_title']) || $request['topic_title']==\"\" )\n throw_error_msg('provide topic title');\n\n if(!isset($request['topic_post']) || $request['topic_post']==\"\" )\n throw_error_msg('provide topic post');\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $cbgroup->add_topic($request);\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group topic added', \"data\" => array());\n $this->response($this->json($data));\n }\n\n if( error() )\n {\n throw_error(error('single')); \n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function store(CreateTopic $request)\n { \n $topic = new Topic();\n $topic->section_id = $request->input('section_id');\n $topic->title = $request->title;\n $topic->save();\n\n $post = new Post();\n $post->user_id = Auth::user()->id;\n $post->topic_id = $topic->id;\n $post->body = $request->input('body');\n $post->save();\n\n return redirect(\"/topic/$topic->id\")->with('success', 'Topic was saved with success');\n }",
"public function register(Topic $topic);",
"public function createTopicAndSubscription(string $topicName, string $subscriptionName, string $type): PubSubService\n {\n if (!$this->validName($topicName) || ('pull' == $type && !$this->validName($subscriptionName))) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'The Resource name (topic or subscription) has not a valid format see https://cloud.google.com/pubsub/docs/admin#resource_names for more information.', 'HTTP_CONFLICT')));\n }\n\n $topic = $this->pubSubClient()->topic($topicName);\n\n if (!$topic->exists()) {\n $topic = $this->createTopic($topicName);\n if ($this->getTopicFullName() == $topic) {\n $subscription = $this->pubSubClient()->subscription($subscriptionName);\n\n if ('pull' == $type) {\n if (!$subscription->exists()) {\n $topic = $this->createSubscription($topicName, $subscriptionName);\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n } else {\n if (!$subscription->exists()) {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Subscription : \"'.$subscriptionName.'\" not exist, add a new subscription in the GCP Console by specify the push method.', 'HTTP_CONFLICT')));\n }\n }\n\n $this->setTopicFullName($topicName);\n $this->setSubscriptionFullName($subscriptionName);\n\n $this->_setInfo();\n\n return $this;\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" not exist, there was an error during topic creation.', 'HTTP_CONFLICT')));\n }\n } else {\n throw new \\Exception(json_encode($this->_error(Response::HTTP_CONFLICT, 'Topic : \"'.$topicName.'\" already exist.', 'HTTP_CONFLICT')));\n }\n }",
"public function createMessage(array $params)\n {\n $body = unserialize($params['body']['serial']);\n $response = $this->client->post('', [\n 'json' => [\n 'queue' => str_replace('aws:', '', $this->queue),\n 'content' => json_encode($body),\n ]\n ]);\n if (204 !== $response->getStatusCode()) {\n return false;\n }\n return true;\n }",
"public function publish($topic, $arguments = null, $argumentsKw = null, $options = null)\n {\n return $this->getClient()->getSession()\n ->publish($this->prefix . $topic, $arguments, $argumentsKw, $options);\n }",
"protected function getNotification_Type_TopicService()\n {\n $instance = new \\phpbb\\notification\\type\\topic(${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'}, ${($_ = isset($this->services['language']) ? $this->services['language'] : $this->getLanguageService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'}, ${($_ = isset($this->services['auth']) ? $this->services['auth'] : ($this->services['auth'] = new \\phpbb\\auth\\auth())) && false ?: '_'}, './../', 'php', 'phpbb_user_notifications');\n\n $instance->set_user_loader(${($_ = isset($this->services['user_loader']) ? $this->services['user_loader'] : $this->getUserLoaderService()) && false ?: '_'});\n $instance->set_config(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'});\n\n return $instance;\n }",
"public function createTopic($data){\n DB::beginTransaction();\n try {\n $topic = $this->create($data);\n $topic->category()->increment('topic_count');\n $topic->user()->increment('topic_count');\n if($data['tags']){\n $topic->tags()->sync($data['tags']);\n $topic->tags()->increment('topic_count');\n }\n }catch (\\Exception $e){\n DB::rollback();\n throw $e;\n }\n DB::commit();\n return $topic->id;\n }",
"public function subscribeToTopic(Request $request, $topic)\n {\n\n $validator = Validator::make($request->all(), [\n \"url\" => [\"required\", \"url\"]\n ]);\n\n if ($validator->fails()) {\n return response()->json(['errors' => $validator->errors()]);\n }\n\n $subscription = $this->subscriptionService->createSubscription($request->url, $topic);\n\n if($subscription[\"success\"])\n return response()->json(new CreateSubscriptionResource($subscription[\"data\"]));\n\n return response()->json($subscription, 201);\n }",
"public function notify_forum_new_topic( $topic_id ) {\n\t\t$this->notify_forum_topic_payload( 'create-topic', $topic_id );\n\t}",
"function Pushcreate($userId,$msg){\n $request = array('user_id' => $userId,'message' => $msg);\n pushdb::create($request);\n }",
"public function store(StoreTopicRequest $request)\n {\n// dd($user->ownsTopic(11));\n $result = Topic::create([\n 'user_id' => $request->user()->id,\n 'title' => trim($request->title),\n 'content' => $request->topic_content\n ]);\n if ($result){\n return response()->json([\n 'message' => '创建成功',\n 'data' => new TopicResource($result)\n ],201);\n }\n return response()->json([\n 'msg' => '服务器错误 创建失败'\n ],400);\n }",
"public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}",
"function target_add_topic_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread_notify (user_id, thread_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['topic_id'] .')');\n}"
] |
[
"0.61896646",
"0.59700626",
"0.5821369",
"0.5806588",
"0.56771785",
"0.5651977",
"0.5595719",
"0.5469061",
"0.5461742",
"0.54513836",
"0.5401871",
"0.536856",
"0.5351663",
"0.5337714",
"0.5293638",
"0.52929306",
"0.52899325",
"0.52864206",
"0.52830076",
"0.5272895",
"0.5270188",
"0.5260251",
"0.519732",
"0.5195842",
"0.5195266",
"0.51867414",
"0.51642454",
"0.51503474",
"0.51396984",
"0.5133173"
] |
0.65653443
|
0
|
Loads assets related to the tour reports functionality.
|
protected function load_assets() {
wp_enqueue_script( 'at_tour_reports', get_template_directory_uri() . '/assets/admin/WooCommerceTourReports.js' );
wp_localize_script( 'at_tour_reports', '_WooCommerceTourReportsCfg', array(
'purge_cache_btn_text' => __( 'Purge Cache', 'adventure-tours' ),
));
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function load_assets() {}",
"public function load_assets() {\n\t\twponion_load_core_assets( $this->option( 'assets' ) );\n\t}",
"private function _load_assets()\r\n {\r\n //set default page title\r\n $this->data['title'] = \"\";\r\n\r\n $this->data['base'] = $this->config->item(\"base_url\");\r\n \r\n if(count($this->config->item('assets')) > 1):\r\n foreach($this->config->item('assets') as $asset_name => $location): \r\n $this->data[$asset_name] = base_url($location);\r\n endforeach;\r\n endif;\r\n\r\n //load Simer variables\r\n if($user_details = $this->session->userdata('user_details')):\r\n\r\n //then user is logged in\r\n $this->user_details = $user_details;\r\n $this->user_id = $user_details->id;\r\n $this->data['user_details'] =$user_details;//setup user details globally for views\r\n $this->data['custom_nav'] = $this->build_nav();\r\n\r\n endif;\r\n }",
"public function addAssets()\n {\n $this->addJs('../../graphreport/assets/d3.js');\n $this->addJs('../../graphreport/assets/c3.js');\n $this->addCss('../../graphreport/assets/c3.css'); \n }",
"public function loadAssets() {\r\n\t\tparent::loadAssets();\r\n\t\t$this->app->document->addScript('elements:download/assets/js/download.js');\r\n\t}",
"public function loadAssets(): void\n {\n $this->printStyle('//resource.css', 'print_resource_page_assets');\n }",
"public function load_additional_assets() {\n\n // Grab current screen\n $screen = get_current_screen();\n\n // Make sure we're on the correct screen\n if ( ! in_array( $screen->id, $this->screens ) ) {\n return;\n }\n\n do_action( 'cv_builder_inline_assets' );\n\n // Render template options callback for modal\n $this->render_template_options_template();\n\n // Render module options for modal\n $this->render_available_modules_template();\n\n }",
"public function loadAssets() {\r\n\t\t$this->app->document->addScript('elements:relateditems/relateditems.js');\r\n\t}",
"protected function loadAssets()\n {\n }",
"public function addRessources()\n {\n // $this->context->controller->addCss(($this->_path . '/views/css/tab.css'), 'all');\n // $this->context->controller->addJquery();\n // $this->context->controller->addJS(($this->_path . '/views/js/script.js'));\n // $this->context->controller->addJS(($this->_path . '/views/js/configuration.js'));\n }",
"public function loadResources() {}",
"public function loadAssets()\n {\n add_action('admin_enqueue_scripts', [$this, 'enqueueAdminAssets']);\n add_filter('script_loader_tag', [$this, 'addAssetAttribute'], 10, 3);\n }",
"public function loadEmployeeAreaAssets()\n\t{\n\t\t$document = JFactory::getDocument();\n\t\t// css\n\t\t$document->AddStyleSheet(VAPASSETS_URI . 'css/vap-emparea.css');\n\t\tVikAppointments::load_font_awesome();\n\n\t\t// js\n\t\tVikAppointments::load_css_js();\n\t\tVikAppointments::load_fancybox();\n\t\tVikAppointments::load_complex_select();\n\t\tVikAppointments::load_utils();\n\t\tVikAppointments::load_currency_js();\n\t\t$this->addScript(VAPASSETS_URI . 'js/jquery-ui.sortable.min.js');\n\t\t$this->addScript(VAPASSETS_URI . 'js/vap-emparea.js');\n\n\t\t$document->addScriptDeclaration(\n<<<JS\nvar EmployeeArea = new EmployeeArea('#empareaForm');\n\njQuery(document).ready(function() {\n\tjQuery('.vap-list-pagination .hasTooltip').removeClass('hasTooltip').removeAttr('title').attr('data-original-title', '');\n});\nJS\n\t\t);\n\t}",
"private function loadResourceForDetailPage()\n {\n $this->data['css'][] = asset('/assets/css/Dss/Priority/detail.css');\n $this->data['js'][] = asset('/assets/js/Dss/Priority/detail.js');\n }",
"public function load_assets() {\n\t\t\t//only load styles and js when needed\n\t\t\tif ( $this->is_edit_page() ) {\n\t\t\t\t//styles\n\t\t\t\twp_enqueue_style( 'thickbox' );\n\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\twp_enqueue_style( 'wm-options-panel-white-label' );\n\t\t\t\tif ( ! wm_option( 'branding-panel-logo' ) && ! wm_option( 'branding-panel-no-logo' ) )\n\t\t\t\t\twp_enqueue_style( 'wm-options-panel-branded' );\n\t\t\t\twp_enqueue_style( 'color-picker' );\n\n\t\t\t\t//scripts\n\t\t\t\twp_enqueue_script( 'jquery-ui-core' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-tabs' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-datepicker' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-slider' );\n\t\t\t\twp_enqueue_script( 'thickbox' );\n\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t\twp_enqueue_script( 'wm-options-panel' );\n\t\t\t\twp_enqueue_script( 'color-picker' );\n\t\t\t}\n\t\t}",
"public function loadAppAssets() {\n\t\tadd_action( 'wp_loaded', function () {\n\t\t\t/** EnqueueScritps instance. Don't remove it. Used in included file. */\n\t\t\t$assets = Container::make( EnqueueScripts::class );\n\t\t\tinclude_once( MWW_PATH . '/app/Support/assets.php' );\n\t\t} );\n\t}",
"function load_assets() {\n\t\t$this->http->http_verify_download();\n\n\t\t$log = $this->error_log;\n\t\t$log->http_prepare_download_log();\n\n\t\t// add our custom CSS classes to <body>\n\t\tadd_filter( 'admin_body_class', array( $this, 'admin_body_class' ) );\n\n\t\t$plugins_url = trailingslashit( plugins_url( $this->props->plugin_folder_name ) );\n\t\t$version = \\defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? time() : $this->props->plugin_version;\n\t\t$ver_string = '-' . str_replace( '.', '', $this->props->plugin_version );\n\n\t\t$src = $plugins_url . 'asset/build/css/styles.css';\n\t\twp_enqueue_style( 'wp-migrate-db-pro-styles', $src, [], $version );\n\n\t\tdo_action( 'wpmdb_load_assets' );\n\n\t\t$src = $plugins_url . \"asset/build/js/bundle{$ver_string}.js\";\n\t\twp_enqueue_script( 'wp-migrate-db-pro-script', $src, [ 'jquery', 'backbone' ], $version, true );\n\n\t\twp_localize_script( 'wp-migrate-db-pro-script',\n\t\t\t'wpmdb_strings',\n\t\t\tapply_filters( 'wpmdb_js_strings', array(\n\t\t\t\t'max_request_size_problem' => __( 'A problem occurred when trying to change the maximum request size, please try again.', 'wp-migrate-db' ),\n\t\t\t\t'license_check_problem' => __( 'A problem occurred when trying to check the license, please try again.', 'wp-migrate-db' ),\n\t\t\t\t'establishing_remote_connection' => __( 'Establishing connection to remote server, please wait', 'wp-migrate-db' ),\n\t\t\t\t'connection_local_server_problem' => __( 'A problem occurred when attempting to connect to the local server, please check the details and try again.', 'wp-migrate-db' ),\n\t\t\t\t'enter_license_key' => __( 'Please enter your license key.', 'wp-migrate-db' ),\n\t\t\t\t'register_license_problem' => __( 'A problem occurred when trying to register the license, please try again.', 'wp-migrate-db' ),\n\t\t\t\t'license_registered' => __( 'Your license has been activated. You will now receive automatic updates and access to email support.', 'wp-migrate-db' ),\n\t\t\t\t'fetching_license' => __( 'Fetching license details, please wait…', 'wp-migrate-db' ),\n\t\t\t\t'clear_log_problem' => __( 'An error occurred when trying to clear the debug log. Please contact support. (#132)', 'wp-migrate-db' ),\n\t\t\t\t'update_log_problem' => __( 'An error occurred when trying to update the debug log. Please contact support. (#133)', 'wp-migrate-db' ),\n\t\t\t\t'please_select_one_table' => __( 'Please select at least one table to migrate.', 'wp-migrate-db' ),\n\t\t\t\t'please_select_one_table_backup' => __( 'Please select at least one table for backup.', 'wp-migrate-db' ),\n\t\t\t\t'please_select_one_table_import' => __( 'Please select at least one table for the find & replace', 'wp-migrate-db' ),\n\t\t\t\t'enter_name_for_profile' => __( 'Please enter a name for your migration profile.', 'wp-migrate-db' ),\n\t\t\t\t'save_profile_problem' => __( 'An error occurred when attempting to save the migration profile. Please see the Help tab for details on how to request support. (#118)', 'wp-migrate-db' ),\n\t\t\t\t'exporting_complete' => _x( 'Export complete', 'Data has been successfully exported', 'wp-migrate-db' ),\n\t\t\t\t'exporting_please_wait' => __( 'Exporting, please wait…', 'wp-migrate-db' ),\n\t\t\t\t'please_wait' => __( 'please wait…', 'wp-migrate-db' ),\n\t\t\t\t'complete' => _x( 'complete', 'Finished successfully', 'wp-migrate-db' ),\n\t\t\t\t'migration_failed' => _x( 'Migration failed', 'Copy of data between servers did not complete', 'wp-migrate-db' ),\n\t\t\t\t'backing_up' => _x( 'Backing up', 'Saving a copy of the data before import', 'wp-migrate-db' ),\n\t\t\t\t'queued' => _x( 'Queued', 'In line to be processed', 'wp-migrate-db' ),\n\t\t\t\t'migrating' => _x( 'Migrating', 'Copying data between servers', 'wp-migrate-db' ),\n\t\t\t\t'running' => _x( 'Running', 'Process is active', 'wp-migrate-db' ),\n\t\t\t\t'status' => _x( 'Status', 'Current request status', 'wp-migrate-db' ),\n\t\t\t\t'response' => _x( 'Response', 'The message the server responded with', 'wp-migrate-db' ),\n\t\t\t\t'table_process_problem' => __( 'A problem occurred when attempting to process the following table (#113)', 'wp-migrate-db' ),\n\t\t\t\t'table_process_problem_empty_response' => __( 'A problem occurred when processing the following table. We were expecting a response in JSON format but instead received an empty response.', 'wp-migrate-db' ),\n\t\t\t\t'completed_with_some_errors' => __( 'Migration completed with some errors', 'wp-migrate-db' ),\n\t\t\t\t'completed_dump_located_at' => __( 'Migration complete, your backup is located at:', 'wp-migrate-db' ),\n\t\t\t\t'finalize_tables_problem' => __( 'A problem occurred when finalizing the backup. (#140)', 'wp-migrate-db' ),\n\t\t\t\t'saved' => _x( 'Saved', 'The settings were saved successfully', 'wp-migrate-db' ),\n\t\t\t\t'reset_api_key' => __( 'Any sites setup to use the current secret key will no longer be able to connect. You will need to update those sites with the newly generated secret key. Do you wish to continue?', 'wp-migrate-db' ),\n\t\t\t\t'reset_api_key_problem' => __( 'An error occurred when trying to generate the secret key. Please see the Help tab for details on how to request support. (#105)', 'wp-migrate-db' ),\n\t\t\t\t'remove_profile' => __( 'You are about to remove the migration profile \"{{profile}}\". This cannot be undone. Do you wish to continue?', 'wp-migrate-db' ),\n\t\t\t\t'remove_profile_problem' => __( 'An error occurred when trying to delete the profile. Please see the Help tab for details on how to request support. (#106)', 'wp-migrate-db' ),\n\t\t\t\t'remove_profile_not_found' => __( \"The selected migration profile could not be deleted because it was not found.\\nPlease refresh this page to see an accurate list of the currently available migration profiles.\", 'wp-migrate-db' ),\n\t\t\t\t'change_connection_info' => __( 'If you change the connection details, you will lose any replaces and table selections you have made below. Do you wish to continue?', 'wp-migrate-db' ),\n\t\t\t\t'enter_connection_info' => __( 'Please enter the connection information above to continue.', 'wp-migrate-db' ),\n\t\t\t\t'save_settings_problem' => __( 'An error occurred when trying to save the settings. Please try again. If the problem persists, please see the Help tab for details on how to request support. (#108)', 'wp-migrate-db' ),\n\t\t\t\t'connection_info_missing' => __( 'The connection information appears to be missing, please enter it to continue.', 'wp-migrate-db' ),\n\t\t\t\t'connection_info_incorrect' => __( \"The connection information appears to be incorrect, it should consist of two lines. The first being the remote server's URL and the second being the secret key.\", 'wp-migrate-db' ),\n\t\t\t\t'connection_info_url_invalid' => __( 'The URL on the first line appears to be invalid, please check it and try again.', 'wp-migrate-db' ),\n\t\t\t\t'connection_info_key_invalid' => __( 'The secret key on the second line appears to be invalid. It should be a 40 character string that consists of letters, numbers and special characters only.', 'wp-migrate-db' ),\n\t\t\t\t'connection_info_local_url' => __( \"It appears you've entered the URL for this website, you need to provide the URL of the remote website instead.\", 'wp-migrate-db' ),\n\t\t\t\t'connection_info_local_key' => __( 'Looks like your remote secret key is the same as the secret key for this site. To fix this, go to the <a href=\"#settings\">Settings tab</a> and click \"Reset Secret Key\"', 'wp-migrate-db' ),\n\t\t\t\t'time_elapsed' => __( 'Time Elapsed:', 'wp-migrate-db' ),\n\t\t\t\t'pause' => _x( 'Pause', 'Temporarily stop migrating', 'wp-migrate-db' ),\n\t\t\t\t'migration_paused' => _x( 'Migration Paused', 'The migration has been temporarily stopped', 'wp-migrate-db' ),\n\t\t\t\t'find_replace_paused' => _x( 'Find & Replace Paused', 'The find & replace has been temporarily stopped', 'wp-migrate-db' ),\n\t\t\t\t'resume' => _x( 'Resume', 'Restart migrating after it was paused', 'wp-migrate-db' ),\n\t\t\t\t'completing_current_request' => __( 'Completing current request', 'wp-migrate-db' ),\n\t\t\t\t'cancelling_migration' => _x( 'Cancelling migration', 'The migration is being cancelled', 'wp-migrate-db' ),\n\t\t\t\t'cancelling_find_replace' => _x( 'Cancelling find & replace', 'The find & replace is being cancelled', 'wp-migrate-db' ),\n\t\t\t\t'paused' => _x( 'Paused', 'The migration has been temporarily stopped', 'wp-migrate-db' ),\n\t\t\t\t'pause_before_finalize_find_replace' => __( 'Pause before finalizing the updates', 'wp-migrate-db' ),\n\t\t\t\t'paused_before_finalize' => __( 'Automatically paused before migrated tables are replaced. Click \"Resume\" or \"Cancel\" when ready.', 'wp-migrate-db' ),\n\t\t\t\t'find_replace_paused_before_finalize' => __( 'Automatically paused before the find & replace was finalized. Click \"Resume\" or \"Cancel\" when ready.', 'wp-migrate-db-pro' ),\n\t\t\t\t'removing_local_sql' => __( 'Removing the local MySQL export file', 'wp-migrate-db' ),\n\t\t\t\t'removing_local_backup' => __( 'Removing the local backup MySQL export file', 'wp-migrate-db' ),\n\t\t\t\t'removing_local_temp_tables' => __( 'Removing the local temporary tables', 'wp-migrate-db' ),\n\t\t\t\t'removing_remote_sql' => __( 'Removing the remote backup MySQL export file', 'wp-migrate-db' ),\n\t\t\t\t'removing_remote_temp_tables' => __( 'Removing the remote temporary tables', 'wp-migrate-db' ),\n\t\t\t\t'migration_cancellation_failed' => __( 'Migration cancellation failed', 'wp-migrate-db' ),\n\t\t\t\t'manually_remove_temp_files' => __( 'A problem occurred while cancelling the migration, you may have to manually delete some temporary files / tables.', 'wp-migrate-db' ),\n\t\t\t\t'migration_cancelled' => _x( 'Migration cancelled', 'The migration has been cancelled', 'wp-migrate-db' ),\n\t\t\t\t'migration_cancelled_success' => __( 'The migration has been stopped and all temporary files and data have been cleaned up.', 'wp-migrate-db' ),\n\t\t\t\t'find_replace_cancelled' => _x( 'Find & replace cancelled', 'The migration has been cancelled', 'wp-migrate-db' ),\n\t\t\t\t'find_replace_cancelled_success' => __( 'The find & replace has been cancelled and all temporary data has been cleaned up.', 'wp-migrate-db' ),\n\t\t\t\t'migration_complete' => _x( 'Migration complete', 'The migration completed successfully', 'wp-migrate-db' ),\n\t\t\t\t'finalizing_migration' => _x( 'Finalizing migration', 'The migration is in the last stages', 'wp-migrate-db' ),\n\t\t\t\t'flushing' => _x( 'Flushing caches and rewrite rules', 'The caches and rewrite rules for the target are being flushed', 'wp-migrate-db' ),\n\t\t\t\t'blacklist_problem' => __( 'A problem occurred when trying to add plugins to backlist.', 'wp-migrate-db' ),\n\t\t\t\t'mu_plugin_confirmation' => __( \"If confirmed we will install an additional WordPress 'Must Use' plugin. This plugin will allow us to control which plugins are loaded during WP Migrate DB Pro specific operations. Do you wish to continue?\", 'wp-migrate-db' ),\n\t\t\t\t'plugin_compatibility_settings_problem' => __( 'A problem occurred when trying to change the plugin compatibility setting.', 'wp-migrate-db' ),\n\t\t\t\t'sure' => _x( 'Sure?', 'Confirmation required', 'wp-migrate-db' ),\n\t\t\t\t'pull_migration_label_migrating' => __( 'Pulling from %s…', 'wp-migrate-db' ),\n\t\t\t\t'pull_migration_label_completed' => __( 'Pull from %s complete', 'wp-migrate-db' ),\n\t\t\t\t'push_migration_label_migrating' => __( 'Pushing to %s…', 'wp-migrate-db' ),\n\t\t\t\t'push_migration_label_completed' => __( 'Push to %s complete', 'wp-migrate-db' ),\n\t\t\t\t'find_replace_label_migrating' => __( 'Running Find & Replace…', 'wp-migrate-db' ),\n\t\t\t\t'find_replace_label_completed' => __( 'Find & Replace complete', 'wp-migrate-db' ),\n\t\t\t\t'import_label_migrating' => __( 'Importing…', 'wp-migrate-db' ),\n\t\t\t\t'import_label_completed' => __( 'Import complete', 'wp-migrate-db' ),\n\t\t\t\t'copying_license' => __( 'Copying license to the remote site, please wait', 'wp-migrate-db' ),\n\t\t\t\t'attempting_to_activate_licence' => __( 'Attempting to activate your license, please wait…', 'wp-migrate-db' ),\n\t\t\t\t'licence_reactivated' => __( 'License successfully activated, please wait…', 'wp-migrate-db' ),\n\t\t\t\t'activate_licence_problem' => __( 'An error occurred when trying to reactivate your license. Please provide the following information when requesting support:', 'wp-migrate-db' ),\n\t\t\t\t'temporarily_activated_licence' => __( \"<strong>We've temporarily activated your licence and will complete the activation once the Delicious Brains API is available again.</strong><br />Please refresh this page to continue.\", 'wp-migrate-db' ),\n\t\t\t\t'ajax_json_message' => __( 'JSON Decoding Failure', 'wp-migrate-db' ),\n\t\t\t\t'ajax_json_errors' => __( 'Our AJAX request was expecting JSON but we received something else. Often this is caused by your theme and/or plugins spitting out PHP errors. If you can edit the theme or plugins causing the errors, you should be able to fix them up, but if not, you can set WP_DEBUG to false in wp-config.php to disable errors from showing up.', 'wp-migrate-db' ),\n\t\t\t\t'ajax_php_errors' => __( 'Our AJAX request was expecting JSON but we received something else', 'wp-migrate-db' ),\n\t\t\t\t'view_error_messages' => __( 'View error messages', 'wp-migrate-db' ),\n\t\t\t\t'delaying_next_request' => __( 'Waiting %s seconds before executing next step', 'wp-migrate-db' ),\n\t\t\t\t'delay_between_requests_problem' => __( 'A problem occurred when trying to change the delay between requests, please try again.', 'wp-migrate-db' ),\n\t\t\t\t'flush_problem' => __( 'A problem occurred when flushing caches and rewrite rules. (#145)', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_push' => _x( 'Push', 'Transfer this database to the remote site', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_push_save' => _x( 'Push & Save', 'Transfer this database to the remote site and save migration profile', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_pull' => _x( 'Pull', 'Transfer the remote database to this site', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_pull_save' => _x( 'Pull & Save', 'Transfer the remote database to this site and save migration profile', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_export' => _x( 'Export', 'Download a copy of the database', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_export_save' => _x( 'Export & Save', 'Download a copy of the database and save migration profile', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_import' => _x( 'Import', 'Import an SQL file into the database', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_import_save' => _x( 'Import & Save', 'Import an SQL file and save migration profile', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_find_replace' => _x( 'Find & Replace', 'Run a find and replace on the database', 'wp-migrate-db' ),\n\t\t\t\t'migrate_button_find_replace_save' => _x( 'Find & Replace & Save', 'Run a find and replace and save migration profile', 'wp-migrate-db' ),\n\t\t\t\t'tables' => _x( 'Tables', 'database tables', 'wp-migrate-db' ),\n\t\t\t\t'files' => __( 'Files', 'wp-migrate-db' ),\n\t\t\t\t'migrated' => _x( 'Migrated', 'Transferred', 'wp-migrate-db' ),\n\t\t\t\t'backed_up' => __( 'Backed Up', 'wp-migrate-db' ),\n\t\t\t\t'searched' => __( 'Searched', 'wp-migrate-db' ),\n\t\t\t\t'hide' => _x( 'Hide', 'Obscure from view', 'wp-migrate-db' ),\n\t\t\t\t'show' => _x( 'Show', 'Reveal', 'wp-migrate-db' ),\n\t\t\t\t'welcome_title' => __( 'Welcome to WP Migrate DB Pro! 🎉', 'wp-migrate-db' ),\n\t\t\t\t'welcome_text' => __( 'Hey, this is the first time activating your license, nice! Your migrations are about to get awesome! If you haven’t already, you should check out our <a href=\"%1$s\">Quick Start Guide</a> and <a href=\"%2$s\">Videos</a>. If you run into any trouble at all, use the <strong>Help tab</strong> above to submit a support request.', 'wp-migrate-db' ),\n\t\t\t\t'title_progress' => __( '%1$s Stage %2$s of %3$s', 'wp-migrate-db' ),\n\t\t\t\t'title_paused' => __( 'Paused', 'wp-migrate-db' ),\n\t\t\t\t'title_cancelling' => __( 'Cancelling', 'wp-migrate-db' ),\n\t\t\t\t'title_cancelled' => __( 'Cancelled', 'wp-migrate-db' ),\n\t\t\t\t'title_finalizing' => __( 'Finalizing', 'wp-migrate-db' ),\n\t\t\t\t'title_complete' => __( 'Complete', 'wp-migrate-db' ),\n\t\t\t\t'title_error' => __( 'Failed', 'wp-migrate-db' ),\n\t\t\t\t'progress_items_truncated_msg' => __( '%1$s items are not shown to maintain browser performance', 'wp-migrate-db' ),\n\t\t\t\t'clear_error_log' => _x( 'Cleared', 'Error log emptied', 'wp-migrate-db' ),\n\t\t\t\t'parsing_sql_file' => __( 'Parsing SQL file, please wait', 'wp-migrate-db' ),\n\t\t\t\t'invalid_sql_file' => __( 'The selected file does not have a recognized file type. Please upload a valid SQL file to continue.', 'wp-migrate-db' ),\n\t\t\t\t'please_select_sql_file' => __( 'Please select an SQL export file above to continue.', 'wp-migrate-db' ),\n\t\t\t\t'import_profile_loaded' => sprintf( '<strong>%s</strong> — %s', __( 'Profile Loaded', 'wp-migrate-db' ), __( 'The selected profile has been loaded, please select an SQL export file above to continue.', 'wp-migrate-db' ) ),\n\t\t\t\t'uploading_file_to_server' => __( 'Uploading file to the server', 'wp-migrate-db' ),\n\t\t\t\t'importing_file_to_db' => __( 'Importing data from %s', 'wp-migrate-db' ),\n\t\t\t\t'upload' => __( 'Upload', 'wp-migrate-db' ),\n\t\t\t) )\n\t\t);\n\n\t\twp_enqueue_script( 'jquery' );\n\t\twp_enqueue_script( 'jquery-ui-core' );\n\t\twp_enqueue_script( 'jquery-ui-slider' );\n\t\twp_enqueue_script( 'jquery-ui-sortable' );\n\t}",
"protected function getAssets() { return array(); }",
"public static function get_resources() {\n if (self::$resource_list === NULL) {\n $base = self::$base_url;\n if (!self::$js_path) {\n self::$js_path = $base . 'media/js/';\n }\n elseif (substr(self::$js_path, -1) != \"/\") {\n // Ensure a trailing slash.\n self::$js_path .= \"/\";\n }\n if (!self::$css_path) {\n self::$css_path = $base . 'media/css/';\n }\n elseif (substr(self::$css_path, -1) != '/') {\n // Ensure a trailing slash.\n self::$css_path .= \"/\";\n }\n global $indicia_theme, $indicia_theme_path;\n if (!isset($indicia_theme)) {\n // Use default theme if page does not specify it's own.\n $indicia_theme = 'default';\n }\n if (!isset($indicia_theme_path)) {\n // Use default theme path if page does not specify it's own.\n $indicia_theme_path = preg_replace('/css\\/$/', 'themes/', self::$css_path);\n }\n // Ensure a trailing slash.\n if (substr($indicia_theme_path, -1) !== '/') {\n $indicia_theme_path .= '/';\n }\n self::$resource_list = [\n 'indiciaFns' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"indicia.functions.js\"],\n ],\n 'jquery' => [\n 'javascript' => [\n self::$js_path . 'jquery.js',\n self::$js_path . 'ie_vml_sizzlepatch_2.js',\n ],\n ],\n 'datepicker' => [\n 'deps' => ['jquery_cookie'],\n 'javascript' => [\n self::$js_path . 'indicia.datepicker.js',\n self::$js_path . 'date.polyfill/better-dom/dist/better-dom.min.js',\n self::$js_path . 'date.polyfill/better-dateinput-polyfill/dist/better-dateinput-polyfill.min.js',\n ]\n ],\n 'sortable' => [\n 'javascript' => ['https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.js'],\n ],\n 'openlayers' => [\n 'javascript' => [\n self::$js_path . (function_exists('iform_openlayers_get_file') ? iform_openlayers_get_file() : 'OpenLayers.js'),\n self::$js_path . 'proj4js.js',\n self::$js_path . 'proj4defs.js',\n self::$js_path . 'lang/en.js',\n ],\n ],\n 'graticule' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'indiciaGraticule.js'],\n ],\n 'clearLayer' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'clearLayer.js'],\n ],\n 'hoverControl' => [\n 'deps' => ['openlayers'],\n 'javascript' => [self::$js_path . 'hoverControl.js'],\n ],\n 'addrowtogrid' => [\n 'deps' => ['validation'],\n 'javascript' => [self::$js_path . \"addRowToGrid.js\"],\n ],\n 'speciesFilterPopup' => [\n 'deps' => ['addrowtogrid'],\n 'javascript' => [self::$js_path . \"speciesFilterPopup.js\"],\n ],\n 'indiciaMapPanel' => [\n 'deps' => ['jquery', 'openlayers', 'jquery_ui', 'jquery_cookie', 'hoverControl'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMapPanel.js\"],\n ],\n 'indiciaMapEdit' => [\n 'deps' => ['indiciaMap'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMap.edit.js\"],\n ],\n 'postcode_search' => [\n 'javascript' => [self::$js_path . \"postcode_search.js\"],\n ],\n 'locationFinder' => [\n 'deps' => ['indiciaMapEdit'],\n 'javascript' => [self::$js_path . \"jquery.indiciaMap.edit.locationFinder.js\"],\n ],\n 'createPersonalSites' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"createPersonalSites.js\"],\n ],\n 'autocomplete' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [self::$css_path . \"jquery.autocomplete.css\"],\n 'javascript' => [self::$js_path . \"jquery.autocomplete.js\"],\n ],\n 'addNewTaxon' => [\n 'javascript' => [self::$js_path . \"addNewTaxon.js\"],\n ],\n 'import' => [\n 'javascript' => [self::$js_path . \"import.js\"],\n ],\n 'indicia_locks' => [\n 'deps' => ['jquery_cookie', 'json'],\n 'javascript' => [self::$js_path . \"indicia.locks.js\"],\n ],\n 'jquery_cookie' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"jquery.cookie.js\"],\n ],\n 'jquery_ui' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [\n self::$css_path . 'jquery-ui.min.css',\n \"$indicia_theme_path$indicia_theme/jquery-ui.theme.min.css\",\n ],\n 'javascript' => [\n self::$js_path . 'jquery-ui.min.js',\n self::$js_path . 'jquery-ui.effects.js',\n ]\n ],\n 'jquery_ui_fr' => [\n 'deps' => ['jquery_ui'],\n 'javascript' => [self::$js_path . \"jquery.ui.datepicker-fr.js\"]\n ],\n 'jquery_form' => [\n 'deps' => ['jquery'],\n 'javascript' => [self::$js_path . \"jquery.form.min.js\"],\n ],\n 'reportPicker' => [\n 'deps' => ['treeview', 'fancybox'],\n 'javascript' => [self::$js_path . \"reportPicker.js\"],\n ],\n 'treeview' => ['deps' => ['jquery'], 'stylesheets' => [self::$css_path.\"jquery.treeview.css\"], 'javascript' => [self::$js_path.\"jquery.treeview.js\"]],\n 'treeview_async' => ['deps' => ['treeview'], 'javascript' => [self::$js_path.\"jquery.treeview.async.js\", self::$js_path.\"jquery.treeview.edit.js\"]],\n 'googlemaps' => [\n 'javascript' => [\"https://maps.google.com/maps/api/js?v=3\" . (empty(self::$google_maps_api_key) ? '' : '&key=' . self::$google_maps_api_key)],\n ],\n 'fancybox' => [\n 'deps' => ['jquery'],\n 'stylesheets' => [self::$js_path . 'fancybox/dist/jquery.fancybox.min.css'],\n 'javascript' => [self::$js_path . 'fancybox/dist/jquery.fancybox.min.js'],\n ],\n 'treeBrowser' => [\n 'deps' => ['jquery', 'jquery_ui'],\n 'javascript' => [self::$js_path . 'jquery.treebrowser.js']\n ],\n 'defaultStylesheet' => [\n 'deps' => [''],\n 'stylesheets' => [\n self::$css_path . 'default_site.css',\n self::$css_path . 'theme-generic.css'\n ],\n 'javascript' => []\n ],\n 'validation' => [\n 'deps' => ['jquery'],\n 'javascript' => [\n self::$js_path . 'jquery.metadata.js',\n self::$js_path . 'jquery.validate.js',\n self::$js_path . 'additional-methods.js',\n ],\n ],\n 'plupload' => [\n 'deps' => ['jquery_ui', 'fancybox'],\n 'javascript' => [\n self::$js_path . 'jquery.uploader.js',\n self::$js_path . 'plupload/js/plupload.full.min.js',\n ]\n ],\n 'uploader' => [\n 'deps' => ['jquery', 'dmUploader'],\n 'javascript' => [\n self::$js_path . 'uploader.js',\n ],\n ],\n 'dmUploader' => [\n 'stylesheets' => [\n self::$js_path . 'uploader/dist/css/jquery.dm-uploader.min.css',\n ],\n 'javascript' => [\n self::$js_path . 'uploader/dist/js/jquery.dm-uploader.min.js',\n ]\n ],\n 'jqplot' => [\n 'stylesheets' => [self::$js_path . 'jqplot/jquery.jqplot.min.css'],\n 'javascript' => [\n self::$js_path . 'jqplot/jquery.jqplot.min.js',\n '[IE]' . self::$js_path . 'jqplot/excanvas.js'\n ],\n ],\n 'jqplot_bar' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.barRenderer.js',\n ],\n ],\n 'jqplot_pie' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.pieRenderer.js',\n ],\n ],\n 'jqplot_category_axis_renderer' => [\n 'javascript' => [self::$js_path . 'jqplot/plugins/jqplot.categoryAxisRenderer.js'],\n ],\n 'jqplot_canvas_axis_label_renderer' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.canvasTextRenderer.js',\n self::$js_path . 'jqplot/plugins/jqplot.canvasAxisLabelRenderer.js',\n ],\n ],\n 'jqplot_trendline' => [\n 'javascript' => [\n self::$js_path . 'jqplot/plugins/jqplot.trendline.js',\n ],\n ],\n 'reportgrid' => [\n 'deps' => ['jquery_ui', 'jquery_cookie'],\n 'javascript' => [\n self::$js_path . 'jquery.reportgrid.js',\n ]\n ],\n 'reportfilters' => [\n 'deps' => ['reportgrid'],\n 'stylesheets' => [self::$css_path . 'report-filters.css'],\n 'javascript' => [self::$js_path . 'reportFilters.js'],\n ],\n 'tabs' => [\n 'deps' => ['jquery_ui'],\n 'javascript' => [self::$js_path . 'tabs.js'],\n ],\n 'wizardprogress' => [\n 'deps' => ['tabs'],\n 'stylesheets' => [self::$css_path . 'wizard_progress.css']\n ],\n 'spatialReports' => [\n 'javascript' => [self::$js_path . 'spatialReports.js'],\n ],\n 'jsonwidget' => [\n 'deps' => ['jquery'],\n 'javascript' => [\n self::$js_path . 'jsonwidget/jsonedit.js',\n self::$js_path . 'jquery.jsonwidget.js',\n ],\n 'stylesheets' => [self::$css_path . 'jsonwidget.css'],\n ],\n 'timeentry' => [\n 'javascript' => [self::$js_path . 'jquery.timeentry.min.js'],\n ],\n 'verification' => [\n 'javascript' => [self::$js_path . 'verification.js'],\n ],\n 'control_speciesmap_controls' => [\n 'deps' => [\n 'jquery',\n 'openlayers',\n 'addrowtogrid',\n 'validation',\n ],\n 'javascript' => [\n self::$js_path . 'controls/speciesmap_controls.js',\n ],\n ],\n 'complexAttrGrid' => [\n 'javascript' => [self::$js_path . 'complexAttrGrid.js'],\n ],\n 'footable' => [\n 'stylesheets' => [self::$js_path . 'footable/css/footable.core.min.css'],\n // Note, the minified version not used as it does not contain bugfixes.\n // 'javascript' => [self::$js_path.'footable/dist/footable.min.js']\n 'javascript' => [self::$js_path . 'footable/js/footable.js'],\n 'deps' => ['jquery'],\n ],\n 'footableSort' => [\n 'javascript' => [self::$js_path . 'footable/dist/footable.sort.min.js'],\n 'deps' => ['footable'],\n ],\n 'footableFilter' => [\n 'javascript' => [self::$js_path . 'footable/dist/footable.filter.min.js'],\n 'deps' => ['footable'],\n ],\n 'indiciaFootableReport' => [\n 'javascript' => [self::$js_path . 'jquery.indiciaFootableReport.js'],\n 'deps' => ['footable'],\n ],\n 'indiciaFootableChecklist' => [\n 'stylesheets' => [self::$css_path . 'jquery.indiciaFootableChecklist.css'],\n 'javascript' => [self::$js_path . 'jquery.indiciaFootableChecklist.js'],\n 'deps' => ['footable']\n ],\n 'html2pdf' => [\n 'javascript' => [\n self::$js_path . 'html2pdf/dist/html2pdf.bundle.min.js',\n ],\n ],\n 'review_input' => [\n 'javascript' => [self::$js_path . 'jquery.reviewInput.js'],\n ],\n 'sub_list' => [\n 'javascript' => [self::$js_path . 'sub_list.js'],\n ],\n 'georeference_default_geoportal_lu' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/geoportal_lu.js'],\n ],\n 'georeference_default_nominatim' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/nominatim.js'],\n ],\n 'georeference_default_google_places' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/google_places.js'],\n ],\n 'georeference_default_indicia_locations' => [\n 'javascript' => [self::$js_path . 'drivers/georeference/indicia_locations.js'],\n ],\n 'sref_handlers_2169' => [\n 'javascript' => [self::$js_path . 'drivers/sref/2169.js'],\n ],\n 'sref_handlers_4326' => [\n 'javascript' => [self::$js_path . 'drivers/sref/4326.js'],\n ],\n 'sref_handlers_osgb' => [\n 'javascript' => [self::$js_path . 'drivers/sref/osgb.js'],\n ],\n 'sref_handlers_osie' => [\n 'javascript' => [self::$js_path . 'drivers/sref/osie.js'],\n ],\n 'font_awesome' => [\n 'stylesheets' => ['https://use.fontawesome.com/releases/v5.15.4/css/all.css']\n ],\n 'leaflet' => [\n 'stylesheets' => ['https://unpkg.com/[email protected]/dist/leaflet.css'],\n 'javascript' => [\n 'https://unpkg.com/[email protected]/dist/leaflet.js',\n 'https://cdnjs.cloudflare.com/ajax/libs/wicket/1.3.3/wicket.min.js',\n 'https://cdnjs.cloudflare.com/ajax/libs/wicket/1.3.3/wicket-leaflet.min.js',\n self::$js_path . 'leaflet.heat/dist/leaflet-heat.js',\n ],\n ],\n 'leaflet_google' => [\n 'deps' => [\n 'googlemaps'\n ],\n 'javascript' => [\n 'https://unpkg.com/leaflet.gridlayer.googlemutant@latest/dist/Leaflet.GoogleMutant.js',\n ],\n ],\n 'datacomponents' => [\n 'deps' => [\n 'font_awesome',\n 'indiciaFootableReport',\n 'jquery_cookie',\n ],\n 'javascript' => [\n self::$js_path . 'indicia.datacomponents/idc.core.js',\n self::$js_path . 'indicia.datacomponents/idc.controlLayout.js',\n self::$js_path . 'indicia.datacomponents/idc.esDataSource.js',\n self::$js_path . 'indicia.datacomponents/idc.pager.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.customScript.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.runCustomVerificationRulesets.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.cardGallery.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.dataGrid.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.esDownload.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.leafletMap.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.recordsMover.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.recordDetailsPane.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.templatedOutput.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.verificationButtons.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.filterSummary.js',\n self::$js_path . 'indicia.datacomponents/jquery.idc.permissionFilters.js',\n 'https://unpkg.com/@ungap/url-search-params',\n ],\n ],\n 'file_classifier' => [\n 'deps' => [\n 'plupload',\n 'jquery_ui',\n ],\n 'javascript' => [\n self::$js_path . 'jquery.fileClassifier.js',\n ],\n ],\n 'brc_atlas' => [\n 'deps' => [\n 'd3',\n 'bigr',\n 'leaflet',\n ],\n 'stylesheets' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brcatlas.umd.css',\n ],\n 'javascript' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brcatlas.umd.min.js',\n ],\n ],\n 'brc_charts' => [\n 'deps' => [\n 'd3',\n ],\n 'stylesheets' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brccharts.umd.css',\n ],\n 'javascript' => [\n 'https://cdn.jsdelivr.net/gh/biologicalrecordscentre/[email protected]/dist/brccharts.umd.min.js',\n ],\n ],\n 'd3' => [\n 'javascript' => [\n 'https://d3js.org/d3.v5.min.js',\n ],\n ],\n 'bigr' => [\n 'javascript' => [\n 'https://unpkg.com/[email protected]/dist/bigr.min.umd.js',\n ],\n ],\n ];\n }\n return self::$resource_list;\n }",
"public function includeAssets()\n {\n $this->Html->script('CkTools.vendor/tinymce/jquery.tinymce.min.js', ['block' => true]);\n $this->Html->script('CkTools.vendor/moxiemanager/js/moxman.loader.min.js', ['block' => true]);\n }",
"protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo(\n array( \"$this->style.css\", \"faq.js\"),\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets($this->gradient);\n }",
"protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo(\n \"ribbon.css\",\n dirname(__FILE__) . \"/assets\"\n );\n $this->addGradientAssets($this->barGradient);\n }",
"public function loadTickets() {\r\n\t\t/** @var Tickets $Tickets */\r\n\t\tif (!$Tickets = $this->modx->getService('Tickets')) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (method_exists($Tickets, 'loadManagerFiles')) {\r\n\t\t\t$Tickets->loadManagerFiles($this, array(\r\n\t\t\t\t'config' => true,\r\n\t\t\t\t'utils' => true,\r\n\t\t\t\t'css' => true,\r\n\t\t\t\t'comments' => true,\r\n\t\t\t));\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$ticketsAssetsUrl = $Tickets->config['assetsUrl'];\r\n\t\t\t$connectorUrl = $ticketsAssetsUrl . 'connector.php';\r\n\t\t\t$ticketsJsUrl = $ticketsAssetsUrl . 'js/mgr/';\r\n\r\n\t\t\t$this->addJavascript($ticketsJsUrl . 'tickets.js');\r\n\t\t\t$this->addLastJavascript($ticketsJsUrl . 'misc/utils.js');\r\n\t\t\t$this->addLastJavascript($ticketsJsUrl . 'comment/comments.common.js');\r\n\t\t\t$this->addLastJavascript($ticketsJsUrl . 'comment/comments.grid.js');\r\n\t\t\t$this->addHtml('\r\n\t\t\t<script type=\"text/javascript\">\r\n\t\t\t// <![CDATA[\r\n\t\t\tTickets.config = {\r\n\t\t\t\tassets_url: \"' . $ticketsAssetsUrl . '\",\r\n\t\t\t\tconnector_url: \"' . $connectorUrl . '\"\r\n\t\t\t};\r\n\t\t\t// ]]>\r\n\t\t\t</script>');\r\n\t\t}\r\n\t}",
"public function initialize()\n {\n // $this->view->setTemplateBefore('public');\n // $this->view->setTemplateBefore('coba');\n if ($this->session->has('auth-identity')) {\n // $this->view->setTemplateBefore('private');\n $this->view->setTemplateBefore('cobaprivate');\n }else {\n // $this->view->setTemplateBefore('public');\n $this->view->setTemplateBefore('coba');\n }\n\n // Add some local CSS resources\n $this->assets->addCss(\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\");\n $this->assets->addCss(\"css/font-awesome.min.css\");\n $this->assets->addCss(\"css/animate.min.css\");\n $this->assets->addCss(\"css/prettyPhoto.css\");\n $this->assets->addCss(\"css/main.css\");\n $this->assets->addCss(\"css/responsive.css\");\n\n // And some local JavaScript resources\n $this->assets->addJs(\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\");\n $this->assets->addJs(\"js/jquery.js\");\n $this->assets->addJs(\"js/bootstrap.min.js\");\n $this->assets->addJs(\"js/main.js\");\n $this->assets->addJs(\"js/jquery.prettyPhoto.js\");\n $this->assets->addJs(\"js/jquery.isotope.min.js\");\n $this->assets->addJs(\"js/wow.min.js\");\n }",
"private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}",
"protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addYiiGemsCommonCss();\n $this->addFontAwesomeCss();\n $this->addAssetInfo( \"buttonBar.css\", dirname(__FILE__) . \"/assets\" );\n $this->addGradientAssets(array(\n $this->gradient, $this->hoverGradient,\n $this->activeGradient, $this->selectedGradient,\n $this->separatorGradient, $this->selectedColor\n ));\n }",
"protected function setupAssetsInfo() {\n JQuery::registerJQuery();\n $this->addAssetInfo(\n array(\"js/jquery.cookie.js\" ),\n $this->getCommonAssetDir()\n );\n $this->addAssetInfo(\n \"smartScrollPane.css\",\n dirname(__FILE__) . \"/assets\"\n );\n }",
"public function index() {\n $this->auth->checkIfOperationIsAllowed('report_list');\n $data = getUserContext($this);\n $this->lang->load('datatable', $this->language);\n \n $reports = array();\n //List all the available reports\n $files = glob(FCPATH . '/local/reports/*.ini');\n foreach($files as $file) {\n $ini_array = parse_ini_file($file, TRUE);\n //Test if the report is available for the language being used\n if (array_key_exists($this->language_code, $ini_array)) {\n //If available, push the report into the list to be displayed with a description\n $reports[$ini_array[$this->language_code]['name']] = array(\n basename($file),\n $ini_array[$this->language_code]['description'],\n $ini_array['configuration']['path'],\n );\n }\n }\n \n $data['title'] = lang('reports_index_title');\n $data['reports'] = $reports;\n $this->load->view('templates/header', $data);\n $this->load->view('menu/index', $data);\n $this->load->view('reports/index', $data);\n $this->load->view('templates/footer'); \n }",
"private function setup_assets() {\n\t\t$this->prefix = sanitize_title($this->theme_name) . '-';\n\t\t$public_lib = '/lib/pub/';\n\t\t$source_lib = '/lib/src/';\n\n\t\t//IF WP DEBUG Is ON, load source maps and assets\n\t\tif (constant(\"WP_DEBUG\") === true) {\n\t\t\t//Style Resources\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'styles',\n\t\t\t\t'path' => $source_lib . 'css/master.css',\n\t\t\t\t'deps' => array()\n\t\t\t);\n\t\t\t\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'scss',\n\t\t\t\t'path' => $source_lib . 'scss/master.scss',\n\t\t\t\t'deps' => array( $this->prefix . 'styles')\n\t\t\t);\n\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'css-map',\n\t\t\t\t'path' => $source_lib . 'maps/master.css.map',\n\t\t\t\t'deps' => array( $this->prefix . 'styles', $this->prefix . 'scss')\n\t\t\t);\n\t\t\n\t\n\t\t\t$this->scripts[] = array(\n\t\t\t\t'slug' => $this->prefix . 'plugins',\n\t\t\t\t'path' => $source_lib . 'js/plugins.js',\n\t\t\t\t'deps' => array(\n\t\t\t\t\t'jquery'\n\t\t\t\t)\n\t\t\t);\n\n\t\t\t$this->scripts[] = array(\n\t\t\t\t'slug' => $this->prefix . 'the-script',\n\t\t\t\t'path' => $source_lib . 'js/script.js',\n\t\t\t\t'deps' => array(\n\t\t\t\t\t'jquery'\n\t\t\t\t)\n\t\t\t);\n\n\n\n\t\t\t// $this->scripts[] = array(\n\t\t\t// \t'slug' => $this->prefix . 'script-map',\n\t\t\t// \t'path' => $source_lib . 'maps/scripts.js.map',\n\t\t\t// \t'deps' => array(\n\t\t\t// \t\t'jquery',\n\t\t\t// \t\t$this->prefix . 'script'\n\t\t\t// \t)\n\t\t\t// );\n\t\n\t\t// Otherwise load only minified assets\n\t\t} else {\n\n\t\t\t$this->styles[] = array(\n\t\t\t\t'slug' => $this->prefix . 'styles-min',\n\t\t\t\t'path' => $public_lib . 'css/master.min.css',\n\t\t\t\t'deps' => array()\n\t\t\t);\n\n\t\t\t$this->scripts[] = array(\n\t\t\t\t\t'slug' => $this->prefix . 'scripts-min',\n\t\t\t\t\t'path' => $public_lib . 'js/master.min.js',\n\t\t\t\t\t'deps' => array(\n\t\t\t\t\t\t'jquery'\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t}\n\t\t\n\t\t$this->add_wp_script('jquery');\n\t\t\n\t\tadd_action('wp_enqueue_scripts', array( $this, 'theme_assets_handler' ));\n\t}",
"public function index()\n {\n $assets = Asset::with('location.building', 'category.parentcatrecursive', 'location.region')->where('deleted_at', '=', null)->paginate(config('globalSettings.entries-per-page'));\n return view('admin.assets.assets',\n [\n 'assets' => $assets\n ]\n );\n }"
] |
[
"0.65653193",
"0.6453832",
"0.63521665",
"0.6299803",
"0.62571365",
"0.62282807",
"0.6082134",
"0.6080862",
"0.58901554",
"0.5817477",
"0.5792225",
"0.57812613",
"0.57686675",
"0.5738319",
"0.5735232",
"0.5680602",
"0.5671449",
"0.56416476",
"0.5494351",
"0.54901075",
"0.54747033",
"0.54653627",
"0.5464735",
"0.54605603",
"0.54596335",
"0.5455615",
"0.5454589",
"0.5445622",
"0.5430051",
"0.54284513"
] |
0.7239882
|
0
|
Returns current value for date_filter_mode property.
|
public function get_date_filter_mode() {
static $value;
if ( null === $value ) {
$value = isset( $_REQUEST['date_filter_mode'] ) ? $_REQUEST['date_filter_mode'] : '';
$modes = $this->get_date_filter_mode_list( false );
if ( ! $modes ) {
$value = '';
} elseif ( ! $value || ! in_array( $value, $modes ) ) {
$value = $modes[0];
}
}
return $value;
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"function getDateFilter() {\n return $this->getAdditionalProperty('date_filter', self::DATE_FILTER_ANY);\n }",
"function getDateFilterSelectedDate() {\n $on = $this->getAdditionalProperty('date_filter_on');\n \n return $on ? new DateValue($on) : null;\n }",
"public function getDateFilterVisibility()\n {\n return $this->_dateFilterVisibility;\n }",
"public function render_date_filter_mode_selector() {\n\t\t$modes = $this->get_date_filter_mode_list();\n\t\tif ( ! $modes ) {\n\t\t\treturn '';\n\t\t}\n\n\t\t$selected = $this->get_date_filter_mode();\n\n\t\t$select_html = '<select name=\"date_filter_mode\" style=\"line-height:26px;height:26px;\">';\n\t\tforeach ( $modes as $key => $value) {\n\t\t\t$select_html .= sprintf( '<option value=\"%s\"%s>%s</option>',\n\t\t\t\tesc_html( $key ),\n\t\t\t\t$key == $selected ? ' selected=\"selected\"' : '',\n\t\t\t\tesc_html( $value )\n\t\t\t);\n\t\t}\n\t\t$select_html .= '</select>';\n\n\t\treturn sprintf( '<div style=\"padding-left:10px\">%s %s</div>', esc_html__( 'Filter by', 'adventure-tours' ), $select_html );\n\t}",
"public function getFiltersMode(): string\n {\n if (null === $this->filtersMode) {\n $this->filtersMode = $this->getGenerator()->getFromYaml('builders.list.params.filtersMode', 'default');\n }\n\n return $this->filtersMode;\n }",
"function setDateFilter($value) {\n return $this->setAdditionalProperty('date_filter', $value);\n }",
"function getLogMode()\n {\n return $this->_props['LogMode'];\n }",
"public function getLogMode() {\n return $this->logMode;\n }",
"protected function getFilter()\n {\n return $this->getSettingsValue('filter');\n }",
"public function getActiveQuoteCutoffDate()\n {\n return date('Y-m-d H:i:s', strtotime('-'.$this->getActiveQuoteCutoff().' days'));\n }",
"public function getCurrentMode()\n\t{\n\t\tif ($this->getHidepriceModel()->getId()) {\n\t\t\treturn $this->getHidepriceModel()->getMode();\n\t\t}\n\n\t\treturn 0;\n\t}",
"public function getMode()\n {\n $value = $this->_config->get('dataprocessing/general/mode');\n\n if ($value === null) {\n $value = 'products';\n }\n\n return $value;\n }",
"public function getFilterValue(): string;",
"function getMode() {\n\t\treturn $this->get('mode');\n\t}",
"public function get_mode() {\n return edd_get_option( 'edd_commissions_payout_schedule_mode', '' );\n }",
"public function get_filtering()\r\n\t{\r\n\t\treturn $this->filtering->get_value();\r\n\t}",
"function getStatusFilter() {\n return $this->getAdditionalProperty('payment_status_filter', self::STATUS_FILTER);\n }",
"public function getDateFilterHtml()\n {\n return $this->getChildHtml('date_filter');\n }",
"protected function getMode() {\n\t\treturn $this->mode;\n\t}",
"public function getMode() {\n return $this->mode;\n }",
"function getMode() {\n\t\treturn $this->mode;\n\t}",
"public function getMode() {\n return $this->mode;\n }",
"public function getMode() {\n return $this->mode;\n }",
"function getMode() {\n\t\treturn $this->_mode;\n\t}",
"function getMode() {\n\t\treturn $this->_mode;\n\t}",
"public static function checkfront_date_format() {\n return (string)static::config()->get('checkfront_date_format');\n }",
"function getMode()\n {\n return $this->mode;\n }",
"function getMode()\n {\n return $this->mode;\n }",
"public function getDateF(){\n return $this->dateF;\n }",
"public function getMode()\n {\n return $this->_mode;\n }"
] |
[
"0.7019574",
"0.6986066",
"0.6444107",
"0.6178794",
"0.5908159",
"0.5721359",
"0.56791323",
"0.56743014",
"0.56449395",
"0.5644237",
"0.55513245",
"0.5534319",
"0.5500975",
"0.5414848",
"0.5394042",
"0.53909534",
"0.53610367",
"0.5354044",
"0.53426296",
"0.53413725",
"0.5338956",
"0.53304106",
"0.53304106",
"0.5325749",
"0.5325749",
"0.53182846",
"0.53119457",
"0.53073883",
"0.5303604",
"0.52919364"
] |
0.81214476
|
0
|
Renders selector for date_filter_mode.
|
public function render_date_filter_mode_selector() {
$modes = $this->get_date_filter_mode_list();
if ( ! $modes ) {
return '';
}
$selected = $this->get_date_filter_mode();
$select_html = '<select name="date_filter_mode" style="line-height:26px;height:26px;">';
foreach ( $modes as $key => $value) {
$select_html .= sprintf( '<option value="%s"%s>%s</option>',
esc_html( $key ),
$key == $selected ? ' selected="selected"' : '',
esc_html( $value )
);
}
$select_html .= '</select>';
return sprintf( '<div style="padding-left:10px">%s %s</div>', esc_html__( 'Filter by', 'adventure-tours' ), $select_html );
}
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"public function getDateFilterHtml()\n {\n return $this->getChildHtml('date_filter');\n }",
"public function render() {\n Openbizx::$app->getClientProxy()->includeCalendarScripts();\n\n $format = $this->dateFormat ? $this->dateFormat : \"%Y-%m-%d\";\n\n $sHTML = parent::render();\n\n $showTime = 'false';\n //$image = \"<img src=\\\"\".Openbizx::$app->getImageUrl().\"/calendar.gif\\\" border=0 title=\\\"Select date...\\\" align='top' hspace='2'>\";\n $sHTML .= \"<a class=\\\"date_picker\\\" href=\\\"javascript: void(0);\\\" onclick=\\\"return showCalendar('$this->objectName','$format',$showTime,true);\\\"></a>\";\n return $sHTML;\n }",
"function getDateFilterSelectedDate() {\n $on = $this->getAdditionalProperty('date_filter_on');\n \n return $on ? new DateValue($on) : null;\n }",
"function filterByDate($date) {\n $this->setDateFilter(self::DATE_FILTER_SELECTED_DATE);\n $this->setAdditionalProperty('date_filter_on', (string) $date);\n }",
"protected function renderFilterCellContent()\n\t{\n\t\tif($this->filter!==false && $this->grid->filter!==null && $this->name!==null && strpos($this->name,'.')===false)\n\t\t{\n\t\t\t\n\t\t\t$cs=Yii::app()->getClientScript();\n\t\t\t$cs->registerCssFile($cs->getCoreScriptUrl().'/jui/css/'. $this->theme .'/jquery-ui.css');\n\t\t\tif ($this->language!==false) {\n\t\t\t\t$cs->registerScriptFile($cs->getCoreScriptUrl().'/jui/js/jquery-ui-i18n.min.js');\n\t\t\t}\n\t\t\t$cs->registerScriptFile($cs->getCoreScriptUrl().'/jui/js/jquery-ui.min.js');\n\t\t\t\n\t/*\t\tif ($this->filter=='range') {\n\t\t\t\techo CHtml::tag('div', array(), \"<span style='\". $this->dateLabelStyle .\"'>\". $this->fromText .\"</span>\" . CHtml::activeTextField($this->grid->filter, $this->name.'_range[from]', array('style'=>$this->dateInputStyle, 'class'=>'filter-date')));\n\n\t\t\t\techo CHtml::tag('div', array(), \"<span style='\". $this->dateLabelStyle .\"'>\". $this->toText .\"</span>\". CHtml::activeTextField($this->grid->filter, $this->name.'_range[to]', array('style'=>$this->dateInputStyle, 'class'=>'filter-date')));\n\t\t\t}*/\n\t\t\tif ($this->filter=='range') {\n\t\t\t\techo CHtml::tag('div', array(), \"<span style='\". $this->dateLabelStyle .\"'>\". $this->fromText .\"</span>\" . CHtml::activeTextField($this->grid->filter, $this->name.'_range[from]', array('style'=>$this->dateInputStyle, 'class'=>'filter-date')) );\n\n\t\t\t\techo CHtml::tag('div', array(), \"<span style='\". $this->dateLabelStyle .\"'>\". $this->toText .\"</span>\". CHtml::activeTextField($this->grid->filter, $this->name.'_range[to]', array('style'=>$this->dateInputStyle, 'class'=>'filter-date')));\n\t\t\t}\n\t\t\telse {\n\t\t\t\techo CHtml::tag('div', array(), CHtml::activeTextField($this->grid->filter, $this->name.'_range[to]', array('class'=>'filter-date')));\n\t\t\t}\n\t\t\t$options=CJavaScript::encode($this->dateOptions);\n\n\t\t\tif ($this->language!==false) {\n$js=<<<EOD\n$(filter_date).datepicker(jQuery.extend({dateFormat:'dd-mm-yy'}, {$options}));\nEOD;\n\t\t\t}\n\t\t\telse {\n$js=<<<EOD\n$(filter_date).datepicker(jQuery.extend({dateFormat:'dd-mm-yy'}, {$options}));\n\nEOD;\n\t\t\t}\n$js=<<<EOD\n\tvar filter_date='#{$this->grid->id} input[class=\"filter-date\"]';\n\t$('body').delegate(filter_date, 'mousedown', function(){\n\t{$js}\n\t});\nEOD;\n\n\t\t\t$cs->registerScript(__CLASS__, $js);\n\t}\n\t\telse\n\t\t\tparent::renderFilterCellContent();\n\t}",
"public function render() \n {\n \n $this->processData();\n \n $code = <<<CODE\n<div class=\"wcm wcm_list_filter do-align\" style=\"margin-right:20px;\" >\n <var class=\"list_filter\" >{\"form\":\"{$this->searchForm}\",\"param\":\"{$this->searchParam}\",\"param_name\":\"{$this->searchParamName}\"}</var>\n <ul class=\"wgt-controls-list\" >\n <li><a class=\"{$this->actionClass}\" data-val=\"{$this->yearStart}\" ><<</a></li>\n <li><a class=\"{$this->actionClass}\" data-val=\"{$this->yearBefore}\" ><</a></li>\nCODE;\n \n foreach ($this->showYears as $year) { \n \n $isActive = '';\n if ($this->active == $year) {\n $isActive = ' action-is-active ';\n }\n \n $code .= <<<CODE\n <li><a class=\"{$this->actionClass} {$isActive}\" data-val=\"{$year}\" >{$year}</a></li>\nCODE;\n \n } \n \n $code .= <<<CODE\n <li><a class=\"{$this->actionClass}\" data-val=\"{$this->yearNext}\" >></a></li>\n <li><a class=\"{$this->actionClass}\" data-val=\"{$this->yearEnd}\" >>></a></li>\n </ul>\n</div>\n \n<div class=\"do-align\" >\n <select class=\"wcm wcm_widget_selectbox\" style=\"width:90px;\" >\nCODE;\n\n foreach ($this->allYears as $year) {\n \n $selected = '';\n \n if ($this->active == $year) {\n $selected = ' selected=\"selected\" ';\n }\n \n $code .= \"<option value=\\\"{$year}\\\" {$selected} >{$year}</option>\";\n }\n \n $code .= <<<CODE\n </select>\n</div>\n \nCODE;\n \n \n return $code;\n \n }",
"function kcsite_add_events_date_filter() {\n\n\tglobal $wpdb, $wp_locale;\n\n\t$months = $wpdb->get_results( $wpdb->prepare( \"\n\t\tSELECT DISTINCT YEAR( meta_value ) AS year, MONTH( meta_value ) AS month\n\t\tFROM $wpdb->postmeta\n\t\tWHERE meta_key = %s\n\t\tORDER BY meta_value ASC\n\t\", '_EventStartDate' ) );\n\n\t$month_count = count( $months );\n\n\tif ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )\n\t\treturn;\n\n\t$m = isset( $_GET['_EventStartDate'] ) ? (int) $_GET['_EventStartDate'] : 0;\n\t?>\n\n\t<select id=\"EventStartDate-filter\" name='_EventStartDate'>\n\t\t<option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Pasirinkite renginio datą' ); ?></option>\n\t<?php\n\tforeach ( $months as $arc_row ) {\n\t\tif ( 0 == $arc_row->year )\n\t\t\tcontinue;\n\n\t\t$month = zeroise( $arc_row->month, 2 );\n\t\t$year = $arc_row->year;\n\n\t\tprintf( \"<option %s value='%s'>%s</option>\\n\",\n\t\t\tselected( $m, $year . $month, false ),\n\t\t\tesc_attr( $arc_row->year . $month ),\n\t\t\t/* translators: 1: month name, 2: 4-digit year */\n\t\t\tsprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )\n\t\t);\n\t}\n\t?>\n\t</select>\n\t<?php\n}",
"function getDateFilter() {\n return $this->getAdditionalProperty('date_filter', self::DATE_FILTER_ANY);\n }",
"function olc_draw_date_selector($prefix, $date='') {\n\t$month_array = array();\n\t$month_array[1] =_JANUARY;\n\t$month_array[2] =_FEBRUARY;\n\t$month_array[3] =_MARCH;\n\t$month_array[4] =_APRIL;\n\t$month_array[5] =_MAY;\n\t$month_array[6] =_JUNE;\n\t$month_array[7] =_JULY;\n\t$month_array[8] =_AUGUST;\n\t$month_array[9] =_SEPTEMBER;\n\t$month_array[10] =_OCTOBER;\n\t$month_array[11] =_NOVEMBER;\n\t$month_array[12] =_DECEMBER;\n\t$usedate = getdate($date);\n\t$day = $usedate['mday'];\n\t$month = $usedate['mon'];\n\t$year = $usedate['year'];\n\t$date_selector = '<select name=\"'. $prefix .'_day\">';\n\tfor ($i=1;$i<32;$i++){\n\t\t$date_selector .= '<option value=\"' . $i . QUOTE;\n\t\tif ($i==$day) $date_selector .= 'selected';\n\t\t$date_selector .= '>' . $i . '</option>';\n\t}\n\t$date_selector .= '</select>';\n\t$date_selector .= '<select name=\"'. $prefix .'_month\">';\n\tfor ($i=1;$i<13;$i++){\n\t\t$date_selector .= '<option value=\"' . $i . QUOTE;\n\t\tif ($i==$month) $date_selector .= 'selected';\n\t\t$date_selector .= '>' . $month_array[$i] . '</option>';\n\t}\n\t$date_selector .= '</select>';\n\t$date_selector .= '<select name=\"'. $prefix .'_year\">';\n\tfor ($i=2001;$i<2019;$i++){\n\t\t$date_selector .= '<option value=\"' . $i . QUOTE;\n\t\tif ($i==$year) $date_selector .= 'selected';\n\t\t$date_selector .= '>' . $i . '</option>';\n\t}\n\t$date_selector .= '</select>';\n\treturn $date_selector;\n}",
"function setDateFilter($value) {\n return $this->setAdditionalProperty('date_filter', $value);\n }",
"function ShowFilterList() {\n\t\tglobal $dealers_reports;\n\t\tglobal $ReportLanguage;\n\n\t\t// Initialize\n\t\t$sFilterList = \"\";\n\n\t\t// Field StartDate\n\t\t$sExtWrk = \"\";\n\t\t$sWrk = \"\";\n\t\tewrpt_BuildDropDownFilter($dealers_reports->StartDate, $sExtWrk, $dealers_reports->StartDate->DateFilter);\n\t\tif ($sExtWrk <> \"\" || $sWrk <> \"\")\n\t\t\t$sFilterList .= $dealers_reports->StartDate->FldCaption() . \"<br>\";\n\t\tif ($sExtWrk <> \"\")\n\t\t\t$sFilterList .= \" $sExtWrk<br>\";\n\t\tif ($sWrk <> \"\")\n\t\t\t$sFilterList .= \" $sWrk<br>\";\n\n\t\t// Show Filters\n\t\tif ($sFilterList <> \"\")\n\t\t\techo $ReportLanguage->Phrase(\"CurrentFilters\") . \"<br>$sFilterList\";\n\t}",
"public static function renderSelect();",
"function addSelectDate($title, $filter, $default = null) {\n\t\t\n\t\t$a = array();\n\t\t$a['id'] = 'filter_'.$filter;\n\t\t$name = 'filters['.$filter.']';\n\n\t\t$display_date = null;\n\t\t\n\t\tif (is_array($this->_mod_filters[$filter])) {\n\t\t\t$display_date = $true_date = implode('-', $this->_mod_filters[$filter]);\n\t\t} else if ($default) {\n\t\t\t$true_date = $default;\n\t\t}\n\t\t\n\t\t$field = Html::SelectDate($name, $true_date, $a);\n\t\t\n\t\t$this->_fields[$this->_row][] = array('html' => $field, 'value' => $display_date, 'title' => $title);\n\t}",
"function getDateSelector($label, $name, $btn){\n\t$btnDatePicker = we_html_button::create_button(we_html_button::CALENDAR, 'javascript:', null, null, null, null, null, null, false, $btn);\n\t$oSelector = new we_html_table(array('class' => 'default', 'id' => $name . '_cell'), 1, 5);\n\t$oSelector->setCol(0, 0, array('class' => 'middlefont'), $label);\n\t$oSelector->setCol(0, 2, null, we_html_tools::htmlTextInput($name, 55, '', 10, 'id=\"' . $name . '\" readonly=\"1\"', \"text\", 70, 0));\n\t$oSelector->setCol(0, 4, null, we_html_element::htmlA(array(\"href\" => \"#\"), $btnDatePicker));\n\treturn $oSelector->getHTML();\n}",
"public function addDateFilter()\n\t{\n\t\t$this->_addFilter(new DataGrid\\Filters\\DateFilter());\n\t\treturn $this->getFilter();\n\t}",
"function hundope_select_field_render() { \n\t\n}",
"function DateSelector($SelectedDate, $StartDate, $Prefix = 'date', $Years = 10) {\n\t \t\t// The selcted year\n\t \t\t$selectedYear = date('Y', $SelectedDate);\n\t \t\t// The 'maximum'-year (StartDate->Year + Years)\n\t \t\t$endYear = date('Y', $StartDate) + $Years;\n\t \t\t// The selected day\n\t \t\t$selectedDay = date('j', $SelectedDate);\n\t \t\t// The selected month\n\t \t\t$selectedMonth = date('n', $SelectedDate);\n\t \t\t// The selected hour\n\t \t\t$selectedHour = date('G', $SelectedDate);\n\t \t\t// The selected minute\n\t \t\t$selectedMinute = date('i', $SelectedDate);\n\t \t\t\t \t\t\t \t\t\n\t \t\t$out = \"<select id=\\\"{$Prefix}Day\\\" name=\\\"{$Prefix}Day\\\">\";\n\t \t\t// print all possible days of a month\n\t \t\tfor($i = 1; $i <= 31; $i++) {\n\t \t\t\tif($i == $selectedDay)\n\t \t\t\t\t$out .= \"<option selected=\\\"selected\\\" value=\\\"$i\\\">\" . substr('0' . $i, -2) . \"</option>\\r\\n\";\n\t \t\t\telse\n\t \t\t\t\t$out .= \"<option value=\\\"$i\\\">\" . substr('0' . $i, -2) . \"</option>\\r\\n\";\n\t \t\t}\n\t \t\t$out .= \"</select>\\r\\n\n\t\t\t\t<select id=\\\"{$Prefix}Month\\\" name=\\\"{$Prefix}Month\\\">\";\n\t\t\t// print all months\n\t \t\tfor($i = 1; $i <= 12; $i++) {\n\t \t\t\tif($i == $selectedMonth)\n\t \t\t\t\t$out .= \"<option selected=\\\"selected\\\" value=\\\"$i\\\">\" . substr('0' . $i, -2) . \"</option>\\r\\n\";\n\t \t\t\telse\n\t \t\t\t\t$out .= \"<option value=\\\"$i\\\">\" . substr('0' . $i, -2) . \"</option>\\r\\n\";\n\t \t\t}\n\t \t\t$out .= \"</select>\\r\\n\n\t \t\t\t<select id=\\\"{$Prefix}Year\\\" name=\\\"{$Prefix}Year\\\">\";\n\t \t\t// print all selectable years, but make sure that the year is greater than 1970 (lower years will make trouble in windows environments)\n\t \t\tfor($i = ($selectedYear - $Years < 1970) ? 1970 : ($selectedYear - $Years); $i <= $endYear; $i++) {\n\t \t\t\tif($i == $selectedYear)\n\t \t\t\t\t$out .= \"<option selected=\\\"selected\\\" value=\\\"$i\\\">$i</option>\\r\\n\";\n\t \t\t\telse\n\t \t\t\t\t$out .= \"<option value=\\\"$i\\\">$i</option>\\r\\n\";\n\t \t\t}\n\t \t\t$out .= \"</select>\\r\\n\n\t\t\t\t<select id=\\\"{$Prefix}Hour\\\" name=\\\"{$Prefix}Hour\\\">\";\n\t \t\t// print all hours\n\t \t\tfor($i = 0; $i <= 23; $i++) {\n\t \t\t\tif($i == $selectedHour)\n\t \t\t\t\t$out .= \"<option selected=\\\"selected\\\" value=\\\"$i\\\">\" . substr('0' . $i, -2) . \"</option>\\r\\n\";\n\t \t\t\telse\n\t \t\t\t\t$out .= \"<option value=\\\"$i\\\">\" . substr('0' . $i, -2) . \"</option>\\r\\n\";\n\t \t\t}\n\t \t\t$out .= \"</select>\\r\\n\n\t\t\t\t<select id=\\\"{$Prefix}Minute\\\" name=\\\"{$Prefix}Minute\\\">\";\n\t \t\t// print all minutes\n\t \t\tfor($i = 0; $i <= 59;$i++) {\n\t \t\t\tif($i == $selectedMinute)\n\t \t\t\t\t$out .= \"<option selected=\\\"selected\\\" value=\\\"$i\\\">\" . substr('0' . $i, -2) . \"</option>\\r\\n\";\n\t \t\t\telse\n\t \t\t\t\t$out .= \"<option value=\\\"$i\\\">\" . substr('0' . $i, -2) . \"</option>\\r\\n\";\n\t \t\t}\n\t \t\t$out .= \"</select>\";\n\t \t\treturn $out;\n\t \t}",
"public function get_date_filter_mode() {\n\t\tstatic $value;\n\t\tif ( null === $value ) {\n\t\t\t$value = isset( $_REQUEST['date_filter_mode'] ) ? $_REQUEST['date_filter_mode'] : '';\n\t\t\t$modes = $this->get_date_filter_mode_list( false );\n\t\t\tif ( ! $modes ) {\n\t\t\t\t$value = '';\n\t\t\t} elseif ( ! $value || ! in_array( $value, $modes ) ) {\n\t\t\t\t$value = $modes[0];\n\t\t\t}\n\t\t}\n\t\treturn $value;\n\t}",
"function DatesSelectField($dates=array())\n {\n if (empty($dates)) { $dates=$this->Dates(); }\n return\n $this->Html_Select_Multi_Field\n (\n $dates,\n \"Dates\",\n \"ID\",\n \"#Text\",\n \"\",\n $this->CGI2Dates(),\n $addempty=FALSE\n );\n }",
"function template_date_select($params,&$smarty)\n {\n extract($params);\n \n if (empty($name)) {\n return;\n }\n \n $buffer = '<input type=\"text\" size=\"12\" maxlength=\"12\" name=\"'.$name.'\" value=\"'.$value.'\" /> (Format: mm/dd/yyyy)';\n return $buffer;\n }",
"public function renderFilterCell() {\r\n echo CHtml::openTag('td', $this->filterHtmlOptions);\r\n echo '<div class=\"filter-container\">';\r\n $this->renderFilterCellContent();\r\n echo '</div>';\r\n echo CHtml::closeTag('td');\r\n }",
"function testRender(){\n\t\t#mdx:Render\n\t\t$select = new HtCklist(\"select_days\");\n\t\t$select->options([1=>'Mon',2=>'Tue',3=>'Wed',4=>'Thu',5=>'Fri',6=>'Sat']);\n\t\t#/mdx echo $select\n\t\t$this->expectOutputRegex(\"/input.*?select_days.*?1.*?select_days.*?6.*?Sat/s\");\n\t\techo $select;\n\t}",
"function print_date_selection_set( $p_name, $p_format, $p_date = 0, $p_default_disable = false, $p_allow_blank = false, $p_year_start = 0, $p_year_end = 0, $p_input_css = \"input-sm\" ) {\n\tif( $p_date != 0 ) {\n\t\t$t_date = date( $p_format, $p_date );\n\t} else {\n\t\t$t_date = '';\n\t}\n\n\t$t_disable = '';\n\tif( $p_default_disable == true ) {\n\t\t$t_disable = ' readonly=\"readonly\"';\n\t}\n\n \techo '<input ' . helper_get_tab_index() . ' type=\"text\" name=\"' . $p_name . '_date\" ' .\n\t\t' class=\"datetimepicker ' . $p_input_css . '\" ' . $t_disable .\n\t\t' data-picker-locale=\"' . lang_get_current_datetime_locale() . '\"' .\n\t\t' data-picker-format=\"' . convert_date_format_to_momentjs( $p_format ) . '\"' .\n\t\t' size=\"16\" maxlength=\"20\" value=\"' . $t_date . '\" />';\n\techo '<i class=\"fa fa-calendar fa-xlg datetimepicker\"></i>';\n}",
"public function datepicker_css()\n\t{\n\t\t$this->actions();\n\t\treturn $this->actions->datepicker_css( ! $this->check_no(ee()->TMPL->fetch_param('include_jqui')));\n\t}",
"static function renderDateField($name, $value = null, $label = null, $mode = 'date', $callback = null)\n {\n echo '<li>';\n if ($label) echo '<label>'.textH8($label).'</label>';\n $calendar = new wcmHtmlCalendar();\n echo $calendar->render($name, $value, $mode, $callback);\n echo '</li>';\n }",
"function culturefeed_search_ui_get_date_facet_options() {\n\n return array(\n 'today' => t('Today'),\n 'tomorrow' => t('Tomorrow'),\n 'next7days' => t('Next 7 days'),\n 'thisweekend' => t('This weekend'),\n 'next14days' => t('Next 14 days'),\n 'next30days' => t('Next 30 days'),\n );\n\n}",
"public function render()\n {\n switch ($this->form) {\n case 'v':\n case 'vertical':\n return view('components.forms.date-vertical');\n break;\n default:\n return view('components.forms.date');\n break;\n }\n }",
"public function getControl()\n {\n $control = parent::getControl();\n $rules = json_encode($control->attrs['data-nette-rules']);\n\n $name = $this->getHtmlName();\n $result = Html::el('div')->addAttributes(['class' => 'input-date',]);\n\n $selectDay = $this->day ?: '';\n $selectMonth = $this->month ?: '';\n $selectYear = $this->year ?: '';\n\n return $result\n ->add(Nette\\Forms\\Helpers::createSelectBox(\n self::$days,\n ['selected?' => $selectDay,'disabled:' => ['' => TRUE],]\n )->addAttributes(['class' => 'form-control input-date-item', 'placeholder'=> 'den', 'data-nette-rules' => $rules])->name($name . '[day]'))\n ->add(Nette\\Forms\\Helpers::createSelectBox(\n self::$months,\n ['selected?' => $selectMonth,'disabled:' => ['' => TRUE],]\n )->addAttributes(['class' => 'form-control input-date-item', 'data-nette-rules' => $rules])->name($name . '[month]'))\n ->add(Nette\\Forms\\Helpers::createSelectBox(\n $this->getYears(),\n ['selected?' => $selectYear,'disabled:' => ['' => TRUE],]\n )->addAttributes(['class' => 'form-control input-date-item', 'data-nette-rules' => $rules])->name($name . '[year]'));\n }",
"protected function getModeSelector() {\n\t\t$options = array();\n\n\n\t\tforeach ( $this->mAllowedModes as $mode ) {\n\t\t\t$text = $this->msg( \"approvedrevs-{$mode}pages\" );\n\n\t\t\t$options[] = Html::element(\n\t\t\t\t'option', array(\n\t\t\t\t\t'value' => $mode,\n\t\t\t\t\t'selected' => ( $mode === $this->mMode ),\n\t\t\t\t), $text\n\t\t\t);\n\t\t}\n\n\t\t$ret = '';\n\t\t$ret .= Html::element(\n\t\t\t\t'label', array(\n\t\t\t\t'for' => 'filter-mode-selector',\n\t\t\t), 'סטטוס'\n\t\t) . ' ';\n\n\t\t// Wrap options in a <select>\n\t\t$ret .= Html::rawElement(\n\t\t\t'select',\n\t\t\tarray( 'id' => 'filter-mode-selector', 'name' => 'show' ),\n\t\t\timplode( \"\\n\", $options )\n\t\t);\n\n\t\treturn $ret;\n\t}",
"public function renderDateRange() {\n\t\tif(!empty($this->dateRange)) {\n\t\t\t$date_range_data = array(\n\t\t\t\t'from' => $this->dateRange->from->format(\"d.m.Y\"),\n\t\t\t\t'to' => $this->dateRange->to->format(\"d.m.Y\")\n\t\t\t);\n\t\t\t\n\t\t\t$this->template->date_range_data = $date_range_data;\n\t\t}\n\t}"
] |
[
"0.6828684",
"0.6088196",
"0.5809791",
"0.580905",
"0.57622975",
"0.5746768",
"0.57143885",
"0.5666682",
"0.56525695",
"0.564223",
"0.5602316",
"0.5586188",
"0.55356795",
"0.55218095",
"0.546544",
"0.54400355",
"0.54118973",
"0.5345859",
"0.53264856",
"0.5265446",
"0.5225534",
"0.5200474",
"0.519961",
"0.5196732",
"0.5172291",
"0.51625264",
"0.5149817",
"0.51451725",
"0.5133015",
"0.51279765"
] |
0.81189275
|
0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.