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 a value to the given URL parameter or remove it from the array if null. | protected function setParameter($parameter, $value)
{
if ($value === null) {
if (is_string($parameter)) {
unset($this->params[$parameter]);
} elseif (is_int($parameter)) {
$this->params[$parameter] = null;
}
} else {
$this->params[$parameter] = $value;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setParam($name, $value = null) {\n\t\tif (is_array($name))\n\t\t{\n\t\t\t$this->params = $this->params + (array)$name;\n\n\t\t\t/*foreach ($name as $key => $value) {\n\t\t\t\tif (null === $value) {\n\t\t\t\t\tunset($this->_params[$key]);\n\t\t\t\t}\n\t\t\t}*/\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$name = ... | [
"0.62114054",
"0.611041",
"0.6056248",
"0.5937544",
"0.5906946",
"0.58134925",
"0.5716021",
"0.5703754",
"0.56769025",
"0.563895",
"0.5621342",
"0.5608077",
"0.55519795",
"0.55410105",
"0.55278784",
"0.5520644",
"0.5476593",
"0.5476259",
"0.5418395",
"0.54177326",
"0.5385158"... | 0.0 | -1 |
Save Access Token to a text file | public function saveAccessToken($accessToken)
{
file_put_contents($_SERVER['DOCUMENT_ROOT'].$this->tokenFile, serialize($accessToken));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function WriteTokenFile()\n {\n if ($this->getTokenUsePickupFile()) {\n $fname = $this->getTokenPickupFile();\n $fh = fopen($fname, \"w+\");\n fwrite($fh, $this->_props['RequestToken']);\n fclose($fh);\n }\n }",
"public function saveAccessToken($accessToken);",
"private function sav... | [
"0.773946",
"0.6335817",
"0.6212518",
"0.6045753",
"0.5930729",
"0.58840746",
"0.58693653",
"0.58662856",
"0.58635217",
"0.5844006",
"0.58256173",
"0.5773556",
"0.5768012",
"0.5749106",
"0.57348484",
"0.5732757",
"0.5728807",
"0.57190937",
"0.5716746",
"0.56892526",
"0.563992... | 0.7467016 | 1 |
Rakuten Make Request To API | public function loadAccessToken()
{
$this->setHeader(self::HEADER_TYPE_BASIC, self::TOKEN_HEADER);
$curl = new Curl;
$opt = [
'grant_type' => $this->grant,
'username' => $this->username,
'password' => $this->password,
'scope' => $this->scope
];
$token = $curl->post(self::BASE_API_URL.self::TOKEN_END_POINT, $opt, $this->getHeader());
$this->saveAccessToken($token);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function do_api_request();",
"private function makeRequest()\n {\n $credentials = $this->generateCredentials();\n\n return $this->engine->client->request('POST', $this->endpoint, [\n 'json' => $credentials,\n 'headers' => [\n 'Accept' => 'application... | [
"0.7155004",
"0.7028688",
"0.70044905",
"0.693367",
"0.6869007",
"0.6764205",
"0.6684785",
"0.6520416",
"0.64286214",
"0.63899094",
"0.6375227",
"0.63673073",
"0.63608444",
"0.6314047",
"0.63072467",
"0.63065886",
"0.626219",
"0.6242517",
"0.62314475",
"0.6213064",
"0.6207345... | 0.0 | -1 |
Get Advertisers of Account | public function merchant()
{
$this->setHeader(self::HEADER_TYPE_BEARER);
$link = Rakuten::BASE_API_URL.'/'.self::API_NAME_ADVERTISER_SEARCH.'/'.self::API_VERSION;
$curl = new Curl;
$response = $curl->get($link, '', $this->getHeader());
$xmlData = new SimpleXMLElement(XMLHelper::tidy($response));
return $xmlData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function accounts()\n {\n return $this->get('ach/relationships');\n }",
"public function advertisers()\n {\n return $this->morphedByMany('App\\Advertiser', 'bucketable')\n ->withoutGlobalScope(MarketScope::class)\n ->withTimestamps()\n ->withPivot([\... | [
"0.71827",
"0.71519214",
"0.7147493",
"0.7040499",
"0.6879609",
"0.68372005",
"0.665782",
"0.6645277",
"0.6551947",
"0.6358533",
"0.6328473",
"0.63213766",
"0.62999195",
"0.62586415",
"0.62243843",
"0.62029296",
"0.62016547",
"0.61821",
"0.6152779",
"0.61156726",
"0.61043805"... | 0.0 | -1 |
Allows you to download advertiser information by specifying the Application Status ID for the Application Status that you want to get the List of Merchants for. Application status options: approved approval extended wait temp removed temp rejected perm removed perm rejected self removed | public function merchantByAppStatus($status)
{
$this->setHeader(self::HEADER_TYPE_BEARER);
$this->setLink(self::MERCHANT_BY_APP_STATUS.'/'.$status);
$curl = new Curl;
$response = $curl->get($this->getLink(), '', $this->getHeader());
$xmlData = new SimpleXMLElement(XMLHelper::tidy($response));
return $xmlData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_all_ads($status = \"active\")\t{\n\n\t}",
"public function merchant()\n {\n $this->setHeader(self::HEADER_TYPE_BEARER);\n $link = Rakuten::BASE_API_URL.'/'.self::API_NAME_ADVERTISER_SEARCH.'/'.self::API_VERSION;\n\n\n $curl = new Curl;\n $response = $curl->g... | [
"0.53869826",
"0.5303477",
"0.5282215",
"0.52747905",
"0.5157121",
"0.507684",
"0.5073884",
"0.50166917",
"0.5013608",
"0.48790282",
"0.4876594",
"0.48608246",
"0.48524415",
"0.48471943",
"0.48466998",
"0.48274335",
"0.48246792",
"0.48224527",
"0.48127168",
"0.4798077",
"0.47... | 0.61909103 | 0 |
Allows you to download advertiser information by specifying the advertiser category. These are the same categories that you see when looking for advertisers in the Programs section of the Publisher Dashboard. | public function merchantByCategory($categoryId)
{
$this->setHeader(self::HEADER_TYPE_BEARER);
$this->setLink(self::MERCHANT_BY_CATEGORY.'/'.$categoryId);
$curl = new Curl;
$response = $curl->get($this->getLink(), '', $this->getHeader());
$xmlData = new SimpleXMLElement(XMLHelper::tidy($response));
//@todo Implementation here
return $categoryId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(CampaignCategory $campaignCategory)\n {\n //\n }",
"public function advertizeAction() {\n\t\t// Init variables\n\t\t$result = '';\n\t\t$yaml = new sfYamlParser();\n\n\t\t// Get settings\n\t\t$settings = $this->configurationManager->getConfiguration('Settings');\n\n\t\t$listOfUid... | [
"0.55863905",
"0.52791435",
"0.52148086",
"0.5134982",
"0.50938255",
"0.5067629",
"0.50020754",
"0.48730886",
"0.48519862",
"0.4844543",
"0.48402268",
"0.48386878",
"0.48365232",
"0.48272622",
"0.48049596",
"0.4801484",
"0.47933578",
"0.4792345",
"0.4755609",
"0.47497275",
"0... | 0.46020567 | 70 |
Provides you the available banner links. To obtain specific banner links, you can filter this request using these parameters: MID, Category, Size, Start Date, and End Date. | public function bannerLinks(
$merchantId = -1,
$categoryId = -1,
$startDate = null,
$endDate = null,
$size = -1,
$campaignId = -1,
$page = 1
) {
$startD = (isset($startDate)) ? str_replace('-', '', $startDate) : null;
$endD = (isset($endDate)) ? str_replace('-', '', $endDate) : null;
$this->setParameter(0, $merchantId);
$this->setParameter(1, $categoryId);
$this->setParameter(2, $startD);
$this->setParameter(3, $endD);
$this->setParameter(4, $size);
$this->setParameter(5, $campaignId);
$this->setParameter(6, $page);
$this->setHeader(self::HEADER_TYPE_BEARER);
$this->setLink(self::BANNER_LINKS.'/'.$this->getParameter());
$curl = new Curl;
$response = $curl->get($this->getLink(), '', $this->getHeader());
$xmlData = new SimpleXMLElement(XMLHelper::tidy($response));
return $xmlData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLinksList()\n {\n $sql = 'SELECT bwl.*, bwll.`title`, bwll.`url`\n FROM `'._DB_PREFIX_.'bwcatbanner_link` bwl\n LEFT JOIN `'._DB_PREFIX_.'bwcatbanner_link_lang` bwll\n ON (bwl.`id_item` = bwll.`id_item`)\n WHERE bwl.`id_shop` ... | [
"0.64956653",
"0.60217077",
"0.5885171",
"0.585809",
"0.57196116",
"0.56638443",
"0.56369996",
"0.5607769",
"0.5594403",
"0.5577562",
"0.5576287",
"0.55581164",
"0.5554815",
"0.5552081",
"0.55503386",
"0.5505732",
"0.54941005",
"0.54884547",
"0.5484968",
"0.5431221",
"0.54280... | 0.70739037 | 0 |
Provides you the available advanced reports. To obtain specific reports, you can filter this by add $nid & $mid. | public function advancedReports(
$reportId,
$startDate,
$endDate,
$nid = null,
$mid = null
)
{
$startD = (isset($startDate)) ? str_replace('-', '', $startDate) : null;
$endD = (isset($endDate)) ? str_replace('-', '', $endDate) : null;
$this->setHeader(self::HEADER_TYPE_BEARER);
$this->setParameter(0, 'token='.self::SECURITY_TOKEN);
$this->setParameter(1, 'reportid='.$reportId);
$this->setParameter(2, 'bdate='.$startD);
$this->setParameter(3, 'edate='.$endD);
$params = implode('&', $this->params);
$this->setLink('?'.$params, self::API_NAME_ADVANCED_REPORT);
$curl = new Curl;
$response = $curl->get($this->getLink(), '', $this->getHeader());
$xmlData = new SimpleXMLElement(XMLHelper::tidy($response));
return $xmlData;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function get_reports( $args = array() );",
"function getReport() ;",
"public function getReport() {}",
"public function getReport() {}",
"public function reportListing()\n {\n\t$strsql = \"SELECT r.*,rs.* FROM \" . TBL_REPORTS . \" r inner join \" . TBL_REPORTS_SUBMISSION . \" rs on r.r... | [
"0.57960796",
"0.56453884",
"0.55919605",
"0.55919605",
"0.55478764",
"0.546281",
"0.54500854",
"0.5443246",
"0.54071546",
"0.5309802",
"0.53067887",
"0.53067887",
"0.5281823",
"0.5250932",
"0.52440524",
"0.521269",
"0.5179699",
"0.5157947",
"0.51575637",
"0.51534766",
"0.515... | 0.7193118 | 0 |
to logout the user | function killsession()
{
$_SESSION = array();
$var = session_destroy();
if($var == true)
{
return true;
}
else
{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function logout(){\n $this->_user->logout();\n }",
"public function logout(){\n\t\t$new_token = sha1(TOKEN_SALT.$this->user->email.Utils::generate_random_string());\n\t\t\n\t\t# Create the data array we'll use with the update method\n\t\t$data = Array(\"token\" => $new_token);\n\n\t\t# Do the up... | [
"0.9136542",
"0.86219144",
"0.8608152",
"0.8573457",
"0.855198",
"0.8546323",
"0.853538",
"0.8534508",
"0.8534342",
"0.852702",
"0.8519795",
"0.8512989",
"0.85081226",
"0.8492816",
"0.8492816",
"0.8492816",
"0.8492816",
"0.8492816",
"0.8492816",
"0.8492816",
"0.8492816",
"0... | 0.0 | -1 |
to store the data given by the user's upload file | function storeDictionary($conn, $username)
{
if(htmlentities(isset($_FILES['textfile'])))
{
$user = $username;
$temp_file = htmlentities($_FILES['textfile']['tmp_name']);
$content = file_get_contents($temp_file);
$printed_data = $content;
//split the data and store in an array
$eachLine = explode(',', $printed_data);
array_pop($eachLine);
foreach($eachLine as $product)
{
$item = explode('=', $product);
$eng = htmlentities($conn->real_escape_string($item[0]));
$spa = htmlentities($conn->real_escape_string($item[1]));
$trim_eng = trim($eng);
$trim_spa = trim($spa);
//to check duplicates
$check_if_exists = "SELECT * FROM dictionary WHERE username='$user' AND english='$trim_eng' AND spanish='$trim_spa'";
$check_result = $conn->query($check_if_exists);
if(!$check_result) die("Database access failed:" . $conn->error);
$checkrows = $check_result->num_rows;
//if there's duplicate then continue, else insert the word into the db.
if($checkrows > 0){
continue;
$check_result->close();
$insert_result->close();
}
else{
$insert_dictionary = "INSERT INTO dictionary (username, english, spanish) VALUES ('$user', '$trim_eng', '$trim_spa')" ;
$insert_result = $conn->query($insert_dictionary);
if(!$insert_result) echo "INSERT failed: '$query' <br>" . $conn->error. "<br><br>";
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function store(&$data) {\n\n\t\t// Prepare some info that we need all over\n\t\t$storageFolder = $this->getPropertyDefinition('dirBase');\n\t\t$optionTags = $this->getPropertyDefinition('optionTags');\n\t\t$canDelete = (!isset($optionTags['NODELETEFILE']) && $this->isRequired() === false);\n\t\t$shouldDelete = (KR... | [
"0.67448384",
"0.65130305",
"0.6492715",
"0.64670604",
"0.646397",
"0.64564556",
"0.645306",
"0.6447592",
"0.64202505",
"0.6388606",
"0.63804126",
"0.6358027",
"0.63499415",
"0.630652",
"0.6301165",
"0.628932",
"0.62806135",
"0.6248031",
"0.62107205",
"0.61863667",
"0.6157350... | 0.0 | -1 |
Create instance of Headers object from instance of Environment object | public function create(Environment $environment)
{
return new Headers($this->resolveHeaders($environment->getServer()));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _initHeaders()\n {\n $headers = new DataHolder();\n\n foreach ($_SERVER as $key => $value)\n {\n if (strpos($key, 'HTTP_') === 0)\n {\n $headers->set(substr($key, 5), $value);\n }\n elseif (in_array($key, array('CONTENT_LENGTH', 'CONTENT_TYPE')))\n {\n ... | [
"0.64663017",
"0.61760974",
"0.6117139",
"0.60135657",
"0.5932401",
"0.588565",
"0.5863152",
"0.5843509",
"0.57841384",
"0.5782216",
"0.576597",
"0.5727603",
"0.57211536",
"0.57118666",
"0.5711274",
"0.5647395",
"0.56083405",
"0.56083405",
"0.56082624",
"0.55858845",
"0.55788... | 0.77983695 | 0 |
Resolve headers from provided array | private function resolveHeaders($headersForResolve)
{
$headers = [];
foreach ($headersForResolve as $name => $value) {
if (strpos($name, 'REDIRECT_') === 0) {
$name = substr($name, 9);
// Do not replace existing variables
if (array_key_exists($name, $headersForResolve)) {
continue;
}
}
if (substr($name, 0, 5) == 'HTTP_' || isset($this->specialHeaders[$name])) {
$headers[$name] = $value;
}
}
return $headers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function parseRequestHeaders(array $array)\n {\n $headers = [];\n\n foreach ($array as $header) {\n preg_match('#(.*?)\\:\\s(.*)#', $header, $matches);\n\n if (count($matches) > 2) {\n $headers[$matches[1]] = $matches[2];\n } else {\n ... | [
"0.6966589",
"0.6901316",
"0.65862864",
"0.6415491",
"0.63962",
"0.6395929",
"0.6391153",
"0.63374436",
"0.63296425",
"0.6324967",
"0.6309371",
"0.62840354",
"0.6262256",
"0.62622404",
"0.62206244",
"0.620608",
"0.6195556",
"0.618765",
"0.6167635",
"0.6148596",
"0.61291605",
... | 0.61550534 | 19 |
Get columns from table use Zend_Db_Adapter | public function getColumnsFromTable()
{
return Zend_Db_Table::getDefaultAdapter()->describeTable($this->_tableName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function get_columns($table);",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n {\n }",
"public function get_columns()\n ... | [
"0.7227525",
"0.7048627",
"0.7048627",
"0.7048627",
"0.7048627",
"0.7046267",
"0.7046267",
"0.6980839",
"0.6975782",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6954283",
"0.6910914",
"0.6861104",
"0.6846852",
"0.6839846",
"0.68080914",
... | 0.78532004 | 0 |
Created by PhpStorm. User: jamesskywalker Date: 04/06/2019 Time: 13:23 | function loadDashPage($params) {
$content = '<div class="container">
<div class="jumbotron">
' . $params->views->stats . '
</div>
<div class="jumbotron">
<div class="container">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
' . $params->views->gamesHistoryTable . '
</div>
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
' . $params->views->newGame . '
</div>
</div>
</div>
</div>';
return $content;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __() {\n }",
"final private function __construct(){\r\r\n\t}",
"private function __construct() {\n \n }",
"private function __construct() {\n \n }",
"private function __construct() {\n \n }",
"final private function __construct() { }",
"final pr... | [
"0.5936153",
"0.58457",
"0.58442605",
"0.58442605",
"0.58442605",
"0.58214027",
"0.58214027",
"0.58214027",
"0.5788374",
"0.5762147",
"0.57532597",
"0.5731893",
"0.5731893",
"0.57265383",
"0.5710697",
"0.5708969",
"0.5708969",
"0.5708969",
"0.5708969",
"0.5708969",
"0.5708969... | 0.0 | -1 |
Compare function NOTE: In theory only $object1 has to implement the Comparable interface but as you cannot know in which order the parameters come i.e. from a sorting algorithm, both are checked. Also it is assumed that $object1>compareTo($object2) == (1) $object2>compareTo($object1) otherwise ComparatorTools may not work properly | public function compare($object1, $object2)
{
if (! $object1 instanceof Comparable) {
throw new ComparatorException('$object1 (type: ' . gettype($object1) . ') does not implement the Comparable interface.');
}
if (! $object2 instanceof Comparable) {
throw new ComparatorException('$object2 (type: ' . gettype($object2) . ') does not implement the Comparable interface.');
}
return $object1->compareTo($object2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function comparator($object1, $object2) {\n\t\t\treturn $object1->amount < $object2->amount; \n\t\t}",
"public function compareTo($object) : int;",
"public /*int*/ function compareTo(/*mixed*/ $object)\n\t{\n\t\tif($this->equals($object))\n\t\t\treturn 0;\n\t\treturn -1;\n\t}",
"public function compare(\\mor... | [
"0.7869542",
"0.73873293",
"0.6969621",
"0.6778731",
"0.6716064",
"0.65809304",
"0.6570545",
"0.6551522",
"0.64861166",
"0.6469694",
"0.639923",
"0.6388334",
"0.6379284",
"0.62946475",
"0.6271855",
"0.6217345",
"0.62134933",
"0.62018955",
"0.62018955",
"0.61652607",
"0.611706... | 0.78664535 | 1 |
Returns a callback object that can be used for core functions that take a callback parameter | public static function callback()
{
return new InvokableComparator(new static);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCallback(): ?callable;",
"public function callback();",
"public function get_callback()\n\t{\n\t\treturn $this->callback;\n\t}",
"public function getCallback(): callable\n {\n return $this->callback;\n }",
"abstract protected function registerCallback();",
"public function... | [
"0.73338103",
"0.72637314",
"0.71662605",
"0.7164941",
"0.7083451",
"0.70586765",
"0.68430144",
"0.68430144",
"0.6787865",
"0.67826724",
"0.67263603",
"0.67124546",
"0.67124546",
"0.67124546",
"0.67124546",
"0.666425",
"0.6620192",
"0.659676",
"0.65362495",
"0.65306866",
"0.6... | 0.594912 | 48 |
views the add tax page | public function getCreate(){
return View::make('tax.create');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTax(){\n $data['title'] = \"Add Tax\";\n $this->admin_load('taxes/add_tax',$data); \n }",
"function tax()\n {\n if (($data['logedUser'] = $this->_admin_pages()))\n { \n \n $manufacturer['content'] = Modules::... | [
"0.7639222",
"0.7605617",
"0.6999087",
"0.69834703",
"0.6749255",
"0.6689019",
"0.6656032",
"0.66480654",
"0.66232944",
"0.66072035",
"0.65587837",
"0.65355647",
"0.65151644",
"0.6495827",
"0.6376431",
"0.6360319",
"0.634183",
"0.6336768",
"0.630134",
"0.6203818",
"0.6202338"... | 0.6965068 | 4 |
Views all tax page | public function getIndex(){
return View::make('tax.view')
->with('taxes', Tax::all());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tax()\n {\n if (($data['logedUser'] = $this->_admin_pages()))\n { \n \n $manufacturer['content'] = Modules::run('tax/_index'); \n \n $data['header'] = '';\n $data['titelHeader'] = $this->la... | [
"0.78218234",
"0.7355406",
"0.728078",
"0.7124663",
"0.68532604",
"0.6847306",
"0.6752247",
"0.6699389",
"0.6591184",
"0.6538653",
"0.6415681",
"0.6389581",
"0.6348284",
"0.633121",
"0.6326061",
"0.6318637",
"0.6268577",
"0.626623",
"0.6246067",
"0.6206845",
"0.6176714",
"0... | 0.71366966 | 3 |
views the tax edit page | public function postEdit(){
$tax = Tax::find(Input::get('id') );
return View::make('tax.edit')
->with('id', $tax->id)
->with('name', $tax->name)
->with('rate', $tax->rate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function taxupdate() {\n $arr['page'] = 'taxdetail';\n\t\t$arr['active'] = 'other';\n\t\t$arr['productTax'] = $this->setting->getTax('product');\n\t\t$arr['shippingTax'] = $this->setting->getTax('shipping');\n\t\t$this->load->view('vwSettingTax',$arr);\n\t}",
"function tax()\n {\n ... | [
"0.76382494",
"0.7034002",
"0.70160884",
"0.69389576",
"0.67746663",
"0.66096514",
"0.64846355",
"0.6437889",
"0.6419488",
"0.641871",
"0.63995886",
"0.63995886",
"0.6371156",
"0.6371156",
"0.63658327",
"0.63194865",
"0.6287405",
"0.6282806",
"0.62676173",
"0.62562585",
"0.62... | 0.77472943 | 0 |
protected $status = ''; | public function __construct()
{
$this->project_id = (int) Input::get('project_id');
$this->svn_name = Input::get('svn_name');
$this->version = Input::get('version');
$this->exclude_files = Input::get('exclude_files');
if ($this->version == 0 || $this->version == '')
{
//默认获取svn服务器上的最新版本号
$url = self::SVN_URL . $this->svn_name;
$this->version = exec(
"svn log " . $url .
" --limit 1 | grep -E '^r[0-9]+' | awk '{print $1}'| awk -F 'r' '{print $2}'",
$output, $retun_var);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_status(){\n return $this->status;\n }",
"function getStatus() {\n return $this->status;\n }",
"function get_status() {\n return $this->status;\n }",
"function getStatus()\n {\n return $this->status;\n }",
"public function ge... | [
"0.8174398",
"0.79952323",
"0.79469347",
"0.7875637",
"0.7743889",
"0.7743889",
"0.77277076",
"0.7720363",
"0.7712261",
"0.7708965",
"0.7636758",
"0.7636758",
"0.7631413",
"0.7628813",
"0.7615055",
"0.755501",
"0.7482353",
"0.744988",
"0.7429337",
"0.7418955",
"0.74129766",
... | 0.0 | -1 |
Display a listing of the resource. | public function index() {
try {
$response['divisions'] = Division::all();
$status = 200;
} catch(Exception $e) {
$response = $e->getMessage();
$status = 400;
} finally {
return new JsonResponse($response, $status);
}
} | {
"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.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request) {
try {
$response = Division::create($request->all());
$status = 200;
} catch (Exception $e) {
$response = $e->getMessage();
$status = 400;
} finally {
return new JsonResponse($response, $status);
}
} | {
"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.72855324",
"0.71447515",
"0.7132799",
"0.6641042",
"0.66208744",
"0.6566955",
"0.65249777",
"0.6509032",
"0.6447701",
"0.63756555",
"0.6373163",
"0.63650846",
"0.63650846",
"0.63650846",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.6341676",
"0.63416... | 0.0 | -1 |
Display the specified resource. | public function show(Division $division) {
$response['division'] = $division;
return new JsonResponse($response, 200);
} | {
"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, Division $division) {
try {
$update = $request->all();
foreach($update as $key => $value) {
$division[$key] = $value;
}
$division->save();
$response = $division;
$status = 200;
} catch(Exception $e) {
$response = $e->getMessage();
$status= 400;
} finally {
return new JsonResponse($response, $status);
}
} | {
"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.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(Division $division) {
try {
$division->delete();
$response = null;
$status = 204;
}
catch(Exception $e) {
$response = $e->getMessage();
$status = 400;
}
finally {
return new JsonResponse($response, $status);
}
} | {
"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 |
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 referralSetting()
{
// $users=User::get();
$referralsetting=ReferralSetting::get();
// $referralcontestsetting=ReferralContestSetting::get();
// $loansetting=LoanSetting::get();
return view('admin.referralSetting.index',compact('referralsetting'));
} | {
"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.77850926",
"0.7760142",
"0.7561336",
"0.75147176",
"0.74653697",
"0.7464913",
"0.73652893",
"0.7351646",
"0.7346477",
"0.73420244",
"0.7326711",
"0.7316215",
"0.73072463",
"0.7287626",
"0.72826403",
"0.727347",
"0.727347",
"0.727347",
"0.727347",
"0.7251768",
"0.7251768",
... | 0.0 | -1 |
Get all bundles defined by this model bundle | public static function allBundles(): Collection; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBundles()\n {\n return $this->bundles;\n }",
"public function getBundles() {\n return $this->getConfig(\"bundles\");\n }",
"public function getBundles()\n {\n return array();\n }",
"public function registerBundles()\n {\n return $this->getBundl... | [
"0.7814292",
"0.7424124",
"0.72127044",
"0.70319444",
"0.6873059",
"0.67700356",
"0.65892583",
"0.615498",
"0.6125429",
"0.605545",
"0.60269505",
"0.6019808",
"0.5954503",
"0.5900245",
"0.5826973",
"0.58258647",
"0.5781311",
"0.57634705",
"0.56828266",
"0.5678196",
"0.5676123... | 0.7471644 | 1 |
The entity class this bundle is for | public function entityFor(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEntityClass();",
"public function getEntityClass()\n {\n return $this->entityClass; \n }",
"public function getEntityClass()\n {\n return $this->entityClass;\n }",
"public function getEntityClass() {\n return $this->entityClass;\n }",
"public function g... | [
"0.80206615",
"0.7989663",
"0.7847127",
"0.78364146",
"0.78364146",
"0.76291174",
"0.7542083",
"0.753335",
"0.7489239",
"0.7348995",
"0.7334447",
"0.73098826",
"0.72972155",
"0.729344",
"0.7136348",
"0.7131462",
"0.7117794",
"0.7080874",
"0.70290124",
"0.6986592",
"0.69794405... | 0.0 | -1 |
All entities that have this bundle | public function entities(): Collection; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getEntities() {\n $query = $this->getStorage()->getQuery();\n $keys = $this->entityType->getKeys();\n\n $query->condition($keys['bundle'], $this->bundle)\n ->sort($keys['id']);\n\n $bundle = $this->entityManager->getStorage($this->entityType->getBundleEntityType())\n ->load... | [
"0.73310024",
"0.7017945",
"0.68710697",
"0.6788393",
"0.6788393",
"0.66760916",
"0.6594431",
"0.65435404",
"0.6517737",
"0.64955944",
"0.647714",
"0.64494205",
"0.64123815",
"0.6343859",
"0.63170236",
"0.62991434",
"0.6236171",
"0.6174518",
"0.61400235",
"0.61255884",
"0.611... | 0.62814605 | 16 |
Get the layout class for this bundle | public function fieldLayout(): FieldLayout; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLayout()\n\t{\n\t\t$name = $this->Layout ? $this->Layout : 'Product_Layout_Standard';\n\t\treturn new $name();\n\t}",
"abstract public function getLayoutTemplateClassName();",
"function publisher_get_header_layout_class() {\n\n\t\tstatic $class;\n\n\t\tif ( isset( $class ) ) {\n\t\t\treturn ... | [
"0.70202655",
"0.6969067",
"0.6930699",
"0.6892897",
"0.6885734",
"0.68760455",
"0.686644",
"0.6783848",
"0.6735523",
"0.67191786",
"0.6681724",
"0.66416353",
"0.66416353",
"0.66416353",
"0.6638315",
"0.6634715",
"0.6634715",
"0.6617936",
"0.65777045",
"0.65467197",
"0.654558... | 0.0 | -1 |
Get the field display class for this bundle | public function fieldDisplay(): FieldDisplay; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDisplayField()\n {\n if ($this->_displayField === null) {\n $primary = (array)$this->getPrimaryKey();\n $this->_displayField = array_shift($primary);\n\n $schema = $this->getSchema();\n if ($schema->getColumn('title')) {\n $thi... | [
"0.7019422",
"0.6904135",
"0.6470423",
"0.644021",
"0.6320836",
"0.6303521",
"0.62766826",
"0.6177034",
"0.6162043",
"0.60369563",
"0.59143126",
"0.58731526",
"0.5861107",
"0.5845614",
"0.5826981",
"0.5814791",
"0.5806632",
"0.57954484",
"0.5747851",
"0.57459027",
"0.57432693... | 0.63759977 | 4 |
Create a new event instance. | public function __construct($shop, $metadata = [])
{
$this->shop = $shop;
$this->metadata = $metadata;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createEvent()\n {\n return new Event();\n }",
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = ... | [
"0.8178475",
"0.73455495",
"0.67515916",
"0.6665345",
"0.66544545",
"0.66479546",
"0.6640835",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6543442",
"0.64682955",
"0.645909",
"0.64520663",
"0.6441302",
"0.6438299",
"0.63917476",
"0.6371641",
"0.6371641... | 0.0 | -1 |
Get the channels the event should broadcast on. | public function broadcastOn()
{
return new PrivateChannel('channel-name');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getChannels()\n {\n return $this->channels;\n }",
"public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }",
"public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }",
"public function get... | [
"0.7364031",
"0.73157305",
"0.73157305",
"0.728789",
"0.71595526",
"0.71306884",
"0.7081815",
"0.70280844",
"0.6982028",
"0.69789195",
"0.69637734",
"0.69507897",
"0.69274014",
"0.6869513",
"0.67492",
"0.6735461",
"0.67240244",
"0.6688548",
"0.6659049",
"0.6614447",
"0.653805... | 0.0 | -1 |
Retrieve the currencyName property | public function getCurrencyName()
{
return $this->currencyName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function currencyName()\n {\n \treturn $this->currencyName = Currency::getCurrencyCode($this->sellPrices->CurrencyNo)->CurrencyName;\n }",
"public function getCurrency() : string\n {\n return $this->currency;\n }",
"public function getCurrency() : string\n {\n return $thi... | [
"0.8412517",
"0.7305462",
"0.7305462",
"0.72835076",
"0.72835076",
"0.6910954",
"0.6910597",
"0.69101375",
"0.69101375",
"0.679487",
"0.67792076",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67726",
"0.67703825",
"0.67687756",
"0.67664695... | 0.8499477 | 0 |
Retrieve the currencyCode property | public function getCurrencyCode()
{
return $this->currencyCode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCurrencyCode()\n {\n return $this->_fields['CurrencyCode']['FieldValue'];\n }",
"public function getCurrencyCode() \n {\n return $this->_fields['CurrencyCode']['FieldValue'];\n }",
"public function getCurrencyCode()\n {\n return $this->_currencyCode;\n ... | [
"0.8643299",
"0.86354387",
"0.84310305",
"0.8402414",
"0.8402414",
"0.8402414",
"0.82547116",
"0.8153313",
"0.81021637",
"0.80292046",
"0.79311454",
"0.78772753",
"0.765885",
"0.75992906",
"0.758271",
"0.7559017",
"0.7526303",
"0.74324435",
"0.74324435",
"0.74308074",
"0.7420... | 0.84799874 | 6 |
Retrieve the discount property | public function getDiscount()
{
return $this->discount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDiscount()\r\n {\r\n return $this->discount;\r\n }",
"public function getDiscount()\n\t{\n\t\treturn $this->getKeyValue('Discount'); \n\n\t}",
"public function getDiscount(): int\n {\n return $this->discount;\n }",
"public function getDiscountInvo... | [
"0.79896754",
"0.7841338",
"0.74055165",
"0.74027413",
"0.7321588",
"0.72975737",
"0.72875565",
"0.72236073",
"0.72219896",
"0.72046924",
"0.7162116",
"0.71152353",
"0.7111353",
"0.71105886",
"0.7058027",
"0.6991039",
"0.69812125",
"0.69605565",
"0.69508463",
"0.6922817",
"0.... | 0.7977441 | 5 |
Retrieve the base property | public function getBase()
{
return $this->base;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBase() {\n return $this->base;\n }",
"public function getBase() {\n return $this->base;\n }",
"public function getBase() {\n\t\treturn $this->base;\n\t}",
"public function getBase() {\n\t\treturn $this->base;\n\t}",
"public function getBase() {\n\t\treturn $this->base... | [
"0.729941",
"0.729941",
"0.7256318",
"0.7256318",
"0.7256318",
"0.7256318",
"0.7256318",
"0.72374195",
"0.7206527",
"0.71509206",
"0.6984356",
"0.6984356",
"0.6984356",
"0.68858105",
"0.68435097",
"0.6785851",
"0.6619723",
"0.6601237",
"0.65846527",
"0.64889735",
"0.6462431",... | 0.7299403 | 4 |
Retrieve the base property | public function getValue()
{
return $this->value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBase() {\n return $this->base;\n }",
"public function getBase() {\n return $this->base;\n }",
"public function getBase()\n {\n return $this->base;\n }",
"public function getBase()\n {\n return $this->base;\n }",
"public function getBase()\n ... | [
"0.729941",
"0.729941",
"0.7299403",
"0.7299403",
"0.7299403",
"0.7256318",
"0.7256318",
"0.7256318",
"0.7256318",
"0.7256318",
"0.72374195",
"0.7206527",
"0.71509206",
"0.6984356",
"0.6984356",
"0.6984356",
"0.68858105",
"0.68435097",
"0.6785851",
"0.6619723",
"0.6601237",
... | 0.0 | -1 |
Configuration Form: Save Settings | private function _postProcess()
{
if (Tools::isSubmit('btnSubmit')) {
Configuration::updateValue('MONDIDO_CHECKOUT_MERCHANTID', Tools::getValue('merchant_id'));
Configuration::updateValue('MONDIDO_CHECKOUT_SECRET', Tools::getValue('secret_code'));
Configuration::updateValue('MONDIDO_CHECKOUT_PASSWORD', Tools::getValue('password'));
Configuration::updateValue('MONDIDO_CHECKOUT_TEST_MODE', Tools::getValue('test_mode'));
Configuration::updateValue('MONDIDO_CHECKOUT_ACTIVE', Tools::getValue('is_active'));
}
$this->_html .= '<div class="conf confirm"> ' . $this->l('Settings updated') . '</div>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement ... | [
"0.8579223",
"0.7864438",
"0.77129227",
"0.75914377",
"0.75671697",
"0.7562504",
"0.7553984",
"0.746205",
"0.7448072",
"0.7381766",
"0.7375146",
"0.7370173",
"0.7280842",
"0.72025746",
"0.7160819",
"0.71488124",
"0.7139524",
"0.71130687",
"0.71094084",
"0.7075805",
"0.7033824... | 0.0 | -1 |
Hook: Payment Render payment method in payment methods list | public function hookPayment($params)
{
if (!$this->active) {
return;
}
$this->smarty->assign(array(
'payment_url' => $this->context->link->getModuleLink($this->name, 'checkout', array(),
Tools::usingSecureMode()),
'this_path' => $this->_path,
'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->name . '/',
));
return $this->display(__FILE__, 'payment.tpl');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function display_account_payment_methods( ){\n\t\tif( $this->is_page_visible( \"payment_methods\" ) ){\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/layout/' . get_option( 'ec_option_base_layout' ) . '/ec_account_payment_methods.php' ) )\t\n\t\t\t\tinclude( WP_PLUGIN_DIR . '/wp-easycart-... | [
"0.74459106",
"0.7410864",
"0.71232545",
"0.70911014",
"0.70579696",
"0.70579696",
"0.70546895",
"0.6988752",
"0.67763597",
"0.66885835",
"0.66784054",
"0.6645982",
"0.6528183",
"0.6514302",
"0.6503996",
"0.6502306",
"0.6499516",
"0.6450459",
"0.64264995",
"0.6419287",
"0.640... | 0.5799847 | 92 |
Get an order by its cart id | public function getOrderByCartId($id_cart)
{
$sql = 'SELECT `id_order`
FROM `' . _DB_PREFIX_ . 'orders`
WHERE `id_cart` = ' . (int)($id_cart)
. (_PS_VERSION_ < '1.5' ? '' : Shop::addSqlRestriction());
$result = Db::getInstance()->getRow($sql, false);
return isset($result['id_order']) ? $result['id_order'] : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($cartId);",
"static public function getOrderById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"sales.`order` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n \n return $aItem[0];\n }",
"public function getOrder($id) {\n ... | [
"0.7578764",
"0.71992123",
"0.717771",
"0.7114212",
"0.70521253",
"0.7019818",
"0.691222",
"0.6855303",
"0.6855296",
"0.67590135",
"0.6753686",
"0.6731708",
"0.6729356",
"0.6727092",
"0.6715189",
"0.6682351",
"0.667848",
"0.6677805",
"0.66730183",
"0.66716117",
"0.66622025",
... | 0.62919873 | 39 |
Get URL for Redirect | public function getRedirectUrl($url)
{
return $this->context->link->getModuleLink($this->name, 'redirect', array('goto' => $url),
Tools::usingSecureMode());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl();",
"public function getRedirectUrl(): string;",
"public function getRedirectUrl()\n {\n }",
"public function getRe... | [
"0.8936267",
"0.8936267",
"0.8936267",
"0.8936267",
"0.8936267",
"0.8646268",
"0.84654593",
"0.82455164",
"0.82455164",
"0.82384086",
"0.823203",
"0.82047397",
"0.8165673",
"0.81578547",
"0.8140219",
"0.81255764",
"0.81108624",
"0.8102142",
"0.80761844",
"0.80761844",
"0.8025... | 0.6804969 | 84 |
Place Order with Custom Checkout | public function placeOrder($id_cart, $status, $transaction_data)
{
$cart = new Cart($id_cart);
$payment_details = $transaction_data['payment_details'];
$email = $payment_details['email'];
$first_name = $payment_details['first_name'];
$last_name = $payment_details['last_name'];
$address_1 = $payment_details['address_1'];
$address_2 = $payment_details['address_2'];
$city = $payment_details['city'];
$postcode = $payment_details['zip'];
$country_code = (new League\ISO3166\ISO3166)->alpha3($payment_details['country_code'])['alpha2'];
$phone = $payment_details['phone'];
// Get Customer
if ($cart->id_customer > 0) {
$customer = new Customer($cart->id_customer);
} else {
// Check Customer by E-Mail
$id_customer = (int)Customer::customerExists($email, true, true);
if ($id_customer > 0) {
$customer = new Customer($id_customer);
} else {
// Create Customer
$password = Tools::passwdGen(8);
$customer = new Customer();
$customer->firstname = $first_name;
$customer->lastname = $last_name;
$customer->email = $email;
$customer->passwd = Tools::encrypt($password);
$customer->is_guest = 0;
$customer->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP', null, $cart->id_shop);
$customer->newsletter = 1;
$customer->optin = 0;
$customer->active = 1;
$customer->id_gender = 9;
$customer->add();
$this->sendConfirmationMail($customer, $cart->id_lang, $password);
}
}
// Check existing address
$id_country = (string)Country::getByIso($country_code);
foreach ($customer->getAddresses($cart->id_lang) as $address) {
if ($address['firstname'] === $first_name
&& $address['lastname'] === $last_name
&& $address['city'] === $city
&& $address['address1'] === $address_1
&& $address['address2'] === $address_2
&& $address['postcode'] === $postcode
&& $address['phone_mobile'] === $phone
&& $address['id_country'] === $id_country) {
// Set Address
$cart->id_address_invoice = $address['id_address'];
$cart->id_address_delivery = $address['id_address'];
break;
}
}
// Save Address if don't exists
if (!$cart->id_address_invoice) {
$address = new Address();
$address->firstname = $first_name;
$address->lastname = $last_name;
$address->address1 = $address_1;
$address->address2 = $address_2;
$address->postcode = $postcode;
$address->phone_mobile = $phone;
$address->city = $city;
$address->id_country = $id_country;
$address->id_customer = $customer->id;
$address->alias = $this->l('My address');
$address->add();
// Set Address
$cart->id_address_invoice = $address->id;
$cart->id_address_delivery = $address->id;
}
// Update cart
$cart->getPackageList(true);
$cart->getDeliveryOptionList(null, true);
$cart->id_customer = $customer->id;
$cart->secure_key = $customer->secure_key;
$cart->delivery_option = '';
$cart->save();
$cart = new Cart($cart->id);
$this->validateOrder(
$cart->id,
$status,
$cart->getOrderTotal(true, 3),
$this->displayName,
null,
array(),
$cart->id_currency,
false,
$customer->secure_key
);
return $this->currentOrder;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function customcheckout($userid,$email,$name,$street,$city,$country_id,$postcode,$telephone,$shipping,$payment,$quoteId)\n\t {\n\t\t/* $parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\tif($lastname=='')\n\t\t{\n\t\t\t$lastname='@';\n\t\t}\n $firstname = implode(\" \", $parts)... | [
"0.71236956",
"0.70294875",
"0.6991281",
"0.6849258",
"0.66342485",
"0.6588023",
"0.6585187",
"0.6568522",
"0.65447295",
"0.6419774",
"0.6392548",
"0.6386586",
"0.63590527",
"0.6308668",
"0.63011426",
"0.6278019",
"0.6258966",
"0.62468094",
"0.6238467",
"0.6223669",
"0.622324... | 0.64667463 | 9 |
Handle the remove issue command. | public function handle(RemoveIssueCommand $command)
{
$issue = $command->issue;
event(new IssueWasRemovedEvent($issue));
$issue->delete();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteIssue($args, $request) {\n\t\t$issueId = (int) $request->getUserVar('issueId');\n\t\t$journal = $request->getJournal();\n\t\t$issueDao = DAORegistry::getDAO('IssueDAO');\n\t\t$issue = $issueDao->getById($issueId, $journal->getId());\n\t\tif (!$issue) fatalError('Invalid issue ID!');\n\n\t\t$isBackIs... | [
"0.63412756",
"0.6070603",
"0.60372996",
"0.5984083",
"0.5983521",
"0.59507513",
"0.59356076",
"0.59081984",
"0.5843781",
"0.5820493",
"0.58113396",
"0.58065546",
"0.57392687",
"0.57363456",
"0.57363456",
"0.57363456",
"0.5726919",
"0.56949914",
"0.56949914",
"0.56949914",
"0... | 0.7258914 | 0 |
IL EST PAS POSSIBLE DE METTRE LA RECUPERATION DE LA LISTE ICI CAR UNE SESSION EST DEJA STARTED! ==================|TROUVER UN COMPTE PAR SON NUM|================== | function findAccountByNum($numero){
$sql = "SELECT * FROM compte WHERE numero='$numero'";
global $db;
return $db->query($sql)->fetch();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function evt__1__entrada()\r\n\t{\r\n\t\t$this->pasadas_por_solapa[1]++;\r\n\t}",
"public function InscribirSoporteEstado($numInsercion,$lin_inf, $conexion,$idTablaGeneral) { \n header(\"Content-Type: text/html;charset=utf-8\"); \n $IdUsuario = $_SESSION['idUsuario']; \n $registro = explod... | [
"0.6448443",
"0.58655244",
"0.57688165",
"0.57363504",
"0.56996715",
"0.56863695",
"0.5668509",
"0.5668442",
"0.5636443",
"0.5619218",
"0.5578589",
"0.55767006",
"0.5574262",
"0.557132",
"0.55558145",
"0.55531645",
"0.55505306",
"0.5545309",
"0.55382043",
"0.55274636",
"0.552... | 0.0 | -1 |
create new toplevel menu | function most_recent_posts_create_menu()
{
add_menu_page('MRP Overview', 'Most Recent Posts', 'administrator', 'MostRecentPostsSettings', 'MRPOverview', 'http://buildautomate.com/favicon.ico');
add_submenu_page('MostRecentPostsSettings', 'Shortcode', 'Shortcode', 'administrator', 'MRPShortcodes', 'MRPShortcodes');
add_submenu_page('MostRecentPostsSettings', 'Registration', 'Registration', 'administrator', 'MRPRegistration', 'MRPRegistration');
add_submenu_page('MostRecentPostsSettings', 'Tech Support', 'Tech Support', 'administrator', 'MRPTechSupport', 'MRPTechSupport');
add_submenu_page('MostRecentPostsSettings', 'Help', 'Help', 'administrator', 'MRPHelp', 'MRPHelp');
//call register settings function
add_action( 'admin_init', 'MRPregister_mysettings' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function makeMenu() {}",
"public function menu( )\n {\n\n if( $this->view->isType( View::SUBWINDOW ) )\n {\n $view = $this->view->newWindow('WebfrapMainMenu', 'Default');\n }\n else if( $this->view->isType( View::MAINTAB ) )\n {\n $view = $this->view->newMaintab('WebfrapMainMenu... | [
"0.75886714",
"0.7500422",
"0.7424531",
"0.7304863",
"0.7302838",
"0.7302838",
"0.7302838",
"0.7302838",
"0.7302838",
"0.7302838",
"0.72914034",
"0.72550994",
"0.7146139",
"0.7123995",
"0.6970596",
"0.6812264",
"0.6773524",
"0.67689735",
"0.6760772",
"0.67488354",
"0.67472106... | 0.0 | -1 |
register Most Recent Posts settings | function MRPregister_mysettings() {
register_setting( 'most-recent-posts-settings-group', 'most_recent_posts_css' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function register_block_core_latest_posts()\n {\n }",
"function control() {\r\n $options = get_option('ace_widget_recent_posts');\r\n \r\n if ( !is_array($options) )\r\n $options = array('title'=>'',\r\n\t\t 'count' => $this->count,\r\n\t\t 'hierarchical' => $this->hierarchical,... | [
"0.6793125",
"0.6424826",
"0.63540393",
"0.6281458",
"0.62611973",
"0.62170917",
"0.6200792",
"0.61863565",
"0.61093587",
"0.60802186",
"0.60503894",
"0.6026789",
"0.59676224",
"0.59476745",
"0.5885122",
"0.58757824",
"0.5873912",
"0.5816651",
"0.5815992",
"0.58115077",
"0.58... | 0.68615973 | 0 |
Display a listing of the resource. | public function index()
{
$servicios = Servicio::all();
$departamentos = Departamento::all();
$idItems = [];
return view('servicio.servicio',['servicios' => $servicios, 'departamentos'=>$departamentos, 'items'=>$idItems]);
} | {
"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.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Show the form for creating a new resource. | public function create(Request $request)
{
$solicitud = $request->except('_token', 'email','user');
$this->store($request, $solicitud);
Mail::to($request->email)->send(new EmailServicio($request));
return redirect()->route('servicio.index')->with('status','Se ha enviado la solicitud');
} | {
"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.7594622",
"0.7594622",
"0.7588457",
"0.7580005",
"0.75723624",
"0.7499764",
"0.7436887",
"0.74322647",
"0.7387517",
"0.735172",
"0.73381543",
"0.73117113",
"0.72958225",
"0.7280436",
"0.7273787",
"0.72433424",
"0.7230227",
"0.7225085",
"0.71851814",
"0.71781176",
"0.717402... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request, Array $solicitud )
{
$tipo = $request->except('_token','user','deps','servs','observacion','email');
$tipoStr = "";
foreach ($tipo as $value) {
if($value!= null){
$tipoStr .= ' '. str_replace( '_' , ' ' , key($tipo)).','.' ';
}
next($tipo);
}
$solicitudServicio = new SolicitudServicio();
$solicitudServicio->user_id = $request->user;
$solicitudServicio->departamento = $solicitud['deps'];
$solicitudServicio->servicios = $solicitud['servs'];
$solicitudServicio->tiposerv = $tipoStr;
$solicitudServicio->observaciones = $request->observacion;
$solicitudServicio->status = 0;
$solicitudServicio->save();
} | {
"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.7285922",
"0.714503",
"0.71324795",
"0.6639801",
"0.6620405",
"0.6568167",
"0.65257645",
"0.650948",
"0.64484984",
"0.6375281",
"0.6373189",
"0.63650924",
"0.63650924",
"0.63650924",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",... | 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)
{
//
} | {
"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.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
//
} | {
"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.7424578",
"0.7062392",
"0.7056844",
"0.6897447",
"0.65815884",
"0.6451359",
"0.634689",
"0.62107086",
"0.6145251",
"0.6121901",
"0.6115076",
"0.61009926",
"0.60885817",
"0.6053816",
"0.6018965",
"0.6007763",
"0.5973282",
"0.59455335",
"0.593951",
"0.59388787",
"0.5892445",... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"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 |
Responds to methods such as converEurToRon($amount), which is translated to convert(1, 'EUR', 'RON'); | public function __call($method, $args)
{
$currencies = $this->extractCurrenciesFrom($method);
return $this->convert($args[0], $currencies[0], $currencies[1]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function convert($amount, Currency $currency);",
"function convertir($devisefrom, $montant)\n\n//verifie sie le montant est numerique sinon il me faut un nombre\n\n{\n\n if(!is_numeric(($montant))) return 'il me faut un nombre';\n if($devisefrom = \"EUR\"){\n $total=$montant*1.15023; //1 EUR =1,15023US... | [
"0.6376113",
"0.6015519",
"0.5948061",
"0.5915423",
"0.5866576",
"0.5824682",
"0.5818584",
"0.5641872",
"0.56192553",
"0.557936",
"0.5528508",
"0.5499438",
"0.5491809",
"0.5453955",
"0.5451526",
"0.5445158",
"0.5407453",
"0.5381026",
"0.536979",
"0.53556776",
"0.5346051",
"... | 0.4912208 | 62 |
Returns whether $code appears in the OrigCurrency element of the XML. | public function isOriginalCurrency($code)
{
return $this->getOriginalCurrency() === strtoupper($code);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isInISO($code) {\n $xml = simplexml_load_file('http://www.currency-iso.org/dam/downloads/lists/list_one.xml');\n $result = $xml -> xpath(\"//CcyNtry[Ccy='{$code}']\");\n if($result != null) {\n return true;\n } else {\n return false;\n }\n }",
"public function has($code) {\n\t... | [
"0.7249582",
"0.6548625",
"0.63530695",
"0.616148",
"0.613512",
"0.581938",
"0.581938",
"0.5816914",
"0.5813855",
"0.580396",
"0.5651243",
"0.56309867",
"0.56309867",
"0.55289704",
"0.55249566",
"0.55030996",
"0.5494372",
"0.5493275",
"0.5476785",
"0.54743254",
"0.5421173",
... | 0.7188052 | 1 |
Get the stub file for the generator. | public function getPublishedStubFileName(): ?string
{
return 'console.stub';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStubFile(): string\n {\n return $this->getStubFileFromPresetStorage($this->preset, 'seeder.stub');\n }",
"protected function getStub()\n {\n return $this->files->get($this->getStubPath().'/default.stub');\n }",
"public function getStubFile(): string\n {\n ... | [
"0.83579874",
"0.81962",
"0.81657106",
"0.81294554",
"0.8034034",
"0.8003708",
"0.7957607",
"0.7940772",
"0.791021",
"0.78739566",
"0.7869222",
"0.78581053",
"0.78546983",
"0.78499",
"0.7845703",
"0.78435755",
"0.7828027",
"0.78246325",
"0.7816588",
"0.78110945",
"0.77891546"... | 0.0 | -1 |
Get the stub file for the generator. | public function getStubFile(): string
{
return $this->getStubFileFromPresetStorage($this->preset, 'console.stub');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStubFile(): string\n {\n return $this->getStubFileFromPresetStorage($this->preset, 'seeder.stub');\n }",
"protected function getStub()\n {\n return $this->files->get($this->getStubPath().'/default.stub');\n }",
"protected function getStub()\n {\n if ($this... | [
"0.83587843",
"0.8197345",
"0.8130298",
"0.8035397",
"0.8004965",
"0.79579943",
"0.7941812",
"0.79107773",
"0.7874845",
"0.78700566",
"0.78591037",
"0.7855985",
"0.7850807",
"0.7846723",
"0.7844069",
"0.7829329",
"0.7825565",
"0.7817247",
"0.78118134",
"0.7790396",
"0.7787586... | 0.8166353 | 2 |
Get the default namespace for the class. | public function getDefaultNamespace(string $rootNamespace): string
{
return $this->preset->config('console.namespace', $rootNamespace.'\Console\Commands');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDefaultNamespace()\n\t{\n\t\treturn $this->default_namespace;\n\t}",
"public function getDefaultNamespace();",
"abstract public function getDefaultNameSpace();",
"public function getNamespace()\n {\n return $this->getAttribute('metadata.namespace', 'default');\n }",
"public ... | [
"0.8448936",
"0.821764",
"0.7800281",
"0.74542356",
"0.74156207",
"0.7397914",
"0.7362119",
"0.7336174",
"0.72904134",
"0.7272925",
"0.723129",
"0.72085345",
"0.7196747",
"0.7127158",
"0.7018227",
"0.7012884",
"0.69916",
"0.6979542",
"0.69777244",
"0.6956813",
"0.6936764",
... | 0.0 | -1 |
Get the console command options. | protected function getOptions()
{
return [
['command', null, InputOption::VALUE_OPTIONAL, 'The terminal command that should be assigned', 'command:name'],
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getOptions() {\n return [\n ['env', null, InputOption::VALUE_OPTIONAL, 'The environment the command should run under.', null],\n ];\n }",
"protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t['testMode', null, InputOption::VALUE_OPTIONAL, 'Runs the command in ... | [
"0.7800682",
"0.751765",
"0.7345173",
"0.73404354",
"0.7306238",
"0.72790045",
"0.7268271",
"0.7237944",
"0.71917665",
"0.715652",
"0.7155546",
"0.7137",
"0.71122515",
"0.710945",
"0.710945",
"0.710945",
"0.710945",
"0.710945",
"0.710945",
"0.710945",
"0.710945",
"0.710945"... | 0.77591324 | 1 |
Used to get a specific field from the given resource | public function __get($field)
{
$this->checkForNecessaryProperties();
$unmodifiedField = lcfirst(str_replace('unmodified', '', $field));
if (!array_key_exists($unmodifiedField, $this->data)) {
return NULL;
}
$attributeMutator = 'get' . str_replace('_', '', ucwords($field, '_')) . 'Attribute';
return (method_exists($this, $attributeMutator)) ? call_user_func([$this, $attributeMutator]) : $this->data[$unmodifiedField];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($field);",
"public function get($field);",
"public function getField($field_name);",
"public function get_field(/* .... */)\n {\n return $this->_field;\n }",
"public function fetchField();",
"public abstract function FetchField();",
"public function getField($fieldName)... | [
"0.7451867",
"0.7451867",
"0.688825",
"0.6779977",
"0.67769057",
"0.6753417",
"0.672195",
"0.66417986",
"0.6611796",
"0.6611796",
"0.6611796",
"0.658248",
"0.6569627",
"0.6519403",
"0.64878833",
"0.6483047",
"0.64712405",
"0.6429632",
"0.6422956",
"0.6401098",
"0.6377754",
... | 0.0 | -1 |
Used to set the value of a specific field on the given resource | public function __set($field, $value)
{
$this->checkForNecessaryProperties();
$this->data[$field] = $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setField($field);",
"public function setField($field);",
"public function set($field, $value);",
"public function set($field, $value);",
"public function setField(string $name, $value);",
"public function setField($name, $value);",
"public function setField(string $name, Field $field);"... | [
"0.6949564",
"0.6949564",
"0.68256503",
"0.68256503",
"0.67060316",
"0.66779286",
"0.65512824",
"0.654686",
"0.6498879",
"0.64150304",
"0.6380653",
"0.636792",
"0.63626605",
"0.632807",
"0.62765604",
"0.6271844",
"0.62673426",
"0.6231689",
"0.62130666",
"0.6188793",
"0.618879... | 0.58239037 | 45 |
Get a specific attribute, without going through any mutators or anything Pretty sure this needs to move to the redis DataAccessor | protected function getAttribute($field)
{
$this->checkForNecessaryProperties();
if (!array_key_exists($field, $this->data)) {
return NULL;
}
return $this->data[$field];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($attribute);",
"public function __GET($attr){\n\n\t\t return $this->$attr;\n\t\t}",
"public function __get($attr)\n {\n return $this->get($attr);\n }",
"public function readAttribute($attribute) {}",
"public function get($attr = null);",
"public function __get($attribute)... | [
"0.7299429",
"0.72725564",
"0.72151935",
"0.7154686",
"0.7076308",
"0.7042904",
"0.6980929",
"0.6896698",
"0.68681735",
"0.6858955",
"0.6852786",
"0.6793147",
"0.6772377",
"0.676507",
"0.6730527",
"0.67199904",
"0.66563606",
"0.65841144",
"0.6548909",
"0.6543471",
"0.6496219"... | 0.0 | -1 |
Returns an array of the resource | public function toArray() {
return $this->data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function asArray() {\n return $this->resource;\n }",
"public function getResources(): array\n {\n return $this->resources;\n }",
"public function getResourceList()\n {\n $data = array();\n $resources = Kronolith::getDriver('Resource')\n ->listResources(... | [
"0.83271515",
"0.7425478",
"0.7247038",
"0.72019887",
"0.71968246",
"0.7153598",
"0.71276134",
"0.7121748",
"0.7120227",
"0.7120227",
"0.70948935",
"0.7045174",
"0.70270306",
"0.69635355",
"0.69635355",
"0.69635355",
"0.69635355",
"0.69323194",
"0.68830174",
"0.68733656",
"0.... | 0.0 | -1 |
Used to save the current collection to the database | public function save()
{
$this->checkForNecessaryProperties();
$this->update($this->getCurrentId(), $this->data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save() {\n\t\treturn $this->data->save($this->collection);\n\t}",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\n }",
"public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}",
"protected function _saveDataCollect... | [
"0.7597874",
"0.7251458",
"0.72219443",
"0.703184",
"0.67488813",
"0.6709139",
"0.6685542",
"0.66612136",
"0.66339",
"0.6584866",
"0.6580554",
"0.65257657",
"0.6486657",
"0.648089",
"0.64617735",
"0.64617735",
"0.64596343",
"0.6457748",
"0.64504576",
"0.6444681",
"0.6418968",... | 0.65957457 | 9 |
Get the ID of the current collection | protected function getCurrentId()
{
return (array_key_exists($this->idfieldName(), $this->data)) ? $this->data[$this->idfieldName()] : NULL;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function id()\n\t{\n\t\t// @todo: _id should not be hard-coded (mongo-specific)\n\t\treturn $this->get('_id');\n\t}",
"public function getCollectionId()\n {\n @list($collectionId) = explode('/', $this->_id, 2);\n\n return $collectionId;\n }",
"public function getCollectionId() : ?str... | [
"0.8163485",
"0.8107526",
"0.789086",
"0.7690199",
"0.74105793",
"0.6962001",
"0.6933297",
"0.6932041",
"0.69179386",
"0.6910203",
"0.68992364",
"0.68992364",
"0.68992364",
"0.6885321",
"0.6885321",
"0.6885321",
"0.6885321",
"0.6885321",
"0.6885321",
"0.6885321",
"0.6885321",... | 0.6681967 | 95 |
Makes sure all the necessary properties have been set | protected function checkForNecessaryProperties()
{
if (!property_exists($this, 'data')) {
throw new IncompatibleParentClass('Parent class must implement $data property.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setUp()\n {\n $this->object = new Properties();\n }",
"protected function checkUnsetProperties()\r\n {\r\n $ar = get_object_vars($this);\r\n if (self::$DEBUG)\r\n {\r\n //echo \"Object Vars:\" .PHP_EOL;\r\n // var_dump... | [
"0.7337592",
"0.73021376",
"0.7079115",
"0.6696277",
"0.6674233",
"0.65453094",
"0.65222734",
"0.650841",
"0.6505057",
"0.64860314",
"0.6483153",
"0.64678365",
"0.6444622",
"0.6440914",
"0.6369585",
"0.63344264",
"0.6298931",
"0.6295469",
"0.62934005",
"0.62934005",
"0.629340... | 0.61426175 | 41 |
Allows you to use the given resource object as a string | public function __toString()
{
return json_encode($this->toArray());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function resource($resource);",
"abstract protected function setResource(): String;",
"static function resource($resource) {\n\t\treturn self::_getLoader()->resource($resource);\n\t}",
"public function get_resource() : string\n {\n return $this->resource;\n }",
"private functio... | [
"0.6700844",
"0.66519636",
"0.65745884",
"0.63703895",
"0.6201882",
"0.6151534",
"0.6103719",
"0.6095307",
"0.6050964",
"0.6040408",
"0.59928054",
"0.5970651",
"0.5935587",
"0.5935587",
"0.5933866",
"0.5806013",
"0.57470834",
"0.57396144",
"0.5728721",
"0.56865364",
"0.568094... | 0.0 | -1 |
Check if $withoutAppends is enabled. | protected function getArrayableAppends()
{
if(self::$withoutAppends){
return [];
}
return parent::getArrayableAppends();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isAppendingEnabled() {\n\t\treturn $this->append;\n\t}",
"public function getAllowMissingDependencies() : bool\n {\n return $this->allowMissingDependencies;\n }",
"function spr_section_exclude_installed() {\n\treturn(spr_exclude_column_found('spr_exclude'));\n}",
"public function... | [
"0.706743",
"0.58802897",
"0.5844586",
"0.58172446",
"0.58103573",
"0.58025587",
"0.5772933",
"0.57648057",
"0.5725931",
"0.57000977",
"0.57000977",
"0.57000977",
"0.56954837",
"0.56892496",
"0.5642585",
"0.55994236",
"0.55978286",
"0.556866",
"0.55247325",
"0.55178916",
"0.5... | 0.5473556 | 24 |
Returns the current element | public function current()
{
return parent::current();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function current() {\n return $this->currentElem;\n }",
"public function current()\n {\n return current($this->_elements);\n }",
"public function current()\n {\n return current($this->elements);\n }",
"public function current()\n\t{\n\t\t$name = $this->_elementNames... | [
"0.86909854",
"0.8645059",
"0.8608747",
"0.8550592",
"0.8512021",
"0.8469719",
"0.84475064",
"0.8440921",
"0.84304065",
"0.8420024",
"0.77886057",
"0.778723",
"0.7734769",
"0.7734769",
"0.7734769",
"0.7703023",
"0.7697769",
"0.7697769",
"0.7697769",
"0.76797825",
"0.7659161",... | 0.7820664 | 31 |
Returns the first element | public function first()
{
return parent::first();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function first()\n {\n return reset($this->_elements);\n }",
"public function first() {\n return $this->nth( 0 );\n }",
"public function first() {\n\t\treturn $this->items[0];\n\t}",
"public function first(){\n // return $this->_results[0];\n return $this->results(... | [
"0.83928025",
"0.8350279",
"0.8252427",
"0.81721365",
"0.81130546",
"0.81010956",
"0.80842423",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8080797",
"0.80754083",
"0.80747885",
"0.80545",
"0.8053941",
"0.804113",... | 0.0 | -1 |
Returns the first element | public function last()
{
return parent::last();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function first()\n {\n return reset($this->_elements);\n }",
"public function first() {\n return $this->nth( 0 );\n }",
"public function first() {\n\t\treturn $this->items[0];\n\t}",
"public function first(){\n // return $this->_results[0];\n return $this->results(... | [
"0.83928025",
"0.8350279",
"0.8252427",
"0.81721365",
"0.81130546",
"0.81010956",
"0.80842423",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8080797",
"0.80754083",
"0.80747885",
"0.80545",
"0.8053941",
"0.804113",... | 0.0 | -1 |
Returns the first element | public function offsetGet($_offset)
{
return parent::offsetGet($_offset);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function first()\n {\n return reset($this->_elements);\n }",
"public function first() {\n return $this->nth( 0 );\n }",
"public function first() {\n\t\treturn $this->items[0];\n\t}",
"public function first(){\n // return $this->_results[0];\n return $this->results(... | [
"0.83928025",
"0.8350279",
"0.8252427",
"0.81721365",
"0.81130546",
"0.81010956",
"0.80842423",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8084021",
"0.8080797",
"0.80754083",
"0.80747885",
"0.80545",
"0.8053941",
"0.804113",... | 0.0 | -1 |
Returns the attribute name | public function getAttributeName()
{
return 'nonDerivativeHolding';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAttributeName()\n {\n return config(LocalizationServiceProvider::getConfigName().'.attribute_name', self::$defaultAttribute);\n }",
"abstract protected function getAttributeName($attribute);",
"public function getAttribute(): string\n {\n return $this->attribute;\n ... | [
"0.7962568",
"0.78212345",
"0.7816693",
"0.7774161",
"0.7737602",
"0.77027494",
"0.7686713",
"0.7588044",
"0.7514053",
"0.7504524",
"0.7504524",
"0.74973154",
"0.7417325",
"0.7368722",
"0.734146",
"0.7296611",
"0.72479343",
"0.7233783",
"0.71818584",
"0.7172",
"0.7106876",
... | 0.67703164 | 53 |
Method returning the class name | public function __toString()
{
return __CLASS__;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClassName();",
"public function getClassName();",
"public function getClassName() ;",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName()\n {\n ... | [
"0.87522393",
"0.87522393",
"0.8751158",
"0.87397957",
"0.87397957",
"0.87397957",
"0.87397957",
"0.8731564",
"0.8696754",
"0.8673495",
"0.8638432",
"0.8615335",
"0.8603119",
"0.8566906",
"0.8562364",
"0.8555002",
"0.85503733",
"0.85503733",
"0.85425884",
"0.8533183",
"0.8529... | 0.0 | -1 |
Check if popup is enabled | public function getStatus(){
if($this->scopeConfigInterface->getValue(self::XML_PATH_ENABLED,ScopeInterface::SCOPE_WEBSITE) ==1){
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isNewsletterPopUpEnable() \n {\n return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE);\n }",
"public static function isPopupWindow()\n\t{\n\t\treturn (bool)(self::$viewingMode & self::POPUP);\n\t}",
"function has_html() {\n\t\treturn $this->settings['popup'];\n\t}",
"public ... | [
"0.73778397",
"0.72082776",
"0.70571244",
"0.652414",
"0.652414",
"0.64251757",
"0.6390545",
"0.62545776",
"0.62286973",
"0.61912286",
"0.6133611",
"0.6127853",
"0.61082196",
"0.61082196",
"0.6040975",
"0.6021793",
"0.6011007",
"0.600878",
"0.600696",
"0.60065675",
"0.5997489... | 0.0 | -1 |
Get popup background url | public function getBgImage(){
return $this->scopeConfigInterface->getValue(self::XML_PATH_POPUP_BG_IMAGE,ScopeInterface::SCOPE_WEBSITE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_url_background_pion(){ return $this->_url_background_pion;}",
"public function get_url_background_card(){ return $this->_url_background_card;}",
"function get_background_image()\n {\n }",
"public function getPopup() {}",
"function getBackground() {return $this->readBackground()... | [
"0.7662499",
"0.65181",
"0.63692915",
"0.62914294",
"0.60900795",
"0.5884704",
"0.58233964",
"0.57780117",
"0.5726911",
"0.5686214",
"0.5676823",
"0.5669619",
"0.56365454",
"0.55923164",
"0.5589073",
"0.55470103",
"0.55421066",
"0.54672974",
"0.5455209",
"0.5407353",
"0.53895... | 0.72030306 | 1 |
Get popup static block id | public function getStaticBlockId(){
return $this->scopeConfigInterface->getValue(self::XML_PATH_POPUP_STATIC_BLOCK,ScopeInterface::SCOPE_WEBSITE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_ID()\n {\n return $this->blockId;\n }",
"public function getBlockId($name='')\n\t{\n\t\tif (!$name)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t$this->_db->setQuery( \"SELECT id FROM $this->_tbl WHERE block=\" . $this->_db->quote($name) . \" LIMIT 1\" );\n\t\treturn $this->_db->load... | [
"0.6915995",
"0.6216904",
"0.6204871",
"0.60660446",
"0.6021487",
"0.60035217",
"0.5912662",
"0.58703965",
"0.5808187",
"0.5794352",
"0.57913446",
"0.57251763",
"0.5600986",
"0.5600986",
"0.5586825",
"0.5564948",
"0.5546049",
"0.55442536",
"0.554154",
"0.5524439",
"0.5505612"... | 0.8631903 | 0 |
Get popup cookie time | public function getCookieTime(){
return $this->scopeConfigInterface->getValue(self::XML_PATH_POPUP_COOKIE_TIME,ScopeInterface::SCOPE_WEBSITE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLastTime(){\n\t \t if (!empty($_COOKIE['lastVisit'])) {\n\t\techo \"你上次登陆的时间是:\".$_COOKIE['lastVisit'];\n\t}else{\n\t\techo \"你是第一次登陆\";\n\t}\n\t\tsetCookie(\"lastVisit\",date(\"Y-m-d : H:i:s\"),time()+24*3600*30);\n }",
"private static function cookieLifetime()\n {\n return time() + (self:... | [
"0.6724043",
"0.6605812",
"0.6433711",
"0.64166373",
"0.6311801",
"0.6257696",
"0.6249962",
"0.622519",
"0.6133038",
"0.6073651",
"0.6008927",
"0.6008927",
"0.60028315",
"0.5937981",
"0.5823877",
"0.58137786",
"0.58137786",
"0.58137786",
"0.58137786",
"0.5795732",
"0.5792176"... | 0.8568498 | 0 |
Run the database seeds. | public function run()
{
foreach ($this->branches as $role){
DB::table('dance_branches')->insert([
'company_id' => FirstCompanySeeder::COMPANY_ID,
'uid' => md5(microtime()),
'name' => $role[0],
'address' => $role[1],
'active' => true
]);
}
} | {
"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 |
Display a listing of the resource. | public function index()
{
$allproduct=Product::orderBy('weightage', 'desc')->paginate(10);
return view('admin.product.index')->with('allproduct', $allproduct);
} | {
"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.7446377",
"0.7361922",
"0.72984487",
"0.7248631",
"0.7162871",
"0.7148215",
"0.7131838",
"0.71028054",
"0.7102395",
"0.70988023",
"0.7048243",
"0.6993516",
"0.6989079",
"0.69341344",
"0.69001913",
"0.6899167",
"0.68920904",
"0.6887188",
"0.68661547",
"0.6849159",
"0.683002... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
$specheads = SpecificationHeader::all();
$attributes = Attribute::all();
// $selectedSpec = User::first()->role_id;
return view('admin.product.create',compact('specheads', 'attributes'));
} | {
"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.75936973",
"0.75936973",
"0.7585464",
"0.7576766",
"0.7571166",
"0.7498768",
"0.7434969",
"0.7432511",
"0.7387868",
"0.7351811",
"0.7336364",
"0.73113805",
"0.7293885",
"0.72812635",
"0.7273037",
"0.72410345",
"0.7228987",
"0.7225174",
"0.718589",
"0.71786976",
"0.7172516"... | 0.0 | -1 |
Store a newly created resource in storage. | public function addcategoris($request, $productId)
{
if($request->category_id){
foreach ($request->category_id as $categories[]);
foreach($categories as $categoryid){
if(!is_numeric($categoryid))
{
$catearr=explode(" - ",$categoryid);
// if(@count($catearr)==3)
if(count($catearr)==3)
{
$firstcate=Category::where('name', $catearr[0])->first();
if($firstcate)
{
$secondcate=Category::where([
'parent_id' => $firstcate->id,
'name' => $catearr[1]
])->first();
if($secondcate){
//add category table
$category = new Category();
$category->parent_id=$secondcate->id;
$category->name=$catearr[2];
$category->order=3;
$category->slug=Str::of($catearr[2])->slug('-');
$category->save();
//add product category table
$productcategory = new ProductCategory();
$productcategory->product_id=$productId;
$productcategory->category_id=$category->id;
$productcategory->save();
}else
{
$c_category = new Category();
$c_category->parent_id=$firstcate->id;
$c_category->name=$catearr[1];
$c_category->order=2;
$c_category->slug=Str::of($catearr[1])->slug('-');
$c_category->save();
$cc_category = new Category();
$cc_category->parent_id=$c_category->id;
$cc_category->name=$catearr[2];
$cc_category->order=3;
$cc_category->slug=Str::of($catearr[2])->slug('-');
$cc_category->save();
$productcategory = new ProductCategory();
$productcategory->product_id=$productId;
$productcategory->category_id=$cc_category->id;
$productcategory->save();
}
}else{
$category = new Category();
$category->name=$catearr[0];
$category->order=1;
$category->slug=Str::of($catearr[0])->slug('-');
$category->save();
$c_category = new Category();
$c_category->parent_id=$category->id;
$c_category->name=$catearr[1];
$c_category->order=2;
$c_category->slug=Str::of($catearr[1])->slug('-');
$c_category->save();
$cc_category = new Category();
$cc_category->parent_id=$c_category->id;
$cc_category->name=$catearr[2];
$cc_category->order=3;
$cc_category->slug=Str::of($catearr[2])->slug('-');
$cc_category->save();
$productcategory = new ProductCategory();
$productcategory->product_id=$productId;
$productcategory->category_id=$cc_category->id;
$productcategory->save();
}
}
}else{
$productcategory = new ProductCategory();
$productcategory->product_id=$productId;
$productcategory->category_id=$categoryid;
$productcategory->save();
}
}
}
} | {
"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)
{
$product = Product::findOrFail($id);
$cate=$product->categories;
$specheads = SpecificationHeader::all();
$attributes = Attribute::all();
$oldattrib = ProductAttribute::where('product_id', $id)->get();
return view('admin.product.edit')
->with([
'product'=> $product,
'cate' => $cate,
'specheads' => $specheads,
'attributes' => $attributes,
'oldattrib' => $oldattrib
]);
} | {
"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.7855416",
"0.769519",
"0.72748375",
"0.724256",
"0.7173659",
"0.7064689",
"0.70549816",
"0.6985127",
"0.6949479",
"0.69474626",
"0.694228",
"0.6929372",
"0.6903047",
"0.6899655",
"0.6899655",
"0.688039",
"0.68649715",
"0.68618995",
"0.68586665",
"0.68477386",
"0.68366665",... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
$this->validate($request, [
'product_name'=> 'required',
'brand'=> 'required',
'prod_desc' => 'required',
'SKU' => 'required',
'category_id' => 'required',
'price' => 'required',
]);
$product = Product::findOrFail($id);
$product->product_name=$request->input('product_name');
$product->slug=Str::of($request->product_name)->slug('-');
$product->brand=$request->input('brand');
$product->prod_desc=$request->input('prod_desc');
$product->SKU=$request->input('SKU');
$product->video_link=$request->input('video_link');
$product->price=$request->input('price');
if($request->input('weightage')) $product->weightage=$request->input('weightage');
else $product->weightage=1;
$product->status=1;
$product->save();
// edit product images
$this->addimages($request, $product->id);
// edit category details
//delete old categories
ProductCategory::where('product_id', $product->id)->delete();
$this->addcategoris($request, $product->id);
// edit attribute
// specification, attribute, product_attribute
ProductAttribute::where('product_id', $product->id)->delete();
$this->addattributs($request, $product->id);
flash('Product Updated Successfully!');
return redirect('/admin/product');
} | {
"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.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"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 |
adds mapping for data type to orm type | public function addDataType($dataType, $ormDataType)
{
$this->dataTypeMapping[$dataType] = $ormDataType;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function initializeDoctrineTypeMappings()\n {\n $this->doctrineTypeMapping = array(\n 'int' => 'integer',\n 'timestamp' => 'datetime',\n 'time' => 'datetime',\n 'date' => 'date',\n 'varchar' => 'string',\n 'char' => 'string',\n ... | [
"0.72686905",
"0.6740753",
"0.66935056",
"0.65132505",
"0.6446485",
"0.6412536",
"0.63516307",
"0.6270797",
"0.6176217",
"0.6037854",
"0.6022009",
"0.5934086",
"0.5865228",
"0.5836885",
"0.5833662",
"0.5805937",
"0.58001393",
"0.57839316",
"0.5701092",
"0.5692783",
"0.5608246... | 0.5782037 | 18 |
adds mapping for orm type to data type | public function addOrmType(OrmDataTypeInterface $ormDataType, $dataType, $dataTypeMaxLength = 'default')
{
$type = $ormDataType->getType();
$this->ormDataTypeInstance[$type] = $ormDataType;
if ($dataTypeMaxLength === 'default') {
if (!isset($this->ormTypeMapping[$type]) || is_string($this->ormTypeMapping[$type])) {
$this->ormTypeMapping[$type] = $dataType;
}
else {
$this->ormTypeMapping[$type]['default'] = $dataType;
}
}
else {
$this->ormTypeMapping[$type]['types'][$dataType] = $dataTypeMaxLength;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function initializeDoctrineTypeMappings()\n {\n $this->doctrineTypeMapping = array(\n 'int' => 'integer',\n 'timestamp' => 'datetime',\n 'time' => 'datetime',\n 'date' => 'date',\n 'varchar' => 'string',\n 'char' => 'string',\n ... | [
"0.73811954",
"0.6838151",
"0.6722298",
"0.6606369",
"0.6455383",
"0.6401928",
"0.6341051",
"0.62335956",
"0.61254036",
"0.60378027",
"0.5999117",
"0.5973201",
"0.58936816",
"0.5887092",
"0.58120924",
"0.5799634",
"0.576904",
"0.5754756",
"0.5724368",
"0.5701635",
"0.56007457... | 0.5154957 | 54 |
removes a data type | public function removeDataType($dataType)
{
if ($this->hasDataType($dataType)) {
unset($this->dataTypeMapping[$dataType]);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function resetDataTypes()\n\t{\n\t\t$this->_dataTypes\t= array();\n\t}",
"public function unset(): void\n\t{\n\t\t$this->_value = $this->_allowNull ? null : self::setType('', gettype($this->_value));\n\t}",
"function _acf_query_remove_post_type($sql)\n{\n}",
"function remove_product_types( $types ){\n... | [
"0.6517857",
"0.6418251",
"0.6355398",
"0.6110722",
"0.6069087",
"0.6069087",
"0.6035349",
"0.5994052",
"0.59864736",
"0.5881831",
"0.58596563",
"0.5857601",
"0.58493507",
"0.58144987",
"0.58114815",
"0.5808125",
"0.5797045",
"0.5727947",
"0.57100236",
"0.56980497",
"0.569495... | 0.6388032 | 2 |
checks, if data type is defined | public function hasDataType($dataType)
{
return isset($this->dataTypeMapping[$dataType]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validDataTypes();",
"public function isSetDataType()\n {\n return !is_null($this->_fields['DataType']['FieldValue']);\n }",
"protected function check_type()\n {\n $regex = \"/^int$|^bool$|^string$/\";\n\n $result = preg_match($regex, $th... | [
"0.7604812",
"0.711981",
"0.6885448",
"0.68116325",
"0.66620356",
"0.6641195",
"0.6477782",
"0.646445",
"0.64446574",
"0.6331044",
"0.6327958",
"0.6294597",
"0.6248369",
"0.62343603",
"0.62250036",
"0.6213766",
"0.6209819",
"0.6203476",
"0.6166224",
"0.61465687",
"0.613947",
... | 0.5738076 | 65 |
checks, if orm data type is defined | public function hasOrmType($ormDataType)
{
return isset($this->ormDataTypeInstance[$ormDataType]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasColumnType($name);",
"public function hasColumnType($name);",
"public function validDataTypes();",
"function checkForDataTypes($modifyModel = false) {\n $res = true;\n foreach ($this->listFields() as $fieldName) {\n $fieldInfo = $this->getFieldInfo($fieldName);\n ... | [
"0.6779968",
"0.6779968",
"0.65375775",
"0.61960137",
"0.6142332",
"0.61381054",
"0.6133925",
"0.60168415",
"0.6004895",
"0.5985088",
"0.5967284",
"0.5937227",
"0.58961135",
"0.5891779",
"0.5876222",
"0.58553946",
"0.58493406",
"0.58295697",
"0.5820066",
"0.5801198",
"0.57792... | 0.5966308 | 11 |
gets orm data type | public function getMappedOrmType($dataType)
{
return $this->hasDataType($dataType)
? $this->dataTypeMapping[$dataType]
: null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDbFieldType()\n {\n }",
"public function getDatatype() {}",
"public function getDataType() {}",
"public function dbFieldType()\n {\n return 'string';\n }",
"public function getDataType(): string;",
"public function getDataType(): string;",
"public function getDataT... | [
"0.7447562",
"0.7431843",
"0.7368935",
"0.7338101",
"0.7139873",
"0.7139873",
"0.70480204",
"0.6993981",
"0.6902445",
"0.6833043",
"0.68257284",
"0.6812871",
"0.6791835",
"0.6791835",
"0.6779235",
"0.6766996",
"0.67507184",
"0.66035813",
"0.65801",
"0.65801",
"0.6579874",
"... | 0.62907004 | 45 |
gets mapped data type for given orm type | public function getMappedDataType($ormType, $length = 0)
{
if (!isset($this->ormTypeMapping[$ormType])) {
return $ormType;
}
$mapping = $this->ormTypeMapping[$ormType];
if (is_string($mapping)) {
return $mapping;
}
$defaultType = isset($mapping['default']) ? $mapping['default'] : null;
if (!isset($mapping['types'])) {
return $defaultType;
}
if ($defaultType && ($length === null || $length === 0)) {
return $defaultType;
}
$unit = isset($mapping['unit']) ? $mapping['unit'] : 'chars';
if ($unit === self::UNIT_BYTES) {
$length = (int)floor((log(pow(10, $length)) / log(2)) / 8);
}
return $this->getBestMatchingType($mapping['types'], $defaultType, $length);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMappedOrmType($dataType)\n {\n return $this->hasDataType($dataType)\n ? $this->dataTypeMapping[$dataType]\n : null;\n }",
"public function getTypeDoctrine()\n {\n if (isset(self::$doctrineTypeMap[$this->getType()])) {\n return self::$doct... | [
"0.72476715",
"0.6878628",
"0.66546255",
"0.66415125",
"0.6619879",
"0.6587381",
"0.65685695",
"0.65685695",
"0.64811766",
"0.6466056",
"0.6463914",
"0.6405813",
"0.6400301",
"0.63959956",
"0.63904804",
"0.6385907",
"0.6370004",
"0.6351379",
"0.63503575",
"0.63249356",
"0.627... | 0.68427837 | 2 |
Determine if the user is authorized to make this request. | public function authorize()
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }"... | [
"0.8401071",
"0.8377486",
"0.8377486",
"0.8344406",
"0.8253731",
"0.824795",
"0.8213121",
"0.8146598",
"0.81115526",
"0.8083369",
"0.7991986",
"0.79907674",
"0.79836637",
"0.79604936",
"0.79516214",
"0.79494005",
"0.79265946",
"0.7915068",
"0.79001635",
"0.7894822",
"0.789145... | 0.0 | -1 |
Get the validation rules that apply to the request. | public function rules()
{
return [
'title' => 'required|min:5|max:255',
'document' => 'required|file|max:5000|mimes:pdf',
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }",
"public function getRules()\n {\n return $this->validator->getRules();\n }",
"public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche... | [
"0.8342703",
"0.80143493",
"0.7937251",
"0.79264987",
"0.79233825",
"0.79048395",
"0.78603816",
"0.7790699",
"0.77842164",
"0.77628785",
"0.7737272",
"0.7733618",
"0.7710535",
"0.7691693",
"0.76849866",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7683038",
"0.76830... | 0.0 | -1 |
Create a manytoone (and onetoone) relation | public function hasOne(Entity|string $entityRelation, string $foreignKey = ''): HasOne|false
{
try {
$entityRelation = $this->getEntity($entityRelation);
$primaryKey = $entityRelation->getPrimaryKey();
$preForeignKey = strtolower((new ReflectionClass($entityRelation))->getShortName());
$foreignKey = $foreignKey ?: $preForeignKey . '_' . $primaryKey;
$relation = new HasOne($this, $entityRelation, $foreignKey);
$name = debug_backtrace()[1]['function'] ?? $entityRelation->getManager()->getTable();
return $this->relations[$name] = $relation;
} catch (Exception $ex) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function one_to_one()\n {\n }",
"private function createRelation()\n {\n $this->createBuilder();\n }",
"public function hasOne($class, $foreignKey = null, $localKey = null);",
"public function isAddToRelationship();",
"protected static function _addOneToOneRelation(array $... | [
"0.7084667",
"0.63699645",
"0.6071527",
"0.59792995",
"0.59470546",
"0.5859",
"0.5841298",
"0.578341",
"0.5720019",
"0.5690512",
"0.56543446",
"0.56434494",
"0.56288576",
"0.5625724",
"0.5596756",
"0.5556394",
"0.55047804",
"0.5483632",
"0.5475374",
"0.5474761",
"0.5467317",
... | 0.0 | -1 |
Create a onetomany relation | public function hasMany(Entity|string $entityRelation, string $foreignKey = ''): HasMany|false
{
try {
$entityRelation = $this->getEntity($entityRelation);
$primaryKey = $this->getPrimaryKey();
$preForeignKey = strtolower((new ReflectionClass($this))->getShortName());
$foreignKey = $foreignKey ?: $preForeignKey . '_' . $primaryKey;
$relation = new HasMany($this, $entityRelation, $foreignKey);
$name = debug_backtrace()[1]['function'] ?? $entityRelation->getManager()->getTable();
return $this->relations[$name] = $relation;
} catch (Exception $ex) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createRelation()\n {\n $this->createBuilder();\n }",
"public function buildRelations()\n\t{\n $this->addRelation('Aviso', 'Aviso', RelationMap::MANY_TO_ONE, array('aviso_id' => 'id', ), 'RESTRICT', null);\n $this->addRelation('Usuario', 'Usuario', RelationMap::MANY_TO_ONE, arr... | [
"0.66931814",
"0.62585574",
"0.62386155",
"0.6210066",
"0.6210066",
"0.6210066",
"0.6210066",
"0.6210066",
"0.6210066",
"0.6210066",
"0.6210066",
"0.6210066",
"0.62069756",
"0.61834407",
"0.6174265",
"0.6161916",
"0.61482066",
"0.6146997",
"0.61420286",
"0.6134204",
"0.611378... | 0.0 | -1 |
Create a manytomany relation | public function manyToMany(Entity|string $entityRelation, string $pivot = '', string $foreignKeyOne = '', string $foreignKeyTwo = '', string $primaryKeyPivot = 'id'): ManyToMany|false
{
try {
$primaryKeyOne = $this->getPrimaryKey();
$entityRelation = $this->getEntity($entityRelation);
$primaryKeyTwo = $entityRelation->getPrimaryKey();
$preForeignKeyOne = strtolower((new ReflectionClass($this))->getShortName());
$preForeignKeyTwo = strtolower((new ReflectionClass($entityRelation))->getShortName());
$foreignKeyOne = $foreignKeyOne ?: $preForeignKeyOne . '_' . $primaryKeyOne;
$foreignKeyTwo = $foreignKeyTwo ?: $preForeignKeyTwo . '_' . $primaryKeyTwo;
$all = DB::query(
'SHOW TABLES FROM ' . config('database.connections.mysql.name', 'mkyframework')
);
if (empty($pivot)) {
foreach ($all as $a) {
if (str_contains($a['Tables_in_' . config('database.connections.mysql.name', 'mkyframework')], '_')) {
$test = explode('_', $a['Tables_in_' . config('database.connections.mysql.name', 'mkyframework')]);
if (in_array($preForeignKeyOne, $test) && in_array($preForeignKeyTwo, $test)) {
$pivot = $a['Tables_in_' . config('database.connections.mysql.name', 'mkyframework')];
}
}
}
}
$name = debug_backtrace()[1]['function'] ?? $preForeignKeyOne . '_' . $preForeignKeyTwo;
$relation = new ManyToMany($this, $entityRelation, $foreignKeyOne, $foreignKeyTwo, $pivot, $primaryKeyPivot);
return $this->relations[$name] = $relation;
} catch (Exception $ex) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function _addManyToManyRelation(array $params)\n {\n $name = $params['foreignClass'] . 's';\n\n $params['type'] = self::MANY_TO_MANY;\n\n static::$_relations[$name] = $params;\n }",
"public function createMany(array $attributes): bool;",
"public function products(): MorphToMany;",
... | [
"0.68628234",
"0.6438887",
"0.63818794",
"0.63563186",
"0.6321703",
"0.62837064",
"0.62233645",
"0.615086",
"0.60595834",
"0.6022016",
"0.59891456",
"0.5939837",
"0.5917573",
"0.58942574",
"0.58543646",
"0.58322924",
"0.58320683",
"0.5830366",
"0.5785774",
"0.57576805",
"0.57... | 0.5421537 | 82 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.