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 _function variable. This is to set the function to call. | private function setFuction($function) {
$this->_function = $function;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function set_function( $function ) {\n\t\t$this->function = $function;\n\t\t$this->is_function_set = true;\n\t}",
"function setFunction(string $function)\n {\n $this->function = $function;\n return $this;\n }",
"public function setFunction($function)\n {\n $this->... | [
"0.82132185",
"0.73930293",
"0.71710855",
"0.71512157",
"0.6802688",
"0.6759857",
"0.673544",
"0.65446764",
"0.64444196",
"0.64161927",
"0.63199854",
"0.6224588",
"0.620609",
"0.61369747",
"0.6000557",
"0.59729016",
"0.59697825",
"0.59564114",
"0.5947657",
"0.58996874",
"0.58... | 0.82827353 | 0 |
Return the part of parameters of URL. | private function getParamsUrlFormat() {
$urlParams = "";
if ($this->getMethod() == 'GET') {
$urlParams .= ($this->getPaging()) ?
"?_paging=1" :
"";
$urlParams .= ($this->getPaging()) ?
"&_return_as_object=1" :
"";
$urlParams .= ($this->getPaging()) ?
"&_max_results=" . $this->getMaxResults() :
"";
}
if ($this->getMethod() == 'POST') {
$function = $this->getFuction();
$urlParams .= (isset($function) and $function != "") ?
"?_function=" . $this->getFuction() :
"";
}
return $urlParams;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParams(){\n if( !empty($this->uri['query']) ):\n parse_str($this->uri['query'], $this->params);\n return $this->params;\n endif;\n }",
"function url_get_parameters() {\n $this->init_full();\n return array('id' => $this->modulerecord->id, 'pageid' => $this->lesson... | [
"0.744725",
"0.7389612",
"0.7205698",
"0.719022",
"0.7183806",
"0.71712357",
"0.716662",
"0.7159257",
"0.7107084",
"0.7074911",
"0.70507735",
"0.69864655",
"0.6968365",
"0.69416034",
"0.67802185",
"0.67595446",
"0.6701124",
"0.6676337",
"0.66562563",
"0.6637577",
"0.662219",
... | 0.7002742 | 11 |
Send query by curl. | private function sendQueryByCurl() {
$this->curl = curl_init();
// JSON data request
$jsonData = $this->getJsonData();
// some params
$urlParams = $this->getParamsUrlFormat();
$this->setCurlOpts($this->curl, $jsonData, $urlParams);
$this->setResult(curl_exec($this->curl));
$this->setHttpCode(curl_getinfo($this->curl, CURLINFO_HTTP_CODE));
curl_close($this->curl);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sendCurl() {\n\t\t$this->curlResponse = $this->curl->exec();\n\t}",
"public function execQuery()\n{\n\n $url = $this->getURL();\n // create curl resource \n $ch = curl_init(); \n\n //return the transfer as a string \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \... | [
"0.6474419",
"0.6389883",
"0.62338114",
"0.61014014",
"0.6081204",
"0.59998935",
"0.59769356",
"0.5898234",
"0.58894",
"0.58357185",
"0.5740103",
"0.5735197",
"0.56887364",
"0.5680275",
"0.5678873",
"0.56678957",
"0.56444895",
"0.5614562",
"0.5563711",
"0.54918087",
"0.548816... | 0.82177544 | 0 |
Return JSON string to query. | private function getJsonData() {
if (empty($this->fields)) {
return json_encode($this->fields, JSON_FORCE_OBJECT);
} else {
return json_encode($this->fields);
}
// Example of returned string:
// $jsonData = '{"name":"foo.antox.intra","ipv4addr":"192.168.1.2"}';
//$obj = json_decode($jsonData);
//echo $obj->{'name'};
//it works, it print "foo.antox.intra"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getResultsInJSON(): string {\n return json_encode($this->getResults());\n }",
"public function queryFormat(): string\n {\n return 'JSONEachRow';\n }",
"public function getJsonString(){\n\t\treturn json_encode(array($this->getRequestData()));\n\t}",
"public function buil... | [
"0.7166545",
"0.71461636",
"0.7015899",
"0.69838184",
"0.69709617",
"0.69657946",
"0.6923514",
"0.68968433",
"0.67979866",
"0.6758024",
"0.6758024",
"0.66582775",
"0.6620821",
"0.6616533",
"0.6579814",
"0.6576082",
"0.6570967",
"0.6556342",
"0.6505868",
"0.6505868",
"0.649919... | 0.0 | -1 |
Sets the result of the query. | private function setResult($result) {
// possible http code errors
if (intval($this->getHttpCode()) > 299) {
$this->setError("HTTP CODE: " . $this->getHttpCode());
$result_decoded = false;
}
$result_decoded = json_decode($result, true);
// bad json query or authentication fail
if ($result_decoded === null and is_string($result)) {
$this->setError($result);
$result_decoded = false;
}
// curl error
if ($result === null or $result === false) {
$this->setError(curl_error($this->curl));
}
// error on the query
if (isset($result_decoded['Error'])) {
$this->setError($result_decoded['text']);
$result_decoded = false;
}
$this->result = $result_decoded;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setResult($result)\n\t{\n\t\t$this->result = $result;\n\t}",
"protected function set_result($result) {\r\n\t\t$this->result = $result;\r\n\t}",
"function setResults ($result) {\n\t\t$this->_results = $result;\n\t}",
"public function setResult($result = null) {\r\n $this->_result = $res... | [
"0.7764854",
"0.7674263",
"0.7601608",
"0.7598547",
"0.7557924",
"0.7511414",
"0.73819834",
"0.7252441",
"0.71103656",
"0.69788355",
"0.68352115",
"0.6832624",
"0.6659639",
"0.66093135",
"0.6560058",
"0.6560058",
"0.6560058",
"0.6560058",
"0.6560058",
"0.6560058",
"0.6560058"... | 0.676085 | 12 |
Return the result of the query. | private function getResult() {
return $this->result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function result() {\n $this -> execute();\n return $this -> stmt -> fetch();\n }",
"public function getQueryResult()\n {\n return $this->queryResult;\n }",
"public function result(){\n\t\t$this->execute() ;\n\t\treturn $this->statement->fetch(PDO::FETCH_ASSOC) ;\n\t}",
"p... | [
"0.7706205",
"0.7396068",
"0.73846525",
"0.73306143",
"0.730227",
"0.72595197",
"0.71988845",
"0.7171339",
"0.715329",
"0.71383303",
"0.70915675",
"0.70915675",
"0.70915675",
"0.70915675",
"0.70915675",
"0.7091422",
"0.7091422",
"0.7091422",
"0.7091422",
"0.7091422",
"0.70914... | 0.72163516 | 6 |
Set the last error ocurred. | private function setError($error) {
$this->error = $error;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function clearError()\n {\n $this->lastError = null;\n }",
"private function setError($value) {\r\n $this->debug('setError() was called with value: ' . $value);\r\n $this->error = $value;\r\n }",
"public function setError($err);",
"public function setError($error) {\n if ... | [
"0.6773016",
"0.671677",
"0.66928595",
"0.667363",
"0.66724795",
"0.66541487",
"0.6611548",
"0.6604737",
"0.659179",
"0.6589912",
"0.6559292",
"0.6544962",
"0.6504052",
"0.6414613",
"0.6400322",
"0.63834155",
"0.63527083",
"0.63527083",
"0.63527083",
"0.63379276",
"0.6317055"... | 0.65441054 | 12 |
Returns the last error. | public function getError() {
return $this->error;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_last_error() {\n\t\treturn $this->errors[count($this->errors - 1)];\n\t}",
"public function get_last_error() {\n\t\treturn $this->last_error;\n\t}",
"public function get_last_error() {\n\t\treturn $this->_error;\n\t}",
"public function get_last_error() {\n return $this->last_error;\n }",
"... | [
"0.9103475",
"0.90772945",
"0.9004299",
"0.8925374",
"0.88872457",
"0.8838866",
"0.86430866",
"0.8579935",
"0.8544211",
"0.8426137",
"0.83394367",
"0.8266494",
"0.8246904",
"0.8198381",
"0.8166439",
"0.8166439",
"0.8162553",
"0.81074035",
"0.80981785",
"0.80957836",
"0.808147... | 0.7414505 | 77 |
Set the http code returned by the server. | private function setHttpCode($httpCode) {
$this->httpCode = $httpCode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setHttpCode(Int $code = 200)\n {\n http_response_code($code);\n }",
"public function setStatusCode($code)\r\n {\r\n http_response_code($code);\r\n }",
"function setStatusCode($code);",
"public function setResponseCode($code) {}",
"public function setResponseCode... | [
"0.802178",
"0.7902739",
"0.78978395",
"0.7764633",
"0.7670433",
"0.76474637",
"0.76119095",
"0.75911933",
"0.75461173",
"0.75445724",
"0.75285167",
"0.7487366",
"0.74737656",
"0.7458318",
"0.74361646",
"0.73906416",
"0.73437107",
"0.7289568",
"0.7272016",
"0.72581464",
"0.72... | 0.71944004 | 25 |
Get the http code returned by the server. | private function getHttpCode() {
return $this->httpCode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHttpCode();",
"public function code() {\n return $this->info['http_code'];\n }",
"public function getCode()\n {\n return curl_getinfo($this->handler)['http_code'];\n }",
"public function getCode()\n\t{\n\t\t$matches = array();\n\t\tif (isset($this->headers) && isset($this->... | [
"0.8656949",
"0.84416634",
"0.82183254",
"0.8149476",
"0.8142114",
"0.8128281",
"0.80250925",
"0.79589045",
"0.79556316",
"0.79496753",
"0.7931411",
"0.7930467",
"0.7853564",
"0.7828672",
"0.77976024",
"0.7780374",
"0.77725226",
"0.77628577",
"0.774638",
"0.771626",
"0.771386... | 0.78809345 | 12 |
Build a new calendar object string | public function build()
{
$this->validate_attributes();
$attributes = [];
foreach (static::$object_attributes as $key => $value) {
$attributes[$key] = $this->{$key};
}
// Construct a vcalendar object based on the templated
return (new Build(
static::VTEMPLATE
))->build(
$attributes
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function build_calendar()\n\t{\n\t\t//ee()->TMPL->log_item('Calendar: Building calendar output');\n\n\t\t$disable\t= array(\n\t\t\t'categories',\n\t\t\t'category_fields',\n\t\t\t'custom_fields',\n\t\t\t'member_data',\n\t\t\t'pagination',\n\t\t\t'trackbacks'\n\t\t);\n\n\t\t$this->CDT->reset();\n\t\t$today... | [
"0.6605577",
"0.63097054",
"0.62160647",
"0.60482085",
"0.60088766",
"0.58616114",
"0.5816698",
"0.5719844",
"0.5700177",
"0.5694095",
"0.56782883",
"0.56463045",
"0.564268",
"0.56420803",
"0.5628636",
"0.5597074",
"0.55894953",
"0.55884564",
"0.55707496",
"0.55680287",
"0.55... | 0.6393743 | 1 |
Get any class attribute | public function __get($attribute)
{
if (!isset($this->{$attribute})) {
Error::set(Error::ERROR_INVALID_PROPERTY, [$attribute], Error::ERROR);
}
return $this->{$attribute};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function attributes()\n {\n $class = self::loadDelegationClass();\n \n return call_user_func($class.'::attributes');\n }",
"private function getAttributes(string $class)\n {\n $reflection = new ReflectionClass($class);\n return $reflection->getAttributes(... | [
"0.70947844",
"0.7075122",
"0.68060815",
"0.67049134",
"0.6703468",
"0.66668063",
"0.665957",
"0.665957",
"0.665957",
"0.665957",
"0.665957",
"0.665957",
"0.665957",
"0.665957",
"0.665957",
"0.6630086",
"0.6612969",
"0.65942186",
"0.6551142",
"0.65312797",
"0.64779085",
"0.... | 0.0 | -1 |
Validate that the necessary values to build the vcalendar object are set | protected function validate_attributes()
{
foreach (static::$object_attributes as $key => $value) {
if (!isset($this->{$key})) {
Error::set(Error::ERROR_MISSING_ATTRIBUTE, [$key], Error::ERROR);
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}",
"function entry_api_ui_event_form_validate($form, &$form_state) {\n\n $values = $form_state['values'];\n\n // Validate publication date.\n if... | [
"0.6093059",
"0.60075784",
"0.59703285",
"0.59201145",
"0.5860117",
"0.5830722",
"0.5762129",
"0.5729802",
"0.5676946",
"0.5636722",
"0.5627454",
"0.56232786",
"0.55909115",
"0.55661476",
"0.55512583",
"0.55256",
"0.5500685",
"0.54744256",
"0.546681",
"0.5453832",
"0.54507864... | 0.0 | -1 |
Load an object based on the file attributes defined for the vcalendar object | protected function load_from_file(File $file)
{
$input_line = $file->get_block_content(static::OPENING_TAG, static::CLOSING_TAG);
return $this->digest_content($file, $input_line);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"public abstract function load();",
"abstract public function load();",
"abstract public function load();",
"public function load( &$object );",
... | [
"0.624233",
"0.624233",
"0.624233",
"0.624233",
"0.6203539",
"0.618731",
"0.618731",
"0.61504155",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.6003234",
"0.590... | 0.0 | -1 |
Digest the content related to a vobject | private function digest_content($file, $input_line)
{
foreach (static::$object_attributes as $property => $process_attributes) {
list($regex, $type) = $process_attributes;
// Process fields by regex
if ($type == self::REGEX) {
if (preg_match($regex, $input_line, $output_array)) {
$this->{$property} = $output_array[1];
} else {
$file->__destruct();
Error::set(Error::ERROR_ATTR_NOT_FOUND, [$property, $input_line], Error::ERROR);
}
// Process free text fields
} elseif ($type == self::FREE_TEXT) {
$string_separated = explode(Build::FIELD_DELIMITER, $input_line);
list($regex, $type, $final_regex) = $process_attributes;
$content_line = '';
$content_found = false;
// Wrap all the content beetween the $regex and the $final_refex
foreach ($string_separated as $line) {
if (preg_match($regex, $line, $output_array)) {
// Remove the beginning tag
$content_line .= preg_replace($regex, "", $line);
$content_found = true;
continue;
}
if (preg_match($final_regex, $line, $output_array)) {
break;
}
if ($content_found) {
// Remove the first white space
$content_line .= preg_replace("/^\s/", "", $line);
}
}
if (empty($content_line)) {
$file->__destruct();
Error::set(Error::ERROR_ATTR_NOT_FOUND, [$property, $input_line], Error::ERROR);
} else {
$this->{$property} = $content_line;
}
} else {
$file->__destruct();
Error::set(Error::DIGEST_METHOD_NOT_FOUND, [$type], Error::ERROR);
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hashObject($object);",
"public function GetDigest()\n {\n return hash_final($this->_resource, true);\n }",
"final public function calculateDigestString($data) {}",
"private static function hash($object)\n\t{\n\t\treturn '#' . substr(md5(spl_object_hash($object)), 0, 4);\n\t}",
... | [
"0.61585265",
"0.6152788",
"0.58677465",
"0.57554233",
"0.5746871",
"0.56986606",
"0.5539554",
"0.549145",
"0.5465774",
"0.5465012",
"0.54147804",
"0.5386723",
"0.53123796",
"0.52738374",
"0.52726376",
"0.5189194",
"0.5182614",
"0.5176311",
"0.5176311",
"0.5176311",
"0.517631... | 0.48590118 | 41 |
probably a better way to check but running out of time | private function checkIfClientIsMemberOfUser($clientArray)
{
$isMember = false;
foreach ($clientArray as $clientUser) {
if ($clientUser->email === 'newClientUser@local.dev') {
$isMember = true;
}
}
return $isMember;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasTimeLimitReached(): bool;",
"protected function checkMaxExecutionTime() {}",
"private function isTimeLimitReached() \n {\n return $this->timeLimit < (microtime(true) - $this->startTime);\n }",
"public function check(): bool\n {\n if (0 == $this->limit) {\n ... | [
"0.6788141",
"0.65422255",
"0.6540328",
"0.6320529",
"0.63091654",
"0.624185",
"0.6045668",
"0.6025906",
"0.6018737",
"0.5997668",
"0.59863925",
"0.59799504",
"0.5972729",
"0.5972729",
"0.5972729",
"0.5972729",
"0.5972729",
"0.5946627",
"0.59207416",
"0.58938867",
"0.5892709"... | 0.0 | -1 |
Method Function to retrieve recordset of table | function fetchrecordset($id="",$condition="",$order="menu_id")
{
if($id!="" && $id!= NULL && is_null($id)==false)
{
$condition = " and menu_id=". $id .$condition;
}
if($order!="" && $order!= NULL && is_null($order)==false)
{
$order = " order by " . $order;
}
$strquery="SELECT * FROM ".DB_PREFIX."menu WHERE 1=1 " . $condition . $order;
$rs=mysql_query($strquery);
return $rs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t ;\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }",
"function get()\n\t{\n\t\tif (empty($this->use_db)) $this->... | [
"0.77051973",
"0.74435425",
"0.7412669",
"0.7364925",
"0.7220245",
"0.7214989",
"0.7179357",
"0.7165607",
"0.71377844",
"0.71131593",
"0.7103008",
"0.7069603",
"0.7031055",
"0.7031055",
"0.7031055",
"0.70238906",
"0.7017412",
"0.7016448",
"0.70016223",
"0.6997968",
"0.6980719... | 0.0 | -1 |
Function to retrieve records of table in form of two dimensional array | function fetchallasarray($intid=NULL, $stralphabet=NULL,$condition="",$order="menu_id")
{
$arrlist = array();
$i = 0;
$and = $condition;
if(!is_null($intid) && trim($intid)!="") $and .= " AND menu_id = " . $intid;
if(!is_null($stralphabet) && trim($stralphabet)!="") $and .= " AND menu_id like '" . $stralphabet . "%'";
$strquery="SELECT * FROM ".DB_PREFIX."menu WHERE 1=1 " . $and . " ORDER BY ".$order;
$rs=mysql_query($strquery);
while($armenu= mysql_fetch_array($rs))
{
$arrlist[$i]["menu_id"] = $armenu["menu_id"];
$arrlist[$i]["menu_name"] = $armenu["menu_name"];
$arrlist[$i]["listing_page"] = $armenu["listing_page"];
$arrlist[$i]["addedit_page"] = $armenu["addedit_page"];
$arrlist[$i]["menu_icon"] = $armenu["menu_icon"];
$arrlist[$i]["menu_order"] = $armenu["menu_order"];
$arrlist[$i]["menu_active"] = $armenu["menu_active"];
$i++;
}
return $arrlist;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMultipleRecords() {\n $i = 0;\n $output = [];\n $_this = $this;\n while($row = $_this->fetchAssoc()){\n $output[\"data\"][$i] = $row;\n $i++;\n }\n return $output;\n }",
"public function getRows();",
"public function getRows(... | [
"0.7551815",
"0.7457688",
"0.7457688",
"0.73595464",
"0.7350422",
"0.72967625",
"0.72301584",
"0.71437913",
"0.7111738",
"0.7050297",
"0.70496595",
"0.7032963",
"0.69809073",
"0.6947696",
"0.6941844",
"0.69342",
"0.6928433",
"0.6912552",
"0.6880259",
"0.68669724",
"0.6856193"... | 0.0 | -1 |
Function to set field values into object properties | function setallvalues($id="",$condition="")
{
$rs=$this->fetchrecordset($id, $condition);
if($armenu= mysql_fetch_array($rs))
{
$this->menu_id = $armenu["menu_id"];
$this->menu_name = $armenu["menu_name"];
$this->listing_page = $armenu["listing_page"];
$this->addedit_page = $armenu["addedit_page"];
$this->menu_icon = $armenu["menu_icon"];
$this->menu_order = $armenu["menu_order"];
$this->menu_active = $armenu["menu_active"];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract function setFields();",
"protected function setProperties()\n {\n foreach ($this->data as $key => $value) {\n $this->$key = $value;\n }\n }",
"public static function setters();",
"public function copyAttributesToValues()\n\t{\n\t\tforeach( $this->values as $f... | [
"0.72022784",
"0.68467426",
"0.6724026",
"0.6275485",
"0.6272835",
"0.6264116",
"0.61984444",
"0.61949253",
"0.6158546",
"0.61427635",
"0.6111663",
"0.60961133",
"0.60961133",
"0.606221",
"0.606221",
"0.60296154",
"0.6014235",
"0.6005995",
"0.59985954",
"0.5978145",
"0.597249... | 0.0 | -1 |
Function to get particular field value | function fieldvalue($field="menu_id",$id="",$condition="",$order="")
{
$rs=$this->fetchrecordset($id, $condition, $order);
$ret=0;
while($rw=mysql_fetch_assoc($rs))
{
$ret=$rw[$field];
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFieldValue($field);",
"function getValue(int $field);",
"function getfield($field){\n\n\t\treturn($this->record[$field]);\n\t}",
"public function getField();",
"public function getField();",
"public function getField();",
"public function fetchField();",
"public function getField(): strin... | [
"0.864525",
"0.80382675",
"0.77892876",
"0.7748479",
"0.7748479",
"0.7748479",
"0.7706694",
"0.7586689",
"0.7574801",
"0.75504386",
"0.7549741",
"0.75051105",
"0.7497644",
"0.7491004",
"0.7467062",
"0.7461338",
"0.74108714",
"0.74108714",
"0.7396601",
"0.72456",
"0.7225899",
... | 0.6978189 | 41 |
Function to add record into table | function add()
{
$strquery="INSERT INTO ".DB_PREFIX."menu (menu_name, listing_page, addedit_page, menu_icon, menu_order, menu_active) values('".$this->menu_name."','".$this->listing_page."','".$this->addedit_page."','".$this->menu_icon."','".$this->menu_order."','".$this->menu_active."')";
mysql_query($strquery) or die(mysql_error());
$this->menu_id = mysql_insert_id();
return mysql_insert_id();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function insertRecord($tableName, $record);",
"function dbase_add_record($dbase_identifier, $record)\n{\n}",
"function add($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\n\t\t// update the DB table approp... | [
"0.73277074",
"0.7323117",
"0.7082011",
"0.6882408",
"0.6849155",
"0.68127424",
"0.677099",
"0.67641115",
"0.67439026",
"0.6714331",
"0.66814274",
"0.668119",
"0.6634894",
"0.6616777",
"0.6612002",
"0.66055614",
"0.6579536",
"0.65602577",
"0.6547044",
"0.64713216",
"0.6461298... | 0.0 | -1 |
Function to update record of table | function update()
{
$strquery="UPDATE ".DB_PREFIX."menu SET menu_name='".$this->menu_name."', listing_page='".$this->listing_page."', addedit_page='".$this->addedit_page."', menu_icon='".$this->menu_icon."', menu_order='".$this->menu_order."', menu_active='".$this->menu_active."' WHERE menu_id=".$this->menu_id;
return mysql_query($strquery) or die(mysql_error());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update($record);",
"public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str... | [
"0.8024222",
"0.7680434",
"0.7628917",
"0.7442483",
"0.7424206",
"0.73762375",
"0.73229647",
"0.72535294",
"0.7249584",
"0.7210448",
"0.71779066",
"0.7177717",
"0.7168458",
"0.7163644",
"0.7146874",
"0.70789826",
"0.7061859",
"0.7053968",
"0.7053265",
"0.7053265",
"0.70267457... | 0.0 | -1 |
Function to delete record from table | function delete()
{
$strquery="DELETE FROM ".DB_PREFIX."menu WHERE menu_id in(".$this->checkedids.")";
return mysql_query($strquery) or die(mysql_error());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}",
"public function delete()\n {\n $this->db->delete($this->table, $this->da... | [
"0.78750867",
"0.7834801",
"0.77469236",
"0.77298295",
"0.77215457",
"0.7672818",
"0.76700956",
"0.76659906",
"0.76607054",
"0.7608853",
"0.7513033",
"0.75043684",
"0.75043494",
"0.7496073",
"0.74807715",
"0.7475265",
"0.74585176",
"0.7441185",
"0.74151385",
"0.74086666",
"0.... | 0.0 | -1 |
Function to activeinactive record of table | function activeinactive()
{
$strquery = "UPDATE " . DB_PREFIX . "menu SET menu_active='n' WHERE menu_id in(" . $this->uncheckedids . ")";
$result = mysql_query($strquery) or die(mysql_error());
if($result == false)
return ;
$strquery = "UPDATE " . DB_PREFIX . "menu SET menu_active='y' WHERE menu_id in(" . $this->checkedids . ")";
return mysql_query($strquery) or die(mysql_error());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setInactive(){\n\t\t\t \t$this->isActive = false;\n\t\t\t \t$this->save();// Make sure the record is saved\n\t\t\t \t\n\t\t\t \t$token = random_text(5);\n\t\t\t \t$query = sprintf('INSERT INTO %sPENDING (USER_ID, TOKEN) VALUES (%d, \"%s\")', DB_TBL_PREFIX, $this->uid, $token);\n\t\t\t \... | [
"0.64813167",
"0.64483964",
"0.6284378",
"0.62711",
"0.6210423",
"0.6205292",
"0.6148314",
"0.61450946",
"0.61382186",
"0.61244506",
"0.60486203",
"0.60410243",
"0.60225576",
"0.60079765",
"0.60000664",
"0.60000163",
"0.5987153",
"0.5983046",
"0.5969126",
"0.5954788",
"0.5944... | 0.666399 | 0 |
pour tonquer un texte By Guigui le 26/09/06 | function tronquer_texte($texte, $longeur_max)
{
if (strlen($texte) > $longeur_max)
{
$texte = substr($texte, 0, $longeur_max);
$dernier_espace = strrpos($texte, "");
$texte = substr($texte, 0, $dernier_espace)."...";
}
return $texte;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function escreverTexto($sText) {\n\n /**\n * Aplicando negrito\n */\n $sText = str_replace(\"<b>\", chr(27) . chr(69), $sText);\n $sText = str_replace(\"</b>\", chr(27) . chr(70), $sText);\n /**\n * Aplicando italico\n */\n $sText = str_replace(\"<i>\", chr(27) . chr(52), $sText);\n ... | [
"0.6381437",
"0.6306502",
"0.62625664",
"0.6220176",
"0.61572963",
"0.609522",
"0.60695016",
"0.6028821",
"0.589756",
"0.5869649",
"0.58539134",
"0.5817899",
"0.58078694",
"0.5804611",
"0.5763301",
"0.57583743",
"0.57451767",
"0.57451767",
"0.57451767",
"0.5745055",
"0.573194... | 0.0 | -1 |
/ Initialize action controller here | public function init()
{
parent::init();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init()\n {\n /* Initialize action controller here */\n }",
"public function init()\n {\n /* Initialize action controller here */\n }",
"protected function initializeController() {}",
"protected function initializeAction() {}",
"protected function initializeAction()... | [
"0.89566046",
"0.89566046",
"0.82057846",
"0.80040884",
"0.80040884",
"0.8004028",
"0.7928566",
"0.7802862",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7741994",
"0.76497424",
"0.7542271",
"0.7541656",
"0.7458589",
"0.7430627",
"0.7382884",
"0.7349326... | 0.0 | -1 |
creating unordered files and names before and after m for filtering | private function assert_many_relations_are_loaded_in_component_value($relation, $formPositions)
{
$file1 = factory(File::class)->create(['name' => 'q.jpg']);
$file2 = factory(File::class)->create(['name' => 'a.jpg']);
$file3 = factory(File::class)->create(['name' => 'l.jpg']);
$obj = Obj::create();
$relation = $relation.'Plain';
$obj->{$relation}()->sync([$file1->id, $file2->id, $file3->id]);
$form = _SelectOptionsFromForm::boot(1);
//$relationPlain
$plainIndex = $formPositions[0];
$this->assertCount(3, $form->elements[$plainIndex]->value);
$this->assertEquals($file1->id, $form->elements[$plainIndex]->value[0]);
$this->assertEquals($file2->id, $form->elements[$plainIndex]->value[1]);
$this->assertEquals($file3->id, $form->elements[$plainIndex]->value[2]);
//$relationOrdered
$orderedIndex = $formPositions[1];
$this->assertCount(3, $form->elements[$orderedIndex]->value);
$this->assertEquals($file2->id, $form->elements[$orderedIndex]->value[0]);
$this->assertEquals($file3->id, $form->elements[$orderedIndex]->value[1]);
$this->assertEquals($file1->id, $form->elements[$orderedIndex]->value[2]);
//$relationFiltered
$filteredIndex = $formPositions[2];
$this->assertCount(2, $form->elements[$filteredIndex]->value);
$this->assertEquals($file2->id, $form->elements[$filteredIndex]->value[0]);
$this->assertEquals($file3->id, $form->elements[$filteredIndex]->value[1]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFileAndFolderNameFilters() {}",
"public function buildFilesForFilterTest()\n {\n // are used as the test method arguments. If we want to use an array\n // as a test data set, we need to return a nested array\n return array(\n array(\n $this->bu... | [
"0.57512695",
"0.5335956",
"0.50982386",
"0.50731194",
"0.5037613",
"0.50217915",
"0.49815577",
"0.4948903",
"0.49290672",
"0.49114808",
"0.48274946",
"0.47958314",
"0.47423187",
"0.47310835",
"0.47012198",
"0.4686132",
"0.46822485",
"0.46796846",
"0.4667601",
"0.46652934",
"... | 0.0 | -1 |
constructor method accepts an optional $locale, otherwise the default will be used | public function __construct ()
{
// check if a locale is present in the session
// otherwise use default
/*
if(Config::get('gettext::config.gettext_type') === 'gettext'):
$session_locale = Session::get('gettext_locale', null);
$locale = (is_null($session_locale)) ? Config::get("gettext::config.default_locale") : $session_locale;
Session::forget('gettext_locale');
// check if an encoding is present in the session
$session_encoding = Session::get('gettext_encoding', null);
$encoding = (is_null($session_encoding)) ? Config::get("gettext::config.default_encoding") : $session_encoding;
Session::forget('gettext_encoding');
// set the encoding and locale
$this->setEncoding($encoding)->setLocale($locale);
// determine and set textdomain
$textdomain = Config::get("gettext::config.textdomain");
$path = Config::get("gettext::config.path_to_mo");
$this->setTextDomain($textdomain, $path);
endif;
*/
$session_locale = Session::get('user.lang', null);
$locale = (is_null($session_locale)) ? Config::get("gettext::config.default_locale") : $session_locale;
Session::put('user.lang', $locale);
DEFINE('LOCALE',$locale);
$this->loadGettextLib($locale);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct($locale = null) \r\n\t{\t\r\n\t\t// call the parent constructor\r\n\t\tif ($locale) {\r\n\t\t\tparent::__construct( $locale );\r\n\t\t} else {\r\n\t\t\tparent::__construct();\r\n\t\t}\r\n\t}",
"public function __construct($locale = 'en_UK')\n {\n $this->locale = $locale;\n ... | [
"0.84578246",
"0.8433195",
"0.8106652",
"0.8045526",
"0.76651657",
"0.7605004",
"0.7386931",
"0.73523545",
"0.7234855",
"0.7221175",
"0.7094039",
"0.7075946",
"0.6976565",
"0.6920702",
"0.6875195",
"0.6875195",
"0.6872673",
"0.68600523",
"0.6846383",
"0.684363",
"0.68276376",... | 0.66445756 | 29 |
method which auto creates the LC_MESSAGES folder for each set locale, if they do not exist yet | public function createFolder ($path)
{
// set full path
$full_path = app_path() . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $this->getLocale() . DIRECTORY_SEPARATOR . 'LC_MESSAGES';
// check if the folder exists
if (!File::isDirectory($full_path))
{
// folder does not exist, attempt to create it
// throws an ErrorException when failed
if (!File::makeDirectory($full_path, 0755, true))
throw new LocaleFolderCreationException("The locale folder [$full_path] does not exist and could not be created automatically; please create the folder manually");
}
// allow object chaining
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function initLocalization() {\n $moFiles = scandir(trailingslashit($this->dir) . 'languages/');\n foreach ($moFiles as $moFile) {\n if (strlen($moFile) > 3 && substr($moFile, -3) == '.mo' && strpos($moFile, get_locale()) > -1) {\n load_textdomain('WP_Visual_Chat', tra... | [
"0.6849074",
"0.67757785",
"0.66482526",
"0.65942484",
"0.65434074",
"0.6441537",
"0.63368994",
"0.6209573",
"0.62066704",
"0.61960584",
"0.6057612",
"0.60370445",
"0.60050964",
"0.59724534",
"0.5932459",
"0.5908964",
"0.5902499",
"0.58570105",
"0.58504015",
"0.5844333",
"0.5... | 0.61686534 | 10 |
method to dump the current locale/encoding settings to string | public function __toString ()
{
return (string) $this->getLocaleAndEncoding();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __toString()\n {\n return $this->getLocale();\n }",
"protected function setUtf8Context()\n {\n setlocale(LC_ALL, $locale = 'en_US.UTF-8');\n putenv('LC_ALL=' . $locale);\n }",
"function __toString(){\n\t\treturn \"UTF-8\";\n\t}",
"protected static function enc... | [
"0.61512303",
"0.5964438",
"0.59439087",
"0.5921155",
"0.5865788",
"0.5865788",
"0.5865788",
"0.58548486",
"0.58451104",
"0.58379936",
"0.5772596",
"0.57654315",
"0.57466245",
"0.5735721",
"0.57076937",
"0.56986123",
"0.5679039",
"0.56492466",
"0.5648888",
"0.5609941",
"0.558... | 0.6692407 | 0 |
/ Make Pay Msg | function MakeMsg()
{
$this->log->WriteLog( INFO, "Make Msg Start" );
/****************************************************************************
* ※ 결제 형태 변수의 값에 따른 결제 구분
*
* * AuthTy = "card" 신용카드결제
* - SubTy = "isp" 안전결제ISP
* - SubTy = "visa3d" 안심클릭
* - SubTy = "normal" 일반결제
*
* * AuthTy = "iche" 일반-계좌이체
*
* * AuthTy = "virtual" 일반-가상계좌(무통장입금)
*
* * AuthTy = "hp" 핸드폰결제
*
* * AuthTy = "ars" ARS결제
*
****************************************************************************/
if( strcmp( $this->REQUEST["AuthTy"], "card" ) == 0 )
{
if( strcmp( $this->REQUEST["SubTy"], "isp" ) == 0 )
{
/****************************************************************************
*
* [1-1] 신용카드결제 - ISP
*
* -- 이부분은 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 승인 요청 전문 포멧
* + 데이터길이(6) + ISP구분코드(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 결제종류(6) | 업체ID(20) | 회원ID(20) | 결제금액(12) |
* 주문번호(40) | 단말기번호(10) | 수신인(40) | 수신인전화(21) |
* 배송지(100) | 주문자명(40) | 주문자연락처(100) | 기타요구사항(350) |
* 상품명(300) | 통화코드(3) | 일반할부기간(2) | 무이자할부기간(2) |
* KVP카드코드(22) | 세션키(256) | 암호화데이터(2048) | 카드명(50) |
* 회원 IP(20) | 회원 Email(50) | 망취소ID (50) |
*
****************************************************************************/
$this->ENCTYPE = 2;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"plug15"."|".
$this->REQUEST["StoreId"]."|".
$this->REQUEST["UserId"]."|".
$this->REQUEST["Amt"]."|".
$this->REQUEST["OrdNo"]."|".
$this->REQUEST["DeviId"]."|".
$this->REQUEST["RcpNm"]."|".
$this->REQUEST["RcpPhone"]."|".
$this->REQUEST["DlvAddr"]."|".
$this->REQUEST["OrdNm"]."|".
$this->REQUEST["OrdPhone"]."|".
$this->REQUEST["Remark"]."|".
$this->REQUEST["ProdNm"]."|".
$this->REQUEST["KVP_CURRENCY"]."|".
$this->REQUEST["partial_mm"]."|".
$this->REQUEST["noIntMonth"]."|".
$this->REQUEST["KVP_CARDCODE"]."|".
$this->REQUEST["KVP_SESSIONKEY"]."|".
$this->REQUEST["KVP_ENCDATA"]."|".
$this->REQUEST["KVP_CONAME"]."|".
$this->REQUEST["UserIp"]."|".
$this->REQUEST["UserEmail"]."|".
$this->RESULT["NetCancID"]."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."Make MSG OK " );
}
else if( ( strcmp( $this->REQUEST["SubTy"], "visa3d" ) == 0 ) || ( strcmp( $this->REQUEST["SubTy"], "normal" ) == 0 ) )
{
/****************************************************************************
*
* [1-2] 신용카드결제 - VISA3D, 일반
*
* -- 이부분은 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 승인 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 하며 카드번호,유효기간,비밀번호,주민번호는 암호화된다.)
* 결제종류(6) | 업체ID(20) | 회원ID(20) | 결제금액(12) | 주문번호(40) |
* 단말기번호(10) | 카드번호(16) | 유효기간(6) | 할부기간(4) | 인증유무(1) |
* 카드비밀번호(2) | 주민등록번호/사업자번호(10) | 수신인(40) | 수신인전화(21) | 배송지(100) |
* 주문자명(40) | 주문자연락처(100) | 기타요구사항(350) | 상품명(300) | MPI_CAVV | MPI_MD64 | MPI_ECI | 망취소ID (50) |
*
****************************************************************************/
$this->ENCTYPE = 0;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"plug15"."|".
$this->REQUEST["StoreId"]."|".
$this->REQUEST["UserId"]."|".
$this->REQUEST["Amt"]."|".
$this->REQUEST["OrdNo"]."|".
$this->REQUEST["DeviId"]."|".
$this->encrypt_aegis($this->REQUEST["CardNo"])."|".
$this->encrypt_aegis($this->REQUEST["ExpYear"].$this->REQUEST["ExpMon"])."|".
$this->REQUEST["Instmt"]."|".
$this->REQUEST["AuthYn"]."|".
$this->encrypt_aegis($this->REQUEST["Passwd"])."|".
$this->encrypt_aegis($this->REQUEST["SocId"])."|".
$this->REQUEST["RcpNm"]."|".
$this->REQUEST["RcpPhone"]."|".
$this->REQUEST["DlvAddr"]."|".
$this->REQUEST["OrdNm"]."|".
$this->REQUEST["UserIp"].";".$this->REQUEST["OrdPhone"]."|".
$this->REQUEST["UserEmail"].";".$this->REQUEST["Remark"]."|".
$this->REQUEST["ProdNm"]."|".
$this->REQUEST["MPI_CAVV"]."|".
$this->REQUEST["MPI_MD64"]."|".
$this->REQUEST["MPI_ECI"]."|".
$this->REQUEST["UserEmail"]."|".
$this->RESULT["NetCancID"]."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."Make MSG OK " );
}
}
else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHE_SOCKETYN"], "Y" ) == 0)
{
/****************************************************************************
*
* [2-1] 인터넷뱅킹 계좌이체(소켓) 처리
*
* -- 이부분은 인터넷뱅킹 결제 처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 인터넷뱅킹 결제 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 결제종류(10) | 업체ID(20) | 주문번호(40) | 예금주명(20) | 거래금액(8) |
* 은행코드(2) | 예금주주민번호(13) | 주문자연락처(16) | 이메일주소(50) | 상품명(100) |
* 이용기관주문번호(50) | FNBC 거래번호(20) | 이체시각(14) | 현금영수증발행여부(1) | 회원아이디(20) |
* 거래자구분(2) | 신분확인번호(13) | 에스크로사용여부(1) | 에스크로회원번호(17) | 에스크로결제금액(8)|
* 에스크로수수료금액(8) |
*
****************************************************************************/
$this->ENCTYPE = R;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"RB-PayReq"."|".
$this->REQUEST["StoreId"]."|".
$this->REQUEST["OrdNo"]."|".
$this->REQUEST["ICHE_OUTBANKMASTER"]."|".
$this->REQUEST["Amt"]."|".
$this->REQUEST["ICHE_OUTBANKNAME"]."|".
$this->REQUEST["ICHE_OUTACCTNO"]."|".
$this->REQUEST["OrdPhone"]."|".
$this->REQUEST["UserEmail"]."|".
$this->REQUEST["ProdNm"]."|".
$this->REQUEST["ICHE_POSMTID"]."|".
$this->REQUEST["ICHE_FNBCMTID"]."|".
$this->REQUEST["ICHE_APTRTS"]."|".
$this->REQUEST["ICHE_CASHYN"]."|".
$this->REQUEST["UserId"]."|".
$this->REQUEST["ICHE_CASHGUBUN_CD"]."|".
$this->REQUEST["ICHE_CASHID_NO"]."|".
$this->REQUEST["ICHE_ECWYN"]."|".
$this->REQUEST["ICHE_ECWID"]."|".
$this->REQUEST["ICHE_ECWAMT1"]."|".
$this->REQUEST["ICHE_ECWAMT2"]."|".
$this->RESULT["NetCancID"]."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make MSG OK " );
}
else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHEARS_SOCKETYN"], "Y" ) == 0)
{
/****************************************************************************
*
* [2-2] 텔레뱅킹 계좌이체(소켓) 처리
*
* -- 이부분은 텔레뱅킹 결제 처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 텔레뱅킹 결제 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 결제종류(10) | 업체ID(20) | 주문번호(40) | 예금주명(20) |
* 거래금액(8) | 은행코드(2) | 예금주주민번호(13) | 주문자연락처(16) |
* 이메일주소(50) | 상품명(100) | 이용기관주문번호(50) | FNBC 거래번호(20) |
* 이체시각(14) | 현금영수증발행여부(1) | 회원아이디(20) | 거래자구분(2) |
* 신분확인번호(13) | 에스크로사용여부(1) | 에스크로회원번호(17) | 에스크로결제금액(8) |
* 에스크로수수료금액(8) |
*
****************************************************************************/
$this->ENCTYPE = B;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"TB-PayReq"."|".
$this->REQUEST["StoreId"]."|".
$this->REQUEST["OrdNo"]."|".
$this->REQUEST["ICHEARS_POSMTID"]."|".
$this->REQUEST["ICHEARS_ADMNO"]."|".
$this->REQUEST["ICHEARS_CENTERCD"]."|".
$this->REQUEST["Amt"]."|".
$this->REQUEST["ICHE_OUTACCTNO"]."|".
$this->REQUEST["ICHE_OUTBANKMASTER"]."|".
$this->REQUEST["ICHEARS_HPNO"]."|".
$this->REQUEST["UserEmail"]."|".
$this->REQUEST["ProdNm"]."|".
$this->REQUEST["ICHE_ECWYN"]."|".
$this->REQUEST["ICHE_ECWID"]."|".
$this->REQUEST["ICHE_ECWAMT1"]."|".
$this->REQUEST["ICHE_ECWAMT2"]."|".
$this->REQUEST["ICHE_CASHYN"]."|".
$this->REQUEST["ICHE_CASHGUBUN_CD"]."|".
$this->REQUEST["ICHE_CASHID_NO"]."|".
$this->RESULT["NetCancID"]."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make MSG OK " );
}
else if( strcmp( $this->REQUEST["AuthTy"], "virtual" ) == 0 ) //가상계좌추가
{
/****************************************************************************
*
* [3] 가상계좌 결제
*
* -- 이부분은 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 승인 요청 전문 포멧
* + 데이터길이(6) + 암호화 구분(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 결제종류(10) | 업체ID(20) | 주문번호(40) | 은행코드(4) | 가상계좌번호(20) |
* 거래금액(13) | 입금예정일(8) | 구매자명(20) | 주민번호(13) |
* 이동전화(21) | 이메일(50) | 구매자주소(100) | 수신자명(20) |
* 수신자연락처(21) | 배송지주소(100) | 상품명(100) | 기타요구사항(300) | 상점 도메인(50) | 상점 페이지(100)|
*
****************************************************************************/
$this->ENCTYPE = "V";
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
/* $this->REQUEST["AuthTy"]."|". */
"vir_n|".
$this->REQUEST["StoreId"]."|".
$this->REQUEST["OrdNo"]."|".
$this->REQUEST["VIRTUAL_CENTERCD"]."|".
$this->REQUEST["VIRTUAL_NO"]."|".
$this->REQUEST["Amt"]."|".
$this->REQUEST["VIRTUAL_DEPODT"]."|".
$this->REQUEST["OrdNm"]."|".
$this->REQUEST["ZuminCode"]."|".
$this->REQUEST["OrdPhone"]."|".
$this->REQUEST["UserEmail"]."|".
$this->REQUEST["OrdAddr"]."|".
$this->REQUEST["RcpNm"]."|".
$this->REQUEST["RcpPhone"]."|".
$this->REQUEST["DlvAddr"]."|".
$this->REQUEST["ProdNm"]."|".
$this->REQUEST["Remark"]."|".
$this->REQUEST["MallUrl"]."|".
$this->REQUEST["MallPage"]."|".
$this->RESULT["NetCancID"]."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make MSG OK " );
}
else if( strcmp( $this->REQUEST["AuthTy"], "hp" ) == 0 )
{
/****************************************************************************
*
* [4] 핸드폰 결제
*
* 핸드폰 결제를 사용하지않는 상점은 AGS_pay.html에서 지불방법을 꼭 신용카드(전용)으로 설정해 놓으시기 바랍니다.
*
* 이부분은 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 테스트를 하여야 한다.
* -- 승인 요청 전문 포멧
* + 데이터길이(6) + 핸드폰구분코드(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
*
****************************************************************************/
$this->ENCTYPE = "h";
$this->REQUEST["StrSubTy"] = "Bill";
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
$this->REQUEST["StrSubTy"]."|".
$this->REQUEST["StoreId"]."|".
$this->REQUEST["HP_SERVERINFO"]."|".
$this->REQUEST["HP_ID"]."|".
$this->REQUEST["HP_SUBID"]."|".
$this->REQUEST["OrdNo"]."|".
$this->REQUEST["Amt"]."|".
$this->REQUEST["HP_UNITType"]."|".
$this->REQUEST["HP_HANDPHONE"]."|".
$this->REQUEST["HP_COMPANY"]."|".
$this->REQUEST["HP_IDEN"]."|".
$this->REQUEST["UserId"]."|".
$this->REQUEST["UserEmail"]."|".
$this->REQUEST["HP_IPADDR"]."|".
$this->REQUEST["ProdNm"]."|".
$this->RESULT["NetCancID"]."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make MSG OK " );
}
else if( strcmp( $this->REQUEST["AuthTy"], "ars" ) == 0 )
{
/****************************************************************************
*
* [5] ARS 결제
*
* ARS 결제를 사용하지않는 상점은 AGS_pay.html에서 지불방법을 꼭 신용카드(전용)으로 설정해 놓으시기 바랍니다.
*
* 이부분은 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 테스트를 하여야 한다.
* -- 승인 요청 전문 포멧
* + 데이터길이(6) + ARS구분코드(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
*
****************************************************************************/
$this->ENCTYPE = "A";
$this->REQUEST["StrSubTy"] = "ABill";
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
$this->REQUEST["StrSubTy"]."|".
$this->REQUEST["StoreId"]."|".
$this->REQUEST["HP_SERVERINFO"]."|".
$this->REQUEST["HP_ID"]."|".
$this->REQUEST["HP_UNITType"]."|".
$this->REQUEST["Amt"]."|".
$this->REQUEST["ProdNm"]."|".
$this->REQUEST["UserEmail"]."|".
$this->REQUEST["HP_SUBID"]."|".
$this->REQUEST["OrdNo"]."|".
$this->REQUEST["UserId"]."|".
$this->REQUEST["ARS_PHONE"]."|".
$this->REQUEST["HP_IDEN"]."|".
$this->REQUEST["ARS_NAME"]."|".
$this->REQUEST["HP_COMPANY"]."|".
$this->REQUEST["HP_IPADDR"]."|".
$this->RESULT["NetCancID"]."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make MSG OK " );
}else{
$this->ERRMSG .= "결제수단 오류. AuthTy:[".$this->REQUEST["AuthTy"]."],SubTy:[".$this->REQUEST["SubTy"]."]";
$this->log->WriteLog( ERROR, $this->ERRMSG );
$this->RESULT["rSuccYn"] = "n";
$this->RESULT["rResMsg"] = $this->ERRMSG;
return false;
}
$this->log->WriteLog( INFO, "Make Msg End" );
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pay();",
"public function createPackageStr($params)\n {\n $out_trade_no = $params['productid'];\n $fee = $params['money_paid'];\n $opts = array(\n 'bank_type' => 'WX',\n 'body' => $params['subject'],\n 'partner' => $this->getPartner(),\n ... | [
"0.7055077",
"0.647994",
"0.63968205",
"0.6366839",
"0.62887305",
"0.6157376",
"0.6116956",
"0.61072886",
"0.61068356",
"0.6042764",
"0.59989667",
"0.5990459",
"0.59878",
"0.5976439",
"0.59706545",
"0.595034",
"0.59163433",
"0.59089184",
"0.59023654",
"0.58902603",
"0.5886441... | 0.57909906 | 32 |
MakeMsg() End / Make Cancel Msg | function MakeCancelMsg()
{
$this->log->WriteLog( INFO, "Make Cancel Msg Start" );
if( strcmp( $this->REQUEST["AuthTy"], "card" ) == 0 )
{
if( strcmp( $this->REQUEST["SubTy"], "isp" ) == 0 )
{
/****************************************************************************
*
* [1-1] 신용카드승인취소 - ISP
*
* -- 이부분은 취소 승인 처리를 위해 PG서버Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 취소 승인 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.
* 결제종류(6) | 업체아이디(20) | 승인번호(20) | 승인시간(8) | 거래고유번호(6) |
*
* -- 취소 승인 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.
* 업체ID(20) | 승인번호(20) | 승인시각(8) | 전문코드(4) | 거래고유번호(6) | 성공여부(1) |
*
****************************************************************************/
$this->ENCTYPE = 2;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"cancel"."|".
$this->GetResult("StoreId")."|".
$this->GetResult("rApprNo")."|".
substr($this->GetResult("rApprTm"),0,8)."|".
$this->GetResult("rDealNo")."|".
$this->GetResult("NetCancID")."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."Make Cancel MSG OK " );
}
else if( ( strcmp( $this->REQUEST["SubTy"], "visa3d" ) == 0 ) || ( strcmp( $this->REQUEST["SubTy"], "normal" ) == 0 ) )
{
/****************************************************************************
*
* [1-2] 신용카드승인취소 - VISA3D, 일반
*
* -- 이부분은 취소 승인 처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
*
* -- 취소 승인 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 하며 카드번호,유효기간,비밀번호,주민번호는 암호화된다.)
* 결제종류(6) | 업체아이디(20) | 승인번호(8) | 승인시간(14) | 카드번호(16) |
*
* -- 취소 승인 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.
* 업체ID(20) | 승인번호(8) | 승인시각(14) | 전문코드(4) | 성공여부(1) |
* 주문번호(20) | 할부개월(2) | 결제금액(20) | 카드사명(20) | 카드사코드(4) |
* 가맹점번호(15) | 매입사코드(4) | 매입사명(20) | 전표번호(6)
*
****************************************************************************/
$this->ENCTYPE = 0;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"cancel"."|".
$this->GetResult("StoreId")."|".
$this->GetResult("rApprNo")."|".
substr($this->GetResult("rApprTm"),0,8)."|".
$this->GetResult("rDealNo")."|".
$this->GetResult("NetCancID")."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."Make Cancel MSG OK " );
}
}else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHE_SOCKETYN"], "Y" ) == 0){
/****************************************************************************
*
* [2-1] 인터넷뱅킹 계좌이체(소켓) 취소처리
*
* -- 이부분은 인터넷뱅킹 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 인터넷뱅킹 결제 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 결제종류(10) | 업체ID(20) | MTID(계좌이체결제 결과값) | 결제금액(8) | 은행코드(2)
*
****************************************************************************/
$this->ENCTYPE = R;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"RB-CanReq"."|".
$this->GetResult("StoreId")."|".
$this->GetResult("ICHE_POSMTID")."|".
$this->GetResult("Amt")."|".
$this->GetResult("ICHE_OUTBANKNAME")."|".
$this->GetResult("NetCancID")."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make Cancel MSG OK " );
}else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHEARS_SOCKETYN"], "Y" ) == 0){
/****************************************************************************
*
* [2-1] 텔레뱅킹 계좌이체(소켓) 취소처리
*
* -- 이부분은 텔레뱅킹 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 텔레뱅킹 결제 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 결제종류(10) | 업체ID(20) | MTID(계좌이체결제 결과값) | 결제금액(8) | 은행코드(2)
*
****************************************************************************/
$this->ENCTYPE = B;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"TB-CanReq"."|".
$this->GetResult("StoreId")."|".
""."|".
""."|".
$this->GetResult("NetCancID")."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make Cancel MSG OK " );
}else if( strcmp( $this->REQUEST["AuthTy"], "hp" ) == 0 ){
/****************************************************************************
*
* [3] 핸드폰 취소처리
*
* -- 이부분은 핸드폰 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- 핸드폰 결제 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 결제종류(10) | 업체ID(20) | NetCancID |
*
****************************************************************************/
$this->ENCTYPE = H;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"MobileCanReq"."|".
$this->GetResult("StoreId")."|".
$this->GetResult("NetCancID")."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make Cancel MSG OK " );
}else if( strcmp( $this->REQUEST["AuthTy"], "ars" ) == 0 ){
/****************************************************************************
*
* [4] ARS 취소처리
*
* -- 이부분은 ARS 결제 취소처리를 위해 암호화Process와 Socket통신하는 부분이다.
* 가장 핵심이 되는 부분이므로 수정후에는 실제 서비스전까지 적절한 테스트를 하여야 한다.
* -- 데이터 길이는 매뉴얼 참고
*
* -- ARS 결제 요청 전문 포멧
* + 데이터길이(6) + 암호화여부(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 결제종류(10) | 업체ID(20) | NetCancID |
*
****************************************************************************/
$this->ENCTYPE = A;
/****************************************************************************
*
* 전송 전문 Make
*
****************************************************************************/
$this->sDataMsg = $this->ENCTYPE.
"ARSCanReq"."|".
$this->GetResult("StoreId")."|".
$this->GetResult("NetCancID")."|";
$this->sSendMsg = sprintf( "%06d%s", strlen( $this->sDataMsg ), $this->sDataMsg );
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Make Cancel MSG OK " );
}else{
//신용카드,계좌이체 이외의 결제수단은 취소기능 적용되지 않음.
$this->log->WriteLog( WARN, "Cancel Passed. AuthTy : [".$this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]."] " );
$this->RESULT["rCancelSuccYn"] = "n";
$this->RESULT["rCancelResMsg"] = "Cannot Cancel AuthTy[".$this->REQUEST["AuthTy"]."]";
return false;
}
$this->log->WriteLog( INFO, "Make Cancel Msg End" );
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cancel();",
"public static function messageBox(string $msg, string $caption = 'Message') : void\n {\n // to show object data, use var_export (similar to var_dump):\n // \\Flexio\\System\\Program::messageBox(var_export($validation_info,true));\n\n if (\\Flexio\\System\\Syst... | [
"0.5731914",
"0.5690395",
"0.5517218",
"0.5479081",
"0.5478776",
"0.54496837",
"0.53853995",
"0.53562933",
"0.5350993",
"0.53453493",
"0.531666",
"0.52889264",
"0.52889264",
"0.5254482",
"0.5223262",
"0.5201813",
"0.5188008",
"0.5188008",
"0.51671016",
"0.51656365",
"0.510703... | 0.62680733 | 0 |
MakeCancelMsg End / RecvMsg Parsing | function ParseMsg()
{
$this->log->WriteLog( INFO, "Parse Msg Start" );
/****************************************************************************
* ※ 결제 형태 변수의 값에 따른 결제 구분
*
* * AuthTy = "card" 신용카드결제
* - SubTy = "isp" 안전결제ISP
* - SubTy = "visa3d" 안심클릭
* - SubTy = "normal" 일반결제
*
* * AuthTy = "iche" 일반-계좌이체
*
* * AuthTy = "virtual" 일반-가상계좌(무통장입금)
*
* * AuthTy = "hp" 핸드폰결제
*
* * AuthTy = "ars" ARS결제
*
****************************************************************************/
if( strcmp( $this->REQUEST["AuthTy"], "card" ) == 0 )
{
if( strcmp( $this->REQUEST["SubTy"], "isp" ) == 0 )
{
/****************************************************************************
*
* [1-1] 신용카드 안전결제ISP 처리
*
*
* -- 승인 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.
* 업체ID(20) | 전문코드(4) | 거래고유번호(6) | 승인번호(8) |
* 거래금액(12) | 성공여부(1) | 실패사유(20) | 승인시각(14) |
* 카드사코드(4) |
*
****************************************************************************/
$this->RESULT["rStoreId"] = $this->RecvValArray[0];
$this->RESULT["rBusiCd"] = $this->RecvValArray[1];
$this->RESULT["rOrdNo"] = $this->REQUEST["OrdNo"];
$this->RESULT["rDealNo"] = $this->RecvValArray[2];
$this->RESULT["rApprNo"] = $this->RecvValArray[3];
$this->RESULT["rProdNm"] = $this->REQUEST["ProdNm"];
$this->RESULT["rAmt"] = $this->RecvValArray[4];
$this->RESULT["rInstmt"] = $this->REQUEST["KVP_QUOTA"];
$this->RESULT["rSuccYn"] = $this->RecvValArray[5];
$this->RESULT["rResMsg"] = $this->RecvValArray[6];
$this->RESULT["rApprTm"] = $this->RecvValArray[7];
$this->RESULT["rCardCd"] = $this->RecvValArray[8];
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."RECV MSG Parsing OK " );
}
else if( ( strcmp( $this->REQUEST["SubTy"], "visa3d" ) == 0 ) || ( strcmp( $this->REQUEST["SubTy"], "normal" ) == 0 ) )
{
/****************************************************************************
*
* [1-2] 안심클릭 or 일반결제 처리 승인응답 전문포맷
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.
* 업체ID(20) | 전문코드(4) | 주문번호(40) | 승인번호(8) | 거래금액(12) |
* 성공여부(1) | 실패사유(20) | 카드사명(20) | 승인시각(14) | 카드사코드(4) |
* 가맹점번호(15) | 매입사코드(4) | 매입사명(20) | 전표번호(6) |
*
****************************************************************************/
$this->RESULT["rStoreId"] = $this->RecvValArray[0];
$this->RESULT["rBusiCd"] = $this->RecvValArray[1];
$this->RESULT["rOrdNo"] = $this->RecvValArray[2];
$this->RESULT["rApprNo"] = $this->RecvValArray[3];
$this->RESULT["rInstmt"] = $this->REQUEST["Instmt"];
$this->RESULT["rAmt"] = $this->RecvValArray[4];
$this->RESULT["rSuccYn"] = $this->RecvValArray[5];
$this->RESULT["rResMsg"] = $this->RecvValArray[6];
$this->RESULT["rCardNm"] = $this->RecvValArray[7];
$this->RESULT["rApprTm"] = $this->RecvValArray[8];
$this->RESULT["rCardCd"] = $this->RecvValArray[9];
$this->RESULT["rMembNo"] = $this->RecvValArray[10];
$this->RESULT["rAquiCd"] = $this->RecvValArray[11];
$this->RESULT["rAquiNm"] = $this->RecvValArray[12];
$this->RESULT["rDealNo"] = $this->RecvValArray[13];
$this->RESULT["rProdNm"] = $this->REQUEST["ProdNm"];
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."RECV MSG Parsing OK " );
}
}
else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHE_SOCKETYN"], "Y" ) == 0)
{
/****************************************************************************
*
* [2-1] 계좌이체 소켓방식(인터넷뱅킹) 결제 요청 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.
* 결제종류(10) | 상점아이디(20) | 주문번호(40) | 이용기관주문번호(50) | 결과코드(4) | 결과메시지(300) |
*
****************************************************************************/
$this->RESULT["rStoreId"] = $this->RecvValArray[1];
$this->RESULT["rOrdNo"] = $this->RecvValArray[2];
$this->RESULT["rMTid"] = $this->RecvValArray[3];
$this->RESULT["ES_SENDNO"] = $this->RecvValArray[4];
$this->RESULT["rSuccYn"] = $this->RecvValArray[5];
$this->RESULT["rResMsg"] = $this->RecvValArray[6];
$this->RESULT["rAmt"] = $this->REQUEST["Amt"];
$this->RESULT["rProdNm"] = $this->REQUEST["ProdNm"];
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."RECV MSG Parsing OK " );
}
else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHEARS_SOCKETYN"], "Y" ) == 0)
{
/****************************************************************************
*
* [2-2] 계좌이체 텔레뱅킹 처리
*
* -- 텔레뱅킹 결제 요청 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.
* 결제종류(10) | 상점아이디(20) | 주문번호(40) | 이용기관주문번호(50) | 결과코드(4) | 결과메시지(300) |*
*
****************************************************************************/
$this->RESULT["rStoreId"] = $this->RecvValArray[1];
$this->RESULT["rOrdNo"] = $this->RecvValArray[2];
$this->RESULT["rMTid"] = $this->RecvValArray[3];
$this->RESULT["rSuccYn"] = $this->RecvValArray[4];
$this->RESULT["rResMsg"] = $this->RecvValArray[5];
$this->RESULT["rAmt"] = $this->REQUEST["Amt"];
$this->RESULT["rProdNm"] = $this->REQUEST["ProdNm"];
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Parse MSG Passed " );
$pos = strpos($this->RESULT["rResMsg"],':');
if( $pos !== false )
{
$this->RESULT["ES_SENDNO"] = substr($this->RESULT["rResMsg"],$pos+1,6) ;
$this->log->WriteLog( INFO, "ES_SENDNO : [".$this->RESULT["ES_SENDNO"]."] ");
}
}
else if( strcmp( $this->REQUEST["AuthTy"], "virtual" ) == 0 )
{
/****************************************************************************
*
* [3] 가상계좌(무통장입금) 처리
*
* -- 승인 응답 전문 포멧
* + 데이터길이(6) + 암호화 구분(1) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.
* 결제종류(10) | 업체ID(20) | 승인일자(14) | 가상계좌번호(20) | 결과코드(1) | 결과메시지(100) |
*
****************************************************************************/
$this->RESULT["rAuthTy"] = $this->RecvValArray[0];
$this->RESULT["rStoreId"] = $this->RecvValArray[1];
$this->RESULT["rApprTm"] = $this->RecvValArray[2];
$this->RESULT["rVirNo"] = $this->RecvValArray[3];
$this->RESULT["rSuccYn"] = $this->RecvValArray[4];
$this->RESULT["rResMsg"] = $this->RecvValArray[5];
$this->RESULT["rOrdNo"] = $this->REQUEST["OrdNo"];
$this->RESULT["rProdNm"] = $this->REQUEST["ProdNm"];
$this->RESULT["rAmt"] = $this->REQUEST["Amt"];
$pos = strpos($this->RESULT["rResMsg"],':');
if( $pos !== false )
{
$this->RESULT["ES_SENDNO"] = substr($this->RESULT["rResMsg"],$pos+1,6) ;
$this->log->WriteLog( INFO, "ES_SENDNO : [".$this->RESULT["ES_SENDNO"]."] ");
}
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."RECV MSG Parsing OK " );
}
else if( strcmp( $this->REQUEST["AuthTy"], "hp" ) == 0 )
{
/****************************************************************************
*
* [4] 핸드폰 결제
*
* -- 승인 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 업체ID(20) | 결과코드(1) | 결과메시지(100) | 핸드폰결제일(8) | 핸드폰결제 TID(12) | 거래금액(12) | 주문번호(40) |
*
****************************************************************************/
$this->RESULT["rStoreId"] = $this->RecvValArray[0];
$this->RESULT["rSuccYn"] = $this->RecvValArray[1];
$this->RESULT["rResMsg"] = $this->RecvValArray[2];
$this->RESULT["rHP_DATE"] = $this->RecvValArray[3];
$this->RESULT["rHP_TID"] = $this->RecvValArray[4];
$this->RESULT["rAmt"] = $this->REQUEST["Amt"];
$this->RESULT["rOrdNo"] = $this->REQUEST["OrdNo"];
$this->RESULT["rProdNm"] = $this->REQUEST["ProdNm"];
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."RECV MSG Parsing OK " );
}
else if( strcmp( $this->REQUEST["AuthTy"], "ars" ) == 0 )
{
/****************************************************************************
*
* [5] ARS 결제
*
* -- 승인 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 한다.)
* 업체ID(20) | 결과코드(1) | 결과메시지(100) | ARS결제일(8) | ARS결제 TID(12) | 거래금액(12) | 주문번호(40) |
*
****************************************************************************/
$this->RESULT["rStoreId"] = $this->RecvValArray[0];
$this->RESULT["rSuccYn"] = $this->RecvValArray[1];
$this->RESULT["rResMsg"] = $this->RecvValArray[2];
$this->RESULT["rHP_DATE"] = $this->RecvValArray[3];
$this->RESULT["rHP_TID"] = $this->RecvValArray[4];
$this->RESULT["rAmt"] = $this->REQUEST["Amt"];
$this->RESULT["rOrdNo"] = $this->REQUEST["OrdNo"];
$this->RESULT["rProdNm"] = $this->REQUEST["ProdNm"];
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."RECV MSG Parsing OK " );
}else{
$this->log->WriteLog( FATAL, "Unknown AuthTy. AuthTy:[".$this->REQUEST["AuthTy"]."],SubTy:[".$this->REQUEST["SubTy"]."]");
return false;
}
$this->log->WriteLog( INFO, "Parse Msg End" );
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ParseCancelMsg() \n\t{\n\t\t$this->log->WriteLog( INFO, \"Parse Cancel Msg Start\" );\n\t\tif( strcmp( $this->REQUEST[\"AuthTy\"], \"card\" ) == 0 )\n\t\t{\n\t\t\tif( strcmp( $this->REQUEST[\"SubTy\"], \"isp\" ) == 0 )\n\t\t\t{\n\t\t\t\t/* [1-1] 안전결제ISP 처리 */\t\t\t\t\t\n\n\t\t\t\t$this->RESULT[\"rStoreId\... | [
"0.77090985",
"0.6340907",
"0.599887",
"0.5420693",
"0.51980245",
"0.51169914",
"0.5116862",
"0.5035484",
"0.49367186",
"0.49275595",
"0.4890324",
"0.48768106",
"0.48179233",
"0.48060954",
"0.48042488",
"0.47740278",
"0.4749471",
"0.47234458",
"0.47113094",
"0.46997076",
"0.4... | 0.49345735 | 9 |
ParseMsg() End / RecvCancelMsg Parsing | function ParseCancelMsg()
{
$this->log->WriteLog( INFO, "Parse Cancel Msg Start" );
if( strcmp( $this->REQUEST["AuthTy"], "card" ) == 0 )
{
if( strcmp( $this->REQUEST["SubTy"], "isp" ) == 0 )
{
/* [1-1] 안전결제ISP 처리 */
$this->RESULT["rStoreId"] = $this->RecvValArray[0];
$this->RESULT["rApprNo"] = $this->RecvValArray[1];
$this->RESULT["rApprTm"] = $this->RecvValArray[2];
$this->RESULT["rBusiCd"] = $this->RecvValArray[3];
$this->RESULT["rDealNo"] = $this->RecvValArray[4];
$this->RESULT["rCancelSuccYn"] = $this->RecvValArray[5];
$this->RESULT["rCancelResMsg"] = $this->RecvValArray[6];
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."RECV MSG Parsing OK " );
}
else if( ( strcmp( $this->REQUEST["SubTy"], "visa3d" ) == 0 ) || ( strcmp( $this->REQUEST["SubTy"], "normal" ) == 0 ) )
{
/* [1-2] 안심클릭 or 일반결제 처리 */
$this->RESULT["rStoreId"] = $this->RecvValArray[0];
$this->RESULT["rApprNo"] = $this->RecvValArray[1];
$this->RESULT["rApprTm"] = $this->RecvValArray[2];
$this->RESULT["rBusiCd"] = $this->RecvValArray[3];
$this->RESULT["rCancelSuccYn"] = $this->RecvValArray[4];
$this->RESULT["rOrdNo"] = $this->RecvValArray[5];
$this->RESULT["rInstmt"] = $this->RecvValArray[6];
$this->RESULT["rAmt"] = $this->RecvValArray[7];
$this->RESULT["rCardNm"] = $this->RecvValArray[8];
$this->RESULT["rCardCd"] = $this->RecvValArray[9];
$this->RESULT["rMembNo"] = $this->RecvValArray[10];
$this->RESULT["rAquiCd"] = $this->RecvValArray[11];
$this->RESULT["rAquiNm"] = $this->RecvValArray[12];
$this->RESULT["rDealNo"] = $this->RecvValArray[13];
if($this->RESULT["rCancelSuccYn"] == "y")
{
$this->RESULT["rCancelResMsg"] = "정상취소";
}
else
{
$this->RESULT["rCancelResMsg"] = "취소실패";
}
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]."-".$this->REQUEST["SubTy"]." "."RECV MSG Parsing OK " );
}
}
else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHE_SOCKETYN"], "Y" ) == 0)
{
/* [2-1] 계좌이체 인터넷뱅킹 취소*/
/* [RB-CanRes|상점ID|posmTid|주문번호|y|취소성공|] */
$this->RESULT["rStoreId"] = $this->RecvValArray[1];
$this->RESULT["ICHE_POSMTID"] = $this->RecvValArray[2];
$this->RESULT["rOrdNo"] = $this->RecvValArray[3];
$this->RESULT["rCancelSuccYn"] = $this->RecvValArray[4];
$this->RESULT["rCancelResMsg"] = $this->RecvValArray[5];
}
else if( strcmp( $this->REQUEST["AuthTy"], "iche" ) == 0 && strcmp( $this->REQUEST["ICHEARS_SOCKETYN"], "Y" ) == 0)
{
/* [2-2] 계좌이체 텔레뱅킹 취소*/
/* [TB-CanRes|상점ID|posmTid|주문번호|y|취소성공|] */
$this->RESULT["rStoreId"] = $this->RecvValArray[1];
$this->RESULT["rMTid"] = $this->RecvValArray[2];
$this->RESULT["rCancelSuccYn"] = $this->RecvValArray[3];
$this->RESULT["rCancelResMsg"] = $this->RecvValArray[4];
}
else if( strcmp( $this->REQUEST["AuthTy"], "hp" ) == 0 )
{
/****************************************************************************
*
* [4] 핸드폰 결제 취소
*
* -- 취소 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.
* | MobileCanRes | 업체ID(20) | 성공여부(1) | 결과메세지 | 취소처리일시 | 이용기관주문번호 |
*
****************************************************************************/
/* [MobileCanRes|상점ID|결과(y/n)|결과메세지|취소일시|이용기관주문번호|] */
$this->RESULT["rStoreId"] = $this->RecvValArray[1];
$this->RESULT["rCancelSuccYn"] = $this->RecvValArray[2];
$this->RESULT["rCancelResMsg"] = $this->RecvValArray[3];
$this->RESULT["rCancelDate"] = $this->RecvValArray[4];
$this->RESULT["rTid"] = $this->RecvValArray[5];
}
else if( strcmp( $this->REQUEST["AuthTy"], "ars" ) == 0 )
{
/****************************************************************************
*
* [5] ARS 결제 취소
*
* -- 취소 응답 전문 포멧
* + 데이터길이(6) + 데이터
* + 데이터 포멧(데이터 구분은 "|"로 하며 암호화Process에서 해독된후 실데이터를 수신하게 된다.
* | ArsCanRes | 업체ID(20) | 성공여부(1) | 결과메세지 | 취소처리일시 | 이용기관주문번호 |
*
****************************************************************************/
/* [ArsCanRes|상점ID|결과(y/n)|결과메세지|취소일시|이용기관주문번호|] */
$this->RESULT["rStoreId"] = $this->RecvValArray[1];
$this->RESULT["rCancelSuccYn"] = $this->RecvValArray[2];
$this->RESULT["rCancelResMsg"] = $this->RecvValArray[3];
$this->RESULT["rCancelDate"] = $this->RecvValArray[4];
$this->RESULT["rTid"] = $this->RecvValArray[5];
}
else
{
$this->log->WriteLog( INFO, $this->REQUEST["AuthTy"]." "."Parse CancelMSG Passed " );
$this->RESULT["rCancelSuccYn"] = "n";
$this->RESULT["rCancelResMsg"] = "Cannot Cancel AuthTy[".$this->REQUEST["AuthTy"]."]";
return false;
}
$this->log->WriteLog( INFO, "Parse Cancel Msg End" );
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function readMessageEnd();",
"public static function decomposeMsg (string $msg) : array {\n\t\tif (($pos = strpos ($msg, ':')) === false || ($command = \\DataLib::isInt (substr ($msg, 0, $pos))) === false || !Command::isCommand ($command)) {\n\t\t\treturn [ Command::INVALID ];\n\t\t}\n\t\treturn ... | [
"0.62496626",
"0.5553664",
"0.55003005",
"0.5401865",
"0.53614014",
"0.53351736",
"0.52289736",
"0.51861334",
"0.51696557",
"0.51074755",
"0.5017843",
"0.50105345",
"0.50105345",
"0.50105345",
"0.50105345",
"0.4986406",
"0.49645597",
"0.49479386",
"0.49140695",
"0.49042082",
... | 0.74872094 | 0 |
/ Make NetCancel ID(); | function MakeNetCancID()
{
$this->log->WriteLog( INFO, "Make NetCancel ID Start" );
switch($this->REQUEST["AuthTy"]){
case("card"): // 신용카드
if( strcmp( $this->REQUEST["SubTy"], "isp" ) == 0 ) $TidTp = "ISP_"; else $TidTp = "VISA";
break;
case("iche"): // 은행 계좌 이체 (IBK:인터넷뱅킹, TBK:텔레뱅킹)
if( strcmp( $this->REQUEST["ICHE_SOCKETYN"], "Y" ) == 0 ) $TidTp = "IBK_"; else $TidTp = "TBK_";
break;
case("virtual"): // 가상계좌
$TidTp = "VIR_"; break;
case("hp"): // 휴대폰 결제
$TidTp = "HPP_"; break;
case("ars"): // ARS 전화결제
$TidTp = "ARS_"; break;
default:
$TidTp = "UNKW"; //미확인 결제방식
}
list($usec, $sec) = explode(" ", microtime());
$datestr = date("YmdHis", $sec).substr($usec,2,3); //YYYYMMDDHHMMSSSSS
//TID는 최소 31자리 ,최대 51자리를 넘지 않는다.
$this->RESULT["NetCancID"] = "AEGIS_".$TidTp . $this->REQUEST["StoreId"] . "_" . $datestr . rand(100,999);
if( (!strlen( $this->RESULT["NetCancID"] ) >= 31 && strlen( $this->RESULT["NetCancID"] ) <= 51) )
{
$this->log->WriteLog( ERROR, $this->RESULT["NetCancID"]);
return false;
}
$this->log->WriteLog( INFO, $this->RESULT["NetCancID"]);
$this->log->WriteLog( INFO, "Make NetCancel ID End" );
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cancel(): int;",
"public function cancel();",
"function ostGetCanceledStatusId()\r\n{\r\n\treturn 1;\r\n}",
"public function cancel(): void;",
"public function actionCancel()\n {\n }",
"public function cancel()\n {\n }",
"public function cancel()\n {\n }",
"public fu... | [
"0.7398135",
"0.6826887",
"0.68177027",
"0.68045336",
"0.6528489",
"0.6526428",
"0.6526428",
"0.6499311",
"0.6491651",
"0.6336501",
"0.6190153",
"0.6074491",
"0.6031924",
"0.5989189",
"0.5962",
"0.5741705",
"0.57363135",
"0.55791324",
"0.55590487",
"0.5554088",
"0.55418336",
... | 0.6271494 | 10 |
Get name of database | public function getSchemaName()
{
return $this->getTable()->getSchema()->getName();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getDatabaseName()\n {\n global $db;\n return $db->database;\n }",
"public static function GetDatabaseName() {\n\t\t\treturn QApplication::$Database[Person::GetDatabaseIndex()]->Database;\n\t\t}",
"public static function getDatabaseName()\n {\n }",
"pub... | [
"0.89710474",
"0.8807664",
"0.88062626",
"0.8803148",
"0.87919205",
"0.86676526",
"0.86437166",
"0.85761255",
"0.85329324",
"0.8523124",
"0.8518723",
"0.8466847",
"0.84385175",
"0.8437289",
"0.8333723",
"0.82513756",
"0.8249755",
"0.8226964",
"0.8213612",
"0.8198349",
"0.8162... | 0.0 | -1 |
Get name of column | public function getName()
{
return $this['column_name'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function column_name(): mixed\n\t{\n\t\treturn self::$query->column_name;\n\t}",
"public function getColumnName();",
"public function getNameColumn()\n {\n return $this->nameColumn;\n }",
"public function getColumn(): string\n {\n return $this->column;\n }",
"publ... | [
"0.87750936",
"0.8556205",
"0.85281396",
"0.84585154",
"0.84172577",
"0.84102434",
"0.8409938",
"0.8364791",
"0.8170897",
"0.7926157",
"0.7836915",
"0.7834179",
"0.77914774",
"0.77914774",
"0.7765352",
"0.7706178",
"0.765601",
"0.75924397",
"0.7591639",
"0.758055",
"0.7504396... | 0.85707176 | 1 |
Validate the captcha, preventing the action from executing if the captcha fails by forwarding the user back to the source form. | function recaptcha_action_event_handler($class, $event, $parameters)
{
global $CONFIG;
if (($class == 'action') && (in_array($event, $CONFIG->recaptcha_actions)))
{
$resp = recaptcha_check_answer ($CONFIG->recaptcha_privatekey,
$_SERVER["REMOTE_ADDR"],
input_get('recaptcha_challenge_field'),
input_get('recaptcha_response_field')
);
if (!$resp->is_valid) {
error_message(_echo('recaptcha:failed'));
log_echo("(reCAPTCHA said: " . $resp->error . ")", 'ERROR');
forward($_SERVER['HTTP_REFERER']);
return false;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validate()\n\t{\n\t\t$arrCaptcha = $this->Session->get('captcha_' . $this->strId);\n\n\t\tif (!is_array($arrCaptcha) || !strlen($arrCaptcha['key']) || !strlen($arrCaptcha['sum']) || \\Input::post($arrCaptcha['key']) != $arrCaptcha['sum'] || $arrCaptcha['time'] > (time() - 3))\n\t\t{\n\t\t\t$this->c... | [
"0.70189464",
"0.6522858",
"0.62569714",
"0.61670995",
"0.6091771",
"0.60840416",
"0.6007879",
"0.6007141",
"0.5954355",
"0.5917162",
"0.5906451",
"0.590642",
"0.58927405",
"0.58841",
"0.5860278",
"0.58506256",
"0.58426744",
"0.5806755",
"0.5802624",
"0.5793692",
"0.5789474",... | 0.54911524 | 52 |
Sets the name of the product | public function setName(string $name)
{
$this->name = $name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProductName($product_name){\n $this->product_name = $product_name;\n }",
"public function setName(string $name) : void\n {\n $this->set('name', $name, 'products');\n }",
"public function setItemName()\n {\n if ($product = $this->product) {\n $name = $pro... | [
"0.8455803",
"0.8269818",
"0.8169795",
"0.77194893",
"0.7626728",
"0.75515145",
"0.73829025",
"0.7319127",
"0.7256896",
"0.7255122",
"0.7253544",
"0.72503793",
"0.7245146",
"0.7232672",
"0.7229399",
"0.7215675",
"0.7215675",
"0.7215675",
"0.7215675",
"0.7200551",
"0.71995354"... | 0.6935231 | 96 |
Gets the name of the product | public function getName()
{
return $this->name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProductName()\n {\n return $this->product_name;\n }",
"public function getProductName()\n {\n return $this->product_name;\n }",
"public function getName_product()\n {\n return $this->name_product;\n }",
"public static function get_name() {\n $type = st... | [
"0.88874096",
"0.877623",
"0.8731499",
"0.85599744",
"0.8527828",
"0.848266",
"0.8389832",
"0.8361574",
"0.81743544",
"0.8163377",
"0.79660964",
"0.7712776",
"0.7678156",
"0.75750035",
"0.75696605",
"0.75696605",
"0.75696605",
"0.75065583",
"0.7396355",
"0.73814994",
"0.72756... | 0.0 | -1 |
Sets the description of the product | public function setDescription(string $description)
{
$this->description = $description;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setProductDescription(string $productDescription)\n\t{\n\t\t$this->addKeyValue('product_description', $productDescription); \n\n\t}",
"function setDescription($description) {\n\t\t$this->description = $description;\n\t}",
"protected function setDescription($description) {\r\n $this->descrip... | [
"0.78268903",
"0.7753783",
"0.77121556",
"0.768426",
"0.767124",
"0.76618224",
"0.7625474",
"0.7594806",
"0.7594806",
"0.7587276",
"0.75838554",
"0.7579703",
"0.7566918",
"0.7562137",
"0.75524384",
"0.7550825",
"0.7541532",
"0.75247395",
"0.75178653",
"0.75178653",
"0.7517865... | 0.7452747 | 34 |
Gets the description of the product | public function getDescription()
{
return $this->description;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProductDescription()\n\t{\n\t\treturn $this->getKeyValue('product_description'); \n\n\t}",
"public function getProdDescription()\n {\n return $this->prod_description;\n }",
"public function getProductDesc()\n {\n return isset($this->productDesc) ? $this->productDesc :... | [
"0.863873",
"0.84030634",
"0.8354022",
"0.8232872",
"0.8026998",
"0.76430887",
"0.76430887",
"0.7637516",
"0.7637516",
"0.76351506",
"0.76125735",
"0.7610457",
"0.7609367",
"0.75967455",
"0.7579747",
"0.75736433",
"0.75468963",
"0.7540425",
"0.7540425",
"0.75358456",
"0.75341... | 0.7507298 | 26 |
Sets the quantity in the store inventory of the product | public function setQuantity(int $quantity)
{
$this->quantity = $quantity;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setQty($qty);",
"public function setItemQuantity($productId, $quantity) {\n Doctrine_Query::create()\n ->update('Orderdetail od')\n ->where('od.Product = ?', $productId)\n ->andWhere('od.Order = ?', $this->getOrderId())\n ->set('quantity', $quant... | [
"0.7270248",
"0.6956504",
"0.69338024",
"0.68505925",
"0.67980903",
"0.6797869",
"0.6795814",
"0.67655826",
"0.6719491",
"0.6668278",
"0.666711",
"0.66181123",
"0.6604154",
"0.6541319",
"0.6534842",
"0.6496296",
"0.64900994",
"0.64812434",
"0.64767516",
"0.6471688",
"0.644163... | 0.69407845 | 2 |
Gets the quantity in the store inventory of the product | public function getQuantity()
{
return $this->quantity;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQuantity()\n {\n $channelInventorySourceIds = $this->channel->inventory_sources->where('status', 1)->pluck('id');\n\n $qty = 0;\n\n foreach ($this->product->inventories as $inventory) {\n if (is_numeric($channelInventorySourceIds->search($inventory->inventory_s... | [
"0.80204177",
"0.7661106",
"0.7661106",
"0.7661106",
"0.752719",
"0.74150646",
"0.7407927",
"0.7396071",
"0.73644054",
"0.73544693",
"0.73544693",
"0.73544693",
"0.73544693",
"0.73544693",
"0.73544693",
"0.73544693",
"0.73544693",
"0.73544693",
"0.73544693",
"0.73544693",
"0.... | 0.7299356 | 25 |
cache the asset without output | function basset(string $asset): string
{
$status = Basset::basset($asset, false);
if (in_array($status, [StatusEnum::DISABLED, StatusEnum::INVALID])) {
return $asset;
}
return Basset::getUrl($asset);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function cache_output();",
"public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}",
"public function onOutputGenerated()\n {\n if (isset($this->assetData)) {\n $cache = $this->grav['cache'];\n if (0 < count($this->assetData) || !method_exists($cache, \"delet... | [
"0.7230205",
"0.71408844",
"0.7055352",
"0.6664145",
"0.6594505",
"0.65584093",
"0.65315",
"0.65147704",
"0.65029913",
"0.6435494",
"0.63988215",
"0.6396814",
"0.6395703",
"0.63411766",
"0.6289901",
"0.62816805",
"0.6276494",
"0.6227038",
"0.6216959",
"0.6194596",
"0.61805403... | 0.0 | -1 |
Run the database seeds. | public function run()
{
$dt = Carbon::now();
$reservation = [
[
'hair_stylist_id'=>'1',
'service_id'=>'1',
'name'=>'Hoàng Nam',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0348012345',
'reservation_time_id'=> '1',
'reservation_date'=> '2019-08-22',
],
[
'hair_stylist_id'=>'2',
'service_id'=>'2',
'name'=>'Hoà Vy',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0948019999',
'reservation_time_id'=> '3',
'reservation_date'=> '2019-08-21',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'3',
'name'=>'An Vỹ',
'status'=>'Đã Thanh Toán',
'phone_number'=>'0947889999',
'reservation_time_id'=> '7',
'reservation_date'=> '2019-08-13',
],
[
'hair_stylist_id'=>'2',
'service_id'=>'1',
'name'=>'Hải An',
'status'=>'Đã Thanh Toán',
'phone_number'=>'0948019999',
'reservation_time_id'=> '1',
'reservation_date'=> '2019-08-13',
],
[
'hair_stylist_id'=>'4',
'service_id'=>'3',
'name'=>'trương phi',
'status'=>'Đã Thanh Toán',
'phone_number'=>'0948339999',
'reservation_time_id'=> '1',
'reservation_date'=> '2019-08-12',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'1',
'name'=>'Hoàng Hà',
'status'=>'Đã Thanh Toán',
'phone_number'=>'0938889999',
'reservation_time_id'=> '1',
'reservation_date'=> '2019-08-12',
],
[
'hair_stylist_id'=>'4',
'service_id'=>'1',
'name'=>'Ánh Nguyệt',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0948779999',
'reservation_time_id'=> '2',
'reservation_date'=> '2019-08-21',
],
[
'hair_stylist_id'=>'4',
'service_id'=>'1',
'name'=>'Nguyên Anh',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0998778999',
'reservation_time_id'=> '2',
'reservation_date'=> '2019-08-21',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'1',
'name'=>'Thái Thịnh',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0958779999',
'reservation_time_id'=> '3',
'reservation_date'=> '2019-08-15',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'1',
'name'=>'Văn Trường',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0933449999',
'reservation_time_id'=> '7',
'reservation_date'=> '2019-08-15',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'1',
'name'=>'Tú Mỡ',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0952244999',
'reservation_time_id'=> '7',
'reservation_date'=> '2019-08-15',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'1',
'name'=>'Thiên An',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0955566999',
'reservation_time_id'=> '7',
'reservation_date'=> '2019-08-14',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'1',
'name'=>'Hoàng Hợi',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0944779999',
'reservation_time_id'=> '7',
'reservation_date'=> '2019-08-14',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'1',
'name'=>'Thư Hoài ',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0955579999',
'reservation_time_id'=> '7',
'reservation_date'=> '2019-08-14',
],
[
'hair_stylist_id'=>'3',
'service_id'=>'1',
'name'=>'Ánh Tuyết',
'status'=>'Chưa Sử Dụng',
'phone_number'=>'0933877999',
'reservation_time_id'=> '7',
'reservation_date'=> '2019-08-14',
],
];
DB::table('reservation')->insert($reservation);
} | {
"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 |
Should be called UCSB side only | public function processRequests() {
$receivedRequests = $this->receivedRequestMapper->findAll();
foreach ($receivedRequests as $receivedRequest) {
$id = $receivedRequest->getId();
$sendingLocation = $receivedRequest->getSendingLocation();
$type = $receivedRequest->getRequestType();
$addedAt = $receivedRequest->getAddedAt();
$field1 = $receivedRequest->getField1();
switch ($type) {
case Request::USER_EXISTS: //Want same behavior for these two queries
case Request::FETCH_USER: //for login for a user that doesn't exist in the db
$userExists = $this->api->userExists($field1) ? '1' : '0';
$this->api->beginTransaction();
$response = new QueuedResponse($id, $sendingLocation, (string) $userExists, $this->api->microTime());
$this->queuedResponseMapper->save($response); //Does not throw Exception if already exists
if ($userExists) {
$userUpdate = $this->userUpdateMapper->find($field1);
$displayName = $this->api->getDisplayName($field1);
$password = $this->api->getPassword($field1);
$queuedUser = new QueuedUser($field1, $displayName, $password, $userUpdate->getUpdatedAt(), $sendingLocation);
$this->queuedUserMapper->save($queuedUser); //Does not throw Exception if already exists
}
$this->api->commit();
break;
default:
$this->api->log("Invalid request_type {$type} for request from {$sendingLocation} added_at {$addedAt}, field1 = {$field1}");
break;
}
$request = $this->receivedRequestMapper->delete($receivedRequest);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __() {\n }",
"protected function init()\n\t{\n\t\t\n\t}",
"public function serch()\n {\n }",
"public function onLoad() {\n \n }",
"public function init() {\t\t\n\n }",
"protected function _init()\r\n\t{\r\n\t}",
"protected function init() {return;}",
"pr... | [
"0.6191517",
"0.58617085",
"0.5814004",
"0.57994753",
"0.5784038",
"0.5782472",
"0.5780426",
"0.5754992",
"0.5752754",
"0.5748352",
"0.574781",
"0.57429665",
"0.5721667",
"0.5721667",
"0.5721667",
"0.5721667",
"0.5721287",
"0.5721287",
"0.5721287",
"0.5721287",
"0.5721287",
... | 0.0 | -1 |
Should be called Village side only | public function processResponses() {
$receivedResponses = $this->receivedResponseMapper->findAll();
foreach ($receivedResponses as $receivedResponse) {
$requestId = $receivedResponse->getRequestId();
$answer = $receivedResponse->getAnswer();
$queuedRequest = $this->queuedRequestMapper->find($requestId);
if ($queuedRequest) {
$type = $queuedRequest->getRequestType();
$field1 = $queuedRequest->getField1();
}
else {
//request no longer exists, so just delete response
$this->receivedResponseMapper->delete($receivedResponse);
continue;
}
switch ($type) {
case Request::USER_EXISTS:
if ($answer !== "1" AND $answer !== "0") {
$this->api->log("ReceivedResponse for Request USER_EXISTS, request_id = {$receivedResponse->getId()} had invalid response = {$answer}");
continue;
}
if ($answer === "0") {
$friendships = $this->friendshipMapper->findAllByUser($field1);
foreach ($friendships as $friendship) {
$this->friendshipMapper->delete($friendship);
}
}
$this->api->beginTransaction();
//Don't need destination for delete since they should all be this instance
$this->receivedResponseMapper->delete($receivedResponse);
$this->queuedRequestMapper->delete($receivedResponse);
$this->api->commit();
break;
case Request::FETCH_USER:
if ($answer !== "1" AND $answer !== "0") {
$this->api->log("ReceivedResponse for Request FETCH_USER, request_id = {$receivedResponse->getId()} had invalid response = {$answer}");
continue;
}
$this->api->beginTransaction();
//Don't need destination for delete since they should all be this instance
$this->receivedResponseMapper->delete($receivedResponse);
$this->queuedRequestMapper->delete($receivedResponse);
$this->api->commit();
break;
default:
$this->api->log("Invalid request_type {$type} for request id {$requestId}");
continue;
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"final function velcom(){\n }",
"public function boleta()\n\t{\n\t\t//\n\t}",
"public function extra_voor_verp()\n\t{\n\t}",
"private function __() {\n }",
"public function branching()\n {\n }",
"public function ogs()\r\n {\r\n }",
"public function serch()\n {\n... | [
"0.6315946",
"0.597431",
"0.5960664",
"0.57853997",
"0.5654882",
"0.56504476",
"0.55135846",
"0.5486689",
"0.54854935",
"0.5481829",
"0.5433384",
"0.5408605",
"0.5405357",
"0.54022664",
"0.53975064",
"0.5384471",
"0.53556013",
"0.53556013",
"0.53556013",
"0.53556013",
"0.5348... | 0.0 | -1 |
/ Search for Cart Id on Session | private function getSessionCart(Request $request) {
$cartId = $request->session()->get('cart_id', function() {
/*
* if no cart found, create a new cart
*/
return $this->createCart()->id;
});
/*
* Search for cart on the database
* If not found, replace by a new one
*/
$objCart = Cart::find($cartId);
if( $objCart == null ) {
$objCart = $this->createCart();
}
/*
* Check cart id
*/
if( $objCart == null || $objCart->id == null ) {
throw new Exception("Invalid Cart");
}
$request->session()->put('cart_id', $objCart->id);
return $objCart;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findCartBySessionId($id)\n {\n \t$cart = $this->model->whereSessionId($id)->first();\n \n \treturn $cart;\n }",
"public function getCurrentCartIdentifier();",
"function details () {\n// Empty\n if (count($_SESSION['cart'])==0) {\n return false;\n }\n\n // Get cart\n... | [
"0.74018586",
"0.6953749",
"0.69343305",
"0.676814",
"0.67562723",
"0.6719614",
"0.66563",
"0.65971744",
"0.65932626",
"0.65146244",
"0.64587826",
"0.6457504",
"0.6451119",
"0.6412967",
"0.6407701",
"0.64009386",
"0.6382313",
"0.6355237",
"0.6355087",
"0.6308169",
"0.62930626... | 0.59864366 | 44 |
Create a new ArchiveStream_Zip object. | public function __construct($name = null, array $opt = [], $basePath = null)
{
if (class_exists("\GMP") === false) {
throw new ArchiveException("GMP extension not loaded");
}
$this->opt['content_type'] = 'application/x-zip';
parent::__construct($name, $opt, $basePath);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function openArchive() {\n $zipname = $this->tempPath() . self::ZIPTEMP_STUB;\n\n // get size of $zipname, save to $this->zip_size\n $this->zip_size = file_exists($zipname) ? filesize($zipname) : 0;\n\n if (class_exists('ZipArchive')) {\n $this->... | [
"0.6654114",
"0.6446682",
"0.64358526",
"0.63543457",
"0.6310615",
"0.6303781",
"0.6271416",
"0.62159896",
"0.6052949",
"0.6052949",
"0.6038485",
"0.5907449",
"0.58905375",
"0.58900625",
"0.5855825",
"0.5819896",
"0.58057207",
"0.57922435",
"0.578048",
"0.5740384",
"0.5695798... | 0.5384501 | 31 |
Explicitly adds a directory to the tar (necessary for empty directories) | public function addDirectory($name, array $opt = [])
{
// calculate header attributes
$this->methodStr = 'deflate';
$meth = 0x08;
if (substr($name, -1) != '/') {
$name = $name . '/';
}
// send header
$this->initFileStreamTransfer($name, $size = 0, $opt, $meth);
// complete the file stream
$this->completeFileStream();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addDirectory(string $dir) {\n $this->directories[] = $dir;\n return $this;\n }",
"public function addDirectory(string $dir, string $localName = '', bool $relativePath = false)\n\t{\n\t\tif ($localName) {\n\t\t\t$localName .= \\DIRECTORY_SEPARATOR;\n\t\t}\n\t\t$path = realpath($dir);\n\t\t$... | [
"0.6016645",
"0.60053205",
"0.58836067",
"0.58508915",
"0.58408254",
"0.58328784",
"0.58170563",
"0.5773411",
"0.57694495",
"0.5738487",
"0.5692865",
"0.56652945",
"0.56645805",
"0.5609438",
"0.55919284",
"0.55740345",
"0.55738896",
"0.5569135",
"0.55503654",
"0.5544785",
"0.... | 0.5648215 | 13 |
Complete the current file stream (zip64 format). | public function completeFileStream()
{
$crc = hexdec(hash_final($this->hash_ctx));
// convert the 64 bit ints to 2 32bit ints
list($zlen_low, $zlen_high) = $this->int64Split($this->zlen);
list($len_low, $len_high) = $this->int64Split($this->len);
// build data descriptor
$fields = [ // (from V.A of APPNOTE.TXT)
['V', 0x08074b50], // data descriptor
['V', $crc], // crc32 of data
['V', $zlen_low], // compressed data length (low)
['V', $zlen_high], // compressed data length (high)
['V', $len_low], // uncompressed data length (low)
['V', $len_high], // uncompressed data length (high)
];
// pack fields and calculate "total" length
$ret = $this->packFields($fields);
// print header and filename
$this->send($ret);
// Update cdr for file record
$this->current_file_stream[3] = $crc;
$this->current_file_stream[4] = gmp_strval($this->zlen);
$this->current_file_stream[5] = gmp_strval($this->len);
$this->current_file_stream[6] += gmp_strval(gmp_add(gmp_init(strlen($ret)), $this->zlen));
ksort($this->current_file_stream);
// Add to cdr and increment offset - can't call directly because we pass an array of params
call_user_func_array([$this, 'addToCdr'], $this->current_file_stream);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function close()\n\t{\n\t\t$this->zip->close();\n\t}",
"public function close() {\n\n \tif($this->zip_archive !== NULL) {\n \t\t$this->zip_archive->close();\n \t}\n\n }",
"protected function closeArchive() {\n $this->zip->close();\n }",
"public function open() {\r\n\t\tif (!$thi... | [
"0.6206459",
"0.60522884",
"0.6006885",
"0.59269696",
"0.5763847",
"0.5577529",
"0.5529851",
"0.55086654",
"0.54959804",
"0.5480804",
"0.54081136",
"0.5371854",
"0.53295326",
"0.5309901",
"0.53073716",
"0.5287815",
"0.52678114",
"0.52616495",
"0.5252909",
"0.5241365",
"0.5231... | 0.69746137 | 0 |
Initialize a file stream | public function initFileStreamTransfer($name, $size, array $opt = [], $meth = 0x00)
{
// if we're using a container directory, prepend it to the filename
if ($this->useContainerDir) {
// the container directory will end with a '/' so ensure the filename doesn't start with one
$name = $this->containerDirName . preg_replace('/^\\/+/', '', $name);
}
$algo = 'crc32b';
// calculate header attributes
$this->len = gmp_init(0);
$this->zlen = gmp_init(0);
$this->hash_ctx = hash_init($algo);
// Send file header
$this->addStreamFileHeader($name, $opt, $meth);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct(InputStream $stream) {\n $this->stream= $stream;\n }",
"function __construct($file_path)\n {\n $this->open($file_path);\n }",
"protected function createStream(): StreamInterface\n {\n return Utils::streamFor(Utils::tryFopen($this->filename, $this->mode));\... | [
"0.6778943",
"0.6683136",
"0.66308445",
"0.66035306",
"0.6551534",
"0.64973444",
"0.64938104",
"0.64938104",
"0.64385235",
"0.64309245",
"0.6374059",
"0.6364889",
"0.6361476",
"0.62940323",
"0.62429935",
"0.62364453",
"0.62348986",
"0.6229075",
"0.6207763",
"0.6176862",
"0.61... | 0.58520466 | 57 |
Stream the next part of the current file stream. | public function streamFilePart($data, $single_part = false)
{
$this->len = gmp_add(gmp_init(strlen($data)), $this->len);
hash_update($this->hash_ctx, $data);
if ($single_part === true && isset($this->methodStr) && $this->methodStr == 'deflate') {
$data = gzdeflate($data);
}
$this->zlen = gmp_add(gmp_init(strlen($data)), $this->zlen);
// send data
$this->send($data);
flush();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function next()\n {\n fseek($this->resource, 1, SEEK_CUR);\n }",
"public function next()\n {\n $this->position++;\n $this->fileIterator->seek($this->position);\n }",
"public function next()\n {\n $this->fileObject->next();\n }",
"public function next()\n \... | [
"0.7109522",
"0.70886064",
"0.6759688",
"0.6200314",
"0.5957632",
"0.5822138",
"0.5788208",
"0.574126",
"0.56715375",
"0.564589",
"0.5642783",
"0.55962306",
"0.5579514",
"0.55615276",
"0.5560258",
"0.55537087",
"0.55526817",
"0.55166566",
"0.54756963",
"0.54756963",
"0.547569... | 0.60446197 | 4 |
PRIVATE METHODS Add initial headers for file stream | protected function addStreamFileHeader($name, array $opt, $meth)
{
// strip leading slashes from file name
// (fixes bug in windows archive viewer)
$name = preg_replace('/^\\/+/', '', $name);
$extra = pack('vVVVV', 1, 0, 0, 0, 0);
// create dos timestamp
$opt['time'] = isset($opt['time']) ? $opt['time'] : time();
$dts = $this->dostime($opt['time']);
// Sets bit 3, which means CRC-32, uncompressed and compresed length
// are put in the data descriptor following the data. This gives us time
// to figure out the correct sizes, etc.
$genb = 0x08;
if (mb_check_encoding($name, "UTF-8") && !mb_check_encoding($name, "ASCII")) {
// Sets Bit 11: Language encoding flag (EFS). If this bit is set,
// the filename and comment fields for this file
// MUST be encoded using UTF-8. (see APPENDIX D)
$genb |= 0x0800;
}
// build file header
$fields = [ // (from V.A of APPNOTE.TXT)
['V', 0x04034b50], // local file header signature
['v', self::VERSION], // version needed to extract
['v', $genb], // general purpose bit flag
['v', $meth], // compresion method (deflate or store)
['V', $dts], // dos timestamp
['V', 0x00], // crc32 of data (0x00 because bit 3 set in $genb)
['V', 0xFFFFFFFF], // compressed data length
['V', 0xFFFFFFFF], // uncompressed data length
['v', strlen($name)], // filename length
['v', strlen($extra)], // extra data len
];
// pack fields and calculate "total" length
$ret = $this->packFields($fields);
// print header and filename
$this->send($ret . $name . $extra);
// Keep track of data for central directory record
$this->current_file_stream = [
$name,
$opt,
$meth,
// 3-5 will be filled in by complete_file_stream()
6 => (strlen($ret) + strlen($name) + strlen($extra)),
7 => $genb,
8 => substr($name, -1) == '/' ? 0x10 : 0x20, // 0x10 for directory, 0x20 for file
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setHeaders(){\n $position = ftell($this->handle);\n rewind($this->handle);\n $read = $this->readLine();\n if( $read === FALSE){\n die(\"File is empty\");\n \n }else{\n $this->headers = $read;\n }\n\n fseek ($this->handle, $... | [
"0.7115468",
"0.65650606",
"0.6383446",
"0.63438684",
"0.63195497",
"0.6317365",
"0.6232592",
"0.62094754",
"0.6170296",
"0.61444247",
"0.6080365",
"0.60741884",
"0.60684776",
"0.60401905",
"0.60272324",
"0.5933614",
"0.5909352",
"0.5907461",
"0.59068155",
"0.5904118",
"0.587... | 0.6312911 | 6 |
Convert a UNIX timestamp to a DOS timestamp. | protected function dostime($when = 0)
{
// get date array for timestamp
$d = getdate($when);
// set lower-bound on dates
if ($d['year'] < 1980) {
$d = [
'year' => 1980,
'mon' => 1,
'mday' => 1,
'hours' => 0,
'minutes' => 0,
'seconds' => 0,
];
}
// remove extra years from 1980
$d['year'] -= 1980;
// return date string
return ($d['year'] << 25) | ($d['mon'] << 21) | ($d['mday'] << 16) |
($d['hours'] << 11) | ($d['minutes'] << 5) | ($d['seconds'] >> 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unix2DosTime($unixtime = 0) {\n $timearray = ($unixtime == 0) ? getdate() : getdate($unixtime);\n\n if ($timearray['year'] < 1980) {\n $timearray['year'] = 1980;\n $timearray['mon'] = 1;\n $timearray['mday'] = 1;\n $timearray['hours'] =... | [
"0.6672501",
"0.6273666",
"0.62374294",
"0.60314375",
"0.6023076",
"0.60225666",
"0.59563255",
"0.5916186",
"0.5884965",
"0.57121253",
"0.5679499",
"0.5630457",
"0.55775416",
"0.5568995",
"0.5565779",
"0.55211246",
"0.5515147",
"0.5466354",
"0.54524446",
"0.545096",
"0.54494"... | 0.0 | -1 |
Split a 64bit integer to two 32bit integers. | protected function int64Split($value)
{
// gmp
if (is_resource($value) || $value instanceof \GMP) {
$hex = str_pad(gmp_strval($value, 16), 16, '0', STR_PAD_LEFT);
$high = $this->gmpConvert(substr($hex, 0, 8), 16, 10);
$low = $this->gmpConvert(substr($hex, 8, 8), 16, 10);
} // int
else {
$left = 0xffffffff00000000;
$right = 0x00000000ffffffff;
$high = ($value & $left) >> 32;
$low = $value & $right;
}
return [$low, $high];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function snmp_dewrap32bit($value)\n{\n if (is_numeric($value) && $value < 0)\n {\n return ($value + 4294967296);\n } else {\n return $value;\n }\n}",
"public static function leftShift32($x, $y) {\n $n = $x << $y;\n if (PHP_INT_MAX != 0x80000000) {\n $n = -(~($n & 0x00000000FFFFFFFF) + 1);\... | [
"0.6214209",
"0.6066999",
"0.5998854",
"0.5849224",
"0.58448803",
"0.5796384",
"0.57775843",
"0.5649391",
"0.5552255",
"0.55408096",
"0.5500989",
"0.5476111",
"0.5473092",
"0.538279",
"0.538074",
"0.5332792",
"0.52913016",
"0.5266705",
"0.5251856",
"0.52393824",
"0.51899266",... | 0.7171849 | 0 |
Add CDR (Central Directory Record) footer. | private function addCdr(array $opt = null)
{
foreach ($this->files as $file) {
$this->addCdrFile($file);
}
$this->addCdrEofZip64();
$this->addCdrEofLocatorZip64();
$this->addCdrEof($opt);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addFooter()\n {\n if (file_exists(DIRREQ . \"app/view/{$this->getDir()}/footer.php\")) {\n include(DIRREQ . \"app/view/{$this->getDir()}/footer.php\");\n }\n }",
"protected function makeFooter()\n {\n }",
"private function writeFooter(): void\n {\n ... | [
"0.6812497",
"0.6521725",
"0.6428819",
"0.63027257",
"0.6231343",
"0.6220941",
"0.62206507",
"0.62206507",
"0.61767226",
"0.6147513",
"0.6127693",
"0.60621715",
"0.6054022",
"0.60327786",
"0.60302967",
"0.60252136",
"0.5996032",
"0.5975229",
"0.5945318",
"0.5934885",
"0.59016... | 0.0 | -1 |
Send CDR EOF (Central Directory Record EndofFile) record. Most values point to the corresponding values in the ZIP64 CDR. The optional comment still goes in this CDR however. | private function addCdrEof(array $opt = null)
{
// grab comment (if specified)
$comment = '';
if ($opt && isset($opt['comment'])) {
$comment = $opt['comment'];
}
$fields = [ // (from V,F of APPNOTE.TXT)
['V', 0x06054b50], // end of central file header signature
['v', 0xFFFF], // this disk number (0xFFFF to look in zip64 cdr)
['v', 0xFFFF], // number of disk with cdr (0xFFFF to look in zip64 cdr)
['v', 0xFFFF], // number of entries in the cdr on this disk (0xFFFF to look in zip64 cdr))
['v', 0xFFFF], // number of entries in the cdr (0xFFFF to look in zip64 cdr)
['V', 0xFFFFFFFF], // cdr size (0xFFFFFFFF to look in zip64 cdr)
['V', 0xFFFFFFFF], // cdr offset (0xFFFFFFFF to look in zip64 cdr)
['v', strlen($comment)], // zip file comment length
];
$ret = $this->packFields($fields) . $comment;
$this->send($ret);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addCdrEofZip64()\n {\n $num = count($this->files);\n \n list($num_low, $num_high) = $this->int64Split($num);\n list($cdr_len_low, $cdr_len_high) = $this->int64Split($this->cdr_len);\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_ofs);\n ... | [
"0.73256916",
"0.6821208",
"0.63606286",
"0.6299368",
"0.62877023",
"0.62016475",
"0.5796436",
"0.56094223",
"0.5364684",
"0.50191504",
"0.50002766",
"0.49926051",
"0.4984768",
"0.49741292",
"0.49507093",
"0.49125916",
"0.491014",
"0.48984468",
"0.48984468",
"0.48909894",
"0.... | 0.6919642 | 1 |
Add location record for ZIP64 central directory | private function addCdrEofLocatorZip64()
{
list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_len + $this->cdr_ofs);
$fields = [ // (from V,F of APPNOTE.TXT)
['V', 0x07064b50], // zip64 end of central dir locator signature
['V', 0], // this disk number
['V', $cdr_ofs_low], // cdr ofs (low)
['V', $cdr_ofs_high], // cdr ofs (high)
['V', 1], // total number of disks
];
$ret = $this->packFields($fields);
$this->send($ret);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addCdrEofZip64()\n {\n $num = count($this->files);\n \n list($num_low, $num_high) = $this->int64Split($num);\n list($cdr_len_low, $cdr_len_high) = $this->int64Split($this->cdr_len);\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_ofs);\n ... | [
"0.626799",
"0.6252693",
"0.59027267",
"0.54948527",
"0.5474614",
"0.53984135",
"0.52814406",
"0.5280893",
"0.52210873",
"0.5154357",
"0.5141009",
"0.51379585",
"0.51292026",
"0.5121536",
"0.508517",
"0.5071955",
"0.5037024",
"0.50327563",
"0.499384",
"0.49801308",
"0.4958509... | 0.6318284 | 0 |
Adds Zip64 end of central directory record. | private function addCdrEofZip64()
{
$num = count($this->files);
list($num_low, $num_high) = $this->int64Split($num);
list($cdr_len_low, $cdr_len_high) = $this->int64Split($this->cdr_len);
list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_ofs);
$fields = [ // (from V,F of APPNOTE.TXT)
['V', 0x06064b50], // zip64 end of central directory signature
['V', 44], // size of zip64 end of central directory record (low) minus 12 bytes
['V', 0], // size of zip64 end of central directory record (high)
['v', self::VERSION], // version made by
['v', self::VERSION], // version needed to extract
['V', 0x0000], // this disk number (only one disk)
['V', 0x0000], // number of disk with central dir
['V', $num_low], // number of entries in the cdr for this disk (low)
['V', $num_high], // number of entries in the cdr for this disk (high)
['V', $num_low], // number of entries in the cdr (low)
['V', $num_high], // number of entries in the cdr (high)
['V', $cdr_len_low], // cdr size (low)
['V', $cdr_len_high], // cdr size (high)
['V', $cdr_ofs_low], // cdr ofs (low)
['V', $cdr_ofs_high], // cdr ofs (high)
];
$ret = $this->packFields($fields);
$this->send($ret);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addCdrEofLocatorZip64()\n {\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_len + $this->cdr_ofs);\n \n $fields = [ // (from V,F of APPNOTE.TXT)\n ['V', 0x07064b50], // zip64 end of central dir locator signature\n ... | [
"0.6524506",
"0.62684804",
"0.60399675",
"0.60191613",
"0.601667",
"0.5660585",
"0.5282199",
"0.51426977",
"0.5123915",
"0.5112667",
"0.4920884",
"0.49105012",
"0.48958436",
"0.4831791",
"0.48160124",
"0.4786769",
"0.47780445",
"0.4774469",
"0.4756552",
"0.47549218",
"0.47482... | 0.7426264 | 0 |
Send CDR record for specified file (Zip64 format). | private function addCdrFile(array $args)
{
list($name, $opt, $meth, $crc, $zlen, $len, $ofs, $genb, $file_attribute) = $args;
// convert the 64 bit ints to 2 32bit ints
list($zlen_low, $zlen_high) = $this->int64Split($zlen);
list($len_low, $len_high) = $this->int64Split($len);
list($ofs_low, $ofs_high) = $this->int64Split($ofs);
// ZIP64, necessary for files over 4GB (incl. entire archive size)
$extra_zip64 = '';
$extra_zip64 .= pack('VV', $len_low, $len_high);
$extra_zip64 .= pack('VV', $zlen_low, $zlen_high);
$extra_zip64 .= pack('VV', $ofs_low, $ofs_high);
$extra = pack('vv', 1, strlen($extra_zip64)) . $extra_zip64;
// get attributes
$comment = isset($opt['comment']) ? $opt['comment'] : '';
// get dos timestamp
$dts = $this->dostime($opt['time']);
$fields = [ // (from V,F of APPNOTE.TXT)
['V', 0x02014b50], // central file header signature
['v', self::VERSION], // version made by
['v', self::VERSION], // version needed to extract
['v', $genb], // general purpose bit flag
['v', $meth], // compresion method (deflate or store)
['V', $dts], // dos timestamp
['V', $crc], // crc32 of data
['V', 0xFFFFFFFF], // compressed data length (zip64 - look in extra)
['V', 0xFFFFFFFF], // uncompressed data length (zip64 - look in extra)
['v', strlen($name)], // filename length
['v', strlen($extra)], // extra data len
['v', strlen($comment)], // file comment length
['v', 0], // disk number start
['v', 0], // internal file attributes
['V', $file_attribute], // external file attributes, 0x10 for dir, 0x20 for file
['V', 0xFFFFFFFF], // relative offset of local header (zip64 - look in extra)
];
// pack fields, then append name and comment
$ret = $this->packFields($fields) . $name . $extra . $comment;
$this->send($ret);
// increment cdr length
$this->cdr_len += strlen($ret);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addCdrEofZip64()\n {\n $num = count($this->files);\n \n list($num_low, $num_high) = $this->int64Split($num);\n list($cdr_len_low, $cdr_len_high) = $this->int64Split($this->cdr_len);\n list($cdr_ofs_low, $cdr_ofs_high) = $this->int64Split($this->cdr_ofs);\n ... | [
"0.61363614",
"0.55708313",
"0.5104863",
"0.5031686",
"0.49155697",
"0.478452",
"0.47721973",
"0.47665402",
"0.4710399",
"0.46400115",
"0.45424974",
"0.453202",
"0.45010385",
"0.44991305",
"0.4497867",
"0.44688576",
"0.44582382",
"0.4457006",
"0.44342908",
"0.44341922",
"0.44... | 0.54902107 | 2 |
Save file attributes for trailing CDR record. | private function addToCdr($name, array $opt, $meth, $crc, $zlen, $len, $rec_len, $genb = 0, $fattr = 0x20)
{
$this->files[] = [$name, $opt, $meth, $crc, $zlen, $len, $this->cdr_ofs, $genb, $fattr];
$this->cdr_ofs += $rec_len;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function afterSave()\n {\n if (!$this->files) {\n return;\n } else if ($this->contentAttribute) {\n $this->owner->updateAttributes([$this->contentAttribute => $this->processContentFiles(true)['content']]);\n } else {\n /** @var UploadedFile $file */\n... | [
"0.54682153",
"0.53734404",
"0.5231508",
"0.51594",
"0.50034225",
"0.49805573",
"0.48937267",
"0.48697585",
"0.48388237",
"0.48270977",
"0.47609127",
"0.47592133",
"0.47366163",
"0.4718553",
"0.4708301",
"0.4669057",
"0.4662235",
"0.46556246",
"0.4604047",
"0.45986497",
"0.45... | 0.43955395 | 39 |
Clear all internal variables. Note: the archive object is unusable after this. | private function clear()
{
$this->files = [];
$this->cdr_ofs = 0;
$this->cdr_len = 0;
$this->opt = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function reset() {\r\n $this->zip->unchangeAll();\r\n }",
"public function reset() {\r\n $this->header = [];\r\n $this->cookie = [];\r\n $this->content = NULL;\r\n }",
"protected function clear()\n {\n $this->optionManager->clear();\n $this->headerManager->cl... | [
"0.7362068",
"0.6931097",
"0.6883876",
"0.6857184",
"0.6793995",
"0.66174203",
"0.66126585",
"0.6601683",
"0.65364224",
"0.6516723",
"0.647981",
"0.64510614",
"0.6392924",
"0.6392509",
"0.63804626",
"0.6357677",
"0.63469714",
"0.6317874",
"0.63127357",
"0.62942195",
"0.629421... | 0.6819694 | 4 |
Convert a number between bases via GMP. | private function gmpConvert($num, $base_a, $base_b)
{
$gmp_num = gmp_init($num, $base_a);
if (!(is_resource($gmp_num) || $gmp_num instanceof \GMP)) {
throw new ArchiveException("gmp_convert could not convert [$num] from base [$base_a] to base [$base_b]");
}
return gmp_strval($gmp_num, $base_b);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init( $number, $base = 10 )\n {\n return gmp_init( $number, $base );\n }",
"function gmp_intval($gmpnumber)\n{\n}",
"public static function base($numberInput, $fromBaseInput, $toBaseInput){\n if ($fromBaseInput==$toBaseInput) return $numberInput;\n $fromBase = str_spl... | [
"0.68385607",
"0.6796888",
"0.63171965",
"0.61972547",
"0.6178832",
"0.6143026",
"0.6103808",
"0.6047344",
"0.6022657",
"0.59909004",
"0.59301865",
"0.58950144",
"0.58758813",
"0.58636874",
"0.5744435",
"0.5684742",
"0.5670876",
"0.5615719",
"0.5496955",
"0.54936457",
"0.5463... | 0.67361766 | 2 |
Register the routes for the objects of the controller. | public function register_routes() {
$namespace = $this->namespace;
$base = $this->rest_base;
register_rest_route( $namespace, '/' . $base, array(
array(
'methods' => WP_REST_Server::CREATABLE,
'callback' => array( $this, 'create_item' ),
'permission_callback' => array( $this, 'create_item_permissions_check' ),
'args' => $this->get_collection_params(),
),
) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register_rest_routes() {\n\t\t$controllers = array(\n\t\t\t'GF_REST_Entries_Controller',\n\t\t\t'GF_REST_Entry_Properties_Controller',\n\t\t\t'GF_REST_Entry_Notifications_Controller',\n\t\t\t'GF_REST_Notes_Controller',\n\t\t\t'GF_REST_Entry_Notes_Controller',\n\t\t\t'GF_REST_Form_Entries_Controller... | [
"0.8205839",
"0.7760709",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"0.7760362",
"... | 0.73001754 | 42 |
Get the query params for collections | public function get_collection_params() {
return array(
'include' => array(
'description' => 'Limit the notifications to specific IDs.',
),
'event' => array(
'description' => 'The event to trigger. Default: form_submission.',
),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_collection_params()\n {\n }",
"public function get_collection_params()\n {\n }",
"public function get_collection_params()\n {\n }",
"public function get_collection_params()\n {\n }",
"public function get_collection_params()\n ... | [
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235",
"0.79422235"... | 0.7022964 | 33 |
/ Plugin Name: Dark Mode Plugin URI: Description: An amazing plugin. Author: Matthieu Mota Author URI: Version: 1.0.0 | function darkmode() {
?>
<script src="https://cdn.jsdelivr.net/npm/darkmode-js@1.5.7/lib/darkmode-js.min.js"></script>
<script>
function addDarkmodeWidget() {
new Darkmode({
label: '🌓',
}).showWidget();
}
window.addEventListener('load', addDarkmodeWidget);
</script>
<style>
.darkmode-layer, .darkmode-toggle {
/* z-index: 500; */
}
.darkmode-toggle {
z-index: 500;
}
.darkmode--activated .navbar {
position: static;
}
</style>
<?php } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doing_dark_mode()\n {\n }",
"function preview_theme()\n {\n }",
"function _h_add_dark_mode_script() { ?>\n<script>\n (function() { 'use strict';\n const darkMode = localStorage.hDarkMode === 'true';\n if (darkMode) {\n document.querySelector('body').classList.add('h-is-dark');\... | [
"0.6921865",
"0.59082514",
"0.58892334",
"0.5790519",
"0.5785034",
"0.5618339",
"0.55743074",
"0.55698943",
"0.5565495",
"0.5546699",
"0.5522256",
"0.55217904",
"0.5493524",
"0.5482564",
"0.5475111",
"0.5455906",
"0.54505396",
"0.54074",
"0.54074",
"0.53953576",
"0.53948104",... | 0.6706402 | 1 |
Seed the application's database. | public function run()
{
$users = [
[
'name' => 'Suan Mungkud',
'email' => 'admin@suan.com',
'password' => bcrypt('password'),
'role' => 'ADMIN',
'telephone' => '0987654321',
'bank_account' => '0123456789',
],
[
'name' => 'Tungjai Tumngan',
'email' => 'employee1@suan.com',
'password' => bcrypt('password'),
'role' => 'EMPLOYEE',
'telephone' => '0808808080',
'bank_account' => '7894561230',
],
[
'name' => 'Jaidee Susu',
'email' => 'employee2@suan.com',
'password' => bcrypt('password'),
'role' => 'EMPLOYEE',
'telephone' => '0606606060',
'bank_account' => '7410852963',
],
[
'name' => 'Tumngan Haamoney',
'email' => 'employee3@suan.com',
'password' => bcrypt('password'),
'role' => 'EMPLOYEE',
'telephone' => '0868968986',
'bank_account' => '0321654987',
],
[
'name' => 'Pai Tumngan',
'email' => 'employee4@suan.com',
'password' => bcrypt('password'),
'role' => 'EMPLOYEE',
'telephone' => '0986989868',
'bank_account' => '0123456789',
],
[
'name' => 'Tumsuan Tumna',
'email' => 'employee5@suan.com',
'password' => bcrypt('password'),
'role' => 'EMPLOYEE',
'telephone' => '0909909090',
'bank_account' => '9876543210',
],
];
foreach($users as $user){
User::create($user);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=... | [
"0.8064933",
"0.7848158",
"0.7674873",
"0.724396",
"0.7216743",
"0.7132209",
"0.70970356",
"0.70752203",
"0.704928",
"0.699208",
"0.6987078",
"0.69839287",
"0.6966499",
"0.68990964",
"0.6868679",
"0.68468624",
"0.68307716",
"0.68206114",
"0.6803113",
"0.6803113",
"0.6801801",... | 0.0 | -1 |
Constructor method for ArrayOfBurglaryExcludedDiscountFactor | public function __construct(array $burglaryExcludedDiscountFactor = array())
{
$this
->setBurglaryExcludedDiscountFactor($burglaryExcludedDiscountFactor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setBurglaryExcludedDiscountFactor(array $burglaryExcludedDiscountFactor = array())\n {\n foreach ($burglaryExcludedDiscountFactor as $arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) {\n // validation for constraint: itemType\n if (!$arrayOfBu... | [
"0.6607878",
"0.6542491",
"0.64514095",
"0.5913188",
"0.57401437",
"0.56704056",
"0.56264037",
"0.5550084",
"0.5540131",
"0.5419293",
"0.53886443",
"0.53261036",
"0.5248413",
"0.52325684",
"0.52010983",
"0.51948416",
"0.5170309",
"0.5155475",
"0.5146486",
"0.5142307",
"0.5132... | 0.818553 | 0 |
Get BurglaryExcludedDiscountFactor value An additional test has been added (isset) before returning the property value as this property may have been unset before, due to the fact that this property is removable from the request (nillable=true+minOccurs=0) | public function getBurglaryExcludedDiscountFactor()
{
return isset($this->BurglaryExcludedDiscountFactor) ? $this->BurglaryExcludedDiscountFactor : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNoDiscount() {\n return $this->item->getNoDiscount();\n }",
"public function getAttributeName()\n {\n return 'BurglaryExcludedDiscountFactor';\n }",
"public function getDiscountConditions()\n {\n return isset($this->DiscountConditions) ? $this->DiscountCondit... | [
"0.6445477",
"0.6307113",
"0.625749",
"0.62265867",
"0.6158091",
"0.6082559",
"0.601071",
"0.5984825",
"0.59839815",
"0.5975843",
"0.5974094",
"0.5954664",
"0.5940398",
"0.5940398",
"0.5940398",
"0.5940398",
"0.5940398",
"0.5940398",
"0.5914922",
"0.5910009",
"0.5782612",
"... | 0.8349522 | 0 |
Set BurglaryExcludedDiscountFactor value This property is removable from request (nillable=true+minOccurs=0), therefore if the value assigned to this property is null, it is removed from this object | public function setBurglaryExcludedDiscountFactor(array $burglaryExcludedDiscountFactor = array())
{
foreach ($burglaryExcludedDiscountFactor as $arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) {
// validation for constraint: itemType
if (!$arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem instanceof \Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor) {
throw new \InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor, "%s" given', is_object($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) ? get_class($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) : gettype($arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem)), __LINE__);
}
}
if (is_null($burglaryExcludedDiscountFactor) || (is_array($burglaryExcludedDiscountFactor) && empty($burglaryExcludedDiscountFactor))) {
unset($this->BurglaryExcludedDiscountFactor);
} else {
$this->BurglaryExcludedDiscountFactor = $burglaryExcludedDiscountFactor;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBurglaryExcludedDiscountFactor()\n {\n return isset($this->BurglaryExcludedDiscountFactor) ? $this->BurglaryExcludedDiscountFactor : null;\n }",
"public function __construct(array $burglaryExcludedDiscountFactor = array())\n {\n $this\n ->setBurglaryExcludedDi... | [
"0.72576165",
"0.64541745",
"0.6219199",
"0.57935286",
"0.5399821",
"0.5362321",
"0.53430957",
"0.5325981",
"0.5256104",
"0.51741374",
"0.5161432",
"0.5151781",
"0.51341367",
"0.5090727",
"0.5079376",
"0.50381726",
"0.50248635",
"0.4886677",
"0.48737356",
"0.48023295",
"0.479... | 0.6954686 | 1 |
Add item to BurglaryExcludedDiscountFactor value | public function addToBurglaryExcludedDiscountFactor(\Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor $item)
{
// validation for constraint: itemType
if (!$item instanceof \Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor) {
throw new \InvalidArgumentException(sprintf('The BurglaryExcludedDiscountFactor property can only contain items of \Mu4ddi3\Compensa\Webservice\StructType\BurglaryExcludedDiscountFactor, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->BurglaryExcludedDiscountFactor[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setBurglaryExcludedDiscountFactor(array $burglaryExcludedDiscountFactor = array())\n {\n foreach ($burglaryExcludedDiscountFactor as $arrayOfBurglaryExcludedDiscountFactorBurglaryExcludedDiscountFactorItem) {\n // validation for constraint: itemType\n if (!$arrayOfBu... | [
"0.6371696",
"0.63480055",
"0.62901795",
"0.60273093",
"0.6026336",
"0.5838916",
"0.5708942",
"0.5593888",
"0.55592257",
"0.55023235",
"0.54956406",
"0.54891443",
"0.5449712",
"0.54480624",
"0.5423988",
"0.53848",
"0.5372779",
"0.53662604",
"0.53316665",
"0.5255153",
"0.52466... | 0.72386545 | 0 |
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.7820664",
"0.7820664",
"0.7820664",
"0.7820664",
"0.7820664",
"0.7820664",
"0.7820664",
"0.7820664",
"0.7820664",
"0.7820664",
"0.7820664",
... | 0.7650098 | 58 |
Returns the indexed element | public function item($index)
{
return parent::item($index);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getIndex() ;",
"abstract protected function getIndex();",
"public function index() {\n if ($this->_m_index !== null)\n return $this->_m_index;\n $this->_m_index = ($this->isIndexSeparate() ? $this->indexSeparate() : $this->indexInTag());\n return $this->... | [
"0.77055407",
"0.72056526",
"0.713027",
"0.7033584",
"0.6996542",
"0.6944985",
"0.6944985",
"0.6944985",
"0.69147193",
"0.6857304",
"0.6857304",
"0.68295634",
"0.6820806",
"0.6799969",
"0.67722803",
"0.6701626",
"0.6688082",
"0.6660176",
"0.66598177",
"0.66598177",
"0.6659817... | 0.0 | -1 |
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 last element | public function last()
{
return parent::last();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function last()\n {\n return end($this->_elements);\n }",
"public function last() {\n return end($this->list);\n }",
"public function last()\r\n\t{\r\n\t\treturn end($this->_items);\r\n\t}",
"public function getLast()\n {\n $k = count($this);\n if ($k > 0) {\n ... | [
"0.8829238",
"0.85912704",
"0.8444729",
"0.84026474",
"0.8388798",
"0.83874923",
"0.8323318",
"0.82952625",
"0.82881796",
"0.828602",
"0.82725483",
"0.8263641",
"0.8263641",
"0.8263641",
"0.8263641",
"0.8263641",
"0.8263641",
"0.8263641",
"0.8263641",
"0.8263641",
"0.8263641"... | 0.8036071 | 61 |
Returns the element at the offset | public function offsetGet($offset)
{
return parent::offsetGet($offset);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function offsetGet($offset)\n {\n return $this->elements[$offset];\n }",
"public function offsetGet($offset);",
"public function offsetGet($offset);",
"public function get($offset);",
"public function offsetGet($offset)\n {\n return $this->item[$offset];\n }",
"public fun... | [
"0.83742225",
"0.7759703",
"0.7759703",
"0.76115364",
"0.7603074",
"0.759659",
"0.759659",
"0.7594955",
"0.75608766",
"0.7557989",
"0.7538264",
"0.7529719",
"0.7468404",
"0.74635136",
"0.7437159",
"0.73601866",
"0.736001",
"0.73566663",
"0.7356636",
"0.732542",
"0.732542",
... | 0.7211354 | 66 |
Returns the attribute name | public function getAttributeName()
{
return 'BurglaryExcludedDiscountFactor';
} | {
"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.0 | -1 |
Method called when an object has been exported with var_export() functions It allows to return an object instantiated with the values | public static function __set_state(array $array)
{
return parent::__set_state($array);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Roo... | [
"0.6952637",
"0.69243443",
"0.65772027",
"0.63792896",
"0.6145798",
"0.61255944",
"0.60570073",
"0.60396284",
"0.59245735",
"0.59245735",
"0.59245735",
"0.59245735",
"0.59245735",
"0.5859685",
"0.5837787",
"0.5812177",
"0.58031034",
"0.5717877",
"0.57158905",
"0.5712734",
"0.... | 0.0 | -1 |
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 |
Put your code for get_index here, something like | public function get_index() {
// 1. Load and validate parameters or form contents
// 2. Query or update the database
// 3. Render a template or redirect
$this->view->renderTemplate(
"views/AboutUs.php",
array(
'title' => 'About Us',
)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_index()\r\n\t{\r\n\r\n\t}",
"public function getIndex()\n {\n // add stuff here\n }",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getInde... | [
"0.8245012",
"0.79080915",
"0.78035706",
"0.78035706",
"0.78035706",
"0.7803318",
"0.7803318",
"0.7803318",
"0.7802606",
"0.7802606",
"0.780224",
"0.7764403",
"0.7701732",
"0.7539829",
"0.7539829",
"0.7539829",
"0.74197626",
"0.7237711",
"0.7185486",
"0.7185486",
"0.7185486",... | 0.0 | -1 |
Create a new controller instance. | public function __construct()
{
$this->middleware('guest');
} | {
"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.82668066",
"0.8173394",
"0.78115296",
"0.77052677",
"0.7681875",
"0.7659338",
"0.74860525",
"0.74064577",
"0.7297601",
"0.7252339",
"0.7195181",
"0.7174191",
"0.70150065",
"0.6989306",
"0.69835985",
"0.69732994",
"0.6963521",
"0.6935819",
"0.68973273",
"0.68920785",
"0.687... | 0.0 | -1 |
Create a new user instance after a valid registration. | protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'role_id' => $data['role_id'],
'password' => bcrypt($data['password']),
'phone' => $data['phone']
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _createUser()\n {\n $data = [\n 'email' => 'newuser@email.nl',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n ... | [
"0.77523947",
"0.74900365",
"0.7475983",
"0.7475983",
"0.7475983",
"0.7475983",
"0.7418979",
"0.7418979",
"0.73626566",
"0.7310667",
"0.72906804",
"0.7172797",
"0.71538836",
"0.71376646",
"0.71314734",
"0.711611",
"0.71076417",
"0.7093154",
"0.7086479",
"0.70860976",
"0.70681... | 0.0 | -1 |
Configures the options for this type. | public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'empty_data' => function () {
$this
->factory
->create();
},
'data_class' => $this
->factory
->getEntityNamespace(),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function configureOptions();",
"protected function configureOptions(): void\n {\n }",
"protected function initOptions()\n {\n }",
"protected function configure($options = array(), $attributes = array())\n {\n $this->addOption('image', false);\n $this->addOption('config', '{}');\n ... | [
"0.7639796",
"0.7548739",
"0.70867825",
"0.6995393",
"0.69848543",
"0.69688797",
"0.6895392",
"0.6892119",
"0.68732864",
"0.6857375",
"0.68489856",
"0.6847529",
"0.6800046",
"0.6783693",
"0.67776173",
"0.6733809",
"0.6722023",
"0.6720958",
"0.6681742",
"0.66166455",
"0.661282... | 0.0 | -1 |
Returns the prefix of the template block name for this type. The block prefix defaults to the underscored short class name with the "Type" suffix removed (e.g. "UserProfileType" => "user_profile"). | public function getBlockPrefix()
{
return 'elcodi_admin_permissions_form_type_permission_group';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getName()\n {\n return $this->getBlockPrefix();\n }",
"public function getName()\n {\n return $this->getBlockPrefix();\n }",
"public function getName()\n {\n return $this->getBlockPrefix();\n }",
"public function getName()\n {\n return $this->g... | [
"0.7190001",
"0.7190001",
"0.7190001",
"0.7190001",
"0.7190001",
"0.71688044",
"0.703786",
"0.703786",
"0.69922364",
"0.69912034",
"0.68640465",
"0.6796179",
"0.6747221",
"0.670726",
"0.62883013",
"0.62694293",
"0.6195702",
"0.6174777",
"0.61599135",
"0.61453474",
"0.6094065"... | 0.0 | -1 |
Return unique name for this form | public function getName()
{
return $this->getBlockPrefix();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function FormName()\n {\n return $this->getTemplateHelper()->generateFormID($this);\n }",
"public function getFormName();",
"public function getFormName();",
"final public function getFormName(): string\n {\n\n return str_replace('.', '__', $this->getName());\n }",
"public ... | [
"0.85805243",
"0.8027047",
"0.8027047",
"0.7865612",
"0.76038104",
"0.75898325",
"0.75755566",
"0.75441486",
"0.7534791",
"0.7487986",
"0.7284605",
"0.7225703",
"0.72013086",
"0.7178432",
"0.7147245",
"0.7127443",
"0.7126057",
"0.71131283",
"0.7036463",
"0.7026459",
"0.700420... | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$categories = Categories::getAll();
return view('content.categories',compact('categories'));
} | {
"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()
{
return view('categories.create');
} | {
"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.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.717428... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(CategoriesRequest $request)
{
$inputs = array_merge($request->all());
$this->categoriesRepository->store($inputs);
return redirect(route('categories.index'));
} | {
"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)
{
$category = $this->categoriesRepository->getById($id);
return view('categories.show', compact('category'));
} | {
"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)
{
$category = $this->categoriesRepository->getById($id);
return view('categories.edit', compact('category'));
} | {
"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(CategoriesRequest $request, $id)
{
$this->categoriesRepository->update($id, $request->all());
return redirect('categories')->withOk('L\'utilisateur ' . $request->input('id') . ' a été modifié');
} | {
"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)
{
$this->categoriesRepository->destroy($id);
return redirect()->back();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n ... | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897... | 0.0 | -1 |
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.82668066",
"0.8173394",
"0.78115296",
"0.77052677",
"0.7681875",
"0.7659338",
"0.74860525",
"0.74064577",
"0.7297601",
"0.7252339",
"0.7195181",
"0.7174191",
"0.70150065",
"0.6989306",
"0.69835985",
"0.69732994",
"0.6963521",
"0.6935819",
"0.68973273",
"0.68920785",
"0.687... | 0.0 | -1 |
Show the application dashboard. | public function index()
{
$userId = Auth::id();
$roleId = DB::table('user_role')
->where('user_id','=', $userId)->get();
$roleObj = DB::table('roles')
->where('id','=', $roleId[0]->role_id)->get();
$role= $roleObj[0]->name;
$upCommingEvents = $this->getUpcommingEvents();
$teachersCount=Teacher::get()->count();
$eventsCount=Event::where('deleted', false)->get()->count();
$casualLeaves=DB::table('leaves')
->where('teacher_id', '=', $userId)
->where('leave_id', '=', 1)
->get()->count();
$medicalLeaves=DB::table('leaves')
->where('teacher_id', '=', $userId)
->where('leave_id', '=', 2)
->get()->count();
$maternityLeaves=DB::table('leaves')
->where('teacher_id', '=', $userId)
->where('leave_id', '=', 3)
->get()->count();
$leaveCount=DB::table('leaves')
->where('teacher_id', '=', $userId)
->get()->count();
return view('home.index', compact('eventsCount','upCommingEvents','teachersCount','leaveCount','casualLeaves','medicalLeaves','maternityLeaves','role'));
} | {
"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 |
Reconstruct the state of the entity from a message stream. | public static function reconstitute(array $events): self; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function FromBytes($stream)\r\n\t{\r\n\t\t//file_put_contents(\"/tmp/stream-dump.txt\", $stream);\r\n\t\t$used = 0;\r\n\t\twhile ($used < strlen($stream))\r\n\t\t{\r\n\t\t\t$f = new ProtoBuf_Field();\r\n\t\t\t$used += $parsed = $f->FromBytes($stream, $used);\r\n\t\t\tif ($parsed > 0)\r\n\t\t\t\t$this->field... | [
"0.54708993",
"0.5368382",
"0.53569835",
"0.523153",
"0.5181459",
"0.5175604",
"0.4946429",
"0.49186584",
"0.48994008",
"0.48926643",
"0.48241606",
"0.4821279",
"0.47446927",
"0.47143325",
"0.4709254",
"0.4620587",
"0.46011",
"0.45697346",
"0.45696715",
"0.4548967",
"0.450462... | 0.0 | -1 |
Accessor for the current version. | public function getVersion(): int; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function &getCurrentVersion() {\n\t\treturn $this->currentVersion;\n\t}",
"public function getVersion()\n {\n return $version;\n }",
"public function getCurrentVersion();",
"public function getVersion()\n {\n return $this->get(self::VERSION);\n }",
"function get_version() {\n\n\t\treturn ... | [
"0.82827",
"0.8273075",
"0.8266082",
"0.81601834",
"0.81588966",
"0.8151715",
"0.81372595",
"0.81330544",
"0.81270343",
"0.8119649",
"0.8108967",
"0.8108967",
"0.80865616",
"0.80865616",
"0.80865616",
"0.80865616",
"0.80865616",
"0.80865616",
"0.80865616",
"0.80865616",
"0.80... | 0.0 | -1 |
Accessor for uncommitted events. | public function getPendingEvents(): array; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUncommittedEvents();",
"public function getUncommittedEventCount();",
"public function getCommitted()\n {\n return $this->readOneof(7);\n }",
"public function getEvent()\r\n {\r\n return $this->Event;\r\n }",
"public function getEvent() {\n return $this->even... | [
"0.80540085",
"0.68608135",
"0.5830936",
"0.5719475",
"0.5710533",
"0.57101226",
"0.56775653",
"0.5661207",
"0.5661207",
"0.5661207",
"0.56357163",
"0.55537134",
"0.5544304",
"0.55212754",
"0.5500275",
"0.54324293",
"0.54324293",
"0.5423741",
"0.5421269",
"0.5413558",
"0.5398... | 0.5142505 | 54 |
Returns all the Authors | public function index(Request $request)
{
$authors = Author::with('books');
if($request->has('sort')) {
$values = explode('_', $request->sort);
$authors->orderBy($values[0], $values[1]);
}
if($request->has('name')) {
$keyword = strtolower($request->name);
$authors->whereRaw('LOWER(name) like (?)', "%{$keyword}%");
}
if($request->has('limit')) {
$authors->limit($request->limit);
}
if($request->has('offset')) {
$authors->offset($request->offset);
}
return $authors->get();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAuthors();",
"public function get_authors();",
"public function getAllAuthors()\n {\n return Author::orderBy('created_at', 'desc')->get();\n }",
"public static function getAuthors()\n\t{\n\t\treturn Author::getAll();\n\t}",
"public function findAll()\n {\n return $... | [
"0.86962265",
"0.8633084",
"0.8479406",
"0.81978595",
"0.809575",
"0.80618083",
"0.79435235",
"0.7895135",
"0.78521365",
"0.77736485",
"0.77509004",
"0.7729594",
"0.77124125",
"0.7645673",
"0.7637013",
"0.7537535",
"0.7528015",
"0.7525482",
"0.7485781",
"0.74601704",
"0.74541... | 0.61984247 | 98 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.