query stringlengths 9 43.3k | document stringlengths 17 1.17M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2 values |
|---|---|---|---|---|---|---|
return boolean as string 'true' / 'false' | function bool2str($bool) {
if($bool ===false)
return 'false';
else
return 'true';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bool_s($boolean) {\n\treturn ($boolean ? 'true' : 'false');\n}",
"public static function strbool($bool){\r\n return ($bool) ? \"true\" : \"false\";\r\n }",
"function format_bool(mixed $input): string\n{\n return $input ? 'true' : 'false';\n}",
"function bool_to_string($value) {\n ... | [
"0.80348504",
"0.80206877",
"0.78751075",
"0.7846424",
"0.76890635",
"0.7611359",
"0.7559533",
"0.7543506",
"0.7523593",
"0.75164706",
"0.74617386",
"0.7412224",
"0.7410573",
"0.7393141",
"0.73901856",
"0.7379897",
"0.73708546",
"0.7250726",
"0.7164452",
"0.71530366",
"0.7104... | 0.8142804 | 0 |
compare two objects. Arguments are passed byreference test: equals, not equal, equal identity, not equal identity | function compareObjects(&$ob1, &$ob2) {
print_pre('o1 == o2 : ' . bool2str($ob1 == $ob2));
print_pre('o1 != o2 : ' . bool2str($ob1 != $ob2));
print_pre('o1 === o2 : ' . bool2str($ob1 === $ob2));
print_pre('o1 !== o2 : ' . bool2str($ob1 !== $ob2));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function equals($other);",
"public function equals( $A, $B );",
"public function equals($other) { return $this->obj==Sandbox::unwrap($other); }",
"protected function compareObjects(object $a, object $b): int\n {\n // see https://github.com/php/php-src/issues/10513\n return strcmp(spl_object_... | [
"0.6673335",
"0.65883684",
"0.6582047",
"0.6493526",
"0.6361353",
"0.6307741",
"0.62992543",
"0.6271147",
"0.6259657",
"0.62595",
"0.62512934",
"0.6212965",
"0.62024915",
"0.614383",
"0.61387986",
"0.60835725",
"0.6081624",
"0.60350287",
"0.6030523",
"0.60098636",
"0.6003072"... | 0.7712369 | 0 |
Check initial states exists | public function hasInitial()
{
return !empty($this->initialStates);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isInitial();",
"public function isInitialised();",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n ... | [
"0.6860986",
"0.6655938",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
"0.65015686",
... | 0.76447755 | 0 |
Check final states exists | public function hasFinal()
{
return !empty($this->finalStates);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasState(){\n return $this->_has(4);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n ... | [
"0.6827876",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"0.6805831",
"... | 0.7345255 | 0 |
Get all final states | public function getFinal()
{
return $this->hasFinal() ? array_values($this->finalStates) : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStates() {\n return $this->state;\n }",
"abstract public function states();",
"public function getStates(): array\n {\n return $this->states;\n }",
"public function getStates(): StateSet;",
"public function getStates() {\n\t\treturn empty( $this->container['states'... | [
"0.67806",
"0.6576226",
"0.6572894",
"0.65708417",
"0.6479763",
"0.6455002",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.64391106",
"0.... | 0.7338602 | 0 |
Check normal states exists | public function hasNormal()
{
return !empty($this->normalStates);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n ... | [
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"0.6515521",
"... | 0.69411725 | 0 |
Get all normal states | public function getNormal()
{
return $this->hasNormal() ? array_values($this->normalStates) : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStates(): array\n {\n return $this->states;\n }",
"public function getStates() {\n return $this->state;\n }",
"public function getAllStates() {\n $states = [];\n $values = DB::table(self::TABLE_NAME)\n ->select([self::C_STATE, self::C_STATE_FUL... | [
"0.647964",
"0.6424091",
"0.63932616",
"0.62895477",
"0.6230935",
"0.6228826",
"0.62103736",
"0.61879295",
"0.6147332",
"0.6135253",
"0.61041045",
"0.6073023",
"0.605905",
"0.5990167",
"0.5959515",
"0.59104687",
"0.58974403",
"0.5879883",
"0.5875688",
"0.58569294",
"0.5841394... | 0.70630133 | 0 |
Creates a form to delete a role entity. | private function createDeleteForm(Roles $role)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('back_roles_delete', array('id' => $role->getId())))
->setMethod('DELETE')
->getForm()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createDeleteForm(Role $role)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('role_delete', array('id' => $role->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"public function deleteRolesAction(){\n \n ... | [
"0.79986936",
"0.69734687",
"0.69086474",
"0.6816056",
"0.6799801",
"0.6702436",
"0.6464739",
"0.64358765",
"0.6387753",
"0.6355804",
"0.63335204",
"0.63201606",
"0.63201606",
"0.63201606",
"0.63067895",
"0.6303177",
"0.62701714",
"0.62513304",
"0.6242807",
"0.62261164",
"0.6... | 0.80152273 | 0 |
/ Plugin Name: My Custom WP Functions Description: Custom Additionals Author: David Mchale Author URI: / Unregister default widgets. | function custom_unregister_default_widgets() {
unregister_widget( 'WP_Widget_Archives' );
unregister_widget( 'WP_Widget_Calendar' );
unregister_widget( 'WP_Widget_Categories' );
unregister_widget( 'WP_Widget_Meta' );
unregister_widget( 'WP_Widget_Pages' );
unregister_widget( 'WP_Widget_Recent_Comments' );
unregister_widget( 'WP_Widget_Recent_Posts' );
unregister_widget( 'WP_Widget_RSS' );
unregister_widget( 'WP_Widget_Search' );
unregister_widget( 'WP_Nav_Menu_Widget' );
unregister_widget( 'WP_Widget_Tag_Cloud' );
unregister_widget( 'Akismet_Widget' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unregister_default_widgets() {\n\t\\add_action( 'widgets_init', 'WPS\\_unregister_default_widgets' );\n}",
"function unregister_default_wp_widgets() {\n unregister_widget('WP_Widget_Archives');\n unregister_widget('WP_Widget_Calendar');\n unregister_widget('WP_Widget_Categories');\n unregist... | [
"0.8636281",
"0.8197421",
"0.81720716",
"0.79573977",
"0.7938502",
"0.7928548",
"0.79066247",
"0.78764915",
"0.7800305",
"0.77646667",
"0.7620833",
"0.75784874",
"0.7419697",
"0.73724735",
"0.7340547",
"0.7312976",
"0.72826034",
"0.72666377",
"0.72553134",
"0.72380036",
"0.72... | 0.8350835 | 1 |
/ Hide dashboard widgets. | function custom_hide_dashboard_widgets() {
global $wp_meta_boxes;
// Today widget.
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now'] );
// Last comments.
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments'] );
// Incoming links.
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links'] );
// Plugins.
unset( $wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins'] );
// WordPress blog.
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_primary'] );
// WordPress news.
unset( $wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary'] );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mitlibnews_remove_dashboard_widgets() {\n\tremove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // Quickpress widget\n\tremove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // Wordpress news\n\tif (!current_user_can('add_users')) {\n\t\tremove_meta_box( 'dashboard_right_now', 'dashboar... | [
"0.76082855",
"0.75985193",
"0.75888413",
"0.75827056",
"0.7523026",
"0.75071985",
"0.750256",
"0.7469566",
"0.74597436",
"0.74109954",
"0.74072343",
"0.7404851",
"0.7344693",
"0.730992",
"0.7305711",
"0.7291481",
"0.7274372",
"0.7229942",
"0.7209446",
"0.7188029",
"0.7165178... | 0.76435626 | 0 |
Check whether provider provider id/name is valid | public static function isProviderValid($provider)
{
return array_key_exists($provider, static::$providers);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkProviderKey($provider) {\n\n $postdata = http_build_query(\n array(\n 'ptype' => 'check-provider-key',\n 'provider_url' => $provider['provider_url'],\n 'provider_key' => $provider['provider_key']\n )\n );\n... | [
"0.63221335",
"0.62779325",
"0.6265286",
"0.6205485",
"0.61896044",
"0.61896044",
"0.61896044",
"0.60886633",
"0.60876095",
"0.60855556",
"0.60406965",
"0.60148853",
"0.60049236",
"0.5953346",
"0.5939193",
"0.59316665",
"0.5893126",
"0.585801",
"0.5856962",
"0.583204",
"0.581... | 0.7011916 | 0 |
Get user sex or null if it is not set | public function getUserSex()
{
return $this->getUserAttribute(static::ATTRIBUTE_SEX);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSex()\n {\n $result = null;\n if (isset($this->userInfo['sex'])) {\n $result = $this->userInfo['sex'] == 1;\n }\n return $result;\n }",
"public function getsex()\n {\n return $this->sex;\n }",
"function getGender($userid) {\n r... | [
"0.7810267",
"0.75179243",
"0.72500116",
"0.71574724",
"0.71574724",
"0.71574724",
"0.71574724",
"0.71574724",
"0.6864054",
"0.6777187",
"0.6545667",
"0.6400071",
"0.6400071",
"0.6380897",
"0.63448596",
"0.62781256",
"0.62503695",
"0.61736095",
"0.6143012",
"0.61328506",
"0.6... | 0.76433337 | 1 |
Get user birthday in format dd.mm.YYYY or null if it is not set | public function getUserBirthday()
{
$result = $this->getUserAttribute(static::ATTRIBUTE_BIRTHDAY);
if (!empty($result)) {
return date('d.m.Y', strtotime($result));
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBirthdayDate():?string\n {\n return $this->birthday_date ? (new \\DateTime($this->birthday_date))->format('d/m/Y') : null;\n }",
"public function getBirthDay() {\n \tif($this->birthDay == null)\n\t\t\treturn \"\";\n\t\telse\n \treturn $this->birthDay;\n }",
"function getDay... | [
"0.81020474",
"0.8087841",
"0.78028715",
"0.77632535",
"0.7634923",
"0.75612813",
"0.7509031",
"0.74697196",
"0.74228454",
"0.73496985",
"0.7268432",
"0.7224518",
"0.7224518",
"0.7224518",
"0.7224518",
"0.7224518",
"0.72205245",
"0.71527565",
"0.7133127",
"0.71291655",
"0.712... | 0.8222234 | 0 |
Get all components required to build authentication url | abstract public function getAuthUrlComponents(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function auth_url();",
"public function getAuthUrl();",
"public function get_auth_url()\n\t{\n\t\treturn $this->auth_url.'?oauth_token='.$this->get_request_token();\n\t}",
"abstract public function getAuthUri(): string;",
"public function getAuthUrl()\n\t{\n\t\t$tokenData = $this->getReq... | [
"0.73218894",
"0.7157372",
"0.6832804",
"0.67731714",
"0.64764035",
"0.6465385",
"0.64473003",
"0.62885475",
"0.6278464",
"0.62723607",
"0.6253919",
"0.6215553",
"0.617608",
"0.617608",
"0.6171891",
"0.61702204",
"0.6094732",
"0.6073644",
"0.60662067",
"0.6051898",
"0.6014222... | 0.85969174 | 0 |
Get a middleware from the iterator | protected function getMiddleware() {
$ret = null;
if ($this->middleware->valid()) {
$ret = $this->middleware->current();
$this->middleware->next();
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMiddleware();",
"protected function callback()\n {\n return GuzzleMiddleware::mapRequest(function (RequestInterface $request) {\n return $request->withHeader('T-middleware', $request->getHeaderLine('T-middleware') . 'B');\n });\n }",
"public function get(): Mid... | [
"0.6752117",
"0.66690207",
"0.6622647",
"0.65207684",
"0.65207684",
"0.63957626",
"0.63761896",
"0.6352436",
"0.62916",
"0.62613744",
"0.615779",
"0.61190957",
"0.60768324",
"0.5982674",
"0.59793043",
"0.59714884",
"0.5905679",
"0.5836984",
"0.58001155",
"0.57484573",
"0.5668... | 0.70806575 | 0 |
Start the middleware pipeline If a delegate is given, will pass on the possibly modified request object when the iterator is no longer valid. | protected function run(
ServerRequestInterface $request,
DelegateInterface $delegate = null,
Dispatcher $that = null
): ResponseInterface {
$that = $that ?: clone $this;
$that->setRequest($request);
try {
$response = $that->step();
}
catch (Exception\OutOfMiddlewareException $ex) {
if ($delegate === null) {
throw $ex;
}
$response = $delegate->process(
$that->getRequest()
);
}
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function next()\n {\n if (($middleware = next($this->middlewares))) {\n call_user_func($middleware, $this->request, $this->response, $this);\n } elseif ($this->parent !== null) {\n $this->parent->next();\n }\n }",
"public function process(ServerRequestInter... | [
"0.5794255",
"0.5558549",
"0.550864",
"0.54824185",
"0.5475669",
"0.545505",
"0.54468197",
"0.5331015",
"0.52557105",
"0.5231224",
"0.5231224",
"0.5162262",
"0.51076806",
"0.5057811",
"0.50243485",
"0.49876884",
"0.49771276",
"0.49744737",
"0.49687684",
"0.495803",
"0.4921403... | 0.5926326 | 0 |
Set the current ServerRequestInterface object | protected function setRequest(ServerRequestInterface $request) {
$this->request = $request;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setRequest(ServerRequestInterface $request);",
"public function setRequest(RequestInterface $request);",
"public static function setRequest(RequestInterface $request)\n {\n $coroutineId = self::getCoroutineId();\n self::$context[$coroutineId][self::REQUEST_KEY] = $request;\n ... | [
"0.8789558",
"0.78180313",
"0.77397805",
"0.76855034",
"0.74649894",
"0.7052358",
"0.6970045",
"0.68101746",
"0.67305535",
"0.66011596",
"0.65865564",
"0.6568458",
"0.6544348",
"0.64832836",
"0.6470893",
"0.64315104",
"0.6385715",
"0.63439685",
"0.63439685",
"0.6340564",
"0.6... | 0.82014227 | 1 |
Find a redirect code in the codes | function is_redirect_http_codes($http_codes) {
foreach ($http_codes as $http_code) {
if ( is_redirect_http_code($http_code) ) {
return TRUE;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_url($url) {\r\n $http_codes = array();\r\n $urls = array();\r\n while (TRUE) {\r\n // Initialise curl and get the header\r\n $ch = curl_init($url);\r\n curl_setopt($ch, CURLOPT_HEADER, true);\r\n curl_setopt($ch, CURLOPT_NOBODY, true);\r\n curl_setopt($ch,... | [
"0.5923443",
"0.5621442",
"0.55835414",
"0.55640584",
"0.54911375",
"0.5490793",
"0.5484887",
"0.54746276",
"0.5465752",
"0.54568994",
"0.54501665",
"0.54036313",
"0.5374671",
"0.53691274",
"0.5354483",
"0.53535295",
"0.5334649",
"0.5333545",
"0.52064425",
"0.5204692",
"0.519... | 0.62229073 | 0 |
Array of urls and http codes | function check_url($url) {
$http_codes = array();
$urls = array();
while (TRUE) {
// Initialise curl and get the header
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
$content = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
// Add urls and http codes to the arrays
array_push($urls, $url);
array_push($http_codes, $http_code);
if ( is_redirect_http_code($http_code) ) {
// Check for redirects, if found, follow the redirected URL
if ( preg_match('/(?<=Location: )[^ \s]*/i', $content, $matches) ) {
$url = $matches[0];
continue;
}
}
// We can't do anything else
break;
}
// Contains all the http_codes and urls encountered
$ret['http_codes'] = $http_codes;
$ret['urls'] = $urls;
// For easy access, contains the last http_code and url encountered
$ret['http_code'] = $http_code;
$ret['url'] = $url;
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUrls(): array;",
"public function getUrls(): array;",
"function urls($data)\r\n{\r\n $result = array();\r\n if (is_array($data)) {\r\n if (isset($data['href']))\r\n $result[] = $data['href']; else\r\n foreach ($data as $d)\r\n if (is_array($d... | [
"0.6547203",
"0.6547203",
"0.61781675",
"0.6152183",
"0.6105734",
"0.6052675",
"0.600427",
"0.600287",
"0.5984404",
"0.5958778",
"0.585329",
"0.58336395",
"0.5811",
"0.5805932",
"0.5791834",
"0.5785595",
"0.57458806",
"0.5737714",
"0.57219404",
"0.5711406",
"0.5698449",
"0.... | 0.6714659 | 0 |
/ 2.6 IMG ALT TAG ATTACHMENT / | function IMGalt_Attachment($attributes, $attachment){
// print_r($attributes);
// print_r($attachment);
// get up to date alt attribute
$alt = SELF::getAltAttribute($attachment->ID);
// set alt tag
$attributes['alt'] = $alt;
// output
return $attributes;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_image_send_to_editor($id, $caption, $title, $align, $url = '', $rel = \\false, $size = 'medium', $alt = '')\n {\n }",
"function custom_send_image_to_editor( $html, $id, $caption, $title, $align, $url, $size, $alt ) {\n\n\t$url = wp_get_attachment_url($id);\n\n\t$html_str = '<div class=\"align-... | [
"0.6808126",
"0.63869506",
"0.6359961",
"0.63204473",
"0.6179372",
"0.6098405",
"0.60709876",
"0.60480756",
"0.60252535",
"0.6022915",
"0.6002773",
"0.59758204",
"0.58942604",
"0.5855631",
"0.58382475",
"0.58003324",
"0.5790051",
"0.57877487",
"0.5761844",
"0.57565975",
"0.57... | 0.7443384 | 0 |
/================================================================================== 3.0 OUTPUT ================================================================================== / 3.1 IMG ALT TAG CONTENT / | function IMGalt_Content($content) {
if($content):
// encode content
$content = mb_convert_encoding($content, 'HTML-ENTITIES', "UTF-8");
$document = new \DOMDocument();
// Disable libxml errors and allow user to fetch error information as needed
libxml_use_internal_errors(true);
$document->loadHTML(utf8_decode($content), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
// get img tag from content
$images = $document->getElementsByTagName('img');
foreach ($images as $image) {
// get orginal from srcset
if( $image->hasAttribute('srcset') ):
$orginal = '';
// get srcset from content and explode to array
$srcset = $image->getAttribute('srcset');
$srcset_array = explode(", ", $srcset);
// get orginal size
foreach ($srcset_array as $key => $value) {
$single_srcset = explode(" ", $value);
$src_size = str_replace("w", "", end($single_srcset));
if(strpos($single_srcset[0], $src_size) !== false):
// not the orginal size
// $orginal .= $single_srcset[0] . ' ' . $src_size;
else:
$orginal .= $single_srcset[0];
endif;
}
else:
$orginal = strpos($image->getAttribute('src'), 'http') !== false ? $image->getAttribute('src') : get_option( 'siteurl' ) . $image->getAttribute('src');
endif;
// get orginal img id and call alt
$id = attachment_url_to_postid($orginal);
$alt = SELF::getAltAttribute($id);
$image->removeAttribute('alt');
$image->setAttribute('alt', $alt);
}
// output
return $document->saveHTML();
endif;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IMGalt_Attachment($attributes, $attachment){\n // print_r($attributes);\n // print_r($attachment);\n // get up to date alt attribute\n $alt = SELF::getAltAttribute($attachment->ID);\n // set alt tag\n $attributes['alt'] = $alt;\n // output\n return $attributes;\n ... | [
"0.7009078",
"0.68325895",
"0.6692804",
"0.66500384",
"0.66121835",
"0.65053207",
"0.6485219",
"0.6444968",
"0.64215714",
"0.6418329",
"0.63981396",
"0.6385716",
"0.6361115",
"0.63594073",
"0.6359043",
"0.6341475",
"0.6329196",
"0.6321962",
"0.631671",
"0.6298811",
"0.6281806... | 0.7602596 | 0 |
Get iterator object of body row elements | public function getIterator()
{
return new ArrayIterator($this->_tbody->getElements());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIterator()\n {\n return new ArrayObject($this->_rows);\n }",
"public function getIterator()\n {\n return new Itr($this);\n }",
"public function getIterator() {}",
"public function getIterator() {}",
"function getInnerIterator()\n\t{\n\t\treturn $this->iterator;\... | [
"0.695523",
"0.68069005",
"0.6612693",
"0.6612693",
"0.65917534",
"0.6573931",
"0.65696836",
"0.65684927",
"0.65684927",
"0.65684927",
"0.65684927",
"0.65684927",
"0.65684927",
"0.6512575",
"0.65009004",
"0.6494172",
"0.6463965",
"0.6391734",
"0.6346755",
"0.63464385",
"0.634... | 0.73687 | 0 |
Add header row element | public function addHeaderElement(HtmlTableRow $row)
{
$this->_createHeaderContainer();
$this->_thead->addElement($row);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function addHeaderRowToCSV() {}",
"static function generateTableHeaderHTML()\n\t{\n\t\techo \"<tr class='exTableRow'>\\n\";\n\t\techo \"<th class='exTableColLineNum'>Item #</th>\\n\";\n\t\techo \"<th class='exTableColDesc'>Description of Work</th>\\n\";\n\t\techo \"<th class='exTableColAmount'>Amount</... | [
"0.7692292",
"0.712604",
"0.7125858",
"0.70332825",
"0.69570416",
"0.69057786",
"0.68878156",
"0.68810683",
"0.68019676",
"0.6754671",
"0.66745335",
"0.6660335",
"0.66567206",
"0.66486377",
"0.66272867",
"0.6618329",
"0.6592501",
"0.6578868",
"0.6541822",
"0.654087",
"0.65400... | 0.72553575 | 1 |
Get element of header container | public function getHeaderContainer()
{
return $this->_thead;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getHeadElement()\n {\n return $this->head;\n }",
"public function get_header() {\n\t\tif (!isset($this->header)) {\n\t\t\t$this->get_array();\n\t\t}\n\t\treturn $this->header;\n\t}",
"public function getHeader(): ?HtmlElementInterface\n {\n return $this->header;\n }",
... | [
"0.66016114",
"0.64025205",
"0.63993317",
"0.6157431",
"0.61392045",
"0.6126388",
"0.6118815",
"0.6118815",
"0.61108035",
"0.6052106",
"0.6040585",
"0.6014633",
"0.6011997",
"0.6007136",
"0.5996616",
"0.5951458",
"0.5950244",
"0.5950244",
"0.5950244",
"0.5950244",
"0.5950244"... | 0.6985704 | 0 |
Get all elements of body rows | public function getRows()
{
$ret = null;
if ($this->_tbody instanceof HtmlElement) {
$ret = $this->_tbody->getElements();
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getElements() {\n return $this->rows_object;\n }",
"public function getRowsContainer()\n\t{\n\t\treturn $this->_tbody;\n\t}",
"public function rows() {\n\t\treturn $this->row();\n\t}",
"public function getElements() {}",
"function get_all(){\r\n\t\t$rows = array();\r\n\t\twhile($... | [
"0.7145024",
"0.67310625",
"0.6620081",
"0.6614637",
"0.65186584",
"0.65153134",
"0.64370507",
"0.63596195",
"0.63553333",
"0.63031673",
"0.6249923",
"0.6249923",
"0.6209117",
"0.6174423",
"0.6156906",
"0.6131532",
"0.6096748",
"0.6048213",
"0.60419387",
"0.6029207",
"0.60171... | 0.75805193 | 0 |
Get element of header row | public function getHeader($rowIndex)
{
$ret = null;
if ($this->_thead instanceof HtmlElement) {
$ret = $this->_thead->getElement($rowIndex);
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function getRowsHeader(): array;",
"public function getHeaderRow($asArray = false) {\n\t\tif (!empty($this->headers)) {\n\t\t\tif ($asArray) {\n\t\t\t\treturn array_keys($this->data);\n\t\t\t} else {\n\t\t\t\treturn Header::getInstance()->setData(array_keys($this->data));\n\t\t\t}\n\t\t} else ... | [
"0.6810676",
"0.62944865",
"0.6242552",
"0.62250215",
"0.62175643",
"0.61919236",
"0.61153996",
"0.6094448",
"0.6079371",
"0.60705155",
"0.6048987",
"0.60014737",
"0.5972997",
"0.5966424",
"0.5965936",
"0.5939383",
"0.5904225",
"0.5897384",
"0.5888053",
"0.5882271",
"0.587228... | 0.6975997 | 0 |
Create the element of header container if it does not exist | protected function _createHeaderContainer()
{
if ($this->_thead == null) {
$this->_thead = new HtmlElement('thead');
$this->addElement($this->_thead);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createHeader() {\n\t\t$header = new PHPWord_Section_Header($this->_sectionCount);\n\t\t$this->_header = $header;\n\t\treturn $header;\n\t}",
"public function addChild($header = \"\");",
"public function newHeaderContainer()\n {\n return new HeaderContainer($this);\n }",
"private ... | [
"0.69501317",
"0.6624627",
"0.64704645",
"0.6257379",
"0.611662",
"0.600705",
"0.598772",
"0.598313",
"0.5980321",
"0.5979505",
"0.58945435",
"0.58895266",
"0.5871452",
"0.5825438",
"0.58023465",
"0.5792442",
"0.5769272",
"0.57636344",
"0.5749514",
"0.5722273",
"0.57159126",
... | 0.8115961 | 0 |
Render flash box (success or error message) Render smarty flash box No parameters expected | function smarty_function_flash_box( $params, &$smarty ) {
if( $message = flash_get( 'success' ) ) {
$type = 'success';
} elseif( $message = flash_get( 'error' ) ) {
$type = 'error';
} else {
return '';
} // if
return '<div id="' . $type . '" class="flash flash-' . $type . '"><span>' . $message . '</span></div>';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function renderFlashMessages() {}",
"public function renderFlash()\n {\n // get the feedback (they are arrays, to make multiple positive/negative messages possible)\n $feedback_positive = Session::get('feedback_positive');\n $feedback_negative = Session::get('feedback_negative');\n\n ... | [
"0.72069967",
"0.7164869",
"0.7150055",
"0.7118421",
"0.69741654",
"0.68779474",
"0.684934",
"0.67434967",
"0.67325103",
"0.67284054",
"0.66904515",
"0.66701514",
"0.65090513",
"0.65033543",
"0.6500036",
"0.6497987",
"0.648419",
"0.64635813",
"0.6458883",
"0.64480376",
"0.643... | 0.84708256 | 0 |
Example of how to send an HTTP 500 response. If mail alerts are enabled in the config.ini, email is sent. | public function send500Action()
{
throw new ZFDemo_Exception_Reroute(_('Example action to test sending a HTTP 500 response'), 500);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function internalServerError($error)\n{\n header('HTTP/1.1 500 Internal Server Error');\n $emailIds = array(\"rahul_lahoria@yahoo.com\", \"pwnpnwr785@gmail.com\", \"vikas.niper2012@gmail.com\", \"kumar.anil8892@yahoo.com\");\n foreach ($emailIds as $to)\n sendMail($to, \"Alert! error occurred in ap... | [
"0.72864425",
"0.71010566",
"0.6995637",
"0.6953725",
"0.6895583",
"0.6764839",
"0.65184075",
"0.64316213",
"0.64159656",
"0.6383572",
"0.63785",
"0.6334098",
"0.6230074",
"0.62020946",
"0.6163585",
"0.61592144",
"0.61590904",
"0.6125583",
"0.6125116",
"0.6122727",
"0.6116837... | 0.7305898 | 0 |
/ $data['activity_type'] = $this > _getParam('activity_type'); $data['event_object'] = $this> _getParam('event'); $data['facebook_user_id'] = $this>_getParam('id'); $data['facebook_user_name'] = $this>_getParam('owner_name'); $data['fanpage_id'] = $this>_getParam('fanpage_id'); $data['target_user_id'] = $this>_getParam('target_id'); $data['target_user_name'] = $this>_getParam('target_name'); $data['message'] = $this>_getParam('message'); | protected function addactivity($activity_type, $event_object, $fanpage_id, $target_user_id, $target_name, $message ){
$data['activity_type'] = $activity_type;
$data['event_object'] = $event_object;
$data['facebook_user_id'] = $this->_user->facebook_user_id;
$data['facebook_user_name'] = $this->_user->facebook_user_name;
$data['fanpage_id'] = $fanpage_id;
$data['target_user_id'] = $target_user_id;
$data['target_user_name'] = $target_name;
$data['message'] = $message;
$act = new Model_FancrankActivities();
$post = new Model_Posts();
/*
if ($data['activity_type'] == "like-status" || $data['activity_type'] == "like-photo" ||
$data['activity_type'] == "like-video" || $data['activity_type'] == "like-link"){
$post->addLikeToPost($data['event_object']);
}else if ($data['activity_type'] == "unlike-status" || $data['activity_type'] == "unlike-photo" ||
$data['activity_type'] == "unlike-video" || $data['activity_type'] == "unlike-link"){
$post->subtractLikeToPost($data['event_object']);
}else if ($data['activity_type'] == "comment-status" || $data['activity_type'] == "comment-photo" ||
$data['activity_type'] == "comment-video" || $data['activity_type'] == "comment-link"){
$post->addCommentToPost($data['event_object']);
}
*/
$act -> addActivities($data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function initializeFacebookEvent()\n {\n $this->trackingName = $this->ifVariableSet($this->parameters['tracking'],null);\n $this->numberGiftEarned = $this->ifVariableSet($this->parameters['numberGiftEarned'],0);\n $this->numberGiftSent = $this->ifVariableSet($this->parameters['number... | [
"0.60599965",
"0.5757755",
"0.55691695",
"0.5533957",
"0.5504438",
"0.5462942",
"0.54532325",
"0.5416127",
"0.5404493",
"0.5373595",
"0.5363646",
"0.5363174",
"0.5360115",
"0.5357556",
"0.53428733",
"0.52425456",
"0.5230426",
"0.5222235",
"0.5203201",
"0.5192375",
"0.51791835... | 0.6309429 | 0 |
check response error from facebook graph api | private function facebookResponseCheck($result) {
if(!empty($result->error)) {
$type = isset($result->error->type) ? $result->error->type : '';
$code = isset($result->error->code) ? $result->error->code : '';
$message = isset($result->error->message) ? $result->error->message : '';
$msg = sprintf('type: %s, $code: %s, message: %s', $type, $code, $message);
throw new Exception($msg);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function is_error() \n\t\t{\n\t\t\t\t$json = json_decode( $this->response );\n\t\t\t\tif( $json->faultstring )\n\t\t\t\t{\n\t\t\t\t\t\t$this->error = $json->faultstring;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\treturn false;\n\n\t\t}",
"public function has_http_error($response) {\n if(!$response || !i... | [
"0.6256429",
"0.6234275",
"0.62125367",
"0.6202816",
"0.619115",
"0.6112488",
"0.59841853",
"0.59429115",
"0.59417385",
"0.5915669",
"0.5915669",
"0.5914272",
"0.5861633",
"0.5848695",
"0.5822073",
"0.57939005",
"0.5764143",
"0.574654",
"0.5718953",
"0.5672794",
"0.56537724",... | 0.73957115 | 0 |
Returns an IntersectionIterator containing elements in $this that are also in $iterable | public function intersection($iterable, $strategy = null); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function of(iterable $iterable): self {\n\t\t$generator = function () use ($iterable) {\n\t\t\tforeach ($iterable as $item) {\n\t\t\t\tyield $item;\n\t\t\t}\n\t\t};\n\t\treturn new self($generator());\n\t}",
"public function intersect(iterable $items): self\n {\n $items = Factory::getArra... | [
"0.6072463",
"0.60437727",
"0.6029325",
"0.5887875",
"0.579804",
"0.55278397",
"0.54709667",
"0.546725",
"0.5455278",
"0.54440105",
"0.5418173",
"0.5389925",
"0.5389925",
"0.5389925",
"0.538118",
"0.53732204",
"0.5365471",
"0.53622234",
"0.536218",
"0.5348531",
"0.5331685",
... | 0.64896554 | 0 |
return get_theme_option(OP_ENTRY_CARD_EXCERPT_MORE, __( '...', THEME_NAME )); | function get_entry_card_excerpt_more(){
return "";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function themify_custom_excerpt_more($more) {\n global $post;\n return '';\n}",
"function xkit_the_theme_option( $field_name, $default = '' ){\n\tprint xkit_get_theme_option( $field_name, $default );\n}",
"function codium_extend_excerpt_more($more) {\n global $post;\n $readmore = __('Czytaj wie... | [
"0.6736971",
"0.66720587",
"0.6604045",
"0.6604045",
"0.6576243",
"0.6531921",
"0.6482173",
"0.643697",
"0.6405216",
"0.6401118",
"0.63861144",
"0.6364165",
"0.6323433",
"0.6321211",
"0.63200486",
"0.6283958",
"0.6236837",
"0.6235942",
"0.62268674",
"0.6214131",
"0.61934173",... | 0.72823095 | 0 |
Method to store valdiation filter rules | public static function filter($rules)
{
static::$filters[] = $rules;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function getRules() {\n return [\n 'imeArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'cenaArtikla' => FILTER_VALIDATE_FLOAT,\n 'opisArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'kategorijaArtikla' => FILTER_SANITIZE_SPECIAL_CHARS,\n 'zalog... | [
"0.66086787",
"0.6507619",
"0.6447703",
"0.6369883",
"0.6359987",
"0.63215977",
"0.63195574",
"0.63150454",
"0.6257946",
"0.6257946",
"0.6257946",
"0.62349886",
"0.62312895",
"0.61983055",
"0.6170236",
"0.615807",
"0.6138033",
"0.6134118",
"0.60906",
"0.6042778",
"0.6023637",... | 0.66950357 | 0 |
Get the template builder manager. | protected function builderManager() {
return \Drupal::service('plugin.manager.entity_template.builder');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBuilder() {\n if (!isset($this->builder)) {\n if (empty($this->configuration['builder'])) {\n $this->builder = $this->builderManager->createInstance('standard', []);\n }\n else {\n $this->builder = $this->builderManager->createInstance($this->configuration['builde... | [
"0.65663296",
"0.6290267",
"0.6290267",
"0.6290267",
"0.62729853",
"0.6265055",
"0.6221792",
"0.60746664",
"0.6015199",
"0.59984595",
"0.59514964",
"0.594063",
"0.5932067",
"0.5932067",
"0.5926895",
"0.591976",
"0.59180784",
"0.59067625",
"0.58905035",
"0.58742106",
"0.587034... | 0.7953468 | 0 |
Get the remote fortrabbit branch to deploy to | public function remoteBranch() : string
{
return (string) $this->getOrError('remote_branch');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function list_remote_branches() {\n\t\t\t$branchArray = explode(\"\\n\", $this->run(\"branch -r\"));\n\t\t\tforeach ($branchArray as $i => &$branch) {\n\t\t\t\t$branch = trim($branch);\n\t\t\t\tif ($branch == \"\" || strpos($branch, 'HEAD -> ') !== false) {\n\t\t\t\t\tunset($branchArray[$i]);\n\t\t\t\t}\n\t... | [
"0.65224206",
"0.6259599",
"0.62317294",
"0.6191133",
"0.6075909",
"0.60703236",
"0.60518396",
"0.60518396",
"0.6004127",
"0.59335285",
"0.58949876",
"0.57196635",
"0.5704866",
"0.5616115",
"0.5611877",
"0.56028503",
"0.55625117",
"0.55576104",
"0.5553211",
"0.5515577",
"0.55... | 0.7209364 | 0 |
Get the build commands to run | public function buildCommands() : Collection
{
return collect((array) $this->get('build_commands', []));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCommandsToRun()\n {\n // Get symfony\n $symfony = $this->findSymfony();\n\n // Commands\n $commands = [\n rtrim($symfony . ' new ' . $this->getProjectPath() . ' ' . $this->getVersion()),\n ];\n\n return implode(' && ', $commands);\n }",
... | [
"0.65266496",
"0.6486425",
"0.64486825",
"0.63645273",
"0.6264899",
"0.6238406",
"0.6073823",
"0.6070439",
"0.59602493",
"0.5953021",
"0.5891035",
"0.5858855",
"0.5854843",
"0.58218366",
"0.5789899",
"0.57700354",
"0.57596934",
"0.5742897",
"0.57065547",
"0.570477",
"0.569952... | 0.67123824 | 0 |
Get the git URL | public function gitUrl() : string
{
return sprintf(
'%s@%s:%s.git',
$this->projectName(),
$this->getOrError('frb_zone'),
$this->projectName()
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_url(){\n\n\t\t\treturn $this->api_urls['giturl'];\n\n\t\t}",
"public function getCommitUrl(): string\n {\n return $this->data->url;\n }",
"public function get_github_url() {\n\t\treturn $this->get_meta( 'github_url' );\n\t}",
"function getUrl() {\n\t\treturn $this->repoObj->... | [
"0.86241466",
"0.7903098",
"0.74523854",
"0.73158497",
"0.6870565",
"0.67854977",
"0.675056",
"0.6714888",
"0.6662214",
"0.6629114",
"0.6623352",
"0.66135496",
"0.65533596",
"0.6542594",
"0.65313685",
"0.65038073",
"0.6503157",
"0.6480044",
"0.6426344",
"0.6394495",
"0.638707... | 0.7926891 | 1 |
Get the fortrabbit remote name | public function fortrabbitRemoteName() : string
{
return 'frb-' . $this->environment();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getName(): string\n {\n return 'centreon_configuration_remote';\n }",
"public function getRemoteAddress()\n {\n return stream_socket_get_name($this->socket, true);\n }",
"public function getReceiverName()\n {\n return $this->get(self::_RECEIVER_NAME);\... | [
"0.63912964",
"0.6318805",
"0.62839437",
"0.61415905",
"0.60348165",
"0.601217",
"0.60069597",
"0.5983146",
"0.5963327",
"0.5961428",
"0.5937357",
"0.5915767",
"0.5899417",
"0.5898476",
"0.5893659",
"0.5887986",
"0.5887931",
"0.5878322",
"0.5876887",
"0.5869484",
"0.58655125"... | 0.80864376 | 0 |
/Add workout function form | public function addWorkout()
{
return view('admin.addworkout');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function work()\n {\n }",
"function vcn_findwork() { // Callback fucntion\r\n\t//return drupal_get_form('vcn_findwork_form');\r\n\treturn theme('vcn_findwork_overview');\r\n}",
"function raptor_glue_worklist_form_builder($form, &$form_state)\n{\n\n $oPI = new \\raptor\\WorklistPage();\n $form = arr... | [
"0.5877085",
"0.57135993",
"0.56200004",
"0.55651164",
"0.54190516",
"0.5377406",
"0.53698415",
"0.53543234",
"0.5306199",
"0.52983457",
"0.527685",
"0.5251136",
"0.52413756",
"0.52306867",
"0.5230611",
"0.52254736",
"0.51927763",
"0.51724637",
"0.51587814",
"0.5121457",
"0.5... | 0.627421 | 0 |
/Add nutrition Category form | public function addNutrationCategory()
{
return view('admin.addnutratoncategory');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add()\n {\n $category = new stdClass();\n $category->category_id = null;\n $category->name = null;\n $data = [\n 'page' => 'add',\n 'row' => $category\n ];\n $this->template->load('template', 'product/category/category_add', $data);... | [
"0.69676876",
"0.69144493",
"0.69017804",
"0.68650234",
"0.68249476",
"0.67566377",
"0.6712905",
"0.668728",
"0.6656021",
"0.6614073",
"0.6611625",
"0.6608978",
"0.6608551",
"0.65376264",
"0.65324306",
"0.6525535",
"0.65221816",
"0.6514171",
"0.6511999",
"0.6508002",
"0.64992... | 0.7627313 | 0 |
/Store nutrition category data form | public function storeNutrationCategory(Request $request)
{
$this->validate($request,array(
'nutrationCategoryName' => 'required',
//'tips' => 'required',
));
$nutrationCategory = new NutrationCategory;
$nutrationCategory->nutration_category_name = $request->nutrationCategoryName;
//$nutrationCategory->tips = $request->tips;
$nutrationCategory->save();
if($nutrationCategory->save()){
return redirect()->back()->with('success','Nutration category Saved successfully.');
}
else{
return redirect()->back()->with('denger-success','Nutration category is not saved.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function storeCategory(array $data): void\n {\n }",
"private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }",
"function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = i... | [
"0.638003",
"0.6293937",
"0.62295073",
"0.6156473",
"0.6106529",
"0.6040855",
"0.60370666",
"0.602494",
"0.6020303",
"0.59738475",
"0.5970187",
"0.59676784",
"0.5944608",
"0.59403944",
"0.59081626",
"0.5884613",
"0.5880202",
"0.58768755",
"0.58323884",
"0.5800276",
"0.5799089... | 0.6651365 | 0 |
/Add program Category form | public function addProgramCategory()
{
return view('admin.addprogramcategory');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n if (!isset(request()->program)) {\n $category = Programs::all();\n } else {\n $category = Programs::where(\"id\", request()->program)->first();\n }\n return view(\"admin/action/create\", compact(\"category\"));\n }",
"public f... | [
"0.6791251",
"0.67398465",
"0.6735368",
"0.67165315",
"0.67116857",
"0.6615872",
"0.6611898",
"0.6589547",
"0.65745264",
"0.6573505",
"0.6542764",
"0.6485271",
"0.64450854",
"0.644032",
"0.6434564",
"0.64265096",
"0.64235735",
"0.6346596",
"0.63265896",
"0.62802815",
"0.62374... | 0.7373798 | 0 |
/Store program category data form | public function storeProgramCategory(Request $request)
{
$this->validate($request,array(
'categoryName' => 'required',
'tips' => 'required',
));
$programCategory = new ProgramCategory;
$programCategory->program_category_name = $request->categoryName;
$programCategory->tips = $request->tips;
$programCategory->save();
if($programCategory->save()){
return redirect()->back()->with('success','Program category Saved successfully.');
}
else{
return redirect()->back()->with('denger-success','Program category is not saved.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lm_save_category() {\n\t@copy(LM_CDATA, LM_CBACKUP);\n\t$id = isset($_POST['category-id']) ? intval($_POST['category-id']) : null;\n\t$cid = isset($_POST['category-cid']) ? intval($_POST['category-cid']) : time();\n\t$arr = array('cid'=>$cid, 'name'=>safe_slash_html($_POST['category-name']));\n\tif (funct... | [
"0.6249412",
"0.6124111",
"0.5888456",
"0.57923037",
"0.5727026",
"0.57267463",
"0.5641175",
"0.56360894",
"0.5622185",
"0.5558223",
"0.5539674",
"0.55263704",
"0.55060816",
"0.550298",
"0.5502602",
"0.5431195",
"0.5417658",
"0.5393107",
"0.5385183",
"0.53831905",
"0.5369164"... | 0.6413852 | 0 |
/Add Workout category form | public function addWorkoutCategory()
{
return view('admin.addworkoutcategory');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function storeWorkoutCategory(Request $request)\n {\n $this->validate($request,array(\n 'categoryName' => 'required',\n ));\n\n $workoutCategory = new Category;\n\n $workoutCategory->category = $request->categoryName;\n\n $workoutCategory->save();\n\n ... | [
"0.67460954",
"0.62550235",
"0.6202757",
"0.59804004",
"0.5974859",
"0.5883679",
"0.5875688",
"0.58718485",
"0.58620435",
"0.5860522",
"0.58561087",
"0.5849379",
"0.58476734",
"0.584638",
"0.5837361",
"0.5828801",
"0.5822643",
"0.58087504",
"0.5780437",
"0.5755626",
"0.573068... | 0.7685577 | 0 |
/Store Workout category data form | public function storeWorkoutCategory(Request $request)
{
$this->validate($request,array(
'categoryName' => 'required',
));
$workoutCategory = new Category;
$workoutCategory->category = $request->categoryName;
$workoutCategory->save();
if($workoutCategory->save()){
return redirect()->back()->with('success','Workout category Saved successfully.');
}
else{
return redirect()->back()->with('denger-success','Workout category is not saved.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addWorkoutCategory()\n {\n return view('admin.addworkoutcategory');\n }",
"public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(tru... | [
"0.61515504",
"0.60063905",
"0.58394295",
"0.58378613",
"0.5620386",
"0.5580089",
"0.555611",
"0.55307066",
"0.55281335",
"0.5486131",
"0.5485075",
"0.54284894",
"0.5389126",
"0.5386289",
"0.5377289",
"0.5354097",
"0.5353045",
"0.5351274",
"0.53213197",
"0.5312135",
"0.530880... | 0.680613 | 0 |
/Store video category data form | public function storeVideocategory(Request $request)
{
$this->validate($request,array(
'categoryName' => 'required',
));
$videoCategory = new VideoCategory;
$videoCategory->video_category_name = $request->categoryName;
$videoCategory->save();
if($videoCategory->save()){
return redirect()->back()->with('success','Video category Saved successfully.');
}
else{
return redirect()->back()->with('denger-success','Video category is not saved.');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store(AddVideoRequest $request)\n {\n try{\n $videoFile = $request->file('video');\n $thumbnailFile = $request->file('thumbnail');\n $videoName = 'video_'.str_slug($request->input('title')).\".\".$videoFile->getClientOriginalExtension();\n ... | [
"0.6457996",
"0.6418421",
"0.6280149",
"0.6258419",
"0.62341547",
"0.62338513",
"0.6215257",
"0.6186579",
"0.6134619",
"0.61315817",
"0.61244404",
"0.6043199",
"0.60421747",
"0.6031893",
"0.60311496",
"0.60204273",
"0.6015956",
"0.6015519",
"0.5985891",
"0.59772885",
"0.59747... | 0.663629 | 0 |
/edit workout Function for delete | public function deleteWorkout(Request $request)
{
$id = $request->workoutid;
$getWorkout = Workout::find($id);
if($getWorkout->delete()){
return redirect()->back()->with('danger','Workout Deleted successfully');
}
else{
return redirect()->back()->with('danger','Sorry! Workout is not deleted');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteWorklog(){\n\n }",
"function delete_entry($entryID) {\r\n $this->db->where('id', $entryID);\r\n $this->db->delete('workHours');\r\n }",
"function delete_workman($id)\n {\n return $this->db->delete('workman',array('id'=>$id));\n }",
"public function edit(... | [
"0.67456985",
"0.63389087",
"0.6332227",
"0.6252248",
"0.6217238",
"0.6122122",
"0.6102628",
"0.605384",
"0.59912604",
"0.59836406",
"0.59804535",
"0.5974781",
"0.5966493",
"0.5956046",
"0.59432197",
"0.59420574",
"0.5908118",
"0.5903832",
"0.5903832",
"0.5902733",
"0.5902004... | 0.6510778 | 1 |
/edit workout category Function for view form | public function editworkoutcategory($id)
{
if((Auth::check()) && (Auth::user()->is_admin == 1)){
$workout = Category::find($id);
return view('admin.editworkoutcategory')->with('workout',$workout);
}
else{
Session::flash('danger','You are not authorize to view this page');
return redirect()->back();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateworkoutcategory(Request $request)\n {\n if((Auth::check()) && (Auth::user()->is_admin == 1)){\n\n $this->validate($request,array(\n 'name' => 'required',\n ));\n $id = $request->id;\n $workoutCategory = Category::find($id);\n ... | [
"0.69934815",
"0.6759673",
"0.6755315",
"0.67062914",
"0.67001015",
"0.66443294",
"0.6574874",
"0.6564783",
"0.65390974",
"0.6490522",
"0.64873505",
"0.647618",
"0.6468072",
"0.6468072",
"0.6468072",
"0.6468072",
"0.6468072",
"0.6468072",
"0.6468072",
"0.6468072",
"0.6468072"... | 0.7222749 | 0 |
/edit workout category Function for update form | public function updateworkoutcategory(Request $request)
{
if((Auth::check()) && (Auth::user()->is_admin == 1)){
$this->validate($request,array(
'name' => 'required',
));
$id = $request->id;
$workoutCategory = Category::find($id);
$workoutCategory->Category = $request->name;
$workoutCategory->save();
Session::flash('success','Workout Category Updated succcessfully.');
return redirect()->back()->with('workout',$workoutCategory);
}
else{
Session::flash('danger','You are not authorize to view this page');
return redirect()->back();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Workout $workout)\n {\n //\n }",
"function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, $_u, $fs;\n\t\t\n\t\t$data = $_r['data'];\n\t\t$data['id'] = $_r['id'];\n\t\t\n\t\tif($data['save'] || $data['apply']){\n\t\t\tif(!$data['title']) $error['title'] = tr... | [
"0.6806339",
"0.67915225",
"0.6783352",
"0.6751382",
"0.67282903",
"0.67065406",
"0.6692574",
"0.65847135",
"0.6567059",
"0.65591395",
"0.6540297",
"0.6506003",
"0.65053743",
"0.6411967",
"0.6411967",
"0.6411967",
"0.6411967",
"0.6411967",
"0.6411967",
"0.6411967",
"0.6411967... | 0.7347392 | 0 |
/Edit workout category Function for delete | public function deleteworkoutcategory(Request $request)
{
$id = $request->workoutid;
$getWorkout = Category::find($id);
if($getWorkout->delete()){
return redirect()->back()->with('danger','Workout Category Deleted successfully');
}
else{
return redirect()->back()->with('danger','Sorry! Workout Category is not deleted');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteNutrationCategory(Request $request)\n {\n $id = $request->workoutid;\n $getWorkout = NutrationCategory::find($id);\n if($getWorkout->delete()){\n return redirect()->back()->with('danger','Nutration Category Deleted successfully');\n }\n else{\n... | [
"0.66179216",
"0.62175333",
"0.606527",
"0.6050479",
"0.6025807",
"0.5908983",
"0.58987623",
"0.58845043",
"0.58626807",
"0.5849458",
"0.58235",
"0.5812783",
"0.57931215",
"0.57875305",
"0.5775079",
"0.5774425",
"0.57559234",
"0.57472736",
"0.5708211",
"0.5707082",
"0.5699718... | 0.67777485 | 0 |
/Edit video category Function for update | public function updateVideoCategory(Request $request)
{
if((Auth::check()) && (Auth::user()->is_admin == 1)){
$this->validate($request,array(
'name' => 'required',
));
$id = $request->id;
$videoCategory = VideoCategory::find($id);
$videoCategory->video_category_name = $request->name;
$videoCategory->save();
Session::flash('success','Video Category Updated succcessfully.');
return redirect()->back()->with('workout',$videoCategory);
}
else{
Session::flash('danger','You are not authorize to view this page');
return redirect()->back();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function modifyCategory()\n{\n global $connection;\n if (isset($_POST['modifyBtn'])) {\n $categoria_id = $_POST['categoria_id'];\n\n $categoria_nome = str_replace([\"'\", '’', '“', '”'], [\"\\'\", \"\\'\", \"\\'\", \"\\'\"], $_POST['categoria_nome']);\n\n $query_update = \"UPDATE video_c... | [
"0.70255893",
"0.68039304",
"0.67580926",
"0.67113507",
"0.67026937",
"0.6621358",
"0.65880543",
"0.6528769",
"0.6527254",
"0.6502974",
"0.6494821",
"0.64577454",
"0.6449746",
"0.6443463",
"0.64407146",
"0.64304763",
"0.6426913",
"0.63906366",
"0.63733435",
"0.63481635",
"0.6... | 0.7049841 | 0 |
/Edit video category Function for delete video category | public function deleteVideoCategory(Request $request)
{
$id = $request->workoutid;
$getWorkout = VideoCategory::find($id);
if($getWorkout->delete()){
return redirect()->back()->with('danger','Video Category Deleted successfully');
}
else{
return redirect()->back()->with('danger','Sorry! Video Category is not deleted');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cat_delete_link()\n{\n return Parrot::getInstance()->getUrl(\"admin/category/\" . discussion::encode_title(cat_title()) . \"/delete\");\n}",
"public function delete(){\n\n\t\t$sql = new Sql();\n\n\t\t$sql->query(\"DELETE FROM tb_categories WHERE idcategory=:idcategory\",array(\n\t\t\t\":idcategory\"=... | [
"0.6836293",
"0.6664944",
"0.663955",
"0.66256726",
"0.65463334",
"0.643667",
"0.64297694",
"0.6421151",
"0.64116925",
"0.6404533",
"0.63948876",
"0.6360626",
"0.63225144",
"0.6319296",
"0.62775624",
"0.62721723",
"0.62640065",
"0.62535095",
"0.6248276",
"0.6229323",
"0.61948... | 0.67401767 | 1 |
/Edit Nutration Category Function for update | public function updateNutrationCategory(Request $request)
{
if((Auth::check()) && (Auth::user()->is_admin == 1)){
$this->validate($request,array(
'name' => 'required',
'tips' => 'required',
));
$id = $request->id;
$nutrationCategory = NutrationCategory::find($id);
$nutrationCategory->nutration_category_name = $request->name;
$nutrationCategory->tips = $request->tips;
$nutrationCategory->save();
Session::flash('success','Nutration Category Updated succcessfully.');
return redirect()->back()->with('workout',$nutrationCategory);
}
else{
Session::flash('danger','You are not authorize to view this page');
return redirect()->back();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testUpdateItemSubCategory()\n {\n }",
"public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\... | [
"0.71557504",
"0.71024853",
"0.70967233",
"0.6873377",
"0.6844343",
"0.68225706",
"0.6781376",
"0.67681557",
"0.6741728",
"0.66843164",
"0.66287494",
"0.6611749",
"0.6610787",
"0.65974736",
"0.65905493",
"0.6587013",
"0.65291274",
"0.6514518",
"0.6501304",
"0.6478147",
"0.646... | 0.7165534 | 0 |
/Delete Nutrition Category Function | public function deleteNutrationCategory(Request $request)
{
$id = $request->workoutid;
$getWorkout = NutrationCategory::find($id);
if($getWorkout->delete()){
return redirect()->back()->with('danger','Nutration Category Deleted successfully');
}
else{
return redirect()->back()->with('danger','Sorry! Nutration Category is not deleted');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete_category() {\n $category_id = $_GET['category_id'];\n\n $data['delete_category'] = $this->Category_crud->get_category_by_id($category_id);\n $this->load->view('restaurant/category/delete_category_model', $data);\n\n if (isset($_POST['delete_category_yes'])) {\n ... | [
"0.69728845",
"0.69309986",
"0.68059367",
"0.65877753",
"0.6557906",
"0.6525597",
"0.6450585",
"0.64371765",
"0.6426727",
"0.64032364",
"0.6383666",
"0.633878",
"0.6333474",
"0.6313338",
"0.6311642",
"0.6310584",
"0.63052934",
"0.6280416",
"0.62617826",
"0.6255811",
"0.621699... | 0.70054156 | 0 |
TODO: Implement getMsgStatusByMSGID() method. | public function getMsgStatusByMSGID($msgid)
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStatus($message_id);",
"public function status(string $msgId)\n {\n $options = [\n 'msg_id' => $msgId,\n ];\n var_dump($options);\n var_dump(\"2222\");\n return $this->httpPostJson('cgi-bin/message/mass/get', $options);\n }",
"public functi... | [
"0.7625756",
"0.70659006",
"0.6991421",
"0.681895",
"0.673134",
"0.639874",
"0.6263489",
"0.62102044",
"0.607951",
"0.6073092",
"0.6046357",
"0.6016508",
"0.6011807",
"0.60105884",
"0.6003367",
"0.59765834",
"0.59706825",
"0.5963977",
"0.5945867",
"0.59445965",
"0.59393036",
... | 0.8129333 | 0 |
Loads collection from database matching $condition. | public function findMany(array $condition)
{
$selection = $this->getTable()->where($condition);
$collectionClassName = $this->getInstanceCollectionClassName();
return $collectionClassName::create($this, $selection);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function find($condition)\n {\n if(!is_array($condition))\n {\n $condition = array($this->getKeyField() => $condition);\n }\n $model = $this->getStorage()->fetchRow($condition);\n if(!$model->isLoaded())\n {\n return null;\n }\n ... | [
"0.57210517",
"0.56922704",
"0.5691084",
"0.56790066",
"0.55747086",
"0.55327123",
"0.5511437",
"0.5477265",
"0.5448327",
"0.54200876",
"0.5348354",
"0.5317316",
"0.53077555",
"0.52874106",
"0.5286501",
"0.528025",
"0.5269855",
"0.5205735",
"0.5188458",
"0.51633877",
"0.51414... | 0.5729831 | 0 |
Initialize SmashPig context and return configuration object | public static function setSmashPigProvider( $provider ) {
$ctx = Context::get();
$spConfig = ProviderConfiguration::createForProvider(
$provider,
$ctx->getGlobalConfiguration()
);
// FIXME: should set a logger prefix here, but we've got a chicken
// and egg problem with the Gateway constructor
$ctx->setProviderConfiguration( $spConfig );
return $spConfig;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function configure();",
"abstract public function configure();",
"public function configure() {}",
"public function configure() {}",
"protected function initializeConfiguration() {}",
"function __construct() {\n //invoke the init method of the config object in context\n $this->init()... | [
"0.5714789",
"0.5712379",
"0.5621134",
"0.5621134",
"0.5573061",
"0.5556468",
"0.5543287",
"0.5543287",
"0.5530572",
"0.54214585",
"0.53707373",
"0.53609705",
"0.53600633",
"0.53128165",
"0.5301196",
"0.5293151",
"0.52765054",
"0.5258332",
"0.52520496",
"0.5249621",
"0.523578... | 0.5848287 | 0 |
Add item to TaxBreakdownCode value | public function addToTaxBreakdownCode(\Sabre\UpdateReservation\StructType\TaxBreakdownCode $item)
{
// validation for constraint: itemType
if (!$item instanceof \Sabre\UpdateReservation\StructType\TaxBreakdownCode) {
throw new \InvalidArgumentException(sprintf('The TaxBreakdownCode property can only contain items of \Sabre\UpdateReservation\StructType\TaxBreakdownCode, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->TaxBreakdownCode[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTax() {\n\t\t$adb = PearDatabase::getInstance();\n\n\t\t$tableName = $this->getTableNameFromType();\n\t\t$taxid = $adb->getUniqueID($tableName);\n\t\t$taxLabel = $this->getName();\n\t\t$percentage = $this->get('percentage');\n\n\t\t//if the tax is not available then add this tax.\n\t\t//Add this... | [
"0.6022677",
"0.5650368",
"0.561249",
"0.5508849",
"0.5507532",
"0.5432416",
"0.540472",
"0.5397493",
"0.5362307",
"0.5269257",
"0.5217888",
"0.52035296",
"0.51972234",
"0.51873654",
"0.51750666",
"0.51657856",
"0.51474166",
"0.51095754",
"0.5083389",
"0.50705147",
"0.5063206... | 0.67118555 | 0 |
Return a Card response | public function card(CardInterface $card)
{
return $this->respond(self::RESPONSE_TYPE_CARD, $card->toArray());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCard() {\n return $this->card;\n }",
"function card_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan... | [
"0.6849949",
"0.682923",
"0.67764735",
"0.6676103",
"0.6617826",
"0.66177595",
"0.6543389",
"0.64561677",
"0.6348846",
"0.6329933",
"0.6126838",
"0.6120103",
"0.60777456",
"0.604684",
"0.60012907",
"0.5987791",
"0.59828883",
"0.5938717",
"0.5935131",
"0.58965313",
"0.5889521"... | 0.6998666 | 0 |
Return a reprompt response, wrapping a speech response | public function reprompt($reprompt, $type = self::TYPE_PLAINTTEXT)
{
return $this->respond(
self::RESPONSE_TYPE_REPROMPT, [
self::RESPONSE_TYPE_OUTPUT_SPEECH => $this->getSpeechResponse($reprompt, $type),
]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function response() {\n $reply = trim(fgets($this -> __sock, 512));\n switch(substr($reply, 0, 1)) {\n /* Error reply */\n case '-':\n trigger_error('ERROR (' . trim($reply) . ')', E_USER_ERROR);\n /* Inline reply */\n ... | [
"0.59148437",
"0.5905642",
"0.56824",
"0.56219715",
"0.56104815",
"0.54974437",
"0.548491",
"0.54318166",
"0.54279864",
"0.539601",
"0.5364582",
"0.5350667",
"0.53386617",
"0.53163886",
"0.5295762",
"0.5294509",
"0.5273699",
"0.5264613",
"0.5262042",
"0.5256307",
"0.52530974"... | 0.5964544 | 0 |
Is the session ending? | public function isEnding()
{
return $this->session->expiring();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sessions_end()\n\t{\n\t\t// nothing to see here\n\t}",
"public static function sessionClose()\n {\n return true;\n }",
"public static function afnSessionStop()\n {\n @session_unset();\n @session_destroy();\n return true;\n }",
"public function logout()\... | [
"0.7965865",
"0.76960903",
"0.7401781",
"0.73459166",
"0.71515185",
"0.71076417",
"0.70544535",
"0.7033305",
"0.70268667",
"0.7003383",
"0.6970757",
"0.6925148",
"0.6842896",
"0.68338794",
"0.683221",
"0.6814471",
"0.68008876",
"0.67978567",
"0.67450947",
"0.673175",
"0.67193... | 0.871339 | 0 |
Tests if the event is checked out | function isCheckedOut( $uid=0 )
{
if ($this->_loadData())
{
if ($uid) {
return ($this->_data->checked_out && $this->_data->checked_out != $uid);
} else {
return $this->_data->checked_out;
}
} elseif ($this->_id < 1) {
return false;
} else {
JError::raiseWarning( 0, 'Unable to Load Data');
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }",
"function checkin()\r\n\t{\r\n\t\tif ($this->_id)\r\n\t\t{\r\n\t\t\t$event = & JTable::getInstance('eventlist_events', '');\r\n\t\t\treturn $event->checkin($this->_id);\r\n\t\t}\r\n\t\tretu... | [
"0.64039415",
"0.6395539",
"0.6377019",
"0.6163626",
"0.6108217",
"0.5880456",
"0.58639574",
"0.5807477",
"0.57964987",
"0.5790323",
"0.5733801",
"0.5634129",
"0.56307447",
"0.56082547",
"0.55301434",
"0.55096173",
"0.5508735",
"0.549131",
"0.5482167",
"0.5473836",
"0.5452035... | 0.6438064 | 0 |
Registers a new submenu page | function add_menu_subpage(){
add_submenu_page(
'wpex-general',
__( 'General', 'athen_transl' ),
__( 'General', 'athen_transl' ),
'manage_options',
ATHEN_THEME_PANEL_SLUG,
array( $this, 'create_admin_page' )
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function add_page() {\n\t\tadd_submenu_page(\n\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\t'administrator',\n\t\t\tWPEX_THEME_PANEL_SLUG . '-under-construction',\n\t\t\tarray( 'WPEX_Under_Construction', 'cr... | [
"0.7796628",
"0.7624312",
"0.7592035",
"0.75650054",
"0.74934274",
"0.7492506",
"0.7465937",
"0.7461963",
"0.74529606",
"0.7447358",
"0.7404587",
"0.73857015",
"0.7372055",
"0.73425573",
"0.73236275",
"0.7304584",
"0.7304443",
"0.72829694",
"0.7274513",
"0.72219056",
"0.72173... | 0.7860317 | 0 |
Fonction createPost avec livewire | public function createPost()
{
$this->validate(['body' => 'required|min:15']);
$post = auth()->user()->posts()->create(['body' => $this->body]);
$this->emit('postAdded', $post->id); //emit de l'event
$this->body = ""; //vidage du body
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function CrearPost(){\n\n\n }",
"public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $th... | [
"0.738942",
"0.7039857",
"0.68104506",
"0.6791263",
"0.67362994",
"0.67085475",
"0.6657472",
"0.66420287",
"0.66184336",
"0.66146517",
"0.66137683",
"0.6607518",
"0.6598134",
"0.6596656",
"0.6584335",
"0.6580934",
"0.65526885",
"0.65375274",
"0.65375274",
"0.65375274",
"0.652... | 0.7189276 | 1 |
/ This function is called on end of script execution to cancel all aborted transactions (if any) | function cancel_transaction()
{
global $transaction_level;
if ($transaction_level) {
db_query("ROLLBACK", "could not cancel a transaction");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cancel()\n {\n $this->_statement =null;\n }",
"function abort() {\n $this->aborted = TRUE;\n }",
"public function rollbackTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('ROLLBACK TRANSACTION');\r\n\t}",
"public function cancel()\n\t{\n\t\t$... | [
"0.66715395",
"0.6633",
"0.6581906",
"0.6556029",
"0.651938",
"0.6457377",
"0.64570516",
"0.6454393",
"0.64411104",
"0.638902",
"0.63374186",
"0.62721604",
"0.62634933",
"0.62581587",
"0.6200545",
"0.6199904",
"0.6167491",
"0.61636937",
"0.6160573",
"0.6159313",
"0.6150514",
... | 0.68961 | 0 |
Sets a new entityKeyPrefix | public function setEntityKeyPrefix($entityKeyPrefix)
{
$this->entityKeyPrefix = $entityKeyPrefix;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function prefixKey($prefix);",
"public function setKeyPrefix($prefix)\n\t{\n\t\t$this->_redisKeyPrefix = $prefix;\n\t}",
"public function setPrefix($prefix)\n {\n $this->idPrefix = $prefix;\n }",
"public function setPrefix($prefix)\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$this->id_pr... | [
"0.69170266",
"0.6827639",
"0.6752836",
"0.6727159",
"0.6696086",
"0.66696656",
"0.6625726",
"0.6598669",
"0.63972265",
"0.63609684",
"0.635862",
"0.6340957",
"0.6340455",
"0.62784034",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.619... | 0.81922144 | 0 |
Sets a new entityType | public function setEntityType($entityType)
{
$this->entityType = $entityType;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setType(EntityType $type);",
"public function setMappedEntityType($entity_type);",
"public function setEntityType($var)\n {\n GPBUtil::checkString($var, True);\n $this->entity_type = $var;\n\n return $this;\n }",
"public function getEntityType() {\n return $this-... | [
"0.7705399",
"0.6784407",
"0.64521676",
"0.631977",
"0.63128513",
"0.62907165",
"0.6183195",
"0.61203974",
"0.60822463",
"0.6041833",
"0.6012842",
"0.5932546",
"0.59062904",
"0.58379114",
"0.58357686",
"0.58011335",
"0.5795091",
"0.5764072",
"0.5761457",
"0.57495964",
"0.5670... | 0.7270525 | 1 |
Update membership end date when subscription expiration date is changed | public function update_membership_end_date( $is_set, $expiration_date, $subscription_key ) {
$user_memberships = $this->get_memberships_from_subscription( $subscription_key );
if ( ! $user_memberships ) {
return;
}
foreach ( $user_memberships as $user_membership ) {
$plan_id = $user_membership->get_plan_id();
if ( $plan_id && $this->plan_grants_access_while_subscription_active( $plan_id ) ) {
$end_date = $expiration_date ? date( 'Y-m-d H:i:s', $expiration_date ) : '';
$user_membership->set_end_date( $end_date );
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renewMembership(&$user){\n\t\t$dateEnd = $user->getSetting('dateEndMembership', 0);\n\t\tif (!$dateEnd) $dateEnd = 0;\n\t\t\n\t\t// if the membership is expired, extend it to today + 1 year\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$dateEnd = mktime(23, 59, 59, date(\"m\", ... | [
"0.70345396",
"0.6584539",
"0.6440476",
"0.6289389",
"0.61278355",
"0.6068972",
"0.59100837",
"0.5908071",
"0.5857778",
"0.57571006",
"0.56894684",
"0.5610006",
"0.5559061",
"0.55220616",
"0.5509971",
"0.5506381",
"0.5491396",
"0.54852813",
"0.54703873",
"0.54534024",
"0.5452... | 0.74767065 | 0 |
Get a Subscription by order_id and product_id | public function get_order_product_subscription( $order_id, $product_id ) {
$subscription_key = WC_Subscriptions_Manager::get_subscription_key( $order_id, $product_id );
$subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key );
return $subscription;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wcs_get_subscriptions_for_product( $product_ids, $fields = 'ids' ) {\n\tglobal $wpdb;\n\n\t// If we have an array of IDs, convert them to a comma separated list and sanatise them to make sure they're all integers\n\tif ( is_array( $product_ids ) ) {\n\t\t$ids_for_query = implode( \"', '\", array_map( 'abs... | [
"0.6971286",
"0.6262788",
"0.6170137",
"0.6138212",
"0.61123526",
"0.60727227",
"0.5949016",
"0.59223175",
"0.58436775",
"0.58203864",
"0.5770421",
"0.5740939",
"0.5735021",
"0.57200074",
"0.5719754",
"0.5700169",
"0.56704336",
"0.56655544",
"0.5649731",
"0.56309545",
"0.5626... | 0.6532087 | 1 |
Get user memberships by subscription key | public function get_memberships_from_subscription( $subscription_key ) {
$user_memberships = array();
$user_membership_ids = new WP_Query( array(
'post_type' => 'wc_user_membership',
'post_status' => array_keys( wc_memberships_get_user_membership_statuses() ),
'fields' => 'ids',
'nopaging' => true,
'suppress_filters' => 1,
'meta_query' => array(
array(
'key' => '_subscription_key',
'value' => $subscription_key,
),
),
) );
if ( ! empty( $user_membership_ids->posts ) ) {
$user_memberships = array();
foreach ( $user_membership_ids->posts as $user_membership_id ) {
$user_memberships[] = wc_memberships_get_user_membership( $user_membership_id );
}
}
return $user_memberships;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getSubscription()\n {\n $members = [];\n $page = 1;\n while(count($members) > 0 || $page === 1) {\n $members = $this->mangopay->listUsers($page);\n foreach ($members as $member) {\n if ($member->Email === 'user-vip@prono-bet.com') {\n ... | [
"0.6504515",
"0.62734777",
"0.6230953",
"0.6120904",
"0.59495854",
"0.59205645",
"0.5730152",
"0.567319",
"0.5672288",
"0.5550507",
"0.55431294",
"0.55325675",
"0.55160296",
"0.5474513",
"0.54615414",
"0.54485065",
"0.54293877",
"0.54163957",
"0.54128474",
"0.5389833",
"0.533... | 0.7590308 | 0 |
Check if order contains a Subscription | protected function order_contains_subscription( $order ) {
return WC_Subscriptions_Order::order_contains_subscription( $order );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function is_subscription( $order_id ) {\n\t\treturn ( function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_is_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) ) );\n\t}",
"protected function order_contains_subscription( $order_id... | [
"0.71747226",
"0.71717185",
"0.6739315",
"0.67205507",
"0.65633047",
"0.6429702",
"0.6339807",
"0.6261275",
"0.61559397",
"0.6135418",
"0.611952",
"0.6118669",
"0.60814667",
"0.6044969",
"0.6043291",
"0.60286",
"0.6028257",
"0.6006084",
"0.59678966",
"0.59616643",
"0.5951888"... | 0.7819213 | 0 |
Get a Subscription renewal url for a Subscriptiontied Membership | public function get_subscription_renewal_url( $user_membership ) {
$subscription_key = $this->get_user_membership_subscription_key( $user_membership->get_id() );
$url = WC_Subscriptions_Renewal_Order::get_users_renewal_link( $subscription_key );
return $url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_renewal_url() {\n\t\t$renewal_url = add_query_arg(\n\t\t\tarray(\n\t\t\t\t'subscription' => $this->get_id(),\n\t\t\t\t'key' => $this->get_key(),\n\t\t\t\t'action' => 'renew',\n\t\t\t), home_url()\n\t\t);\n\n\t\treturn $renewal_url;\n\t}",
"public function new_subscription_url($... | [
"0.7509436",
"0.6820527",
"0.63464165",
"0.61982125",
"0.60496145",
"0.604195",
"0.6018879",
"0.598256",
"0.5924393",
"0.5900339",
"0.58577156",
"0.58441734",
"0.58365834",
"0.58042365",
"0.5786703",
"0.5777251",
"0.57770866",
"0.5769336",
"0.5738676",
"0.5706045",
"0.569512"... | 0.7367929 | 1 |
Get a Subscription event date or time | protected function get_subscription_event( $subscription, $event, $format = 'mysql' ) {
$date = '';
// sanity check
if ( ! is_array( $subscription ) || empty( $subscription ) ) {
return $date;
}
switch ( $event ) {
case 'end' :
case 'end_date' :
case 'expiry_date' :
$date = isset( $subscription['expiry_date'] ) ? $subscription['expiry_date'] : '';
break;
case 'trial_end' :
case 'trial_end_date' :
case 'trial_expiry_date' :
$date = isset( $subscription['trial_expiry_date'] ) ? $subscription['trial_expiry_date'] : '';
break;
}
return 'timestamp' === $format && ! empty( $date ) ? strtotime( $date ) : $date;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEventTimestamp();",
"public function getEventTime()\n {\n return $this->event_time;\n }",
"public function getEventTime()\n {\n return $this->event_time;\n }",
"public function getSubscribeDate()\n {\n return $this->subscribeDate;\n }",
"public func... | [
"0.65830815",
"0.6512927",
"0.6512927",
"0.6419624",
"0.6197726",
"0.6095644",
"0.5823512",
"0.57241666",
"0.55804104",
"0.5556832",
"0.54295284",
"0.54208565",
"0.5419405",
"0.5419405",
"0.5419405",
"0.54192126",
"0.5415985",
"0.5409596",
"0.5400543",
"0.53901464",
"0.539014... | 0.668442 | 0 |
Infers the $this>className based on $this>attributeName. Will try to guess the appropriate class by singularizing and uppercasing $this>attributeName. | protected function setInferredClassName()
{
$singularize = ($this instanceOf HasMany ? true : false);
$this->setClassName(\ChickenTools\Str::classify($this->attributeName, $singularize));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function reworkClassName() {\n $className = $this->className;\n\n if ( (is_array($className) && (count($className) == 0)) || (is_string($className) && (strlen($className) == 0)) ) {\n $this->className = array();\n return;\n }\n\n $arr = self::goodSplit($className, '::');\n... | [
"0.61572564",
"0.6152336",
"0.5693837",
"0.55937994",
"0.53605855",
"0.5350472",
"0.533853",
"0.53346974",
"0.5283421",
"0.521665",
"0.5216016",
"0.51824164",
"0.51801217",
"0.5172149",
"0.51718843",
"0.5143842",
"0.514227",
"0.51409215",
"0.5131353",
"0.5124402",
"0.5109615"... | 0.6888032 | 0 |
fetches the team list info | public function getTeamList() {
return $this->getData('/team/list');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function team_list()\n {\n }",
"public function team_info() {\n\n $method=\"team.info\";\n $payload = array();\n $team_details = $this->apicall($method, $payload);\n $this->debug(\"team-details.log\", json_encode($team_details));\n return $team_details;\n\n }",
"public function ge... | [
"0.7134685",
"0.6676885",
"0.6662068",
"0.65972847",
"0.65259886",
"0.6419824",
"0.6387947",
"0.6385662",
"0.63537157",
"0.6350115",
"0.6341144",
"0.62110436",
"0.62058854",
"0.6135939",
"0.61335206",
"0.6123362",
"0.61066926",
"0.6099865",
"0.6001227",
"0.59856087",
"0.59597... | 0.67592037 | 1 |
fetches a list of regions for a given country OR subdivision $subdivision has a higher priority than country, if it is set, countryIdent is ignored. | public function getRegions($countryIdent = NULL, $subdivisionIdent = NULL) {
$params = '';
if (NULL !== $countryIdent) {
$params = '?land=' . $countryIdent;
}
if (NULL !== $subdivisionIdent) {
$params = '?bundesland=' . $subdivisionIdent;
}
return $this->getData('/objekt/regionen' . $params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadCountriesFromRegion($region,$companyID) {\n\tif($region) {\n\t\tglobal $trailSessionUser;\n\t\n\t\t$theUserID=0;\n\t\t//ensure $trailSessionUser is not a visitor\n\t\tif(substr($trailSessionUser,0,7)!=\"visitor\") {\n\t\t\t$theUserID=getUserID($trailSessionUser);\n\t\t}\n\t\n\t\t//get the towns first\... | [
"0.591614",
"0.588374",
"0.572429",
"0.5716984",
"0.56642544",
"0.56364155",
"0.5634883",
"0.5538464",
"0.5441478",
"0.54394996",
"0.54124194",
"0.53636754",
"0.5238547",
"0.5189449",
"0.5092153",
"0.5081505",
"0.5063675",
"0.5063472",
"0.5034281",
"0.50044245",
"0.498959",
... | 0.6667048 | 0 |
end bh products category loop add sorting scripts to footer add_action('genesis_after_footer','bh_ajax_sort_posts'); | function bh_ajax_sort_posts(){
?>
<script>
//add drop-downs to js pages
$jq('.select-post-sorting').html(
'<form action="#">Sort by:<select name="posts_sort" class="posts_sort"><option value="newest">Release Date, Newest First</option><option value="oldest">Release Date, OIdest First</option><option value="az">Product Title, A-Z</option><option value="za">Product Title, Z-A</option></select> Quantity: <select name="posts_number" class="posts_number"><option value="10">10</option><option value="15">15</option><option value="20">20</option><option value="25" selected>25</option><option value="50">50</option></select></form>'
);
//collect dropdown data
$jq('.select-post-sorting select').on('change',function(){
//get value from each box
$sortby = $jq('.posts_sort').val();
$number = $jq('.posts_number').val();
var loc = String(window.location);
$link = loc.substring(0,(loc.lastIndexOf('/')+1));
switch($sortby){
case 'oldest':
o = '?orderby=pubdate&order=ASC';
break;
case 'az':
o = '?orderby=title&order=ASC';
break;
case 'za':
o = '?orderby=title&order=DESC';
break;
default: //newest
o = '?orderby=pubdate&order=DESC';
}
if($number){
n='&ppp='+$number;
}else{
n='&ppp=25';
//default 25
}
$link = $link + o + n;
//v1 - load new page in div
$plist = $jq('.product-category.product-list');
$plist.fadeOut(300,function(){
$jq(this).load($link + ' .product-category.product-list',function(){
$plist.fadeIn(500);
// update page url/hash
if($link!=window.location){
//window.history.pushState({path:$link},'',$link);
} // if new url doesn't match current location
}); //end load
}); //end fade
}); //end jq
</script>
<?php
//v2 - use admin-ajax
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jigoshop_categories_scripts () {\n\t\n\tif( !isset($_GET['taxonomy']) || $_GET['taxonomy'] !== 'product_cat') return;\n\t\n\twp_register_script('jigoshop-categories-ordering', jigoshop::plugin_url() . '/assets/js/categories-ordering.js', array('jquery-ui-sortable'));\n\twp_print_scripts('jigoshop-categori... | [
"0.7241142",
"0.6526731",
"0.6444402",
"0.6413683",
"0.6400463",
"0.63700396",
"0.6369376",
"0.6338886",
"0.630546",
"0.6296617",
"0.6249045",
"0.6207119",
"0.61928964",
"0.61739033",
"0.61543816",
"0.61080056",
"0.6093143",
"0.6033762",
"0.6032027",
"0.6030236",
"0.60086805"... | 0.71792096 | 1 |
Insert DropLoader link above the imagelist on the imagetab | function abl_droploader_image_ui($event, $step) {
$content = '<div class="abl-droploader-file-uploader">
<a id="abl-droploader-open" class="abl-droploader-open txp-button" href="#" title="' . gTxt('abl_droploader_open_title') . '">' . gTxt('abl_droploader_open') . '</a>
</div>';
return $content.n;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function abl_droploader_article_ui($event, $step, $data) {\n\t\t$content = '\n<ul class=\"abl_droploader plain-list\">\n<li><a id=\"abl-droploader-open\" class=\"abl-droploader-open\" href=\"#\" title=\"' . gTxt('abl_droploader_open_title') . '\">' . gTxt('abl_droploader_open') . '</a></li>\n</ul>';\n\t\tif (is_ca... | [
"0.5821236",
"0.5731083",
"0.5348935",
"0.52925766",
"0.5190834",
"0.5184053",
"0.5172822",
"0.5155723",
"0.50927645",
"0.50896585",
"0.5076415",
"0.50673866",
"0.5060036",
"0.5054299",
"0.50460917",
"0.5045767",
"0.5042095",
"0.5017115",
"0.50115144",
"0.5004158",
"0.4980735... | 0.61316556 | 0 |
get image categoryselector form element | function abl_droploader_get_image_cat_select() {
$image_categories = getTree('root', 'image');
//$image_categories_select = str_ireplace("\n", '', tag('<label for="image-category">' . gTxt('image_category') . '</label>' . br .
// treeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' id="abl-droploader-image-cat-sel" class="category"'));
//$alt_caption = tag('<label for="alt-text">'.gTxt('alt_text').'</label>'.br.
// fInput('text', 'alt', '', 'edit', '', '', 50, '', 'alt-text'), 'div', ' class="alt text"').
// tag('<label for="caption">'.gTxt('caption').'</label>'.br.
// '<textarea id="caption" name="caption"></textarea>'
// , 'div', ' class="caption description text"');
$image_categories_select = str_ireplace("\n", '', tag(tag('<label for="image-category">'.gTxt('image_category').'</label>'.br.
treeSelectInput('category', $image_categories, '', 'image-category'), 'div', ' class="category"'), 'div', ' id="abl-droploader-image-cat-sel"'));
return $image_categories_select;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOptionCategoryImage()\n {\n return $this->optionCategoryImage;\n }",
"function add_category_image ( $taxonomy ) { ?>\n <div class=\"form-field term-group\">\n <label for=\"category-image-id\"><?php _e('Image', 'hero-theme'); ?></label>\n <input type=\"hidden\" id=\"ca... | [
"0.62970215",
"0.62586004",
"0.6227012",
"0.57733345",
"0.56803226",
"0.56673837",
"0.5647469",
"0.5637749",
"0.5631106",
"0.56053597",
"0.55868727",
"0.55862486",
"0.55563235",
"0.55137765",
"0.5445103",
"0.54429305",
"0.5440785",
"0.5428641",
"0.54227984",
"0.53898305",
"0.... | 0.7250795 | 0 |
image_uploaded callback (txp_image.php) return JSON (imageid) and exit | function abl_droploader_image_uploaded($event, $step, $id) {
if (ps('abl_droploader') == '') return;
$response = array(
'status' => 1,
'image_id' => $id,
);
echo json_encode($response);
exit;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _imgUpload(){\r\n\r\n\r\n\r\n // It will always be called via ajax so we will respond as such\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r... | [
"0.6914485",
"0.65540594",
"0.64273363",
"0.633404",
"0.62768304",
"0.62700474",
"0.6246787",
"0.6237996",
"0.6179238",
"0.6125587",
"0.61215407",
"0.60871947",
"0.6084634",
"0.6075415",
"0.60514855",
"0.6032719",
"0.6007915",
"0.6007191",
"0.5999424",
"0.5979448",
"0.5961162... | 0.67073905 | 1 |
Filter the HTML script tag of `fontawesome` script to add `defer` attribute. | function add_defer_attribute( $tag, $handle ) {
if ( 'font-awesome' === $handle ) {
$tag = str_replace( ' src', ' defer src', $tag );
}
return $tag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filter_script_loader_tag( $tag, $handle ) {\n foreach ( [ 'async', 'defer' ] as $attr ) {\n if ( ! wp_scripts()->get_data( $handle, $attr ) ) {\n continue;\n }\n // Prevent adding attribute when already added in #12009.\n if ( ! preg_match( \":\\s$attr(=|>|\\s):\"... | [
"0.7237725",
"0.6505373",
"0.6418179",
"0.6246111",
"0.59877104",
"0.59083897",
"0.5795956",
"0.5675229",
"0.5587274",
"0.54035765",
"0.53767705",
"0.53493905",
"0.5349385",
"0.5293278",
"0.52620023",
"0.52599305",
"0.5229869",
"0.5225538",
"0.52089006",
"0.5190596",
"0.51886... | 0.7009983 | 1 |
Add support for custom color palettes in Gutenberg. | function tewwie_gutenberg_color_palette() {
add_theme_support(
'editor-color-palette', array(
array(
'name' => esc_html__( 'Primary', '@@textdomain' ),
'slug' => 'primary',
'color' => 'rgb(94, 114, 228)',
),
array(
'name' => esc_html__( 'Secondary', '@@textdomain' ),
'slug' => 'secondary',
'color' => 'rgb(245, 54, 92)',
),
array(
'name' => esc_html__( 'Green', '@@textdomain' ),
'slug' => 'green',
'color' => 'rgb(67, 170, 139)',
),
array(
'name' => esc_html__( 'Dark Grey', '@@textdomain' ),
'slug' => 'dark-grey',
'color' => 'rgb(68,68,68)',
)
)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hotel_lux_gutenberg_support() {\r\n\t$colors = cmsmasters_color_picker_palettes();\r\n\t\r\n\t$color_palette = array();\r\n\t\r\n\t\r\n\tforeach ($colors as $color) {\r\n\t\t$color_palette[] = array(\r\n\t\t\t'color' => $color,\r\n\t\t);\r\n\t}\r\n\t\r\n\t\r\n\tadd_theme_support('editor-color-palette', $c... | [
"0.72150284",
"0.69665104",
"0.6926205",
"0.64307857",
"0.614706",
"0.6119006",
"0.61009115",
"0.60835445",
"0.60757315",
"0.60445267",
"0.60401005",
"0.6023986",
"0.60196173",
"0.5969022",
"0.5923433",
"0.586679",
"0.5779214",
"0.5763321",
"0.57502395",
"0.5736252",
"0.57309... | 0.7064425 | 1 |
Remove page templates inherited from the parent theme. | function child_theme_remove_page_template( $page_templates ) {
unset( $page_templates['page-templates/blank.php'],$page_templates['page-templates/empty.php'], $page_templates['page-templates/fullwidthpage.php'], $page_templates['page-templates/left-sidebarpage.php'], $page_templates['page-templates/both-sidebarspage.php'] );
return $page_templates;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function be_remove_genesis_page_templates( $page_templates ) {\n\tunset( $page_templates['page_archive.php'] );\n\tunset( $page_templates['page_blog.php'] );\n\treturn $page_templates;\n}",
"function wmf_undo_redirect_template_changes_in_admin() {\n\tremove_filter( 'page_link', 'wmf_skip_redirect_template_in_pag... | [
"0.702426",
"0.65037644",
"0.64131457",
"0.6406326",
"0.6262876",
"0.62376744",
"0.61424834",
"0.6110962",
"0.61082923",
"0.6108143",
"0.6036941",
"0.60307467",
"0.602198",
"0.5971363",
"0.59237164",
"0.58937496",
"0.5886289",
"0.5847543",
"0.58383566",
"0.5826905",
"0.580675... | 0.7632337 | 0 |
Display only sticky posts | function be_display_only_sticky_posts( $args, $atts ) {
$sticky_variations = array( 'sticky_posts', 'sticky-posts', 'sticky posts' );
if( !empty( $atts['id'] ) && in_array( $atts['id'], $sticky_variations ) ) {
$sticky_posts = get_option( 'sticky_posts' );
$args['post__in'] = $sticky_posts;
}
if( !empty( $atts['exclude'] ) && in_array( $atts['exclude'], $sticky_variations ) ) {
$sticky_posts = get_option( 'sticky_posts' );
$args['post__not_in'] = $sticky_posts;
}
return $args;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onlyStickyPosts()\r\n{\r\n\t$sticky = get_option('sticky_posts');\r\n\t// check if there are any\r\n\tif (!empty($sticky)) {\r\n\t\t// optional: sort the newest IDs first\r\n\t\trsort($sticky);\r\n\t\t// override the query\r\n\t\t$args = array(\r\n\t\t\t'post__in' => $sticky\r\n\t\t);\r\n\t\tquery_posts($... | [
"0.7932049",
"0.7375507",
"0.7180215",
"0.7099434",
"0.683806",
"0.67774963",
"0.6630844",
"0.65019584",
"0.6468794",
"0.6466884",
"0.640469",
"0.6374649",
"0.6162739",
"0.6154045",
"0.6144017",
"0.60648507",
"0.6064456",
"0.60457355",
"0.5959761",
"0.59366274",
"0.5935665",
... | 0.76922 | 1 |
/ Test create consignee with incorrect parameters | public function testCreateConsigneeWithIncorrectParameters() {
$this->expectException( WebException::class);
// Give wrong/missing parameters to provoke an error response
$builder = new ConsigneeBuilder();
$consignee = $builder->build();
$this->api->createConsignee( $consignee );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testQuarantineCreate()\n {\n\n }",
"public function testCannotBeCreatedFromInvalidEmailAddress()\n {\n\n }",
"function testCreate() {\n # fails due to not verified...\n $this->aRequest['email'] = 'unverified@example.com';\n $this->assertFalse($this->oObject->create());\n\n #... | [
"0.6802849",
"0.6537524",
"0.64769465",
"0.64532065",
"0.6296269",
"0.61695564",
"0.6125048",
"0.6089019",
"0.60516536",
"0.602815",
"0.6021496",
"0.5986568",
"0.59795356",
"0.5977144",
"0.5974034",
"0.5964491",
"0.5945142",
"0.5940745",
"0.59194815",
"0.5912024",
"0.5876557"... | 0.7950649 | 0 |
Get a new identifier | public function newIdentifier(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNewId();",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public fu... | [
"0.80312693",
"0.8014722",
"0.8014218",
"0.8014218",
"0.8014218",
"0.8014218",
"0.8014218",
"0.80135",
"0.80135",
"0.7998252",
"0.7998252",
"0.7998252",
"0.7998252",
"0.7998252",
"0.7998252",
"0.7998252",
"0.7998252",
"0.7998252",
"0.7962092",
"0.7954783",
"0.7890156",
"0.7... | 0.84006816 | 0 |
Add a version Mark this version as upgrade | public function add(string $version); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_version() {\n $installed = get_option( 'wd_academy_installed' );\n if ( $installed ) {\n update_option( 'wd_academy_installed', time() );\n }\n update_option( 'wd_academy_version', WD_ACADEMY_VERSION );\n }",
"public function upgrade () {\r\n }",
... | [
"0.6990274",
"0.6209433",
"0.6165426",
"0.6125037",
"0.6125037",
"0.60869944",
"0.6077672",
"0.60432667",
"0.60432667",
"0.60432667",
"0.60432667",
"0.60432667",
"0.5943941",
"0.5942448",
"0.592736",
"0.5889506",
"0.5815514",
"0.5784992",
"0.5761434",
"0.57479626",
"0.5715671... | 0.7515287 | 0 |
Remove a version Mark this version as downgrade | public function remove(string $version); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function uninstall()\n {\n\n $this->markUninstalled();\n //or call parent::uninstall(); \n }",
"function bft_remove_version() {\n\treturn '';\n}",
"function pramble_remove_version(){\n\t\t\t\treturn '';\n\t\t\t}",
"public function uninstall();",
"public function uninstall();",
... | [
"0.65213996",
"0.6320239",
"0.6307188",
"0.62853426",
"0.62853426",
"0.61895514",
"0.6139495",
"0.613305",
"0.60173833",
"0.60069394",
"0.6003697",
"0.598573",
"0.5975026",
"0.59682363",
"0.59232265",
"0.5914587",
"0.59127164",
"0.59127164",
"0.591234",
"0.58904654",
"0.58347... | 0.710458 | 0 |
select db and tb | final public function select($db, $tb)
{
$this->db = $db;
$this->tb = $tb;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function select_db($dbname);",
"public function pick_db($db)\n\t\t{\t$this->db = $db\n\t\t}",
"public function selectDb($dbName) {}",
"public function select($db, $dbh = \\null)\n {\n }",
"public function sql_select_db() {}",
"public function sql_select_db() {}",
"publi... | [
"0.6528299",
"0.6523396",
"0.6441326",
"0.6288948",
"0.62825274",
"0.6281867",
"0.62785035",
"0.6225119",
"0.61457175",
"0.61379474",
"0.6058814",
"0.60488206",
"0.6018403",
"0.6014407",
"0.59870315",
"0.5964312",
"0.5956833",
"0.59456414",
"0.5869428",
"0.58607244",
"0.57583... | 0.7610733 | 0 |
Return an instance of DOMDocument constructed with the property of results | protected function getDom()
{
if (! isset($this->dom)) {
$dom = new DOMDocument();
if (is_null($this->getResults())) {
throw new \RuntimeException('There doesnt appear to be any results to load');
}
// suppress warning but throw Exception
if (! @$dom->loadXML($this->getResults())) {
throw new \RuntimeException('Could not load results into DOMDocument');
}
$this->dom = $dom;
}
return $this->dom;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function createDomDocument()\n {\n $document = new DOMDocument('1.0', 'utf-8');\n $document->preserveWhiteSpace = false;\n $document->formatOutput = true;\n\n return $document;\n }",
"private static function createDomDocument()\n {\n $document = new DOMD... | [
"0.6937923",
"0.6937923",
"0.68195045",
"0.67717385",
"0.66584253",
"0.659529",
"0.65547985",
"0.6502658",
"0.64987546",
"0.6346673",
"0.6260541",
"0.61434364",
"0.6108336",
"0.6086359",
"0.6032171",
"0.6025498",
"0.59359473",
"0.58533907",
"0.5848541",
"0.58449787",
"0.58419... | 0.7134096 | 0 |
Return the XPath query string used to retrieved result class DOMNodes Template method. Calls for domListQuery which should be defined in subclasses from the DOMDocument | protected function getDomListQuery()
{
return $this->domListQuery;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createQuery() {\n return new XML\\DOM();\n }",
"private function generateXpathQuery() {\n $parentElementClass = trim(Settings::get(\"main_class\"), \".\");\n $excludeProcessingClass = trim(Settings::get(\"exclude_class\"), \".\");\n\n $xQuery = \"\";\n ... | [
"0.6341028",
"0.6320869",
"0.58280796",
"0.56859773",
"0.56746715",
"0.565675",
"0.55895334",
"0.54552805",
"0.54449564",
"0.5404445",
"0.5340602",
"0.5239214",
"0.521587",
"0.5182041",
"0.517856",
"0.5127131",
"0.5105987",
"0.5102869",
"0.5070465",
"0.5064086",
"0.50508446",... | 0.66692346 | 0 |
Return a DateTime instance containing the created attribute of the DOMDocument as returned from the web service | public function getCreated()
{
if (! isset($this->created)) {
$this->created = new DateTime($this->getXPath($this->getDom())->query($this->getCreatedQuery())->item(0)->value);
}
return $this->created;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDate()\n {\n $yearconst = $this->getValue(self::XPATH_YEAR);\n $monthconst = $this->getValue(self::XPATH_MONTH);\n $dayconst = $this->getValue(self::XPATH_DAY);\n\n return $this->formateDate($yearconst, $monthconst, $dayconst);\n }",
"public function getDateCr... | [
"0.67757446",
"0.6628347",
"0.6293689",
"0.6265451",
"0.6250675",
"0.6211613",
"0.6206654",
"0.6206654",
"0.6206654",
"0.6206654",
"0.6206654",
"0.6206654",
"0.6206654",
"0.6206654",
"0.6135572",
"0.61332995",
"0.610985",
"0.61069834",
"0.60814273",
"0.60775733",
"0.6069899",... | 0.747618 | 0 |
Return the DOMXPath query string use to retrieve the ResultSet offset property | protected function getOffsetQuery()
{
return $this->offsetQuery;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function offsetGet($offset) \n\t{\n if($this->doc && $this->doc[$offset]->length > 0) return $this->doc[$offset];\n\t\telse return phpQuery::newDocument();\n }",
"public function getOffset()\n {\n if (! isset($this->offset)) {\n $this->offset = (int)$this->getXPath($this->ge... | [
"0.5891331",
"0.5858565",
"0.57634467",
"0.5634551",
"0.5543583",
"0.54944134",
"0.54081166",
"0.53653616",
"0.53576374",
"0.529386",
"0.52843153",
"0.518309",
"0.5145246",
"0.5143747",
"0.5102981",
"0.507216",
"0.5064272",
"0.500201",
"0.4991872",
"0.49641213",
"0.4947015",
... | 0.62557465 | 0 |
Return an instance of XmlFactory | protected function getFactory()
{
if (! isset($this->factory)) {
$this->factory = new \MphpMusicBrainz\Adapter\Xml\XmlFactory();
}
return $this->factory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFactory()\n {\n return new Factory();\n }",
"public function getFactory() {}",
"public function getFactory(): Factory;",
"public static function factory()\n {\n return new self;\n }",
"public static function factory()\r\n {\r\n return parent::factory(... | [
"0.68133634",
"0.6687715",
"0.6544517",
"0.65268314",
"0.65139043",
"0.650521",
"0.64808017",
"0.6466598",
"0.64327395",
"0.6400517",
"0.63851243",
"0.6369048",
"0.6369048",
"0.6369048",
"0.6369048",
"0.6369048",
"0.6369048",
"0.6369048",
"0.6369048",
"0.6298765",
"0.6278735"... | 0.84304833 | 0 |
ANTI XSS & SQL INJECTION// | function antiinjection($data){
$filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)));
return $filter_sql;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sqlInjections($data){\n\t$value1=mysqli_real_escape_string($GLOBALS['link'],$data);\n\t$value1=trim($value1);\n\treturn $value1;\n\t}",
"function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}",
"public function anti_injection($... | [
"0.6846932",
"0.6671799",
"0.66669977",
"0.6589908",
"0.658406",
"0.65651757",
"0.65582883",
"0.65257055",
"0.6510999",
"0.65039515",
"0.6479666",
"0.6462158",
"0.6458724",
"0.64330816",
"0.6429838",
"0.64138585",
"0.64120257",
"0.63999945",
"0.6394304",
"0.63847834",
"0.6372... | 0.7492571 | 0 |
get restaurant id from reservation objec loop all reservation managers for the found restaurant send email to reservation managers | public function sendReservationWasCreatedToReservationManagersByEmail(Reservation $reservation)
{
// Customer Basic Info
$customer = $reservation->user->toArray();
// Loop and send to Reservation Managers
foreach ($this->reservation_managers as $manager) {
Mail::send(
'emails/cart/admin/pending',
[
'user' => $manager,
'reservation' => $reservation,
'customer' => $customer
],
function ($message) use ($manager) {
$message->from('sales@howtheyrate.net', trans('HTR Sales!'));
$message->to($manager->email, $manager->name)->subject(trans('Reservation is Pending'));
}
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function confirm_reservations($id) {\n global $DB;\n\n $reservation = $DB->get_record('roomscheduler_reservations', array('id' => $id));\n\n $reservations = $DB->get_records('roomscheduler_reservations', array('recurrence_id'=>$reservation->recurrence_id,'location'=>$reservation->location));\n \n fo... | [
"0.588065",
"0.57398707",
"0.55826837",
"0.55086607",
"0.5463044",
"0.5441211",
"0.5418472",
"0.5410198",
"0.5404332",
"0.5390521",
"0.53864413",
"0.53753436",
"0.53495204",
"0.53312933",
"0.5284397",
"0.5262806",
"0.5259282",
"0.52040493",
"0.51934665",
"0.51905113",
"0.5158... | 0.6470802 | 0 |
Truncate data in table before alter his structure | public function truncateTable() {
Schema::disableForeignKeyConstraints();
DB::table('questions')->truncate();
DB::table('answers')->truncate();
Schema::enableForeignKeyConstraints();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function truncate()\n {\n // Désactivation des contraintes FK\n $this->co->executeQuery('SET foreign_key_checks = 0');\n // On tronque\n $this->co->executeQuery('TRUNCATE TABLE casting');\n $this->co->executeQuery('TRUNCATE TABLE department');\n $this->co->execu... | [
"0.7778109",
"0.7232321",
"0.72232217",
"0.7217286",
"0.7166768",
"0.7090838",
"0.7081197",
"0.6998966",
"0.69685507",
"0.69621325",
"0.6954953",
"0.6933242",
"0.6917339",
"0.68343383",
"0.6774539",
"0.6695984",
"0.6688773",
"0.6658805",
"0.6617286",
"0.65879977",
"0.6577454"... | 0.7258272 | 1 |
This method is used on contructor to check if each given item can be contained in the container. When this method returns 'false', then an invalid argument exception is throwed. Its default implemantation always returns 'true', but the child classes can reimplement it to keep the container consistency. | protected function canContain($item): bool
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function contains(...$items) : bool;",
"public function inListForItemContainedReturnsTrueDataProvider() {}",
"public function contains(self $item, $checkAgainstThis = true) {}",
"public function has_items()\n {\n }",
"public function inListForItemNotContainedReturnsFalseDataProvider() ... | [
"0.63054496",
"0.61064714",
"0.60920185",
"0.59744334",
"0.5972856",
"0.59413624",
"0.5938047",
"0.5869159",
"0.5851113",
"0.5845355",
"0.5845355",
"0.57907116",
"0.5750357",
"0.57077146",
"0.5680839",
"0.5672905",
"0.56706405",
"0.56604517",
"0.56485707",
"0.5625417",
"0.560... | 0.66998434 | 0 |
The string returned by this method is used to create the invalid argument exception throwed when a given item can not be contained in container. | protected function itemCanNotBeContainedExceptionMessage(string $label): string
{
return "The item '$label' can not be contained in this container";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function beginsWithReturnsInvalidArgumentDataProvider() {}",
"protected function throwInterfaceException(){\n throw new InvalidArgumentException('Invalid $interface argument type : expected string or array of strings');\n }",
"protected function throwTraitException(){\n throw new Invali... | [
"0.5872395",
"0.56960976",
"0.55896795",
"0.557091",
"0.55615705",
"0.5440138",
"0.5365426",
"0.5255015",
"0.5248033",
"0.522471",
"0.5221725",
"0.51909983",
"0.51804",
"0.51517254",
"0.5129337",
"0.51230407",
"0.510752",
"0.5096554",
"0.5096224",
"0.5089041",
"0.50584525",
... | 0.6114548 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.