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 |
|---|---|---|---|---|---|---|
Store a newly created resource in storage. | public function store(Request $request)
{
$input = $request->all();
$validator = Validator::make($input, [
'nisn' => 'required|string|size:4|unique:siswa,nisn',
'nama_siswa' => 'required|string|max:30',
'tanggal_lahir' => 'required|date',
'jenis_kelamin' => 'required|in:L,P',
'nomor_telepon' => 'nullable|numeric|digits_between:10,15|unique:telepon,nomor_telepon',
'id_kelas' => 'required'
]);
if($validator->fails()) {
return redirect('siswa/create')
->withInput()
->withErrors($validator);
}
$siswa = Siswa::create($input);
$telepon = new Telepon;
if($request->nomor_telepon) {
$telepon->nomor_telepon = $request->nomor_telepon;
$siswa->telepon()->save($telepon);
} else {
$telepon->nomor_telepon = "-";
$siswa->telepon()->save($telepon);
}
$siswa->hobi()->attach($request->id_hobi);
return redirect('siswa');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.63424... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
$halaman = 'siswa';
$siswa = Siswa::findOrFail($id);
return view('siswa.show', compact('halaman', 'siswa'));
} | {
"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)
{
$siswa = Siswa::findOrFail($id);
$list_kelas = Kelas::all();
$jumlah_kelas = Kelas::count();
// $siswa->nomor_telepon = $siswa->telepon->nomor_telepon;
return view('siswa.edit', compact('siswa', 'list_kelas', 'jumlah_kelas'));
} | {
"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($id, Request $request)
{
$siswa = Siswa::findOrFail($id);
$input = $request->all();
$validator = Validator::make($input, [
'nisn' => 'required|string|size:4|unique:siswa,nisn,' . $id,
'nama_siswa' => 'required|string|max:30',
'tanggal_lahir' => 'required|date',
'jenis_kelamin' => 'required|in:L,P',
'nomor_telepon' => 'nullable|numeric|digits_between:10,15|unique:telepon,nomor_telepon,' . $id . ',id_siswa',
'id_kelas' => 'required'
]);
if($validator->fails()) {
return redirect('siswa/'. $id . '/edit')
->withInput()
->withErrors($validator);
}
$siswa->update($request->all());
$telepon = $siswa->telepon;
$telepon->nomor_telepon = $request->nomor_telepon;
$siswa->telepon()->save($telepon);
return redirect('siswa');
} | {
"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)
{
$siswa = Siswa::findOrFail($id);
$siswa->delete();
return redirect('siswa');
} | {
"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 |
Function to get translation by specific key | function get ($key,$localeName = null)
{
$modulesRegistry = $this->modulesRegistry;
if (!$localeName)
$localeName = $this->locale->locale();
$modules = $this->getAvailableModulesOfKey($key);
$privateModule = "";
foreach ($modules as $module)
if ($this->modulesRegistry->isPrivateModule($module))
$privateModule = $module;
if ($privateModule) $modules = [$privateModule];
if (!$modules)
return $key;
sort($modules);
$module = $modulesRegistry->getModule($modules[0]);
$path = $this->getResourcesLangPath($module)."/$localeName.ini";
return $this->translationData->get($key, $path);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getTranslation($key = '')\n {\n return self::$translations[$key];\n }",
"public function getTranslationsForKey($key);",
"private function getTrans($key)\n {\n $tr = $this->get('translator');\n\n return $tr->trans($key);\n }",
"public function translate($key)\n... | [
"0.8063592",
"0.7993933",
"0.76812536",
"0.7442232",
"0.73759437",
"0.73039764",
"0.7237441",
"0.72153497",
"0.7200249",
"0.7136597",
"0.694452",
"0.6853477",
"0.6829391",
"0.6824267",
"0.6794968",
"0.6741432",
"0.6687451",
"0.6666056",
"0.66229224",
"0.65715986",
"0.6565427"... | 0.65939015 | 19 |
Function to get an array with all translations in all entire project | function getAllTranslations()
{
$translations = [];
$modules = $this->getAllModulesOfProject();
sort($modules);
foreach ($modules as $module)
{
$trans = $this->getTranslationsOfModule($module);
if ($trans)
{
foreach ($trans as $value)
{
foreach ($value as $key => $val)
{
$langsAvailable = $this->getAvailableLangsOfKey($key);
if (!isset($translations[$key]))
{
$translations[$key] = [
'key' => $key,
'value' => $val,
'module' => $module->name,
'locale' => implode(', ', $langsAvailable)
];
}
else
{
$isPrivateModulo = $this->modulesRegistry->isPrivateModule($module->name);
if ($isPrivateModulo)
{
$translations[$key] = [
'key' => $key,
'value' => $val,
'module' => $module->name,
'locale' => implode(', ', $langsAvailable)
];
}
}
}
}
}
}
return $translations;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllTranslationByLanguage();",
"protected function translations(): array\n {\n return $this->cache->get('translations', function (): array {\n return array_values(array_map(function (SplFileInfo $file): string {\n return $file->getBasename('.yaml');\n ... | [
"0.7936426",
"0.781887",
"0.774593",
"0.7547088",
"0.7544516",
"0.731501",
"0.7163456",
"0.71537936",
"0.71046144",
"0.71046126",
"0.7083187",
"0.7042341",
"0.6965644",
"0.69579184",
"0.68774176",
"0.6872991",
"0.68667144",
"0.6848462",
"0.68352705",
"0.6820744",
"0.6805927",... | 0.8123033 | 0 |
Method to get all translations of specific module | function getTranslationsOfModule($module)
{
$translations = [];
$resourcesLangPath = $this->getResourcesLangPath($module);
$iniFiles = $this->getIniFilesOfModule($module);
foreach ($iniFiles as $file => $data)
$translations[str_replace('.ini', '', $data)] = parse_ini_file ("$resourcesLangPath/$data");
return $translations;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllTranslations()\n {\n $translations = [];\n $modules = $this->getAllModulesOfProject();\n sort($modules);\n\n foreach ($modules as $module)\n {\n $trans = $this->getTranslationsOfModule($module);\n if ($trans)\n {\n foreach ($trans as $value)\n {\n ... | [
"0.77585846",
"0.7519644",
"0.75016063",
"0.73077905",
"0.7251117",
"0.70535856",
"0.68925446",
"0.68523324",
"0.6808986",
"0.6746941",
"0.6741045",
"0.6738055",
"0.6695994",
"0.6666037",
"0.6640058",
"0.66320163",
"0.6596456",
"0.65793896",
"0.6564944",
"0.65433246",
"0.6516... | 0.7816113 | 0 |
Method to get all languages where the indicated key is registered | function getAvailableLangsOfKey($key)
{
$langs = [];
$modules = $this->getAllModulesOfProject();
foreach ($modules as $module)
{
$translations = $this->getTranslationsOfModule($module);
foreach ($translations as $lang => $value)
{
if (get($value,$key))
$langs[$key][] = strtoupper($this->locale->shortCode ($lang));
}
}
return $langs ? array_unique($langs[$key]) : [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getLanguageList();",
"public function getLanguages();",
"public function getLanguages() {}",
"protected function getLanguages() {}",
"public function getTranslationsForKey($key);",
"function GetLanguages() // static function\r\n\t{\r\n\t\treturn array_keys ( $this->m_languages );\r\n\t}",... | [
"0.74686384",
"0.7355214",
"0.7268893",
"0.72001886",
"0.7180961",
"0.715266",
"0.70666873",
"0.7051027",
"0.6897231",
"0.68570435",
"0.68503135",
"0.68440163",
"0.6818944",
"0.6803733",
"0.6786593",
"0.67756516",
"0.67755",
"0.67456156",
"0.67223006",
"0.6699972",
"0.6697188... | 0.76414835 | 0 |
Private method to get resources languages folder of specific module | function getResourcesLangPath($module)
{
return "$module->path/{$this->localizationSettings->moduleLangPath}";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getLanguagePath()\n {\n return $this->resourcePath('lang');\n }",
"function sti_get_localization_directory()\r\n\t{\r\n\t\treturn \"localization\";\r\n\t}",
"function sti_get_localization_directory()\n\t{\n\t\treturn \"localization\";\n\t}",
"public static function LanguageFol... | [
"0.74307245",
"0.69792694",
"0.6939375",
"0.6815248",
"0.67490596",
"0.6584351",
"0.65752465",
"0.6532462",
"0.6508149",
"0.6459096",
"0.63418084",
"0.63270485",
"0.6311079",
"0.63049555",
"0.63046765",
"0.6297079",
"0.62796825",
"0.62702113",
"0.62194806",
"0.62148356",
"0.6... | 0.83719397 | 0 |
Private method to get all modules of current project | private function getAllModulesOfProject()
{
return $this->modulesRegistry->getModules();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModules();",
"public function getModules();",
"public function getModules() {\n }",
"public function all()\n {\n return $this->modules;\n }",
"public function getIncludedModules ();",
"public function getModulesList();",
"public function getModules()\n {\n ret... | [
"0.81733066",
"0.81733066",
"0.8046601",
"0.7664847",
"0.76621205",
"0.7625909",
"0.75027376",
"0.74667656",
"0.7464819",
"0.74457943",
"0.7423007",
"0.73694557",
"0.73416436",
"0.7336872",
"0.73325574",
"0.71203834",
"0.7119757",
"0.70992935",
"0.70629334",
"0.70449466",
"0.... | 0.8411386 | 0 |
Method to get all modules where the indicated key is registered | function getAvailableModulesOfKey($key)
{
$availableModules = [];
$modules = $this->getAllModulesOfProject();
foreach ($modules as $module)
{
$translations = $this->getTranslationsOfModule($module);
foreach ($translations as $lang => $value)
{
if (get($value,$key) && !in_array($module->name, $availableModules))
$availableModules[] = $module->name;
}
}
return $availableModules;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getModules();",
"public function getModules();",
"function qa_load_all_modules_with($method)\n{\n\t$modules = array();\n\n\t$regmodules = qa_list_modules_info();\n\n\tforeach ($regmodules as $moduletype => $modulesinfo) {\n\t\tforeach ($modulesinfo as $modulename => $moduleinfo) {\n\t\t\t$modul... | [
"0.700129",
"0.700129",
"0.67833364",
"0.6589975",
"0.655044",
"0.6474812",
"0.6364183",
"0.61944747",
"0.6189151",
"0.61363125",
"0.6130783",
"0.61043257",
"0.6074729",
"0.60546374",
"0.60528034",
"0.60104096",
"0.5999453",
"0.5987314",
"0.5967615",
"0.59352195",
"0.5924302"... | 0.71593446 | 0 |
var $uses = array('Ingredient'); | function index() {
$this->ProductReteta->recursive = 0;
$this->data=$this->ProductReteta->find('all',array(
'fields'=>array(
'ProductReteta.id',
'ProductReteta.ingredient_id',
'ProductReteta.product_id',
'ProductReteta.procent')
)
) ;
$this->set('productRetetas', $this->paginate());
/* $this->set('productRetetas', ));*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Ingredient()\n {\n return $this->hasMany('App\\Ingredient');\n }",
"public function ingredient()\n {\n return $this->belongsTo('App\\Models\\Ingredient');\n }",
"public function ingredients()\n {\n return $this->belongsTo('App\\Models\\Ingredient');\n }",
"publ... | [
"0.76049274",
"0.73901564",
"0.73404354",
"0.704858",
"0.6953162",
"0.6805089",
"0.67988086",
"0.67928666",
"0.6714641",
"0.6421411",
"0.6419635",
"0.6415319",
"0.64125913",
"0.63305515",
"0.6288704",
"0.6286602",
"0.62273467",
"0.619802",
"0.619802",
"0.61480093",
"0.6146233... | 0.0 | -1 |
Get the intrinsic ratio used to calculate the responsive video size. | public function intrinsic_ratio()
{
return ($this->slide_video_dimensions['height'] / $this->slide_video_dimensions['width']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function intrinsic_ratio()\n {\n $w = intval($this->r_width);\n $h = intval($this->r_height);\n return $h / $w;\n }",
"public function ratio()\r\n {\r\n if (is_null($this->ratio)) {\r\n $this->ratio = $this->width() / 64;\r\n }\r\n\r\n return $... | [
"0.8139961",
"0.75486",
"0.72354454",
"0.7170941",
"0.6863232",
"0.6560961",
"0.6264969",
"0.62637305",
"0.6252468",
"0.62079614",
"0.59535044",
"0.5945698",
"0.59242505",
"0.5867603",
"0.5864762",
"0.5812672",
"0.57373184",
"0.5709485",
"0.56588614",
"0.5621279",
"0.5593527"... | 0.87134606 | 0 |
Returns the starting location of the rent | public function startingLocation()
{
return $this->hasOne(Location::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStartLocation()\n {\n return $this->start_location;\n }",
"public function getInitialPosition();",
"private function getStartLocation()\n {\n for ($counter = 0; $counter < count($this->boardingCards); $counter++) {\n\n $from = $this->boardingCards[$counter]-... | [
"0.7058608",
"0.67648256",
"0.6636519",
"0.6383384",
"0.6361913",
"0.63196445",
"0.6255223",
"0.6191643",
"0.61067486",
"0.608256",
"0.6078235",
"0.6074882",
"0.6064629",
"0.6053781",
"0.60432476",
"0.60032755",
"0.60032755",
"0.60032755",
"0.60032755",
"0.60032755",
"0.60032... | 0.5798122 | 32 |
Returns the ending location of the rent | public function endingLocation()
{
return $this->hasOne(Location::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEndLocation()\n {\n return $this->end_location;\n }",
"public function getEndPosition()\n\t{\n\t\treturn $this->endPosition;\n\t}",
"public function getEndPosition() {\r\n return $this->endPosition;\r\n }",
"public function getEndPosition()\n\t{\n\t\treturn -1;\n\t}"... | [
"0.75712734",
"0.69171387",
"0.6770453",
"0.6734005",
"0.6655595",
"0.6655595",
"0.660335",
"0.6565841",
"0.6524859",
"0.6524859",
"0.6524859",
"0.6524859",
"0.6524859",
"0.6524859",
"0.6499173",
"0.64778167",
"0.6453015",
"0.64362144",
"0.6409448",
"0.6374772",
"0.63242024",... | 0.61220944 | 29 |
Returns the car that is rented | public function car()
{
return $this->hasOne(Car::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCarRental()\r\n {\r\n return $this->_carRental;\r\n }",
"public function getCarrito()\n {\n return $this->carrito;\n }",
"public function getCarid()\n {\n return $this->carid;\n }",
"public function histories_rented_car($date) {\n $d = ... | [
"0.78182954",
"0.66702616",
"0.6353133",
"0.618491",
"0.614746",
"0.5933345",
"0.59087414",
"0.58867294",
"0.5858294",
"0.5840118",
"0.58147365",
"0.5788528",
"0.5770658",
"0.5733557",
"0.566802",
"0.56475854",
"0.5599465",
"0.55961734",
"0.55651164",
"0.5553492",
"0.5538561"... | 0.53503036 | 44 |
Returns the user (customer) that rented the car | public function customer()
{
return $this->belongsTo(User::class);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function returnCar(User $user, Car $car, $returnedTo);",
"public function getCarRental()\r\n {\r\n return $this->_carRental;\r\n }",
"abstract public function getCruser();",
"public function actionUsersReyting()\n { \n return Yii::$app->user->identity->UsersReyting();\n }",... | [
"0.62990326",
"0.6077771",
"0.59355336",
"0.59008795",
"0.58972234",
"0.58438456",
"0.5812675",
"0.5812675",
"0.5812675",
"0.5752633",
"0.57367307",
"0.5711199",
"0.56665933",
"0.56447583",
"0.55870783",
"0.55716133",
"0.55700517",
"0.55665374",
"0.5563395",
"0.55601984",
"0.... | 0.53812796 | 32 |
Run the database seeds. | public function run()
{
ProductPrice::insert(
[
["product_id" => 1,
"description" => "economical",
"price" => 10000
],
["product_id" => 1,
"description" => "default",
"price" => 100000
],
["product_id" => 1,
"description" => "plus",
"price" => 1000000
],
["product_id" => 2,
"description" => "economical",
"price" => 10000
],
["product_id" => 2,
"description" => "default",
"price" => 100000
],
["product_id" => 2,
"description" => "plus",
"price" => 1000000
],
["product_id" => 3,
"description" => "economical",
"price" => 10000
],
["product_id" => 3,
"description" => "default",
"price" => 100000
],
["product_id" => 3,
"description" => "plus",
"price" => 1000000
],
["product_id" => 4,
"description" => "economical",
"price" => 10000
],
["product_id" => 4,
"description" => "default",
"price" => 100000
],
["product_id" => 4,
"description" => "plus",
"price" => 1000000
],
["product_id" => 5,
"description" => "economical",
"price" => 10000
],
["product_id" => 5,
"description" => "default",
"price" => 100000
],
["product_id" => 5,
"description" => "plus",
"price" => 1000000
]
]);
} | {
"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 |
I think I have severly butchered this test...it's not so much of a unit test as it is a fullfledged component test | public function testConnectionValueFromPdo() {
if (false === $this->checkSymfonyPresent()) {
return $this->markTestSkipped('Dependency of Symfony HttpFoundation failed');
}
$sessionId = md5('testSession');
$dbOptions = array(
'db_table' => 'sessions'
, 'db_id_col' => 'sess_id'
, 'db_data_col' => 'sess_data'
, 'db_time_col' => 'sess_time'
);
$pdo = new \PDO("sqlite::memory:");
$pdo->exec(vsprintf("CREATE TABLE %s (%s VARCHAR(255) PRIMARY KEY, %s TEXT, %s INTEGER)", $dbOptions));
$pdo->prepare(vsprintf("INSERT INTO %s (%s, %s, %s) VALUES (?, ?, ?)", $dbOptions))->execute(array($sessionId, base64_encode('_sf2_attributes|a:2:{s:5:"hello";s:5:"world";s:4:"last";i:1332872102;}_sf2_flashes|a:0:{}'), time()));
$component = new SessionComponent(new NullMessageComponent, new PdoSessionHandler($pdo, $dbOptions), array('auto_start' => 1));
$connection = new Connection(new FakeSocket);
$headers = $this->getMock('Guzzle\\Http\\Message\\Request', array('getCookie'), array('POST', '/', array()));
$headers->expects($this->once())->method('getCookie', array(ini_get('session.name')))->will($this->returnValue($sessionId));
$connection->WebSocket = new \StdClass;
$connection->WebSocket->headers = $headers;
$component->onOpen($connection);
$this->assertEquals('world', $connection->Session->get('hello'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testGetOrderPackData()\n {\n }",
"public function testGetChangeIssue()\n {\n }",
"public function testGetDuplicatePackingPlanById()\n {\n }",
"public function testGetPackingPlanByFilter()\n {\n }",
"protected function testObjects() {\n }",
"public function testG... | [
"0.6363485",
"0.6244811",
"0.61958396",
"0.6176611",
"0.6137648",
"0.60929275",
"0.6092413",
"0.6065636",
"0.6065078",
"0.60646075",
"0.6051743",
"0.60425806",
"0.602919",
"0.6026006",
"0.60214466",
"0.60077053",
"0.59983575",
"0.5998249",
"0.59868073",
"0.59792584",
"0.59736... | 0.0 | -1 |
Return labels collection array | public function getLabels(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getLabels(): array;",
"public function labels()\n {\n return array();\n }",
"public function labels(): array\n {\n return [];\n }",
"public function getLabels(): array\n {\n return $this->labels;\n }",
"public function getLabels()\n {\n retu... | [
"0.83863896",
"0.8179198",
"0.79970664",
"0.7993685",
"0.77408785",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
"0.77203465",
... | 0.8109356 | 4 |
Create event and set modified object instance. | function __construct(UserSetting $model){
$this->model = $model;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }",
"public function initEvent()\n {\n ... | [
"0.662823",
"0.62388754",
"0.6136346",
"0.60999006",
"0.5848104",
"0.5760689",
"0.57416457",
"0.5695659",
"0.5613788",
"0.5583024",
"0.5526849",
"0.5518614",
"0.5512491",
"0.54959965",
"0.5415083",
"0.540321",
"0.5399479",
"0.5388593",
"0.537941",
"0.53547585",
"0.5331016",
... | 0.0 | -1 |
Get modified object instance. | public function getModel(){
return $this->model;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getObjectForChange(): ObjectForChange\n {\n return $this->objectForChange;\n }",
"public function get_instance() {\r\n\t\treturn $this->obj;\r\n\t}",
"public function getObject()\n {\n return $this;\n }",
"protected function getObject()\n {\n return... | [
"0.6823997",
"0.673067",
"0.66962063",
"0.6696035",
"0.66413444",
"0.66370547",
"0.6633345",
"0.6612283",
"0.651491",
"0.651491",
"0.6513166",
"0.64967585",
"0.64796245",
"0.64759415",
"0.6475109",
"0.64683217",
"0.64096606",
"0.64014065",
"0.64014065",
"0.64014065",
"0.64014... | 0.0 | -1 |
Update object data in database. | public function update($user, $ident, DatabaseDataHandler $data); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }",
"public abstract function update($object);",
"public function update($database, CouchDBObject $object);",
"protected function updateObject()\n {\n $gatewayData = $this->encodeDataToJso... | [
"0.7925046",
"0.75684094",
"0.75554305",
"0.7425165",
"0.7421076",
"0.7421076",
"0.72626555",
"0.72453195",
"0.7192925",
"0.71047586",
"0.7067533",
"0.70461637",
"0.70461637",
"0.70461637",
"0.70461637",
"0.7035605",
"0.69635665",
"0.693914",
"0.6923561",
"0.6897104",
"0.6862... | 0.0 | -1 |
Get object data from database | public function read($user, $ident); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function fetchObject();",
"public function fetchObject();",
"public function getObject()\n {\n return mysqli_fetch_object($this->resulset);\n }",
"public function fetchObject()\n {\n return sasql_fetch_object($this->result);\n }",
"function FetchObject() {\n\t\t\treturn pg_... | [
"0.71915686",
"0.71915686",
"0.7092581",
"0.70577836",
"0.7017421",
"0.7009417",
"0.6891646",
"0.6805683",
"0.6768851",
"0.6706375",
"0.66692483",
"0.6644114",
"0.66173244",
"0.661118",
"0.65407735",
"0.653628",
"0.6533729",
"0.6530687",
"0.65088135",
"0.6486326",
"0.6483642"... | 0.0 | -1 |
Remove data from database. | public function delete($user, $ident); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }",
"public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n ... | [
"0.76250154",
"0.75664103",
"0.7349364",
"0.69925183",
"0.6877784",
"0.68643105",
"0.6847803",
"0.68193406",
"0.6799729",
"0.67645043",
"0.6704909",
"0.66585183",
"0.6610564",
"0.656945",
"0.65559596",
"0.65433925",
"0.65287197",
"0.65037304",
"0.6496126",
"0.64825225",
"0.64... | 0.0 | -1 |
// Constructor // // Create model UserSetting instance. | public function __construct($user = null, $ident = null, $array = array()){
$this->user = new User($user);
$this->ident = $ident;
if(sizeof($array) > 0){
$this->_setFromArray($array);
}
$this->datahandler = new DatabaseDataHandler();
$this->datahandler->set(self::FIELD_USER, $user);
$this->datahandler->set(self::FIELD_IDENT, $ident);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct(UserSetting $model){\n\t\t$this->model = $model;\n\t}",
"public function __construct(User $user, Setting $settings)\n {\n $this->user = $user;\n $this->settings = $settings;\n }",
"public function settings()\n {\n return $this->hasOne(UserSetting::class);\n ... | [
"0.77055204",
"0.68514276",
"0.6822671",
"0.67443466",
"0.6696679",
"0.6605239",
"0.62592435",
"0.6212984",
"0.6201849",
"0.6131827",
"0.6131827",
"0.6131827",
"0.6084034",
"0.5979452",
"0.5969099",
"0.594395",
"0.5919447",
"0.5908983",
"0.58629054",
"0.58571696",
"0.579725",... | 0.0 | -1 |
// Get methods // // / Get methods Get user. | public function getUser(){
return $this->user;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function user_get()\n\t{\n\t\t$id = $this->get('id');\n\t\tif ($id == null) {\n\t\t\t$data = $this->User->showUser();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$data = $this->User->showUser($id);\n\t\t}\n\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'er... | [
"0.7513879",
"0.7381871",
"0.7294445",
"0.71858335",
"0.71485204",
"0.7027607",
"0.7027607",
"0.7027607",
"0.7027607",
"0.7027607",
"0.7027607",
"0.7027607",
"0.6966491",
"0.6950848",
"0.69298625",
"0.69282484",
"0.6885848",
"0.6870872",
"0.68398523",
"0.682885",
"0.6824195",... | 0.63509727 | 68 |
/ Get methods end // Set methods // // / Set methods Set user. | public function setUser(User $user){
$this->user = $user;
$this->datahandler->set(self::FIELD_USER, $user->getID());
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUser()\n\t{\n\t\t$user = User::getInstance();\n\t\t\n\t\tif ( $this->session->get( 'user_id' ) ) {\n\t\t\t$user->set( 'id', $this->session->get( 'user_id' ) );\n\t\t\t$user->read();\n\t\t}\n\t}",
"function set_user_setting( $user, $key, $value )\n {\n //Unimplemented\n }",
"function set... | [
"0.7070637",
"0.6970826",
"0.68851197",
"0.68761915",
"0.68259835",
"0.6611628",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
"0.66034734",
... | 0.0 | -1 |
/ Set methods end // Converter set methods // // / Converter methods / Converter methods end // Utility methods // // / Utility methods / Utility methods end Set cache manager. | public function setCacheManagerOutput(CacheManagerOutput $cache){
/* Cache references */
$cache->addObjectReferenceMethod('getUser');
/* Cache references end */
$this->cache = $cache;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCache()\n\t{\n\t\treturn CacheBot::set($this->getCacheKey(), $this->getDataToCache(), self::$objectCacheLife);\n\t}",
"public static function setCache($cache) {}",
"public function setCaching($cache);",
"public static function setCache($caching)\n{\nself::$caching=$caching;\n}",
"protect... | [
"0.69528115",
"0.6350277",
"0.6343695",
"0.6133147",
"0.61120266",
"0.608157",
"0.5984159",
"0.5856781",
"0.58567804",
"0.58490646",
"0.58480704",
"0.5830866",
"0.58306986",
"0.5826112",
"0.5773646",
"0.57422227",
"0.5736567",
"0.5710192",
"0.5694979",
"0.5684546",
"0.5681",
... | 0.5480915 | 33 |
// Data change methods // // Delete data from database. | public function delete(){
$this->_getDAO(false);
return $this->dao->delete($this->user->getID(), $this->ident);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }",
"public function delete($data)\n {\n }",
"public function delete($data)\n {\n }",
"public function delete($data='')\n\t{\n\t\tif (func_num_args() == ... | [
"0.7578217",
"0.72978806",
"0.72978806",
"0.70765924",
"0.6869644",
"0.6699259",
"0.6647375",
"0.65759933",
"0.65580577",
"0.65346587",
"0.6498273",
"0.6468006",
"0.6461607",
"0.6455932",
"0.6428831",
"0.64002264",
"0.6398102",
"0.63489664",
"0.6309988",
"0.6299943",
"0.62907... | 0.0 | -1 |
Read data from database. | public function read(){
$this->_getDAO(false);
if($array = $this->dao->read($this->user->getID(), $this->ident)){
$this->_setFromArray($array);
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function readDB() {\n\n\t\t// READ FROM MYSQL, kh_mod 0.3.0, add\n\t\treturn ($this->sqldatabase)?\n\t\t\t\t $this->readDBSQL()\n\t\t\t\t :\n\t\t\t\t $this->readDBFlatfile();\n\t}",
"public function readDatabase() {\n\t\t$q = $this->pdo->query(\"SELECT count(*) FROM `Articles`\");\n\t\t$count = $q->fetch(PDO::FE... | [
"0.73131603",
"0.7229912",
"0.7056037",
"0.7042203",
"0.6924658",
"0.69234234",
"0.69171447",
"0.68304944",
"0.6827631",
"0.6813229",
"0.67752385",
"0.6732399",
"0.66953313",
"0.6678461",
"0.66766584",
"0.66362405",
"0.6633179",
"0.66305",
"0.65827954",
"0.65705556",
"0.65678... | 0.59516215 | 82 |
Commit changes to database. | public function commit(){
$event = EventHandler::getInstance();
$this->_getDAO();
$event->trigger(new UserSettingModifyBeforeCommit($this));
$r = $this->_update();
if($r !== false){
$event->trigger(new UserSettingModifyAfterCommit($this));
}
return $r;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function commit()\n\t{\n\t\t$this->db->commit();\n\t}",
"public function commit()\n {\n $this->getConnection()->commit();\n }",
"public function commit();",
"public function commit();",
"public function commit();",
"public function commit();",
"public function commit();",
"publ... | [
"0.81972885",
"0.81330085",
"0.79823554",
"0.79823554",
"0.79823554",
"0.79823554",
"0.79823554",
"0.7974852",
"0.7943506",
"0.7916717",
"0.78971267",
"0.7767097",
"0.77320963",
"0.7679301",
"0.7676115",
"0.7633196",
"0.7504767",
"0.74967957",
"0.74670374",
"0.7458039",
"0.74... | 0.6062841 | 92 |
// Output methods // // | public function getXML(DOMDocument $xml){
$user_setting = $xml->createElement('user-setting');
/* Get XML method */
if(!is_null($this->user)){
$user_setting->setAttribute('user', $this->user->getID());
}
if(!is_null($this->ident)){
$user_setting->setAttribute('ident', $this->getIdent());
}
if(!is_null($this->value)){
$user_setting->setAttribute('value', $this->getValue());
}
/* Get XML method end */
return $user_setting;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function output() {}",
"public static function output() {}",
"public function output();",
"public function output();",
"public function output();",
"public function output();",
"public function output();",
"public function output() {\n }",
"function output() {\n \n }",
"public... | [
"0.8584805",
"0.8558659",
"0.85149896",
"0.85149896",
"0.85149896",
"0.85149896",
"0.85149896",
"0.8250669",
"0.8191944",
"0.812429",
"0.79335",
"0.79335",
"0.78289956",
"0.76613754",
"0.76554424",
"0.7534764",
"0.7345834",
"0.7327123",
"0.72463775",
"0.7119197",
"0.7084843",... | 0.0 | -1 |
// Private methods // // Get Current DAO object instance. | private function _getDAO($read=true){
if(is_null($this->dao)){
$this->dao = Database::getDAO(self::DAO);
if($read){
$this->read();
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDAO() \n {//--------------->> getDAO()\n return $this->_DAO;\n }",
"function getDaoObject() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_DAO_OBJECT);\r\n\t}",
"public function getDao()\n\t{\n\t\treturn parent::getDao();\n\t}",
"public function getDao()\n\t{\... | [
"0.7938594",
"0.75982434",
"0.74124396",
"0.74124396",
"0.73951185",
"0.73689747",
"0.7358017",
"0.7034523",
"0.7027359",
"0.69319713",
"0.68426555",
"0.67922455",
"0.6783773",
"0.6763665",
"0.6715807",
"0.6715807",
"0.6542306",
"0.6528387",
"0.6500319",
"0.6436909",
"0.63962... | 0.5945393 | 69 |
Update object in database. | private function _update(){
if($this->dao->update($this->user->getID(), $this->ident, $this->datahandler)){
$this->read();
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }",
"public abstract function update($object);",
"public function update($database, CouchDBObject $object);",
"public function update($object): void;",
"public function db_update() {}",
"protect... | [
"0.8009206",
"0.7785735",
"0.7631174",
"0.7478339",
"0.73854357",
"0.73268515",
"0.7269681",
"0.7265984",
"0.7170775",
"0.7132711",
"0.7073909",
"0.702336",
"0.69467956",
"0.6919108",
"0.6919108",
"0.68729264",
"0.6864613",
"0.6856165",
"0.6852195",
"0.6818536",
"0.680176",
... | 0.0 | -1 |
Populate model using an array as data source. | protected function _setFromArray($array){
/* setFromArray method content */
if(isset($array[self::FIELD_USER])){
$this->user = new User((integer) $array[self::FIELD_USER]);
}
if(isset($array[self::FIELD_IDENT])){
$this->ident = (string) $array[self::FIELD_IDENT];
}
if(isset($array[self::FIELD_VALUE])){
$this->value = (string) $array[self::FIELD_VALUE];
}
/* setFromArray method content end */
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function populate(array $data);",
"public function fromArray(array $data);",
"public function fromArray(array $data);",
"public function fromArray(array $arrayData);",
"function populateFromArray(array $arr);",
"function populateFromArray(array $arr);",
"abstract public function populate();",
... | [
"0.67750573",
"0.62489414",
"0.62489414",
"0.6178525",
"0.6165857",
"0.6165857",
"0.6151003",
"0.6116818",
"0.60306865",
"0.5905473",
"0.58835536",
"0.58045447",
"0.58029866",
"0.5784616",
"0.57818216",
"0.57344085",
"0.5730597",
"0.57224673",
"0.5692537",
"0.5657823",
"0.563... | 0.0 | -1 |
A visual identifier that represents this user. | public function getUsername(): string
{
return (string) $this->email;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUserVisibleName() {\n\t\t\treturn $this->getUID();\n\t\t}",
"public function getName()\n {\n return self::USER_ID;\n }",
"public function getVisualId()\n {\n return $this->getId();\n }",
"public function getId() {\n\t\treturn SYS_USERNAME;\n\t}",
"public functio... | [
"0.69463336",
"0.68791765",
"0.6734728",
"0.6636532",
"0.65999246",
"0.6594324",
"0.6588144",
"0.6577275",
"0.6567396",
"0.6563488",
"0.6538281",
"0.6509249",
"0.650821",
"0.64903057",
"0.64898163",
"0.6444243",
"0.642105",
"0.64198184",
"0.64189166",
"0.6388467",
"0.6387211"... | 0.0 | -1 |
Shows the planet list owned by player on a tab | function getprodforplanet(&$tabcontent, &$tabcontentstyle, $pid, &$ajaxcode, $par = null, &$jschild = null)
{
$userid = $_SESSION['id'];
getplanetowner($pid, $pluserid, $plusername);
if ($pluserid != $userid) {
$tabcontent = "You dont own that planet $pluserid != $userid";
return false;
}
$tabselected = 0;
$open = $_SESSION['open'];
$isajax = $_SESSION['isajax'];
if (!myisset($par)) {
$parst = "`bparentid` is NULL";
$tabcontent = '<div class="planprod">';
$ts = 'planet';
$pr = 0;
$jsroot = '';
$jschild = '';
} else {
$parst = "`bparentid`=$par";
$ts = 'industry';
$pr = $par;
}
$ts .= " prod.";
$curvars = $_SERVER["REQUEST_URI"];
$quer = "SELECT * FROM `buildings`,`buildingtypes`,`buildinglevels` WHERE `pid`=$pid and `buildings`.`btid`=`buildingtypes`.`btid` and `buildings`.`btid`=`buildinglevels`.btid and `level`=`blevel`+1 and $parst order by btype";
if (executequery($quer, $qres, $qrcnt)and $qrcnt > 0) {
adddebug("Found $qrcnt Buildings for planet $pid <br>");
if (!myisset($par)) {
$tabcontent .= "
<form name='builtlist' method='post' onsubmit='return validateForm()' >
";
}
for ($i = 1; $i < $qrcnt + 1; $i++) {
$dbarr = query_fetch_array($qres);
$bname = $dbarr['bname'];
$bperc = $dbarr['percnt'];
$blvl = $dbarr['blevel'];
$gold = $dbarr['gold'];
$metal = $dbarr['metalum'];
$tritium = $dbarr['tritium'];
$goldupg = $dbarr['goldupg'];
$metalupg = $dbarr['metalumupg'];
$tritiumupg = $dbarr['tritiumupg'];
$upgrading = $dbarr['baction'] == 1;
$upgdays = $dbarr['daysupg'];
$upghours = $dbarr['hoursupg'];
$upgmins = $dbarr['minsupg'];
$upglevel = $dbarr['blevel'] + 1;
$tmdur = maketimetoupg($upgdays, $upghours, $upgmins);
$tmdurs = gettimetoupgrade($tmdur);
if ($upgrading) {
$ttt = calctimetoupgrade($dbarr['bacttimestart'], $dbarr['bacttimedur']);
$timetoupg = gettimetoupgrade($ttt);
$upgs = '▲U... ' . $timetoupg;
adddebug($timetoupg . '<br>');
//todo : get this out of here
if (istimetoupg($dbarr['bacttimestart'], $dbarr['bacttimedur'])) {
//levelup
upgradeplanetbuilding($pid, $dbarr['btid']);
}
} else {
$upgs = '';
}
//getupgresneeded($goldupg,$metalupg,$tritiumupg,$blvl+1);
if (!myisset($par)) {
$tabcontent = $tabcontent . "<b>";
$jsroot = $jsroot . 'rootcomps[' . $i . ']="buildrng_' . $pr . $i . '";';
} else {
$jschild = $jschild . 'childcomps[' . $i . ']="buildrng_' . $pr . $i . '";';
}
$tabcontent = $tabcontent . "
<div class='builddiv_$pr$i'><div style='position:absolute;left:00px'>
$i.";
if (!myisset($par) and $open != $i) {
$tabcontent = $tabcontent . "
<a href='?pg=planet&tab=$tabselected&open=$i'> ";
}
$tabcontent = $tabcontent . $bname;
if (!myisset($par) and $open != $i) {
$tabcontent = $tabcontent . "</a>";
}
$hint = "NEED FOR UPGRADE
 Resources: g:$goldupg m:$metalupg t:$tritiumupg
";
$tabcontent = $tabcontent . " ($blvl) $upgs</div>
<div style='position:absolute;left:350px;color:green'>STORAGE</div>
<div style='position:absolute;top:20px;left:310px'>g:$gold m:$metal t:$tritium </div>
<div style='position:absolute;top:18px;'>
";
if (!$upgrading) {
$tabcontent = $tabcontent . "
<a href='javascript:upgBuilding(" . '"' . "$pr$i" . '"' . ")'> <img src='Images/upgbuild.png' title='$hint Time: $tmdurs'/> </a>";
} else {
$tabcontent = $tabcontent . "
<img src='Images/upgbuild.png' title='Upgrading to level $upglevel ($tmdurs)'/>";
}
$tabcontent = $tabcontent . "
</div>
<input type='range' class='buildrng' name='buildrng_$pr$i' id='buildrng_$pr$i' min='0' max='100' value='$bperc' step='5' list='number' onchange='" . 'onChangeVal("' . $pr . $i . '")' . "' />
<datalist id='number'>
<option>0</option>
<option>10</option>
<option>20</option>
<option>30</option>
<option>40</option>
<option>50</option>
<option>60</option>
<option>70</option>
<option>80</option>
<option>90</option>
<option>100</option>
</datalist>
<div style='position:relative;left:170;top:-12;width:120'><output id='rangevalue_$pr$i' style='color:green' >$bperc</output> % of $ts </div>
";
if (!myisset($par)) {
$tabcontent = $tabcontent . "</b>";
}
if ($open == $i) {
getprodforplanet($tabcontent, $tabcontentstyle, $pid, $ajaxcode, $dbarr['btid'], $jschild);
}
$tabcontent = $tabcontent . "</div>";
if (!myisset($par)) {
$tabcontent = $tabcontent . "<br><hr>";
}
if (!myisset($par)) {
$margin = "10px";
} else {
$margin = "20px";
}
$tabcontentstyle .= "
.builddiv_$pr$i
{
font-family:arial;color:#8B3626;font-size:12px;
position: relative;
display: block;
left:$margin;
width:465px;
}
";
}
$tabcontentstyle .= "
.buildrng
{
##-webkit-appearance: none;
position: relative;
width: 120px;
height: 30px;
left:30;
top:13px;
padding: 3px;
-webkit-border-radius: 15px;
border-radius: 15px;
border: 1px solid #525252;
background-image: -webkit-gradient(
linear,
right top,
left top,
color-stop(0.45, rgb(204,84,84)),
color-stop(0.61, rgb(72,181,67))
);
}
";
if (!myisset($par)) {
$tabcontent = $tabcontent . "
<div style='position:relative;left:170px;width:200px;'>
<input type = 'hidden' name = 'submit' value = 'submit'>
<input type='image' name='submit' value='submit'
src='Images/submit_up.png' border='0'
onmouseover='" . 'this.src="Images/submit_dn.png"' . "'
onmouseout='" . 'this.src="Images/submit_up.png"' . "'
/>
</div>
</form>
</div>";
}
if ($par == null) {
$tabcontentstyle = $tabcontentstyle . "
.planprod
{
height:569px;
width:505px;
}
-webkit-scrollbar-track {
background-color: #b46868;
} /* the new scrollbar will have a flat appearance with the set background color */
-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
} /* this will style the thumb, ignoring the track */
-webkit-scrollbar-button {
background-color: #7c2929;
} /* optionally, you can style the top and the bottom buttons (left and right for horizontal bars) */
-webkit-scrollbar-corner {
background-color: black;
} /* if both the vertical and the horizontal bars appear, then perhaps the right bottom corner also needs to be styled */
";
}
if ($par == null) {
$jscr = "
function upgBuilding(bid){
info=90;
console.log(bid);
obj=getAjaxInfo(info,'planet','bid='+bid,'planprodscr');
//alert(obj.content);
tabpressed(null,selectedTab);
}\n
";
if (!$isajax) {
addjsfunction('initform', $jsroot . $jschild);
} else {
$ajaxcode .= $jscr . getajaxjsfunction('initform', '//alert("hi");' . $jsroot . $jschild);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n $players = Players::get()->toArray();\n return view('players', compact('players'));\n }",
"function fantacalcio_admin_players_list() {\n $out = l(\"Aggiorna lista\", \"admin/fantacalcio/players/list\") . \"<br/>\";\n \n $players = Player::all();\n \n if ($pl... | [
"0.6203474",
"0.6066433",
"0.594469",
"0.5929404",
"0.59072834",
"0.5870743",
"0.5852552",
"0.5837689",
"0.58266056",
"0.58266056",
"0.58155245",
"0.5807356",
"0.5718556",
"0.5717814",
"0.5707983",
"0.5655626",
"0.5634233",
"0.56234556",
"0.5609753",
"0.5604313",
"0.56029755"... | 0.0 | -1 |
$config = array('key' => , ); | public function encode_url($text){
$text_encode = $this->encrypt($text);
$text_encode = strtr(
$text_encode,
array(
'+' => '.',
'=' => '-',
'/' => '~'
)
);
return $text_encode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function config(array $config);",
"function get_config_array();",
"function config($key = '')\n{\n $config = [\n 'name' => 'MyBank', \n 'db' => [\n 'user' => 'host',\n 'password' => '',\n 'host' => 'localhost',\n 'database' => ''\n ],\n ... | [
"0.6397574",
"0.6053443",
"0.58638304",
"0.5804085",
"0.5777525",
"0.56257",
"0.5558586",
"0.5545311",
"0.54820216",
"0.5478043",
"0.5448007",
"0.5411207",
"0.53909403",
"0.5382577",
"0.53721714",
"0.5357657",
"0.5353311",
"0.5353311",
"0.5339319",
"0.5339319",
"0.5330795",
... | 0.0 | -1 |
This action is the home page of the website | public function indexAction() {
$this->view->title = 'Hello World !';
$this->view->headTitle('Hello World !');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionHome(){\n\t\t\n\t\t$this->getContent('home');\n\t\t\n\t}",
"private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }",
"public function index() {\n\t\t$this->... | [
"0.8794394",
"0.83464575",
"0.8193258",
"0.81521136",
"0.8087572",
"0.8067565",
"0.80491585",
"0.804651",
"0.803703",
"0.80242014",
"0.8015902",
"0.7969428",
"0.7964574",
"0.7945826",
"0.793966",
"0.7920688",
"0.7900923",
"0.789872",
"0.7846322",
"0.77918994",
"0.77867424",
... | 0.0 | -1 |
Gets the application's auth adapter. | public static function getAuthAdapter() {
if (null == self::$_authAdapter) {
throw new Celsus_Exception("Auth adapter has not been set!");
}
return self::$_authAdapter;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAuthAdapter()\n {\n if (!$this->_authAdapter) {\n throw new Zend_Controller_Action_Exception(\n \"No auth adapter set\"\n );\n }\n\n return $this->_authAdapter;\n }",
"public function getAuthAdapter()\n {\n if (!$this->_... | [
"0.7517111",
"0.7517111",
"0.70926493",
"0.7074507",
"0.7058152",
"0.69433445",
"0.676704",
"0.66693985",
"0.6613607",
"0.6541378",
"0.6526375",
"0.6520811",
"0.6495131",
"0.6481802",
"0.6472004",
"0.6472004",
"0.6472004",
"0.6472004",
"0.6472004",
"0.6472004",
"0.6472004",
... | 0.8052087 | 0 |
Display a listing of the resource. | public function index()
{
return User::all();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.63424... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
return User::find($id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78550774",
"0.7692893",
"0.7273195",
"0.7242132",
"0.7170847",
"0.70622855",
"0.7053459",
"0.6982539",
"0.69467914",
"0.6945275",
"0.6941114",
"0.6928077",
"0.69019294",
"0.68976134",
"0.68976134",
"0.6877213",
"0.68636996",
"0.68592185",
"0.68566656",
"0.6844697",
"0.6833... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
$user = User::find($id);
//check policy first
$this->authorize('update', $user);
$request->validate([
'firstname' => '',
'lastname' => '',
'email' => 'email | unique:users,email,',
'password' => ['nullable'],
]);
$user->update($request->only(['firstname', 'lastname', 'email']));
if ($request->filled('password')) {
$user->password = bcrypt($request->password);
}
$user->save();
return $user;
} | {
"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)
{
//Find User
$user = User::find($id);
//check policy first
$this->authorize('update', $user);
//Delete user
Profile::destroy($id);
Comment::destroy($id);
Job::destroy($id);
Post::destroy($id);
return User::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 |
Display a listing of the resource. | public function index()
{
return view('backend.pages.reviews.index', ['title' => 'Reviews']);
} | {
"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 |
Remove the specified resource from storage. | public function destroy($id)
{
if ($this->review->find($id)->delete()) {
return Response::json(array(
'deleted' => 1
)
);
}
return Response::json(array(
'deleted' => 0
)
);
} | {
"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 |
Change the active state to blocked or active | public function changeState($id)
{
DB::beginTransaction();
// fetch the deed
$review = $this->review->find($id);
$review->visible = Input::get('state');
if ($review->save()) {
DB::commit();
return Response::json(array(
'changed' => 1
)
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setActive()\n\t\t{\n\t\t\t$this->_state = 1;\n\t\t}",
"public function setActive() {}",
"public function setActive()\n {\n $this->update(['status' => static::STATUS_ACTIVE]);\n }",
"public function setInactive()\r\n {\r\n $this->active = false;\r\n }",
"public func... | [
"0.7470521",
"0.73557156",
"0.7217344",
"0.71412903",
"0.6991776",
"0.6764547",
"0.66991407",
"0.6617581",
"0.65624195",
"0.64563334",
"0.64285225",
"0.6423099",
"0.6394583",
"0.638073",
"0.6318471",
"0.6252152",
"0.62335765",
"0.6222609",
"0.6222609",
"0.6215889",
"0.6215889... | 0.0 | -1 |
get a random review to display on the home page | public function getData()
{
$reviews = $this->review->select('id as i', 'name', 'rating', 'description', 'description_en', 'created_at', 'visible as v')->orderBy('created_at', 'ASC');
return datatables()->of($reviews)
->editColumn('description', '<div class="description_container"><div class="inline_description" data-id="{{ $i }}">{{ $description }}</div></div>')
->editColumn('description_en', '<div class="description_en_container"><div class="inline_description_en" data-id="{{ $i }}">{{ $description_en }}</div></div>')
->addColumn('actions', '<div class="btn-group" role="group"><button class="state_review btn btn-xs btn-info" data-id="{{$i}}" data-state="{{$v}}"><i class="@if($v == 1) icon-checkbox-checked @else icon-checkbox-unchecked @endif"></i></button> <button class="remove_review btn btn-xs btn-danger" data-id="{{$i}}"><i class="icon-trash"></i></button></div>')
->removeColumn('v')
->removeColumn('i')
->rawColumns(['description', 'description_en', 'actions'])
->make();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $viewer = Engine_Api::_()->user()->getViewer();\n\n $params = array(\n 'featured' => 1,\n 'order' => 'random'\n );\n \n $this->view->review = Engine_Api::_()->getDbtable('reviews', 'review')->getReview($params);\n \n if (!$this->view->review) {\n ... | [
"0.6437381",
"0.6401948",
"0.62523925",
"0.6221924",
"0.60027045",
"0.5924952",
"0.58893853",
"0.5888304",
"0.58600396",
"0.58412975",
"0.5840483",
"0.58377117",
"0.5832486",
"0.5789125",
"0.57876295",
"0.57838285",
"0.57277256",
"0.57175773",
"0.57057464",
"0.56922734",
"0.5... | 0.0 | -1 |
/ checks if YouTube video exists | private function validateYoutubeVideo($id_youtube)
{
$headers = get_headers('http://gdata.youtube.com/feeds/api/videos/' . $id_youtube);
if (!strpos($headers[0], '200'))
return false; // video does not exists
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasVideo() {}",
"function isYoutube($url)\n {\n\treturn (substr_count(strtolower($url), \"youtube.com\"));\n }",
"function landtalk_check_youtube_id_valid( $id ) {\n\tif ( empty( $id ) ) {\n\t\treturn false;\n\t}\n\n\t$url = add_query_arg(\n\t\tarray(\n\t\t\t'part' => 'status',\n\t\t\t'id... | [
"0.7620277",
"0.6999222",
"0.67780435",
"0.6568749",
"0.6520824",
"0.6519239",
"0.6497901",
"0.6456665",
"0.63994825",
"0.63982075",
"0.6395107",
"0.6388288",
"0.6324664",
"0.6307082",
"0.6300856",
"0.62773395",
"0.6268459",
"0.6256828",
"0.62420994",
"0.6212979",
"0.6209806"... | 0.7399397 | 1 |
/ checks if product has any assigned videos | private function hasVideos($id_product)
{
return Db::getInstance()->getValue("SELECT COUNT(`id`) FROM `"._DB_PREFIX_."youtube` WHERE `id_product`='$id_product' AND `active`='1'");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasVideo() {}",
"public function product_videos( $product=null )\n\t{\n\t\t$CI =& get_instance();\n\t\t$this->product = ($product != null) ? $product : $this->product;\n\n\t\t$result = $CI->db->where(\"cv.product_id\",$this->product)->from(\"products_item_video AS cv\")->join(\"media_videos AS m... | [
"0.6772142",
"0.65406775",
"0.60900927",
"0.6057279",
"0.60450256",
"0.59278154",
"0.5810182",
"0.58054364",
"0.5792452",
"0.57916605",
"0.5627142",
"0.56171227",
"0.56118757",
"0.56101435",
"0.5608703",
"0.5590502",
"0.55865693",
"0.55720097",
"0.55720097",
"0.55720097",
"0.... | 0.7452454 | 0 |
/ Ordena las categorias se une con el widget de sortable | function cms_reOrder() {
foreach ($this->data["Categoria"] as $id => $posicion) {
$this -> Categoria -> id = $id;
$this -> Categoria -> saveField("posicion", $posicion);
}
echo "yes";
Configure::write('debug', 0);
$this -> autoRender = false;
exit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSortMenu();",
"public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }",
"function sort_admin_categories()\n {\n $this->outer_template = null;\n\n // Require admin login\n ... | [
"0.65796506",
"0.6345059",
"0.61198014",
"0.59969425",
"0.59961057",
"0.59961057",
"0.5847243",
"0.5817415",
"0.5782316",
"0.57674813",
"0.57557017",
"0.57466584",
"0.5744626",
"0.5735735",
"0.5726776",
"0.56511354",
"0.5636979",
"0.5618283",
"0.5618009",
"0.5612012",
"0.5594... | 0.0 | -1 |
Get the view / contents that represent the component. | public function render()
{
return view('components.form.input');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getViewComponent();",
"public function getView() {\n\t\treturn $this -> st_view;\n\t}",
"public function getView() {\n\t\treturn $this->view;\n\t}",
"public function getView() {\n\t\treturn $this->view;\n\t}",
"public function getView()\r\n {\r\n return $this->_controller->getView... | [
"0.7674351",
"0.7261792",
"0.7230966",
"0.7230966",
"0.7227455",
"0.71946317",
"0.7192078",
"0.7184927",
"0.7179126",
"0.7179126",
"0.7179126",
"0.7179126",
"0.7179126",
"0.7179126",
"0.7179126",
"0.7179126",
"0.71563184",
"0.7150517",
"0.71496874",
"0.7144422",
"0.71397746",... | 0.0 | -1 |
If the enum has overridden the `parseDatabase` method, use it to get the cast value | protected function getCastableValue(mixed $value): mixed
{
$value = $this->enumClass::parseDatabase($value);
if ($value === null) {
return null;
}
// If the value exists in the enum (using strict type checking) return it
if ($this->enumClass::hasValue($value)) {
return $value;
}
// Find the value in the enum that the incoming value can be coerced to
foreach ($this->enumClass::getValues() as $enumValue) {
if ($value == $enumValue) {
return $enumValue;
}
}
// Fall back to trying to construct it directly (will result in an error since it doesn't exist)
return $value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetEnumValue(){\n\t\treturn db_enum_value($this->tables[0], $this->fields[0]);\n\t}",
"function get_enum($db, $table, $column) {\n\t// get ENUM values as string to populate a dropdown select (not the what column has what enum assigned but the possible enums themself)\n\n\t//\t$sql = \"SELECT COLU... | [
"0.61950845",
"0.58033305",
"0.56334156",
"0.5629258",
"0.5629258",
"0.55831796",
"0.5496877",
"0.5386859",
"0.5340978",
"0.5327611",
"0.53069067",
"0.5304493",
"0.5242085",
"0.51905245",
"0.518612",
"0.5144378",
"0.5137614",
"0.51319605",
"0.51291305",
"0.51147777",
"0.51038... | 0.60442966 | 1 |
Require Init Functions File | protected function __init_func_loader()
{
require_once(INIT_FUNC_FILE);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadInit() {}",
"public function initialize()\n {\n if (file_exists($this->path.'init.php')) {\n require_once($this->path.'init.php');\n }\n }",
"public function init() {\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitUsers.php');\n\t\trequire(__DIR__ . '... | [
"0.73725533",
"0.72113645",
"0.6878275",
"0.68194246",
"0.6753673",
"0.67479175",
"0.6638716",
"0.66373515",
"0.6627892",
"0.6611482",
"0.6606788",
"0.659789",
"0.658719",
"0.6570231",
"0.65622",
"0.65578824",
"0.6551566",
"0.6536073",
"0.6533895",
"0.65211284",
"0.65189785",... | 0.74994653 | 0 |
Check the configuration and set view vars | private function checkConfig() {
$roleModelName = Configure::read('acl.aro.role.model');
if (! empty($roleModelName)) {
$this->set('roleModelName', $roleModelName);
$this->set('userModelName', Configure::read('acl.aro.user.model'));
$this->set('rolePkName', $this->getRolePrimaryKeyName());
$this->set('userPkName', $this->getUserPrimaryKeyName());
$this->set('roleFkName', $this->_getRoleForeignKeyName());
$this->authorizeAdmins();
if (Configure::read('acl.check_act_as_requester')) {
$is_requester = true;
if (! $this->AclManager->checkAclRequester(
Configure::read('acl.aro.user.model'))) {
$this->set('model_is_not_requester', false);
$is_requester = false;
}
if (! $this->AclManager->checkAclRequester(
Configure::read('acl.aro.role.model'))) {
$this->set('role_is_not_requester', false);
$is_requester = false;
}
if (! $is_requester) {
$this->render('Acl.Aros/admin_not_acl_requester');
}
}
} else {
$this->Session->setFlash(
__d('acl',
'The role model name is unknown. The ACL plugin bootstrap.php file has to be loaded in order to work. (see the README file)'),
'flash_error', null, 'plugin_acl');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function initViewVars()\n {\n $this->viewEngine->vars['loggedUserId'] = $this->model->config->getVar('loggedUserId');\n $this->viewEngine->vars['isUserLogged'] = $this->model->config->getVar('isUserLogged');\n $this->viewEngine->vars['loggedUserRole'] = $this->model->config->get... | [
"0.73819894",
"0.65747166",
"0.65731233",
"0.6472627",
"0.6409084",
"0.6400274",
"0.6400274",
"0.63231105",
"0.63148564",
"0.63109696",
"0.62683535",
"0.6239735",
"0.61769354",
"0.6164895",
"0.61598253",
"0.6156604",
"0.6155691",
"0.61226183",
"0.6114929",
"0.60942304",
"0.60... | 0.0 | -1 |
check for for missing Acos or nodes to prune and update the Controller Hash File | private function checkFileUpdates() {
if ($this->request->params['controller'] != 'acos' || ($this->request->params['action'] != 'admin_synchronize' && $this->request->params['action'] != 'admin_prune_acos' && $this->request->params['action'] != 'admin_build_acl')) {
if ($this->AclManager->isControllerHashFileOutOfSync()) {
$missingAcoNodes = $this->AclManager->getMissingAcos();
$nodesToPrune = $this->AclManager->getAcosToPrune();
$hasUpdates = false;
if (count($missingAcoNodes) > 0) {
$hasUpdates = true;
}
if (count($nodesToPrune) > 0) {
$hasUpdates = true;
}
$this->set('nodesToPrune', $nodesToPrune);
$this->set('missingAcoNodes', $missingAcoNodes);
if ($hasUpdates) {
$this->render('Acl.Acos/admin_has_updates');
$this->response->send();
$this->AclManager->updateControllerHashFile();
exit();
} else {
$this->AclManager->updateControllerHashFile();
}
$this->AclManager->update_controllers_hash_file();
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pruneMissingDirectories(): void\n {\n try {\n Configuration::prune();\n } catch (\\JsonException $e) {\n warning('Invalid configuration file at '.Configuration::path().'.');\n exit;\n }\n }",
"private function cleanHashs() {\n\t\t//$sql ... | [
"0.57330114",
"0.51736265",
"0.50988466",
"0.5017974",
"0.490558",
"0.48949087",
"0.4881771",
"0.48385644",
"0.4832635",
"0.48161834",
"0.47905853",
"0.47737452",
"0.4743827",
"0.47349206",
"0.4733623",
"0.47286183",
"0.4724922",
"0.4708866",
"0.46837717",
"0.468364",
"0.4682... | 0.6815893 | 0 |
Authorize Admins for access to the Admin area. | private function authorizeAdmins() {
$authorizedRoleIds = Configure::read('acl.role.access_plugin_role_ids');
$authorizedUserIds = Configure::read('acl.role.access_plugin_user_ids');
$modelRoleFk = $this->_getRoleForeignKeyName();
if (in_array($this->Auth->user($modelRoleFk), $authorizedRoleIds) || in_array(
$this->Auth->user($this->getUserPrimaryKeyName()),
$authorizedUserIds)) {
// Allow all actions. CakePHP 2.0
$this->Auth->allow('*');
// Allow all actions. CakePHP 2.1
$this->Auth->allow();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n return Gate::allows('admin');\n }",
"public function authorize()\n {\n return Gate::allows('admin');\n }",
"public static function authAdmin() {\n if (Yii::$app->user->can(\"administrator\") || Yii::$app->user->can(\"adminsite\")) {\n ... | [
"0.7631978",
"0.7631978",
"0.74966955",
"0.74205786",
"0.740605",
"0.73730934",
"0.73479766",
"0.7312293",
"0.7306907",
"0.7237257",
"0.72363514",
"0.72122437",
"0.7208024",
"0.7203129",
"0.7182813",
"0.71687454",
"0.71657455",
"0.71657455",
"0.71657455",
"0.71304035",
"0.711... | 0.79690534 | 0 |
Get the Aco passed as an url parameter | protected function getPassedAcoPath() {
$acoPath = '';
if (isset($this->params['named']['plugin'])) {
$acoPath = $this->params['named']['plugin'];
}
if (empty($acoPath)) {
$acoPath .= $this->params['named']['controller'];
} else {
$acoPath .= '/' . $this->params['named']['controller'];
}
$acoPath .= '/' . $this->params['named']['action'];
return $acoPath;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getAsso()\r\n {\r\n return $this->get('asso_am.asso_selector')->getAsso();\r\n }",
"protected function getAssoId()\r\n {\r\n return $this->get('asso_am.asso_selector')->getAssoId();\r\n }",
"public function getAtocom()\n {\n return $this->atocom;\n }",
... | [
"0.6314992",
"0.5767865",
"0.56962717",
"0.56341916",
"0.54825413",
"0.5309926",
"0.5264007",
"0.5230006",
"0.5218084",
"0.50830007",
"0.501909",
"0.49902704",
"0.49557215",
"0.493336",
"0.49329585",
"0.49236137",
"0.4916106",
"0.4915516",
"0.4912758",
"0.48910385",
"0.489103... | 0.66496086 | 0 |
Set the Aco Variables | protected function setAcoVariables() {
$this->set('plugin',
isset($this->params['named']['plugin']) ? $this->params['named']['plugin'] : '');
$this->set('controller_name', $this->params['named']['controller']);
$this->set('action', $this->params['named']['action']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setVariables()\n \t{\t\n \t\tif (isset($this->params->plugin)) {\n \t\t\t$this->setPlPath(App::pluginPath(Inflector::humanize($this->params->plugin)));\n \t\t}\n \t\t$this->setController($this->params->controller);\n \t\t$this->setAction($this->params->action);\n \t\t$this->setConstant(Confi... | [
"0.6426496",
"0.63845694",
"0.6160323",
"0.61217064",
"0.59801626",
"0.5944837",
"0.5867351",
"0.58112305",
"0.57892907",
"0.5781792",
"0.5739037",
"0.5672007",
"0.56626254",
"0.56445134",
"0.5637403",
"0.56333673",
"0.5633296",
"0.5622706",
"0.5604848",
"0.55785626",
"0.5564... | 0.8083901 | 0 |
Get the name of the Primary Key | public function getRolePrimaryKeyName() {
$forcedPkName = Configure::read('acl.aro.role.primary_key');
if (! empty($forcedPkName)) {
return $forcedPkName;
} else {
/* Return the primary key's name that follows the CakePHP
* conventions */
return 'id';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPrimaryKeyName()\n {\n return self::$primary_key_name;\n }",
"protected function getPrimaryKeyName(): string\n {\n return $this->query->getModel()->getKeyName();\n }",
"public function getPrimaryKeyName()\n {\n return $this->primaryKeyName;\n }",
"pub... | [
"0.8802069",
"0.86419415",
"0.8611568",
"0.84539366",
"0.8401211",
"0.8294184",
"0.82471144",
"0.8239536",
"0.8233553",
"0.8187097",
"0.8114791",
"0.8112787",
"0.8105451",
"0.809935",
"0.80548555",
"0.80479753",
"0.7973346",
"0.79243207",
"0.79243207",
"0.78962404",
"0.780480... | 0.788415 | 20 |
Get the Primary Key Name for the User Model | public function getUserPrimaryKeyName() {
$forcedPkName = Configure::read('acl.aro.user.primary_key');
if (! empty($forcedPkName)) {
return $forcedPkName;
} else {
/* Return the primary key's name that follows the CakePHP
* conventions */
return 'id';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function primaryKey() {\n return (new static)->getKeyName();\n }",
"public function getPrimaryKeyName()\n {\n return self::$primary_key_name;\n }",
"private function userKeyName()\n {\n $userModel = config('follow.user');\n\n return (new $userModel)->getKey... | [
"0.81207246",
"0.80537635",
"0.80530363",
"0.8032713",
"0.803236",
"0.79726744",
"0.79648507",
"0.7948807",
"0.79371184",
"0.7924475",
"0.7910404",
"0.78667253",
"0.78244376",
"0.77758414",
"0.77562934",
"0.77033526",
"0.77033526",
"0.76473117",
"0.75378853",
"0.75027096",
"0... | 0.8695527 | 0 |
Get the Foreign Key Name for the Role Model | protected function _getRoleForeignKeyName() {
$forcedFkName = Configure::read('acl.aro.role.foreign_key');
if (! empty($forcedFkName)) {
return $forcedFkName;
} else {
/* Return the foreign key's name that follows the CakePHP
* conventions */
return Inflector::underscore(Configure::read('acl.aro.role.model')) . '_id';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getForeignKeyName() {\n return $this->foreignKeyName;\n }",
"public function getForeignKey()\n {\n return $this->getTableSingular().'_'.$this->getKeyName();\n }",
"public function getQualifiedForeignKeyName()\n {\n return $this->foreignKey;\n }",
"public fu... | [
"0.7569259",
"0.75360084",
"0.7419114",
"0.73863214",
"0.73412377",
"0.7316087",
"0.7259885",
"0.71900666",
"0.7155617",
"0.7107631",
"0.70518327",
"0.6753322",
"0.66961634",
"0.66732",
"0.66642493",
"0.66597706",
"0.6655589",
"0.6647459",
"0.6642061",
"0.6631837",
"0.6591524... | 0.85481507 | 0 |
redirect to the referring page or the admin_index action. | protected function _returnToReferer() {
return $this->redirect(
$this->referer(
array(
'action' => 'admin_index'
)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function redirect() {\n\t\theader('Location: admin.php');\n\t\texit();\n\t}",
"public static function redirect() {\n\t\tunset( $_GET['action'] );\n\n\t\twp_safe_redirect( admin_url( 'admin.php?page=' . WPFC_QS_Setup::get_template_name() . '-setup' ) );\n\n\t\texit();\n\t}",
"public function index()\n {\n ... | [
"0.7361207",
"0.7289132",
"0.72034097",
"0.7177263",
"0.7059238",
"0.7026167",
"0.6996214",
"0.69860095",
"0.6976114",
"0.69076633",
"0.6881888",
"0.6802216",
"0.6802216",
"0.6802216",
"0.67744046",
"0.67598134",
"0.67345256",
"0.67100114",
"0.6705284",
"0.6701056",
"0.668244... | 0.77819353 | 0 |
generate() performs the duties of this page and is called during execution | function page_GuideData($courseData, $displayParam) {
global $app;
// get LibApps config values as well as the ruleset
$libapps = getCfg("libapps");
$ruleset = new GuideRuleSet();
$gObj = new GuideData($courseData, $displayParam, $libapps['apiDomain'], $libapps['siteID'], getCfg('app-secrets')['libapps']['apiKey'], $ruleset, $libapps['subjexclude'], $libapps['defaultSearchGroup']);
$gObj->init();
$g = $gObj->getAll();
logMsg("Guide request for ".$courseData['id'], $g);
$app['guides'] = $g['guides']; // api
$app['subjects'] = $g['subjects']; // api
$app['databases'] = $g['databases']; // api
$app['librarian'] = $g['profiles']; // api
$app['course'] = $g['course'];
$app['coursematerials'] = array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generatePage_postProcessing() {}",
"abstract protected function view_generatePageContent();",
"private function buildPage() {\n ob_clean();\n ob_start();\n\n //session_start();\n require_once $this->_template;\n\n $this->_page = ob_get_clean();\n }",
"public function generate(... | [
"0.7119313",
"0.7039277",
"0.689197",
"0.6831564",
"0.67443365",
"0.6603778",
"0.6541911",
"0.65355104",
"0.65325576",
"0.6514206",
"0.64600575",
"0.64475715",
"0.64018476",
"0.63958335",
"0.63958335",
"0.6395799",
"0.6395799",
"0.6395799",
"0.6395799",
"0.6395799",
"0.635544... | 0.0 | -1 |
$sql is a string which contains $1 to $n parameters and $param_array must supply the correct amount of string parameters in the correct order. Zero parameters are also allowed | function execute_params($sql, $param_array)
{
// Using an empty string as stmtname here overwrites any
// previous prepared statement making multiple prepares
// easily doable
$q = pg_prepare($this->connection, '', $sql);
$q = pg_execute($this->connection, '', $param_array);
$rows = array();
while($r = pg_fetch_array($q, null, PGSQL_ASSOC))
{
array_push($rows, $r);
}
pg_free_result($q);
return $rows;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setParams($sql, $params)\n{\n\t$has_params = false;\n\t\n\t$pat = $this->SQL_PARAM_PATTERN;\n\tif (strpos($sql, '{')) $has_params = true;\n\tif ($this->config['pclib.compatibility']['sql_syntax'] and strpos($sql, '[')) {\n\t\t$has_params = true;\n\t\t$pat = \"/\\[([#\\?\\!]?)([a-z0-9_]+)\\]/i\";\n\t}\n\ti... | [
"0.7089347",
"0.7055418",
"0.69063294",
"0.6806215",
"0.6777838",
"0.66843504",
"0.6653871",
"0.66308755",
"0.65509635",
"0.65400493",
"0.64663815",
"0.6454364",
"0.6415091",
"0.6411967",
"0.6393609",
"0.6391266",
"0.635393",
"0.6343606",
"0.6310819",
"0.6306672",
"0.62978935... | 0.7140548 | 0 |
$sql is a string with no parameters | function execute($sql)
{
$q = pg_query($sql) or die('Query failed: ' . pg_last_error());
$rows = array();
while($r = pg_fetch_array($q, null, PGSQL_ASSOC))
{
array_push($rows, $r);
}
pg_free_result($q);
return $rows;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function query(string $sql);",
"public function fetchSqlString();",
"function sql($sql)\n\t{\n\n\t}",
"public function _clean_by_sql($sql = '')\n {\n }",
"public function query($sql = null);",
"public function query ($sqlString);",
"function sqlQuery($sql){\r\n\t\t$con->testmodeEcho($sql, ... | [
"0.74276507",
"0.73753804",
"0.7299624",
"0.7234915",
"0.7140678",
"0.7065686",
"0.7063434",
"0.6982136",
"0.6967203",
"0.6948657",
"0.6924587",
"0.6924587",
"0.6924587",
"0.6924587",
"0.692238",
"0.68959826",
"0.6874919",
"0.6874066",
"0.68280596",
"0.68044317",
"0.67939585"... | 0.0 | -1 |
This method should be overriden to handle requests to a controller from the web app | public abstract function processRequest(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }",
"public function handleReq... | [
"0.76366717",
"0.7590859",
"0.75122344",
"0.702995",
"0.6882258",
"0.6745427",
"0.67073464",
"0.6706052",
"0.6683487",
"0.6643251",
"0.66411024",
"0.6596901",
"0.65963507",
"0.65365463",
"0.65293056",
"0.65243316",
"0.6481427",
"0.6480582",
"0.6478707",
"0.64639384",
"0.64533... | 0.0 | -1 |
Used to remove bad input from either a GET'd or POST'd form variable | public function sanitize($request_field, $type) {
switch($type) {
case "email":
$out = filter_input(INPUT_GET,
$request_field, FILTER_SANITIZE_EMAIL);
if($out === false) {
$out = filter_input(INPUT_POST,
$request_field, FILTER_SANITIZE_EMAIL);
}
break;
case "string":
$out = filter_input(INPUT_GET,
$request_field, FILTER_SANITIZE_STRING);
if($out === false) {
$out = filter_input(INPUT_POST,
$request_field, FILTER_SANITIZE_STRING);
}
break;
default:
$out = "";
}
return $out;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }",
"protected fun... | [
"0.67657924",
"0.6611784",
"0.6456173",
"0.64221996",
"0.64126855",
"0.63949996",
"0.63582677",
"0.6334755",
"0.63221896",
"0.6319415",
"0.62881356",
"0.6287171",
"0.62116665",
"0.6179333",
"0.6150595",
"0.6131559",
"0.6127376",
"0.6118516",
"0.61030513",
"0.60571605",
"0.605... | 0.0 | -1 |
Used to check if the provided $variable is of $type. | public function validate($variable, $type) {
switch($type) {
case "email":
$valid = filter_var($variable, FILTER_VALIDATE_EMAIL);
break;
case "url":
$valid = filter_var($variable, FILTER_VALIDATE_URL);
break;
default:
$valid = false;
break;
}
return $valid;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function is_type( $type ) {\n\t\tif ( 'variable' == $type || ( is_array( $type ) && in_array( 'variable', $type ) ) ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn parent::is_type( $type );\n\t\t}\n\t}",
"function is_type_of(mixed $var, string ...$types): bool\n{\n $var_type = strtolower(get_debug_... | [
"0.76078147",
"0.73024774",
"0.7015623",
"0.688433",
"0.670352",
"0.66899526",
"0.65855217",
"0.6500075",
"0.6500075",
"0.64862466",
"0.6474049",
"0.6375837",
"0.6350485",
"0.6321905",
"0.63138914",
"0.62842023",
"0.61914444",
"0.6137475",
"0.6135796",
"0.61303115",
"0.609264... | 0.7130578 | 2 |
Used to get a singleton instance of the given view. | public function view($name) {
static $loaded_views = [];
if (!empty($loaded_views[$name])) {
return $loaded_views[$name];
}
$class_name = ucfirst($name) . "View";
$full_name = B\NS_VIEWS . $class_name;
$view_folder = __DIR__ . "/../views/";
$path_name = $view_folder . $class_name . ".php";
if (file_exists($path_name)) {
require_once $path_name;
$loaded_views[$name] = new $full_name();
return $loaded_views[$name];
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"Public Static Function Instance($template = null){\r\n return new View($template);\r\n }",
"public static function getInstance( $key )\n\t\t{\n\t\t\tif ( !array_key_exists( $key, self::$_instanceMap ) ) self::$_instanceMap[ $key ] = new View( $key );\n\n\t\t\treturn self::$_instanceMap[ $key ];... | [
"0.7236729",
"0.7057422",
"0.6998144",
"0.6906143",
"0.6643412",
"0.6639887",
"0.6618556",
"0.6432019",
"0.6431364",
"0.63765574",
"0.63710487",
"0.62415713",
"0.6226642",
"0.61917716",
"0.61917365",
"0.6191004",
"0.6183961",
"0.6176135",
"0.6176135",
"0.6174748",
"0.6174748"... | 0.0 | -1 |
9 EXPORTAR: PDF Funcion para exportar PDF | public function exportarpdf(Request $request){
// 0- ORDEN FILTROS
//ORDENAMIENTO
// ASCENDENTE - DESCENTE
$this->m_canuint_ordene=$request->m_canuint_ordene;
// NOMBRE CAMPO
$this->m_canuint_campos=$request->m_canuint_campos;
// FILTROS
$this->m_caplaca_filtro=$request->m_caplaca;
$this->m_canuint_filtro=$request->m_canuint;
$this->m_nucociu_filtro=$request->m_nucociu;
$this->m_cadacon_filtro=$request->m_cadacon;
$this->m_caidpac_filtro=$request->m_caidpac;
$this->m_caestad_filtro=$request->m_caestad;
$this->m_causreg_filtro=$request->m_causreg;
$this->m_causact_filtro=$request->m_causact;
$vehiculos = Capmvehi::Nuipe($this->m_caplaca_filtro)->
Numerointerno($this->m_canuint_filtro)->
Nombre_ciudad($this->m_nucociu_filtro)->
Nombre_contacto($this->m_cadacon_filtro)->
Codigo_nacional($this->m_caidpac_filtro)->
estado($this->m_caestad_filtro)->
usuario_registra($this->m_causreg_filtro)->
usuario_actualiza($this->m_causact_filtro)->
orderBy($this->m_canuint_campos,$this->m_canuint_ordene)->get();
$barra = new DNS1D();
$pdf = \App::make('dompdf.wrapper');
$vista = \view('admin.vehiculos.vehiculos.vehiculos.exportarpdf',compact('vehiculos'))->render();
$pdf->loadHTML($vista);
// Obtiene fecha y hora actual
$fecha_actual = new DateTime();
// Convierte fecha y hora actual a texto
$cadena_fecha_actual = $fecha_actual->format("d/m/Y/h/i/s/a");
// Nombre archivo exportacion
$nombre_archivo = 'vehiculos_'.$cadena_fecha_actual.'.pdf';
// Resultados
return $pdf->download($nombre_archivo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function exportpdfAction(){ \r\n $id = $this->_getParam('id'); \r\n $sympC = new SympathieCollection();\r\n $symp = $sympC->getDetails($id);\r\n $obiC = new ObituaryCollection();\r\n $obi = $obiC->getDetailsFromNoContract($symp['SD_noContract'])... | [
"0.7548537",
"0.7542988",
"0.75356543",
"0.73674786",
"0.7164493",
"0.71178246",
"0.7012998",
"0.70127916",
"0.69695795",
"0.6934141",
"0.6918378",
"0.68731236",
"0.6872049",
"0.6837302",
"0.681815",
"0.67712927",
"0.6711011",
"0.67072904",
"0.66852653",
"0.6663429",
"0.66552... | 0.62304693 | 68 |
10 EXPORTAR: HOJA DE CALCULO Funcion para exportar HOJA DE CALCULO | public function exportarexcel(Request $request){
// 0- ORDEN FILTROS
//ORDENAMIENTO
// ASCENDENTE - DESCENTE
$this->m_canuint_ordene=$request->m_canuint_ordene;
// NOMBRE CAMPO
$this->m_canuint_campos=$request->m_canuint_campos;
// FILTROS
$this->m_caplaca_filtro=$request->m_caplaca;
$this->m_canuint_filtro=$request->m_canuint;
$this->m_nucociu_filtro=$request->m_nucociu;
$this->m_cadacon_filtro=$request->m_cadacon;
$this->m_caidpac_filtro=$request->m_caidpac;
$this->m_caestad_filtro=$request->m_caestad;
$this->m_causreg_filtro=$request->m_causreg;
$this->m_causact_filtro=$request->m_causact;
// Obtiene fecha y hora actual
$fecha_actual = new DateTime();
// Convierte fecha y hora actual a texto
$cadena_fecha_actual = $fecha_actual->format("d/m/Y/h/i/s/a");
// Nombre archivo exportacion
$nombre_archivo = 'vehiculos_'.$cadena_fecha_actual;
Excel::create($nombre_archivo, function($excel) {
$excel->sheet('Vehículos', function($sheet) {
// 0- CONSULTA
$vehiculos = Capmvehi::Nuipe($this->m_caplaca_filtro)->
Numerointerno($this->m_canuint_filtro)->
Nombre_ciudad($this->m_nucociu_filtro)->
Nombre_contacto($this->m_cadacon_filtro)->
Codigo_nacional($this->m_caidpac_filtro)->
estado($this->m_caestad_filtro)->
usuario_registra($this->m_causreg_filtro)->
usuario_actualiza($this->m_causact_filtro)->
orderBy($this->m_canuint_campos,$this->m_canuint_ordene)->get();
foreach($vehiculos as $vehiculo){
$ciudad = Capmciud::where('m_nucodig',$vehiculo->m_nucociu)->first();
$departamento = Capmdepa::where('m_nucodig',$ciudad->m_nucodep)->first();
$pais = Capmpais::where('m_nucodig',$departamento->m_nucopai)->first();
$oficina_registro = Capmsucu::where('m_nucodig',$vehiculo->m_nuofici)->first();
$ciudad_x[]=$ciudad->m_canuint;
$departamento_x[]=$departamento->m_canuint;
$pais_x[]=$pais->m_canuint;
}
// 1- EMPRESA RAZON SOCIAL
$emp_raz_soc = Auth::user()->empresa->m_carazso;
// 2- EMPRESA NUIPE
$emp_nui_pes = Auth::user()->empresa->m_caplaca;
// 3- OFICINA NOMBRE
$ofi_nom_bre = Auth::user()->oficina->m_canuint;
// 4- OFICINA UBICACION REGIONAL - VARIABLE GLOBAL
// Session::get('glo_ofi_ubi_reg'
// 5- APLICATIVO NOMBRE
$app_nom_bre = 'mistiquetes.com';
// 6- TITULO CONSULTA
$tit_con_sul = 'CONSULTA DE VEHICULOS';
// 20- TOTAL REGISTROS
$tot_reg_ist = $vehiculos->Count();
// 21- GENERADO FECHA HORA
$fecha_hora = new DateTime();
setlocale(LC_TIME,"es_ES");
date_default_timezone_set ('America/Bogota');
$fec_hor_gen = strftime("El %A, %d de %B del %Y - %r - Spreadsheet (Hoja de calculo)");
// 22- GENERADO USUARIO
$usu_gen_era = Auth::user()->name;
// 23- GENERADO NOTICIA
$not_cla_con = 'Aplican cláusulas de confidencialidad en el manejo de información';
// 1- EMPRESA RAZON SOCIAL
$sheet->row(1, array($emp_raz_soc));
// ESTILO
$sheet->mergeCells('A1:L1');
$sheet->row(1, function ($row) {
$row->setFontFamily('Arial');
$row->setFontSize(14);
});
// 2- EMPRESA NUIPE
$sheet->row(2, array($emp_nui_pes));
// ESTILO
$sheet->mergeCells('A2:L2');
$sheet->row(2, function ($row) {
$row->setFontFamily('Arial');
$row->setFontSize(12);
});
// 3- OFICINA NOMBRE
$sheet->row(3, array($ofi_nom_bre));
// ESTILO
$sheet->mergeCells('A3:L3');
$sheet->row(3, function ($row) {
$row->setFontFamily('Arial');
$row->setFontSize(12);
});
// 4- OFICINA UBICACION REGIONAL
$sheet->row(4, array(Session::get('glo_ofi_ubi_reg')));
// ESTILO
$sheet->mergeCells('A4:L4');
$sheet->row(4, function ($row) {
$row->setFontFamily('Arial');
$row->setFontSize(12);
});
// 5- APLICATIVO NOMBRE
$sheet->row(5, array($app_nom_bre));
// ESTILO
$sheet->mergeCells('A5:L5');
$sheet->row(5, function ($row) {
$row->setFontFamily('Arial');
$row->setFontSize(12);
});
// 6- TITULO CONSULTA
$sheet->row(6, array($tit_con_sul));
// IMPORTANTE: ESTILO - UNA CELDA ANTES DE LA FINAL
$sheet->mergeCells('A6:AD6');
$sheet->row(6, function ($row) {
$row->setFontFamily('Arial');
$row->setFontSize(12);
});
// ENCABEZADOS
$sheet->row(7, [
'Identificador', 'NUIP', 'DV',
'Tipo de documento','Conductor',
'Primer nombre','Segundo nombre','Primer apellido','Segundo apellido',
'Dirección','Ciudad','Departamento','País',
'Telefóno fijo', 'Telefóno móvil', 'Portal Web',
'Correo electrónico', 'Contacto', 'Código autorización',
'Código nacional', 'Estado',
'Vínculo empresarial', 'Oficina de registro',
'Registro', 'Usuario', 'actualizado', 'Usuario',
'Total registros', 'Generado fecha - hora', 'Generado usuario', 'Noticia'
]);
// ESTILO
$sheet->Cells('A7:Z7');
$sheet->row(7, function ($row) {
// Fuente
$row->setFontFamily('Arial');
// Negrita
$row->setFontWeight('bold');
// Tamaño
$row->setFontSize(10);
// Alineamiento
$row->setAlignment('center');
// Fondo
$row->setBackground('#4eb24d');
// Bordes - Set all borders (top, right, bottom, left)
$row->setBorder('thin','thin','thin','thin');
});
// REGISTROS
//13-10-2018
$j=0;
foreach($vehiculos as $index => $vehiculo) {
// ESTILO
$sheet->Cells('A8:Z100000');
$sheet->row($index+8, function ($row) {
$row->setFontFamily('Arial');
$row->setFontSize(10);
});
if ($index) {
$sheet->row($index+8, [
$vehiculo->m_nucodig,
$vehiculo->m_caplaca, $vehiculo->m_nudiver,
$vehiculo->tiposdocumentos->m_canuint,
$vehiculo->m_canuint,
$vehiculo->m_caprnom, $vehiculo->m_casenom,
$vehiculo->m_caprape, $vehiculo->m_caseape,
$vehiculo->m_cadirec, $vehiculo->ciudades->m_canuint,
$departamento_x[$j],
$pais_x[$j],
$vehiculo->m_catelfi, $vehiculo->m_camovil, $vehiculo->m_casitew,
$vehiculo->m_cacorel, $vehiculo->m_cadacon, $vehiculo->m_caautna,
$vehiculo->m_caidpac, $vehiculo->m_caestad,
$vehiculo->m_caviemp, $vehiculo->oficina_registro->m_canuint,
$vehiculo->created_at, $vehiculo->usuario_registra->name,
$vehiculo->updated_at, $vehiculo->usuario_actualiza->name,
]);
} else {
$sheet->row($index+8, [
$vehiculo->m_nucodig,
$vehiculo->m_caplaca, $vehiculo->m_nudiver,
$vehiculo->tiposdocumentos->m_canuint,
$vehiculo->m_canuint,
$vehiculo->m_caprnom, $vehiculo->m_casenom,
$vehiculo->m_caprape, $vehiculo->m_caseape,
$vehiculo->m_cadirec, $vehiculo->ciudades->m_canuint,
$departamento_x[$j],
$pais_x[$j],
$vehiculo->m_catelfi, $vehiculo->m_camovil, $vehiculo->m_casitew,
$vehiculo->m_cacorel, $vehiculo->m_cadacon, $vehiculo->m_caautna,
$vehiculo->m_caidpac, $vehiculo->m_caestad,
$vehiculo->m_caviemp, $vehiculo->oficina_registro->m_canuint,
$vehiculo->created_at, $vehiculo->usuario_registra->name,
$vehiculo->updated_at, $vehiculo->usuario_actualiza->name,
$tot_reg_ist, $fec_hor_gen, $usu_gen_era, $not_cla_con
]);
}
//13-10-2018
$j++;
}
// PIE
// ESTILO
$sheet->row(($tot_reg_ist+9), function ($row) {
// Fuente
$row->setFontFamily('Arial');
// Negrita
$row->setFontWeight('bold');
// Tamaño
$row->setFontSize(10);
// Alineamiento
$row->setAlignment('center');
// Fondo
$row->setBackground('#4eb24d');
// Bordes - Set all borders (top, right, bottom, left)
$row->setBorder('thin','thin','thin','thin');
});
});
})->export('xlsx');
return redirect()->route('vehiculos.index');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exportarDatos(){\n\t\t$this->objFunc=$this->create('MODResultadoPlantilla');\t\t\n\t\t\n\t\t$this->res = $this->objFunc->exportarDatos();\n\t\t\n\t\tif($this->res->getTipo()=='ERROR'){\n\t\t\t$this->res->imprimirRespuesta($this->res->generarJson());\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$nombreArchivo = $this->c... | [
"0.64816993",
"0.6454423",
"0.63283974",
"0.63088953",
"0.6263856",
"0.6225978",
"0.62014586",
"0.61634815",
"0.615945",
"0.61212456",
"0.6114265",
"0.6109386",
"0.603245",
"0.60239863",
"0.60239863",
"0.60239863",
"0.60239863",
"0.60239863",
"0.60076505",
"0.60052323",
"0.59... | 0.5434518 | 95 |
11 NOTIFICACIONES NOTIFICACIONES USUARIO | public function notification($type)
{
switch ($type) {
case 'message':
alert()->message('Notificación solo con mensaje');
break;
case 'basic':
alert()->basic('Notificación Básica, mensaje y título', 'Título');
break;
case 'info':
alert()->info('Notificación tipo Información');
break;
case 'success':
alert()->success('Notificación de Éxito.','Título')->autoclose(3000);
break;
case 'error':
alert()->error('Notificación de Error');
break;
case 'warning':
alert()->warning('Notificación de Advertencia');
break;
}
return redirect()->route('home');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function recepcionUsuario($nombre , $password){\n\t\t\t$result_child = $this->_db->query(\"SELECT * FROM usuario WHERE login_usu = '\".$nombre.\"'\");\n\t\t\t$retorna_child = $result_child->fetch_all(MYSQL_ASSOC);\n\n\t\t\t//mensaje por defecto indicando que no se registro\n\t\t\t//genera mensaje para el si... | [
"0.5902636",
"0.58718246",
"0.58545405",
"0.5835639",
"0.5809908",
"0.5809003",
"0.58007425",
"0.578646",
"0.5776636",
"0.57624876",
"0.57418495",
"0.5718892",
"0.57164574",
"0.5716178",
"0.5715364",
"0.57058275",
"0.5693342",
"0.56877506",
"0.5687582",
"0.5687543",
"0.566801... | 0.0 | -1 |
Skip translation file reading for default locale. | public function register(Environment $environment): void
{
if ($this !== self::default()) {
$translator = Loader::getInstance();
$translator->setlocale($this->value);
$translator->textdomain('default');
$translator->bindtextdomain('default', $environment->getBaseDirectory() . '/resources/locale');
}
Loader::loadFunctions();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function load_default_textdomain($locale = \\null)\n {\n }",
"function SL_old($locale) {\n\n \t$filePath = $this->localizationPath.$locale.\".php\";\n \tif (file_exists($filePath)) {\n \t\trequire_once($filePath);\n \t} else {\n \t\tthrow new Exception('Can not load locale '.$filePath);\n ... | [
"0.63068426",
"0.62525725",
"0.6248865",
"0.6096594",
"0.6090796",
"0.59316796",
"0.5909315",
"0.58981335",
"0.5884485",
"0.5829003",
"0.5819432",
"0.5818257",
"0.57971406",
"0.5743409",
"0.57426834",
"0.57209516",
"0.57057285",
"0.57032126",
"0.56849676",
"0.56653434",
"0.56... | 0.0 | -1 |
Retrieves a list of models based on the current search/filter conditions. Typical usecase: Initialize the model fields with values from filter form. Execute this method to get CActiveDataProvider instance which will filter models according to data in model fields. Pass data provider to CGridView, CListView or any similar widget. | public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.
$criteria=new CDbCriteria;
$criteria->compare('idesp_ing',$this->idesp_ing);
$criteria->compare('idingreso_esp_ing',$this->idingreso_esp_ing);
$criteria->compare('idespecie_esp_ing',$this->idespecie_esp_ing);
$criteria->compare('fecha',$this->fecha,true);
$criteria->compare('hora',$this->hora,true);
$criteria->compare('color',$this->color,true);
$criteria->compare('precio',$this->precio);
$criteria->compare('stock',$this->stock);
return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function search()\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('id',$this->id);\n\t\t//$criteria->compare('object_id',$this->object_id);\n\t\t$criteria->compare('object_type_id',$this->object... | [
"0.7213206",
"0.713612",
"0.70938337",
"0.7093002",
"0.69858676",
"0.6960803",
"0.69480467",
"0.6941687",
"0.6933831",
"0.6924013",
"0.6910334",
"0.69030845",
"0.6898343",
"0.68980265",
"0.6892977",
"0.68826646",
"0.68795866",
"0.6874432",
"0.6848758",
"0.6848734",
"0.6834556... | 0.0 | -1 |
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants! | public static function model($className=__CLASS__)
{
return parent::model($className);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function model() {\n return parent::model(get_called_class());\n }",
"public function model()\r\n {\r\n return static::class;\r\n }",
"public static function model($className=__CLASS__) { return parent::model($className); }",
"public static function model($className=__CLA... | [
"0.757441",
"0.7528538",
"0.72709787",
"0.7269166",
"0.7261262",
"0.7212218",
"0.7211229",
"0.71310693",
"0.7127921",
"0.7127921",
"0.71018285",
"0.71018285",
"0.7101606",
"0.70739484",
"0.7063319",
"0.7063319",
"0.7063319",
"0.7063319",
"0.7063319",
"0.7063319",
"0.7063319",... | 0.0 | -1 |
This method returns a single record based on primary key $dsh_id | public function select(){
try {
global $ks_db;
global $ks_log;
if (! isset ( $this->id )) {
echo "Fatal Error: Id is not set for the object! Please do \$objA->setId(\$dsh_id); in: " . __METHOD__;
exit ();
}
//count how many rows found
if($this->exists ()) {
$sql = "SELECT * FROM $this->sqlTable WHERE dsh_id = ?";
$stmt = $ks_db->query ( $sql, $this->id );
//record is found, associate columns to the object properties
while ( true == ($row = $stmt->fetch ()) ) {
$this->id = $row ['dsh_id'];
$this->title = $row ['dsh_title'];
$this->desc = $row ['dsh_desc'];
$this->portlet = $row ['dsh_portlet'];
$this->hide = $row ['dsh_hide'];
$this->createdBy = $row ['dsh_created_by'];
$this->modifiedBy = $row ['dsh_modified_by'];
$this->createdDate = $row ['dsh_created_date'];
$this->modifiedDate = $row ['dsh_modified_date'];
}
} else {
echo "No record found with primary column ($this->id) from table ($this->sqlTable).";
}
} catch(Exception $e) {
$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );
$ks_log->info ( '<br>SQL Statement: ' . $sql);
echo "Fatal Error: " . __METHOD__ . '. ' . $e->getMessage ();
echo "SQL Statement: " . $sql;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRecord($id){\n\t\t$req = \"SELECT * FROM $this->table WHERE mdr_id = '$id' LIMIT 1\";\n\t\t$res = $this->select($req);\n\t\treturn $res[0];\n\t}",
"public static function sdGetOne($sId){\n\t\t$sql = \"SELECT * FROM ts_shirt_design WHERE s_id=\".smFunctions::checkInput($sId).\" \";\n\t\t$query ... | [
"0.6621309",
"0.66006404",
"0.6560324",
"0.6560324",
"0.6484012",
"0.64318097",
"0.63333637",
"0.6284888",
"0.62811077",
"0.6274679",
"0.6245663",
"0.61827606",
"0.61729807",
"0.61609197",
"0.61418366",
"0.611993",
"0.6119749",
"0.61131173",
"0.611165",
"0.6101702",
"0.607809... | 0.59924537 | 32 |
This method check whether the supplied primary key $dsh_id exists or not | public function exists(){
try {
global $ks_db;
global $ks_log;
$bReturn = false;
if (! isset ( $this->id )) {
echo "Fatal Error: Id is not set for the object! Please do \$objA->setId(\$dsh_id); in: " . __METHOD__;
exit ();
}
$sql = "SELECT COUNT(*) as totalRow FROM $this->sqlTable WHERE dsh_id = ?";
//count how many rows found
$totalRow = $ks_db->fetchOne ( $sql, $this->id );
if ($totalRow > 0) {
$bReturn = true;
}else {
$bReturn = false;
}
return $bReturn;
} catch(Exception $e) {
$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );
$ks_log->info ( '<br>SQL Statement: ' . $sql);
echo "Fatal Error: " . __METHOD__ . '. ' . $e->getMessage ();
echo "SQL Statement: " . $sql;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private static function KeyExists($id, $key)\n {\n global $SESSDB;\n \n $q = $SESSDB->prepare(\"SELECT COUNT(id) FROM `sdat` WHERE id=:id AND pkey=:key\");\n $q->bindParam(':id', $id, PDO::PARAM_INT);\n $q->bindParam(':key', $key);\n $q->execute();\n\n $result = ... | [
"0.6575605",
"0.64779884",
"0.63994676",
"0.6291113",
"0.62721914",
"0.6246964",
"0.6206025",
"0.61375153",
"0.60984004",
"0.6077715",
"0.60469276",
"0.5994472",
"0.5990669",
"0.5954009",
"0.59210426",
"0.59045076",
"0.5898235",
"0.5895467",
"0.58408785",
"0.5837751",
"0.5837... | 0.65306145 | 1 |
This method inserts a single record | public function insert() {
try {
global $ks_db;
global $ks_log;
$ks_db->beginTransaction ();
$arrBindings = array ();
$insertCols = '';
$insertVals = '';
if (isset ( $this->title )) {
$insertCols .= "dsh_title, ";
$insertVals .= "?, ";
$arrBindings[] = $this->title;
}
if (isset ( $this->desc )) {
$insertCols .= "dsh_desc, ";
$insertVals .= "?, ";
$arrBindings[] = $this->desc;
}
if (isset ( $this->portlet )) {
$insertCols .= "dsh_portlet, ";
$insertVals .= "?, ";
$arrBindings[] = $this->portlet;
}
if (isset ( $this->hide )) {
$insertCols .= "dsh_hide, ";
$insertVals .= "?, ";
$arrBindings[] = $this->hide;
}
if (isset ( $this->createdBy )) {
$insertCols .= "dsh_created_by, ";
$insertVals .= "?, ";
$arrBindings[] = $this->createdBy;
}
if (isset ( $this->modifiedBy )) {
$insertCols .= "dsh_modified_by, ";
$insertVals .= "?, ";
$arrBindings[] = $this->modifiedBy;
}
if (isset ( $this->createdDate )) {
$insertCols .= "dsh_created_date, ";
$insertVals .= "?, ";
$arrBindings[] = $this->createdDate;
}
if (isset ( $this->modifiedDate )) {
$insertCols .= "dsh_modified_date, ";
$insertVals .= "?, ";
$arrBindings[] = $this->modifiedDate;
}
//remove trailing commas
$insertCols = preg_replace("/, $/", "", $insertCols);
$insertVals = preg_replace("/, $/", "", $insertVals);
$sql = "INSERT INTO $this->sqlTable ($insertCols)";
$sql .= " VALUES ($insertVals)";
$ks_db->query ( $sql, $arrBindings );
//set the auto-increment property, only if the primary column is auto-increment
$this->id = $ks_db->lastInsertId();
$ks_db->commit ();
} catch(Exception $e) {
$ks_db->rollBack ();
$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );
$ks_log->info ( '<br>SQL Statement: ' . $sql);
echo "Fatal Error: " . __METHOD__ . '. ' . $e->getMessage ();
echo "SQL Statement: " . $sql;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// ins... | [
"0.77479666",
"0.72448236",
"0.7186681",
"0.70507956",
"0.70061606",
"0.69673663",
"0.6939948",
"0.6932719",
"0.69033796",
"0.6900701",
"0.6897995",
"0.68897724",
"0.68857694",
"0.68857694",
"0.6885629",
"0.68570733",
"0.68257725",
"0.68176895",
"0.68135893",
"0.67918104",
"0... | 0.0 | -1 |
This method updates a single record, based on primary column $id | public function update() {
try {
global $ks_db;
global $ks_log;
$ks_db->beginTransaction ();
$arrBindings = array ();
if (! isset ( $this->id )) {
echo "Fatal Error: Id is not set for the object! Please do \$objA->setId(\$dsh_id); in: " . __METHOD__;
exit ();
}
//check if record exists
if(! $this->exists ()) {
echo "Fatal Error: No record found with primary key of ($this->id)";
exit ();
}
$sql = "UPDATE $this->sqlTable SET ";
if (isset ( $this->title )) {
$sql .= "dsh_title = ?, ";
$arrBindings[] = $this->title;
}
if (isset ( $this->desc )) {
$sql .= "dsh_desc = ?, ";
$arrBindings[] = $this->desc;
}
if (isset ( $this->portlet )) {
$sql .= "dsh_portlet = ?, ";
$arrBindings[] = $this->portlet;
}
if (isset ( $this->hide )) {
$sql .= "dsh_hide = ?, ";
$arrBindings[] = $this->hide;
}
if (isset ( $this->createdBy )) {
$sql .= "dsh_created_by = ?, ";
$arrBindings[] = $this->createdBy;
}
if (isset ( $this->modifiedBy )) {
$sql .= "dsh_modified_by = ?, ";
$arrBindings[] = $this->modifiedBy;
}
if (isset ( $this->createdDate )) {
$sql .= "dsh_created_date = ?, ";
$arrBindings[] = $this->createdDate;
}
if (isset ( $this->modifiedDate )) {
$sql .= "dsh_modified_date = ?, ";
$arrBindings[] = $this->modifiedDate;
}
$sql = preg_replace ( '/, $/', '', $sql);
$sql .= " WHERE dsh_id = ?";
$arrBindings[] = $this->id;
$ks_db->query ( $sql, $arrBindings );
$ks_db->commit ();
} catch(Exception $e) {
$ks_db->rollBack ();
$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );
$ks_log->info ( '<br>SQL Statement: ' . $sql);
echo "Fatal Error: " . __METHOD__ . '. ' . $e->getMessage ();
echo "SQL Statement: " . $sql;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update($id);",
"public function update($id);",
"public function update($id) {\r\n //\r\n }",
"public function update($id){\n\t\t//\n\t}",
"public function update($id){\n\t\t//\n\t}",
"public function update($id) {\n \n }",
"public function update($id) {\n \n ... | [
"0.798296",
"0.798296",
"0.7874775",
"0.7825142",
"0.7825142",
"0.78197956",
"0.78197956",
"0.7804547",
"0.7783499",
"0.7783499",
"0.7783499",
"0.7783499",
"0.7775723",
"0.7775723",
"0.7775723",
"0.7775723",
"0.7775723",
"0.7775723",
"0.7775723",
"0.7775723",
"0.7775723",
"... | 0.0 | -1 |
This method deletes a single record, based on primary column $id | public function delete() {
try {
global $ks_db;
global $ks_log;
if (! isset ( $this->id )) {
echo "Fatal Error: Id is not set for the object! Please do \$objA->setId(\$dsh_id); in: " . __METHOD__;
exit ();
}
//check if record exists
if(! $this->exists ()) {
echo "Fatal Error: No record found with primary key of ($this->id)";
exit ();
}
$ks_db->beginTransaction ();
$sql = "DELETE FROM $this->sqlTable ";
$sql .= " WHERE dsh_id = ?";
$ks_db->query ( $sql, $this->id );
$ks_db->commit ();
} catch(Exception $e) {
$ks_db->rollBack ();
$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );
$ks_log->info ( '<br>SQL Statement: ' . $sql );
echo "Fatal Error: " . __METHOD__ . '. ' . $e->getMessage ();
echo "SQL Statement: " . $sql;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteRecord ($id);",
"function delete( $id )\n\t{\n\t\t// where clause\n\t\t$this->db->where( $this->primary_key, $id );\n\n\t\t// delete the record\n\t\treturn $this->db->delete( $this->table_name );\n\t\t// print_r($this->db->last_query());die;\n \t}",
"public function deleteRecord($id){\n\t... | [
"0.8512585",
"0.81900144",
"0.8181833",
"0.8091682",
"0.80581766",
"0.8039612",
"0.7895442",
"0.7895442",
"0.7895442",
"0.7895442",
"0.7895442",
"0.7895442",
"0.7866019",
"0.78637075",
"0.78485733",
"0.78070587",
"0.7801292",
"0.7800486",
"0.7797326",
"0.77570045",
"0.7749764... | 0.0 | -1 |
This method perform search based on this object. | public function search() {
try {
global $ks_db;
global $ks_log;
$arrSearchResults = array ();
parent::initSearch ();
$stmt = $ks_db->query ( $this->searchSQL, $this->searchBinding );
//record is found, associate columns to the object properties
while ( true == ($row = $stmt->fetch ()) ) {
$objResult = new KS_Dashboard ( );
$objResult->id = $row ['dsh_id'];
$objResult->title = $row ['dsh_title'];
$objResult->desc = $row ['dsh_desc'];
$objResult->portlet = $row ['dsh_portlet'];
$objResult->hide = $row ['dsh_hide'];
$objResult->createdBy = $row ['dsh_created_by'];
$objResult->modifiedBy = $row ['dsh_modified_by'];
$objResult->createdDate = $row ['dsh_created_date'];
$objResult->modifiedDate = $row ['dsh_modified_date'];
$arrSearchResults [] = $objResult;
$objResult->searchResultAssociativeArray = $row;
}
return $arrSearchResults;
} catch(Exception $e) {
$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );
echo "Fatal Error: " . __METHOD__ . '. ' . $e->getMessage ();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function search(){}",
"public function search()\n\t{\n\t\t\n\t}",
"public function search();",
"public function search();",
"public function search()\n {\n\n }",
"public function search()\n {\n\n }",
"public function search()\n\t{\n\t\treturn self::extraSearch($this);\n\t}",
"publi... | [
"0.81322336",
"0.78832644",
"0.7816721",
"0.7816721",
"0.75675595",
"0.75675595",
"0.7480842",
"0.7426851",
"0.72968334",
"0.72965914",
"0.729206",
"0.7233448",
"0.72204435",
"0.7111532",
"0.7097985",
"0.70446575",
"0.7040305",
"0.7040305",
"0.69758093",
"0.6969395",
"0.69514... | 0.6358044 | 81 |
Display a listing of the resource. | public function index()
{
$cards = Cards::orderBy('id')->paginate(1);
return view('cards', ['cards'=>$cards]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
return view('cards.create');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.717428... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(CardsRequest $request)
{
Cards::create($request->all());
session()->flash('mensagem', 'Atividade cadastrada com sucesso!');
return redirect()->route('cards.index');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.63424... | 0.0 | -1 |
Display the specified resource. | public function show(Cards $card)
{
return view('cards.show', ['card'=>$card]);
} | {
"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(Cards $cards)
{
//return view('cards.edit', ['cards'=>$cards]);
} | {
"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(CardsRequest $request, Cards $cards)
{
/*$cards->fill($request->all());
$cards->save();
session()->flash('mensagem', 'Atividade atualizada com sucesso!');
return redirect()->route('cards.index');*/
} | {
"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(Cards $card)
{
$card->delete();
session()->flash('mensagem', 'Atividade excluída com sucesso!');
return redirect()->route('cards.index');
} | {
"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 |
Display a listing of the Medication. | public function index(Medicine $med)
{
// $meds = $med->latest()->sortable()->paginate(5);
//return view('medication.index', compact('meds'))
// ->with('i', (request()->input('page', 1) - 1) * 5)
try {
$meds = $med->select('*')->sortable()->paginate(10);
return view('medication.index', ['meds' => $meds]);
}
catch(\Kyslik\ColumnSortable\Exceptions\ColumnSortableException $e)
{
dd($e);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n {\n $medics = new Medic();\n $data = $medics->getMedicSectionAndClinic();\n return view('medics/medics')->with(\n ['medics' => json_decode($data, true)]\n );\n }",
"public function index()\n {\n $medicos = Medicos::all();\n\n ret... | [
"0.69569194",
"0.6928663",
"0.6831302",
"0.68075716",
"0.6807074",
"0.68064094",
"0.67800367",
"0.6763041",
"0.674597",
"0.67029667",
"0.6684803",
"0.66559464",
"0.664174",
"0.66378963",
"0.66293997",
"0.6628364",
"0.66106784",
"0.6599878",
"0.65946597",
"0.65854764",
"0.6574... | 0.66219836 | 16 |
Show the form for creating a new Medication. | public function create()
{
$med_categories = MedCategory::with('children')->whereNull('parent_id')->get();
$med_names = MedName::get();
$packs = MedPack::get();
$templateMeds = TemplateMed::get();
return view('medication.create')
->withMedCategories($med_categories)
->withMedNames($med_names)
->withMedPacks($packs)
->withTemplateMeds($templateMeds);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return view('backend.admin.medicine.create');\n }",
"public function create()\n {\n return view('Medicines.create');\n }",
"public function create()\n {\n $mobil = new Mobil();\n return view('mobil.form', compact('mobil'));\n }",
"p... | [
"0.7291153",
"0.7144382",
"0.71082056",
"0.7085397",
"0.7032347",
"0.701842",
"0.6983736",
"0.69143116",
"0.68464106",
"0.6737258",
"0.670481",
"0.6640224",
"0.6628402",
"0.6621706",
"0.65985733",
"0.6594298",
"0.65936834",
"0.6550819",
"0.65471536",
"0.65314263",
"0.6517359"... | 0.7407342 | 0 |
Store a newly created Medication in storage. | public function store(Request $request)
{
$request->validate([
//'medicine_id' => 'required',
'category_id' => 'required',
'med_name' => 'required',
'batch_no' => 'required',
'expiry_date' => 'required',
'quantity' => 'required',
'location' => 'required',
]);
Medicine::create($request->all());
return redirect()->route('med_category.index')
->with('success', 'Medicine added successfully.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store(MedicationPost $request)\n {\n return $this->medications->save($request);\n \n }",
"public function persist()\n {\n $uid = $this->getIdentifier() == 0 ? 'NEW' . rand(100000, 999999) : $this->getIdentifier();\n $data = [\n trim(static::$storageTab... | [
"0.7134208",
"0.6562721",
"0.6541115",
"0.63804567",
"0.6317958",
"0.6253484",
"0.62434864",
"0.62237245",
"0.62003386",
"0.6181381",
"0.61657715",
"0.6055272",
"0.6050803",
"0.60507363",
"0.6044073",
"0.60436445",
"0.60210216",
"0.60210216",
"0.60210216",
"0.60184544",
"0.60... | 0.0 | -1 |
Display the specified Medication. | public function show($id)
{
//return view('meds.show', compact('med'));
//return view('medication.show', [
// 'meds' => Medicine::findOrFail($med)
// ]);
$med = Medicine::findOrFail($id);
$med_categories = MedCategory::with('children')->whereNull('parent_id')->get();
return view('medication.show', compact('med'))->withMedCategories($med_categories);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Medicament $medicament)\n {\n //\n }",
"public function show(Medicine $medicine)\n {\n //\n }",
"public function show(Medicine $medicine)\n {\n //\n }",
"public function show(Medicos $medicos)\n {\n //\n }",
"public function show(Medi... | [
"0.6800163",
"0.6655146",
"0.6655146",
"0.6432994",
"0.6425121",
"0.633849",
"0.6156593",
"0.6003853",
"0.59843165",
"0.59530675",
"0.59530675",
"0.59342307",
"0.59300417",
"0.5879647",
"0.586444",
"0.5852782",
"0.5844819",
"0.58344525",
"0.5831568",
"0.58302826",
"0.58262485... | 0.0 | -1 |
Display the form for editing the Medication. | public function edit($id)
{
// return view('meds.edit', compact('med'));
$med = Medicine::findOrFail($id);
$med_categories = MedCategory::with('children')->whereNull('parent_id')->get();
$med_names = MedName::get();
$packs = MedPack::get();
return view('medication.edit', compact('med'))
->withMedCategories($med_categories)
->withMedNames($med_names)
->withMedPacks($packs);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r... | [
"0.6842624",
"0.6824506",
"0.6730651",
"0.66864717",
"0.6618821",
"0.66081464",
"0.6599686",
"0.6577026",
"0.65726113",
"0.6538633",
"0.6536878",
"0.64362216",
"0.6426706",
"0.64111984",
"0.64079463",
"0.6379779",
"0.63778704",
"0.6376861",
"0.63656175",
"0.63597107",
"0.6336... | 0.61075425 | 56 |
Update the Medication in storage. | public function update(Request $request, Medicine $med)
{
$request->validate([
'med_name' => 'required',
'batch_no' => 'required',
'expiry_date' => 'required',
'quantity' => 'required',
'location' => 'required',
]);
$med->update($request->all());
return redirect()->route('med_category.index')
->with('success', 'Medicine updated successfully');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update($medical_id, MedicationPost $request)\n {\n //\n\n }",
"private function mediaUpdate() {\n\t\t$this->s3->request = array(\n\t\t\t'access_key' => \\Crypt::encrypt($this->access_key),\n\t\t\t'secret' => \\Crypt::encrypt($this->secret),\n\t\t\t'region' => \\Aws\\Common\\E... | [
"0.6111123",
"0.60327846",
"0.59713364",
"0.5923484",
"0.58842725",
"0.56630224",
"0.5654665",
"0.56013054",
"0.5600379",
"0.5519009",
"0.55127466",
"0.5458947",
"0.5454832",
"0.54485524",
"0.54211503",
"0.53826547",
"0.537467",
"0.53722125",
"0.53589",
"0.53517765",
"0.53457... | 0.5469028 | 11 |
Remove the Medication from storage. | public function destroy(Medicine $med)
{
$med->delete();
return redirect()->route('meds.index')
->with('success', 'Medicine deleted successfully');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function clear() {\n @rmpath($this->storage);\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself onl... | [
"0.63331175",
"0.63169545",
"0.6256027",
"0.61680454",
"0.61680454",
"0.61680454",
"0.6141303",
"0.60303617",
"0.5981979",
"0.5980616",
"0.5975166",
"0.59714496",
"0.59661907",
"0.5961117",
"0.59489757",
"0.5936509",
"0.5927842",
"0.59248817",
"0.58972025",
"0.5879505",
"0.58... | 0.54217076 | 81 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.