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 |
|---|---|---|---|---|---|---|
Retrieves the required type of Dispatcher according to the given page name. | private static final function getDispatcherType($page) {
// List here every AJAX pages
$pagesAJAX = array(
"cron"
);
// If the page is in the array
if (in_array($page, $pagesAJAX)) {
return new AJAX();
}
return new PHP();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_page( $name ) {\n\t\treturn $name ? $this->get_object( $name, 'page' ) : null;\n\t}",
"public function getContentTypeClass($pageName)\n {\n $pageName = $this->getFriendlyName($pageName);\n\n $allTypes = $this->getAllContentTypeClasses();\n\n return isset($allTypes[$pag... | [
"0.58718884",
"0.58493096",
"0.58163655",
"0.58163655",
"0.58027726",
"0.56905025",
"0.56550765",
"0.5625911",
"0.56154585",
"0.5585284",
"0.5572647",
"0.55249774",
"0.5453267",
"0.52950674",
"0.5256691",
"0.5248824",
"0.5176613",
"0.51565754",
"0.5136357",
"0.51003456",
"0.5... | 0.7577404 | 0 |
Retrieves the page from the $_GET. Also replaces "" into "_". | private static final function getPage(\phpbb\request\request $request) {
$page = $request->variable("page", ADispatcher::DEFAULT_CONTROLLER);
return str_replace("-", "_", strtolower($page));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bersihGET($papar) \n{\n\t$paparHTML = filter_input(INPUT_GET, $papar, FILTER_SANITIZE_SPECIAL_CHARS);\n\t$paparURL = filter_input(INPUT_GET, $papar, FILTER_SANITIZE_ENCODED);\n\t//$papar = filter_var($_GET[$papar], FILTER_SANITIZE_URL);\n\t\n\t//echo \"You have searched for $paparHTML.\\n\";\n\t//echo \"<... | [
"0.64691097",
"0.6289452",
"0.61375284",
"0.60681885",
"0.6035902",
"0.60167533",
"0.600143",
"0.5989319",
"0.5958492",
"0.5884145",
"0.5870913",
"0.5854474",
"0.58163035",
"0.58072394",
"0.5786383",
"0.5769944",
"0.57683516",
"0.5742934",
"0.5702014",
"0.5699888",
"0.5657288... | 0.5855577 | 11 |
Dispatches the page, the action, and parameters to the right AController. | public final function dispatch() {
$request = PhpBB::getInstance()->getRequest();
if ($this->controller != NULL) {
return $this->handleResponse(
$this->controller->executeAction(
self::getAction($request),
self::getParameters($request)
)
);
}
return $this->handleResponse(new Error404())... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dispatch()\n {\n $data = $this->router->getData();;\n $c = $data->controller;\n $ref = new $c($data->params);\n $a = $data->action;\n if (!is_null($a) && !empty($a)) call_user_func(array($ref, $a));\n return;\n }",
"p... | [
"0.685324",
"0.6655799",
"0.6588958",
"0.65379184",
"0.65329146",
"0.64895004",
"0.64130956",
"0.6410554",
"0.6375605",
"0.6331509",
"0.6330825",
"0.6330825",
"0.6330825",
"0.63155687",
"0.6293023",
"0.62606895",
"0.6225598",
"0.62163305",
"0.6216201",
"0.621201",
"0.6204824"... | 0.64251643 | 6 |
Retrieves the action from the $_GET. Also replaces "" into "_". | public static final function getAction(\phpbb\request\request $request) {
$action = $request->variable("action", AController::DEFAULT_ACTION);
return str_replace("-", "_", strtolower($action));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _get_action()\n {\n $retval = preg_quote($this->object->param('action'), '/');\n $retval = strtolower(preg_replace(\"/[^\\\\w]/\", '_', $retval));\n return preg_replace(\"/_{2,}/\", \"_\", $retval) . '_action';\n }",
"public function get_action() {\n\t\t$action\t\t\t\t\t\t\t\t... | [
"0.791511",
"0.7254227",
"0.7140272",
"0.7133606",
"0.69927347",
"0.6904715",
"0.6876074",
"0.6832604",
"0.67941463",
"0.66802377",
"0.6647116",
"0.66080964",
"0.6598364",
"0.65678906",
"0.6386663",
"0.63134795",
"0.63092816",
"0.62517476",
"0.6231177",
"0.61898184",
"0.61291... | 0.6473316 | 14 |
Merge GET and POST values into one single array. Also removes value from page and action used by ADispatcher and AController | public static final function getParameters(\phpbb\request\request $request) {
$values = array_merge_recursive(
array(),
$request->get_super_global(request_interface::GET),
$request->get_super_global(request_interface::POST)
);
if (array_key_exists("page", $values) && !empty($values['page'])) {
unset($... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getActionParams() { return array_merge($_GET, $_POST); }",
"public function getActionParams()\n\t{\n\t\t$args = parent::getActionParams();\n\n\t\t// Add in the $_POST array, giving it precedence\n\t\treturn array_merge($args, $_POST);\n\t}",
"protected function __getPostRemoveEmpty(){\r\n ... | [
"0.7287896",
"0.64479154",
"0.63948417",
"0.6167034",
"0.6009163",
"0.59874064",
"0.5962537",
"0.594242",
"0.58935344",
"0.58619934",
"0.5798575",
"0.5759933",
"0.57418805",
"0.56824875",
"0.5674535",
"0.5653743",
"0.56532925",
"0.5645066",
"0.5606732",
"0.5604698",
"0.558737... | 0.5100032 | 74 |
Handles the response accordingly. | protected abstract function handleResponse(View $view); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function process_response() {\n\t\t\t$this->response['response']['Message'] = isset($this->response['response']['Message']) ? $this->response['response']['Message'] : '';\n\t\t\t$this->response['response']['error'] = (strpos(strtolower($this->response['response']['Message']), 'invalid') !== false) ? true... | [
"0.77262974",
"0.772563",
"0.7590391",
"0.73592067",
"0.7097606",
"0.7097482",
"0.7087113",
"0.69908226",
"0.6897515",
"0.6848459",
"0.6693331",
"0.6671048",
"0.6668582",
"0.6638462",
"0.66298544",
"0.6606334",
"0.6536513",
"0.6512884",
"0.64772254",
"0.6461064",
"0.6454721",... | 0.72486347 | 4 |
This function returns all the testcases inside one parent category and their subcategories | function getFilteredTestCasesInsideCategory($parentCategoryID, $idsToSearch){
global $clientID,$categoriesItemTypeID,$categoryParentPropertyID,$testcasesItemTypeID,$testCasesCategoryPropertyID,$testcasesNamePropertyID,$testcasesOrderPropertyID,$inDebug;
// build return properties array
$returnProperties = array();... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllTestCasesInsideCategory($parentCategoryID, $clientID) {\n\n global $definitions;\n\n //get item type\n $itemTypeTestCasesID = getClientItemTypeID_RelatedWith_byName($definitions['testcases'], $clientID);\n\n //get property\n $testCasesParentPropertyID = getClientPropertyID_RelatedWith... | [
"0.7702972",
"0.75852704",
"0.7377731",
"0.7181234",
"0.71775866",
"0.7006619",
"0.68165207",
"0.6547832",
"0.65261054",
"0.6519886",
"0.6500176",
"0.6454018",
"0.64258707",
"0.6258138",
"0.62468475",
"0.6177269",
"0.6156098",
"0.6149857",
"0.610501",
"0.6096779",
"0.6071637"... | 0.65188265 | 10 |
Determine whether the user can view the homeSection. | public function view(User $user, HomeSection $homeSection)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isHomePage() {\n return $this->uri === $this->kirby->options['home'];\n }",
"public function isHomePage()\n\t{\n\t\treturn $this->home_page;\n\t}",
"private function isHome(): bool\n {\n if (! $this->context->get('is_entry')) {\n return false;\n }\n\n if (... | [
"0.68453467",
"0.6793855",
"0.6749943",
"0.66786456",
"0.66786456",
"0.64784837",
"0.64718413",
"0.6413568",
"0.6413568",
"0.6398466",
"0.6382212",
"0.6364407",
"0.6335144",
"0.6242335",
"0.6231097",
"0.6227865",
"0.6203153",
"0.6201138",
"0.61946094",
"0.61342824",
"0.612350... | 0.0 | -1 |
Determine whether the user can create homeSections. | public function create(User $user)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n return Auth()->user()->isAbleTo('school_sections-create');\n }",
"function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }",
"public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->ha... | [
"0.70002526",
"0.66863817",
"0.6412139",
"0.62274444",
"0.6181688",
"0.6132528",
"0.6110069",
"0.6045707",
"0.60447246",
"0.6036616",
"0.5991477",
"0.5986806",
"0.59731597",
"0.5950675",
"0.5930091",
"0.5846387",
"0.5845461",
"0.583233",
"0.5827489",
"0.5822666",
"0.581772",
... | 0.0 | -1 |
Determine whether the user can update the homeSection. | public function update(User $user, HomeSection $homesection)
{
// dd($homesection->user_id);
return $user->id == $homesection->user_id && $user->role == 'admin';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}",
"public function authorize()\n {\n if (auth()... | [
"0.6591029",
"0.6449361",
"0.6357467",
"0.63551825",
"0.6342069",
"0.63266003",
"0.62959164",
"0.62945354",
"0.6255443",
"0.62160176",
"0.6201601",
"0.6196519",
"0.61929685",
"0.61834997",
"0.6091546",
"0.6091546",
"0.60856473",
"0.6083612",
"0.6080879",
"0.60437894",
"0.6036... | 0.65515465 | 1 |
Determine whether the user can delete the homeSection. | public function delete(User $user, HomeSection $homeSection)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}",
"function canDelete() {\n return true;\n }",
"public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }",
"public function canDeletePages()... | [
"0.7144526",
"0.6601688",
"0.6566402",
"0.65225285",
"0.65159494",
"0.64713407",
"0.64658165",
"0.6396663",
"0.63796335",
"0.63678294",
"0.63438267",
"0.63352984",
"0.6299225",
"0.6288657",
"0.62610406",
"0.6225199",
"0.62093264",
"0.6184597",
"0.6183365",
"0.6183202",
"0.616... | 0.6353949 | 10 |
constructor with $db as database connection | public function __construct($db){
$this->conn = $db;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct($db) {\n $this->db = $db;\n }",
"function __construct($db) {\r\n\t\t$this->db = $db;\r\n\t}",
"public function __construct($db) {\r\n\r\n $this->conn = $db;\r\n\r\n }",
"public function __construct($db) {\n $this->conn = $db;\n }",
"public function __constru... | [
"0.887094",
"0.8836854",
"0.8794315",
"0.8782656",
"0.8782656",
"0.87762517",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8769251",
"0.8766189",
"... | 0.0 | -1 |
Returns the last ZaloRequest that was sent. Useful for debugging and testing. | public function getLastRequest()
{
return $this->lastRequest;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLastRequest()\n\t{\n\t\treturn $this->request;\n\t}",
"public function getLastRequest() {\n\t\treturn $this->_lastRequest;\n\t}",
"public function getLastRequest() {\n\t\treturn $this->lastRequest;\n\t}",
"public function getLastRequest()\n {\n return $this->api->getRequest();\n ... | [
"0.83514535",
"0.8264668",
"0.8244768",
"0.82447493",
"0.81521535",
"0.8120553",
"0.8098079",
"0.80263853",
"0.7826246",
"0.772541",
"0.7668181",
"0.7668181",
"0.7569289",
"0.7482106",
"0.7479831",
"0.7414334",
"0.73830605",
"0.7339468",
"0.717909",
"0.70524704",
"0.6957466",... | 0.8119629 | 7 |
Generates an authorization URL to begin the process of authenticating a user. | public function getAuthorizationUrlByUser($redirectUrl, $codeChallenge, $state, $separator = '&')
{
$params = [
'app_id' => $this->app->getId(),
'redirect_uri' => $redirectUrl,
'code_challenge' => $codeChallenge,
'state' => $state
];
return st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' =... | [
"0.7304819",
"0.724317",
"0.71096873",
"0.6946465",
"0.68703794",
"0.68235534",
"0.68028384",
"0.67311007",
"0.66889876",
"0.6643993",
"0.6611109",
"0.6606323",
"0.65896595",
"0.6572925",
"0.6572925",
"0.6568854",
"0.6568253",
"0.6563203",
"0.65117663",
"0.6499312",
"0.649608... | 0.0 | -1 |
Generates an authorization URL to begin the process of authenticating a official account. | public function getAuthorizationUrlByOA($redirectUrl, $codeChallenge, $state, $separator = '&')
{
$params = [
'app_id' => $this->app->getId(),
'redirect_uri' => $redirectUrl,
'code_challenge' => $codeChallenge,
'state' => $state
];
return stat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create_auth_url() {\n\t\t$params = array(\n\t\t\t'response_type' => 'code',\n\t\t\t'redirect_uri' => $this->get_redirect_uri(),\n\t\t\t'client_id' => urlencode( $this->config['client_id'] ),\n\t\t\t'scope' => implode( \" \", $this->config['scopes'] ),\n\t\t\t'access_type' =... | [
"0.7636061",
"0.73171246",
"0.71295434",
"0.7105079",
"0.70463043",
"0.7043609",
"0.70413375",
"0.7040529",
"0.70289844",
"0.7008467",
"0.6986752",
"0.6944371",
"0.6943936",
"0.69139266",
"0.6871955",
"0.6855001",
"0.68522453",
"0.685121",
"0.6831284",
"0.6825356",
"0.6765184... | 0.0 | -1 |
Get Zalo Token by user from a oauth code. | public function getZaloTokenFromCodeByUser($code, $codeVerifier)
{
$endpoint = '/access_token';
return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function userByToken();",
"public function requestToken($code) {\n $client = new Zend_Http_Client();\n $queryParams = array(\n 'client_id' => self::CLIENT_ID,\n 'client_secret' => self::CLIENT_SECRET,\n 'grant_type' => 'authorization_code',\n ... | [
"0.6548133",
"0.62418205",
"0.6216023",
"0.61993533",
"0.616934",
"0.6165256",
"0.6163069",
"0.61442304",
"0.6139946",
"0.611449",
"0.6088107",
"0.60616255",
"0.60541344",
"0.60380435",
"0.6021874",
"0.60201627",
"0.6005444",
"0.60038644",
"0.5966843",
"0.59653574",
"0.596424... | 0.6042526 | 13 |
Get Zalo Token by OA from a oauth code. | public function getZaloTokenFromCodeByOA($code, $codeVerifier)
{
$endpoint = '/oa/access_token';
return $this->getZaloTokenFromCode($code, $codeVerifier, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_oauth_code($wpoa) {\n\t$params = array(\n\t\t'response_type' => 'code',\n\t\t'client_id' => CLIENT_ID,\n\t\t'scope' => SCOPE,\n\t\t'state' => uniqid('', true),\n\t\t'redirect_uri' => REDIRECT_URI,\n\t);\n\t$_SESSION['WPOA']['STATE'] = $params['state'];\n\t$url = URL_AUTH . http_build_query($params);\n... | [
"0.63158053",
"0.6271524",
"0.6168491",
"0.61228997",
"0.60891896",
"0.60217106",
"0.59315324",
"0.5885841",
"0.5882335",
"0.58086056",
"0.57784075",
"0.5776831",
"0.5759412",
"0.5757447",
"0.57286817",
"0.5711065",
"0.5688519",
"0.568213",
"0.5679922",
"0.56456864",
"0.56436... | 0.67076296 | 0 |
Get Zalo Token from a oauth code. | public function getZaloTokenFromCode($code, $codeVerifier, $endpoint)
{
$params = [
'code' => $code,
'app_id' => $this->app->getId(),
'grant_type' => 'authorization_code',
'code_verifier' => $codeVerifier
];
$response = $this->sendRequest($end... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function requestToken($code) {\n $client = new Zend_Http_Client();\n $queryParams = array(\n 'client_id' => self::CLIENT_ID,\n 'client_secret' => self::CLIENT_SECRET,\n 'grant_type' => 'authorization_code',\n 'redirect_uri' => self::getAbsolu... | [
"0.7473007",
"0.74613917",
"0.69956553",
"0.6934205",
"0.6928433",
"0.6862946",
"0.68281823",
"0.6772642",
"0.67095494",
"0.6702045",
"0.66770226",
"0.6670247",
"0.6662462",
"0.6651413",
"0.6650898",
"0.6649306",
"0.663062",
"0.658401",
"0.6549713",
"0.6542398",
"0.651721",
... | 0.0 | -1 |
Get Zalo Token by user from a refresh token. | public function getZaloTokenFromRefreshTokenByUser($refreshToken)
{
$endpoint = '/access_token';
return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRefreshToken();",
"public function refreshToken($refreshToken,$userIdentifier){\r\n return $oAuthTokens = $this->oAuthClient->generateAccessTokenFromRefreshToken($refreshToken,$userIdentifier);\r\n }",
"public function getRefreshToken($refreshToken);",
"public function userByToken... | [
"0.7064229",
"0.67303157",
"0.66610783",
"0.663927",
"0.64334583",
"0.64309305",
"0.64272475",
"0.6382374",
"0.63475156",
"0.628991",
"0.62442255",
"0.6195381",
"0.6168231",
"0.614821",
"0.61375743",
"0.61200464",
"0.6115424",
"0.6108219",
"0.61064184",
"0.61057794",
"0.60942... | 0.7421615 | 0 |
Get Zalo Token by OA from a refresh token. | public function getZaloTokenFromRefreshTokenByOA($refreshToken)
{
$endpoint = '/oa/access_token';
return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generateAccessToken($token){\n $zohoCredentials = $this->where('user_id',Auth::user()->id)->first();\n $tokenval = json_decode($token->value);\n $refresh_token=$tokenval->refresh_token;\n\n $post = [\n 'refresh_token' => $refresh_token,\n 'redirect_... | [
"0.6578652",
"0.6435746",
"0.6199668",
"0.61013776",
"0.5993337",
"0.5982597",
"0.5947403",
"0.5947034",
"0.5908615",
"0.5903045",
"0.5868388",
"0.58446217",
"0.5836059",
"0.58323646",
"0.58042264",
"0.58040535",
"0.5799324",
"0.5785068",
"0.5777068",
"0.5756752",
"0.5737968"... | 0.78807735 | 0 |
Get a ZaloToken from a refresh token. | public function getZaloTokenFromRefreshToken($refreshToken, $endpoint)
{
$params = [
'refresh_token' => $refreshToken,
'app_id' => $this->app->getId(),
'grant_type' => 'refresh_token'
];
$response = $this->sendRequest($endpoint, $params);
return $... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRefreshToken();",
"public function getRefreshToken($refreshToken);",
"public function getZaloTokenFromRefreshTokenByUser($refreshToken)\n {\n $endpoint = '/access_token';\n return $this->getZaloTokenFromRefreshToken($refreshToken, $endpoint);\n }",
"public function getZ... | [
"0.75672966",
"0.752618",
"0.73875654",
"0.7093878",
"0.6966197",
"0.6947219",
"0.6862143",
"0.68446887",
"0.68046284",
"0.67479366",
"0.6725597",
"0.6703755",
"0.6703114",
"0.66802675",
"0.663067",
"0.66197187",
"0.6618539",
"0.6602108",
"0.6600503",
"0.6596477",
"0.6576707"... | 0.6353746 | 26 |
Build a ZaloToken from a ZaloResponse | protected function buildZaloTokenFromZaloResponse($response)
{
$data = $response->getDecodedBody();
if (!isset($data['access_token'])) {
throw new ZaloSDKException('Access token was not returned from request.', 401);
}
$accessToken = $data['access_token'];
if (!... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function tokenFromResponse($response){\n parse_str($response);\n $this->token = $access_token;\n }",
"protected function _createNewToken(Eway_Rapid31_Model_Response $response)\n {\n try {\n $customer = $response->getCustomer();\n\n $tokenInfo = array(\n ... | [
"0.6656247",
"0.638981",
"0.6044114",
"0.594295",
"0.5584943",
"0.5584056",
"0.55710405",
"0.5568637",
"0.55299413",
"0.55171824",
"0.55137736",
"0.5434297",
"0.5419445",
"0.5346053",
"0.53301066",
"0.53043735",
"0.5287231",
"0.52536833",
"0.51734364",
"0.51734364",
"0.517343... | 0.809194 | 0 |
Escapes HTML for output | function escape($html) {
return htmlspecialchars($html, ENT_QUOTES | ENT_SUBSTITUTE, "UTF-8");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function escape()\n\t{\n\t\treturn ! $this->escaped ? esc_html($this->content) : $this->content;\n\t}",
"public function renderEscaped(): string\n {\n $this->escapeHtml(true);\n\n return $this->render();\n }",
"function escape($html) { return htmlspecialchars($html, ENT_QUOTES | ENT_... | [
"0.7599932",
"0.7566792",
"0.7518149",
"0.7114036",
"0.7030297",
"0.70085686",
"0.6928343",
"0.6913884",
"0.68620974",
"0.6840841",
"0.6694448",
"0.66618204",
"0.6648232",
"0.66341335",
"0.66086787",
"0.66071266",
"0.6585318",
"0.6581215",
"0.6574279",
"0.65725774",
"0.655474... | 0.7069538 | 4 |
/ Plugin Name: Ajax page load Plugin URI: Description: Ajax the world, yolo! Version: 0.0.1 Author: Cesare Cocito Author URI: License: GPL2 License URI: Domain Path: /languages Text Domain: ajpl | function asdotrack_skin_scripts() {
wp_register_script('ajpl-ajax', plugin_dir_url(__FILE__) . 'js/ajax.js', array( 'jquery' ) );
wp_localize_script( 'ajpl-ajax', 'ajpl', array(
'ajaxurl' => admin_url( 'admin-ajax.php' ),
'ajplNonce' => wp_create_nonce( 'ajpl-nonce' ),
//'before' => false,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loading_page_admin_init(){\n load_plugin_textdomain( LOADING_PAGE_TD, false, LOADING_PAGE_PLUGIN_DIR . '/languages/' );\n\n // Set plugin links\n $plugin = plugin_basename(__FILE__);\n add_filter('plugin_action_links_'.$plugin, 'loading_page_links');\n\n // Load resource... | [
"0.6979065",
"0.65815854",
"0.64389163",
"0.6437674",
"0.6396322",
"0.6391373",
"0.6377355",
"0.6371476",
"0.63523334",
"0.6337274",
"0.6297271",
"0.62650955",
"0.6252879",
"0.624005",
"0.6203887",
"0.6177601",
"0.61650836",
"0.6155671",
"0.6154683",
"0.6151414",
"0.6149632",... | 0.63921356 | 5 |
recupera l'id della pagina dal permalink | function load_post_callback() {
if ( isset($_POST['id'] ) ) {
$id = $_POST['id'];
} elseif ($_POST['permalink']){
$id = url_to_postid( $_POST['permalink'] );
} else {
wp_send_json_error('No page requested');
}
if ($id == 0){
wp_send_json_error('No page requested');
}
// recupera il post
$args = array... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPermalinkID($db, $safeButUnescapedPath) {\n $path = $db->doEscapeParam($safeButUnescapedPath);\n $query = \"SELECT * FROM permalinks WHERE path ='$path'\";\n $rows = $db->doQuery($query);\n return (count($rows) === 1) ? $rows[0]['id'] : 0;\n }",
"public function getUrlId();",
... | [
"0.7064595",
"0.6859658",
"0.6698544",
"0.6698517",
"0.65625405",
"0.65625405",
"0.647614",
"0.6378253",
"0.63410705",
"0.63195163",
"0.6318693",
"0.628233",
"0.6270037",
"0.62672615",
"0.62601656",
"0.6241309",
"0.6206426",
"0.61797935",
"0.61594635",
"0.6143704",
"0.6135692... | 0.0 | -1 |
search backwards starting from haystack length characters from the end | function startsWith($haystack, $needle) {
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function strpos_last($haystack, $needle) {\r\n\t\tif(strlen($needle) === 0) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$len_haystack = strlen($haystack);\r\n\t\t$len_needle = strlen($needle);\t\t\r\n\t\t$pos = strpos(strrev($haystack), strrev($needle));\r\n\t\tif($pos === false) {\r\n\t\t\treturn false;\r\n\t\t}\r\n... | [
"0.65940523",
"0.6586245",
"0.65789247",
"0.64274114",
"0.6359162",
"0.6305681",
"0.62781745",
"0.6266382",
"0.61677057",
"0.61317486",
"0.6023471",
"0.59243816",
"0.58941704",
"0.5891455",
"0.58855695",
"0.58644915",
"0.5817055",
"0.5791456",
"0.57525593",
"0.56922936",
"0.5... | 0.0 | -1 |
De render functie ontvangt het gevraagde bestandsnaam en heeft een data array als niet verplichte variabele Allereerst wordt er door de data array heen gelopen en wordt elk item omgezet in een variabele. Bijvoorbeeld: $data["voornaam"] wordt in de view beschikbaar als $voornaam Daarna worden er 3 bestanden ingeladen. D... | function render($filename, $data = null)
{
if ($data) {
foreach($data as $key => $value) {
$$key = $value;
}
}
require('templates\header.php');
require($filename . '.php');
require('templates\footer.php');
die();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function render($filename, $data = null)\n{\n\tif ($data && is_array($data)) { //ik heb de core hier aangepast zodat als je render('', array($val1 /*is an array*/, $val2)) doet dat ie ook al the variables goed regeld\n\t\tforeach ($data as $key => $value){\n\t\t\tif(!is_object($value)){// we wilen niet dat de code... | [
"0.73604995",
"0.68902063",
"0.6707959",
"0.6618832",
"0.6528438",
"0.6436547",
"0.6355825",
"0.62887096",
"0.62724173",
"0.6236665",
"0.6235162",
"0.6198221",
"0.6194328",
"0.61886233",
"0.6139481",
"0.6127642",
"0.6093501",
"0.60799205",
"0.6079408",
"0.6076341",
"0.6033123... | 0.62253404 | 11 |
echo ('T_group_info Model init!!'); | protected static function init()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display() {\r\n\t\t$model = $this->getModel ( 'gruppi' );\r\n\t\t//$model->importJUser();\r\n\t\tparent::display();\r\n\t}",
"function groupmessageboard_init() {\n\n\telgg_extend_view('groups/tool_latest','gmessageboard/group_module',1);\n}",
"function __construct()\n {\n // ... | [
"0.6496339",
"0.6377201",
"0.6340512",
"0.63042873",
"0.6286095",
"0.62701666",
"0.61889595",
"0.6051195",
"0.59630615",
"0.5939663",
"0.5930781",
"0.59022796",
"0.5858376",
"0.5831459",
"0.579548",
"0.5780874",
"0.57636833",
"0.5745324",
"0.57064694",
"0.5687466",
"0.568454"... | 0.0 | -1 |
//$this>errMsgsArr[$fieldName] = array("errCode"=>$errCode, "msg"=>$msg, "fieldName"=>$fieldName); | protected function addErrMsg($msg, $fieldName, $errCode, $severity) //should be in abstract class
{
$this->errMsgsArr[$fieldName] = new ERR($msg, $fieldName, $errCode, $severity);
//if required then "Required field $fieldName" + msg
//msg either "field is not of expected data type i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_to_error_array($field = '', $message = '')\n {\n if ( ! isset($this->_error_array[$field]))\n {\n $this->_error_array[$field] = $message;\n }\n\n return;\n }",
"private function _error($msg = '')\n {\n return array('error' => $msg);\n }",
"... | [
"0.6842536",
"0.66193515",
"0.65815634",
"0.6542045",
"0.63488364",
"0.6211707",
"0.6080832",
"0.6058984",
"0.6033558",
"0.6026323",
"0.59879583",
"0.59748214",
"0.58849835",
"0.5875412",
"0.5833254",
"0.5830733",
"0.5822193",
"0.58094937",
"0.57812786",
"0.57648045",
"0.5752... | 0.6425753 | 4 |
Get how many result from a posinc header. | function posinc_headers_count_by_criteria($field_name = '', $field_type = '', $field_content = '', $date_from = '', $date_to = '', $status = 0, $sort = '') {
if(empty($field_content))
$field_content = '';
if(empty($date_from))
$date_from = '';
if(empty($date_to))
$date_to = '';
if(empty($field_cont... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function countHeader()\n {\n $headerCount = 0;\n foreach ($this->data[0] as $transactionData) {\n if($transactionData) $headerCount += 1;\n }\n return $headerCount;\n }",
"public function getHeaderLength()\n {\n return $this->headerLength;\n }",
... | [
"0.6723938",
"0.6068429",
"0.6056738",
"0.6056738",
"0.6056738",
"0.5998293",
"0.59429556",
"0.59142464",
"0.5859364",
"0.585819",
"0.5840473",
"0.58282596",
"0.58222246",
"0.5785394",
"0.57710683",
"0.5702341",
"0.5662599",
"0.5603648",
"0.55612063",
"0.5546585",
"0.55403155... | 0.0 | -1 |
end of browse start of input | function posinc_header_select($id) {
$this->db->from('t_posinc_header');
$this->db->order_by('id_posinc_header');
$this->db->where('id_posinc_header', $id);
$query = $this->db->get();
if($query->num_rows() > 0)
return $query->row_array();
else
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getEndInput(): Input {\n return $this->upperInput;\n }",
"public function GoToEnd()\n {\n $this->setItemPointer(($this->Length() - 1));\n }",
"public function get_end_cursor()\n {\n }",
"public function eof();",
"public function eof();",
"public function eo... | [
"0.6146185",
"0.5944995",
"0.5735529",
"0.5630303",
"0.5630303",
"0.56229395",
"0.5612025",
"0.56011957",
"0.5398812",
"0.5387007",
"0.53679657",
"0.5256146",
"0.525614",
"0.52152336",
"0.51474357",
"0.512471",
"0.5117081",
"0.508345",
"0.508312",
"0.50801855",
"0.5076219",
... | 0.0 | -1 |
Specifies the type of the organization in the hierachy. Only suborganizations can be newly created. (required) | public function type(OrganizationType $type)
{
$this->type = $type;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function setOrganization() {}",
"public function setOrganization($val)\n {\n $this->_propDict[\"organization\"] = $val;\n return $this;\n }",
"public function setOwnerType($val)\n {\n $this->_propDict[\"ownerType\"] = $val;\n return $this;\n }",
"function Org... | [
"0.5971098",
"0.58305913",
"0.56215245",
"0.560196",
"0.5576466",
"0.5368283",
"0.5294454",
"0.5226254",
"0.520699",
"0.5192983",
"0.51843065",
"0.5158562",
"0.5157589",
"0.5147624",
"0.5146748",
"0.5135818",
"0.50923425",
"0.50736207",
"0.50725406",
"0.5053438",
"0.50439733"... | 0.6149541 | 0 |
Run the database seeds. | public function run()
{
$category = new Category();
$category->name = "Men's Fashion";
$category->slug = "A new style cloths for men.";
$category->save();
$category = new Category();
$category->name = "Women's Fashion";
$category->slug = "A new style cloths f... | {
"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 |
Create a new torrents controller instance. | public function __construct()
{
$this->middleware('auth');
//$this->middleware('auth', ['only' => 'create']);
} | {
"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.68487304",
"0.6648464",
"0.6401117",
"0.6321797",
"0.6211108",
"0.6195524",
"0.61517876",
"0.6067127",
"0.6062295",
"0.6059265",
"0.6003153",
"0.5977132",
"0.5966941",
"0.5956305",
"0.59340405",
"0.5931451",
"0.5896649",
"0.588841",
"0.5834794",
"0.58190525",
"0.57721466",... | 0.0 | -1 |
show all torrent or one based on search. | public function index(Request $request)
{
//$output = \Tmdb::getSearchApi()->searchMovies('saw',array('language' => 'fr'));
$perPage = 2;
$input = $request->input('q');
$tags = '';
if ($request->input('tags') != '') {
$tags = explode(',', $request->input('tags')... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function search()\n {\n $vereinRepository = new VereinRepository();\n $searchTerm = $_GET['searchTerm'];\n $view = new View('verein_index');\n $view->heading = 'Suchbegriff: '. $searchTerm;\n $view->title = 'Vereine';\n $view->vereine = $vereinRepository->search($searchTerm)... | [
"0.6373711",
"0.62420404",
"0.6092526",
"0.60694516",
"0.604872",
"0.60119194",
"0.60119194",
"0.60119194",
"0.5934348",
"0.5917506",
"0.5807493",
"0.58016276",
"0.5770522",
"0.57559943",
"0.57195836",
"0.5716357",
"0.5687029",
"0.56843454",
"0.5675398",
"0.56733894",
"0.5668... | 0.0 | -1 |
Show the series page according to the torrent. | public function show(Torrent $torrent)
{
return view('series.show', compact('torrent'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n $series = ContentHandler::getLatestSeriesSimplePaginate(9);\n\n $subscribed = UserHandler::checkSubscription();\n\n return Theme::view('series.index', [\n 'content' => $series, \n 'subscribed' => $subscribed,\n ]);\n }",
"publi... | [
"0.68016213",
"0.67161155",
"0.670912",
"0.65621823",
"0.64823246",
"0.64804983",
"0.6376649",
"0.6353893",
"0.60920006",
"0.6072526",
"0.60561466",
"0.60531056",
"0.59571636",
"0.583245",
"0.5817992",
"0.5738484",
"0.57279515",
"0.56740916",
"0.56675434",
"0.5604933",
"0.554... | 0.6659827 | 3 |
Save new torrent in BD. | public function store(TorrentRequest $request)
{
$this->createTorrent($request);
flash('Votre torrent a été ajouté');
return redirect('torrents');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `tours` set \";\n\t\t\t$i = 0;\n\t\t\tforeach($this->UPDATE as $u){\n\t\t\t\tif ($i>0) $sql = $sql.\" , \";\n\t\t\t\t$sql = $sql.$u;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$sql = $sql.\" WHERE `id`='\".addslashes($this->id).\"'\";\n\t\t}e... | [
"0.64194536",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.62590057",
"0.6206342",... | 0.6107702 | 29 |
Sync up the list of tags in the database. | private function syncTags(Movie $movie, array $tags)
{
$movie->tags()->sync($tags);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pico_sync_tags($mydirname)\n{\n\t$db = XoopsDatabaseFactory::getDatabaseConnection();\n\n\t// get all tags in tags table\n\t$all_tags_array = [];\n\t$result = $db->query('SELECT label FROM ' . $db->prefix($mydirname . '_tags'));\n\twhile (list($label) = $db->fetchRow($result)) {\n\t\t$all_tags_array[$labe... | [
"0.65426326",
"0.6495874",
"0.6242632",
"0.6236097",
"0.6214575",
"0.620443",
"0.61687785",
"0.6151563",
"0.60765684",
"0.602629",
"0.6003759",
"0.5991478",
"0.5988167",
"0.5977015",
"0.59762394",
"0.59760094",
"0.59514785",
"0.59126663",
"0.5912211",
"0.58993334",
"0.5896452... | 0.57872665 | 29 |
Save a new article. | private function createTorrent(TorrentRequest $request)
{
$collection = \Tmdb::getMoviesApi()->getMovie($request->input('tmdb_id'))['belongs_to_collection'];
if ($collection['name'] != null) {
$serie = Serie::firstOrCreate(['title' => $collection['name'], 'tmdb_id' => $collection['id']]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveAction()\n {\n\n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"articles\",\n \"action\" => \"index\"\n ));\n }\n\n $id = $this->request->getPost(\"id\");\n\n $a... | [
"0.7495521",
"0.7338945",
"0.73143536",
"0.7083988",
"0.704278",
"0.6945502",
"0.6897031",
"0.68532366",
"0.6772855",
"0.67460746",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
"0.6732604",
... | 0.0 | -1 |
Find information for the upload autocomplete. | public function findAutocompleteInfo(Request $request)
{
//dd($request->all());
$name = $request->input('query');
$output = \Tmdb::getSearchApi()->searchMovies($name, array('language' => 'fr', 'search_type' => 'ngram', 'year' => $request->input('year')));
//$output = \Tmdb::getMoviesAp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAutocomplete() { return $this->readAutocomplete(); }",
"function suggest()\n {\n // allow parallel searchs to improve performance.\n session_write_close();\n $suggestions = $this->Item->get_manage_items_search_suggestions($this->input->get('term'), 100);\n echo json_enc... | [
"0.58987004",
"0.58928037",
"0.5892126",
"0.58619815",
"0.5801784",
"0.57530075",
"0.5694007",
"0.5627469",
"0.5595498",
"0.5577241",
"0.54767525",
"0.5462312",
"0.54321563",
"0.54269177",
"0.5419353",
"0.5385081",
"0.5366471",
"0.5363788",
"0.53560567",
"0.5344834",
"0.53290... | 0.5648393 | 7 |
Creates data provider instance with search query applied | public function search($params)
{
$query = ApoyoAcademico::find();
// add conditions that should always apply here
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
$this->load($params);
if (!$this->validate()) {
// uncomment ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function searchQueryDataProvider() {}",
"public function search()\n {\n $q = $this->getQuery();\n $dataProvider = new ActiveDataProvider([\n 'query' => $q,\n ]);\n\n return $dataProvider;\n }",
"public function getQueryDataProvider() {}",
"public function s... | [
"0.7773856",
"0.674291",
"0.65721744",
"0.6503215",
"0.6472826",
"0.6389071",
"0.63745373",
"0.6287255",
"0.62671757",
"0.62457365",
"0.62425256",
"0.62123144",
"0.61969537",
"0.6172912",
"0.61250603",
"0.6123412",
"0.6116283",
"0.61031115",
"0.6101092",
"0.608637",
"0.608177... | 0.0 | -1 |
Check if an error (enum name or value) has a helpful message defined. | public static function hasMessageForError($value)
{
if (self::isValidName($value)) {
$value = self::getNameValue($value);
}
return isset(self::$messages[$value]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasErrMsg()\n {\n return $this->get(self::ERRMSG) !== null;\n }",
"private function errorMessages()\n {\n return [\n 'question_category_id.required' => 'Atleast one question-category '.\n 'is required',\n ];\n }",... | [
"0.6532334",
"0.6112858",
"0.60871816",
"0.5994619",
"0.588347",
"0.5871205",
"0.58507043",
"0.58352774",
"0.5829778",
"0.58265734",
"0.5783014",
"0.57745075",
"0.5774181",
"0.57488996",
"0.574561",
"0.5728158",
"0.5723214",
"0.5721792",
"0.5719723",
"0.56991595",
"0.5686096"... | 0.61666507 | 1 |
Get the helpful error message for a specific error if it exists. | public static function getMessageForError($value)
{
if (self::isValidName($value)) {
$value = self::getNameValue($value);
}
return isset(self::$messages[$value]) ? self::$messages[$value] : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getErrorMessage(): ?string {\n\t\t// 1. a string with an error message (e.g. `{\"error\":{\"code\":404,\"errors\":\"invalid token\"},\"success\":false}`)\n\t\t// 2. an object (e.g. `{\"error\":{\"code\":120,\"errors\":{\"name\":\"payload\",\"reason\":\"required\"}},\"success\":false}`)\n\t\t//\n\t\... | [
"0.7344493",
"0.7142879",
"0.7049306",
"0.70177937",
"0.689458",
"0.67980844",
"0.6797857",
"0.67960685",
"0.6774486",
"0.6773865",
"0.6746002",
"0.67257935",
"0.6717672",
"0.6712315",
"0.66933566",
"0.6687774",
"0.6680655",
"0.662988",
"0.66238904",
"0.66158855",
"0.66087085... | 0.6610221 | 20 |
Get the helpful error message for this response code, if any is defined. | public function getMessage()
{
return self::getMessageForError($this->value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function responseMessage()\n {\n return isset($this->codes[$this->code]) ? $this->codes[$this->code] : '';\n }",
"public function getError()\n {\n\n if (!$this->getResponse()) {\n return null;\n }\n\n if ($this->isOK()) {\n return null;\n ... | [
"0.7717625",
"0.76589835",
"0.7489517",
"0.7439286",
"0.74276996",
"0.7334964",
"0.7283329",
"0.7266248",
"0.724295",
"0.7181715",
"0.71788627",
"0.71765745",
"0.7099624",
"0.7081251",
"0.7066938",
"0.70620763",
"0.70488137",
"0.70370346",
"0.7025028",
"0.7020223",
"0.7010262... | 0.67958355 | 43 |
Returns the static model of the specified AR class. | public static function model($className=__CLASS__)
{
return parent::model($className);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function model()\r\n {\r\n return static::class;\r\n }",
"public static function model() {\n return parent::model(get_called_class());\n }",
"public static function model($class = __CLASS__)\n {\n return parent::model($class);\n }",
"public static function model($cl... | [
"0.74850124",
"0.73803526",
"0.7154113",
"0.71401674",
"0.70629025",
"0.703232",
"0.69285315",
"0.69285315",
"0.6925706",
"0.6902751",
"0.6894916",
"0.6894916",
"0.68900806",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.68698424",
"0.... | 0.0 | -1 |
Retrieves a list of models based on the current search/filter conditions. | public function search()
{
// Warning: Please modify the following code to remove attributes that
// should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('id',$this->id);
$criteria->compare('message',$this->message,true);
$criteria->compare('subject',$this->subject,true);
$criteria->co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModels();",
"public function getModels();",
"public function findAll($model);",
"public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('w... | [
"0.6743169",
"0.6743169",
"0.660761",
"0.6479806",
"0.63798267",
"0.63454884",
"0.6310211",
"0.630157",
"0.6253882",
"0.62494963",
"0.62494963",
"0.6111013",
"0.6077699",
"0.60734916",
"0.604629",
"0.60349816",
"0.60323626",
"0.6014135",
"0.5981404",
"0.5979577",
"0.59790176"... | 0.0 | -1 |
Get real visitor IP behind CloudFlare network | public function getUserIP() {
if (isset($_SERVER["HTTP_CF_CONNECTING_IP"])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
$_SERVER['HTTP_CLIENT_IP'] = $_SERVER["HTTP_CF_CONNECTING_IP"];
}
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ip()\n{\n return \\SumanIon\\CloudFlare::ip();\n}",
"public static function ip()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn filter_var(request()->header('CF_CONNECTING_IP'), FILTER_VALIDATE_IP);\n\t\t}) ?: request()->ip();\n\t}",
"public static function getIP() {\n\n ... | [
"0.8134372",
"0.78707206",
"0.78628796",
"0.7771929",
"0.7717964",
"0.7709309",
"0.7699518",
"0.7663612",
"0.7652659",
"0.7631865",
"0.762262",
"0.7617747",
"0.76061195",
"0.7599003",
"0.7598686",
"0.7581547",
"0.7579719",
"0.7562035",
"0.7552743",
"0.75504524",
"0.75504524",... | 0.7256931 | 99 |
Registers services on the given app. This method should only be used to configure services and parameters. It should not get services. | public function register(Application $app)
{
parent::register($app);
$app['cache'] = $app->share(function ($app) {
$config = $app['config'];
if (! array_key_exists('cache.driver', $config)) {
return new ArrayCache();
}
switch ($config['... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function register(Container $app);",
"public function register(Application $app)\n {\n // if console register console providers\n if (php_sapi_name() === 'cli') {\n $app->register(new ConsoleProvider);\n }\n $app->register(new DoctrineOrmManagerRegistryPr... | [
"0.7093729",
"0.6959216",
"0.6948521",
"0.68954635",
"0.686848",
"0.679123",
"0.6783036",
"0.6747346",
"0.67230237",
"0.6703542",
"0.6648266",
"0.6615571",
"0.65958136",
"0.6593183",
"0.6561424",
"0.6540766",
"0.65216947",
"0.6500588",
"0.6488714",
"0.648653",
"0.6480464",
... | 0.62920517 | 39 |
Bootstraps the application. This method is called after all services are registered and should be used for "dynamic" configuration (whenever a service must be requested). | public function boot(Application $app)
{
// TODO: Implement boot() method.
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function boot()\n {\n $this->shareResources();\n $this->mergeConfigFrom(self::CONFIG_PATH, 'amocrm-api');\n }",
"public function boot()\n {\n $this->setupConfig($this->app);\n }",
"public function bootstrap(): void\n {\n if (! $this->app->hasBeenBootstrapped())... | [
"0.75502616",
"0.75494164",
"0.73749775",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7332361",
"0.7329851",
"0.730737",
"0.7304671",
"0.72920865",
"0.7271831",
"0.72522545",
"0.72344595",
"0.72166127",
"0.7215375",
"0.7215161... | 0.0 | -1 |
Seed the application's database. | public function run()
{
$usuario1 = new User(
[
'rut_usuario' => '19105288',
'nombre_usuario' => 'SILVA ESTEFANIA',
'domicilio_usuario' => 'Calle #1234',
'fecha_nac' => '1994-10-14',
'email' => 'admin@hotmail.com',
... | {
"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 |
Get a validator for an incoming registration request. | public function register(Request $data)
{
$client = new Client();
$client2 = new Client();
try{
$res = $client->request('POST', 'http://127.0.0.1:8000/api/register', [
'form_params' => [
'name' => $data->name,
'email' => $data->email,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getValidator() {}",
"public function getValidator();",
"public function getValidator();",
"public function getValidator()\n {\n return $this->validator;\n }",
"public function getValidator()\n {\n return $this->validator;\n }",
"public function getValidator()\n ... | [
"0.7217253",
"0.71017957",
"0.71017957",
"0.7048845",
"0.7048845",
"0.7048845",
"0.6924129",
"0.69168675",
"0.6899657",
"0.68542325",
"0.684801",
"0.68128955",
"0.68007755",
"0.6797457",
"0.67463154",
"0.66977936",
"0.6687648",
"0.6645321",
"0.6593937",
"0.6564549",
"0.650673... | 0.0 | -1 |
TODO:add softdelete to media then impliment this action | public function undeleteAction(){
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteMedia() {\n\t\tif(isset($this->data['mdid'])) {\n\t\t\t$rs = mq(\"update \" . DB_TBL_MEDIA . \" set md_active='0' where mdid='\" . $this->data['mdid'] . \"'\");\n\t\t\t$_SESSION['_mtype'] = \"W\";\n\t\t\t$_SESSION['_msg'] = \"deletedmedia\";\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}"... | [
"0.6850172",
"0.68044263",
"0.6698258",
"0.6342084",
"0.62271947",
"0.62087977",
"0.61943966",
"0.6163046",
"0.616006",
"0.61591274",
"0.61587214",
"0.61318684",
"0.6108222",
"0.61035967",
"0.6091239",
"0.6087458",
"0.6081194",
"0.60750633",
"0.6039582",
"0.6016609",
"0.60127... | 0.5844161 | 35 |
Gets query for [[AuthUserRoles]]. | public function getAuthUserRoles()
{
return $this->hasMany(AuthUserRole::className(), ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ... | [
"0.72904855",
"0.7241075",
"0.7217274",
"0.71789694",
"0.7175139",
"0.71642995",
"0.71013355",
"0.70474124",
"0.70197487",
"0.70162874",
"0.7009743",
"0.700763",
"0.6996395",
"0.69680065",
"0.6965587",
"0.6945544",
"0.694478",
"0.694478",
"0.689542",
"0.6867073",
"0.68490136"... | 0.7247991 | 1 |
Gets query for [[Roles]]. | public function getRoles()
{
return $this->hasMany(AuthRole::className(), ['id' => 'role_id'])->viaTable('auth_user_role', ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }",
"public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameR... | [
"0.75666773",
"0.7546121",
"0.7342624",
"0.73010975",
"0.72883534",
"0.72692055",
"0.72331977",
"0.7229644",
"0.7215152",
"0.7206947",
"0.71684676",
"0.71464187",
"0.7121172",
"0.7111802",
"0.7095937",
"0.7077436",
"0.70490164",
"0.7048976",
"0.70297486",
"0.70243764",
"0.700... | 0.6902539 | 33 |
Gets query for [[BranchUsers]]. | public function getBranchUsers()
{
return $this->hasMany(BranchUser::className(), ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllBoUsers()\n {\n $Query = \"select identifier, login from User WHERE type NOT IN ('contributor','client','chiefodigeo','superclient')\";\n if(($result = $this->getQuery($Query,true)) != NULL)\n return $result;\n else\n return \"NO\";\n }",
"pu... | [
"0.652172",
"0.6406769",
"0.63893676",
"0.6243423",
"0.5955821",
"0.5922144",
"0.58860856",
"0.588534",
"0.588534",
"0.588534",
"0.58408",
"0.5833292",
"0.580099",
"0.57879907",
"0.5785123",
"0.5784147",
"0.5771292",
"0.5766113",
"0.5763777",
"0.5758388",
"0.5737733",
"0.57... | 0.7455023 | 0 |
Gets query for [[Branches]]. | public function getBranches()
{
return $this->hasMany(Branch::className(), ['id' => 'branch_id'])->viaTable('branch_user', ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBranches();",
"public function getAllBranches() {\n\t\t\t// Database Connection\n\t\t\t$db\t\t\t\t= $GLOBALS['db_q'];\n\t\t\t// Initialize variables\n\t\t\t$return\t\t\t= false;\n\t\t\t// Query set up\t\n\t\t\t$table\t\t\t= 'tb_branch AS b';\n\t\t\t$select_what\t= 'b.id, b.vc_branch AS vc_name... | [
"0.7334657",
"0.7314451",
"0.7273982",
"0.72302026",
"0.708368",
"0.63874584",
"0.6365511",
"0.634872",
"0.62989163",
"0.6266081",
"0.6158412",
"0.60645807",
"0.60439175",
"0.5937598",
"0.5901767",
"0.58994997",
"0.57146263",
"0.567026",
"0.56433",
"0.56433",
"0.5586284",
"... | 0.6345976 | 8 |
Gets query for [[MenuCooks]]. | public function getMenuCooks()
{
return $this->hasMany(MenuCook::className(), ['cook_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQueryMenus();",
"public function get_book()\n {\n $sql = DB::select('select * from books');\n return $sql;\n }",
"public function getBooks()\n {\n $page = isset($_GET['page']) ? $_GET['page'] : 1;\n $this->limit = isset($_GET['limit']) ? $_GET['limit'] : ... | [
"0.6034852",
"0.57275033",
"0.5724402",
"0.56848574",
"0.5541098",
"0.5503939",
"0.5496269",
"0.54730177",
"0.5358738",
"0.53564066",
"0.5281198",
"0.52330416",
"0.5213908",
"0.5204147",
"0.52004284",
"0.5197803",
"0.5195157",
"0.5184411",
"0.5171213",
"0.51686865",
"0.512471... | 0.67026013 | 0 |
Gets query for [[Menus]]. | public function getMenus()
{
return $this->hasMany(Menu::className(), ['id' => 'menu_id'])->viaTable('menu_cook', ['cook_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getQueryMenus();",
"public function getMenus() {}",
"public static function getMenus()\n\t{\n\t\t$sql = \"SELECT * FROM mod_menu\";\n\t\t$query = \\SimplCMS::$app->getDbConnection()->query($sql);\n\t\treturn $query->fetchAll( \\PDO::FETCH_ASSOC );\t\t\n\t}",
"function GetMenu()\n {\n ... | [
"0.8478544",
"0.7518383",
"0.71966344",
"0.7098829",
"0.7085742",
"0.7009039",
"0.6894907",
"0.68746626",
"0.6847141",
"0.68435115",
"0.67738056",
"0.6770894",
"0.6756192",
"0.6657886",
"0.6594664",
"0.65764225",
"0.65571254",
"0.65424675",
"0.65221184",
"0.65205455",
"0.6458... | 0.6600042 | 14 |
Gets query for [[Notifications]]. | public function getNotifications()
{
return $this->hasMany(Notification::className(), ['user_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetNotifications () {\n\t\treturn $this->notifications;\n\t}",
"public function listNotifications()\r\n { \t \r\n \r\n \t$data = $this->call(array(), \"GET\", \"notifications.json\");\r\n \t$data = $data->{'notifications'};\r\n \t$notificationArray = new ArrayObject();\r\n \tfor($i = ... | [
"0.7324579",
"0.72169805",
"0.7207508",
"0.7159329",
"0.7157475",
"0.7153732",
"0.7145465",
"0.7141083",
"0.7108115",
"0.6953154",
"0.69496465",
"0.68876755",
"0.6843784",
"0.6809255",
"0.6806639",
"0.6772309",
"0.67457473",
"0.6722028",
"0.6715384",
"0.6710293",
"0.6667241",... | 0.7192696 | 3 |
Gets query for [[OrderAssets]]. | public function getOrderAssets()
{
return $this->hasMany(OrderAsset::className(), ['cook_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_assets($queryargs = array()) {\n $query = \"/assets/\";\n return $this->get_list_data($query, $queryargs);\n }",
"public function getAssets()\n {\n return $this->hasMany(Asset::className(), ['asset_gl_acc_id' => 'account_id']);\n }",
"public function getAssetOrder();",
... | [
"0.6302675",
"0.62636924",
"0.6203693",
"0.6149409",
"0.60908747",
"0.59697217",
"0.57756585",
"0.5761034",
"0.5740975",
"0.5740975",
"0.57059973",
"0.57034045",
"0.5699253",
"0.5611357",
"0.55952233",
"0.55188215",
"0.548984",
"0.5484093",
"0.54322815",
"0.54158306",
"0.5396... | 0.709236 | 0 |
Gets query for [[OrderAssets0]]. | public function getOrderAssets0()
{
return $this->hasMany(OrderAsset::className(), ['waiter_id' => 'id']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAssets0()\n {\n return $this->hasMany(Asset::className(), ['dep_gl_acc_id' => 'account_id']);\n }",
"public function getOrderAssets()\n {\n return $this->hasMany(OrderAsset::className(), ['cook_id' => 'id']);\n }",
"public function getAssets1()\n {\n retur... | [
"0.6548097",
"0.5910376",
"0.57933617",
"0.56649065",
"0.56123066",
"0.54299194",
"0.53276455",
"0.5269801",
"0.52359325",
"0.5197732",
"0.49858963",
"0.49842745",
"0.4944428",
"0.493879",
"0.49280986",
"0.4911635",
"0.4854161",
"0.48090672",
"0.47973374",
"0.47651446",
"0.47... | 0.6768411 | 0 |
Set the Enable on Frontend flag in System Configuration for the given store. | public function setExtensionEnabledFlag($flag, $store = null) {
$flag = ($flag) ? 1 : 0;
$this->setStoreConfig(static::XML_PATH_EXTENSION_ENABLED, $flag, $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function enabled($store = null);",
"public function setFrontendOptions( array $frontend ) {\n $this->_frontendOptions = $frontend;\n $this->_frontendOptions[ 'cached_entity' ] = $this->_model;\n }",
"public function enablewebsiteconfigurationAction()\n {\n $path = $this... | [
"0.68808234",
"0.6062333",
"0.5985989",
"0.57530636",
"0.5622945",
"0.5589563",
"0.5589249",
"0.5583273",
"0.55787593",
"0.5509246",
"0.5488924",
"0.54679716",
"0.54343563",
"0.54176563",
"0.53995156",
"0.53519154",
"0.53510034",
"0.5330969",
"0.5328834",
"0.52971363",
"0.529... | 0.51303786 | 33 |
Check if the Klevu_Search extension is enabled in the system configuration for the current store. | public function isExtensionEnabled($store_id = null) {
return Mage::getStoreConfigFlag(static::XML_PATH_EXTENSION_ENABLED, $store_id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function isClerkSearchEnabled()\n {\n return $this->scopeConfig->isSetFlag(Config::XML_PATH_SEARCH_ENABLED, ScopeInterface::SCOPE_STORE);\n }",
"public function isExtentionEnable() {\n\t\treturn $this->_scopeConfig->getValue(Self::ENABLE, ScopeInterface::SCOPE_STORE);\n\t}",
"public functi... | [
"0.713247",
"0.69722885",
"0.6661157",
"0.656787",
"0.6544586",
"0.652439",
"0.651889",
"0.6487892",
"0.64539975",
"0.6384332",
"0.63824433",
"0.6350602",
"0.6326563",
"0.63183343",
"0.62722486",
"0.6243879",
"0.62172866",
"0.6202335",
"0.61581254",
"0.6144671",
"0.6140843",
... | 0.6266351 | 15 |
Set the Test Mode flag in System Configuration for the given store. | public function setTestModeEnabledFlag($flag, $store = null) {
$flag = ($flag) ? 1 : 0;
$this->setStoreConfig(static::XML_PATH_TEST_MODE, $flag, $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTestModeEnabledFlag($store = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);\n }",
"public function setTestMode()\n {\n $this->isTestMode = true;\n }",
"public function setTestMode(bool $testMode): void\n {\n $this->testMode = $... | [
"0.69331837",
"0.6719498",
"0.60137445",
"0.5996708",
"0.59809285",
"0.5980124",
"0.5969511",
"0.5820247",
"0.5817319",
"0.5738897",
"0.5736035",
"0.57280105",
"0.56378835",
"0.56042486",
"0.54367965",
"0.5323449",
"0.5310368",
"0.52633345",
"0.5259129",
"0.5250934",
"0.52445... | 0.658754 | 2 |
Return the configuration flag for enabling test mode. | public function getTestModeEnabledFlag($store = null) {
return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIsTestMode()\n {\n return $this->isTestMode;\n }",
"public function getTestMode(): bool\n {\n return $this->testMode;\n }",
"public function isTestmode()\n {\n return $this->getConfigDataFlag('test', $this->getStoreId());\n }",
"public function isTest... | [
"0.74136305",
"0.7347719",
"0.7226287",
"0.7154691",
"0.7100731",
"0.6959062",
"0.6937216",
"0.67025185",
"0.6632899",
"0.6545286",
"0.64057964",
"0.640047",
"0.6398071",
"0.63970757",
"0.63376826",
"0.6332218",
"0.62560725",
"0.62505823",
"0.624481",
"0.6183823",
"0.6104949"... | 0.7602675 | 0 |
Check if Test Mode is enabled for the given store. | public function isTestModeEnabled($store = null) {
return $this->getTestModeEnabledFlag($store) || !Mage::helper("klevu_search")->isProductionDomain(Mage::app()->getStore($store)->getBaseUrl());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTestModeEnabledFlag($store = null) {\n return Mage::getStoreConfigFlag(static::XML_PATH_TEST_MODE, $store);\n }",
"public function isTestmode()\n {\n return $this->getConfigDataFlag('test', $this->getStoreId());\n }",
"public function isTestMode() {\n\t\treturn (bool) ... | [
"0.80950695",
"0.7575858",
"0.7348273",
"0.70585555",
"0.67603743",
"0.67512584",
"0.6696677",
"0.66335917",
"0.65811926",
"0.65545684",
"0.64963686",
"0.6393847",
"0.63709384",
"0.6347967",
"0.6335858",
"0.6214475",
"0.6167899",
"0.61345035",
"0.6087093",
"0.6000051",
"0.599... | 0.8129329 | 0 |
Set the JS API key in System Configuration for the given store. | public function setJsApiKey($key, $store = null, $test_mode = false) {
$path = ($test_mode) ? static::XML_PATH_TEST_JS_API_KEY : static::XML_PATH_JS_API_KEY;
$this->setStoreConfig($path, $key, $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getJsApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_JS_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_JS_API_KEY, $store);\n }\n }",
"public function s... | [
"0.68459",
"0.6038925",
"0.5920227",
"0.5899742",
"0.58098763",
"0.57767445",
"0.5717741",
"0.56669",
"0.56669",
"0.5659631",
"0.56486773",
"0.55964184",
"0.55896425",
"0.55011034",
"0.54949635",
"0.5449839",
"0.5437471",
"0.54229325",
"0.54213333",
"0.5408198",
"0.53559107",... | 0.62714857 | 1 |
Return the JS API key configured for the specified store. | public function getJsApiKey($store = null) {
if ($this->isTestModeEnabled($store)) {
return Mage::getStoreConfig(static::XML_PATH_TEST_JS_API_KEY, $store);
} else {
return Mage::getStoreConfig(static::XML_PATH_JS_API_KEY, $store);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRestApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_REST_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_REST_API_KEY, $store);\n }\n }",
"public func... | [
"0.7231489",
"0.69567627",
"0.6930649",
"0.65350497",
"0.6399003",
"0.6314857",
"0.62804186",
"0.6250112",
"0.61807114",
"0.61807114",
"0.61807114",
"0.61656886",
"0.6140492",
"0.61160046",
"0.6094938",
"0.6029686",
"0.6009566",
"0.60093814",
"0.59522015",
"0.59414035",
"0.59... | 0.85303515 | 0 |
Set the REST API key in System Configuration for the given store. | public function setRestApiKey($key, $store = null, $test_mode = false) {
$path = ($test_mode) ? static::XML_PATH_TEST_REST_API_KEY : static::XML_PATH_REST_API_KEY;
$this->setStoreConfig($path, $key, $store);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRestApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_REST_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_REST_API_KEY, $store);\n }\n }",
"public func... | [
"0.65908056",
"0.58959967",
"0.58610886",
"0.5819145",
"0.56996083",
"0.56772137",
"0.56292623",
"0.5578141",
"0.55113965",
"0.5499459",
"0.5485894",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
"0.54574597",
... | 0.6128657 | 1 |
Return the REST API key configured for the specified store. | public function getRestApiKey($store = null) {
if ($this->isTestModeEnabled($store)) {
return Mage::getStoreConfig(static::XML_PATH_TEST_REST_API_KEY, $store);
} else {
return Mage::getStoreConfig(static::XML_PATH_REST_API_KEY, $store);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getJsApiKey($store = null) {\n if ($this->isTestModeEnabled($store)) {\n return Mage::getStoreConfig(static::XML_PATH_TEST_JS_API_KEY, $store);\n } else {\n return Mage::getStoreConfig(static::XML_PATH_JS_API_KEY, $store);\n }\n }",
"public function g... | [
"0.7382552",
"0.7299957",
"0.70200706",
"0.67021656",
"0.65869385",
"0.6507865",
"0.62872064",
"0.6227851",
"0.61854136",
"0.61661553",
"0.6146089",
"0.61239886",
"0.61159295",
"0.61159295",
"0.61159295",
"0.6084403",
"0.6067366",
"0.60481924",
"0.60120046",
"0.59982896",
"0.... | 0.8366736 | 0 |
Check if the Klevu Search extension is configured for the given store. | public function isExtensionConfigured($store_id = null) {
$js_api_key = $this->getJsApiKey($store_id);
$rest_api_key = $this->getRestApiKey($store_id);
return (
$this->isExtensionEnabled($store_id)
&& !empty($js_api_key)
&& !empty($rest_api_key)
);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function isClerkSearchEnabled()\n {\n return $this->scopeConfig->isSetFlag(Config::XML_PATH_SEARCH_ENABLED, ScopeInterface::SCOPE_STORE);\n }",
"public function hasStore(): bool;",
"public function isTestModeEnabled($store = null) {\n return $this->getTestModeEnabledFlag($store) || ... | [
"0.6739226",
"0.64571923",
"0.6312574",
"0.6128049",
"0.60947824",
"0.6090797",
"0.60860443",
"0.5984468",
"0.5920413",
"0.5917814",
"0.5915649",
"0.590712",
"0.5892888",
"0.58743584",
"0.586364",
"0.5858254",
"0.58280176",
"0.5813628",
"0.580744",
"0.5757283",
"0.5740547",
... | 0.69049436 | 0 |
Return the system configuration setting for enabling Product Sync for the specified store. The returned value can have one of three possible meanings: Yes, No and Forced. The values mapping to these meanings are available as constants on Klevu_Search_Model_System_Config_Source_Yesnoforced. | public function getProductSyncEnabledFlag($store_id = null) {
return intval(Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_ENABLED, $store_id));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function getOrderSyncEnabledFlag($store = null) {\n return intval(Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_ENABLED, $store));\n }",
"... | [
"0.65764624",
"0.65610963",
"0.63442016",
"0.6315542",
"0.5891043",
"0.5613256",
"0.55932254",
"0.5573776",
"0.54481304",
"0.5387158",
"0.5277634",
"0.52389574",
"0.520713",
"0.5193687",
"0.51893955",
"0.51604533",
"0.51242787",
"0.5088018",
"0.5082648",
"0.50535154",
"0.5024... | 0.66452974 | 0 |
Check if Product Sync is enabled for the specified store and domain. | public function isProductSyncEnabled($store_id = null) {
$flag = $this->getProductSyncEnabledFlag($store_id);
// Require "Forced" configuration setting to enable Product Sync on non production environments
if (Mage::helper("klevu_search")->isProductionDomain(Mage::getBaseUrl())) {
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function isOrderSyncEnabled($store = null) {\n $flag = $this->getOrderSyncEnabledFlag($store);\n\n // Require \"Forced\" configuration sett... | [
"0.7941048",
"0.69490826",
"0.69406486",
"0.6827529",
"0.6777556",
"0.6437757",
"0.6380422",
"0.606974",
"0.5989923",
"0.59848136",
"0.5904683",
"0.58715326",
"0.5848788",
"0.58290184",
"0.5819734",
"0.5766202",
"0.56785417",
"0.5646732",
"0.56383455",
"0.5635939",
"0.5631859... | 0.77698475 | 1 |
Return the configured frequency expression for Product Sync. | public function getProductSyncFrequency() {
return Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_FREQUENCY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFrequency()\n {\n return $this->get(self::_FREQUENCY);\n }",
"public function getFrequency()\n {\n return $this->get(self::_FREQUENCY);\n }",
"public function getOrderSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_FREQUENCY);\n ... | [
"0.6913802",
"0.6913802",
"0.68953407",
"0.6617102",
"0.6462655",
"0.6305728",
"0.6224425",
"0.6216743",
"0.62010956",
"0.5857624",
"0.582219",
"0.5792854",
"0.5759783",
"0.56721723",
"0.55765706",
"0.55165136",
"0.5486093",
"0.5224401",
"0.52086717",
"0.5183178",
"0.51383287... | 0.76718354 | 0 |
Set the last Product Sync run time in System Configuration for the given store. | public function setLastProductSyncRun($datetime = "now", $store = null) {
if (!$datetime instanceof DateTime) {
$datetime = new DateTime($datetime);
}
$this->setStoreConfig(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, $datetime->format(static::DATETIME_FORMAT), $store);
return $... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }",
"public function hasProductSyncRun($store = null) {\n $config = Mage::getConfig();\n\n if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN... | [
"0.62357396",
"0.582095",
"0.5662576",
"0.5626434",
"0.5599257",
"0.55595475",
"0.5424594",
"0.54020727",
"0.53499424",
"0.5284663",
"0.5263734",
"0.51984936",
"0.5182326",
"0.50813454",
"0.50588",
"0.505704",
"0.5047409",
"0.5000528",
"0.49952918",
"0.49725744",
"0.49340934"... | 0.7008211 | 0 |
Check if Product Sync has ever run for the given store. | public function hasProductSyncRun($store = null) {
$config = Mage::getConfig();
if (!$config->getNode(static::XML_PATH_PRODUCT_SYNC_LAST_RUN, "store", $store)) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function isProductSyncEnabled($store_id = null) {\n $flag = $this->getProductSyncEnabledFlag($store_id);\n\n // Require \"Forced\" configur... | [
"0.7449988",
"0.7029201",
"0.65083593",
"0.6306006",
"0.612225",
"0.61052454",
"0.60977775",
"0.6053355",
"0.6036305",
"0.6021347",
"0.5969194",
"0.5937525",
"0.5929147",
"0.5918213",
"0.588954",
"0.58499306",
"0.5849475",
"0.581778",
"0.58034676",
"0.58034676",
"0.57484996",... | 0.8481843 | 0 |
Return the map of additional Klevu attributes to Magento attributes. | public function getAdditionalAttributesMap($store = null) {
$map = unserialize(Mage::getStoreConfig(static::XML_PATH_ATTRIBUTES_ADDITIONAL, $store));
return (is_array($map)) ? $map : array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attributeMap() + self::$attributeMap;\n }",
"public static function attributeMap()\n {\n return parent::attribut... | [
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.68388295",
"0.6740685",
"0.66691023",
"0.66691023",
"0.66691023",
"0.66691023",
"0.6668884",
"0.6668884",
... | 0.6315512 | 25 |
Return the System Configuration setting for enabling Order Sync for the given store. The returned value can have one of three possible meanings: Yes, No and Forced. The values mapping to these meanings are available as constants on Klevu_Search_Model_System_Config_Source_Yesnoforced. | public function getOrderSyncEnabledFlag($store = null) {
return intval(Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_ENABLED, $store));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isOrderSyncEnabled($store = null) {\n $flag = $this->getOrderSyncEnabledFlag($store);\n\n // Require \"Forced\" configuration setting to enable Sync on non production environments\n if (Mage::helper(\"klevu_search\")->isProductionDomain(Mage::getBaseUrl())) {\n retur... | [
"0.6817371",
"0.6248821",
"0.6130598",
"0.6115169",
"0.59758514",
"0.5474048",
"0.5280187",
"0.5247429",
"0.52199924",
"0.5219286",
"0.52076316",
"0.5158877",
"0.5128161",
"0.507192",
"0.5047929",
"0.5032075",
"0.4981114",
"0.498024",
"0.4973968",
"0.49737",
"0.4944672",
"0... | 0.6966115 | 0 |
Check if Order Sync is enabled for the given store on the current domain. | public function isOrderSyncEnabled($store = null) {
$flag = $this->getOrderSyncEnabledFlag($store);
// Require "Forced" configuration setting to enable Sync on non production environments
if (Mage::helper("klevu_search")->isProductionDomain(Mage::getBaseUrl())) {
return in_array($fl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isProductSyncEnabled($store = null)\n {\n return boolval(Mage::getStoreConfig(self::XML_PATH_PRODUCT_SYNC, $store));\n }",
"public function isProductSyncEnabled($store_id = null) {\n $flag = $this->getProductSyncEnabledFlag($store_id);\n\n // Require \"Forced\" configur... | [
"0.7657166",
"0.7387574",
"0.72523534",
"0.6671791",
"0.6630824",
"0.6578566",
"0.65314656",
"0.6482672",
"0.60258687",
"0.60238415",
"0.6022229",
"0.5962134",
"0.5881125",
"0.584267",
"0.5810655",
"0.58047014",
"0.5753723",
"0.574169",
"0.57298493",
"0.5708213",
"0.57045346"... | 0.82984823 | 0 |
Return the configured frequency expression for Order Sync. | public function getOrderSyncFrequency() {
return Mage::getStoreConfig(static::XML_PATH_ORDER_SYNC_FREQUENCY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFrequency()\n {\n return $this->get(self::_FREQUENCY);\n }",
"public function getFrequency()\n {\n return $this->get(self::_FREQUENCY);\n }",
"public function getProductSyncFrequency() {\n return Mage::getStoreConfig(static::XML_PATH_PRODUCT_SYNC_FREQUENCY);\... | [
"0.68094397",
"0.68094397",
"0.6721141",
"0.6530065",
"0.62518746",
"0.6245237",
"0.61661255",
"0.6114785",
"0.608413",
"0.5987414",
"0.57449675",
"0.57098186",
"0.5666298",
"0.55795556",
"0.55288947",
"0.54507154",
"0.53974515",
"0.53645444",
"0.5347514",
"0.522793",
"0.5201... | 0.7555554 | 0 |
Set the last Order Sync run time in System Configuration. | public function setLastOrderSyncRun($datetime = "now") {
if (!$datetime instanceof DateTime) {
$datetime = new DateTime($datetime);
}
$this->setGlobalConfig(static::XML_PATH_ORDER_SYNC_LAST_RUN, $datetime->format(static::DATETIME_FORMAT));
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }",
"public function setSyncTime(): void\n {\n }",
"public function setLastSyncDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('las... | [
"0.7032765",
"0.69917005",
"0.6173254",
"0.6064555",
"0.5968182",
"0.5798335",
"0.5797511",
"0.5789471",
"0.5743275",
"0.56709117",
"0.5652032",
"0.56423736",
"0.5641824",
"0.5636575",
"0.5615925",
"0.55867004",
"0.55734766",
"0.5553155",
"0.5553145",
"0.55401874",
"0.5535839... | 0.6348002 | 2 |
Check if default Magento log settings should be overridden to force logging for this module. | public function isLoggingForced() {
return Mage::getStoreConfigFlag(static::XML_PATH_FORCE_LOG);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function uses_standard_settings() : bool {\n $classname = self::get_logger_classname();\n if (!class_exists($classname)) {\n return false;\n }\n\n if (is_a($classname, database_logger::class, true)) {\n return true;\n }\n\n return false;... | [
"0.7341589",
"0.6904965",
"0.67774576",
"0.6524594",
"0.64568865",
"0.6418857",
"0.6328534",
"0.62996745",
"0.61947334",
"0.619206",
"0.61699796",
"0.5865257",
"0.5831409",
"0.5798236",
"0.5785972",
"0.5772453",
"0.5764625",
"0.5640854",
"0.56261206",
"0.56179804",
"0.5535306... | 0.79847676 | 0 |
Return the minimum log level configured. Default to Zend_Log::WARN. | public function getLogLevel() {
$log_level = Mage::getStoreConfig(static::XML_PATH_LOG_LEVEL);
return ($log_level !== null) ? intval($log_level) : Zend_Log::INFO;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getMinimumLogLevel() {}",
"public static function getLevelWarn()\n {\n if (!isset(self::$levelMap[Payone_Log4php_LoggerLevel::WARN])) {\n self::$levelMap[Payone_Log4php_LoggerLevel::WARN] = new Payone_Log4php_LoggerLevel(Payone_Log4php_LoggerLevel::WARN, 'WARN', LOG_WARNIN... | [
"0.7804657",
"0.6993126",
"0.69348603",
"0.67378664",
"0.66611683",
"0.645335",
"0.64270025",
"0.63970125",
"0.6376658",
"0.63304716",
"0.63052595",
"0.6285079",
"0.621341",
"0.61800015",
"0.6127694",
"0.60697174",
"0.6000227",
"0.59257954",
"0.59135664",
"0.59117126",
"0.589... | 0.6940264 | 2 |
Set the global scope System Configuration value for the given key. | protected function setGlobalConfig($key, $value) {
Mage::getConfig()
->saveConfig($key, $value, "default")
->reinit();
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function set_global($key, $value = NULL) {\r\n if ( is_array($key) ) {\r\n foreach ($key as $key2=>$value) {\r\n View::$_global_data[$key2] = $value;\r\n if ( self::$_smarty_is_loaded ) {\r\n Smarty_View::smarty_prototype()->assignGlobal($key2, $value);\r\n }\r\n }\r\n }... | [
"0.6638664",
"0.6475853",
"0.6137864",
"0.61229724",
"0.60142416",
"0.5986156",
"0.59665126",
"0.59483516",
"0.591921",
"0.5887739",
"0.58624434",
"0.58555096",
"0.5796277",
"0.5795588",
"0.5782393",
"0.57684785",
"0.5759131",
"0.5743672",
"0.57220745",
"0.5705849",
"0.570252... | 0.595707 | 7 |
Set the store scope System Configuration value for the given key. | protected function setStoreConfig($key, $value, $store = null) {
$config = Mage::getConfig();
$store_code = Mage::app()->getStore($store)->getCode();
$scope_id = $config->getNode(sprintf(static::XML_PATH_STORE_ID, $store_code));
if ($scope_id !== null) {
$scope_id = (int) $s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function set($sKey, $xValue)\n {\n session([$sKey => $xValue]);\n }",
"public function set($key, $value) {\n $this->store->setConfigValue($key, $value);\n }",
"public function setConfig($key, $value);",
"public abstract function setConfig($key, $value);",
"function setSiteOpti... | [
"0.61056936",
"0.60803246",
"0.60697687",
"0.6042345",
"0.5740328",
"0.5733689",
"0.5721374",
"0.5690854",
"0.5674718",
"0.5662158",
"0.56218874",
"0.561473",
"0.55953103",
"0.55627865",
"0.55465555",
"0.55409545",
"0.55112875",
"0.55097675",
"0.55062664",
"0.55020326",
"0.54... | 0.576643 | 4 |
Creates a new BrandApplication model. If creation is successful, the browser will be redirected to the 'view' page. | public function actionCreate()
{
$model = new BrandApplication();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return json_encode([
'code' => 0,
'msg' => '提交成功',
]);
} else {
return json_encode([
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new Brand();\n\n if (Yii::$app->request->isAjax && $model->load(Yii::$app->request->post())) {\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ActiveForm::validate($model);\n }\n\n\n if ($model->load(... | [
"0.78058046",
"0.7219564",
"0.70903903",
"0.6964024",
"0.693161",
"0.69162846",
"0.6851973",
"0.6844626",
"0.6826405",
"0.6818147",
"0.6818147",
"0.6818147",
"0.6818147",
"0.6814663",
"0.67826456",
"0.67570436",
"0.67037696",
"0.6665711",
"0.66594183",
"0.66473997",
"0.661651... | 0.8114974 | 0 |
Finds the BrandApplication model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. | protected function findModel($id)
{
if (($model = BrandApplication::findOne($id)) !== null) {
return $model;
} else {
throw new NotFoundHttpException('The requested page does not exist.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function findModel($id)\n {\n if (($model = Brand::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }",
"protected function findModel($id)\n {\n if (($model = B... | [
"0.6482144",
"0.63159597",
"0.6145415",
"0.61148816",
"0.59933525",
"0.5915281",
"0.59019506",
"0.58878577",
"0.5876495",
"0.58350796",
"0.5823614",
"0.5811899",
"0.58065116",
"0.5804942",
"0.57786924",
"0.5764684",
"0.57392085",
"0.57196075",
"0.5712225",
"0.5712225",
"0.569... | 0.7144929 | 0 |
Create a new event instance. | public function __construct(JobApplication $jobApplication, $job_application_status_company_id)
{
$this->jobApplication = $jobApplication;
$this->job_application_status_company_id = $job_application_status_company_id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createEvent()\n {\n return new Event();\n }",
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = ... | [
"0.8178475",
"0.73455495",
"0.67515916",
"0.6665345",
"0.66544545",
"0.66479546",
"0.6640835",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6556383",
"0.6543442",
"0.64682955",
"0.645909",
"0.64520663",
"0.6441302",
"0.6438299",
"0.63917476",
"0.6371641",
"0.6371641... | 0.0 | -1 |
Get the channels the event should be broadcast on. | public function broadcastOn()
{
return [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getChannels()\n {\n return $this->channels;\n }",
"public function getChannels();",
"public function broadcastOn()\n {\n return [\n $this->channel\n ];\n }",
"public function broadcastOn()\n {\n return [\n $this->channel\n ... | [
"0.7449813",
"0.7367057",
"0.7359504",
"0.7359504",
"0.72011125",
"0.7173089",
"0.7115883",
"0.7101729",
"0.706744",
"0.70430064",
"0.7023131",
"0.69550014",
"0.69529486",
"0.69211733",
"0.68433154",
"0.6804953",
"0.6757097",
"0.6730202",
"0.6713746",
"0.6648456",
"0.6570507"... | 0.6462908 | 61 |
Make call to application... | public function testDatabase()
{
$user = factory(App\User::class)->create();
$user = factory(App\User::class)->create([
'name' => 'Abigail',
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function call();",
"public function call();",
"public function launch() {\n\t\t$controller = ucfirst($this->getController());\n\t\t$method = $this->getMethod();\n\t\t\n\t\tif (file_exists(APPPATH . 'modules/' . $controller . '.php') === FALSE)\n\t\t\tshowError($this->lang->line('syserr_notfound'), 404);... | [
"0.6813632",
"0.6813632",
"0.64578557",
"0.6387159",
"0.6305149",
"0.62660027",
"0.6265228",
"0.6257039",
"0.6209303",
"0.6147062",
"0.61173457",
"0.61149544",
"0.61082935",
"0.60137224",
"0.5942163",
"0.59321725",
"0.5919044",
"0.5895917",
"0.5887004",
"0.5874423",
"0.584418... | 0.0 | -1 |
This function will delete the record based on the id | public function remove($id) {
$this->db->where('id_user', $id);
$this->db->delete('user');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteRecord ($id);",
"public function deleteRecord($id){\n\t}",
"public function destroy($id)\n {\n //delete specific record\n }",
"function delete($id){\n\t\t$this->db->where('id', $id);\n\t\t$this->db->delete($this->table);\n }",
"function delete($id);",
"function deleteR... | [
"0.884148",
"0.87813485",
"0.83410996",
"0.81578004",
"0.8116337",
"0.81083494",
"0.80948323",
"0.8082271",
"0.8020353",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",
"0.8018749",... | 0.0 | -1 |
This function will take the post data passed from the controller If id is present, then it will do an update else an insert. One function doing both add and edit. | public function add($data) {
if (isset($data['id_user'])) {
$this->db->where('id_user', $data['id_user']);
$this->db->update('user', $data);
} else {
$this->db->insert('user', $data);
return $this->db->insert_id();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit($id) \r\n {\r\n $this->load(array('id=?',$id));\r\n $this->copyFrom('POST');\r\n $this->update();\r\n }",
"public function _addOrEdit() {\n\t\tif($this->getRequest()->getParam('id')) { return true; } else { return false; }\n\t}",
"public function edit($id){\n ... | [
"0.71723413",
"0.6954864",
"0.6939089",
"0.6931946",
"0.6907699",
"0.6859462",
"0.68556136",
"0.6751269",
"0.6740402",
"0.6726097",
"0.6723098",
"0.6723098",
"0.6711481",
"0.6709175",
"0.67050683",
"0.67050683",
"0.6702781",
"0.66959846",
"0.66959846",
"0.6692991",
"0.6690463... | 0.0 | -1 |
the file property can be empty if the field is not required | public function upload()
{
if (null === $this->getFile()) {
return;
}
// use the original file name here but you should
// sanitize it at least to avoid any security issues
$path = ($this->isPublic()) ? 'public' : 'sections' . '/' . strtolower($this->getSection(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function configureFileField() {}",
"public function file_required(): static\r\n {\r\n if (empty($this->is_file['name'])) $this->message(\"is required\");\r\n return $this;\r\n }",
"function zen_draw_file_field($name, $required = false) {\n $field = zen_draw_input_field($nam... | [
"0.6987462",
"0.6811598",
"0.6588868",
"0.65699726",
"0.65216774",
"0.6491254",
"0.63153064",
"0.6295755",
"0.6212579",
"0.61824673",
"0.6164055",
"0.6144368",
"0.6141305",
"0.60929865",
"0.6085833",
"0.60772556",
"0.60756683",
"0.60717565",
"0.6047275",
"0.6042965",
"0.60323... | 0.0 | -1 |
the absolute directory path where uploaded | protected function getUploadRootDir()
{
// documents should be saved
return __DIR__.'/../../../web/'.$this->getUploadDir();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getUploadDir()\n {\n return 'uploads';\n }",
"protected function getUploadDir() {\n return '/uploads';\n }",
"public function getRelativeUploadPath(): string;",
"protected function getUploadRootDir()\r\n {\r\n // the absolute directory path where uploaded d... | [
"0.8005355",
"0.7987917",
"0.7977486",
"0.7972477",
"0.7971831",
"0.79548585",
"0.79398304",
"0.79366845",
"0.79297465",
"0.79209554",
"0.79197216",
"0.7911412",
"0.79051995",
"0.7900123",
"0.78990775",
"0.78984356",
"0.7878848",
"0.7877958",
"0.7873649",
"0.7871114",
"0.7865... | 0.77277666 | 96 |
get rid of the __DIR__ so it doesn't screw up | public function getUploadDir()
{
// when displaying uploaded doc/image in the view.
return 'uploads';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _clearPaths() {\n\t\tApp::build(array('Vendor' => array('junk')), App::RESET);\n\t\tini_set('include_path', 'junk');\n\t}",
"function dirPath() {return (\"../../../../\"); }",
"function appDir($dir)\n{\n return __DIR__.\"/../\".$dir;\n}",
"function clean_path($path){ return str_replace(... | [
"0.6684865",
"0.64995277",
"0.6411538",
"0.63900113",
"0.63626224",
"0.6359468",
"0.6357689",
"0.6331285",
"0.6302421",
"0.6276588",
"0.6257401",
"0.6169059",
"0.61551183",
"0.6075298",
"0.60708284",
"0.6053722",
"0.6036839",
"0.60255325",
"0.60246104",
"0.59848154",
"0.59682... | 0.0 | -1 |
/ Initialize action controller here | public function 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 |
saca listas de actividades realizadas por un curso | public function resultadoscursoAction()
{
// action body
// requiere layout activado en aplication ini
//$this->_helper->layout->disableLayout();
//echo "voy bien 1";
//configuraci�n inicial
$config = Zend_Registry::get('config');
//echo "voy bien 2";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listarActivos(){\n $sql = \"SELECT c.idcompra, c.nrofactura, date(c.fecha) as fecha, p.razonsocial AS proveedor, concat(per.nombre, ' ', per.apellido) AS personal, c.monto, c.estado \n FROM compras c JOIN proveedores p ON c.idproveedor = p.idproveedor JOIN personales per ON c.idperson... | [
"0.74924237",
"0.697998",
"0.6657896",
"0.64976966",
"0.6428243",
"0.640448",
"0.63940513",
"0.63639206",
"0.6346448",
"0.6322791",
"0.62215436",
"0.6194469",
"0.619091",
"0.61513",
"0.6148813",
"0.6121606",
"0.6099972",
"0.60812265",
"0.607087",
"0.6067152",
"0.6029399",
"... | 0.0 | -1 |
Generates a link to PFS | function cot_build_pfs($id, $c1, $c2, $title, $parser = '')
{
global $L, $cfg, $usr, $cot_groups;
if ($id == 0)
{
$res = "<a href=\"javascript:pfs('0','" . $c1 . "','" . $c2 . "','" . $parser . "')\">" . $title . "</a>";
}
elseif (/*$cot_groups[$usr['maingrp']]['pfs_maxtotal'] > 0 && $cot_groups[$usr['maingrp']]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function CreatePublicSymLink()\n {\n $filemanager = $this->getFileManager();\n\n $fullPath = PATH_OUTBOX.'/public/'.$this->sqlData['cms_document_tree_id'].'/';\n if (!is_dir($fullPath)) {\n $filemanager->mkdir($fullPath, 0777, true);\n }\n $targetFile = $this... | [
"0.62729466",
"0.6113219",
"0.5976677",
"0.590912",
"0.5881928",
"0.5848959",
"0.5792101",
"0.57365143",
"0.57140017",
"0.56712306",
"0.56440204",
"0.56202257",
"0.5615459",
"0.5615393",
"0.55871993",
"0.5564749",
"0.5564749",
"0.55646354",
"0.5540782",
"0.5535262",
"0.550430... | 0.5326838 | 36 |
Create a new PFS folder, return new folder ID | function cot_pfs_createfolder($ownerid, $title='', $desc='', $parentid='', $ispublic='', $isgallery='')
{
global $db, $db_pfs_folders, $cfg, $sys, $L, $err_msg;
if ($title==='') $title = cot_import('ntitle','P','TXT');
if ($desc==='') $desc = cot_import('ndesc','P','TXT');
if ($parentid==='') $parentid = cot_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createFolder(string $foldername);",
"function create_new_folder($parent_id, $folder_name) {\n\n\t\t// Ensure that folder name is valid\n\t\t{\n\t\t\t$test = preg_match('/^[a-zA-Z0-9_\\.\\s-]{'\n\t\t\t\t.FilesDatabase::NAME_MIN_LENGTH.','.FilesDatabase::NAME_MAX_LENGTH\n\t\t\t\t.'}$/u',\n\t\t\t\t$folder_... | [
"0.72312224",
"0.71322167",
"0.71091",
"0.7015157",
"0.6886734",
"0.683119",
"0.6817487",
"0.6661311",
"0.6656184",
"0.65089184",
"0.649598",
"0.6470891",
"0.64591753",
"0.64077854",
"0.64077854",
"0.64077854",
"0.63980865",
"0.63879627",
"0.63312995",
"0.6302738",
"0.6292748... | 0.6852539 | 5 |
Delete a PFS file | function cot_pfs_deletefile($userid, $id)
{
global $db, $db_pfs, $cfg;
$sql = $db->query("SELECT pfs_id FROM $db_pfs WHERE pfs_userid=".(int)$userid." AND pfs_id=".(int)$id." LIMIT 1");
if ($sql->rowCount()>0)
{
$fpath = cot_pfs_filepath($id);
if (file_exists($thumbs_dir_user.$fpath))
{
@unlink($thumbs_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($filepath);",
"public function delete($filename);",
"public function file_delete($filename);",
"public function delete($file) {\n\t}",
"function deleteFile() {\r\n\t\tif (file_exists($this->data[$this->alias]['path'])) {\r\n\t\t\tunlink($this->data[$this->alias]['path']);\r\n\t\t}\r\... | [
"0.74030894",
"0.7365989",
"0.7200488",
"0.71284854",
"0.7017305",
"0.6897608",
"0.68961114",
"0.68452597",
"0.67141354",
"0.6706241",
"0.67054486",
"0.6696619",
"0.6694998",
"0.6694124",
"0.6679157",
"0.6679157",
"0.66555864",
"0.6652714",
"0.6648252",
"0.66409475",
"0.66253... | 0.6664602 | 16 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.