query stringlengths 7 5.25k | document stringlengths 15 1.06M | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
set last query to present query | public function query($sql){
//for debug purposes
$this->lastQuery = $sql;
$result = mysqli_query($this->conn, $sql);
$this->confirmQuery($result);
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function setLastQuery($newQuery = \"\")\r\n {\r\n $_SESSION[\"last_query\"] = $newQuery;\r\n }",
"protected function resetLastQuery(): void\n {\n $this->lastQuery = null;\n }",
"function lastQuery() {\n\t\treturn $this->lastQuery;\n\t}",
"public function getLastQuer... | [
"0.7700382",
"0.7555782",
"0.7164885",
"0.7086459",
"0.6991607",
"0.69829834",
"0.69499695",
"0.6784595",
"0.6768863",
"0.67634267",
"0.67031544",
"0.6625186",
"0.6602108",
"0.65464514",
"0.6480334",
"0.64726645",
"0.64195716",
"0.64069813",
"0.6345529",
"0.6325208",
"0.62993... | 0.0 | -1 |
get list of rules | public function getRules(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRulesList(){\n return $this->_get(3);\n }",
"public function getRules() {}",
"abstract protected function getRules();",
"public function getRules(): Collection;",
"public static function getRules(): array;",
"public function getRules(): array;",
"public function getRules(): ar... | [
"0.8531926",
"0.8500616",
"0.83190566",
"0.8303848",
"0.8300871",
"0.8227738",
"0.8227738",
"0.8100199",
"0.80676585",
"0.80380654",
"0.80380654",
"0.80380654",
"0.79961723",
"0.7965298",
"0.7877579",
"0.78692764",
"0.7777388",
"0.77557963",
"0.77557963",
"0.77471775",
"0.771... | 0.8726984 | 0 |
/ Ahora mostramos la estadistica para cada articulo dentro de nuestra administracion, generando una nueva columna donde se muestran el numero de visitas para cada articulo. | function posts_column_views($defaults){
$defaults['post_views'] = __('Visitas');
return $defaults;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function visites_mensuelles_chiffres($global_jour) {\r\n\tglobal $couleur_foncee, $couleur_claire;\r\n\r\n\t$periode = date('m/y'); // mois /annee en cours (format de $date)\r\n\t$dday = date('j'); // numero du jour\r\n\t$nb_mois = $GLOBALS['actijour']['nbl_mensuel']; // nombre mois affiche\r\n\r\n\t$requ... | [
"0.600245",
"0.58265793",
"0.5663111",
"0.5615238",
"0.5612189",
"0.56053364",
"0.56039834",
"0.5583585",
"0.5556775",
"0.55057216",
"0.5462677",
"0.5411139",
"0.54092",
"0.53830427",
"0.5381245",
"0.5365633",
"0.5362829",
"0.5341498",
"0.533916",
"0.533275",
"0.5324862",
"... | 0.0 | -1 |
$this>path = new File($certificateFolder); | function __construct(String $certificateFolder) {
$this->path = new FileLocator($certificateFolder);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct(string $file_path);",
"public function __construct($file);",
"function __construct($file_path)\n {\n $this->open($file_path);\n }",
"public function __construct($path);",
"public function getFile() {}",
"public function getFile() {}",
"public function __construct()\... | [
"0.6861805",
"0.660397",
"0.64530945",
"0.63977253",
"0.63536257",
"0.6351859",
"0.63486254",
"0.6246805",
"0.6214628",
"0.61984205",
"0.6184057",
"0.61572343",
"0.6137795",
"0.61377895",
"0.61106455",
"0.61079943",
"0.61064553",
"0.60980433",
"0.6095672",
"0.60745305",
"0.60... | 0.6901473 | 0 |
Desarrollar una funcion que reciba un array o un string, en un mismo parametro, e imprima el contenido de la varible en un archivo | function print_f($variable){
if(is_array($variable)){
//Si es un array, lo recorro y guardo el contenido en el archivo "datos.txt"
foreach($variable as $valor){
$contenido = $contenido . $valor . "\n";
}
file_put_contents("datos.txt", $contenido);
}
else{
//Entonces es string, guardo el contenido en el archivo "datos.txt"
file_put_contents("datos.txt", $variable);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function readFileFromParam() {\n\t\tglobal $argv;\n\t\t$myArr = array();\n $myString = \"\";\n $len = 0;\n \n\t\tif (($file = fopen($argv[1], \"r\") or exit (\"Sorry - file not found.\")) != FALSE) {\n\t\t\twhile (($data = fgets($file)) != FALSE) {\n\t\t\t $myArr[$len] = $data;\n ... | [
"0.60956895",
"0.5862017",
"0.5849489",
"0.5704998",
"0.567625",
"0.5525777",
"0.5523403",
"0.547683",
"0.54739606",
"0.5453325",
"0.5448067",
"0.5427438",
"0.53477925",
"0.5330651",
"0.5317426",
"0.5317426",
"0.5317426",
"0.5316768",
"0.5316578",
"0.52904195",
"0.52730924",
... | 0.6409371 | 0 |
TODO: Implement wrapMessages() method. | public function wrapMessages(string $messages, string $type): string
{
return '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMessages() {}",
"public function getMessages() {}",
"public function getMessages(){ }",
"public function toMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMes... | [
"0.72713464",
"0.72713464",
"0.714196",
"0.71093196",
"0.7061492",
"0.7061492",
"0.7061492",
"0.7061492",
"0.7061492",
"0.7061492",
"0.7061492",
"0.70536304",
"0.67928547",
"0.67928547",
"0.67928547",
"0.66566473",
"0.66309863",
"0.6595975",
"0.6492883",
"0.6445229",
"0.64018... | 0.5917994 | 85 |
Total values of items in this order (without any tax) | public function getSubTotal() {
$total = 0;
// Calculate total from items in the list
foreach($this->Items() as $item) {
$total += $item->getSubTotal();
}
return $total;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function itemTotal(): float;",
"public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }",
"protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $en... | [
"0.7840666",
"0.7607806",
"0.75806826",
"0.7437518",
"0.74133396",
"0.74101573",
"0.74066925",
"0.73827547",
"0.7366938",
"0.73305714",
"0.73085326",
"0.7292632",
"0.72888774",
"0.725131",
"0.72466314",
"0.72401214",
"0.720252",
"0.71927935",
"0.7178356",
"0.7166466",
"0.7149... | 0.6898818 | 47 |
Total values of items in this order | public function getTaxTotal() {
$total = 0;
// Calculate total from items in the list
foreach($this->Items() as $item) {
$total += $item->getTaxTotal();
}
// Add any tax from postage
$total += $this->PostageTax;
return $total;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }",
"public function getTotalItems()\n {\n $total = 0;\n \n foreach ($this->items as $item) {\n... | [
"0.77438444",
"0.7740794",
"0.74697185",
"0.7412311",
"0.73996043",
"0.7378311",
"0.7358779",
"0.7354533",
"0.7285978",
"0.7219718",
"0.72026575",
"0.7187239",
"0.7166573",
"0.7138649",
"0.7130117",
"0.7111038",
"0.7106049",
"0.70964336",
"0.70951694",
"0.70790625",
"0.703917... | 0.0 | -1 |
Get the postage cost for this order | public function getPostage() {
return $this->PostageCost;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPostageCost()\n {\n $total = 0;\n \n if ($this->postage) {\n $total = $this->postage->Cost;\n }\n \n return $total;\n }",
"public function getCost()\n {\n return $this->get(self::_COST);\n }",
"public function cost()\n ... | [
"0.80778193",
"0.7858859",
"0.7741399",
"0.7631515",
"0.76224536",
"0.76028836",
"0.7595196",
"0.75835454",
"0.75835454",
"0.75835454",
"0.7427905",
"0.7324105",
"0.73094076",
"0.7278735",
"0.71628827",
"0.7157007",
"0.7098993",
"0.7098993",
"0.70699406",
"0.7006299",
"0.6986... | 0.76968616 | 3 |
Total of order including postage | public function getTotal() {
$sub = ($this->hasDiscount()) ? $this->SubTotal - $this->DiscountAmount : $this->SubTotal;
return number_format($sub + $this->Postage + $this->TaxTotal, 2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTotal()\n {\n return $this->service()->getTotalOfOrder();\n }",
"public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }",
"public function ... | [
"0.77671987",
"0.7684026",
"0.75328183",
"0.7202079",
"0.7202079",
"0.7202079",
"0.71825165",
"0.7176639",
"0.71408474",
"0.70981425",
"0.70921874",
"0.70871454",
"0.70000887",
"0.6991273",
"0.6990894",
"0.698819",
"0.6985154",
"0.6935586",
"0.6926372",
"0.69143444",
"0.69130... | 0.6649881 | 47 |
Return a list string summarising each item in this order | public function getItemSummary() {
$return = '';
foreach($this->Items() as $item) {
$return .= "{$item->Quantity} x {$item->Title};\n";
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toList() : string\n {\n return implode(\"\\n\", $this->all());\n }",
"public function __toString(): string\n {\n $ret = \"\";\n\n if (count($this->_items) > 0) {\n foreach ($this->_items as $orderItem) {\n $ret .= $orderItem->__toString() . ... | [
"0.64233047",
"0.6347259",
"0.62909704",
"0.62092125",
"0.614493",
"0.6084903",
"0.6080245",
"0.6065177",
"0.60519177",
"0.59055525",
"0.5887425",
"0.58818746",
"0.58699155",
"0.58278614",
"0.5810605",
"0.58101577",
"0.5807248",
"0.5766627",
"0.5690212",
"0.5675996",
"0.56324... | 0.61355567 | 5 |
API Callback before this object is written to the DB | public function onBeforeWrite() {
parent::onBeforeWrite();
// See if this order was just marked paid, if so reduce quantities for
// items.
if($this->isChanged("Status") && $this->Status == "paid") {
foreach($this->Items() as $item) {
$product = $item->MatchProduct;
if($product->ID && $product->Quantity) {
$new_qty = $product->Quantity - $item->Quantity;
$product->Quantity = ($new_qty > 0) ? $new_qty : 0;
$product->write();
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function beforeSaveInDB(){}",
"public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }",
"public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }",
"public function onAfterSave();",
"public function preSaveCallbac... | [
"0.7023155",
"0.69771075",
"0.69771075",
"0.68390816",
"0.68033314",
"0.68033314",
"0.6795757",
"0.6795757",
"0.6793903",
"0.6793903",
"0.6736093",
"0.6728146",
"0.66032565",
"0.658259",
"0.65468806",
"0.65348",
"0.6531158",
"0.65279573",
"0.6475497",
"0.6465709",
"0.64558536... | 0.0 | -1 |
API Callback before this object is removed from to the DB | public function onBeforeDelete() {
// Delete all items attached to this order
foreach($this->Items() as $item) {
$item->delete();
}
parent::onBeforeDelete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onRemove();",
"public function after_delete() {}",
"protected function afterRemoving()\n {\n }",
"public function afterRemove()\n\t{}",
"protected function afterDelete()\r\n {\r\n }",
"public function onAfterDelete();",
"public function delete() \n {\n DomainWatche... | [
"0.76699215",
"0.7421804",
"0.729886",
"0.7280106",
"0.71365166",
"0.71324843",
"0.7089952",
"0.70717645",
"0.7046764",
"0.7016627",
"0.7016627",
"0.69988257",
"0.6998365",
"0.69609445",
"0.696023",
"0.6957569",
"0.6956488",
"0.69203836",
"0.68374366",
"0.68128425",
"0.678871... | 0.0 | -1 |
API Callback after this object is written to the DB | public function onAfterWrite() {
parent::onAfterWrite();
// Check if an order number has been generated, if not, add it and save again
if(!$this->OrderNumber) {
$this->OrderNumber = $this->generate_order_number();
$this->write();
}
// Deal with sending the status email
if($this->isChanged('Status') && in_array($this->Status, array('failed','paid','processing','dispatched')) ) {
$siteconfig = SiteConfig::current_site_config();
$from = $siteconfig->EmailFromAddress;
$vars = array(
'Order' => $this,
'SiteConfig' => $siteconfig
);
// Deal with customer email
if($siteconfig->sendCommerceEmail('Customer', $this->Status)) {
// if subsites installed, then get the native language for that site
$current_i18n = i18n::get_locale();
if($this->SubsiteID && class_exists('Subsite') && $this->Subsite())
i18n::set_locale($this->Subsite()->Language);
$subject = _t('CommerceEmail.Order', 'Order') . " {$this->OrderNumber} {$this->getTranslatedStatus()}";
$body = $this->renderWith('OrderEmail_Customer', $vars);
$email = new Email($from,$this->Email,$subject,$body);
$email->sendPlain();
// If subsites enabled, set the language back
if($this->SubsiteID && class_exists('Subsite') && $this->Subsite())
i18n::set_locale($current_i18n);
}
// Deal with vendor email
if($siteconfig->sendCommerceEmail('Vendor', $this->Status)) {
$subject = _t('CommerceEmail.Order', 'Order') . " {$this->OrderNumber} {$this->getTranslatedStatus()}";
switch($this->Status) {
case 'paid':
$email_to = $siteconfig->PaidEmailAddress;
case 'processing':
$email_to = $siteconfig->ProcessingEmailAddress;
case 'dispatched':
$email_to = $siteconfig->DispatchedEmailAddress;
}
if(isset($email_to)) {
$body = $this->renderWith('OrderEmail_Vendor', $vars);
$email = new Email($from,$email_to,$subject,$body);
$email->sendPlain();
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }",
"public function postPersistCallback()\n {\n $this->performPostPersistCallback();\n }",
"public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}",
"public function... | [
"0.7129526",
"0.7129526",
"0.7050235",
"0.70251524",
"0.70251524",
"0.69667184",
"0.68732816",
"0.6855578",
"0.6800485",
"0.67896706",
"0.67896706",
"0.6789429",
"0.6755349",
"0.66785234",
"0.6656412",
"0.6648279",
"0.66437894",
"0.6592316",
"0.6588565",
"0.65849906",
"0.6558... | 0.0 | -1 |
API Callback after this object is removed from to the DB | public function onAfterDelete() {
parent::onAfterDelete();
foreach ($this->Items() as $item) {
$item->delete();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onRemove();",
"public function after_delete() {}",
"public function afterRemove()\n\t{}",
"protected function afterRemoving()\n {\n }",
"public function delete() \n {\n DomainWatcher::addDeletedObject($this);\n }",
"protected function afterDelete()\r\n {\r\n }",
... | [
"0.7542932",
"0.73507524",
"0.7181743",
"0.71804345",
"0.71469074",
"0.7015905",
"0.7003163",
"0.6979227",
"0.6960795",
"0.6960478",
"0.692682",
"0.689657",
"0.689657",
"0.6820351",
"0.67868817",
"0.6757821",
"0.675697",
"0.6723526",
"0.6718578",
"0.6713574",
"0.6701855",
"... | 0.6448388 | 38 |
Only order creators or users with VIEW admin rights can view | public function canView($member = null) {
$extended = $this->extend('canView', $member);
if($extended && $extended !== null) return $extended;
if($member instanceof Member)
$memberID = $member->ID;
else if(is_numeric($member))
$memberID = $member;
else
$memberID = Member::currentUserID();
if($memberID && Permission::checkMember($memberID, array("ADMIN", "COMMERCE_VIEW_ORDERS")))
return true;
else if($memberID && $memberID == $this->CustomerID)
return true;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function commerce_store_admin_order_view_access($order) {\n $access = commerce_order_admin_order_view_access($order);\n return $access || user_access('view any commerce_order entity in own store') && commerce_order_access('view', $order);\n}",
"public function adminOnly();",
"public function adminOnly();",
... | [
"0.74309516",
"0.6762254",
"0.6762254",
"0.67123437",
"0.6495226",
"0.64607954",
"0.63877654",
"0.631979",
"0.630981",
"0.62731874",
"0.62484103",
"0.62472475",
"0.6245806",
"0.62293524",
"0.6213342",
"0.61986494",
"0.6196738",
"0.6171531",
"0.6166352",
"0.6165085",
"0.613869... | 0.0 | -1 |
Anyone can create orders, even guest users | public function canCreate($member = null) {
$extended = $this->extend('canCreate', $member);
if($extended && $extended !== null) return $extended;
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createOrder(){\n $order = Auth::user()->orders()->create(['status' => 'aguardando']);\n\n return $order;\n }",
"public function create()\n {\n if (Gate::allows('create-order')) {\n return view('orders.create', [\n 'order' => null\n ... | [
"0.6789236",
"0.6546317",
"0.6395398",
"0.6345244",
"0.62821716",
"0.6266845",
"0.6250803",
"0.61733466",
"0.61536336",
"0.6114564",
"0.60527945",
"0.60353374",
"0.5961002",
"0.59541523",
"0.5925883",
"0.5886639",
"0.5877791",
"0.5860154",
"0.5825765",
"0.58227515",
"0.575885... | 0.0 | -1 |
Only users with EDIT admin rights can view an order | public function canEdit($member = null) {
$extended = $this->extend('canEdit', $member);
if($extended && $extended !== null) return $extended;
if($member instanceof Member)
$memberID = $member->ID;
else if(is_numeric($member))
$memberID = $member;
else
$memberID = Member::currentUserID();
if($memberID && Permission::checkMember($memberID, array("ADMIN", "COMMERCE_EDIT_ORDERS")))
return true;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function commerce_store_admin_order_view_access($order) {\n $access = commerce_order_admin_order_view_access($order);\n return $access || user_access('view any commerce_order entity in own store') && commerce_order_access('view', $order);\n}",
"public function get_adminOrder(){\n if(Auth::user()->user_t... | [
"0.7628756",
"0.6865917",
"0.68158907",
"0.6804738",
"0.6804738",
"0.6789904",
"0.6498177",
"0.6472775",
"0.6471079",
"0.6451094",
"0.64366347",
"0.64366347",
"0.64366347",
"0.64366347",
"0.64366347",
"0.64366347",
"0.64366347",
"0.64366347",
"0.64366347",
"0.64366347",
"0.64... | 0.0 | -1 |
No one should be able to delete an order once it has been created | public function canDelete($member = null) {
$extended = $this->extend('canDelete', $member);
if($extended && $extended !== null) return $extended;
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleting(Order $Order)\n {\n //code...\n }",
"public function deleted(Order $Order)\n {\n //code...\n }",
"public function deleted(Order $order)\n {\n //\n }",
"public function deleted(Order $order)\n {\n //\n }",
"public function deleteOr... | [
"0.7734511",
"0.7657907",
"0.7652144",
"0.7652144",
"0.7575158",
"0.7502184",
"0.7428316",
"0.7428316",
"0.7422564",
"0.74171025",
"0.7329596",
"0.7262482",
"0.7247783",
"0.720496",
"0.7185836",
"0.7185836",
"0.7185836",
"0.7127131",
"0.7127131",
"0.7127131",
"0.7127131",
"... | 0.0 | -1 |
/ specify names for command properties, not required | public function createAction()
{
$this->request()->commandProperties([
'name',
]);
if (!$name = $this->request()->command('name'))
return $this->_('ERROR: Empty migration name parameter');
if (!$name = preg_replace('~[^0-9A-z_]+~iu', '', $name))
return $this->_('ERROR: Wrong migration name parameter');
if (!is_dir(MIGRATE_PATH))
return $this->_('ERROR: Directory is not exist "' . MIGRATE_PATH . '"');
$name = 'Migrate_' . time() . "_$name";
$content = @file_get_contents(BASE_PATH . 'base/migrate/create.tpl');
$content = str_replace('{name}', $name, $content);
@file_put_contents(MIGRATE_PATH . $name . '.php', $content);
return $this->_('Migration "' . $name . '" created');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function defineCommandOptions(){}",
"public function command($name)\n {\n $this->name = $name;\n }",
"protected function defineCommandOptions()\n {\n $this->addOption('all', 'A', InputOption::VALUE_NONE, \"List all defined globals settings\");\n\n $this->addArgument('key... | [
"0.6406731",
"0.6141441",
"0.60041213",
"0.59673685",
"0.58744985",
"0.57174426",
"0.5699127",
"0.5605896",
"0.5524268",
"0.5471651",
"0.5463972",
"0.5425009",
"0.542314",
"0.54102296",
"0.5391896",
"0.53867847",
"0.5383985",
"0.53772336",
"0.5370679",
"0.53553486",
"0.534904... | 0.0 | -1 |
Get the value of Id_batiment | public function getId_batiment()
{
return $this->Id_batiment;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBidId(){\n return $this->bidId; \n }",
"public function getBid()\n {\n return $this->getAttribute()->getBid();\n }",
"public function getId_Boisson()\n {\n return $this->Id_Boisson;\n }",
"public function setId_batiment($Id_batiment)\n {\... | [
"0.6747695",
"0.66339815",
"0.66311955",
"0.658652",
"0.643237",
"0.6398355",
"0.6224411",
"0.6188837",
"0.6156267",
"0.6151657",
"0.6064528",
"0.58263236",
"0.5734558",
"0.57297283",
"0.57233727",
"0.56914264",
"0.5638607",
"0.56230545",
"0.5612167",
"0.56011236",
"0.5591568... | 0.86391884 | 0 |
Set the value of Id_batiment | public function setId_batiment($Id_batiment)
{
$this->Id_batiment = $Id_batiment;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getId_batiment()\n {\n return $this->Id_batiment;\n }",
"public function setId($IDabbonamento)\n {\n $this->id = $IDabbonamento;\n }",
"function setId($value) {\n $this->_id = intval($value);\n }",
"public function setId($id)\r\n {\r\... | [
"0.76356494",
"0.6097018",
"0.58651775",
"0.57700163",
"0.5764101",
"0.57294595",
"0.5657558",
"0.5611514",
"0.5577207",
"0.55523413",
"0.5541761",
"0.5527859",
"0.55245644",
"0.551988",
"0.55164087",
"0.55164087",
"0.55164087",
"0.55041605",
"0.5477404",
"0.5474623",
"0.5471... | 0.8076125 | 0 |
Display a listing of the resource. | public function index()
{
$webinar = Webinar::with('user')->get();
return response()->json($webinar);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7447426",
"0.73628515",
"0.73007894",
"0.7249563",
"0.7164474",
"0.7148467",
"0.71320325",
"0.7104678",
"0.7103152",
"0.7100512",
"0.7048493",
"0.6994995",
"0.69899315",
"0.6935843",
"0.6899995",
"0.68999326",
"0.6892163",
"0.6887924",
"0.6867505",
"0.6851258",
"0.6831236"... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(AddWebinarRequest $request)
{
$data = $request->all();
$webinar = new Webinar();
$webinar->fill($data);
$image = $request->file('image');
if($image)
{
$path = Storage::disk('public')->put('images', $image);
$webinar->image = $path;
}
$webinar->save();
return response()->json([
'status' => 200,
'webinar' => $webinar,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.63424... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
$webinar = Webinar::where('id', $id)->first();
return response()->json($webinar);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
$data = $request->all();
$webinar = Webinar::findOrFail($id);
$previousImage = $webinar->image;
$image = $request->file('image');
if($image)
{
$path = Storage::disk('public')->put('images', $image);
$data['image'] = $path;
if($path){
Storage::disk('public')->delete('/' . $previousImage);
}
} else
{
$webinar->image = $previousImage;
}
$webinar->update($data);
return response()->json([
'status' => 200,
'message' => 'Webinar was updated successfully',
'webinar' => $webinar,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7424884",
"0.7062319",
"0.70572054",
"0.6897199",
"0.658233",
"0.6450576",
"0.6347209",
"0.6211253",
"0.6146092",
"0.6121878",
"0.6114851",
"0.61005586",
"0.608833",
"0.60537165",
"0.60196865",
"0.60068345",
"0.5972924",
"0.594671",
"0.5940615",
"0.5938648",
"0.58927333",
... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
$webinar = Webinar::findOrFail($id);
$image = $webinar->image;
Storage::disk('public')->delete('/' .$image);
$webinar->delete();
return response()->json([
'status' => 200,
'message' => 'Webinar has been deleted successfully',
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n ... | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897... | 0.0 | -1 |
var $db; var $table = "pengantar"; | function __construct()
{
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct()\n {\n parent::__construct();\n $this->table = 'ms_pengguna';\n }",
"public function table($table);",
"public function table($table);",
"public static function table($table)\n {\n }",
"function MySQL() {\n \n }",
"public function setTable... | [
"0.67128307",
"0.6536057",
"0.6536057",
"0.64223886",
"0.6401775",
"0.63816965",
"0.63795215",
"0.6353503",
"0.63432986",
"0.6309436",
"0.6300133",
"0.62862873",
"0.6280485",
"0.6268039",
"0.626761",
"0.6256716",
"0.6220726",
"0.6213175",
"0.6196643",
"0.6190259",
"0.6187563"... | 0.0 | -1 |
Gets the datasource for this connection | public function datasource() {
return $this->HasMany('App\Datasource');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDatasource()\n {\n return static::resolveDatasource($this->datasource);\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public function getDatasource()\n {\n return $this->datasource;\n }",
"public static function getData... | [
"0.80677944",
"0.80668855",
"0.80668855",
"0.7831839",
"0.77213144",
"0.7670749",
"0.76419246",
"0.7344449",
"0.73009634",
"0.7198656",
"0.69559574",
"0.68324494",
"0.6803551",
"0.67411083",
"0.67122364",
"0.65214634",
"0.6424574",
"0.6386449",
"0.6281664",
"0.6281361",
"0.62... | 0.0 | -1 |
get user for this connection | public function User()
{
return $this->belongsTo('App\User');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->g... | [
"0.8164691",
"0.8164691",
"0.8164691",
"0.8164691",
"0.79397446",
"0.789546",
"0.78900176",
"0.78879094",
"0.78050584",
"0.7802587",
"0.7785356",
"0.77667177",
"0.7756139",
"0.7746232",
"0.77385336",
"0.77385336",
"0.77347785",
"0.7726845",
"0.77265245",
"0.77189034",
"0.7703... | 0.0 | -1 |
Run the passed query on the database and returns result in json format | public function runquery(string $query) {
// Check if SELECT is in the query
if (preg_match('/SELECT/', strtoupper($query)) != 0) {
// Array with forbidden query parts
$disAllow = array( 'INSERT','UPDATE','DELETE','RENAME','DROP','CREATE','TRUNCATE','ALTER',
'COMMIT','ROLLBACK','MERGE','CALL','EXPLAIN','LOCK','GRANT','REVOKE',
'SAVEPOINT','TRANSACTION','SET');
$disAllow = array( 'UPDATE ','DELETE ', 'DROP ', 'TRUNCATE ', 'RENAME ');
$disAllow = implode('|', $disAllow);
// Check if no other harmfull statements exist
if (preg_match('/('.$disAllow.')/', strtoupper($query)) == 0) {
$conn=array(
'driver' => $this->dbtype,
'host' => $this->host,
'database' => $this->dbname,
'username' => $this->username,
'password' => decrypt($this->password),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => ''
);
if ($this->dbtype=='oracle') {
$conn['database']='';
$conn['service_name']=$this->dbname;
}
Config::set('database.connections.'.$this->name, $conn);
$DB=\DB::connection($this->name);
//Connection
try {
\DB::connection($this->name)->getPdo();
}
catch(\PDOException $e) {
return $e->getMessage();
}
//Query
try {
$ret=$DB->select($query);
}
catch(\PDOException $err) {
return $err->getMessage();
}
return collect($ret)->toJson();
} else {
return 'Error: only SELECT queries area allowed. INVALID keyword included.';
}
} else {
return 'Error: only SELECT queries area allowed.';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fire_query_get_json() {\n $res = $this->fire_query();\n $res_arr = array();\n while($row = $res->fetch_array(MYSQL_ASSOC)) {\n $res_arr[] = $row;\n }\n return json_encode($res_arr);\n }",
"public function query();",
"public function query();",
"public... | [
"0.7105816",
"0.68147826",
"0.68147826",
"0.68147826",
"0.6802983",
"0.66834146",
"0.6682107",
"0.660833",
"0.65793455",
"0.65341854",
"0.6501893",
"0.6469688",
"0.64643395",
"0.6458618",
"0.6392739",
"0.63908637",
"0.6364758",
"0.63640594",
"0.6341996",
"0.6312305",
"0.62928... | 0.60266453 | 44 |
Include the default item template | function tpl_item( $post, $include_date = true ) {
tpl('item', 'default', array(
'post' => $post
) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function available_items_template()\n {\n }",
"function defaultTemplate() {\n\t\t$l = $this->api->locate('addons',__NAMESPACE__,'location');\n\t\t$addon_location = $this->api->locate('addons',__NAMESPACE__);\n\t\t$this->api->pathfinder->addLocation($addon_location,array(\n\t\t\t//'js'=>'temp... | [
"0.70914614",
"0.69423985",
"0.6857787",
"0.67445195",
"0.6502809",
"0.63727",
"0.63441795",
"0.63319206",
"0.6323185",
"0.631422",
"0.6311157",
"0.6311157",
"0.6311157",
"0.6311157",
"0.6311157",
"0.6311157",
"0.6311157",
"0.6311157",
"0.6311157",
"0.6311157",
"0.6292951",
... | 0.6812593 | 3 |
Include the default page template | function tpl_item_page( $page ) {
tpl('item', 'page', array(
'page' => $page
) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function page_default () {\r\n\t\t$skeleton = new xhtml ('skeleton.basic');\r\n\t\t$skeleton->load();\r\n\t\t$content=\"\";\r\n\t\t/**\r\n\t\t * Fetch the body content template\r\n\t\t */\r\n\t\tif(config::get('locale')!='') {\r\n\t\t\t$body = new xhtml ('body.vidtuts.'.config::get('locale'));\r\n\t\t} e... | [
"0.71611106",
"0.7046104",
"0.6818574",
"0.6759805",
"0.67546314",
"0.6731774",
"0.67270565",
"0.6722121",
"0.6714793",
"0.67102885",
"0.6697808",
"0.6664415",
"0.66510314",
"0.66510314",
"0.6647876",
"0.6628416",
"0.6621367",
"0.6621367",
"0.6621367",
"0.6621367",
"0.6621367... | 0.0 | -1 |
Include the default comment template Note, this should probably only be used as a callback for wp_list_comments() | function tpl_comment( $comment, $args, $depth ) {
tpl('item', 'comment', array(
'comment' => $comment,
'args' => $args,
'depth' => $depth
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pixelgrade_comments_template() {\n\t\t// We need to pass the template path retrieved by our locate function so the component template is accounted for\n\t\t// If present in the root of the theme or child theme, `/comments.php` will take precedence.\n\t\tcomments_template( '/' . pixelgrade_make_relative_pa... | [
"0.7894192",
"0.75712",
"0.7442904",
"0.7241063",
"0.71609265",
"0.71125174",
"0.7097508",
"0.6934415",
"0.6745412",
"0.6659723",
"0.6658278",
"0.6638466",
"0.6570929",
"0.654988",
"0.6520269",
"0.6511005",
"0.6491101",
"0.6464287",
"0.64412445",
"0.64310646",
"0.6428039",
... | 0.0 | -1 |
Include the closing for a comment item This is only meant to be used as a callback for wp_list_comments() 'endcallback' argument | function tpl_comment_end( $comment, $args, $depth ){
echo '</li>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hybrid_comments_end_callback() {\n\techo '</li><!-- .comment -->';\n}",
"function wizate_comments_close() {\n\t\techo '</div>';\n }",
"function close_comment() {?>\n\t</article>\n<?php\n}",
"public function renderCloseComment($node) {\n\t\tif ($node->isConditional) return parent::renderCloseComment... | [
"0.8140795",
"0.78549004",
"0.70392954",
"0.6702649",
"0.6558431",
"0.6345414",
"0.61633116",
"0.6061738",
"0.6051477",
"0.5999857",
"0.59105116",
"0.58853954",
"0.58633614",
"0.5835095",
"0.5825912",
"0.5816918",
"0.57893574",
"0.5773253",
"0.5766595",
"0.57573164",
"0.57453... | 0.6995325 | 3 |
Kontrollerar textfilen gentemot kakornas tid. | public function validateExpirationTime()
{
// Variabel som ska innehålla tiden från filen.
$correctTime = "";
// Öppnar filen, läser igenom den och sparar värdet i $correctTime, för att sedan stänga filen.
$file = fopen('cookieExpirationTime.txt','r');
while ($line = fgets($file))
{
$correctTime = $line;
}
fclose($file);
// Om tiden från filen är större än just precis nu...
if(intval($correctTime) > time())
{
// Returnera true, kakan är fortfarande giltig.
return true;
}
else
{
// Annars kalla på felmeddelandet, kakans levnadstid är över.
$this->cookieException();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function difundir() {\n $frase = $this->obtener_frase();\n echo $frase;\n }",
"public function get_text()\n {\n }",
"public function tes()\n\t{\n\t\t$tes = \"^ & %aku% ak4 $ 12 Trilyun2 Enak2 banget2 ya Tragedi ular kembali memakan korban. Kali ini seorang bocah laki... | [
"0.62134343",
"0.6045996",
"0.6007843",
"0.5896323",
"0.58933234",
"0.5884074",
"0.5824838",
"0.5816255",
"0.57773316",
"0.57773316",
"0.57773316",
"0.5774886",
"0.5768003",
"0.5756065",
"0.5753877",
"0.5709279",
"0.5709178",
"0.56730694",
"0.56618184",
"0.56615835",
"0.56427... | 0.0 | -1 |
Returns the order mapper | public function getOrderMapper()
{
if($this->orderMapper == null) {
throw new \Exception('Please set the order mapper');
}
return $this->orderMapper;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_order() {\n return $this->get_mapped_property('order');\n }",
"public function generateOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder();",
"public function getOrder... | [
"0.6431113",
"0.58484906",
"0.58419657",
"0.58419657",
"0.58419657",
"0.58419657",
"0.58419657",
"0.58419657",
"0.58290136",
"0.5786071",
"0.5786071",
"0.5786071",
"0.5775523",
"0.57736933",
"0.5729906",
"0.56842107",
"0.56812525",
"0.5652704",
"0.5636372",
"0.5636219",
"0.56... | 0.7406881 | 0 |
Create a new controller instance. | public function __construct ()
{
$this->middleware( 'auth' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createController()\n {\n $this->createClass('controller');\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this-... | [
"0.82678324",
"0.8173564",
"0.78118384",
"0.7706353",
"0.76816905",
"0.7659159",
"0.74858105",
"0.7406485",
"0.7298472",
"0.7253435",
"0.7196091",
"0.7174443",
"0.7016074",
"0.6989523",
"0.69837826",
"0.69728553",
"0.69640046",
"0.69357765",
"0.6897687",
"0.689282",
"0.687757... | 0.0 | -1 |
Show the application dashboard. | public function index ( Request $request, $event_instance_name )
{
$event_instance = SocialWallScreenSettingController::GetEventInstanceByName( $event_instance_name );
$screen_settings = SocialWallScreenSetting::where(
'event_instance_id', '=', $event_instance->id
)
->orderBy( 'id', 'ASC' )
->get();
return(
view( 'dashboard.index' )
->with(
[
'event_instance_name' => $event_instance_name,
'settings' => $screen_settings
]
)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }",
"function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}",
"public function showDashboard() { \n\t\n ... | [
"0.77845055",
"0.7759553",
"0.75615275",
"0.75149643",
"0.74643844",
"0.74642456",
"0.7364247",
"0.73505014",
"0.7346846",
"0.73411953",
"0.7326109",
"0.73154867",
"0.7306794",
"0.7287334",
"0.72823006",
"0.7272898",
"0.7272898",
"0.7272898",
"0.7272898",
"0.7251149",
"0.7251... | 0.0 | -1 |
Add a boolean param | public function addBoolean(string $name, bool $default = false) {
$this->add('boolean', $name, func_get_args());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _setBoolean($name, $value) {}",
"public function set_add($param)\n\t{\n\t\t$this->add = (bool)$param;\n\t\treturn $this;\n\t}",
"public function putBool(string $name, ?bool $value, bool $mandatory = false): string;",
"public function setBoolean($trueFalse);",
"function post_bool($boolean... | [
"0.6995609",
"0.6974047",
"0.6896783",
"0.6663273",
"0.6496533",
"0.6441607",
"0.641299",
"0.63380754",
"0.6304253",
"0.6259438",
"0.6259438",
"0.6259438",
"0.6259438",
"0.6259438",
"0.6253668",
"0.6182342",
"0.61822045",
"0.6175959",
"0.61320627",
"0.6130263",
"0.6117875",
... | 0.70515066 | 0 |
Add an integer param | public function addInteger(string $name, bool $short = false, int $length = 0, bool $unsigned = false, int $default = 0) {
$this->add('integer', $name, func_get_args());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function appendParamsInt($value)\n {\n return $this->append(self::PARAMS_INT, $value);\n }",
"public function integerMethod($integer)\n {\n }",
"private function int ($param)\n {\n $this->type = 'int';\n $this->value = (int)$this->value;\n return true;\n }",... | [
"0.6848231",
"0.6306623",
"0.63048005",
"0.6080029",
"0.60794723",
"0.59684604",
"0.59131795",
"0.5753972",
"0.5719734",
"0.5709594",
"0.57089746",
"0.56803775",
"0.56742334",
"0.5605312",
"0.55938256",
"0.5566804",
"0.55602235",
"0.553378",
"0.5533093",
"0.5506475",
"0.54923... | 0.60169417 | 5 |
Add a textual param | public function addTextual(string $name, bool $short = true, int $length = 0, bool $binary = false, string $default = '') {
$this->add('textual', $name, func_get_args());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_text($text)\n {\n }",
"function addText($text);",
"function add()\n{\n\t$args = func_get_args();\n\t$string = array_shift($args);\n\tSystem::InterfaceHandler()->content(vsprintf($string, $args));\n}",
"public function addParam($param, $raw = true)\n {\n if ($param instance... | [
"0.6921021",
"0.6892538",
"0.6789542",
"0.65996337",
"0.6599433",
"0.65875435",
"0.65344065",
"0.6451737",
"0.6430316",
"0.63584936",
"0.6349766",
"0.6296022",
"0.6162246",
"0.61600465",
"0.6099131",
"0.60867304",
"0.6077351",
"0.6003899",
"0.5994574",
"0.5954804",
"0.595036"... | 0.54115295 | 62 |
Get the secure params list (includes every param except of long textuals) | public function getSecure() : array {
return $this->secure;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function PKG_listParams($paramStr)\n{\n\t$params = explodeAssoc(\"?#*\",$paramStr);\n\n\t$out = \"\";\n\n\t$keys = array_keys($params);\n\n\tfor ($i=0; $i < count($keys); $i++)\n\t\tif ((strlen($keys[$i]) > 0) && (strlen($params[$keys[$i]]) > 0))\n\t\t$out.=wordwrap($keys[$i].\": \".$params[$keys[$i]].\"<br>\",60)... | [
"0.68041766",
"0.63572526",
"0.62716115",
"0.62243575",
"0.6221891",
"0.6175087",
"0.61143017",
"0.60476387",
"0.6029033",
"0.60233516",
"0.59914386",
"0.5951765",
"0.5941729",
"0.5909978",
"0.58895934",
"0.5818779",
"0.58046275",
"0.57841",
"0.57818466",
"0.57809836",
"0.577... | 0.0 | -1 |
funzione che elimina cartella prop e files al suo interno | function delete_files($target) {
if(is_dir($target)){
//GLOB_MARK adds a slash to directories returned
$files = glob( $target . '*', GLOB_MARK );
foreach( $files as $file )
{
delete_files( $file );
}
rmdir( $target );
} elseif(is_file($target)) {
unlink( $target );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function purgeAllClone($stri_extra_id='')\n {\n $stri_file_name=serialisable::constructFileName($stri_extra_id);\n $stri_user_temp_path=serialisable::constructUserTempPath();\n $stri_file=$stri_user_temp_path.\"/\".$stri_file_name;\n $lenght = strlen($stri_file)-4;//calcule la taille de la chaine... | [
"0.6425457",
"0.6214671",
"0.61338115",
"0.6123779",
"0.61083204",
"0.60348797",
"0.59706146",
"0.59237784",
"0.583745",
"0.583333",
"0.58218706",
"0.5782317",
"0.57731783",
"0.57566667",
"0.5748633",
"0.5732352",
"0.5731475",
"0.57248944",
"0.5724773",
"0.57100385",
"0.57078... | 0.0 | -1 |
TODO: add to frontier ccording to priority | function add2Front($url, $priority){
global $frontier;
$frontier->insert($url,$priority);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPriority() ;",
"function getPriority() ;",
"function getPriority() ;",
"function getPriority() ;",
"function getPriority() ;",
"function getPriority() ;",
"function getPriority() ;",
"protected function setPriority() {}",
"public function getPriority() {}",
"public function getPriorit... | [
"0.69260234",
"0.69260234",
"0.69260234",
"0.6924646",
"0.6924646",
"0.6924646",
"0.69245905",
"0.6853707",
"0.64298135",
"0.64298135",
"0.64298135",
"0.64298135",
"0.64298135",
"0.6428831",
"0.6428831",
"0.6428831",
"0.6428794",
"0.6428794",
"0.6428794",
"0.6428794",
"0.6428... | 0.5690033 | 53 |
Get a list of members of a particular chamber in a particular Congress | public function listMembers(int $congress, string $chamber)
{
$this->congressValidator->isValidChamber($chamber);
switch ($chamber) {
case 'senate':
$earliestCongress = 80;
break;
case 'house':
default:
$earliestCongress = 102;
break;
}
$this->congressValidator->isValidCongress($congress, $earliestCongress);
$uriStub = "{$congress}/{$chamber}/members.json";
return $this->performApiRequest($uriStub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getChamberMembers($chamberID) {\r\n $sql = $this->db->prepare(\"SELECT UserID, firstname, lastname, email, businessname, expiry, archived, type\r\n FROM USER LEFT OUTER JOIN BUSINESS ON USER.businessID=BUSINESS.businessID WHERE USER.chamberID=:chamber_id\r\n ORDER BY lastname;\");\r... | [
"0.73190004",
"0.6645987",
"0.62595874",
"0.59774035",
"0.59544647",
"0.5867948",
"0.5847275",
"0.5789874",
"0.57801473",
"0.5643668",
"0.5597109",
"0.55882555",
"0.5572076",
"0.5558976",
"0.5558413",
"0.55562127",
"0.5533526",
"0.55256444",
"0.5503543",
"0.550002",
"0.548751... | 0.6867929 | 1 |
Get biographical and congressional role information for a particular member of Congress | public function getSpecificMember(string $memberId)
{
$this->formatValidator->isValidMemberIdFormat($memberId);
$uriStub = "members/{$memberId}.json";
return $this->performApiRequest($uriStub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRole() {}",
"public function getRole();",
"public function getRole();",
"public function getRole() : string;",
"function getRole() {\n\t\treturn 1;\n\t}",
"public function get_role()\n {\n }",
"protected function _getRole(){\n\t$user = new Pas_User_Details();\n $pers... | [
"0.615511",
"0.60776645",
"0.60776645",
"0.6030217",
"0.599632",
"0.59461206",
"0.5719794",
"0.5646128",
"0.56439006",
"0.5550596",
"0.5517149",
"0.5516284",
"0.5493032",
"0.54811007",
"0.54803157",
"0.5402824",
"0.53978205",
"0.53936833",
"0.5384679",
"0.53741974",
"0.537213... | 0.0 | -1 |
Get a list of the most recent new members of the current Congress | public function getNewMembers()
{
$uriStub = 'members/new.json';
return $this->performApiRequest($uriStub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNewMembers($limit = 10, $offset = -1)\n\t{\n\t\t$criteria = new CDbCriteria();\n\t\t$criteria->condition = \"superuser <> 1\";\n\t\t$criteria->limit = $limit;\n\t\t$criteria->offset = $offset;\n\t\t$criteria->order = \"created DESC\";\n\t\t$newMembers = ZoneUser::model()->findAll($criteria);\n\n... | [
"0.627372",
"0.61850905",
"0.6174401",
"0.6114995",
"0.6100552",
"0.597774",
"0.59293956",
"0.5919237",
"0.58966655",
"0.5890074",
"0.5864995",
"0.5856403",
"0.5777726",
"0.5777397",
"0.5717376",
"0.57084703",
"0.56799996",
"0.56646717",
"0.56153995",
"0.5609165",
"0.5596281"... | 0.63905877 | 0 |
Get current senators by state or current representatives by state and district | public function getCurrentMembersByStateOrStateAndDistrict(string $chamber, string $state, int $district = null)
{
$this->congressValidator->isValidChamber($chamber);
$this->stateValidator->isValidStateAbbreviation($state);
$uriStub = "members/{$chamber}/{$state}/";
if (! is_null($district)) {
$uriStub .= "{$district}/";
}
$uriStub .= 'current.json';
return $this->performApiRequest($uriStub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function seniorContributors()\n {\n $query = \"SELECT identifier FROM \".$this->_name.\" WHERE status='Active' AND profile_type='senior'\";\n if(($result = $this->getQuery($query,true)) != NULL)\n {\n for($i=0; $i<count($result); $i++)\n {\n $res... | [
"0.56107414",
"0.5576005",
"0.55233175",
"0.5217713",
"0.5198404",
"0.51926404",
"0.51031095",
"0.49812588",
"0.49535838",
"0.49093494",
"0.49017674",
"0.4883469",
"0.48760858",
"0.48672482",
"0.4866077",
"0.48542807",
"0.485303",
"0.48505163",
"0.48368448",
"0.48238772",
"0.... | 0.53161716 | 3 |
Get a list of members who have left the Senate or House or have announced plans to do so | public function getMembersLeavingOffice(int $congress, string $chamber)
{
$earliestCongress = 111;
$this->congressValidator->isValidCongress($congress, $earliestCongress);
$this->congressValidator->isValidChamber($chamber);
$uriStub = "{$congress}/{$chamber}/members/leaving.json";
return $this->performApiRequest($uriStub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMembers() {\n\t\t$query = $this->createQuery();\n\t\t$query .= \"WHERE c2.status = '\" . KontakteData::$STATUS_MEMBER . \"'\";\n\t\t$query .= \" OR c2.status = '\" . KontakteData::$STATUS_ADMIN . \"' \";\n\t\t$query .= \"ORDER BY c2.name ASC\";\n\t\treturn $this->database->getSelection($query);\n\t}",
... | [
"0.5922946",
"0.5792282",
"0.57002634",
"0.5632166",
"0.55439156",
"0.54254216",
"0.53389496",
"0.5336526",
"0.52803427",
"0.52668625",
"0.5257534",
"0.5208803",
"0.5185166",
"0.5182264",
"0.51785356",
"0.5159715",
"0.51547617",
"0.51544523",
"0.51538944",
"0.5151475",
"0.512... | 0.0 | -1 |
Get the most recent vote positions for a specific member of the House of Representatives or Senate | public function getSpecificMemberVotePositions(string $memberId)
{
$this->formatValidator->isValidMemberIdFormat($memberId);
$uriStub = "{$memberId}/votes.json";
return $this->performApiRequest($uriStub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFriendLastedPosting() {\n $sql = \"SELECT b.*,\n c.name \n FROM member_posting a\n INNER JOIN posting b \n ON b.id = a.posting_id\n INNER JOIN member c \n ON c.id = a.member_id\n WHERE a.member_id IN (\n ... | [
"0.53921187",
"0.52387536",
"0.509725",
"0.5026603",
"0.4901936",
"0.47599354",
"0.47508165",
"0.47487944",
"0.47423947",
"0.47328556",
"0.472439",
"0.47059375",
"0.46956787",
"0.46693555",
"0.4653796",
"0.4643136",
"0.4643121",
"0.46318394",
"0.4630398",
"0.4604285",
"0.4563... | 0.47752798 | 5 |
Compare bill sponsorship between two members who served in the same Congress and chamber | public function compareTwoMembersBillSponsorships(string $firstMemberId, string $secondMemberId, int $congress, string $chamber)
{
$this->formatValidator->isValidMemberIdFormat($firstMemberId);
$this->formatValidator->isValidMemberIdFormat($secondMemberId);
$this->congressValidator->isValidChamber($chamber);
switch ($chamber) {
case 'senate':
$earliestCongress = 101;
break;
case 'house':
default:
$earliestCongress = 102;
break;
}
$this->congressValidator->isValidCongress($congress, $earliestCongress);
$uriStub = "members/{$firstMemberId}/bills/{$secondMemberId}/{$congress}/{$chamber}.json";
return $this->performApiRequest($uriStub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compare_citations($x, $y)\n{\n\n if( !$x->sources[0]->citation->uuid){// && !$y->sources[0]->citation->uuid){\n $res = -1;\n //var_dump($y->sources[0]->citation->uuid);\n }elseif(!$y->sources[0]->citation->uuid){\n $res = 1;\n //var_dump($x->sources[0]->citation->uuid);\n }\n else{\n\n\n ... | [
"0.5376475",
"0.5031117",
"0.49625513",
"0.49073452",
"0.48976406",
"0.48951378",
"0.48256844",
"0.46761075",
"0.46516463",
"0.46340224",
"0.46296656",
"0.46080282",
"0.4603489",
"0.45780826",
"0.4576223",
"0.4570238",
"0.4570038",
"0.45478666",
"0.45273718",
"0.45207253",
"0... | 0.66868687 | 0 |
Get the 20 most recent bill cosponsorships for a particular member | public function getSpecificMemberCosponsoredBills(string $memberId, string $type)
{
$this->formatValidator->isValidMemberIdFormat($memberId);
$this->billValidator->isValidCosponsoredBillType($type);
$uriStub = "{$memberId}/bills/{$type}.json";
return $this->performApiRequest($uriStub);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMemberContractList() {\n $sql = \"SELECT b.* \n FROM user_contract a INNER JOIN contract b ON a.contract_id = b.id \n WHERE a.user_type = 'member' AND a.uid = ? \n ORDER BY b.id DESC\";\n return getAll($sql, [getLogin()['mid']]);\n}",
"function getAffiliateSpon... | [
"0.56200135",
"0.5617521",
"0.5444341",
"0.5423977",
"0.5405237",
"0.5385923",
"0.5324675",
"0.5312633",
"0.5310244",
"0.5306531",
"0.52872974",
"0.5187799",
"0.51819146",
"0.5179681",
"0.51522",
"0.5122256",
"0.51160336",
"0.50941294",
"0.5080814",
"0.5049103",
"0.50185037",... | 0.4872455 | 29 |
Grab all the users | public function index()
{
$users = User::All();
$iduser = Auth::id();
// Show the page
return View('admin.users.index', compact('users', 'iduser'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllUsers() {\n //Example of the auth class (you have to change the functionality for yourself)\n AuthHandler::needsAuth(array(\n 'auth' => true\n ));\n\n return ModelLoader::getModel('UserData')->getMultipleUsers(array(\n 1, 2, 3\n ... | [
"0.82159644",
"0.81963795",
"0.81963795",
"0.81963795",
"0.819341",
"0.80237275",
"0.7971727",
"0.79622465",
"0.79622465",
"0.7955282",
"0.7949617",
"0.79246294",
"0.78911173",
"0.78825337",
"0.7880041",
"0.78759897",
"0.7863552",
"0.7853774",
"0.78480643",
"0.7844588",
"0.78... | 0.0 | -1 |
Returns the Ip Locker form | public function __construct($name)
{
parent::__construct($name);
$this->add(array(
'name' => 'ip',
'type' => 'Text',
'attributes' => array(
'class' => 'input large',
'id' => 'ip'
)
));
$this->add(array(
'type' => 'Zend\Form\Element\Textarea',
'name' => 'description',
'attributes' => array(
'class' => 'styled_textarea',
'rows' => '7',
'cols' => '40'
)
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ObtenerIp()\n { \n\n return str_replace(\".\",\"\",$this->getIP()); //Funcion que quita los puntos de la IP\n\n }",
"public function getIpAdress(){\n return $this->auth['ip_adress'];\n }",
"public function getIpLockIsDisabled() {}",
"private function ip_lock($token, $... | [
"0.60105306",
"0.5860311",
"0.57311285",
"0.5723498",
"0.57130504",
"0.57081383",
"0.5656677",
"0.56053233",
"0.5602244",
"0.5602244",
"0.5599226",
"0.5583803",
"0.55820405",
"0.5577483",
"0.55456936",
"0.5532191",
"0.5522312",
"0.5497495",
"0.54882723",
"0.5469468",
"0.54447... | 0.0 | -1 |
Cache for how long. | public function overAPeriodOf(string $time): PersisterInterface; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function howLongToCacheInSeconds(){\n return(120); //two minutes by default\n }",
"public function howLongToCacheInSeconds(){\n return(12000); //200 minutes\n }",
"public function howLongToCacheInSeconds(){\n return(1200); //twenty minutes by default\n }",
"protected functio... | [
"0.7718767",
"0.7644094",
"0.7560773",
"0.7219959",
"0.71991587",
"0.7115223",
"0.7071395",
"0.69224864",
"0.69180954",
"0.6858608",
"0.6815398",
"0.680982",
"0.6753738",
"0.6701596",
"0.66249394",
"0.66159534",
"0.66078776",
"0.6607179",
"0.6606004",
"0.6601273",
"0.65983623... | 0.0 | -1 |
Parameters to pass into the method. | public function withParameters(): PersisterInterface; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getParameters()\r\n {\r\n }",
"public function getParameters()\n\t{\n\n\t}",
"public function getParameters()\n\t{\n\n\t}",
"public function parameters();",
"public function parameters();",
"public function getParameters() {}",
"public function get_params()\n {\n }",
"pub... | [
"0.73878",
"0.72067785",
"0.72067785",
"0.7179065",
"0.7179065",
"0.7166118",
"0.71289724",
"0.71289724",
"0.7112083",
"0.70258236",
"0.70258236",
"0.698418",
"0.6923519",
"0.6923519",
"0.6923519",
"0.6923519",
"0.6923519",
"0.6923519",
"0.6923519",
"0.6923519",
"0.6883794",
... | 0.0 | -1 |
Display a listing of the resource. | public function __construct()
{
$this->Customer = new Customer();
$this->Pelanggan = new Pelanggan();
$this->User = new User();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446838",
"0.7361646",
"0.7299749",
"0.7246801",
"0.7163394",
"0.7148201",
"0.71318537",
"0.7104601",
"0.7101873",
"0.709985",
"0.70487136",
"0.69936216",
"0.6988242",
"0.69347453",
"0.68989795",
"0.68988764",
"0.68909055",
"0.68874204",
"0.68650436",
"0.6848891",
"0.68294... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
$customers = Customer::all();
$jenis_langganan = ref_jenis_langganan::all();
return view('pelanggan.create', ['customers' => $customers, 'jenis_langganan' => $jenis_langganan]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.75934863",
"0.75934863",
"0.7587591",
"0.75782615",
"0.75711566",
"0.74992937",
"0.74349296",
"0.7432467",
"0.7387912",
"0.7351958",
"0.73380226",
"0.73111826",
"0.72957826",
"0.72812104",
"0.72734547",
"0.7242778",
"0.72294843",
"0.7225723",
"0.718609",
"0.71780044",
"0.7... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
$request->validate([
'alamat' => 'required',
'Id_kabupaten' => 'required',
'Id_provinsi' => 'required',
'nomor_pelanggan' => 'required',
'nomor_rumah' => 'required',
'Kode_pos' => 'required'
]);
$customer = $this->Customer->detailData($request->id_customer);
$data = [
'Id_customer' => $request->id_customer,
'no_rumah' => $request->nomor_rumah,
'Alamat_titik_langganan' => $request->alamat,
'Id_kabupaten' => $request->Id_kabupaten,
'Id_provinsi' => $request->Id_provinsi,
'Id_jenis_langganan' => $request->Id_jenis_langganan,
'nomor_pelanggan' => $request->nomor_pelanggan,
'Nik' => $customer->Nik,
'created_by' => 'Admin',
'updated_by' => 'Admin',
'Kode_pos' => $request->Kode_pos
];
$this->Pelanggan->addData($data);
return redirect('/admin/pelanggan');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.63424... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
$pelanggan = $this->Pelanggan->detailData($id);
$jenis_langganan = ref_jenis_langganan::all();
$data = [
'pelanggan' => $pelanggan,
'customer' => $this->Customer->detailData($pelanggan->Id_customer),
'jenis_langganan' => $jenis_langganan
];
return view('pelanggan.edit', $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78561044",
"0.7695814",
"0.72755414",
"0.72429216",
"0.71737534",
"0.7064628",
"0.7056257",
"0.69859976",
"0.6949863",
"0.6948435",
"0.6942811",
"0.69298875",
"0.69032556",
"0.6900465",
"0.6900465",
"0.6880163",
"0.6865618",
"0.68620205",
"0.6859499",
"0.6847944",
"0.68375... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
$request->validate([
'alamat' => 'required',
'Id_kabupaten' => 'required',
'Id_provinsi' => 'required',
'nomor_pelanggan' => 'required',
'nomor_rumah' => 'required',
'Kode_pos' => 'required'
]);
$data = [
'no_rumah' => $request->nomor_rumah,
'Alamat_titik_langganan' => $request->alamat,
'Id_kabupaten' => $request->Id_kabupaten,
'Id_provinsi' => $request->Id_provinsi,
'Id_jenis_langganan' => $request->Id_jenis_langganan,
'nomor_pelanggan' => $request->nomor_pelanggan,
'Kode_pos' => $request->Kode_pos
];
$this->Pelanggan->editData($id, $data);
return redirect('/admin/pelanggan');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7423347",
"0.70622426",
"0.70568657",
"0.6896551",
"0.65835553",
"0.64519453",
"0.6348333",
"0.6212436",
"0.61450946",
"0.6122591",
"0.6114199",
"0.6101911",
"0.60876113",
"0.60528636",
"0.60177964",
"0.6006609",
"0.59725446",
"0.594558",
"0.59395295",
"0.5938792",
"0.5893... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
$customer = Pelanggan::where('Id',$id)->delete();
return redirect()->back();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n ... | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897... | 0.0 | -1 |
wrapper for the curl_ functions to make a POST request to the given url with given body. | public static function do_post_request($url, $request_body, $port = false, &$optional_headers = null) {
$ch = curl_init($url);
if ($port !== false) {
curl_setopt($ch, CURLOPT_PORT, $port);
}
curl_setopt($ch, CURLOPT_USERAGENT,
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request_body);
$has_headers = !empty($optional_headers);
curl_setopt($ch, CURLOPT_HEADER, $has_headers);
if ($has_headers) {
$hasCL = false;
foreach ($optional_headers as $index => $header) {
if (substr($header, 0, 15) == 'Content-Length:') {
$hasCL = true;
break;
}
}
if (!$hasCL) {
$cl = strlen($request_body);
$optional_headers[] = "Content-Length: $cl";
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $optional_headers);
}
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
if (false === $result) {
$errno = curl_errno($ch);
$error = curl_error($ch);
static::debugError($url, $optional_headers, $request_body, "$errno: $error");
return 'Erreur :\n' . $error;
}
curl_close($ch);
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function post($url, $body = array(), $query = array(), $headers = array());",
"public function post($url, $body){\n\t\t\n\t\t// do we even need this?\n\t\t// $headers = array('Content-Type: application/x-www-form-urlencoded')\n\t\t\n\t\treturn $this->doRequest('POST', $url, $body);\n }",
"function do... | [
"0.80899096",
"0.7871003",
"0.76686794",
"0.7516226",
"0.74639946",
"0.7203069",
"0.716835",
"0.707107",
"0.7064467",
"0.7041658",
"0.70412344",
"0.69424546",
"0.6933469",
"0.69093966",
"0.6870257",
"0.68594074",
"0.6854093",
"0.68258476",
"0.67878294",
"0.67781204",
"0.67771... | 0.7215433 | 5 |
Method returning list of available datasets | public function getPpDatasets() {
throw new NotSupportedException('MySQL does not support list of datasets!');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDatasetsList() {\n return $this->_get(3);\n }",
"public function getDatasetsList() {\n return $this->_get(1);\n }",
"public function getDatasetsList() {\n return $this->_get(4);\n }",
"function getDataSets()\n {\n if ($this->getResource('wdrs:describedby')... | [
"0.746276",
"0.74213374",
"0.737682",
"0.7341661",
"0.69292605",
"0.6902698",
"0.690156",
"0.6782518",
"0.6723412",
"0.6723412",
"0.64663994",
"0.6343628",
"0.6245609",
"0.6230754",
"0.6222818",
"0.61989164",
"0.6135125",
"0.6118722",
"0.610989",
"0.6104249",
"0.6088492",
"... | 0.7043735 | 4 |
Method returning info about one selected dataset | public function getPpDataset($ppDatasetId) {
return new PpDataset($ppDatasetId, $ppDatasetId, null, PpConnection::TYPE_MYSQL, $this->getRowsCount($ppDatasetId));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function getDataSet();",
"public function dataset()\n {\n return $this->data;\n }",
"public function Individualgetdata();",
"public function getOneDataset()\n\t{\t\n\t\tglobal $ilDB;\n\t\t\n\t\t$data_type = array();\n\t\t$data_value = array();\n\t\t\n\t\t$query = 'SELECT * FRO... | [
"0.64766693",
"0.64530253",
"0.61231613",
"0.60006773",
"0.5907415",
"0.5866788",
"0.58132446",
"0.5737339",
"0.57204473",
"0.56719625",
"0.56719625",
"0.56672966",
"0.5657123",
"0.5657123",
"0.56437755",
"0.56400615",
"0.56350416",
"0.5628495",
"0.5628495",
"0.5601358",
"0.5... | 0.0 | -1 |
Method returning count of rows in a DB table | private function getRowsCount($ppDatasetId) {
$query=$this->db->prepare('SELECT count(*) AS pocet FROM `'.$ppDatasetId.'`;');
$query->execute();
return $query->fetchColumn(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function count(){\n\t\t\t$query = \"SELECT COUNT(*) as total_rows FROM \" . $this->table_name . \"\";\n\t\t\n\t\t\t$stmt = $this->conn->prepare( $query );\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t\treturn $row['total_rows'];\n\t\t}",
"public function getCount() {\n... | [
"0.84036404",
"0.83994806",
"0.8388586",
"0.834689",
"0.8339552",
"0.8281562",
"0.8262859",
"0.81768626",
"0.8140634",
"0.8117222",
"0.81021065",
"0.80970526",
"0.80913913",
"0.80719787",
"0.80555564",
"0.80273324",
"0.80268776",
"0.8016575",
"0.80121446",
"0.79986846",
"0.79... | 0.0 | -1 |
Method returning list of attributes (data columns) in selected dataset | public function getPpAttributes(PpDataset $ppDataset) {
$query=$this->db->prepare('SHOW COLUMNS IN `'.$ppDataset->id.'`;');
$query->execute();
$columns=$query->fetchAll(PDO::FETCH_CLASS);
$result=[];
foreach ($columns as $column){
$result[]=new PpAttribute($column->Field, $ppDataset->id, null, $column->Field, self::encodeDbDataType($column->Type), null);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getColumnsAttribute()\n {\n return $this->fetchData[self::COLUMNS];\n }",
"public function getAttributesNames(){\n\t\t$this->_connect();\n\t\treturn ActiveRecordMetaData::getAttributes($this->_source, $this->_schema);\n\t}",
"public function getData(){\n $values = array()... | [
"0.6912565",
"0.67044073",
"0.66587377",
"0.6645676",
"0.6625465",
"0.6570991",
"0.65597194",
"0.6544039",
"0.65066284",
"0.64955425",
"0.6456338",
"0.6456338",
"0.6456338",
"0.6456338",
"0.6456338",
"0.6456338",
"0.6456338",
"0.6456338",
"0.6456338",
"0.63712233",
"0.6339038... | 0.705272 | 0 |
MySQLDatabase constructor, providing connection to remote database | public function __construct(PpConnection $ppConnection, $apiKey) {
$this->db=new PDO($ppConnection->getPDOConnectionString(),$ppConnection->dbUsername,$ppConnection->dbPassword,array(PDO::MYSQL_ATTR_LOCAL_INFILE => true));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct($db_location, $db_user_name, $db_password, $db_name) { \n \n $this->db = MYSQL_CONNECT ($db_location, $db_user_name, $db_password) or DIE (\"Unable to connect to Database Server\");\n MYSQL_SELECT_DB ($db_name, $this->db) or DIE (\"Could not select database\");\n }",
... | [
"0.6838518",
"0.67073375",
"0.6680107",
"0.6544474",
"0.65043575",
"0.64954954",
"0.648076",
"0.6429608",
"0.6396104",
"0.6391263",
"0.63842636",
"0.63760525",
"0.6361692",
"0.6358571",
"0.63483465",
"0.6346546",
"0.63420737",
"0.63409114",
"0.6316471",
"0.63002074",
"0.62971... | 0.0 | -1 |
Method returning list of available preprocessing types | public static function getSupportedPreprocessingTypes() {
return [Preprocessing::TYPE_EACHONE, Preprocessing::TYPE_EQUIDISTANT_INTERVALS, Preprocessing::TYPE_INTERVAL_ENUMERATION, Preprocessing::TYPE_NOMINAL_ENUMERATION];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_desired_types();",
"function wp_get_ext_types()\n {\n }",
"public static function getTypes();",
"public static function getStandardTypes()\n {\n }",
"public static function get_possible_types()\n {\n }",
"public static function get_possible_types()\n ... | [
"0.6598652",
"0.64527637",
"0.64381003",
"0.64247364",
"0.6379551",
"0.6379551",
"0.6379551",
"0.63713324",
"0.63643444",
"0.63504547",
"0.6295311",
"0.62837964",
"0.6280552",
"0.62575877",
"0.62489337",
"0.62489337",
"0.62489337",
"0.62489337",
"0.62391174",
"0.6199816",
"0.... | 0.7659145 | 0 |
region methods returning identification constants Method returning user understandable name of database | public static function getPpTypeName() {
return self::PP_TYPE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getDatabaseId();",
"public function getDatabaseNameIdentifier()\n {\n return $this->database_name;\n }",
"public function getActualDatabaseName():string;",
"public static function getDatabaseName()\n {\n }",
"public function getDatabaseName(): string;",
"public static ... | [
"0.7820882",
"0.736728",
"0.7245367",
"0.71730876",
"0.6981991",
"0.695359",
"0.69443434",
"0.6872108",
"0.6859525",
"0.67500824",
"0.67409176",
"0.6637565",
"0.6604582",
"0.65959805",
"0.6573506",
"0.65402126",
"0.65140104",
"0.6489426",
"0.6465374",
"0.6452141",
"0.6441247"... | 0.0 | -1 |
Method returning identification of the database type | public static function getPpType() {
return self::PP_TYPE_NAME;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDatabaseType();",
"public function getDatabaseType();",
"private function get_db_type() {\n global $CFG;\n return $CFG->dbtype;\n }",
"public function get_type()\n {\n return self::$_id;\n }",
"function getDbTypeID($connect, $type_name)\n {\n ... | [
"0.8859894",
"0.8859894",
"0.80813485",
"0.7279126",
"0.7276363",
"0.7114309",
"0.7109791",
"0.7109438",
"0.706158",
"0.69906247",
"0.6929009",
"0.68989605",
"0.6890659",
"0.68792826",
"0.68318653",
"0.68197614",
"0.6811902",
"0.6803151",
"0.67689097",
"0.67649794",
"0.676272... | 0.0 | -1 |
endregion methods returning identification constants Method for creating (initializating) a dataset | public function createPpDataset(PpDataset $ppDataset=null, PpTask $ppTask=null) {
throw new NotImplementedException();
// TODO: Implement createPpDataset() method.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function creating(Dataset $dataset)\n {\n }",
"public function createData()\n {\n // TODO: Implement createData() method.\n }",
"private static function createSampleData()\n\t{\n\t\tself::createSampleObject(1, \"Issue 1\", 1);\n\t\tself::createSampleObject(2, \"Issue 2\", 1);\n\t}",
... | [
"0.69908494",
"0.6368192",
"0.6149166",
"0.5988477",
"0.5956643",
"0.5935347",
"0.59341925",
"0.5912515",
"0.5902734",
"0.5884235",
"0.58465856",
"0.58465856",
"0.5720782",
"0.57170105",
"0.56564385",
"0.56128603",
"0.55902535",
"0.55145943",
"0.55025685",
"0.5438796",
"0.542... | 0.53706765 | 25 |
Method for deleting a dataset | public function deletePpDataset(PpDataset $ppDataset) {
throw new NotImplementedException();
// TODO: Implement deletePpDataset() method.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleting(Dataset $dataset)\n {\n //\n }",
"public function destroy(dataset $dataset){\n $dataset->delete();\n return redirect()->route('datasets.index');\n }",
"public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where... | [
"0.86313146",
"0.746939",
"0.70219946",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6909281",
"0.6900952",
"0.6900952",
"0.6796084",
... | 0.7457217 | 2 |
Method for initialization of preprocessing of an attribute | public function createAttributes(array $attributes=null, PpTask $ppTask=null){
// TODO: Implement createAttributes() method.
throw new NotImplementedException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function initAttribute();",
"protected static function pre_processing ($tag, &$attributes) { }",
"protected function _construct()\n\n\t{\n\n\t\t$this->_init('eav_attribute', 'attribute_id');\n\n\t}",
"public function __construct()\n {\n $defaultAttributeSetId = \\Mage::getSingleton('eav/conf... | [
"0.75025964",
"0.6525065",
"0.65008765",
"0.6446009",
"0.6339662",
"0.6003855",
"0.5949957",
"0.58280283",
"0.5827965",
"0.57839036",
"0.5746511",
"0.56921417",
"0.56879693",
"0.5621746",
"0.5614431",
"0.55853873",
"0.5579955",
"0.55498654",
"0.5540262",
"0.5532112",
"0.55283... | 0.0 | -1 |
Method returning values of one selected attribute | public function getPpValues(PpDataset $ppDataset, $ppAttributeId, $offset=0, $limit=1000){
// TODO: Implement getPpValues() method.
throw new NotImplementedException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getValueAttribute() {}",
"public function getValues()\n {\n\n\t\t$record = ProductAttributeValues::whereIn('avid',[1,6])->get();\n\t\t$rec = $record->pluck('pro_att_value');\n\t\treturn $rec;\n }",
"public function getViaTableAttributesValue();",
"function _getTagValueFromAttributeList($... | [
"0.71480864",
"0.67497283",
"0.67299634",
"0.6709054",
"0.6660661",
"0.6660661",
"0.6660661",
"0.6660661",
"0.6660661",
"0.6660661",
"0.6660661",
"0.6660661",
"0.6660661",
"0.6648277",
"0.65965766",
"0.65332997",
"0.6519329",
"0.651205",
"0.6495232",
"0.6490505",
"0.6484266",... | 0.0 | -1 |
Method returning details of one attribute | public function getPpAttribute(PpDataset $ppDataset, $ppAttributeId){
// TODO: Implement getPpAttribute() method.
throw new NotImplementedException();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPropertyDetails(){\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n return $objectManager->get ( 'Apptha\\Airhotels\\Model\\Attributes' );\n }",
"public function getIdentifyingAttribute();",
"public function getAttribute()\n {\n r... | [
"0.7444576",
"0.73922855",
"0.69421256",
"0.69421256",
"0.6921342",
"0.6866154",
"0.6865827",
"0.68637234",
"0.6863235",
"0.6863235",
"0.6863235",
"0.6863235",
"0.6863235",
"0.6863235",
"0.6863235",
"0.6863235",
"0.6863235",
"0.68540484",
"0.6826927",
"0.6809957",
"0.68064153... | 0.0 | -1 |
Send request to api server | public function send(): GetDataFromApiClass; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function request()\n {\n $this->setParams();\n\n $jsondata = json_encode($this->getData(), JSON_UNESCAPED_SLASHES);\n\n if(!$this->is_JSON($jsondata)){\n $this->log(\"Sending parameters must be JSON.\",'Exiting process.');\n $this->error_message('Sending paramet... | [
"0.7310158",
"0.7284167",
"0.72554886",
"0.7125396",
"0.6880223",
"0.68694586",
"0.6865552",
"0.6803222",
"0.67465174",
"0.6673545",
"0.6553301",
"0.6541784",
"0.65238005",
"0.6511811",
"0.64745677",
"0.64745677",
"0.64736086",
"0.64704627",
"0.6463386",
"0.6459888",
"0.64464... | 0.5872654 | 60 |
configuration for curl request | public function curlConfig(): GetDataFromApiClass; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function configureCurl ()\n {\n curl_setopt_array($this->cURL, [\n CURLOPT_URL => $this->url,\n CURLOPT_RETURNTRANSFER => true\n ]);\n }",
"private function init() {\n $this->_cm = curl_init();\n curl_setopt($this->_cm, CURLOPT_PROXY, $config['cu... | [
"0.80188376",
"0.70171314",
"0.6930479",
"0.68231344",
"0.6760573",
"0.6736323",
"0.6723858",
"0.6671174",
"0.66328025",
"0.6618768",
"0.6610453",
"0.6592722",
"0.65157074",
"0.64736676",
"0.6439512",
"0.6437452",
"0.6386511",
"0.6371556",
"0.6344599",
"0.63423115",
"0.633928... | 0.6055862 | 36 |
This part is save houses data from backend | public function saveHousesDataInternal($data) {
$now = date('Y-m-d H:i:s');
$id = intval(@$data['id']);
// 获取旧数据
if ($id > 0) {
$oldInfo = $this->find($id);
if (!$oldInfo) {
return array('code' => -1, 'msg' => '文章不存在');
}
$old_thumbnail = $oldInfo['thumnail'];
} else {
$data['admin_id'] = session('id');
$old_thumbnail = '';
}
// 移动标题图
if ($data['thumnail']) { // 确保从tmp中移动出thumnail
// 如果之前上传过缩略图,删除
if ($old_thumbnail && $data['thumnail'] != $old_thumbnail) {
deleteFile($old_thumbnail);
}
if (false === ($data['thumnail'] = $this->_move_thumbnail($data['thumnail']))) {
return array('code' => -1, 'msg' => '移动缩略图位置失败');
}
}
$data['cdate'] = $now;
$data['mdate'] = $now;
// Generate DSN for current situtation
//$data['dsn'] = $this->gen_house_dsn($data['source'], $data['city']);
$data['dsn'] = $this->gen_house_dsn_new();
// 保存数据
if ($data['id']) {
$lines = $this->save($data, array('id' => $data['id']));
if ($lines !== false) {
$res = true;
}
} else {
$insertId = $this->insertGetId($data);
if ($insertId) {
$data['id'] = $insertId;
$res = true;
}
}
if (!$res) {
return array('code' => -1, 'msg' => $this->getDbError());
}
return array('code' => 0, 'msg' => 'ok', 'data' => $data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveHousesData($data) {\n\t\t$now = date('Y-m-d H:i:s');\n\t\t$data['mdate'] = $now;\n\t\tfile_put_contents('_save_house_model.txt', json_encode($data));\n\t\tif (isset($data['id']) && intval($data['id'] <= 0)) {\n\t\t\tunset($data['id']);\n\t\t}\n\t\tif (!isset($data['id'])) {\n\t\t\t// if (empty(... | [
"0.73458666",
"0.6701009",
"0.66668546",
"0.64166516",
"0.63487613",
"0.63421315",
"0.63403875",
"0.63212645",
"0.6209394",
"0.6168239",
"0.6168239",
"0.6168239",
"0.6168239",
"0.6168239",
"0.61465377",
"0.61465377",
"0.61465377",
"0.61465377",
"0.61465377",
"0.61465377",
"0.... | 0.63754016 | 4 |
This part is save houses data from API | public function saveHousesData($data) {
$now = date('Y-m-d H:i:s');
$data['mdate'] = $now;
file_put_contents('_save_house_model.txt', json_encode($data));
if (isset($data['id']) && intval($data['id'] <= 0)) {
unset($data['id']);
}
if (!isset($data['id'])) {
// if (empty($data['Housesname'])) {
// return ['code' => -1, 'msg' => '请提供用户名'];
// }
// if (empty($data['password'])) {
// return ['code' => -1, 'msg' => '请提供密码'];
// }
// if (self::get(['Housesname' => $data['Housesname']])) {
// return ['code' => -1, 'msg' => '用户名已存在'];
// }
$data['cdate'] = $now;
//添加房源编号new
// $data['dsn'] = $this->gen_house_dsn($data['source'], $data['city']);
$data['dsn'] = $this->gen_house_dsn_new();
$this->data = $data;
//访问频繁
if (cache('add_house_'.$data['user_id'])) {
$left_second = time() - cache('add_house_'.$data['user_id']);
return ['code' => -1, 'msg' => '访问过于频繁,请'.$left_second.'s后再试'];
}
//防并发操作 解决ID重复的问题 #A#
$fp = fopen(RUNTIME_PATH."lock.txt", "w+");
if(flock($fp,LOCK_EX | LOCK_NB))
{
//..处理订单
flock($fp,LOCK_UN);
$result = $this->save();
if ($result) {
cache('add_house_'.$data['user_id'], time(),10);
}
}else{
fclose($fp);
return ['code' => -1, 'msg' => '系统繁忙,请稍后再试'];
}
fclose($fp);
//防并发操作 #A#
if (false === $result) {
return ['code' => -1, 'msg' => '添加数据失败'];
}
$data['id'] = $this->id;
} else {
$data['id'] = intval($data['id']);
if ($data['id'] <= 0) {
return ['code' => -1, 'msg' => 'id 必须大于0'];
}
// if (self::get(['Housesname' => $data['Housesname'], 'id' => ['neq', $data['id']]])) {
// return ['code' => -1, 'msg' => '用户名已存在'];
// }
// if (isset($data['password']) && $data['password'] == '') {
// unset($data['password']);
// }
$result = $this->save($data, ['id' => $data['id']]);
if ($result === false) {
return ['code' => -1, 'msg' => '修改数据失败'];
}
}
//添加房源编号
//$this->set_house_dsn($data['id']);
return ['code' => 0, 'msg' => 'ok', 'data' => $data];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store(Request $request)\n {\n\t\t$request->validate([\n\t\t\t'title' => 'required|max:250',\n\t\t\t'nr_of_rooms' => 'required|integer|min:0',\n\t\t\t'nr_of_beds' => 'required|integer|min:0',\n\t\t\t'nr_of_bathrooms' => 'integer|min:0|nullable',\n\t\t\t'square_mt' => 'integer|min:1|nullable',\n\t... | [
"0.6158201",
"0.61282796",
"0.6126096",
"0.6077741",
"0.6012739",
"0.59959525",
"0.5984435",
"0.59579444",
"0.59231687",
"0.588005",
"0.58591515",
"0.5828687",
"0.5826385",
"0.5815575",
"0.57798016",
"0.5759381",
"0.57567835",
"0.5684596",
"0.56678474",
"0.56493664",
"0.56486... | 0.7213015 | 0 |
// CodeGenrator PHP File class methods // // Get codeblock from source. | protected function _getCodeBlock(&$source, $block, $prefix='/*', $suffix='*/'){
$block = new CodeGeneratorCodeBlockPHP($source, $block, $prefix, $suffix);
if($block->exist()){
return $block;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSourceFile() ;",
"public function getCode()\n {\n if ( $this->isInternal() ) {\n $code = '/* ' . $this->getName() . ' is an internal function.'\n . ' Therefore the source code is not available. */';\n } else {\n $filename = $this->getFileName();... | [
"0.7319558",
"0.7263099",
"0.66822195",
"0.6558869",
"0.6497158",
"0.6475975",
"0.6449538",
"0.63747907",
"0.63373107",
"0.6305515",
"0.62682104",
"0.6260121",
"0.62532854",
"0.6210308",
"0.62098116",
"0.62098116",
"0.62098116",
"0.62098116",
"0.62098116",
"0.62098116",
"0.61... | 0.5701315 | 59 |
Get PHP valid data type for column. | protected function _getColumnDataType(CodeGeneratorColumn $column, $mixed=false){
$type = false;
switch ($column->getType()){
case CodeGeneratorColumn::TYPE_BOOLEAN:
$type = 'bool';
break;
case CodeGeneratorColumn::TYPE_FLOAT:
$type = 'float';
break;
case CodeGeneratorColumn::TYPE_INTEGER:
$type = 'integer';
break;
case CodeGeneratorColumn::TYPE_STRING:
$type = 'string';
break;
default:
if($mixed){
$type = 'mixed';
}
}
return $type;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_datatype() {\n return $this->datatype;\n }",
"public function getDataType(): string\n {\n return $this->col->getAttribute('data-type');\n }",
"public static function data_type() {\n\n\t\treturn 'string';\n\t}",
"public function getDataType()\n {\n return $this->da... | [
"0.70724964",
"0.70270747",
"0.6657593",
"0.65027493",
"0.6470381",
"0.6431656",
"0.6430504",
"0.64113694",
"0.63587874",
"0.6345374",
"0.634257",
"0.6335417",
"0.62989426",
"0.6271382",
"0.6257551",
"0.62444067",
"0.6243017",
"0.62238723",
"0.62238723",
"0.62238723",
"0.6223... | 0.65234345 | 3 |
Print an HTML escaped URI | public function p() {
$args = func_get_args();
print htmlspecialchars(call_user_func_array(array($this, 'get'), $args));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function esc_url_raw($url, $protocols = \\null)\n {\n }",
"public function renderUri();",
"private static function printUri ($url, $encodage) {\n\t\t$uri = '';\n\t\t$separator = '/?';\n\t\t\n\t\tif($encodage == 'html') {\n\t\t\t$and = '&';\n\t\t} else {\n\t\t\t$and = '&';\n\t\t}\n\t\t\n\t\tif (isset ... | [
"0.64130765",
"0.62795436",
"0.6229998",
"0.603219",
"0.5919408",
"0.57777673",
"0.5764219",
"0.5764219",
"0.5762591",
"0.56746805",
"0.56746805",
"0.5664323",
"0.56168866",
"0.55927104",
"0.5562192",
"0.55058396",
"0.5496703",
"0.54831773",
"0.5481119",
"0.54784757",
"0.5477... | 0.0 | -1 |
Print an HTML escaped site URI | public function pSite() {
$args = func_get_args();
print htmlspecialchars(call_user_func_array(array($this, 'getSite'), $args));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function esc_url_raw($url, $protocols = \\null)\n {\n }",
"public function outputUrl()\n\t{\n\t\techo App::e($this->url);\n\t}",
"function esc_url_raw( $url, $protocols = null ) {\n\treturn esc_url( $url, $protocols, 'db' );\n}",
"function well_known_page() {\n $link = 'http://tools.ietf.org/html/rfc5... | [
"0.64860785",
"0.62447315",
"0.6175386",
"0.6158804",
"0.60853946",
"0.60637325",
"0.6036462",
"0.60264903",
"0.60264903",
"0.59406036",
"0.5912904",
"0.59044605",
"0.58468246",
"0.5836722",
"0.57920617",
"0.57813245",
"0.5770052",
"0.5743745",
"0.5743745",
"0.5730215",
"0.57... | 0.5660479 | 23 |
Print a site URI | public function pSiteRaw() {
$args = func_get_args();
print call_user_func_array(array($this, 'getSite'), $args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function outputUrl()\n\t{\n\t\techo App::e($this->url);\n\t}",
"public function dumpUrl()\n {\n print $this->getSession()->getCurrentUrl().\"\\r\\n\";\n\n }",
"public function url(){\r\n\t\techo $_SERVER['SERVER_NAME'].\" => \".$_SERVER['PHP_SELF'];\r\n\t}",
"function print_link($link) {\... | [
"0.67893094",
"0.6783772",
"0.6682064",
"0.661576",
"0.65640384",
"0.6538068",
"0.62810695",
"0.6251396",
"0.62447035",
"0.6219712",
"0.6184435",
"0.61729246",
"0.6130308",
"0.61071634",
"0.60908544",
"0.60890305",
"0.6077486",
"0.60758007",
"0.6074794",
"0.60741687",
"0.6028... | 0.62460786 | 8 |
Get an HTML escaped URI | public function g() {
$args = func_get_args();
return htmlspecialchars(call_user_func_array(array($this, 'get'), $args));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function renderUri();",
"function esc_url_raw($url, $protocols = \\null)\n {\n }",
"function esc_url_raw( $url, $protocols = null ) {\n\treturn esc_url( $url, $protocols, 'db' );\n}",
"public function getURI();",
"protected function escape($value)\n {\n $escaper = $this->getEscaper()... | [
"0.66119343",
"0.649956",
"0.6492189",
"0.6326966",
"0.62508965",
"0.6239864",
"0.6127398",
"0.6045618",
"0.6022748",
"0.6015473",
"0.59565085",
"0.59474427",
"0.5941867",
"0.5938241",
"0.59342647",
"0.5916713",
"0.59066164",
"0.58840084",
"0.5879682",
"0.5871617",
"0.584403"... | 0.0 | -1 |
Get an HTML escaped site URI | public function gSite() {
$args = func_get_args();
return htmlspecialchars(call_user_func_array(array($this, 'getSite'), $args));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function buildCurrentPageURI() {\n $protocol = is_ssl() ? 'https' : 'http';\n $site = $_SERVER['SERVER_NAME'];\n $slug = $_SERVER['REQUEST_URI'];\n\n return urlencode($protocol.'://'.$site.$slug);\n }",
"public function url()\n {\n $scheme = $this->scheme(... | [
"0.66294074",
"0.6608077",
"0.66007423",
"0.6565302",
"0.6556402",
"0.65006626",
"0.6436616",
"0.6412553",
"0.6387606",
"0.63653296",
"0.63499886",
"0.6317341",
"0.6314389",
"0.6299983",
"0.62967896",
"0.6280086",
"0.6267425",
"0.6253248",
"0.6141746",
"0.61181474",
"0.609577... | 0.0 | -1 |
Get a site URI | public function gSiteRaw() {
$args = func_get_args();
return call_user_func_array(array($this, 'getSite'), $args);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function siteURL(): string\n {\n return sprintf(\"%s://%s\", Request::scheme(), Request::host());\n }",
"public function getUrl()\n\t{\n\t\tif ($this->uri !== null)\n\t\t{\n\t\t\treturn UrlHelper::getSiteUrl($this->uri);\n\t\t}\n\t}",
"function url_site(): string\n{\n //return inp... | [
"0.7778082",
"0.7680461",
"0.7558942",
"0.74966085",
"0.74762875",
"0.74698746",
"0.7392462",
"0.73744786",
"0.735821",
"0.734984",
"0.7301719",
"0.7296233",
"0.7296233",
"0.7296233",
"0.7296233",
"0.72959435",
"0.7273374",
"0.7263061",
"0.71794784",
"0.71608114",
"0.71608114... | 0.0 | -1 |
initialized below class definition | public function testApi($api, $params)
{
$this->runApiTests($api, $params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function __init__() { }",
"public function __init(){}",
"final private function __construct(){\r\r\n\t}",
"final private function __construct() {\n\t\t\t}",
"private function __construct()\t{}",
"private function __construct() {\r\n\t\r\n\t}",
"private function __construct(){}",
"private fu... | [
"0.85031796",
"0.82744414",
"0.82071686",
"0.8203828",
"0.8170888",
"0.81261444",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
"0.80482423",
... | 0.0 | -1 |
A project belongs to: user (many) | public function user()
{
return $this->belongsTo('App\User');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function users_in_projects () {\n return $this->hasMany(users_in_projects::class);\n }",
"public function getProjectsUsers()\n {\n return $this->hasMany(ProjectsUsers::class, ['user_id' => 'id']);\n }",
"public function users() {\n\t\treturn $this->belongsToMany('User', 'project_u... | [
"0.70675355",
"0.68541604",
"0.67971194",
"0.6730031",
"0.6712118",
"0.66935295",
"0.66313136",
"0.6551135",
"0.65028954",
"0.6488359",
"0.6477355",
"0.64708185",
"0.6410876",
"0.6405436",
"0.6388012",
"0.6382657",
"0.6371067",
"0.6364542",
"0.63595426",
"0.6338766",
"0.63380... | 0.0 | -1 |
Return the list of Users related to Object | public function users()
{
return $this->belongsToMany("App\User");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_users()\n\t{\n\n\t\trequire_once('modules/Users/User.php');\n\t\t\n\t\t$query = \"SELECT user_id as id FROM roles_users WHERE role_id='$this->id' AND deleted=0\";\n\t\t\n\t\treturn $this->build_related_list($query, new User());\n\t}",
"public function users()\n {\n return $this->morphToMan... | [
"0.70190173",
"0.6994424",
"0.6979404",
"0.6979404",
"0.6979404",
"0.6775906",
"0.6720836",
"0.6704345",
"0.6703602",
"0.66644543",
"0.66623133",
"0.66623133",
"0.6634026",
"0.6587259",
"0.65802366",
"0.6564789",
"0.65572155",
"0.65420026",
"0.6530026",
"0.65281427",
"0.65171... | 0.0 | -1 |
Return the list of Users related to Object referring to owner_id | public function workers()
{
return $this->belongsToMany("App\User")
->where("owner_id", Auth::id());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findByOwner($owner);",
"public function owners()\n {\n return $this->belongsTo('Owner', 'owner_id');\n }",
"public function owner(){\n return $this->belongsTo('App\\Models\\User', 'owner_id');\n }",
"public function owners() {\n return $this->belongsToMany(User::clas... | [
"0.66499436",
"0.6450406",
"0.64240646",
"0.6397755",
"0.6383452",
"0.6383452",
"0.63537866",
"0.6348474",
"0.6348474",
"0.6314939",
"0.62940735",
"0.6287748",
"0.6285946",
"0.6284558",
"0.6258476",
"0.6246058",
"0.6199926",
"0.6192709",
"0.61836094",
"0.61785734",
"0.6159701... | 0.0 | -1 |
Run the database seeds. | public function run()
{
$options = [
[
'name' => 'luanlun',
'title' => '家庭乱伦',
],
[
'name' => 'renqi',
'title' => '人妻交换',
],
[
'name' => 'dushi',
'title' => '都市激情',
],
[
'name' => 'xiaoyuan',
'title' => '校园春色',
],
[
'name' => 'wuxia',
'title' => '武侠古典',
],
[
'name' => 'linglei',
'title' => '另类小说',
],
[
'name' => 'zipai',
'title' => '自拍偷拍',
],
[
'name' => 'yazhou',
'title' => '亚洲色图',
],
[
'name' => 'oumei',
'title' => '欧美色图',
],
[
'name' => 'meitui',
'title' => '美腿丝袜',
],
[
'name' => 'qingchun',
'title' => '清纯唯美',
],
[
'name' => 'katong',
'title' => '卡通动漫'
],
];
foreach($options as $option){
$option['type'] = 'category';
$option['value'] = '';
\App\Model\Option::create($option);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact... | [
"0.80140394",
"0.7980541",
"0.79775697",
"0.79547316",
"0.79514134",
"0.79500794",
"0.79444957",
"0.794259",
"0.79382807",
"0.7937482",
"0.7934376",
"0.7892533",
"0.7881253",
"0.78794724",
"0.7879101",
"0.7875628",
"0.787215",
"0.7870168",
"0.78515327",
"0.7850979",
"0.784195... | 0.0 | -1 |
Run the database seeds. | public function run()
{
DB::table('personas')->insert([
'nombre'=>'Fulanito',
'apellidos'=>'Torrico',
'genero'=>'Masculino',
'fechanacimiento'=>'2020-1-2',
'direccion'=>'Av. Los cachis',
'telefono'=>764543424,
'user_id'=>1,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact... | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.78414... | 0.0 | -1 |
Lists all User models. | public function actionIndex(){
echo 'REST API';
//echo \admin\components\GoogleURLShortner::widget(["url" => "http://www.google.com"]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allUsers()\n {\n $users = $this->user->findAll();\n $this->show('admin/allusers', ['users' => $users]);\n }",
"public function index() {\n $rows = AdminUser::paginate(10);\n return View::make(\"CoreCms::user.listing\")->with(\"models\", $rows);\n }",
"public... | [
"0.75496715",
"0.74824166",
"0.7447048",
"0.7422733",
"0.7371054",
"0.7371054",
"0.7371054",
"0.7371054",
"0.7371054",
"0.7371054",
"0.7371054",
"0.7371054",
"0.7243898",
"0.72151834",
"0.72028935",
"0.71336454",
"0.71035457",
"0.7048071",
"0.70458233",
"0.703646",
"0.7030818... | 0.0 | -1 |
Shows the records in limbo | function show_lost_record($dbc) {
#Create a query to get the id, item name, and status
$query = 'SELECT owner, item_name, create_date FROM stuff WHERE status="lost"' ;
#Execute the query
$results = mysqli_query( $dbc, $query ) ;
check_results($results);
#Show results
if( $results ) {
#Initializes the table before executing the query.
echo '<TABLE border = "1" float="left" cellpadding="5px" cellspacing=5px border = "1">' ;
echo '<TR>' ;
echo '<TH>Owner</TH>' ;
echo '<TH>Item Name</TH>' ;
echo '<TH>Created</TH>' ;
echo '</TR>' ;
#For each row result, generate a table row
while ( $row = mysqli_fetch_array( $results, MYSQLI_ASSOC ) ) {
echo '<TR>' ;
echo '<TD>' . $row['owner'] . '</TD>' ;
echo '<TD>' . $row['item_name'] . '</TD>' ;
echo '<TD>' . $row['create_date'] . '</TD>' ;
echo '</TR>' ;
}
#End the table
echo '</TABLE>' ;
#Free up the results in memory
mysqli_free_result ( $results ) ;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showAllRecordsPage() { \n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-show-all') {\n $access = TRUE;\n break;\n }\n }\n if ... | [
"0.62079084",
"0.6181111",
"0.61596495",
"0.6080475",
"0.60361236",
"0.5978715",
"0.5949737",
"0.5881786",
"0.5851703",
"0.58410895",
"0.58346355",
"0.5826792",
"0.58251965",
"0.5821228",
"0.5820679",
"0.58068216",
"0.5796361",
"0.57798886",
"0.5761892",
"0.57570404",
"0.5746... | 0.0 | -1 |
Shows the records in limbo | function show_found_records($dbc) {
#Create a query to get the id, item name, and status
$query = 'SELECT finder, item_name, create_date FROM stuff WHERE status="found"' ;
#Execute the query
$results = mysqli_query( $dbc, $query ) ;
check_results($results);
#Show results
if( $results ) {
#Initializes the table before executing the query.
echo '<TABLE border = "1" float="left" cellpadding=5px cellspacing=5px border = "1">' ;
echo '<TR>' ;
echo '<TH>Finder</TH>' ;
echo '<TH>Item Name</TH>' ;
echo '<TH>Created</TH>' ;
echo '</TR>' ;
#For each row result, generate a table row
while ( $row = mysqli_fetch_array( $results, MYSQLI_ASSOC ) ) {
echo '<TR>' ;
echo '<TD>' . $row['finder'] . '</TD>' ;
echo '<TD>' . $row['item_name'] . '</TD>' ;
echo '<TD>' . $row['create_date'] . '</TD>' ;
echo '</TR>' ;
}
#End the table
echo '</TABLE>' ;
#Free up the results in memory
mysqli_free_result ( $results ) ;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showAllRecordsPage() { \n \n $permissions = $this->permission();\n $access = FALSE;\n foreach ($permissions as $per) {\n if ($per->permission == 'user-show-all') {\n $access = TRUE;\n break;\n }\n }\n if ... | [
"0.6207694",
"0.6179446",
"0.61589366",
"0.607983",
"0.6037082",
"0.5977527",
"0.59486306",
"0.5880716",
"0.5852229",
"0.5840769",
"0.5834428",
"0.58274543",
"0.5825388",
"0.5821923",
"0.5821362",
"0.580684",
"0.57953393",
"0.5779624",
"0.57602304",
"0.5757486",
"0.57456714",... | 0.0 | -1 |
Create a query to get the name and price sorted by price | function show_all_records($dbc) {
$query = 'SELECT id, item_name, create_date, status FROM stuff' ;
# Execute the query
$results = mysqli_query( $dbc , $query ) ;
check_results($results);
# Show results
if ( $results )
{
# Initializes the table before executing the query
echo '<H1 align="center"></H1>';
echo '<TABLE align="center" cellpadding=5px cellspacing=5px border = "1">';
echo '<TR>';
echo '<TH>ID</TH>' ;
echo '<TH>Item Name</TH>';
echo '<TH>Created</TH>';
echo '<TH>Updated</TH>';
echo '<TH>Status</TH>';
echo '<TH>Update Status</TH>';
echo '<TH>Submit Changes</TH>';
echo '</TR>';
# For each row result, generate a table row
while ( $row = mysqli_fetch_array( $results, MYSQLI_ASSOC ) )
{
echo '<form method = "POST" action = "admin.php">';
echo '<TR>' ;
echo '<TD>' . $row['id'] . '</TD>' ;
$alink = '<A HREF=adminLogInCheck.php?id='. $row['id'] . '>' . $row['item_name'] . '</A>' ;
echo '<TD align="right">' . $alink . '</TD>' ;
echo '<TD>' . $row['create_date'] . '</TD>' ;
echo '<TD>' . $row['status'] . '</TD>' ;
echo '<TD class = "select">
<select name = "Status">
<option value = "lost">Lost</option>
<option value = "found">Found</option>
</select>
</TD>' ;
echo '<TD> <input type = "submit" value = "Submit"> </TD>';
echo '</TR>' ;
echo '</form>';
echo '</TR>' ;
}
# End the table
echo '</TABLE>';
# Free up the results in memory
mysqli_free_result( $results ) ;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_vehicles_by_price() {\n global $db;\n $query = 'SELECT * FROM vehicles\n ORDER BY price DESC';\n $statement = $db->prepare($query);\n $statement->execute();\n $vehicles = $statement->fetchAll();\n $statement->closeCursor();\n return $ve... | [
"0.7209732",
"0.6168381",
"0.6044679",
"0.60036105",
"0.59780574",
"0.59621537",
"0.59010166",
"0.5794474",
"0.57897145",
"0.5743816",
"0.573246",
"0.5726216",
"0.5680039",
"0.56217074",
"0.55058527",
"0.5499792",
"0.54768866",
"0.546463",
"0.54193276",
"0.54191655",
"0.54104... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.