query stringlengths 7 5.25k | document stringlengths 15 1.06M | metadata dict | negatives listlengths 3 101 | negative_scores listlengths 3 101 | document_score stringlengths 3 10 | document_rank stringclasses 102 values |
|---|---|---|---|---|---|---|
Check that the language used by the application is at the required version. | public function language(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function checkIfLanguagesExist() {}",
"public function appLanguageVersion() {\n // get version\n $this->loadModel('Versions');\n $version = $this->Versions->findAppLanguageVersion();\n\n // get language\n $this->loadModel('AppLanguages');\n $arrayLanguages = $t... | [
"0.7021248",
"0.65808654",
"0.65651554",
"0.64186203",
"0.6378637",
"0.6366941",
"0.63584083",
"0.6309358",
"0.62619865",
"0.62583864",
"0.6251327",
"0.62208813",
"0.6188067",
"0.61478674",
"0.6139712",
"0.6139004",
"0.61294913",
"0.61153954",
"0.61045176",
"0.61017513",
"0.6... | 0.0 | -1 |
Check for the required extensions. | public function extensions(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkExtensions()\n {\n $extensions = array(\n 'fileinfo',\n 'pdo',\n 'mbstring',\n 'tokenizer',\n 'openssl',\n 'json',\n 'curl',\n 'xml'\n );\n\n $results = array();\n\n foreach (... | [
"0.8116604",
"0.7901163",
"0.7873443",
"0.78547615",
"0.77574605",
"0.7597541",
"0.7415215",
"0.7384415",
"0.7373312",
"0.73700166",
"0.7320419",
"0.71613866",
"0.70539176",
"0.7036733",
"0.7033759",
"0.7022527",
"0.6991644",
"0.698146",
"0.6974277",
"0.6974277",
"0.69378865"... | 0.5955151 | 92 |
currently client can not send any data. | public function onData($data, $client)
{
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function send() {\n if (!$this->client) {\n return false;\n }\n }",
"protected function send() {}",
"abstract function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
... | [
"0.7309382",
"0.70066345",
"0.6972947",
"0.6862657",
"0.6862657",
"0.6862657",
"0.6862657",
"0.6862657",
"0.6862657",
"0.6862657",
"0.6862657",
"0.6862657",
"0.6862657",
"0.6862657",
"0.68433714",
"0.68096477",
"0.68096477",
"0.68096477",
"0.68096477",
"0.68096477",
"0.670574... | 0.0 | -1 |
Display a listing of the resource. | public function index($id)
{
$mainshedule = newschedule::where('newschedules_id', $id)->get();
$mainGantt = Gantt::all();
return view('configurator.fleetschedule',['id' => $id], compact('mainGantt', 'mainshedule'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.75936973",
"0.75936973",
"0.7585464",
"0.7576766",
"0.7571166",
"0.7498768",
"0.7434969",
"0.7432511",
"0.7387868",
"0.7351811",
"0.7336364",
"0.73113805",
"0.7293885",
"0.72812635",
"0.7273037",
"0.72410345",
"0.7228987",
"0.7225174",
"0.718589",
"0.71786976",
"0.7172516"... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
$link = new Link();
$newschedule = newschedule::all();
foreach ($newschedule as $que) {
$task = new Task();
$task->text = 'Рейс ' . $que['number'] . ' действителен c ' . $que['beginning'] . ' - ' . $que['ending'] . ' ' . $que['airportOfDeparture'] . ' ' . $que['airportOfArriving'];
$task->start_date = $que['beginning'];
$task->duration = '4';
$task->progress = '0';//$request->has("progress") ? $request->progress : 0;
$task->parent = '0';
//$task->text = $que['type'] . ' ' . $que['timeOfDeparture'];
//$task->parent = $que['id'];
//$task->text = $que['type'] . ' ' . $que['timeOfArriving'];
$task->gantt_id = $request->idGantt;
$task->save();
}
// foreach ($newschedule as $que) {
// $task = new Task();
//
// $task->text = $que['type'] . ' ' . $que['timeOfDeparture'];
// $task->start_date = $que['beginning'];
// $task->duration = '1';
// $task->progress = '0';//$request->has("progress") ? $request->progress : 0;
// $task->parent = $task->id;
// //$task->text = $que['type'] . ' ' . $que['timeOfDeparture'];
// //$task->parent = $que['id'];
// //$task->text = $que['type'] . ' ' . $que['timeOfArriving'];
// $task->gantt_id = $request->idGantt;
//
// $task->save();
// }
return redirect('/list/');
// $link->type = $request->type;
// $link->source = $request->source;
// $link->target = $request->target;
// $link->gantt_id = $request->idGantt;
//
// $link->save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72857565",
"0.714571",
"0.71328056",
"0.66390204",
"0.6620437",
"0.6567189",
"0.6526738",
"0.65074694",
"0.64491314",
"0.63734114",
"0.6370837",
"0.63628685",
"0.63628685",
"0.63628685",
"0.6342026",
"0.63394964",
"0.63394964",
"0.63394964",
"0.63394964",
"0.63394964",
"0.... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8232636",
"0.81890994",
"0.68296117",
"0.64987075",
"0.649589",
"0.64692974",
"0.64633286",
"0.63640857",
"0.6307513",
"0.6281809",
"0.621944",
"0.61926234",
"0.61803305",
"0.6173143",
"0.61398774",
"0.6119022",
"0.61085826",
"0.6106046",
"0.60947937",
"0.6078597",
"0.6047... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n ... | [
"0.6673811",
"0.66624975",
"0.66376764",
"0.66351163",
"0.66280866",
"0.65443397",
"0.6543099",
"0.64656305",
"0.62881804",
"0.61755043",
"0.61278707",
"0.6089098",
"0.60534257",
"0.6043048",
"0.6006416",
"0.593359",
"0.5929751",
"0.5923406",
"0.59201753",
"0.5904145",
"0.589... | 0.0 | -1 |
Check whether configuration is valid | public function verifyConfig(array $config)
{
// check for mandatory params
foreach ($this->knownConfigParams as $param) {
if (!array_key_exists($param, $config)) {
// no mandatory param provided
throw new InvalidArgumentException("Expects an array with key: '$param'");
}
}
// check for unknown params
foreach (array_keys($config) as $param) {
if (!in_array($param, $this->knownConfigParams)) {
// unknown param provided
throw new InvalidArgumentException("Unrecognized key: '$param'");
}
}
// all OK
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkConfig();",
"private function configurationChecks()\n {\n\n // Debug Check: If debug enabled, check that debug email is set\n if ($this->salesforceDebug && is_string($this->salesforceDebugEmail) && $this->salesforceDebugEmail != '') {\n throw new \\InvalidArgument... | [
"0.8321174",
"0.767717",
"0.7632656",
"0.7613625",
"0.7567675",
"0.7421805",
"0.73195434",
"0.72821873",
"0.72558916",
"0.7242519",
"0.7234478",
"0.715906",
"0.7116023",
"0.71115464",
"0.70899004",
"0.7025994",
"0.7003249",
"0.69695014",
"0.6945149",
"0.6907657",
"0.68839246"... | 0.0 | -1 |
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 unified user attribute based on unified attribute name | protected function getUserAttribute($attribute)
{
// do we have requested attribute?
if (isset($this->userInfo[$this->fieldsMap[$attribute]])) {
// yes, we have requested attribute
return $this->userInfo[$this->fieldsMap[$attribute]];
}
// we do not have requested attribute, just return something
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAttribute($name)\n {\n $user = $this->getUserRecord();\n if($user === false)\n return false;\n\n if(isset($user[$name]))\n return $user[$name];\n return false;\n }",
"public function getUserAttr()\n {\n return $this->UserAttr;\n }",
"public function getId... | [
"0.6732487",
"0.67118496",
"0.66759706",
"0.6352132",
"0.63333344",
"0.6241906",
"0.62288773",
"0.6212016",
"0.6210523",
"0.61787534",
"0.6169093",
"0.6156412",
"0.61411065",
"0.6109545",
"0.60890454",
"0.6085997",
"0.60473293",
"0.60297585",
"0.599938",
"0.5969465",
"0.59509... | 0.65728647 | 3 |
Return all user info available | public function getUserInfo()
{
return array(
static::ATTRIBUTE_ID => $this->getUserId(),
static::ATTRIBUTE_EMAIL => $this->getUserEmail(),
static::ATTRIBUTE_NAME => $this->getUserName(),
static::ATTRIBUTE_PAGE_URL => $this->getUserPageUrl(),
static::ATTRIBUTE_AVATAR_URL => $this->getUserAvatarUrl(),
static::ATTRIBUTE_SEX => $this->getUserSex(),
static::ATTRIBUTE_BIRTHDAY => $this->getUserBirthday(),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_all_user_info()\n {\n $query = $this->db->get('users');\n return $query->result();\n }",
"public function getUserInfo() {}",
"private function getUserInfo()\n\t{\n\t\t$user = Sentry::user();\n\t\t$result = array(\n\t\t\t'username' => $user->get('username'),\n\t\t\t'isAdm... | [
"0.81399924",
"0.79606336",
"0.78374976",
"0.7827238",
"0.78079367",
"0.77872777",
"0.7775272",
"0.7751578",
"0.76985025",
"0.76906866",
"0.7601779",
"0.7589388",
"0.7522777",
"0.7465305",
"0.7426594",
"0.7424809",
"0.7402705",
"0.7395036",
"0.738747",
"0.73867804",
"0.738177... | 0.7373256 | 22 |
Get user social id or null if it is not set | public function getUserId()
{
return $this->getUserAttribute(static::ATTRIBUTE_ID);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSocialId(): Uuid {\n\t\treturn $this->socialId;\n\t}",
"public function getUser_id()\n {\n return isset($this->user_id) ? $this->user_id : null;\n }",
"public function getUserId()\r\n\t{\r\n\t\t$user = parent::getUser();\r\n\t\tif(!($user instanceof User))\r\n\t\t{\r\n\t\t\tretu... | [
"0.73893046",
"0.7262947",
"0.70886433",
"0.70082384",
"0.69774115",
"0.69473016",
"0.6913323",
"0.6885049",
"0.6857952",
"0.6850451",
"0.684587",
"0.6838322",
"0.6746954",
"0.6733413",
"0.67274886",
"0.6726086",
"0.671502",
"0.67052805",
"0.6704902",
"0.6682006",
"0.66754127... | 0.0 | -1 |
Get user email or null if it is not set | public function getUserEmail()
{
return $this->getUserAttribute(static::ATTRIBUTE_EMAIL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEmail() {\r\n\t\t\t$email = null;\r\n\t\t\tif( $user != null ) {\r\n\t\t\t\t$email = $user->getEmail();\r\n\t\t\t}\r\n\t\t\treturn $email;\r\n\t\t}",
"public function getEmail()\n {\n // Look for value only if not already set\n if (!isset($this->email)) {\n $us = Se... | [
"0.8397961",
"0.82463115",
"0.81660837",
"0.8137748",
"0.8045918",
"0.80221957",
"0.80181164",
"0.80104977",
"0.8009183",
"0.8008261",
"0.8008261",
"0.80042744",
"0.7983284",
"0.7983284",
"0.79805696",
"0.79805696",
"0.79805696",
"0.79805696",
"0.79805696",
"0.79805696",
"0.7... | 0.7621591 | 37 |
Get user name or null if it is not set | public function getUserName()
{
return $this->getUserAttribute(static::ATTRIBUTE_NAME);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUserName()\n {\n if (array_key_exists(\"userName\", $this->_propDict)) {\n return $this->_propDict[\"userName\"];\n } else {\n return null;\n }\n }",
"function get_user_name()\n {\n return isset($_SESSION['username']) ? $_SESSION['user... | [
"0.83176637",
"0.8163982",
"0.81516105",
"0.8139892",
"0.80432045",
"0.79979205",
"0.79851705",
"0.7879795",
"0.7879795",
"0.7879795",
"0.78723836",
"0.7862283",
"0.7861708",
"0.786052",
"0.78291756",
"0.7795948",
"0.77762973",
"0.7747659",
"0.7697129",
"0.76923704",
"0.76834... | 0.7345937 | 63 |
Get user social page url or null if it is not set | public function getUserPageUrl()
{
return $this->getUserAttribute(static::ATTRIBUTE_PAGE_URL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSocialPage()\n {\n $result = null;\n if (isset($this->userInfo['screen_name'])) {\n $result = 'http://vk.com/' . $this->userInfo['screen_name'];\n }\n return $result;\n }",
"public function getSocialUrl(): string {\n\t\treturn ($this->socialUrl);\n\... | [
"0.7830812",
"0.7291481",
"0.6710422",
"0.6585223",
"0.6455965",
"0.6424321",
"0.64123684",
"0.6377663",
"0.63366735",
"0.6283951",
"0.62809014",
"0.61773324",
"0.6171965",
"0.6130776",
"0.610084",
"0.6082877",
"0.59831244",
"0.5960559",
"0.595489",
"0.59398514",
"0.58958584"... | 0.6958454 | 2 |
Get url of user's avatar or null if it is not set | public function getUserAvatarUrl()
{
return $this->getUserAttribute(static::ATTRIBUTE_AVATAR_URL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function AvatarURL() {\n\t\t\n\t\tif (!empty($this->profil)) {\n\t\t\t\n\t\t\treturn $this->profil['user']['avatar150'];\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function getAvatarUrlAttribute(): ?string\n {\n return $this->avatar()->exists() ? $this->avatar->url : null;\n }",
"protect... | [
"0.8325968",
"0.8106889",
"0.770614",
"0.77053094",
"0.76909536",
"0.76909536",
"0.7686753",
"0.76304084",
"0.76304084",
"0.7567911",
"0.7525242",
"0.7480854",
"0.74695784",
"0.74043787",
"0.7402077",
"0.73952687",
"0.73800653",
"0.73449355",
"0.7339244",
"0.7324274",
"0.7312... | 0.8016835 | 2 |
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 userfriendly name of the provider | public function getName($provider = null)
{
$provider = empty($provider) ? $this->provider : $provider;
return array_key_exists($provider, static::$providers) ? static::$providers[$provider] : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getProviderName();",
"public function getProviderName();",
"public function getProviderName();",
"public function getProviderName()\n\t{\n\t\treturn ($this->provider != NULL) ? $this->provider->getName() : NULL;\n\t}",
"public function getProviderName(): string\n {\n return $this-... | [
"0.85860145",
"0.85860145",
"0.85860145",
"0.7950859",
"0.7944409",
"0.7939616",
"0.77767116",
"0.7401992",
"0.7355963",
"0.73398817",
"0.7236504",
"0.7126173",
"0.7097952",
"0.70698315",
"0.7067926",
"0.7067328",
"0.6988047",
"0.6962606",
"0.6920967",
"0.691212",
"0.68840116... | 0.68627405 | 21 |
Return name of parameter which service returns | public function getResponseType()
{
return $this->responseType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParameterName();",
"private function getNamedParam()\n {\n return self::BINDING_PREFIX . $this->getLetterBinding();\n }",
"public function getParameterName()\n {\n return $this->parameterName;\n }",
"public function getParameterName(): string\n {\n retur... | [
"0.7640029",
"0.7356018",
"0.7206104",
"0.71635526",
"0.70573443",
"0.67864513",
"0.6783879",
"0.66880584",
"0.6638111",
"0.6614838",
"0.6614838",
"0.6614838",
"0.6573774",
"0.6537814",
"0.6533069",
"0.64999276",
"0.6481746",
"0.64809465",
"0.6474495",
"0.6474495",
"0.6462604... | 0.0 | -1 |
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 |
Make post request and return result | protected function post($url, $params, $parse = true)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, urldecode(http_build_query($params)));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($curl);
curl_close($curl);
if ($parse) {
$result = json_decode($result, true);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function post_post()\n\t{\n\t\ttry {\n\t\t\t$results = Articles::regist( self::$_JSON );\n\t\t\t//\\Log::warning(print_r($results, true));\n\n\t\t\treturn $this->response($results, 200);\n\t\t} catch (\\MarcoPandaException $e) {\n\t\t\t$this->error($e);\n\t\t}\n\t}",
"public function post() {\n\t\treturn ... | [
"0.7271194",
"0.7184211",
"0.71510756",
"0.71510756",
"0.71510756",
"0.7068729",
"0.68226117",
"0.67729324",
"0.6747302",
"0.66837823",
"0.66566765",
"0.65943265",
"0.6537652",
"0.6528032",
"0.65205866",
"0.6491419",
"0.6447373",
"0.6397669",
"0.63846445",
"0.6372782",
"0.636... | 0.0 | -1 |
Make get request and return result | protected function get($url, $params, $parse = true)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url . '?' . urldecode(http_build_query($params)));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($curl);
curl_close($curl);
if ($parse) {
$result = json_decode($result, true);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get() {\n return self::call(\"GET\");\n }",
"public function get() {\n try {\n\n /**\n * Set up request method\n */\n $this->method = 'GET';\n /**\n * Process request and call for response\n */\n ... | [
"0.75161093",
"0.73780215",
"0.71908015",
"0.71778965",
"0.7122921",
"0.70723283",
"0.6969746",
"0.69367665",
"0.68779355",
"0.68628347",
"0.6840119",
"0.6815398",
"0.6811503",
"0.68036973",
"0.679793",
"0.67408484",
"0.6730184",
"0.6686879",
"0.6686879",
"0.6686879",
"0.6686... | 0.0 | -1 |
Create a Delegate object | protected function createDelegate(
callable $callback,
string $implementation = Delegate::class
): DelegateInterface {
return new $implementation($callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDelegate();",
"abstract protected function createDelegate($source, $dest);",
"public function __construct(callable $delegate)\n {\n $this->delegate = $delegate;\n }",
"private function createExtractorDelegate()\n {\n return $this->extractorDelegate ?: $this->extracto... | [
"0.74412537",
"0.7384471",
"0.6722676",
"0.6596427",
"0.61962175",
"0.6050739",
"0.57009536",
"0.54285944",
"0.51821905",
"0.5156536",
"0.5135747",
"0.5134291",
"0.51333123",
"0.51258516",
"0.51014304",
"0.504907",
"0.50425494",
"0.50001407",
"0.49962223",
"0.4962092",
"0.489... | 0.6149349 | 5 |
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 |
Get the current ServerRequestInterface object | protected function getRequest() {
return $this->request;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getCurrentRequest():ServerRequestInterface {\n return $this->requestStack->getCurrentRequest();\n }",
"protected function getRequest(): RequestInterface\n {\n return $this->request;\n }",
"public function getRequest(): RequestInterface\n {\n return $this->req... | [
"0.832709",
"0.8216281",
"0.81265247",
"0.81265247",
"0.79964876",
"0.7783456",
"0.7683295",
"0.75505924",
"0.75505924",
"0.750584",
"0.73708427",
"0.73535985",
"0.7287063",
"0.72131014",
"0.7136395",
"0.71035033",
"0.70918846",
"0.7066601",
"0.7059956",
"0.703765",
"0.703765... | 0.6977724 | 58 |
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 |
Invoke the next middleware in the pipeline | protected function step(): ResponseInterface {
$current = $this->getMiddleware();
if ($current !== null) {
$delegate = $this->createDelegate(
function(ServerRequestInterface $request) {
return $this->setRequest($request)->step();
}
);
$request = $this->getRequest();
return $current->process($request, $delegate);
}
throw new Exception\OutOfMiddlewareException(
"Middleware iterator exhausted."
);
} | {
"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 call()\n {\n // ... | [
"0.7877431",
"0.6895964",
"0.6475088",
"0.64572096",
"0.64411354",
"0.63446134",
"0.6324159",
"0.63163024",
"0.63081664",
"0.6279044",
"0.6267998",
"0.625005",
"0.62320393",
"0.62249714",
"0.61180604",
"0.61071503",
"0.60936975",
"0.60840696",
"0.60749",
"0.60710466",
"0.6040... | 0.5976964 | 27 |
Show the form for creating a new resource. | public function create()
{
$cbd='---Seleccione Distrito---';
$cbid="";
$distritos = Distrito::all();
return view('proveedores.create', [
'proveedor' => new Proveedor,
'distritos'=> $distritos,
'cbid' => $cbid,
'cbd' => $cbd
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.75936973",
"0.75936973",
"0.7585464",
"0.7576766",
"0.7571166",
"0.7498768",
"0.7434969",
"0.7432511",
"0.7387868",
"0.7351811",
"0.7336364",
"0.73113805",
"0.7293885",
"0.72812635",
"0.7273037",
"0.72410345",
"0.7228987",
"0.7225174",
"0.718589",
"0.71786976",
"0.7172516"... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(SaveProveedorRequest $request)
{
Proveedor::create($request->validated());
return redirect()->route('proveedores.index')->with('status', 'El proveedor ha sido guardado');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72857565",
"0.714571",
"0.71328056",
"0.66390204",
"0.6620437",
"0.6567189",
"0.6526738",
"0.65074694",
"0.64491314",
"0.63734114",
"0.6370837",
"0.63628685",
"0.63628685",
"0.63628685",
"0.6342026",
"0.63394964",
"0.63394964",
"0.63394964",
"0.63394964",
"0.63394964",
"0.... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
$distritos = Distrito::all();
$temp = Proveedor::Findorfail($id);
$id_distrito = ($temp->distrito_id);
$dist = Distrito::Findorfail($id_distrito);
return view('proveedores.show', [
'proveedor' => Proveedor::Findorfail($id),
'distritos'=> $distritos,
'dist'=> $dist
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8232636",
"0.81890994",
"0.68296117",
"0.64987075",
"0.649589",
"0.64692974",
"0.64633286",
"0.63640857",
"0.6307513",
"0.6281809",
"0.621944",
"0.61926234",
"0.61803305",
"0.6173143",
"0.61398774",
"0.6119022",
"0.61085826",
"0.6106046",
"0.60947937",
"0.6078597",
"0.6047... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit(Proveedor $proveedor)
{
$distritos = Distrito::all();
$cb = Distrito::Findorfail($proveedor->distrito_id);
$cbid = ($cb->id);
$cbd = ($cb->distrito);
return view('proveedores.edit', [
'proveedor' => $proveedor,
'distritos'=> $distritos,
'cbid' => $cbid,
'cbd' => $cbd
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Proveedor $proveedor, SaveProveedorRequest $request)
{
$proveedor->update($request->validated());
return redirect()->route('proveedores.show', $proveedor)->with('status', 'El proveedor ha sido actualizado');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(Proveedor $proveedor)
{
$proveedor -> delete();
return redirect()->route('proveedores.index')->with('status', 'El proveedor fue eliminado');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n ... | [
"0.6673811",
"0.66624975",
"0.66376764",
"0.66351163",
"0.66280866",
"0.65443397",
"0.6543099",
"0.64656305",
"0.62881804",
"0.61755043",
"0.61278707",
"0.6089098",
"0.60534257",
"0.6043048",
"0.6006416",
"0.593359",
"0.5929751",
"0.5923406",
"0.59201753",
"0.5904145",
"0.589... | 0.0 | -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 |
Find an invalid code in the codes | function is_invalid_http_codes($http_codes) {
foreach ($http_codes as $http_code) {
if ( is_invalid_http_code($http_code) ) {
return TRUE;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_if_code_is_valid($code){\n\n $query = $this->db->get_where('tbl_doctor_code',array('dc_code' => $code));\n return $query->result_array();\n }",
"public function check($code) {\n $code = trim($code);\n // last token should be ;\n if(substr($code, -1) != ';') {\n ... | [
"0.6232527",
"0.6053732",
"0.5995396",
"0.5882779",
"0.5839085",
"0.579839",
"0.5793934",
"0.5730614",
"0.5689528",
"0.56472814",
"0.563137",
"0.56308454",
"0.5601879",
"0.5598712",
"0.5573343",
"0.5567668",
"0.55655617",
"0.5560928",
"0.5535387",
"0.5523847",
"0.55072284",
... | 0.54990184 | 23 |
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 |
/ 1.2 ON LOAD RUN / | public function __construct() {
// update default vars with configuration file
SELF::updateVars();
// add custom fields
if($this->WPimgAttr_Alt_content == 1 || $this->WPimgAttr_Alt_attachment == 1):
// add custom fields
add_filter( 'attachment_fields_to_edit', array( $this, 'WPimgAttr_Alt_meta_CustomFields' ), null, 2 );
// update custom fields
add_action('add_attachment', array( $this, 'WPimgAttr_Alt_meta_Attachments_Save' ), 10, 2 );
add_action('edit_attachment', array( $this, 'WPimgAttr_Alt_meta_Attachments_Save' ), 10, 2 );
endif;
// alt img in the_content
if($this->WPimgAttr_Alt_content == 1):
add_filter('the_content', array( $this, 'IMGalt_Content' ) );
endif;
// alt img in do_shortcode
if($this->WPimgAttr_Alt_shortcode == 1):
add_filter('do_shortcode', array( $this, 'IMGalt_Content' ) );
endif;
// alt img for attachments
if($this->WPimgAttr_Alt_attachment == 1):
add_filter( 'wp_get_attachment_image_attributes', array( $this, 'IMGalt_Attachment' ), 10, 2 );
endif;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _preExec()\n {\n }",
"public function preExec()\n {\n }",
"abstract protected function _run();",
"abstract protected function _run();",
"function public_load() {\n\n\t}",
"function load() {\n\n\t}",
"function needsExecution() ;",
"public function preProcess();",
"publ... | [
"0.5842563",
"0.58228374",
"0.56333256",
"0.56333256",
"0.55635273",
"0.5529471",
"0.5491936",
"0.54754484",
"0.54754484",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239",
"0.5373239... | 0.0 | -1 |
/================================================================================== 2.0 FUNCTIONS ================================================================================== / 2.1 GET CONFIGURATION FORM CONFIG FILE / | private function updateVars(){
// get configuration
global $configuration;
// if configuration file exists && class-settings
if($configuration && array_key_exists('WPimgAttr', $configuration)):
// class configuration
$myConfig = $configuration['WPimgAttr'];
// update vars
$this->WPimgAttr_Alt_content = array_key_exists('Alt_content', $myConfig) ? $myConfig['Alt_content'] : $this->WPimgAttr_Alt_content;
$this->WPimgAttr_Alt_attachment = array_key_exists('Alt_attachment', $myConfig) ? $myConfig['Alt_attachment'] : $this->WPimgAttr_Alt_attachment;
$this->WPimgAttr_Alt_shortcode = array_key_exists('Alt_shortcode', $myConfig) ? $myConfig['Alt_shortcode'] : $this->WPimgAttr_Alt_shortcode;
SELF::$WPimgAttr_Alt_languages = array_key_exists('Alt_languages', $myConfig) ? $myConfig['Alt_languages'] : SELF::$WPimgAttr_Alt_languages;
endif;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getConfigFile();",
"public function getConfigFilePath();",
"public function getConfig()\r\n {\r\n return $this->_file;\r\n }",
"public function getConfigForm() {\r\n\t\treturn parent::getConfigForm()->addElementPath(dirname(__FILE__));\r\n\t}",
"abstract protected function getC... | [
"0.75502646",
"0.75166035",
"0.7432217",
"0.7239127",
"0.7227589",
"0.7179488",
"0.7179488",
"0.7179488",
"0.7179488",
"0.7179488",
"0.7179488",
"0.7179488",
"0.7179488",
"0.71528363",
"0.7141366",
"0.7138566",
"0.7128693",
"0.710064",
"0.70982504",
"0.70982504",
"0.70500225"... | 0.0 | -1 |
/ 2.2 ADD CUSTOM FIELDS / | function WPimgAttr_Alt_meta_CustomFields( $form_fields, $post ) {
//output for each language
if(is_array(SELF::$WPimgAttr_Alt_languages)):
// repeat output for each language (exept first one - is default)
foreach (SELF::$WPimgAttr_Alt_languages as $key => $lang) {
if($key > 0):
// get saved value
$var_name = SELF::$WPimgAttr_Alt_prefix . $lang;
$value = get_post_meta($post->ID, $var_name, true);
// create custom field
$form_fields[$var_name] = array(
'value' => $value ? $value : '',
'label' => __( 'Alternative Text', 'WPimgAttr' ) . ' (' . $lang . ')',
'input' => 'text'
);
endif;
}
endif;
// output
return $form_fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addField();",
"private function addCustomFields() {\n if (function_exists('get_fields')) {\n foreach (self::getPostTypes() as $post_type) {\n register_rest_field($post_type, 'fields', [\n 'get_callback' => function ($post) {\n if (is_object($post)) {\n ... | [
"0.8254478",
"0.7122423",
"0.71163917",
"0.7104441",
"0.7024229",
"0.7019351",
"0.7013509",
"0.7013509",
"0.7008495",
"0.7005112",
"0.69479126",
"0.6937515",
"0.69035953",
"0.6886714",
"0.6862101",
"0.68538237",
"0.6853246",
"0.6822653",
"0.6821339",
"0.68084425",
"0.68017447... | 0.0 | -1 |
/ 2.3 SAVE METABOXES / | public function WPimgAttr_Alt_meta_Attachments_Save($post_id) {
if( isset( $_POST['attachment'] ) ):
//Not save if the user hasn't submitted changes
if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ):
return;
endif;
// Verifying whether input is coming from the proper form
if ( ! wp_verify_nonce ( $_POST['WPimgAttr_Alt_lang_de'] ) ):
return;
endif;
// Making sure the user has permission
if( 'post' == $_POST['attachment'] ):
if( ! current_user_can( 'edit_post', $post_id ) ):
return;
endif;
endif;
endif;
// save fields
SELF::WPimgAttr_Alt_saveAltAttributes($post_id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function save_meta() {}",
"function saveMetadata(){\n\t\t \n\t\t $db = $this->startDB();\n\t\t $metadataJSON = $this->generateJSON();\n\t\t \n\t\t $where = \"source_id = '\".$this->penelopeTabID.\"' \";\n\t\t $db->delete(\"export_tabs_meta\", $where);\n\t\t \n\t\t if(!$this->tableGroupID){\n\t\... | [
"0.7012829",
"0.6330845",
"0.626479",
"0.62023014",
"0.62023014",
"0.61780995",
"0.6174957",
"0.6174957",
"0.6162104",
"0.6053119",
"0.60290456",
"0.6026802",
"0.6019811",
"0.60017914",
"0.5973457",
"0.5966111",
"0.5954616",
"0.59420156",
"0.59212404",
"0.589848",
"0.589848",... | 0.0 | -1 |
/ 2.4 SAVE CUSTOM FIELDS / | public function WPimgAttr_Alt_saveAltAttributes(int $id = 0){
// save field for each language
foreach (SELF::$WPimgAttr_Alt_languages as $key => $lang) {
if($key > 0):
// get field name
$var_name = SELF::$WPimgAttr_Alt_prefix . $lang;
// save value
if ( isset( $_REQUEST['attachments'][ $id ][$var_name] ) ):
$new_value = $_REQUEST['attachments'][ $id ][$var_name];
update_post_meta( $id, $var_name, $new_value );
endif;
endif;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function save() {\n //save the added fields\n }",
"public function saveCustom()\n {\n // Look through all of the updated fields to see if there are any Custom fields\n foreach ($this->updatedFields as $id => $updatedField) {\n\n // Translates WarrantyExpiration to \"Warranty... | [
"0.77478546",
"0.71502805",
"0.680388",
"0.6733931",
"0.6707489",
"0.66934514",
"0.6637578",
"0.6630833",
"0.65892756",
"0.65819794",
"0.65817565",
"0.657542",
"0.65376043",
"0.65298855",
"0.65298855",
"0.65298855",
"0.65298855",
"0.65298855",
"0.65298855",
"0.65298855",
"0.6... | 0.0 | -1 |
/ 2.5 IMG ALT TAG / | public static function getAltAttribute(int $id = 0){
// vars
$output = '';
$lang = prefix_core_BaseFunctions::getCurrentLang();
// check if active lang is default or not
if($lang == SELF::$WPimgAttr_Alt_languages[0]):
// default language
$output .= get_post_meta($id, '_wp_attachment_image_alt', TRUE);
else:
// alternative text
$name = SELF::$WPimgAttr_Alt_prefix . $lang;
$output .= get_post_meta($id, $name, true);
endif;
// output
return $output;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IMGalt_Content($content) {\n if($content):\n // encode content\n $content = mb_convert_encoding($content, 'HTML-ENTITIES', \"UTF-8\");\n $document = new \\DOMDocument();\n // Disable libxml errors and allow user to fetch error information as needed\n libxml_use_internal_errors... | [
"0.7211252",
"0.7119902",
"0.6939392",
"0.68722725",
"0.66553277",
"0.6593555",
"0.65538",
"0.65101254",
"0.6497176",
"0.6496141",
"0.64957166",
"0.64408207",
"0.6425709",
"0.642347",
"0.6421273",
"0.64058113",
"0.640349",
"0.6360163",
"0.63558084",
"0.63507175",
"0.6346629",... | 0.6588177 | 6 |
/ 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 |
initialise the reference to the codeigniter instance | public function __construct() {
require_once APPPATH.'third_party/PHPExcel.php';
$this->excel = new PHPExcel();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n $this->CI =& get_instance();\n \n }",
"public function __construct() {\n $this->CI =& get_instance();\n }",
"public function __construct()\n\t{\n\t \t$this->CI =& get_instance();\n\t}",
"function __construct()\n\t{\n... | [
"0.83183616",
"0.82485515",
"0.8189965",
"0.81561106",
"0.81559265",
"0.81559265",
"0.8152424",
"0.813686",
"0.81122595",
"0.81122595",
"0.8112081",
"0.8011267",
"0.80102533",
"0.79955953",
"0.79292023",
"0.79267794",
"0.7855327",
"0.77943444",
"0.7783894",
"0.75914556",
"0.7... | 0.0 | -1 |
Write out as the new file | public function save($path) {
$objWriter = PHPExcel_IOFactory::createWriter($this->excel, 'Excel5');
$objWriter->save($path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function writeFile()\n {\n $this->eof();\n\n return parent::writeFile();\n }",
"public function write($filename);",
"public function write($filename);",
"public function write(){\n\n\t\t$ACHFile = fopen($this->getFileLocation(), \"w\");\n\t\tfwrite($ACHFile, $this->getData());\n\t\... | [
"0.7144365",
"0.68584806",
"0.68584806",
"0.66825694",
"0.65157396",
"0.65000904",
"0.6489703",
"0.6479929",
"0.6435044",
"0.64224213",
"0.64224213",
"0.63701296",
"0.63371885",
"0.62978816",
"0.6263443",
"0.6254037",
"0.62493944",
"0.6224318",
"0.6217265",
"0.6203878",
"0.61... | 0.0 | -1 |
make sure our child object has this method | public function __call($name, $arguments) {
if(method_exists($this->excel, $name)) {
// forward the call to our child object
return call_user_func_array(array($this->excel, $name), $arguments);
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _ensureInheritedAttributes() {}",
"public function __construct()\n {\n //to be extended by children\n }",
"protected function childLoad() {}",
"abstract protected function doWorkChildImpl();",
"protected function parentSetup() {\n }",
"public function hasParent()\n {... | [
"0.6522693",
"0.64097923",
"0.6336127",
"0.6136622",
"0.60512614",
"0.60427994",
"0.6022591",
"0.5990071",
"0.59495944",
"0.59495944",
"0.59177727",
"0.5915389",
"0.5905513",
"0.5875406",
"0.58505416",
"0.5843374",
"0.583975",
"0.58356607",
"0.5815869",
"0.5815869",
"0.580341... | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$checkAdmin = auth()->user()->role;
$checkActive = User::where('active','=','0')->get();
$activeCount = $checkActive->count();
$task = Task::where('status','!=','X')->take(5)->get();
$call = Call::where('status','!=','X')->take(5)->get();
$countpriority = Task::where('status','I')->where('priority','4')->count();
$priority = Task::where('status','I')->where('priority','4')->get();
return view('pages.calllog.index')->with(compact('checkAdmin','activeCount','task','countpriority','priority','call'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
$checkAdmin = auth()->user()->role;
$checkActive = User::where('active','=','0')->get();
$activeCount = $checkActive->count();
$assign = User::where('position','EXECUTIVE')->get();
$task = Task::where('status','!=','X')->take(5)->get();
$call = Call::where('status','!=','X')->take(5)->get();
$countpriority = Task::where('status','I')->where('priority','4')->count();
$priority = Task::where('status','I')->where('priority','4')->get();
$checkid = Call::orderBy('id','desc')->value('id');
$newid = $checkid + 1;
return view('pages.calllog.create')->with(compact('checkAdmin','activeCount','task','countpriority','priority','call','newid','assign'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.7594873",
"0.7594873",
"0.75862724",
"0.7577369",
"0.75727355",
"0.7500874",
"0.74348205",
"0.74339336",
"0.7389178",
"0.73531044",
"0.73364365",
"0.73124814",
"0.7296061",
"0.72818893",
"0.7274119",
"0.72423935",
"0.72292763",
"0.72266877",
"0.7187332",
"0.717915",
"0.717... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
$checkid = Call::orderBy('id','desc')->value('id');
$newid = $checkid + 1;
$this->validate($request, [
'contact_name' => ['required', 'string', 'max:50'],
'subject' => ['required', 'max:200'],
]);
$call = new Call([
'subject' => $request->get('subject'),
'description' => $request->get('description'),
'contact_name' => $request->get('contact_name'),
'contact_no' => $request->get('contact_no'),
'assign_to' => $request->get('assign_to'),
'priority' => $request->get('priority'),
'status' => 'I'
]);
$call->save();
if(!empty($request->get('remarks')))
{
$remark = new CallRemark([
'call_id' => $newid,
'user' => auth()->user()->username,
'remark' => $request->get('remarks'),
'datetime' => now()
]);
$remark->save();
}
$log = new Log([
'status' => ''.strtoupper(auth()->user()->username).' create Call Log with Subject ['.$request->get('subject').'].'
]);
$log->save();
return redirect()->route('call.index')->with('success', 'Call Log added successfully.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.7286258",
"0.71454436",
"0.7132821",
"0.6640289",
"0.6621105",
"0.6566493",
"0.65255576",
"0.65087926",
"0.6448317",
"0.63752604",
"0.63736314",
"0.6365631",
"0.6365631",
"0.6365631",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
$checkAdmin = auth()->user()->role;
$checkActive = User::where('active','=','0')->get();
$activeCount = $checkActive->count();
$assign = User::where('position','EXECUTIVE')->get();
$task = Task::where('status','!=','X')->take(5)->get();
$call = Call::where('status','!=','X')->take(5)->get();
$countpriority = Task::where('status','I')->where('priority','4')->count();
$priority = Task::where('status','I')->where('priority','4')->get();
$calldata = Call::whereId($id)->first();
$remark = Call::find($id)->remark;
return view('pages.calllog.show')->with(compact('checkAdmin','activeCount','calldata','task','countpriority','assign','priority','remark','call'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78557473",
"0.76946205",
"0.72731614",
"0.7241571",
"0.71700776",
"0.70650244",
"0.7052897",
"0.698311",
"0.69465625",
"0.6944826",
"0.69399333",
"0.69286525",
"0.69031185",
"0.68969506",
"0.68969506",
"0.6878258",
"0.6862812",
"0.6859171",
"0.68560475",
"0.68436426",
"0.6... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
if($request->status != 'X')
{
$data = request([
'contact_no',
'contact_name',
'subject',
'description',
'status',
]);
Call::whereId($id)->update($data);
if(empty($request->get('remarks')))
{
$log = new Log([
'status' => ''.strtoupper(auth()->user()->username).' update Call Log ID ['.$id.'].'
]);
$log->save();
return redirect('call')->with('success', 'Call Log is successfully updated.');
}
else
{
$remark = new CallRemark([
'call_id' => $id,
'user' => auth()->user()->username,
'remark' => $request->get('remarks'),
'datetime' => now()
]);
//dd($remark);
$remark->save();
$log = new Log([
'status' => ''.strtoupper(auth()->user()->username).' add Remarks for Call Log ID ['.$id.'].'
]);
$log->save();
return back()->with('success', 'Remark is successfully added.');
}
}
else
{
$delete_on = now();
$delete_by = auth()->user()->username;
$request->request->add([
'delete_on' => $delete_on,
'delete_by' => $delete_by
]);
$data = request([
'contact_no',
'contact_name',
'subject',
'description',
'status',
'delete_on',
'delete_by'
]);
Call::whereId($id)->update($data);
if(empty($request->get('remarks')))
{
$log = new Log([
'status' => ''.strtoupper(auth()->user()->username).' delete Call Log ID ['.$id.'].'
]);
$log->save();
return redirect('call')->with('success', 'Call Log with ID: '.$id.' is closed permenantly.');
}
else
{
$remark = new CallRemark([
'call_id' => $id,
'user' => auth()->user()->username,
'remark' => $request->get('remarks'),
'datetime' => now()
]);
$remark->save();
$log = new Log([
'status' => ''.strtoupper(auth()->user()->username).' delete Call Log ID ['.$id.'].'
]);
$log->save();
return redirect('call')->with('success', 'Call Log with ID: '.$id.' is closed permenantly.');
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7424884",
"0.7062319",
"0.70572054",
"0.6897199",
"0.658233",
"0.6450576",
"0.6347209",
"0.6211253",
"0.6146092",
"0.6121878",
"0.6114851",
"0.61005586",
"0.608833",
"0.60537165",
"0.60196865",
"0.60068345",
"0.5972924",
"0.594671",
"0.5940615",
"0.5938648",
"0.58927333",
... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n ... | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897... | 0.0 | -1 |
Get the logged in User Id | public function index() {
$loggedUser = Sentinel::getUser();
# Get the profile of the logged in User
$profile = new UserProfile;
$profile = $profile->find($loggedUser->id);
$user = array("fullname" => $profile->fullname, "profile_type" => $profile->profile_type);
return view('Dashboard.patient.dashboard', compact('user'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_user_id();",
"public function loggedInUserId()\n\t{\n\t\treturn auth()->id();\n\t}",
"public static function getLoggedUserId()\r\n {\r\n return self::getVariable(\"login\", \"user-id\");\r\n }",
"public function getCurrentUserId();",
"public function getUserId() {\n\t\tretu... | [
"0.86765665",
"0.8528013",
"0.8441339",
"0.8436033",
"0.8406613",
"0.8403246",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83380324",
"0.83216953",
"0.8307371",
"0.8279631",
"0.8279631",
"0.8... | 0.0 | -1 |
Get the logged in User Id | public function patientAppointment() {
$loggedUser = Sentinel::getUser();
# Get the profile of the logged in User
$profile = new UserProfile;
$profile = $profile->find($loggedUser->id);
# Some info of the logged in user
$user = array("fullname" => $profile->fullname, "profile_type" => $profile->profile_type);
# Return all Doctors with their complete profile
$users = new User();
$users = $users::with('userProfile')
->whereHas('userProfile', function ($query) {
$query->where('profile_type', '=', 'doctor');
})->get();
# All Appointment
$userAppointment = Appointment::where('patient_id', '=', $loggedUser->id)->get();
return view('Dashboard.patient.appointments', compact('user', 'users', 'userAppointment'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_user_id();",
"public function loggedInUserId()\n\t{\n\t\treturn auth()->id();\n\t}",
"public static function getLoggedUserId()\r\n {\r\n return self::getVariable(\"login\", \"user-id\");\r\n }",
"public function getCurrentUserId();",
"public function getUserId() {\n\t\tretu... | [
"0.86765665",
"0.8528013",
"0.8441339",
"0.8436033",
"0.8406613",
"0.8403246",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83380324",
"0.83216953",
"0.8307371",
"0.8279631",
"0.8279631",
"0.8... | 0.0 | -1 |
Get the logged in User Id | public function patientPrescription() {
$loggedUser = Sentinel::getUser();
# Get the profile of the logged in User
$profile = new UserProfile;
$profile = $profile->find($loggedUser->id);
# Some info of the logged in user
$user = array("fullname" => $profile->fullname, "profile_type" => $profile->profile_type);
$userPrescription = Prescription::where('patient_id', '=', $loggedUser->id)->get();
return view('Dashboard.patient.prescription', compact('user', 'userPrescription'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_user_id();",
"public function loggedInUserId()\n\t{\n\t\treturn auth()->id();\n\t}",
"public static function getLoggedUserId()\r\n {\r\n return self::getVariable(\"login\", \"user-id\");\r\n }",
"public function getCurrentUserId();",
"public function getUserId() {\n\t\tretu... | [
"0.86765665",
"0.8528013",
"0.8441339",
"0.8436033",
"0.8406613",
"0.8403246",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83851194",
"0.83380324",
"0.83216953",
"0.8307371",
"0.8279631",
"0.8279631",
"0.8... | 0.0 | -1 |
Returns a context populated with the data of the given header. | public static function fromTraceparent(string $header)
{
@trigger_error(sprintf('The %s() method is deprecated since version 3.1 and will be removed in 4.0. Use TransactionContext::fromHeaders() instead.', __METHOD__), \E_USER_DEPRECATED);
$context = new static();
if (!preg_match(self::TRACEPARENT_HEADER_REGEX, $header, $matches)) {
return $context;
}
if (!empty($matches['trace_id'])) {
$context->traceId = new TraceId($matches['trace_id']);
}
if (!empty($matches['span_id'])) {
$context->parentSpanId = new SpanId($matches['span_id']);
}
if (isset($matches['sampled'])) {
$context->sampled = '1' === $matches['sampled'];
}
return $context;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get($header)\n {\n }",
"public function getHeaderData() {}",
"public function prepareContext()\n {\n $headers = [\n 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',\n 'Accept-Encoding: gzip, deflate',\n 'Accept-L... | [
"0.60030746",
"0.5975836",
"0.5782746",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.566771",
"0.56619024",
"0.56619024",
"0.56619024",
"0.56619024",
"0.56619024",
"0.56619024",
"0.566... | 0.57210153 | 3 |
Primary key of the table. | public function getEntityId(): ?int; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function primary_key()\n\t{\n\t\treturn $this->primary_key;\n\t}",
"public function PrimaryKey() {\n\t\t\treturn $this->intId;\n\t\t}",
"public function PrimaryKey() {\n\t\t\treturn $this->intId;\n\t\t}",
"protected function _getPrimaryIdKey()\n {\n if ($this->_primaryIdKey == null) {\n ... | [
"0.8246662",
"0.81746453",
"0.81746453",
"0.7854036",
"0.7718086",
"0.7713176",
"0.7670647",
"0.76509964",
"0.76214075",
"0.7617651",
"0.7590767",
"0.7587781",
"0.7566466",
"0.7550634",
"0.75035554",
"0.74986225",
"0.74973756",
"0.74935925",
"0.74935925",
"0.7476718",
"0.7441... | 0.0 | -1 |
Get the method (Upstream Pay method). | public function getMethod(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getPaymentMethod();",
"public function GetMethod () {\n\t\treturn $this->method;\n\t}",
"public function get_method() {\n\t\treturn $this->method;\n\t}",
"public function getPaymentMethod() \n {\n return $this->_fields['PaymentMethod']['FieldValue'];\n }",
"public func... | [
"0.72925735",
"0.71410537",
"0.7104616",
"0.70821536",
"0.7064106",
"0.705116",
"0.70487434",
"0.7007694",
"0.6984685",
"0.6959266",
"0.69476897",
"0.6890857",
"0.6890345",
"0.68859535",
"0.6883712",
"0.688217",
"0.6877061",
"0.6877061",
"0.6852213",
"0.6839865",
"0.6839865",... | 0.6735112 | 58 |
Set the method (Upstream Pay method). Only set it on creation, never update it. | public function setMethod(string $method): self; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setMethod($value) { $this->_method = $value; }",
"public function setMethod($method);",
"public function setMethod($method);",
"public function SetMethod ($method = NULL);",
"public function setMethod($method)\n {\n $this->method = $method;\n }",
"public function set_metho... | [
"0.70461285",
"0.68319213",
"0.68319213",
"0.6789065",
"0.6741972",
"0.6740141",
"0.66572326",
"0.6549691",
"0.649964",
"0.6489535",
"0.6474664",
"0.6459748",
"0.6459748",
"0.6459748",
"0.6459748",
"0.64214945",
"0.64098513",
"0.6397173",
"0.63823617",
"0.6367813",
"0.6362973... | 0.6689269 | 6 |
Get the method type (Upstream Pay method), it can be primary or secondary. | public function getType(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function get_method_type() {\n\n\t\treturn isset( $this->response_data->expMonth ) ? 'credit_card' : 'echeck';\n\t}",
"public function getPaymentMethod()\n {\n return $this->response['result']['payment_type'];\n }",
"public function getPaymentMethodType()\n {\n return $this->ge... | [
"0.71292573",
"0.706702",
"0.70372164",
"0.688519",
"0.6766512",
"0.67069995",
"0.65590346",
"0.65417457",
"0.6532208",
"0.6505225",
"0.6439814",
"0.64316154",
"0.6410438",
"0.63374287",
"0.63341784",
"0.63274676",
"0.63253784",
"0.63081175",
"0.63081175",
"0.63029885",
"0.62... | 0.0 | -1 |
Set the method type (Upstream Pay method), it can be primary or secondary. | public function setType(string $type): self; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setMethod($request_method) {}",
"public function setMethod($method);",
"public function setMethod($method);",
"public function setMethod($value) { $this->_method = $value; }",
"public function SetMethod ($method = NULL);",
"public function set_type($type) {\n $this->update([\n ... | [
"0.6323319",
"0.61291957",
"0.61291957",
"0.60944873",
"0.6035735",
"0.602574",
"0.5998133",
"0.5968025",
"0.59463066",
"0.59297174",
"0.59146297",
"0.58952636",
"0.58526653",
"0.58499074",
"0.5824971",
"0.5796151",
"0.5796151",
"0.5796151",
"0.5796151",
"0.579468",
"0.577730... | 0.55020034 | 72 |
Get the creation date of the UpStream Pay payment method. | public function getCreatedAt(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPaymentDate() {\n\t\t// return $this->created_at;\n\t\treturn $this->account ? $this->account->payment_date : $this->created_at;\n\t}",
"public function getPaymentDate();",
"public function getDateCreate()\n\t{\n\t\treturn $this->dateCreate;\n\t}",
"function get_creation_date()\n\t{\n\t\tr... | [
"0.68526983",
"0.67178136",
"0.6521741",
"0.6508159",
"0.64983726",
"0.6474219",
"0.6474219",
"0.6466675",
"0.6465898",
"0.64563006",
"0.64245254",
"0.64245254",
"0.64069015",
"0.64066577",
"0.64066577",
"0.64066577",
"0.63769734",
"0.63253444",
"0.6324338",
"0.6324338",
"0.6... | 0.0 | -1 |
Set the creation date of the UpStream Pay payment method. The DB will automatically set this info. | public function setCreatedAt(string $createdAt): self; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDate()\n\t{\n\t\tif ($this->getIsNewRecord())\n\t\t\t$this->create_time = time();\n\t}",
"public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}",
"public function setDate()\n\t{\n\t\tif... | [
"0.6821997",
"0.66016597",
"0.66016597",
"0.6596195",
"0.638352",
"0.62294364",
"0.62050384",
"0.6176323",
"0.6130548",
"0.60814",
"0.6035228",
"0.59878564",
"0.5961503",
"0.5936572",
"0.59281224",
"0.59281224",
"0.5911937",
"0.5885293",
"0.58767813",
"0.5825121",
"0.5812772"... | 0.0 | -1 |
Get the last modification date of the UpStream Pay payment. | public function getUpdatedAt(): string; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLastModificationDateTime() {\n $timestamp = $this->getUpdatedAt();\n // we don't know when the module content is updated, so we \"guess\"\n if ($this->getModule() != '') {\n $timestamp->setDate(date('Y'), date('m'), date('d'));\n }\n return $timestam... | [
"0.7002915",
"0.69285536",
"0.68846834",
"0.68416584",
"0.6733687",
"0.6709978",
"0.67075896",
"0.66477615",
"0.6634119",
"0.6619758",
"0.65926635",
"0.6503651",
"0.6495727",
"0.6477243",
"0.6469512",
"0.6466893",
"0.64630044",
"0.6457552",
"0.6449073",
"0.6446438",
"0.644244... | 0.0 | -1 |
Set the last modification date of the UpStream Pay payment method. The DB will automatically set this info. | public function setUpdatedAt(string $updatedAt): self; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save() {\n $this->lastModified = new \\DateTime();\n parent::save();\n }",
"private function actionAlterTablePaymentSetTimestamp() {\n $this->changeTableColumnToTimestamp(TB_VPS_PAYMENT, array(\"payment_date\"), \"payment_id\");\n echo TB_VPS_PAYMENT . \" DONE <br/>... | [
"0.65013456",
"0.64233965",
"0.63372695",
"0.631596",
"0.6215716",
"0.61283875",
"0.61283875",
"0.61082864",
"0.60666466",
"0.5989967",
"0.5901514",
"0.58995867",
"0.588913",
"0.57821006",
"0.5775943",
"0.577553",
"0.57426775",
"0.56938964",
"0.568997",
"0.56890607",
"0.56653... | 0.0 | -1 |
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 |
Set default attributes of the elements of column | public function setColumnsAttributes($columnsAttributes)
{
$this->_checkArgumentIsArray(__METHOD__, 1, $columnsAttributes);
foreach ($columnsAttributes as $columnKey => $attributes) {
if (is_array($attributes)) {
$this->setColumnAttributes($columnKey, $attributes);
}
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fillupDefault()\n {\n\n foreach (static::$cols as $key => $col) {\n if ('' != $col[self::COL_DEFAULT]) {\n $this->data[$key] = $col[self::COL_DEFAULT];\n }\n }\n\n }",
"public function setAttributes();",
"abstract public function getColDefaults();",
"function initiali... | [
"0.6533331",
"0.64790803",
"0.64535666",
"0.6406681",
"0.63245183",
"0.6310447",
"0.6302117",
"0.62929285",
"0.6242857",
"0.62410724",
"0.6216642",
"0.6211655",
"0.6187357",
"0.6175051",
"0.61327463",
"0.60933846",
"0.60276556",
"0.6011132",
"0.60094136",
"0.6008063",
"0.6008... | 0.0 | -1 |
Set default attributes of the element of a column | public function setColumnAttributes($columnKey, $attributes)
{
$this->_checkArgumentIsArray(__METHOD__, 2, $attributes);
foreach ($attributes as $name => $val) {
$this->_defaultColumnsAttributes[$columnKey][$name] = $val;
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fillupDefault()\n {\n\n foreach (static::$cols as $key => $col) {\n if ('' != $col[self::COL_DEFAULT]) {\n $this->data[$key] = $col[self::COL_DEFAULT];\n }\n }\n\n }",
"public function column_default($item, $column_name)\n {\n }",
"public function column_d... | [
"0.64865583",
"0.6403172",
"0.6402127",
"0.6402127",
"0.6402127",
"0.6402127",
"0.6402127",
"0.6379181",
"0.6345725",
"0.6265452",
"0.62221503",
"0.61970633",
"0.61426544",
"0.600932",
"0.5979119",
"0.59032226",
"0.58905494",
"0.58699787",
"0.5867052",
"0.5853109",
"0.5833222... | 0.5592871 | 34 |
Get default attributes of the element of a column | public function getColumnAttributes($columnKey)
{
$ret = null;
if (isset($this->_defaultColumnsAttributes[$columnKey])) {
$ret = $this->_defaultColumnsAttributes[$columnKey];
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getColDefaults();",
"function getCellAttributes()\n\t{\n\t\treturn $this->attrs;\n\t}",
"function getCellAttributes()\n\t{\n\t\treturn $this->attrs;\n\t}",
"protected function _getDefaultAttributes()\n {\n return ['entity_type_id', 'attribute_set_id', 'created_at', 'updated... | [
"0.735408",
"0.67821515",
"0.67821515",
"0.67272556",
"0.663794",
"0.65878904",
"0.6439237",
"0.64173335",
"0.6415646",
"0.6364332",
"0.62245405",
"0.62049246",
"0.62044716",
"0.6171318",
"0.61372334",
"0.6116767",
"0.6096225",
"0.6089471",
"0.608819",
"0.60817605",
"0.605256... | 0.62841636 | 10 |
Add body row element by specifying cells value, and return created row element | public function addRow($values)
{
$this->_checkArgumentIsArray(__METHOD__, 1, $values);
$row = $this->createRow($values);
$this->addRowElement($row);
return $row;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function newRow( $cell ) {\n\n $sheetDataRef = $this->sheet->contents->sheetData;\n $rowCol = $this->cellToRowAndColumn( $cell );\n\n // SimpleXML does not seem to allow adding XML objects directly into other XML objects, and so some trickery must be used to insert a row between\n ... | [
"0.67737055",
"0.6219642",
"0.6182994",
"0.6176805",
"0.6127217",
"0.59216374",
"0.5808461",
"0.57574546",
"0.5741175",
"0.5726457",
"0.5716659",
"0.56912696",
"0.56903166",
"0.5678019",
"0.5672391",
"0.5669758",
"0.56671923",
"0.56659406",
"0.5652681",
"0.560402",
"0.5584926... | 0.58187896 | 6 |
Create and return body row element by specifying cells value | public function createRow($values = array(), $isHeader = false)
{
$this->_checkArgumentIsArray(__METHOD__, 1, $values);
$row = new HtmlTableRow($this);
if ($isHeader == true) {
$row->setCellTagName('th');
}
foreach ($values as $columnKey => $value) {
$row->addCell($columnKey, $value);
}
return $row;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cell($value) {\n return $this->setProperty('cell', $value);\n }",
"private function newRow( $cell ) {\n\n $sheetDataRef = $this->sheet->contents->sheetData;\n $rowCol = $this->cellToRowAndColumn( $cell );\n\n // SimpleXML does not seem to allow adding XML objects di... | [
"0.6242905",
"0.6084221",
"0.6039841",
"0.59566337",
"0.58452594",
"0.5769639",
"0.57656497",
"0.57437134",
"0.568748",
"0.56583637",
"0.5620575",
"0.5619136",
"0.5607734",
"0.56033534",
"0.5592004",
"0.55728626",
"0.55640006",
"0.55632055",
"0.5555762",
"0.5547828",
"0.55055... | 0.59333 | 4 |
Add body row element | public function addRowElement(HtmlTableRow $row)
{
$this->_createRowContainer();
$this->_tbody->addElement($row);
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addRow() {\n if ($this->linesCount >= 0)\n $this->addContent('</div>');\n $this->linesCount ++;\n $this->colunsCount = 0;\n $this->addContent('<div class=\"row\" >');\n }",
"protected function _createRowContainer()\n\t{\n\t\tif ($t... | [
"0.76264775",
"0.73576355",
"0.6549476",
"0.64756453",
"0.64550054",
"0.6420464",
"0.6287849",
"0.6169601",
"0.61275655",
"0.6030965",
"0.60230595",
"0.5993272",
"0.5962001",
"0.59042925",
"0.5894203",
"0.5887458",
"0.5886196",
"0.5778984",
"0.57778215",
"0.5777762",
"0.57740... | 0.580318 | 17 |
Add header row element by specifying cells value, and return created row element | public function addHeader($values)
{
$this->_checkArgumentIsArray(__METHOD__, 1, $values);
$row = $this->createHeader($values);
$this->addHeaderElement($row);
return $row;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function table_table_header_row($values)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\t$cells->attach(do_template('TABLE_TABLE_HEADER_ROW_CELL',array('_GUID'=>'5002f54ccddf7259f3460d8c0759fd1a','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_HEADER_ROW',array('_GUID'=>'2f4... | [
"0.6858519",
"0.66062266",
"0.648914",
"0.64698666",
"0.632523",
"0.6299195",
"0.6236023",
"0.61877406",
"0.61541545",
"0.6030426",
"0.59895873",
"0.5949746",
"0.59466124",
"0.58835906",
"0.5824204",
"0.5821001",
"0.58190095",
"0.5802883",
"0.578394",
"0.5753952",
"0.57231617... | 0.6162816 | 8 |
Create and return header row element by specifying cells value | public function createHeader($values = array())
{
$this->_checkArgumentIsArray(__METHOD__, 1, $values);
return $this->createRow($values, true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function table_table_header_row($values)\n{\n\t$cells=new ocp_tempcode();\n\tforeach ($values as $value)\n\t{\n\t\t$cells->attach(do_template('TABLE_TABLE_HEADER_ROW_CELL',array('_GUID'=>'5002f54ccddf7259f3460d8c0759fd1a','VALUE'=>$value)));\n\t}\n\n\treturn do_template('TABLE_TABLE_HEADER_ROW',array('_GUID'=>'2f4... | [
"0.72085065",
"0.6674754",
"0.6447409",
"0.6413221",
"0.62979126",
"0.6216644",
"0.62077314",
"0.6166023",
"0.61543834",
"0.61455077",
"0.6122714",
"0.60276544",
"0.600498",
"0.59996784",
"0.597468",
"0.5974656",
"0.5974111",
"0.59692496",
"0.59381145",
"0.59037757",
"0.58981... | 0.60505193 | 11 |
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 body container | public function getRowsContainer()
{
return $this->_tbody;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBodyElement()\n {\n return $this->body;\n }",
"public function getWrapperElement();",
"protected function get_body_node() {\n\t\t_deprecated_function( 'Use $this->dom->body instead', '1.5.0' );\n\t\treturn $this->dom->body;\n\t}",
"abstract protected function get_root_element(... | [
"0.6975315",
"0.6546882",
"0.6529626",
"0.6373216",
"0.61402196",
"0.606286",
"0.59727883",
"0.59232944",
"0.5904535",
"0.58936137",
"0.5886445",
"0.5854023",
"0.5816618",
"0.57678187",
"0.57205063",
"0.5717475",
"0.5694509",
"0.5659016",
"0.5659016",
"0.56494313",
"0.5598522... | 0.0 | -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 element of body row | public function getRow($rowIndex)
{
$ret = null;
if ($this->_tbody instanceof HtmlElement) {
$ret = $this->_tbody->getElement($rowIndex);
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_row() {\n\t\tif (!isset($this->rows)) {\n\t\t\t$this->get_rows();\n\t\t}\n\t\t$value = current($this->rows);\n\t\tnext($this->rows);\n\t\treturn $value;\n\t}",
"public function getRow()\n {\n return $this->row;\n }",
"public function getRow()\n {\n return $this->get('... | [
"0.6462467",
"0.6430712",
"0.64278567",
"0.63921416",
"0.63694614",
"0.6310292",
"0.63045377",
"0.62498844",
"0.62273586",
"0.62168664",
"0.6210518",
"0.6148992",
"0.59975886",
"0.5958963",
"0.59482557",
"0.593269",
"0.5829517",
"0.5829517",
"0.5800319",
"0.5799819",
"0.57846... | 0.6293322 | 7 |
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 |
Get all elements of header rows | public function getHeaders()
{
$ret = null;
if ($this->_thead instanceof HtmlElement) {
$ret = $this->_thead->getElements();
}
return $ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function getRowsHeader(): array;",
"protected function get_header_elements() {\n foreach( $this->header_elements_array as $header_element ) {\n $header_elements .= \"\\n\" . $header_element;\n }\n\n return $header_elements;\n }",
"abstract protected function getColum... | [
"0.77124095",
"0.7186105",
"0.710517",
"0.6633367",
"0.6604542",
"0.656018",
"0.6556048",
"0.65241647",
"0.651443",
"0.6347346",
"0.6260192",
"0.6250425",
"0.6194485",
"0.6182214",
"0.61683863",
"0.6150064",
"0.6127913",
"0.61131585",
"0.61042744",
"0.60967386",
"0.6090807",
... | 0.70073044 | 3 |
Create elements of rows and columns element by two dimensional array | public function bindArray($rows)
{
$this->_checkArgumentIsArray(__METHOD__, 1, $rows);
$this->_tbody = new HtmlElement('tbody');
$this->addElement($this->_tbody);
foreach ($rows as $row) {
$this->addRow($row);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function make_2d($x, $y)\n{\n for ($_x = 0; $_x < $x; $_x++) {\n for ($_y = 0; $_y < $y; $_y++) {\n $a[$_x][$_y] = \"x{$_x}y{$_y}\";\n }\n }\n return $a;\n}",
"protected function initializeElements()\n {\n for ($i = 0; $i < $this->_rows; ++$i) {\n for ($j = ... | [
"0.5986138",
"0.5956309",
"0.54289067",
"0.5381754",
"0.5377197",
"0.5265973",
"0.52472264",
"0.51712656",
"0.51700544",
"0.5141177",
"0.50366396",
"0.50366396",
"0.5014995",
"0.5014949",
"0.499914",
"0.49861243",
"0.4966335",
"0.48686203",
"0.4867317",
"0.48633653",
"0.48621... | 0.0 | -1 |
Create the element of body container if it does not exist | protected function _createRowContainer()
{
if ($this->_tbody == null) {
$this->_tbody = new HtmlElement('tbody');
$this->addElement($this->_tbody);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testBodyElementAutomaticallyCreated() {\n\t\t$document = new HTMLDocument(Helper::HTML);\n\t\t$this->assertInstanceOf(Element::class, $document->body);\n\t}",
"private function ensureExistenceOfBodyElement(\\DOMDocument $document)\n {\n if ($document->getElementsByTagName('body')->item(... | [
"0.6856831",
"0.6498647",
"0.574058",
"0.5732401",
"0.5584925",
"0.55000705",
"0.5436509",
"0.5414238",
"0.53868806",
"0.5266912",
"0.52580684",
"0.52203315",
"0.51579833",
"0.5101406",
"0.5080407",
"0.50763047",
"0.50546455",
"0.50546056",
"0.5017042",
"0.50101405",
"0.49947... | 0.5669783 | 4 |
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 |
Validate the form date | public function adminlogin(Request $request){
$this->validate($request, [
'email'=>'required|email',
'password'=>'required|min:6',
]);
//Attempt to login Admin
if(Auth::guard('admin')->attempt(['email'=>$request->email, 'password'=>$request->password], $request->remember)){
//if SuccessFully done
return redirect()->intended(route('dashboard'));
}
//if not SuccessFull than
return redirect()->back()->with('status', 'Email Address And Password Are Not Match !');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate_date() {\n # Check the date is in ISO date format\n if (ereg('(19|20)[0-9]{2}[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])', $this->cur_val)) {\n # Remove any existing error message\n $this->error_message = \"\";\n\n # Return Val... | [
"0.76500404",
"0.76280826",
"0.7349785",
"0.73120666",
"0.7291731",
"0.7289353",
"0.7289353",
"0.72614795",
"0.72071373",
"0.71772885",
"0.717427",
"0.7145322",
"0.7119601",
"0.7119298",
"0.71172035",
"0.71044755",
"0.7104054",
"0.7090664",
"0.7090038",
"0.7067511",
"0.704481... | 0.0 | -1 |
Run the database seeds. | public function run()
{
$faker = Faker\Factory::create();
for($i=0;$i<20;$i++)
{
$customers = array(
'name' => $faker->name,
'mob' => $faker->phoneNumber,
'license' => $faker->randomNumber('9',true),
'email' => $faker->email,
'address' => $faker->address
);
Customer::insert($customers);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact... | [
"0.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.78414... | 0.0 | -1 |
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 |
the default action is "indexAction", unless explcitly set to something else | public function indexAction()
{
// STAGE 3: Choose, create, and optionally update models using business logic.
if (false === strpos($this->view->baseUrl, '/index.php')) {
$this->view->baseUrl .= '/index.php';
}
// STAGE 4: Apply business logic to create a presentation model for the view.
// STAGE 5: Choose view and submit presentation model to view.
$this->renderToSegment('body');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction() {\n\t\t// TODO Auto-generated AdminController::indexAction() default action\n\t}",
"abstract public function actionIndex();",
"public function singleIndexAction() {}",
"abstract function indexAction();",
"public function actionIndex()\n\n {\n\n echo 'Index action has... | [
"0.8225392",
"0.8095778",
"0.80863327",
"0.80374944",
"0.7992981",
"0.7971771",
"0.7912538",
"0.7903136",
"0.78977334",
"0.7892377",
"0.7849805",
"0.7848459",
"0.7848071",
"0.78203434",
"0.7812484",
"0.78045547",
"0.78045547",
"0.7787189",
"0.7778062",
"0.7777224",
"0.7777224... | 0.0 | -1 |
reload the DB tables using the DB SQL dump found in config/zfdemo..sql | public function resetAction()
{
// STAGE 3: Choose, create, and optionally update models using business logic.
$registry = Zend_Registry::getInstance();
$db = $registry['db'];
// if the DB is not configured to handle "large" queries, then we need to feed it bite-size queries
$filename = $registry['configDir'] . 'zfdemo.' . $registry['config']->db->type . '.sql';
$statements = preg_split('/;\n/', file_get_contents($filename, false));
foreach ($statements as $blocks) {
$sql = '';
foreach (explode("\n", $blocks) as $line) {
if (empty($line) || !strncmp($line, '--', 2)) {
continue;
}
$sql .= $line . "\n";
}
$sql = trim($sql);
if (!empty($sql)) {
$db->query($sql);
}
}
// STAGE 4: Apply business logic to create a presentation model for the view.
$this->view->filename = $filename;
// STAGE 5: Choose view and submit presentation model to view.
$this->renderToSegment('body');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function resetDatabase()\n {\n $dumpFolder = APPLICATION_PATH . '/../data/dumps/';\n\n $directoryIterator = new DirectoryIterator($dumpFolder);\n /**\n * @var Zend_Db_Adapter_Abstract $db\n */\n $db = Zend_Registry::get('db');\n\n foreach ($directoryIte... | [
"0.71364564",
"0.66584945",
"0.6474742",
"0.64356214",
"0.635151",
"0.6320904",
"0.62520653",
"0.6122368",
"0.6073391",
"0.6073266",
"0.60632855",
"0.6055538",
"0.60545975",
"0.6001374",
"0.60007554",
"0.5976796",
"0.5967964",
"0.59626496",
"0.5939987",
"0.59098667",
"0.59052... | 0.5543664 | 77 |
show user a link to access resetAction() above and reload/restore their DB from config/zfdemo..sql | public function testDbFailedAction()
{
$this->renderToSegment('body');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function resetAction()\n {\n // STAGE 3: Choose, create, and optionally update models using business logic.\n $registry = Zend_Registry::getInstance();\n $db = $registry['db'];\n // if the DB is not configured to handle \"large\" queries, then we need to feed it bite-size quer... | [
"0.7777203",
"0.7600285",
"0.7002099",
"0.6734565",
"0.6592833",
"0.6476906",
"0.6474454",
"0.64211327",
"0.6369323",
"0.6346148",
"0.6283537",
"0.6279184",
"0.6265187",
"0.62285084",
"0.6181591",
"0.6179993",
"0.61779195",
"0.6173194",
"0.61322355",
"0.6115769",
"0.61040723"... | 0.0 | -1 |
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 |
check for user authorization | public function preDispatch() {
$this->_auth = Zend_Auth::getInstance();
$this->_auth->setStorage(new Zend_Auth_Storage_Session('Fancrank_App'));
//
if(!$this->_auth->hasIdentity()) {
$this->_helper->json(array('message'=>'authentication failed','code'=>400));
//set the proper navbar
}
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$this->_user = $this->_auth->getIdentity();
if ($this->_getParam('id') != $this->_user->facebook_user_id){
echo "IDENTITY AND PARAMETER ID DOES NOT MATCH" ;
exit();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n ... | [
"0.7900136",
"0.78684956",
"0.7711052",
"0.76828724",
"0.76721627",
"0.76721627",
"0.76720124",
"0.7655715",
"0.765273",
"0.765273",
"0.7617856",
"0.7617856",
"0.76150703",
"0.76146305",
"0.7608963",
"0.7603318",
"0.7601234",
"0.7601234",
"0.75969887",
"0.75825316",
"0.756468... | 0.0 | -1 |
Note: data could initialize from preDispatch | public function postAction() {
//197221680326345_425781560803688
$starttime = time();
$data['facebook_user_id'] = $this->_user->facebook_user_id;
$data['fanpage_id'] = $this->_getParam('fanpage_id');
$data['fanpage_name'] = $this->_getParam('fanpage_name');
$data['access_token'] = $this->_getParam('access_token');
//$data['post_id'] = $this->_getParam('post_id');
$data['message'] = $this->_getParam('message');
try{
$fancrankFB = new Service_FancrankFBService();
$params = array(
'message' => $data['message'],
'access_token' => $this->_user->facebook_user_access_token
);
$ret_obj = $fancrankFB->api('/'.$data['fanpage_id'].'/feed', 'POST',
$params);
Zend_Debug::dump($ret_obj);
$data['post_id'] = $ret_obj['id'];
$fanpageModel = new Model_Fanpages();
$fanpageAccessToken = $fanpageModel->getFanpageAccessToken($data['fanpage_id']);
$client = new Zend_Http_Client;
$client->setUri("https://graph.facebook.com/". $data['post_id']);
$client->setMethod(Zend_Http_Client::GET);
$client->setParameterGet('access_token', $fanpageAccessToken);
$response = $client->request();
$result = Zend_Json::decode($response->getBody(), Zend_Json::TYPE_OBJECT);
Zend_debug::dump($result);
if(!empty ($result)) {
$db = Zend_Db_Table::getDefaultAdapter();
// check response error from facebook graph api
$result = $this->facebookResponseCheck($result);
$db->beginTransaction();
$postModel = new Model_Posts();
$created = new Zend_Date(!empty($post->created_time) ? $post->created_time : null, Zend_Date::ISO_8601);
$updated = new Zend_Date(!empty($post->updated_time) ? $post->updated_time : null, Zend_Date::ISO_8601);
$row = array(
'post_id' => $result->id,
'facebook_user_id' => $result->from->id,
'fanpage_id' => $data['fanpage_id'],
'post_message' => isset($result->message) ? $postModel->quoteInto($result->message) : '',
'picture' => !empty($result->picture) ? $result->picture : '',
'link' => !empty($result->link) ? $result->link : '',
'post_type' => !empty($result->type) ? $result->type : '',
'status_type' => !empty($result->status_type) ? $result->status_type : '',
'post_description' => !empty($result->description) ? $postModel->quoteInto($result->description) : '',
'post_caption' => !empty($result->caption) ? $postModel->quoteInto($result->caption) : '',
'created_time' => $created->toString('yyyy-MM-dd HH:mm:ss'),
'updated_time' => $updated->toString('yyyy-MM-dd HH:mm:ss'),
'post_comments_count' => !empty($result->comments->count) ? $result->comments->count : 0,
'post_likes_count' => isset($result->likes) && isset($result->likes->count) ? $result->likes->count : 0
);
if (property_exists($result, 'application') && isset($result->application->id)) {
$row['post_application_id'] = $result->application->id;
$row['post_application_name'] = empty($result->application->name) ? null : $result->application->name;
} else {
$row['post_application_id'] = null;
$row['post_application_name'] = null;
}
try {
// retrieve fanpage setting
$fanpageSettingModel = new Model_FanpageSetting();
$settingData = $fanpageSettingModel->findRow($data['fanpage_id']);
if(!$settingData) {
$settingData = $fanpageSettingModel->getDefaultSetting();
}else {
$settingData = $settingData->toArray();
}
// insert new post into database
$postModel->insert($row);
// if none admin post, apply point rule to post
if($data['fanpage_id'] != $result->from->id) {
// add activity into database
$this->addactivity('post-'.$row['post_type'], $data['post_id'],
$data['fanpage_id'],$data['fanpage_id'], $data['fanpage_name'],$row['post_message'] );
// update fan data
$fan = new Model_Fans($data['facebook_user_id'], $data['fanpage_id']);
$fan->updateFanPoints($settingData['point_post_normal']);
$fan->updateFanProfile();
// update fan stat
$fanstat = new Model_FansObjectsStats();
switch($row['post_type']){
case 'status':
$fanstat ->addPostStatus($data['fanpage_id'], $data['facebook_user_id']);
break;
case 'photo':
$fanstat->addPostPhoto($data['fanpage_id'], $data['facebook_user_id']);
break;
case 'video':
$fanstat->addPostVideo($data['fanpage_id'], $data['facebook_user_id']);
break;
case 'link':
$fanstat->addPostLink($data['fanpage_id'], $data['facebook_user_id']);
break;
}
// update point data
$pointLog = array();
$pointLog['fanpage_id'] = $data['fanpage_id'];
$pointLog['facebook_user_id'] = $data['facebook_user_id'];
$pointLog['object_id'] = $data['post_id'];
$pointLog['object_type'] = 'posts';
$pointLog['giving_points'] = $settingData['point_post_normal'];
$pointLog['note'] = 'post on fanpage';
$pointLogModel = new Model_PointLog();
$result = $pointLogModel->insert($pointLog);
}else {
$this->addactivity('post-'.$row['post_type'], $data['post_id'],
$data['fanpage_id'],$data['fanpage_id'], $data['fanpage_name'],$row['post_message'] );
}
// commit all update
$db->commit();
$db->closeConnection();
} catch (Exception $e) {
$db->rollBack();
$db->closeConnection();
print $e->getMessage();
$appLogger = Zend_Registry::get('appLog');
$appLogger->log(sprintf('Unable to save post %s from fanpage %s to database. Error Message: %s ', $post->id,$data['fanpage_id'], $e->getMessage()), Zend_log::ERR);
return;
}
}
//return $result;
} catch (Exception $e){
echo $e;
$appLogger = Zend_Registry::get('appLog');
$appLogger->log(sprintf('Unable to save post from fanpage %s to database. Error Message: %s ', $data['fanpage_id'], $e->getMessage()), Zend_log::ERR);
}
echo '<br/>' .time() - $starttime . 'sec';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function preDispatch() {\n\t\t\n\t\t}",
"public function processData() {\r\r\n if ( is_array($this->data) && isset($this->data['args']) )\r\r\n $this->args = array_merge($this->args, $this->data['args']);\r\r\n\r\r\n if ( is_array($this->data) && isset($this->data['val... | [
"0.66408956",
"0.66198885",
"0.660924",
"0.6602933",
"0.6555129",
"0.6525035",
"0.6461326",
"0.64545405",
"0.64011914",
"0.63908345",
"0.63763577",
"0.6352918",
"0.633062",
"0.6323182",
"0.6253072",
"0.6224948",
"0.6203702",
"0.618554",
"0.6182026",
"0.6171962",
"0.61441904",... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.