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
Get DataTable class for the given slug.
private function getDatatable(string $slug) { $datatable = app('boilerplate.datatables')->load(app_path('Datatables'))->getDatatable($slug); if (! $datatable) { abort(404); } return $datatable; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBySlug(string $slug);", "public function getBySlug($slug)\n\t{\n\t\treturn $this->doll->with('DollTypes')->where('slug', $slug)->firstOrFail();\n\t}", "public function getRecord($slug){\n return $this->where(\"slug\", $slug)->first();\n }", "public function findBySlug($slug);", ...
[ "0.6035133", "0.58107543", "0.5802353", "0.57914114", "0.57914114", "0.57914114", "0.57914114", "0.57914114", "0.5736294", "0.5733054", "0.5687116", "0.5687116", "0.5597255", "0.55901104", "0.55877244", "0.55502015", "0.5545581", "0.5532963", "0.5532963", "0.5528735", "0.5522...
0.7550043
0
User validates and user login
public function postLogin() { $rules = array( 'email' => 'required|email', // make sure the email is an actual email 'password' => 'required' // password can only be alphanumeric and has to be greater than 3 characters ); $messages = []; if(Input::exists('captcha')) { $rules['captcha'] = 'required|captcha'; $messages['captcha.captcha'] = 'captcha not match try again'; } $validator = Validator::make(Input::all(), $rules, $messages); $login_failed_count = (Session::has('login_failed_count')) ? Session::get('login_failed_count') : 0; $ip = Request::getClientIp(true); if ($validator->fails()) { return Redirect::back()->withErrors($validator) ->withInput(Input::only('email')) ->with('message', trans('Invalid user login')) ->with('message_type', 'danger'); } else { // create our user data for the authentication $userdata = array( 'email' => Input::get('email'), 'password' =>Input::get('password'), 'delete_request' => 0 || null ); $remember = Input::has('remember') ? true : false; if ( Auth::user()->validate($userdata,$remember) ) { $user = User::select('id')->where('email', $userdata['email'])->first(); $user_id = $user->id; $session = SessionModel::where('user_type', 'user') ->where('user_id', $user_id) ->where('last_activity', '>', time() - ( Config::get('session.lifetime') * 60 ) ) ->where('id', '<>', Session::getId()) ->orderBy('last_activity', 'desc') ->first(); if ($session) { return Redirect::route('remotelogin.get'); } Auth::user()->loginUsingId($user_id, $remember); Session::forget('login_failed_count'); Firewall::whitelist($ip); $location = Location::get($ip); if($location) { $loginLog = new LoginLog(); $loginLog->user_id = $user_id; $loginLog->ip_address = $location->ip; $loginLog->country = $location->countryName; $loginLog->type = 'user'; $loginLog->login_time = Carbon\Carbon::now(); $loginLog->save(); } return Redirect::route('user.session'); }else{ Session::put('login_failed_count', ++$login_failed_count); if($login_failed_count >= 6) { Firewall::blacklist($ip, true); } return Redirect::back()->with('message', trans('Invalid user login')) ->with('message_type', 'danger'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function login_validation() {\n\n\t\t$this -> load -> library('form_validation');\n\t\t$this -> form_validation -> set_rules('email', \"Email\", \"required|trim|xss_clean|callback_validate_credentials\");\n\t\t$this -> form_validation -> set_rules('password', \"Password\", \"required|md5|trim\");\n\n\t\tif ...
[ "0.7740115", "0.7632011", "0.7619647", "0.75822484", "0.752933", "0.74773115", "0.7464351", "0.7427856", "0.7422374", "0.73686075", "0.7360091", "0.7356692", "0.7355555", "0.7349847", "0.7314108", "0.7312242", "0.73062134", "0.7295352", "0.72912145", "0.72668314", "0.72527623...
0.0
-1
User or consultant Show form =>show all profile of consultant
public function showProfile() { $user = User::with('consultant','consultantNationality')->find(Auth::user()->get()->id); $nationalities = $user->nationalities(); $specialization = $user->specialization(); $workedcountries = $user->workedcountries(); $skills = $user->skills(); $languages = $user->languages(); $agencies = $user->agencies(); return View::make('user.profile.show', compact('user', 'nationalities','specialization','workedcountries','skills','languages','agencies')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show()\n {\n $user_identifier = $this->session->userdata('identifier');\n $user_details = $this->user_m->read($user_identifier);\n $this->data['user_details'] = $user_details;\n $this->load_view('Profil Akun', 'user/profil');\n }", "public function show($Perprof)...
[ "0.72175086", "0.6812279", "0.67973906", "0.67820877", "0.6770297", "0.67349076", "0.6717453", "0.6705375", "0.66897005", "0.6646057", "0.6609219", "0.66017866", "0.65792996", "0.6576358", "0.65713227", "0.6558116", "0.65488094", "0.65488094", "0.6543807", "0.6522693", "0.651...
0.7193861
1
Consultant validates, update record in database
public function updateProfile(){ $user_id = Auth::user()->get()->id; $user = User::with('consultant')->find($user_id); $consultant = Consultant::find(Auth::user()->get()->id); $website_url = $consultant['website_url']; $user_name = $consultant['other_names']; $user_surname = $consultant['surname']; $post_data = Input::all(); $nationalities = Input::get('nationality'); $skills = Input::get('skill', array()); $specializations = Input::get('specialization',array()); $worked_countries = Input::get('country_worked',array()); $consultant_agencies = Input::get('consultant_agencies',array()); $languages = $post_data['languages']['languages']; $rules = Consultant::editRules(); if ($consultant->resume == null) { if (!Input::hasFile('resume')) { $rules['linkedin_url'] = 'url|required_without_all:resume,website_url'; $rules['website_url'] = 'url|required_without_all:resume,linkedin_url'; } $rules['resume'] = 'mimes:doc,docx,txt,pdf|max:1024|extension:txt,doc,docx,pdf|required_without_all:linkedin_url,website_url'; } $validation = Validator::make($post_data, $rules,Consultant::$messages); if ($validation->passes()){ $old_resume = $consultant->resume; $consultant->fill(Input::except('resume','terms_conditions','email')); if(Input::hasFile('resume')){ $destinationPath = public_path().'/upload/resume/'; if($old_resume != ""){ $resume_to_delete = $destinationPath . $old_resume; @unlink($resume_to_delete); } $file = Input::file('resume'); $extension = $file->getClientOriginalExtension(); $user_fullname = $user_name." ".$user_surname; $user_fullname = $user_name." ".$user_surname; $file_name = Str::slug($user_fullname,'_'); $doc_name = $file_name.'.'.$extension; $file->move($destinationPath,$doc_name); $consultant->resume = $doc_name; } $consultant->save(); if($languages) { ConsultantLanguage::where('consultant_id', $user_id)->delete(); foreach ($languages as $key => $language) { if($language['language'] != ""){ $consultant_language = new ConsultantLanguage(); $consultant_language->consultant_id = $user->id; $consultant_language->language_id = $language['language']; // $consultant_language->language_level = $language['lang_level']; $consultant_language->speaking_level = $language['speaking_level']; $consultant_language->reading_level = $language['reading_level']; $consultant_language->writing_level = $language['writing_level']; $consultant_language->understanding_level = $language['understanding_level']; $consultant_language->save(); } } } $nationality_list = array(); if( count($nationalities) > 0 ){ foreach ($nationalities as $nationality_id) { $nationality['country_id'] = $nationality_id; array_push($nationality_list, $nationality); } ConsultantNationality::where('consultant_id', $user_id)->delete(); $user->consultantNationality()->createMany($nationality_list); } $skill_list = array(); if( count($skills) > 0 ){ foreach ($skills as $skill_id) { $skill['skill_id'] = $skill_id; array_push($skill_list, $skill); } ConsultantSkill::where('consultant_id', $user_id)->delete(); $user->consultantSkill()->createMany($skill_list); } $specialization_list = array(); if( count($specializations) > 0 ){ foreach ($specializations as $specialization_id) { $specialization['specialization_id'] = $specialization_id; array_push($specialization_list, $specialization); } ConsultantSpecialization::where('consultant_id', $user_id)->delete(); $user->consultantSpecialization()->createMany($specialization_list); } $worked_country_list = array(); if( count($worked_countries) > 0 ){ foreach ($worked_countries as $worked_country_id) { $worked_country['country_id'] = $worked_country_id; array_push($worked_country_list, $worked_country); } ConsultantWorkedCountry::where('consultant_id', $user_id)->delete(); $user->consultantWorkedCountry()->createMany($worked_country_list); } $consultant_agency_list = array(); if( count($consultant_agencies) > 0 ){ foreach ($consultant_agencies as $consultant_agency_id) { $consultant_agency['agency_id'] = $consultant_agency_id; array_push($consultant_agency_list, $consultant_agency); } ConsultantAgency::where('consultant_id', $user_id)->delete(); $user->consultantAgencies()->createMany($consultant_agency_list); } return Redirect::route('user.profile')->with('message', 'You have successfully updated your profile') ->with('message_type', 'success'); }else{ $errors = $validation->errors()->toArray(); // echo "<pre>"; // print_r($errors);exit; return Redirect::back() ->withInput(Input::all()) ->withErrors($validation) ->with('message', 'Some required field(s) have been left blank. Please correct the error(s)!') ->with('message_type', 'danger'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_record () {\n\t\t\n\t\t// validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n ...
[ "0.70477086", "0.67882794", "0.67609763", "0.6726821", "0.6695551", "0.6680563", "0.66446084", "0.6642027", "0.65414214", "0.6502001", "0.64468783", "0.643699", "0.6414681", "0.6405396", "0.63762504", "0.6365731", "0.6359753", "0.6333642", "0.6308955", "0.6276731", "0.6233675...
0.0
-1
Update the specified resource in storage.
public function update($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.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
Consultant new password form
public function getNewPassword() { return View::make('user.newpassword'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function new_password_form()\n {\n $markers = array();\n $markers['errors'] = $this->Register['Validate']->getErrors();\n if (isset($_SESSION['FpsForm'])) unset($_SESSION['FpsForm']);\n\n\n $markers['action'] = get_url('/users/send_new_password/');\n $source = $this->re...
[ "0.77254796", "0.74721974", "0.7455298", "0.74144745", "0.73576844", "0.7254467", "0.724389", "0.7227306", "0.72135466", "0.7175521", "0.716488", "0.7147477", "0.71322036", "0.7107721", "0.7096354", "0.705996", "0.7037376", "0.70304817", "0.7017736", "0.7016646", "0.7010504",...
0.7115997
13
Consultant validates, stores record in database and sends email
public function postNewPassword() { //$user = User::find(Auth::user()->get()->id); $user = User::where('remember_token', Input::get('token'))->first(); if( !$user ){ return Redirect::back()->with('message',"Invalid User") ->with('message_type','danger'); } Validator::extend('strong_password', function($attribute, $value, $parameters) { $r1 = '/[A-Z]/'; //Uppercase $r2 = '/[a-z]/'; //lowercase $r3 = '/[!@#$%^&*()\-_=+{};:,<.>]/'; // whatever you mean by 'special char' $r4 = '/[0-9]/'; //numbers if(preg_match_all($r1,$value, $o)<1) return false; if(preg_match_all($r2,$value, $o)<1) return false; if(preg_match_all($r3,$value, $o)<1) return false; if(preg_match_all($r4,$value, $o)<1) return false; if(strlen($value)<8) return false; return true; }); Validator::extend('check_password', function($attribute, $value, $parameters) use ($user) { $old_password = Hash::check($value, $user->password); if($old_password == true) return true; return false; }); $rules = array( 'old_password' => 'required|check_password', 'password' => 'required|strong_password|confirmed', 'password_confirmation' => 'required', ); $messages = array( 'password.strong_password' => 'Passwords must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, one digit and one special character.', 'old_password.check_password' => 'Please enter correct system-generated password', 'old_password.required' => 'Please enter the system generated password', ); $response = []; $validator = Validator::make(Input::all(), $rules, $messages); if($validator->passes()) { $user->password = Hash::make(Input::get('password')); $user->password_changed = '1'; $user->remember_token = NULL; $user->save(); Session::forget('token'); return Redirect::route('user.login.get')->with('message',"Password updated successfully.") ->with('message_type','success'); } else { return Redirect::back()->with('message',"Could not update password") ->with('message_type','danger') ->withErrors($validator); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insert()\n\t{\n\t\t//@TODO email advisor and student(?)\n\t\t$kReport = $this->report->insert();\n\t\tif($this->input->post(\"email_advisor\")){\n\t\t\t$this->notify($kReport);\n\t\t}\n\t\tredirect(\"report/view/$kReport\");\n\t}", "public static function save() {\n\t\t// Connect to database\n\t\t$db = ...
[ "0.69944495", "0.6653729", "0.6476456", "0.6474699", "0.63563025", "0.629711", "0.62132126", "0.61525404", "0.61364603", "0.6080098", "0.606059", "0.605993", "0.60408705", "0.603728", "0.6032288", "0.60286945", "0.5948877", "0.5931676", "0.59029526", "0.58964443", "0.5895095"...
0.0
-1
consultant validates, stores record in database
public function postChangePassword() { if( Request::ajax() ) { $user = User::find(Auth::user()->get()->id); Validator::extend('strong_password', function($attribute, $value, $parameters) { $r1 = '/[A-Z]/'; $r2 = '/[a-z]/'; $r3 = '/[!@#$%^&*()\-_=+{};:,<.>]/'; $r4 = '/[0-9]/'; if(preg_match_all($r1,$value, $o)<1) return false; if(preg_match_all($r2,$value, $o)<1) return false; if(preg_match_all($r3,$value, $o)<1) return false; if(preg_match_all($r4,$value, $o)<1) return false; if(strlen($value)<8) return false; return true; }); Validator::extend('check_password', function($attribute, $value, $parameters) { $user = User::find(Auth::user()->get()->id); $old_password = Hash::check($value, $user->password); if($old_password == true) return true; return false; }); $rules = array( 'old_password' => 'required|check_password', 'password' => 'required|strong_password|different:old_password', 'password_confirmation' => 'required|same:password', ); $messages = array( 'old_password.check_password' => 'Please enter correct password', 'password.strong_password' => 'Passwords must be at least 8 characters long and contain at least one uppercase letter, one lowercase letter, one digit and one special character.', 'password.different' => 'new password must be different', ); $validator = Validator::make(Input::all(), $rules, $messages); if($validator->passes()) { $user->password = Hash::make(Input::get('password')); $user->save(); return Response::json(array('success' => true)); } $errors = $validator->errors()->toArray(); return Response::json(array('success' => false, 'errors' => $errors)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validate()\n {\n // query for validation information\n // set the validation flag\n // close database\n }", "public function validate();", "public function validate();", "public function validate();", "public function validate();", "public function validate();",...
[ "0.7349539", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.65394914", "0.6505781", "0.64008623", "0.64008623", "0.63577545", "0.63176054", "0.63032573", "0.62649196", ...
0.0
-1
Reindex all indexes associated with Sphinx
public function reindexAll() { //@todo: indexers should be dynamically injected. Probable via `$this->getIndeces()` /** @var St_SphinxSearch_Model_Fulltext $fulltextIndex */ $fulltextIndex = Mage::getModel('st_sphinxsearch/fulltext'); $fulltextIndex->rebuildIndex(); return; /** @var Mage_Core_Model_Resource $resourceSingleton */ $resourceSingleton = Mage::getSingleton('core/resource'); /** @var Varien_Db_Adapter_Interface $writeAdapater */ $writeAdapater = $resourceSingleton->getConnection('core_write'); /** @var Varien_Db_Adapter_Interface $readAdapter */ $readAdapter = $resourceSingleton->getConnection('core_read'); /** @var string $tableName */ $tableName = $readAdapter->getTableName('st_sphinxsearch_fulltext_tmp'); /** @var Mage_CatalogSearch_Model_Resource_Indexer_Fulltext $indexerFulltext */ $indexerFulltext = Mage::getResourceModel('catalogsearch/indexer_fulltext'); $fulltextTableName = $indexerFulltext->getTable('fulltext'); $sql = "CREATE TABLE IF NOT EXISTS `$tableName` LIKE `$fulltextTableName`"; $writeAdapater->query($sql); $t=1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reindexAll()\n {\n $this->_getIndexer()->rebuildIndex();\n }", "public function reindexAll()\n {\n }", "public function reindex();", "public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::IN...
[ "0.82837737", "0.8053411", "0.7784555", "0.77700615", "0.7016176", "0.6748132", "0.6673288", "0.66522497", "0.6651888", "0.66340154", "0.66175485", "0.65770084", "0.6473278", "0.6467087", "0.6398623", "0.6300468", "0.62853336", "0.62369335", "0.6176799", "0.6129391", "0.61174...
0.79297537
2
Retrieve searchable attributes list
protected function _getSearchableAttributes() { if (is_null($this->_searchableAttributes)) { /** @var $attributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */ $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection'); $attributeCollection->addIsSearchableFilter(); foreach ($attributeCollection as $attribute) { $this->_searchableAttributes[] = $attribute->getAttributeCode(); } } return $this->_searchableAttributes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getSearchableAttributes()\n {\n if (is_null($this->_searchableAttributes)) {\n /** @var $attributeCollection Mage_Catalog_Model_Resource_Product_Attribute_Collection */\n $attributeCollection = Mage::getResourceModel('catalog/product_attribute_collection');\n ...
[ "0.7376163", "0.72983575", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7282965", "0.7221753", "0.71514755", "0.71006167", "0.70980465", "0.7073783", "0.7045631", "0.7021353", "0.69856626", "0.6977222", "0.6958847"...
0.7298709
1
/ Determines the direction (theres probably a better term for this) of values/deltas in an array.
function array_direction(Array $ar) { $deltas = array_deltas($ar); $deltas = array_normalize($deltas); $delta = array_average($deltas); if ($delta >= 0.01) return 1; else if ($delta <= -0.01) return -1; else return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDirection() {}", "public function getDirection();", "public function getDirection();", "public function getDirection();", "public function direction()\n {\n return $this->direction;\n }", "public function getDirection()\n\t{\n\t\treturn $this->direction;\n\t}", "public f...
[ "0.64091176", "0.6237101", "0.6237101", "0.6237101", "0.6179278", "0.6094874", "0.60530907", "0.60530907", "0.60530907", "0.59899354", "0.5926546", "0.5906345", "0.57637256", "0.57555753", "0.5588258", "0.55396533", "0.5526342", "0.54993665", "0.5388671", "0.53641814", "0.533...
0.78534895
0
/ Determines the differences between each entry in an array
function array_deltas(Array $ar) { $lastV = null; $deltas = []; foreach($ar AS $i => $v) { if ($i > 0) { $deltas[] = $v - $lastV; } $lastV = $v; } return $deltas; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function diffWith(array $array);", "public function diff(array $a, array $b): array;", "function ary_diff( $ary_1, $ary_2 ) {\n // get differences that in ary_1 but not in ary_2\n // get difference that in ary_2 but not in ary_1\n // return the unique difference between val...
[ "0.79168713", "0.7230371", "0.7148854", "0.713427", "0.71177554", "0.7045551", "0.7044944", "0.7006157", "0.6963481", "0.6945318", "0.6850213", "0.6827347", "0.67936885", "0.66046005", "0.6537278", "0.6523461", "0.6486921", "0.6405531", "0.6385527", "0.6357374", "0.62957555",...
0.6621708
13
/ Determines the average of all values in an array
function array_average($a) { if (count($a) == 0) return null; return array_sum($a) / count($a); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function average($array)\n{\n $avg = array_sum($array) / (count($array));\n return $avg;\n}", "function array_mean($array) {\n return array_sum($array) / count($array);\n}", "function average($arr){\n return ($arr) ? array_sum($arr)/count($arr) : 0;\n }", "function meanArray(array $array): float\n...
[ "0.84324926", "0.82277066", "0.8185965", "0.8129213", "0.79283744", "0.7836048", "0.76188815", "0.760712", "0.74337053", "0.74300736", "0.739128", "0.7378344", "0.7195212", "0.70465946", "0.7029415", "0.6967245", "0.68920493", "0.688764", "0.6880679", "0.68720067", "0.6854469...
0.78160465
6
/ Makes sure all values in an array are scaled to a 0..1 range
function array_normalize(Array $ar) { $max = null; foreach($ar as $v) { $v = abs($v); if ($max == null) { $max = $v; } else { $max = max($max, $v); } } if ($max > 0) foreach($ar as $i => $v) $ar[$i] = $v / $max; return $ar; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function scale() { }", "public function fit(array $values) : void;", "function normalize_benefits(&$sourceCoords,$sourceKey, $isolated_benefits)\n {\n $min = min($isolated_benefits);\n //$min = 1; \n $max = max($isolated_benefits);\n if (!(($min >= 0 && $min <= 1)&&($max >= 0 && $ma...
[ "0.5751997", "0.52359784", "0.5171452", "0.51353115", "0.49886486", "0.49558976", "0.49540737", "0.49366724", "0.49161685", "0.48997074", "0.488008", "0.4822818", "0.4815006", "0.47946823", "0.47918874", "0.47918874", "0.47302058", "0.4697648", "0.46970266", "0.4689435", "0.4...
0.62381905
0
/ Tries to determine the direction the prediction is going
function forecast_direction(Array $real, Array $predicted, $windowSize = 60, $windowSizePredicted = 15) { $real = array_splice($real, -$windowSize); $predicted = array_splice($predicted, 0, $windowSizePredicted); $samples = array_merge($real, $predicted); return array_direction($samples); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDirection() {}", "public function getDirection();", "public function getDirection();", "public function getDirection();", "public function getDirection(): string;", "function array_direction(Array $ar) {\n\t$deltas = array_deltas($ar);\n\t$deltas = array_normalize($deltas);\n\t$delta =...
[ "0.63074315", "0.583398", "0.583398", "0.583398", "0.5539379", "0.5520857", "0.55036545", "0.54760486", "0.5419174", "0.54125756", "0.5396324", "0.5391217", "0.53847116", "0.53847116", "0.53847116", "0.5370099", "0.5352947", "0.5265754", "0.52311015", "0.52074724", "0.5205808...
0.5915877
1
Add oro_au_net_enabled_cim_website foreign keys.
protected function addOroAuthorizeNetEnabledCimWebsiteForeignKeys(Schema $schema) { $table = $schema->getTable('oro_au_net_enabled_cim_website'); $table->addForeignKeyConstraint( $schema->getTable('oro_integration_transport'), ['transport_id'], ['id'], ['onDelete' => 'CASCADE', 'onUpdate' => null] ); $table->addForeignKeyConstraint( $schema->getTable('oro_website'), ['website_id'], ['id'], ['onDelete' => 'CASCADE', 'onUpdate' => null] ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wa_wcc_activation($networkwide) {\n\n\t\tif(is_multisite() && $networkwide) {\n\t\t\tglobal $wpdb;\n\n\t\t\t$activated_blogs = array();\n\t\t\t$current_blog_id = $wpdb->blogid;\n\t\t\t$blogs_ids = $wpdb->get_col($wpdb->prepare('SELECT blog_id FROM '.$wpdb->blogs, ''));\n\n\t\t\tforeach($blogs_ids as $blog...
[ "0.4868019", "0.46813077", "0.46539247", "0.46389386", "0.4593109", "0.45888263", "0.45174706", "0.45115185", "0.44924554", "0.44784907", "0.44563314", "0.44329885", "0.44283924", "0.44063735", "0.4346143", "0.4321289", "0.4320234", "0.43152604", "0.43025306", "0.4295783", "0...
0.67638546
0
return action based on resource name and action name.
public function getAction($resourceName, $actionName) { if(empty($resourceName) || empty($actionName) ) throw new \InvalidArgumentException('Resource name and action name must not be empty.'); $entry = null; $supported_actions = $this->getSupportedActions($resourceName); foreach ($supported_actions as $action) { if(!array_key_exists(ResourceActionServiceInterface::ACTION_NAME, $action)) { throw new \Nth\Permit\Exceptions\InvalidResourceActionException('Invalid action. Missing actionName property.'); } if($action[ResourceActionServiceInterface::ACTION_NAME] === $actionName ) { $entry = new \Nth\Permit\Models\ResourceAction; $entry->resourceName = $resourceName; $entry->actionName = $actionName; $entry->bitwiseValue = intval( $action[ResourceActionServiceInterface::BITWISE_VALUE] ); break; } } return $entry; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getAction(): string\n\t{\n\t\treturn $this->getActionInput() ?: $this->getDefaultAction($this->getNameInput());\n\t}", "public function getAction()\n\t{\n\t\t\n\t\t$parsed = (array)$this->getAsArray();\n\t\t\n\t\tforeach(array('getPrefix', 'getController') as $method)\n\t\t{\n\t\t\tif( $this->...
[ "0.77828175", "0.76543474", "0.75372714", "0.74376976", "0.74290305", "0.7383659", "0.7358026", "0.72646856", "0.7256024", "0.7235979", "0.7196766", "0.71966887", "0.71966887", "0.71966887", "0.7188184", "0.71669173", "0.71230036", "0.7092704", "0.7092704", "0.70908076", "0.7...
0.0
-1
return whether the action name string is valid and supported for this resource (based on resource name) return true if valid
public function isActionExists($resourceName, $actionName) { if(empty($resourceName) || empty($actionName) ) throw new \InvalidArgumentException('Resource name and action name must not be empty.'); $supported_actions = $this->getSupportedActions($resourceName); $found = false; foreach ($supported_actions as $action) { if(!array_key_exists(ResourceActionServiceInterface::ACTION_NAME, $action)) { throw new \Nth\Permit\Exceptions\InvalidResourceActionException('Invalid action. Missing actionName property.'); } if($action[ResourceActionServiceInterface::ACTION_NAME] === $actionName ) { $found = true; break; } } return $found ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function has_valid_action(): bool {\n\t\treturn is_string( $this->get_action() )\n\t\t&& \\mb_strlen( $this->get_action() ) > 0;\n\t}", "public function hasAction(string $name): bool;", "public function testIsActionName(): void\n {\n foreach (['delete', 'edit', 'index', 'view'] as $action) {\n...
[ "0.7373374", "0.6650868", "0.6565993", "0.63315195", "0.61463994", "0.6108006", "0.6037052", "0.59764224", "0.596602", "0.5958181", "0.59517473", "0.59314567", "0.5900052", "0.5900052", "0.58829767", "0.58575433", "0.5851231", "0.58428586", "0.5821487", "0.5806005", "0.579120...
0.58264345
18
Return array of supported resource actions for this resource If resourceName cannot be found, just return an empty array
public function getSupportedActions($resourceName) { if(empty($resourceName) ) throw new \InvalidArgumentException('Resource name must not be empty.'); // load permission resources file from config file $init_perms_arr = ConfigHelper::getInitPermResources(); if(array_key_exists($resourceName, $init_perms_arr )) { $supported_actions = $init_perms_arr[$resourceName] ; return $supported_actions; } return array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResourceActions()\n {\n if (array_key_exists(\"resourceActions\", $this->_propDict)) {\n return $this->_propDict[\"resourceActions\"];\n } else {\n return null;\n }\n }", "static protected function get_resource_actions(): array\n\t{\n\t\treturn [...
[ "0.7930071", "0.7674014", "0.65302354", "0.649807", "0.649807", "0.6366927", "0.63273644", "0.63052773", "0.62988895", "0.62988895", "0.6297878", "0.6281724", "0.622257", "0.62158865", "0.6210286", "0.6206013", "0.6181117", "0.61730576", "0.61724645", "0.615362", "0.61277395"...
0.810912
0
Remove all actions for this resource. Not supported if data provider is config file
public function removeAllActions($resourceName ) { throw new \Nth\Permit\Exceptions\NotSupportedException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function clearAction() {\n\t\t$this->actionlist = null;\n\t}", "public function unsetAvailableActions(): void\n {\n $this->availableActions = [];\n }", "public function actions(){\n $actions = parent::actions();\n unset($actions['index']);\n unset($actions['view']);\n ...
[ "0.6268786", "0.60205126", "0.59976447", "0.5951053", "0.5948253", "0.5727065", "0.56561613", "0.56509435", "0.5596584", "0.5569524", "0.5568207", "0.55370307", "0.5518015", "0.5487811", "0.5484393", "0.5470757", "0.54148155", "0.54123366", "0.53762233", "0.5376111", "0.53740...
0.56834483
6
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.789145...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'name_metting' => 'required', 'type_metting' => 'required', 'phone' => 'required|min:6|max:20', 'email' => 'required|max:100|email', 'name' => 'required|max:100', 'date' => 'required|date', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.76830...
0.0
-1
Test that the arguments on the command are reset to 0
public function testCommandHasNoArguments() { $oCompareApp = new CompareApplication(); $oDefinition = $oCompareApp->getDefinition(); $iArgumentCount = $oDefinition->getArgumentCount(); $this->assertEquals(0, $iArgumentCount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "private function setGivenArgumentAmount(): int {\n return $_SERVER['argc'] - 1;\n }", "function test_checkMode_newA...
[ "0.63556373", "0.6195474", "0.60131013", "0.59272224", "0.59151995", "0.5813436", "0.58116686", "0.5797995", "0.57846665", "0.578354", "0.57782733", "0.5737364", "0.5723526", "0.5709251", "0.57064253", "0.57017124", "0.5696448", "0.5662", "0.564536", "0.5628304", "0.562682", ...
0.67117864
0
Gets a list of all idle conversations. A conversation is considered idle based on the time of the last message posted and the conversationTTL setting in the controller.
public static function getAllIdleConversations($options = array()) { //Build the list $options = $options + (new RecordList)->getDefaultOptions(); $options['sql'] = "SELECT conversations.id, message FROM conversations LEFT JOIN messages ON (conversations.id = messages.conversations_id) WHERE (SELECT id FROM messages WHERE conversations_id = conversations.id ORDER BY date_created DESC LIMIT 1) = messages.id AND (conversations.method = 'CHAT' OR conversations.method = 'CHATBOT') AND messages.date_created < now() + INTERVAL -" . (int)\UNL\VisitorChat\Controller::$conversationTTL . " MINUTE AND (conversations.status = 'CHATTING' OR conversations.status = 'SEARCHING')"; return self::getBySql($options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getUnreadConversations() {\n return DB::table('conversations')\n ->join('participants', function($join) {\n $join->on('participants.conversation_id', '=', 'conversations.id')\n ->on('participants.last_read', '<',...
[ "0.63908464", "0.6250145", "0.60021186", "0.5771216", "0.5753393", "0.5634709", "0.5605642", "0.5478655", "0.5407373", "0.53847027", "0.5342065", "0.532252", "0.5243816", "0.5232736", "0.5214624", "0.5194992", "0.5188993", "0.5176792", "0.51290023", "0.51153564", "0.5106208",...
0.7715345
0
Gets a list of all idle conversations. A conversation is considered idle based on the time of the last message posted and the conversationTTL setting in the controller.
public static function getAllSearchingEmailConversations($options = array()) { //Build the list $options = $options + (new RecordList)->getDefaultOptions(); $options['sql'] = "SELECT conversations.id, message FROM conversations LEFT JOIN messages ON (conversations.id = messages.conversations_id) WHERE (SELECT id FROM messages WHERE conversations_id = conversations.id ORDER BY date_created DESC LIMIT 1) = messages.id AND conversations.method = 'EMAIL' AND messages.date_created < now() + INTERVAL -" . (int)\UNL\VisitorChat\Controller::$conversationTTL . " MINUTE AND (conversations.status = 'CHATTING' OR conversations.status = 'SEARCHING')"; return self::getBySql($options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAllIdleConversations($options = array()) {\n //Build the list\n $options = $options + (new RecordList)->getDefaultOptions();\n $options['sql'] = \"SELECT conversations.id, message\n FROM conversations\n LEFT JOIN mes...
[ "0.77161443", "0.639176", "0.6253238", "0.6003354", "0.57741725", "0.57559013", "0.56375766", "0.56085944", "0.5480252", "0.54108155", "0.5386998", "0.53446406", "0.5324518", "0.5245553", "0.5234964", "0.52149624", "0.519543", "0.5187628", "0.51789904", "0.51298064", "0.51191...
0.4598238
83
Build the chat status constraint.
public static function getConversationsForUser($userID, $chatStatus = false, $options = array()) { $constraint = ""; if ($chatStatus) { $constraint = "AND conversations.status = '" . self::escapeString($chatStatus) . "'"; } //Build the list $options = $options + (new RecordList)->getDefaultOptions(); $options['sql'] = "SELECT conversations.id FROM conversations LEFT JOIN assignments ON (conversations.id = assignments.conversations_id) WHERE assignments.users_id = " . (int)$userID . " AND (assignments.status = 'ACCEPTED' OR assignments.status = 'COMPLETED') $constraint ORDER BY conversations.date_created DESC"; return self::getBySql($options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function buildStatusFields()\n {\n //====================================================================//\n // Order Current Status\n $this->fieldsFactory()->create(SPL_T_VARCHAR)\n ->Identifier(\"status\")\n ->Name(Translate::getAdminTranslation(\"Status\"...
[ "0.5204905", "0.51732594", "0.5075318", "0.5001444", "0.4883574", "0.48571327", "0.48432925", "0.46995038", "0.46629268", "0.46604362", "0.46587604", "0.46195787", "0.46006712", "0.46001738", "0.45946902", "0.45653456", "0.45423868", "0.45247012", "0.45169893", "0.45118675", ...
0.0
-1
///////////////////////////////// end CRUD /////////////////////////////////////////////
public function getAllMachina($request, $response, $args) { $id=$args['id']; $ret = maq_rep::TraerTodosMaquina($id); $newResponse = $response->withJson($ret, 200); return $newResponse; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function crud() {\n\t\t\n\t\t$this->load->model('Produttori_model','produttori');\n\t\t$data=array(\"produttore\" => \"franco\");\n\t\t$this->produttori->create($data);\n\t\t$this->produttori->update(array(),1);\n\t\t$this->produttori->delete(3);\n\t\tvar_dump ($this->produttori->read());\n\t\t$this->load->...
[ "0.65184134", "0.65005285", "0.6420956", "0.63752794", "0.63282883", "0.6328282", "0.6315142", "0.6294663", "0.6294663", "0.6207952", "0.6176747", "0.61562335", "0.61243725", "0.61195934", "0.61052084", "0.61013615", "0.60824543", "0.6033119", "0.6030603", "0.6025666", "0.600...
0.0
-1
Called when view the creation form.
public function index_onCreateForm() { parent::create(); return $this->makePartial('create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function createForm()\n {\n }", "public function create()\n\t{\t\n\t\t\n\t\t// load the create form (app/views/fbf_presenca/create.blade.php)\n\t\t$this->layout->content = View::make('fbf_presenca.create')\n;\n\t...
[ "0.8177952", "0.79812753", "0.77793795", "0.7682758", "0.7682758", "0.76644146", "0.76644146", "0.76644146", "0.76644146", "0.76185876", "0.7605621", "0.759826", "0.7588477", "0.7561074", "0.75554293", "0.7547765", "0.7547765", "0.75470513", "0.7540081", "0.7528355", "0.75283...
0.816507
1
Called when record is created.
public function index_onCreate() { parent::create_onSave(); return $this->controller->listRefresh(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createRecord();", "public function onSaveNewRecord()\n {\n $this->created = $this->updated = new \\DateTime();\n $this->rev = 1;\n }", "public function create(Tinebase_Record_Interface $_record) {\n }", "public function create()\n\t{\n\t\t\n\t\t//\n\t}", "public funct...
[ "0.7818932", "0.6874693", "0.67229396", "0.6573961", "0.6573055", "0.6566566", "0.65605944", "0.65420943", "0.6541739", "0.6527829", "0.6527829", "0.65011716", "0.6499331", "0.64985627", "0.6497928", "0.6486302", "0.6478104", "0.64617205", "0.64617205", "0.64617205", "0.64617...
0.0
-1
Called when view the update form.
public function index_onUpdateForm() { $record_id = post('record_id'); parent::update($record_id); $this->controller->vars['record_id'] = $record_id; return $this->makePartial('update'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateForm(){\n $new = $this->model->getNew();\n $this->view->updateForm($new);\n }", "private function update_form()\n\t{\n\t\t$this->title = sprintf(lang('update_title'), $this->installed_version, $this->version);\n\t\t$vars['action'] = $this->set_qstr('do_update');\n\t\t$this-...
[ "0.7787808", "0.76972586", "0.75012714", "0.7350414", "0.7343673", "0.7136632", "0.70738024", "0.70074", "0.6977582", "0.6977582", "0.690154", "0.68174213", "0.6801636", "0.67400956", "0.67120886", "0.6699232", "0.6698965", "0.66947037", "0.6694545", "0.6684002", "0.6680352",...
0.78059417
0
Called when record is updated.
public function index_onUpdate() { $record_id = post('record_id'); parent::update_onSave($record_id)); return $this->controller->listRefresh(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }", "public function update($record);", "protected function performUpdate() {}", "public function update(Tinebase_Record_Interface $_record) {\n }", "protected function update() {}", "protec...
[ "0.8240956", "0.72095877", "0.7132987", "0.70146465", "0.70145035", "0.69764525", "0.69764525", "0.69472766", "0.6727736", "0.66644263", "0.66431844", "0.6627668", "0.66194415", "0.65953183", "0.65304273", "0.6525666", "0.65243214", "0.65151817", "0.6485487", "0.6481069", "0....
0.66507
10
$audios = Track::findAll(['type' => 'audio']);
public function actionIndex() { // $videos = Track::findAll(['type' => 'video']); return $this->render('index',['audio' => '1','video' => '1']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function model()\n {\n return Audio::class;\n }", "public function model()\n {\n return Audio::class;\n }", "public function audio_tracks(){\n return $this->hasMany('App\\AudioTrack');\n }", "public function getTracksAudio () {\n $tracks = [];\n $files = Storag...
[ "0.68406", "0.68406", "0.68265045", "0.64751625", "0.6137249", "0.6079677", "0.59715414", "0.5815132", "0.57713187", "0.57629347", "0.57611454", "0.5739055", "0.56956613", "0.56812894", "0.5675972", "0.5644856", "0.56220853", "0.56055135", "0.5567175", "0.5432586", "0.5374294...
0.56145287
17
Display a listing of the resource.
public function index() { $todo = Todo::all(); return view('home')->with(compact('todo')); }
{ "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) { $data = $request->validate([ 'name' => 'required|max:50', 'dob' => 'required', 'address' => 'required', 'postcode' => 'required', 'state_id' => 'required' ]); $todo = Todo::create($data); return Response::json($todo); }
{ "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
Finds a single object by a set of criteria.
public function findOneBy(array $criteria);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function findOneBy(array $criteria);", "public function find(array $criteria);", "public function findOneBy($criteria);", "public function getOneBy(array $criteria);", "public function find(array $conditions = []);", "public function findBy(array $criteria);", "public function findOn...
[ "0.7848679", "0.77024996", "0.7549836", "0.73790014", "0.72849756", "0.72729474", "0.72524965", "0.71501535", "0.71273106", "0.7055579", "0.7035512", "0.7035512", "0.68538964", "0.68081313", "0.67926735", "0.6791479", "0.67565936", "0.67460996", "0.67360353", "0.6714842", "0....
0.77505267
3
/ Get vehicle_geofence_assignment by id
function get_vehicle_geofence_assignment($id) { $this->db->select("vga.id,vga.vehicle_id,vga.geofence_id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date" . ",date(vga.update_date) as update_date," . "CONCAT(u.first_name,',',u.last_name) as assign_uid," . ",CONCAT(u2.first_name,',',u2.last_name) as update_uid," . "in_alert,out_alert,sms_alert,email_alert") ->from("vehicle_geofence_assignment vga") ->join("vehicles v", "v.vehicle_id = vga.vehicle_id", "right") ->join("users u", "u.user_id = vga.assign_uid", "left") ->join("users u2", "u2.user_id = vga.update_uid", "left") ->join("geofence g", "g.id = vga.geofence_id", "left") ->where("vga.id", $id) ->where("vga.account_id", $this->session->userdata("hawk_account_id")); $query = $this->db->get(); return $query->row_array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_vehicle_geofence_assignment($id, $params) {\n $this->db->where('id', $id);\n $response = $this->db->update('vehicle_geofence_assignment', $params);\n if ($response) {\n return \"vehicle_geofence_assignment updated successfully\";\n } else {\n return...
[ "0.65768445", "0.64559877", "0.6339131", "0.6193969", "0.6018292", "0.5611572", "0.5437773", "0.53892237", "0.5293428", "0.52860874", "0.52570254", "0.52543825", "0.5250408", "0.51520956", "0.50781864", "0.5073617", "0.5049677", "0.5021969", "0.5020745", "0.50073355", "0.5002...
0.77601165
0
/ Get all vehicle_geofence_assignment
function get_all_vehicle_geofence($vehicle_id = null) { if (isset($vehicle_id)) { $this->db->where("vga.vehicle_id", $vehicle_id); } $this->db->select("vga.id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date" . ",date(vga.update_date) as update_date," . "CONCAT(u.first_name,',',u.last_name) as assign_uid," . ",CONCAT(u2.first_name,',',u2.last_name) as update_uid," . "in_alert,out_alert,sms_alert,email_alert") ->from("vehicle_geofence_assignment vga") ->join("vehicles v", "v.vehicle_id = vga.vehicle_id", "right") ->join("users u", "u.user_id = vga.assign_uid", "left") ->join("users u2", "u2.user_id = vga.update_uid", "left") ->join("geofence g", "g.id = vga.geofence_id", "left") ->where("vga.account_id", $this->session->userdata("hawk_account_id")) ->order_by("vga.status", "desc"); $query = $this->db->get(); return $query->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_vehicle_geofence_assignment($id) {\n $this->db->select(\"vga.id,vga.vehicle_id,vga.geofence_id,plate_no,g.name,g.type,vga.status,date(vga.assign_date) as assign_date\"\n . \",date(vga.update_date) as update_date,\"\n . \"CONCAT(u.first_name,',',u.la...
[ "0.69417584", "0.5792541", "0.57728255", "0.5378969", "0.5337486", "0.5317466", "0.5279488", "0.5254071", "0.52165556", "0.52145034", "0.52144593", "0.51434386", "0.5123004", "0.5112198", "0.5075808", "0.5044118", "0.501423", "0.49985194", "0.4985502", "0.49741435", "0.490702...
0.7000169
0
/ function to add new vehicle_geofence_assignment
function add_vehicle_geofence_assignment($params) { $params['status'] = 1; $this->db->insert('vehicle_geofence_assignment', $params); return $this->db->insert_id(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_vehicle_geofence_assignment($id, $params) {\n $this->db->where('id', $id);\n $response = $this->db->update('vehicle_geofence_assignment', $params);\n if ($response) {\n return \"vehicle_geofence_assignment updated successfully\";\n } else {\n return...
[ "0.59476495", "0.5339896", "0.52166086", "0.50555676", "0.49128625", "0.47900632", "0.4782088", "0.4773849", "0.47499636", "0.47288382", "0.47044054", "0.46734616", "0.46727452", "0.4666103", "0.4664354", "0.46551523", "0.46493262", "0.46308765", "0.4616317", "0.46146682", "0...
0.7993619
0
/ function to update vehicle_geofence_assignment
function update_vehicle_geofence_assignment($id, $params) { $this->db->where('id', $id); $response = $this->db->update('vehicle_geofence_assignment', $params); if ($response) { return "vehicle_geofence_assignment updated successfully"; } else { return "Error occuring while updating vehicle_geofence_assignment"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_vehicle_geofence_assignment($params) {\n $params['status'] = 1;\n $this->db->insert('vehicle_geofence_assignment', $params);\n return $this->db->insert_id();\n }", "function get_vehicle_geofence_assignment($id) {\n $this->db->select(\"vga.id,vga.vehicle_id,vga.geofence...
[ "0.67844564", "0.547341", "0.5471063", "0.53886133", "0.52800906", "0.52572995", "0.5181716", "0.5072404", "0.50360197", "0.50171363", "0.4978722", "0.4978353", "0.49743152", "0.49743152", "0.4953974", "0.48693395", "0.4859785", "0.48082832", "0.47805163", "0.47803462", "0.47...
0.7104693
0
/ function to delete vehicle_geofence_assignment
function delete_vehicle_geofence_assignment($id) { $response = $this->db->delete('vehicle_geofence_assignment', array('id' => $id)); if ($response) { return "vehicle_geofence_assignment deleted successfully"; } else { return "Error occuring while deleting vehicle_geofence_assignment"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete() {\n\t\t$this->assignment->delete();\n\t}", "function delete(){\n // Renumber resolutions\n $resolutions = resolution::getResolutions($this->committeeId, $this->topicId);\n foreach($resolutions as $resolution){\n if($resolution->resolutionNum <= $this->reso...
[ "0.6305839", "0.58737594", "0.58670783", "0.58670783", "0.5857505", "0.5848575", "0.58225924", "0.5804214", "0.57480526", "0.5734508", "0.5708458", "0.57063586", "0.5705181", "0.57026464", "0.5636021", "0.56256634", "0.5618755", "0.5596669", "0.5584243", "0.5583029", "0.55683...
0.7569554
0
Run the database seeds.
public function run() { DB::table('ops_order')->delete(); opsOrder::create([ 'OrderCode' => 'O-2017080001', 'CustomerCode' => 'C2017080001', 'OrderDate' => Carbon::today()->toDateString(), ]); }
{ "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
[getProductBids fetch autometic bid details]
public function getAutoProductBids($product_id){ $date = new DateTime('2014-06-1', new DateTimeZone($this->config->get('wkproduct_auction_timezone_set'))); $zone = $date->format('P'); $query = "SELECT CONVERT_TZ(NOW(), @@session.time_zone, '$zone') as time;"; $data = $this->db->query($query)->row; $time = date("Y-m-d H:i:s", strtotime($data['time'])); $result = $this->db->query("SELECT wab.user_id,wab.user_bid,c.firstname,c.lastname FROM ".DB_PREFIX."wk_automatic_auctionbids wab LEFT JOIN ".DB_PREFIX."customer c ON wab.user_id=c.customer_id WHERE wab.product_id = '".$product_id."' AND wab.start_date <= '".$time."' AND wab.end_date >= '".$time."' AND winner != 1 ORDER BY wab.user_bid DESC LIMIT 0,10")->rows; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bidList()\n {\n return $this->p_bidList;\n }", "public function getBidId(){\n return $this->bidId; \n }", "function viewBiddingofUser($conn,$userID){\n\t$status = 0;\n $response = array();\n\t//select all item whicn is available and is bid by this user\n\t$sql = \"sel...
[ "0.64565176", "0.637513", "0.63570374", "0.6267922", "0.61740637", "0.6028982", "0.5973907", "0.5949159", "0.5920895", "0.5796354", "0.5763516", "0.57352936", "0.5709202", "0.5684421", "0.5682297", "0.5672321", "0.56345785", "0.5545192", "0.5541577", "0.55033445", "0.5499496"...
0.6332182
3
[wkauto_auctionbids_insertbids inserts automatic bids]
public function wkauto_auctionbids_insertbids($data,$user){ $date = new DateTime('2014-06-1', new DateTimeZone($this->config->get('wkproduct_auction_timezone_set'))); $zone = $date->format('P'); $query = "SELECT CONVERT_TZ(NOW(), @@session.time_zone, '$zone') as time;"; $data_time = $this->db->query($query)->row; $time = date("Y-m-d H:i:s", strtotime($data_time['time'])); $userExist = $this->db->query("SELECT user_id,product_id FROM ".DB_PREFIX."wk_automatic_auctionbids WHERE user_id = '".$data['user']."' AND product_id='".$data['product_id']."' AND winner = 0 " )->row; $sql=$this->db->query("SELECT MAX(wab.user_bid) id,wa.min,wa.max,wa.product_id FROM " . DB_PREFIX . "wkauction wa LEFT JOIN ". DB_PREFIX . "wk_automatic_auctionbids wab ON (wa.id=wab.auction_id) WHERE wa.id = '" . (int)$data['auction'] . "' AND wab.winner = 0 AND wab.start_date<='".$time."' AND wab.end_date>='".$time."' ")->row; $normal_max_bid=$this->db->query("SELECT MAX(wab.user_bid) id,wa.min,wa.max,wa.product_id FROM " . DB_PREFIX . "wkauction wa LEFT JOIN ". DB_PREFIX . "wkauctionbids wab ON (wa.id=wab.auction_id) WHERE wa.id = '" . (int)$data['auction'] . "' AND wab.winner = 0 AND wab.start_date<='".$time."' AND wab.end_date>='".$time."' ")->row; $range = $this->db->query("SELECT min,max FROM ".DB_PREFIX."wkauction WHERE id='".$data['auction']."' ")->row; if($data['amount']>=$range['max'] || $data['amount']<=$range['min']){ return 'not done'; } if(isset($normal_max_bid['product_id'])){ if(count($normal_max_bid)!=0 && $data['amount']<=$normal_max_bid['id']){ return 'not_min_auction'; //only for checking not messages } } if(isset($sql['product_id'])){ if(count($sql)!=0 && $data['amount']<=$sql['id']){ return 'not'; //only for checking not messages } } if($userExist) { $sql = "UPDATE " . DB_PREFIX . "wk_automatic_auctionbids SET winner='0',sold='0',auction_id = '" . (int)$data['auction']. "', user_id = '" .(int)$user."', product_id = '" .(int)$data['product_id']."', start_date = '" .$this->db->escape($data['start_date']). "', end_date = '" .$this->db->escape($data['end_date'])."', date = '".$time."', user_bid = '" .(double)$data['amount']."' WHERE user_id = '".$userExist['user_id']."' AND product_id = '".$userExist['product_id']."' AND winner = 0 "; $query=$this->db->query($sql); }else{ $sql = "INSERT INTO " . DB_PREFIX . "wk_automatic_auctionbids SET winner='0',sold='0',auction_id = '" . (int)$data['auction']. "', user_id = '" .(int)$user."', product_id = '" .(int)$data['product_id']."', start_date = '" .$this->db->escape($data['start_date']). "', end_date = '" .$this->db->escape($data['end_date'])."', date = '".$time."', user_bid = '" .(double)$data['amount']."'"; $query=$this->db->query($sql); } return 'done'; //only for checking not mesaages }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addBid($itemid, $buserid, $bidamount)\n {\n $itemid = mysql_real_escape_string( $itemid);\n $buserid = mysql_real_escape_string( $buserid);\n $biddate = date('Y-m-d');\n $bidtime = time('H:i:s');\n $bidamount = mysql_real_escape_string($bidamount);\n $sql=\"IN...
[ "0.5938184", "0.58566076", "0.58543193", "0.5742449", "0.57308227", "0.5667897", "0.5620382", "0.55823296", "0.55725706", "0.5465333", "0.54337233", "0.5431652", "0.5405736", "0.53686404", "0.53497505", "0.534635", "0.5337155", "0.5299727", "0.5297826", "0.52938837", "0.52892...
0.6893643
0
This is the controller for the homepage.
public function index() { $this->data['pagebody'] = 'homepage'; // this is the view we want shown $teams = $this->team->all(); $list = array(); foreach ($teams as $team) { $list[$team["code"]] = $team["name"]; } $this->data['selection'] = form_dropdown('teams', $list, '', 'id="teams"'); $this->data['additionalJs'] = '<script src="/assets/js/prediction.js"></script>'; $this->render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index() {\n $this->home(); \n }", "public function index() {\n\n\t\t$data['content'] = 'Homepage';\n\t\t$this->flexi->title('Homepage')\n\t\t\t\t\t->make('home', $data);\n\n\t}", "public function index() {\n\n\t\tif(!empty($_GET['page'])) {\n\t\t\tif($_GET['page'] == 'home') {...
[ "0.8125734", "0.809419", "0.7953311", "0.79244953", "0.7804663", "0.77974397", "0.77931726", "0.77711487", "0.774903", "0.7711235", "0.7708371", "0.76928794", "0.7690008", "0.76850045", "0.7684042", "0.7653408", "0.76532114", "0.7648796", "0.76132715", "0.76085085", "0.760218...
0.0
-1
Return a single project
public function find($id, array $with = array()) { return $this->findThroughColumn($id, $with); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_project(){\n if ( $this->project != NULL){\n $myProject= new Project();\n return $myProject->get_by_ID($this->project);\n }\n }", "private function getProject()\n {\n $url = $this->base_uri.\"project/\".$this->project;\n $project = $this->request($url);...
[ "0.8227643", "0.81461644", "0.7868313", "0.7868313", "0.7680388", "0.7641327", "0.75985277", "0.7586173", "0.75367993", "0.7495326", "0.7493603", "0.74736357", "0.7472539", "0.74059176", "0.7402656", "0.7402656", "0.73534983", "0.7321618", "0.7312343", "0.7268293", "0.7267876...
0.0
-1
Get Results by Page
public function getByPage($page = 1, $limit = 10, $with = array()) { return $this->getByPageThroughColumn($page, $limit, $with); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPageResults(int $page = 1): array;", "public function getByPage($pageNo) {}", "public function getList($page);", "public function getPage();", "public function getPage($pageNumber = 0);", "public function getPages();", "public function getResultsForPage(int $page = 1)\n {\n ...
[ "0.7974593", "0.73173827", "0.7184264", "0.7050876", "0.6976383", "0.68216693", "0.67577434", "0.67133176", "0.67079526", "0.6701624", "0.66957736", "0.6657719", "0.66326857", "0.6580734", "0.6535044", "0.650758", "0.6457221", "0.6457221", "0.6446972", "0.64348406", "0.642969...
0.0
-1
Search for a single result by key and value
public function getFirstBy($key, $value, array $with = array()) { return $this->getFirstByThroughColumn($key, $value, $with); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function find ($key);", "public function getBy($key, $value);", "public function find(int $key);", "public function findFirstByKey($key);", "public function find($primaryValue);", "public function findByKey($key, $token);", "public function find($value);", "function searchByKey($keyVal, $array...
[ "0.7035525", "0.6930657", "0.67059666", "0.6607768", "0.6597266", "0.65115374", "0.6492918", "0.63967717", "0.6157202", "0.615621", "0.61440235", "0.61434484", "0.60285205", "0.5950472", "0.5948574", "0.5948025", "0.5943677", "0.5903959", "0.5894827", "0.5891082", "0.5886907"...
0.0
-1
Search for many results by key and value
public function getManyBy($key, $value, array $with = array()) { return $this->getManyByThroughColumn($key, $value, $with); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cpSearch($tablename,$value1=0,$value2=0) {\n\n /*\n * Prepare the select statement\n */\n $sql=\"SELECT * FROM $tablename\";\n if($value1!=0)\n { $key1= key($value1);\n $sql.=\" where $key1 like '%$value1[$key1]%'\";\n }\n if($value1!=0 && $value2!=0) \n ...
[ "0.60674536", "0.58577555", "0.58548766", "0.58534956", "0.5825886", "0.58209693", "0.57837963", "0.57722884", "0.57695466", "0.57453954", "0.57453954", "0.5669044", "0.5632001", "0.5625059", "0.5584379", "0.5576225", "0.5549484", "0.5539646", "0.55303764", "0.5525359", "0.55...
0.0
-1
Display a listing of the resource.
public function oferta() { return view('newsletter.oferta'); }
{ "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
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// HELPER FUNCTIONS ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function hasClass($DOMElement, $classname){ if (!$DOMElement->getAttribute("class")) return false; if (preg_match("~(^| )".$classname."( |$)~", $DOMElement->getAttribute("class"))) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function helper()\n\t{\n\t\n\t}", "private function _i() {\n }", "private function __() {\n }", "private function static_things()\n\t{\n\n\t\t# code...\n\t}", "abstract protected function external();", "function _prepare() {}", "private function __construct()\t{}", "abstract protec...
[ "0.6820881", "0.5922928", "0.55304813", "0.5426056", "0.5332057", "0.527056", "0.5264991", "0.5192188", "0.5185682", "0.5185682", "0.5185682", "0.5185682", "0.5171951", "0.5169123", "0.5169123", "0.5160467", "0.5133725", "0.5133725", "0.51315665", "0.50822395", "0.5081866", ...
0.0
-1
END AUTH Get idProf
public function getIdProf() { return $this->idProf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listProById()\n {\n\n // obtener el perfil por id\n $id = 3985390143818633;\n print_r($this->getProfile($id)); \n\n }", "function getProfileID() {\n\t\treturn $this->_ProfileID;\n\t}", "public function getId_Profesor()\n {\n return $this->id_profesor;\n }", "functi...
[ "0.6538144", "0.6449604", "0.63818187", "0.62674844", "0.6218616", "0.6160209", "0.60681003", "0.6044823", "0.60376567", "0.6015372", "0.5985411", "0.5980361", "0.5974151", "0.5917154", "0.5916462", "0.586037", "0.58591735", "0.58574146", "0.5847538", "0.5844989", "0.5844149"...
0.7223227
0
Create or update a record matching the attributes, and fill it with values.
public function updateOrCreate(array $attributes, array $values = []) { $result = $this->_model->updateOrCreate($attributes, $values); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateOrCreateRecord(array $record) {\n /** @var CmfDbModel|KeyValueModelHelpers $this */\n if (empty($record['key'])) {\n throw new DbModelException($this, '$record does not contain [key] key or its value is empty');\n } else if (!array_key_exists('value', $record))...
[ "0.65145797", "0.64139426", "0.64108765", "0.6342939", "0.63365686", "0.6192365", "0.6097777", "0.6059532", "0.6058125", "0.5993739", "0.5936922", "0.589888", "0.5859133", "0.5844759", "0.5827632", "0.5810893", "0.57815766", "0.57736886", "0.5715631", "0.5695516", "0.56309915...
0.5532908
30
helps binding locale prefix [en, ar] to view url example: /en/about
public static function route($routeName) { $prefix = \App::isLocale('en') ? 'en' : 'ar'; return url($prefix . '/' . $routeName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function my_locale_url($locale)\n {\n // Parse URL\n $urlParsed = parse_url(Request::fullUrl());\n if (isset($urlParsed['query'])) {\n parse_str($urlParsed['query'], $params);\n }\n // Set locale to params\n $params['lang'] = $locale;\n\n // Build quer...
[ "0.69684005", "0.66739017", "0.62418747", "0.6153795", "0.61295", "0.61245936", "0.61179996", "0.60981715", "0.6069777", "0.59347165", "0.5904051", "0.59038585", "0.5825536", "0.58139974", "0.57895136", "0.5788633", "0.5710751", "0.569959", "0.56736225", "0.56018907", "0.5581...
0.0
-1
convert lang_id [1, 2] to ['en', 'ar']
public static function getUserLocale() { $lang_id = Auth::user()->lang_id; $locale = ($lang_id == 1) ? 'en' : 'ar'; Session::put('locale', $locale); return $locale; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getInverseLangCodesMapping()\n {\n $oLang = \\OxidEsales\\Eshop\\Core\\Registry::getLang();\n $aLanguages = $oLang->getLanguageArray();\n $aRetArray = array();\n foreach ($aLanguages as $aLanguage) {\n $aRetArray[$aLanguage->id] = $aLanguage->oxid;\n ...
[ "0.68240523", "0.67489463", "0.60517883", "0.59584564", "0.58605766", "0.5851838", "0.57318735", "0.57133245", "0.5690931", "0.5677893", "0.5656834", "0.5631202", "0.5623903", "0.55831015", "0.5573501", "0.5538129", "0.55328315", "0.55250895", "0.54786545", "0.5470317", "0.54...
0.0
-1
get user's last login time in UTC
public static function getUserLastLogin() { return Users::where('id', Auth::user()->id)->first()->last_login; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function lastLoginTime();", "public function getLastLoginDateAndTime() {}", "public function getLastLoginTime()\n {\n return $this->last_login_time;\n }", "public function getLastLoginAt();", "public function getLastLogin() {\n\n $lastLoginDateTime = \\DateTime::createFromFormat(...
[ "0.8500162", "0.83748925", "0.8198686", "0.8132589", "0.79475373", "0.76591897", "0.76424056", "0.75524944", "0.7514378", "0.7455361", "0.7445956", "0.7191092", "0.7168853", "0.7151985", "0.7151985", "0.71453303", "0.71244043", "0.71244043", "0.71244043", "0.71244043", "0.712...
0.75014526
9
get user's current timezone from DB
public static function getUserTimezone() { return Users::where('id', Auth::user()->id)->first()->timezone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function user_timezone() {\n global $USER, $remotedb;\n $sql = \"SELECT timezone FROM {user} WHERE id = ?\";\n $params = array($USER->id);\n $timezone = $remotedb->get_record_sql($sql, $params);\n return $timezone ? $timezone->timezone : 99;\n }", "public function get...
[ "0.86436653", "0.7483286", "0.7337002", "0.72573817", "0.724671", "0.7228356", "0.7198175", "0.7168709", "0.7121297", "0.70778155", "0.70546204", "0.7046977", "0.70364594", "0.703261", "0.70259583", "0.70215976", "0.702086", "0.69955325", "0.69896823", "0.6976687", "0.6969740...
0.8498203
1
convert UTC to user's local timezone
public static function getUserLocalTimezone($timestamp = null, $format = 'h:m A - M d Y') { return \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $timestamp, 'GMT')->setTimeZone(Helper::getUserTimezone())->format($format); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function date_sys_to_local($timestamp, $local_tz='') {\n\tif($local_tz == '') $local_tz = @$_SESSION['cms']['user']['timezone'];\n\tif($local_tz == '') return $timestamp;\n\t\n\t$offset = date_tz_offset($timestamp, $local_tz);\n\treturn $timestamp + $offset;\n}", "public static function convertUtc0ToUserTimezone...
[ "0.67844003", "0.6583868", "0.65731144", "0.6431809", "0.64239585", "0.64139736", "0.63574165", "0.63529027", "0.63414145", "0.6335767", "0.6272131", "0.6231112", "0.6175453", "0.617137", "0.61555284", "0.6130551", "0.6113226", "0.6110703", "0.60823375", "0.6010368", "0.60039...
0.5698712
33
Returns a collection of all related links
public static function getLinks($item_id, $lang_id) { $localization = EntityLocalization::where('field', 'link') ->where('item_id', $item_id) ->where('lang_id', $lang_id) ->where('value', 'NOT LIKE', '%youtube%') ->get(); return $localization; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRelatedLinks()\n {\n return $this->_relLinks;\n }", "public function getRelatedLinks()\n {\n return $this->_relLinks;\n }", "public function getRelatedLinks()\n {\n return $this->_relLinks;\n }", "public function ge...
[ "0.8063407", "0.8063407", "0.8063407", "0.8063407", "0.8063407", "0.8063407", "0.8063407", "0.8063407", "0.8063407", "0.8063407", "0.8063407", "0.783965", "0.7514421", "0.7502209", "0.74329937", "0.729128", "0.71676993", "0.71676993", "0.71451634", "0.71174514", "0.71174514",...
0.0
-1
Returns a collection of youtube links
public static function getYoutubeLinks($item_id, $lang_id) { $links_arr = ['', '']; $localization = EntityLocalization::where('field', 'link') ->where('item_id', $item_id) ->where('lang_id', $lang_id) ->where('value', 'LIKE', '%youtube%') ->get(); if (count($localization) > 0) { if (isset($localization[0])) { $links_arr[0] = $localization[0]->value; } if (isset($localization[1])) { $links_arr[1] = $localization[1]->value; } } return $links_arr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getYoutubeVideos()\n {\n return $this->youtube_videos;\n }", "function getYouTubeLink()\n {\n $youtubeLink = new Link();\n $youtubeLink->setTitle('YouTube');\n $youtubeLink->setTarget('https://www.youtube.com/channel/UCXmtnbNO7_no7RekfUIqVcw');\n $youtu...
[ "0.7233361", "0.6671031", "0.66378033", "0.6523865", "0.6337566", "0.6334777", "0.6325676", "0.6284445", "0.62772", "0.62378716", "0.6228286", "0.6228286", "0.6227925", "0.6200569", "0.6076801", "0.60681975", "0.60303587", "0.6012129", "0.60054064", "0.59874755", "0.59874755"...
0.60513353
16
Add new localization into `entity_localization` table
public static function add_localization($entity_id, $field, $item_id, $value, $lang_id) { $localization = new EntityLocalization; $localization->entity_id = $entity_id; $localization->field = $field; $localization->value = $value; $localization->item_id = $item_id; $localization->lang_id = $lang_id; $localization->save(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testUpdateTranslationWithLocaleInEntity(): void\n {\n $table = $this->getTableLocator()->get('Articles');\n $table->addBehavior('Translate', ['fields' => ['title', 'body']]);\n $article = $table->find()->first();\n $this->assertSame(1, $article->get('id'));\n $...
[ "0.618603", "0.58940005", "0.5868121", "0.57442737", "0.5700741", "0.5679664", "0.56244624", "0.55950224", "0.5575678", "0.5548704", "0.55447686", "0.5500646", "0.5461112", "0.54520863", "0.5435318", "0.5401778", "0.5393687", "0.5371231", "0.5366857", "0.5365915", "0.53038365...
0.68696773
0
Mostra os top 5 deputados que mais gastaram verbas na categoria informada
public function topCincoDeputadosCategoria($codTipoDespesa) { $serviceDeputado = Deputados::getService();; $topDeputados = $serviceDeputado->buscarTopDeputadosPorDespesa($codTipoDespesa); return view('verbas_indenizatorias.top_cinco_deputados_categoria', ['topDeputados' => $topDeputados]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function topCategory(){\n $category = Category::select('title')\n ->join('category_meals', 'categories.id', 'category_meals.category_id')\n ->selectRaw('COUNT(category_id) AS count')\n ->groupby('title')\n ->orderBy('count', 'desc')\n ->take(5)\n ->get();\n ...
[ "0.64558333", "0.63861537", "0.627026", "0.61985165", "0.6145836", "0.613995", "0.61307913", "0.60768807", "0.602096", "0.58634114", "0.5840066", "0.5817883", "0.5806332", "0.5805818", "0.5719755", "0.5686841", "0.5641024", "0.56330204", "0.55967516", "0.5552871", "0.5546515"...
0.0
-1
Get post store fields from request.
public function getStoreDataFromRequest(FormRequest $request) { $request->merge(['active' => ($request->active) ? 1 : 0]); return $request->except(['_token', 'category_id', 'tags', 'image']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPostFields()\n {\n return $this->invokeWrappedIfEntityEnclosed(__FUNCTION__, func_get_args());\n }", "public function getPostParams()\n {\n return $this->request->all();\n }", "protected function get_fields() {\n\t\treturn rwmb_get_registry( 'field' )->get_by_object...
[ "0.7047386", "0.68666387", "0.668019", "0.65796393", "0.65465343", "0.6516127", "0.6502755", "0.6501424", "0.6412936", "0.6377357", "0.63515866", "0.63342285", "0.6332466", "0.6287863", "0.6282994", "0.62141764", "0.61593604", "0.60750884", "0.60721993", "0.6034869", "0.60335...
0.5999881
23
Get post image from request.
public function getImageFromRequest(FormRequest $request) { return $request->file('image'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getImage()\n {\n return $this->get('image');\n }", "function rest_get_featured_image( $post, $field_name, $request ) {\n $attachment_id = $post['featured_media'];\n $attachment_info = wp_get_attachment_image_src( $attachment_id, 'rest_post_thumbnail' );\n return $attachment_...
[ "0.67804134", "0.6226074", "0.6222303", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", "0.6217657", ...
0.7483523
0
Get post categories ids from request.
public function getCategoriesIdsFromRequest(FormRequest $request) { $categoryIds = $request->input('category_id', []); if (is_null($categoryIds)) { return []; } if (!is_array($categoryIds)) { return [$categoryIds]; } return $categoryIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_categories_from_post(){\n\t\t\n\t\t$categorias_bbdd=$this->get_categories(0,true);\n\t\t\n\t\t//Se inicia $this->num a 0 por que va a servir de indice para \n\t\t//la lista $this->categorias\n\t\t$this->num=0;\t\t\n\t\t$this->serv_cat_list=\"\";\n\t\t//con esta lista cogemos los checkbox que esten señ...
[ "0.6574451", "0.65149295", "0.650191", "0.64733267", "0.64367276", "0.6369342", "0.63379025", "0.62997186", "0.6281136", "0.6272477", "0.62447727", "0.62176013", "0.61998785", "0.61902714", "0.61053264", "0.60955364", "0.6043584", "0.5954529", "0.5937874", "0.5910052", "0.590...
0.67760575
0
Get tags ids for post from request.
public function getTagIdsFromRequest(FormRequest $request, TagRepository $tagRepo) { $tags = $this->getUniqueTags($request->get('tags', [])); $tagIds = []; $dbTags = $this->getTagsFromDbByName($tags, $tagRepo); foreach ($tags as $tagName) { if (array_key_exists($tagName, $dbTags)) { $tagIds[] = $dbTags[ $tagName ]; continue; } $model = $tagRepo->create($this->getTagDataForNewTagByTagName($tagName)); $tagIds[] = $model->id; } return $tagIds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tagIDs()\n {\n return $this->tags()->pluck('tag_id');\n }", "public function get_tag_ids()\n {\n $tags = $this->tags->find_all();\n\n $ids = [];\n\n foreach ($tags as $tag) {\n if ($tag->loaded()) {\n $ids[] = $tag->id;\n }...
[ "0.67871934", "0.6762219", "0.6688502", "0.6657141", "0.66525394", "0.63873804", "0.63694555", "0.6306646", "0.62731993", "0.62143975", "0.6075703", "0.60278416", "0.6018238", "0.6002142", "0.5958248", "0.5946304", "0.5917022", "0.5915156", "0.5885566", "0.5851368", "0.583331...
0.70384735
0
Get blog tags from database by names.
private function getTagsFromDbByName($tags, TagRepository $tagRepo) { $dbTags = $tagRepo->whereNamesInArrayPluckedByNameAndId($tags); return $this->arrayChangeKeyCaseUnicode($dbTags); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function tags($name){\n\n\n\t $postsWithTag= WinkTag::with('posts')\n\t\t\t\t\t\t->where('name',$name)\n\t\t\t\t\t\t->orderBy('created_at', 'DESC')\n\t\t\t\t\t\t->simplePaginate(10);\n\n\t $posts =[];\n\n\t foreach ( $postsWithTag as $post ) {\n\n\t $posts = $post->...
[ "0.7030865", "0.6910597", "0.68789256", "0.6794928", "0.6772174", "0.6723662", "0.6579492", "0.6535305", "0.6508257", "0.6470555", "0.6397102", "0.6397102", "0.6397102", "0.6397102", "0.6397102", "0.63221556", "0.631164", "0.6300045", "0.6297315", "0.6275284", "0.6265484", ...
0.69545245
1
Get unique tag names in lower case.
private function getUniqueTags($tags) { $tags = array_unique(array_map(function($value) { return mb_strtolower($value, 'UTF-8'); }, $tags)); return $tags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getTagNames() {\n\t\tif (isset($this->tag_names)) {\n\t\t\treturn $this->tag_names;\n\t\t}\n\t\t\n\t\t$this->tag_names = tag_tools_rules_get_tag_names();\n\t\treturn $this->tag_names;\n\t}", "public function getNameTags() \n { \n $allTags = []; \n foreach($this->tags as $tag...
[ "0.6823132", "0.6629779", "0.6608012", "0.6542607", "0.648649", "0.6417229", "0.62563574", "0.62129396", "0.6072404", "0.606155", "0.6042667", "0.6026047", "0.5939413", "0.5913699", "0.5911372", "0.59107596", "0.58727634", "0.5865646", "0.5858633", "0.58375734", "0.5785564", ...
0.71891963
0
Change array keys to lower case.
private function arrayChangeKeyCaseUnicode($arr, $c = CASE_LOWER) { $c = ($c == CASE_LOWER) ? MB_CASE_LOWER : MB_CASE_UPPER; $ret = []; foreach ($arr as $k => $v) { $ret[mb_convert_case($k, $c, "UTF-8")] = $v; } return $ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function arrayKeysToLowercase($array)\n {\n return array_change_key_case($array, \\CASE_LOWER);\n }", "function array_keys_to_lower($array) {\n $rr = [];\n foreach ($array as $k => $v) {\n $rr[strtolower($k)] = $v;\n }\n return $rr;\n}", "protected function normalizeKeys(array $arr)\...
[ "0.8308202", "0.824607", "0.8061835", "0.7582825", "0.73542583", "0.7250216", "0.7113666", "0.69114256", "0.67804134", "0.6740351", "0.67314106", "0.668597", "0.6630975", "0.6484052", "0.64739436", "0.64334387", "0.6416332", "0.6379095", "0.62393445", "0.6235923", "0.62154317...
0.6743913
9
Get tag store data by tag name.
private function getTagDataForNewTagByTagName($name) { return [ 'name' => $name, 'meta_title' => $name, 'active' => 1, 'slug' => md5(time()), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get($name) {\n if ($this->exists($name)) {\n return $this->store[$name];\n }\n\n return null;\n }", "protected function get($name)\n\t{\n\t\treturn $this->stores[ $name ] ?? $this->resolve($name);\n\t}", "protected function get($name)\n {\n return $this->st...
[ "0.6425764", "0.63254315", "0.62286365", "0.62286365", "0.6127437", "0.6061778", "0.6000079", "0.5983054", "0.5944644", "0.59116215", "0.59059715", "0.58663756", "0.5851332", "0.580065", "0.5771201", "0.5729618", "0.5697242", "0.5695704", "0.56644154", "0.56638235", "0.561461...
0.5493099
25
Delete post image dir.
public function deleteImageDir($postId) { Storage::deleteDirectory('public/' . Post::getFilePath($postId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleting(Post $post)\n {\n if ($post->image) {\n Storage::delete([$post->image->url]);\n }\n }", "public function delete()\n {\n $post_id = $this->uri->rsegment('3');\n $this->_del($post_id);\n $image = $this->input->get('image');\n unlink(\"upload/post\".$image);\n /...
[ "0.7184746", "0.71389914", "0.70402676", "0.698791", "0.69734347", "0.6966473", "0.68978524", "0.6895776", "0.6871979", "0.6847922", "0.6832268", "0.6820418", "0.669043", "0.66575927", "0.6638194", "0.6626801", "0.66223365", "0.6608945", "0.6603633", "0.6598827", "0.65981334"...
0.78136164
0
Display a listing of the resource.
public function index(Request $request) { // if ($request->filled('all')) { $budgets = \App\Budget::with(['workflow', 'department', 'action'])->orderBy('id', 'desc')->get(); return ['data'=>$budgets]; } else { $budgets = \App\Budget::with(['workflow', 'department', 'action'])->orderBy('id', 'desc')->paginate(15); // $imprest[] = 0; // foreach($budgets as $budget) // { // $imprest[] = \App\Imprest::where('budget_id', $budget->id)->first(); // } // // $imprest; // return ['data'=>$budgets, 'imprest'=>$imprest]; return BudgetResource::collection($budgets); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.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(Request $request) { // return $request->all(); $budget = $request->isMethod('put') ? \App\Budget::findOrFail($request->budget_id) : new \App\Budget; if($request->isMethod('put') == true) { if($request->actions == '') { $budget->id = $request->budget_id; $budget->name = $request->name; $budget->description = $request->description; $budget->type_id = $request->type_id; $budget->department_id = $request->department_id; $budget->amount = $request->amount; $budget->year = $request->year; $budget->end_date = $request->end_date; $budget->balance = $request->balance; $budget->workflow_id = $request->workflow_id; } else { $budget->id = $request->budget_id; $budget->name = $request->name; $budget->description = $request->description; $budget->type_id = $request->type_id; $budget->department_id = $request->department_id; $budget->amount = $request->amount; $budget->year = $request->year; $budget->end_date = $request->end_date; $budget->balance = $request->balance; $budget->workflow_id = $request->workflow_id; $budget->flow_stage_id = $request->actions + 1; $budget->actions = $request->actions; } if($budget->save()) { //track history if($request->actions == ''){ $Action = 'Update'; } elseif($request->actions == 2) { $Action = 'Review'; } elseif($request->actions == 3) { $Action = 'Approve'; } $history = new \App\TrackHistory; $history->history_name = 'Budget'; $history->action_name_id = $budget->id; $history->action = $Action; $history->created_by = 2; if($history->save()) { //UPDATE NO OF FLOWS return new BudgetResource($budget); } } } else { $budget->name = $request->name; $budget->description = $request->description; $budget->type_id = $request->type_id; $budget->department_id = $request->department_id; $budget->amount = $request->amount; $budget->balance = $request->amount; $budget->year = $request->year; $budget->end_date = date('Y-m-d', strtotime($request->end_date)); $budget->workflow_id = $request->workflow_id; if($budget->save()) { //track history $history = new \App\TrackHistory; $history->history_name = 'Budget'; $history->action_name_id = $budget->id; $history->action = 'Create'; $history->created_by = 2; if($history->save()) { //UPDATE NO OF FLOWS $workflow_count = \App\Flow::where('workflow_id', $request->workflow_id)->count(); $no_of_flows = $workflow_count; $data = array ( 'no_of_flows' => $workflow_count, 'updated_at' => date('Y-m-d h:i:s') ); \App\Workflow::where('id', $request->workflow_id)->update($data); //update position $position = \App\Flow::where('workflow_id', $request->workflow_id)->where('position', 2)->first(); $data = array ( 'flow_stage_id' => $position->position, 'updated_at' => date('Y-m-d h:i:s') ); \App\Budget::where('id', $budget->id)->update($data); return new BudgetResource($budget); } } } }
{ "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) { // $budget = \App\Budget::findOrFail($id); return new BudgetResource($budget); }
{ "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) { // }
{ "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) { // $budget = \App\Budget::findOrFail($id); if($budget->delete()) { return new BudgetResource($budget); } }
{ "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
verify that all questions were answered
public function execute(&$structureManager, &$controller, &$structureElement) { $questions = $structureElement->getQuestionsList(); $idIndex = []; foreach ($questions as &$question) { $bQuestionsAnswered = false; foreach ($structureElement->answers as $questionId => $answersList) { if ($questionId == $question->id) { $bQuestionsAnswered = true; break; } } if (!$bQuestionsAnswered) { $idIndex[$questionId] = true; } } if (count($idIndex)) { $structureElement->setFormError("answers", $idIndex); } // send results to DB, redirect the user if ($this->validated) { $collection = persistableCollection::getInstance("polls_votes"); $IP = $this->getService('user')->IP; foreach ($structureElement->answers as $questionId => $answersList) { foreach ($answersList as &$answerId) { $row = $collection->getEmptyObject(); $row->pollId = $structureElement->id; $row->questionId = $questionId; $row->answerId = $answerId; $row->IP = $IP; $row->timestamp = time(); $row->persist(); } } $currentElement = $structureManager->getCurrentElement(); $controller->redirect($currentElement->URL); } $structureElement->executeAction("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasAnswers();", "public static function check_question(array $question);", "public function answerCheck()\n {\n $first_number = $this->post_data['firstNumber']; \n // Assign the second number in the question to $second_number in the class method.\n $second_number = $thi...
[ "0.7244656", "0.6714781", "0.6645392", "0.65199095", "0.6352035", "0.6345784", "0.6319965", "0.6308032", "0.61963797", "0.6164262", "0.61537564", "0.6046836", "0.6033271", "0.6027505", "0.5995204", "0.59922487", "0.59846294", "0.59739506", "0.5962496", "0.5932368", "0.5915357...
0.0
-1
endregion Private properties UserName constructor.
private function __construct(string $firstName, string $lastName) { $this->firstName = $firstName; $this->lastName = $lastName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($user_name)\n {\n $this->user_name = $user_name;\n }", "public function __construct(User $user)\n {\n $this->name = $user->name;\n }", "public function __construct()\n {\n //\n //$this->name = $user->name;\n }", "public function __cons...
[ "0.73432165", "0.70330113", "0.69057935", "0.6837568", "0.67403924", "0.67403924", "0.66883856", "0.66586685", "0.6645809", "0.66410995", "0.6545454", "0.653774", "0.6533125", "0.6510123", "0.6488426", "0.6488426", "0.64812094", "0.647256", "0.6457825", "0.64555067", "0.64519...
0.0
-1
endregion Factory methods region Public API
public function getFirstName(): string { return $this->firstName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function create ();", "abstract function create();", "static function create(): self;", "protected static function newFactory()\n {\n //\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "abstract fu...
[ "0.81929636", "0.7951868", "0.7872709", "0.77761966", "0.7769827", "0.7769827", "0.7769827", "0.7727936", "0.7458048", "0.740738", "0.7305781", "0.726283", "0.71948564", "0.71787304", "0.71787304", "0.7167562", "0.7167562", "0.7167562", "0.7167562", "0.7167562", "0.7167562", ...
0.0
-1
Run the database seeds.
public function run() { Estados::create([ 'est_nome' => 'Rascunho', 'est_descricao' => 'Rascunho de um Ticket' ]); Estados::create([ 'est_nome' => 'Enviado', 'est_descricao' => 'Ticket enviado, esperando um avaliador receber a solicidação' ]); Estados::create([ 'est_nome' => 'Em análise', 'est_descricao' => 'Ticket em análise, sua solicidação está sendo analisada por um avaliador' ]); Estados::create([ 'est_nome' => 'Aprovado', 'est_descricao' => 'Ticket aprovado, sua solicidação foi aprovada' ]); Estados::create([ 'est_nome' => 'Não aprovado', 'est_descricao' => 'Ticket não aprovado, sua solicidação não foi aprovada' ]); Estados::create([ 'est_nome' => 'Cancelado', 'est_descricao' => 'Ticket cancelado, este ticket foi cancelado' ]); Estados::create([ 'est_nome' => 'Análise em atraso', 'est_descricao' => 'Ticket em atraso, este ticket está em atraso para sua avaliação' ]); }
{ "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
ver na base de dados se Username existe
function addUser($nome, $morada, $email, $telefone, $username, $password){ $result = checkUsername($username); if(count($result) < 2){ //Não existe ninguém com este username global $conn; $stmt = $conn->prepare("INSERT INTO utilizador VALUES (DEFAULT, ? , ? , ? , ? , ? , ? ,false);"); if (!$stmt->execute(array($nome, $morada, $telefone, $username, $password, $email))) { return 1; // Erro a executar a query exit; } return 0; //Correu tudo bem return $query; } else return 2; //Username já utilizado*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkUsernameExist(){\n $base = new ConnexionDb();\n\n $req = $base->query(\n \"SELECT u.username FROM user as u WHERE u.username = :username\",\n array(\n array('username',$_POST['username'],\\PDO::PARAM_STR)\n ...
[ "0.80721146", "0.77715987", "0.76887244", "0.76329285", "0.74370706", "0.74314666", "0.7410899", "0.7397808", "0.73844033", "0.73830754", "0.7336675", "0.7327393", "0.732256", "0.7302741", "0.730223", "0.72769254", "0.7253596", "0.72253066", "0.7224483", "0.719405", "0.719143...
0.0
-1
Run the database seeds.
public function run() { $products = array('Nike','New Balance','Converse','Puma','Sparx','Reebok','Adidas','Jordan','Woodland','Timberland'); for ($i = 0; $i < 10; $i++) { DB::table('products')->insert([ 'name' => $products[$i], 'image' => '/images/'.$i.'.jpg', 'price' => $i+100, ]); } }
{ "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
Getters and setters Set map.
public function setMap($list, $defval = null, $var = null, $ord_num = 0) { $this->chkData(array('list' => $list)); switch ($this->type) { // Report folder case 'rfolder': $this->maps['rfolder'] = array('defval' => $defval, 'list' => $list); break; // Template case 'template': if (!isset($var) || strlen($var) == 0) throw new WSS_Exception('W3S_NodeData-no_tpl_var', array(), 'Tamplate variable is not set.'); $this->maps[$var] = array('defval' => $defval, 'list' => $list, 'ordnum' => $ord_num); break; default: throw new WSS_Exception('W3S_NodeData-err_addmap', array(), 'Unable to add map to this node type.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function setters();", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::setters() + self::$setters;\n }", "public static function setters()\n {\n return parent::sett...
[ "0.7340038", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.67105263", "0.66750985", "0.64445543", "0.64445543", "0.64445543", "0.64445543", "0.64445543",...
0.0
-1
Delete all maps or only one named in argument.
public function deleteMap($var = null) { switch ($this->type) { // Report folder case 'rfolder': $this->maps = array(); break; // Template case 'template': if (!isset($var) || strlen($var) == 0) $this->maps = array(); else unset($this->maps[$var]); break; default: throw new WSS_Exception('W3S_NodeData-err_del_map', array(), 'Unable to delete map from this node type.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteTagMaps()\n {\n foreach ($this->tags as $tag) {\n $tag->tagObjectMap->delete();\n }\n }", "function delete_map ($data) {\r\n\t\t$id = (int)$data['id'];\r\n\t\t$table = $this->get_table_name();\r\n\r\n\t\t$result = $this->wpdb->query(\"DELETE FROM {$table} WHERE id={$id}\");\r\n...
[ "0.6129634", "0.6125516", "0.58507687", "0.58299667", "0.5805846", "0.5798076", "0.5781145", "0.5732298", "0.56992173", "0.5587084", "0.55723315", "0.5536331", "0.5503559", "0.548957", "0.548957", "0.5454936", "0.54480237", "0.5442309", "0.5416353", "0.5413486", "0.5411453", ...
0.60618204
2
Get map data. Report folder returns only a list object. Template returns whole map or the list object if variable name is specified in argument.
public function getMap($var = null) { switch ($this->type) { // Report folder case 'rfolder': return $this->maps['rfolder']; break; // Template case 'template': if (!isset($var) || strlen($var) == 0) return $this->maps; else return $this->maps[$var]; break; default: throw new WSS_Exception('W3S_NodeData-err_get_map', array(), 'Unable to get map from this node type.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function renderMapGetTemplateOxMap( $template )\n {\n $arr_return = array();\n $arr_return[ 'error' ] = false;\n\n // map hash key\n $mapHashKey = '###MAP###';\n\n // Get the template\n $mapTemplate = $this->pObj->cObj->fileResource( $this->confMap[ 'template.' ][ 'file' ] );\n\n // R...
[ "0.66684216", "0.6188578", "0.6017391", "0.5933799", "0.5778548", "0.56561357", "0.5571654", "0.5537836", "0.55373263", "0.55251", "0.5468929", "0.5455433", "0.54431546", "0.5414471", "0.5348369", "0.53354126", "0.53255737", "0.5294381", "0.5287362", "0.52565086", "0.5252688"...
0.6365316
1
Alias to getReference function.
public function getWorkbook() { return $this->getReference(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReferenceTo() {}", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getReference()\n {\n return $this->reference;\n }", "public function getRef...
[ "0.8143128", "0.78472894", "0.78472894", "0.78472894", "0.78472894", "0.7841476", "0.782491", "0.7801794", "0.7798668", "0.7789841", "0.76667535", "0.76305264", "0.76245034", "0.749741", "0.74673957", "0.7449435", "0.7442647", "0.7400477", "0.73462266", "0.73312765", "0.71393...
0.0
-1
Get Group, Hierarchy & Node of reference joined in report hierarchy.
public function getReference() { return $this->ref; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRefgroup()\n {\n return $this->refgroup;\n }", "public function getGroup();", "public function getGroup();", "public function getGroup();", "public function getRel(): string;", "public function getGroupInherits() {\n\t\t$groupParent = $this->group->getParentNode();\n\t\tre...
[ "0.5938859", "0.5417768", "0.5417768", "0.5417768", "0.53716755", "0.5340417", "0.5324379", "0.5306751", "0.51780593", "0.5165977", "0.5160985", "0.51516926", "0.5117085", "0.50925875", "0.5078081", "0.50684434", "0.50591135", "0.50591135", "0.50591135", "0.50591135", "0.5052...
0.47417396
51
Get array with all variables used in workbook.
public function getVars() { return $this->vars; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function variables(): array;", "public function variables(): array;", "public function getVars() {\n return array();\n }", "public function getAvailableVariables() :array\n {\n return [];\n }", "public function getVariables()\n {\n \treturn isset($this->all['variables'])...
[ "0.7246037", "0.7246037", "0.71143174", "0.7072907", "0.6991727", "0.6833056", "0.66221863", "0.6597415", "0.65754825", "0.65215", "0.65215", "0.6517814", "0.6509209", "0.6499425", "0.64980733", "0.64699125", "0.6444797", "0.6420494", "0.6390695", "0.63741666", "0.63631696", ...
0.63452446
23
/ Delete all resources.
public function deleteAllResources() { $this->resources = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAll(): void\n {\n $this->client->delete($this->baseUri);\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public function deleteAll(): void;", "public final function destroy_all()\n {\n }", "abstract ...
[ "0.77336645", "0.7723481", "0.7723481", "0.7723481", "0.76765454", "0.7570651", "0.7441812", "0.7400447", "0.7355423", "0.7308607", "0.7307646", "0.6999794", "0.69665504", "0.694", "0.6894418", "0.67790323", "0.67747205", "0.6694325", "0.6681674", "0.66804236", "0.66403764", ...
0.87818134
0
/ Delete all dependents.
public function deleteAllDependents() { $this->dependents = array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteAll(): void;", "public function deleteAll()\n {\n $this->ensureModels();\n foreach ($this->_models as $model) {\n $model->delete();\n }\n }", "public function deleteAll();", "public function deleteAll();", "public function deleteAll();", "public...
[ "0.6793108", "0.6562115", "0.6507074", "0.6507074", "0.6507074", "0.6435713", "0.6397847", "0.63043207", "0.6302768", "0.62322485", "0.6184805", "0.6174771", "0.6163906", "0.6125516", "0.6086713", "0.60380095", "0.5939262", "0.58965313", "0.58471376", "0.58071613", "0.5786902...
0.8678872
0
Delete parameters named in array.
public function deleteParams(array $params) { $this->chkParams(); foreach ($params as $key) unset($this->params[$key]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function purge($params = array())\n\t{\n\t\t$sql = 'DELETE FROM '.$this->paramsTableName;\n\t\tif (sizeof($params) > 0)\n\t\t{\n\t\t\t$params = $this->preprocessParams($params);\n\t\t\t$sql .= ' WHERE option_name IN (\\''.implode('\\',\\'', $params).'\\')';\n\t\t}\n\t\t$db = $this->getDbConnection();\n\t\t$...
[ "0.68664366", "0.6493911", "0.6442798", "0.6417786", "0.63110995", "0.6262988", "0.6180346", "0.61637026", "0.61636525", "0.6137342", "0.610598", "0.6073579", "0.6053164", "0.60285723", "0.6027156", "0.60155505", "0.6005731", "0.60013664", "0.59870344", "0.5984834", "0.597092...
0.77794266
0
Get the context array for logs.
protected function getContext(Exception $exception = null) { // TODO:Add org name. $user = auth()->user(); $baseContext = [ 'user' => $user->id, 'userName' => $user->getNameAttribute(), 'organization_id' => $this->getOrganizationId($user), 'organization' => $this->getOrganizationName($user) ]; if (!$exception) { return $baseContext; } return array_merge($baseContext, ['trace' => $exception->getTraceAsString()]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function context() {\n return ArrayHelper::filter($GLOBALS, $this->logVars);\n }", "public function getContext(): array\n {\n $context = [];\n\n if ($this->category !== null) {\n $context['category'] = $this->category;\n }\n\n if ($this->trace !== nul...
[ "0.7274187", "0.707339", "0.7022211", "0.6764433", "0.67090416", "0.66890687", "0.66890687", "0.6654729", "0.65982133", "0.65869397", "0.6560941", "0.6555299", "0.6555257", "0.64994276", "0.6475271", "0.6457639", "0.6358158", "0.62970465", "0.6287558", "0.6272084", "0.6268155...
0.52180505
89
Get the Organization name of the current User's Organization.
protected function getOrganizationName(User $user) { return $user->organization ? $user->organization->name : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrganizationName(): string {\n\t\treturn ($this->organizationName);\n\t}", "public function getOrgName()\n {\n return $this->orgName;\n }", "public function getOrganizationUser()\n {\n return $this->organizationUser;\n }", "public function getCurrentOrganization()...
[ "0.8020499", "0.7703937", "0.7653495", "0.7288905", "0.7252708", "0.7252708", "0.7252708", "0.7163634", "0.7073842", "0.70602465", "0.6960716", "0.6921465", "0.6845175", "0.67599314", "0.6675268", "0.66670716", "0.66561157", "0.6638369", "0.6606092", "0.6576483", "0.65129846"...
0.7920484
1
Get the Organization id of the current User's Organization.
protected function getOrganizationId(User $user) { return $user->organization ? $user->organization->id : ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOrganizationId()\n {\n return $this->organization_id;\n }", "public function getOrganizationId()\n {\n return $this->organizationId;\n }", "public function getCurrentOrganizationId()\n {\n $orgId = $this->_getVar('user_organization_id');\n\n //If no...
[ "0.81918854", "0.81755483", "0.8080694", "0.79224217", "0.7543634", "0.75284135", "0.7434382", "0.7410546", "0.735388", "0.72922283", "0.71612304", "0.7037692", "0.7015493", "0.7015493", "0.7015493", "0.6960828", "0.68216383", "0.68005264", "0.6774059", "0.66087705", "0.65160...
0.797914
3
Set up the dataTable definition for this controller.
public function setup_table($table) { $table->add_column('title', array('head' => 'Title', 'class' => 'col-lg-4')); $table->add_column('stock_type', array('head' => 'Stock', 'class' => 'col-lg-2')); $table->add_column('stock_cap', array('head' => 'Stock cap', 'class' => 'col-lg-2')); $table->add_column('status', array('head' => 'Status', 'class' => 'col-lg-2'), true, false); $table->add_button('stock-item', 'fa fa-lemon-o', 'primary', 'after', 'edit'); return $table; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function tableDataTable()\r\n\t{\r\n\t\t$source = $this->getSource();\r\n\r\n\t\t//$table = new TableExample\\DataTable();\r\n\t\t$table = new Model\\DataInsTable();\r\n\t\t$table->setAdapter($this->getDbAdapter())\r\n\t\t->setSource($source)\r\n\t\t->setParamAdapter(new AdapterDataTables($this->getRequest...
[ "0.64392626", "0.6424642", "0.64154977", "0.6406543", "0.6384608", "0.63421845", "0.6289109", "0.6235449", "0.6195749", "0.6127254", "0.612542", "0.61021614", "0.60892767", "0.605739", "0.6014683", "0.59969854", "0.5994309", "0.59792686", "0.59623", "0.59596986", "0.593669", ...
0.0
-1
Add restocks when the modal requests a record.
public function load(ORM $record) { $restocks = []; $records = $record->restocks->find_all(); foreach($records as $r) { $restocks[] = array_merge($r->as_array(), ['item_name' => $r->item->name]); } return array('restocks' => $restocks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function preRetrieve();", "function __editUserModal()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //template file\n $this->data['template_file'] = PATHS_COMMON_THEME . 'users.modal.html';\n\n //get client id\n $user_id = $thi...
[ "0.5671948", "0.5304025", "0.5132934", "0.5130173", "0.51179886", "0.5029773", "0.5007176", "0.50058556", "0.494534", "0.49146783", "0.48466593", "0.48311657", "0.4816197", "0.48115146", "0.4801566", "0.4785484", "0.47829124", "0.4774283", "0.4770719", "0.47503093", "0.474710...
0.0
-1
Add an item to a store's stock.
public function action_item_save(Request $request, Response $response) { $values = $request->post(); if(isset($values['store_id'])) { $store = ORM::factory('Store', $values['store_id']); } else if(isset($values['store_name'])) { $store = ORM::factory('Store') ->where('title', '=', $values['store_name']) ->find(); } if(!$store->loaded()) { RD::set(RD::ERROR, 'No store found to add this item to.'); } else { $item = ORM::factory('Item') ->where('item.name', '=', $values['item_name']) ->find(); if(!$item->loaded()) { RD::set(RD::ERROR, 'No item found by the name of "'.$values['item_name'].'".'); } else { try { $values['store_id'] = $store->id; $values['item_id'] = $item->id; if($values['id'] == '') { $restock = ORM::factory('Store_Restock') ->values($values, ['item_id', 'store_id', 'min_price', 'max_price', 'min_amount', 'max_amount', 'cap_amount', 'frequency']) ->save(); RD::set(RD::SUCCESS, $item->name.' has been added to the "'.$store->title.'" store\'s stock.', null, array_merge($restock->as_array(), ['item_name' => $item->name])); } else { $restock = ORM::factory('Store_Restock', $values['id']) ->values($values, ['item_id', 'store_id', 'min_price', 'max_price', 'min_amount', 'max_amount', 'cap_amount', 'frequency']) ->save(); RD::set(RD::SUCCESS, $item->name.' has been added updated.', null, array_merge($restock->as_array(), ['item_name' => $item->name])); } } catch(ORM_Validation_Exception $e) { RD::set(RD::ERROR, 'Problem validating form', null, array('errors' => $e->errors('orm'), 'submit_data' => $values)); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addItemStock()\n {\n $this->validate($this->request, [\n 'itemCondition' => 'required|string',\n 'itemStateId' => 'required|integer|min:1',\n ]);\n $items = array(\n 'itemStateId' => $this->request->input('itemStateId'),\n 'itemCondition' => $this->request->input( 'ite...
[ "0.68307114", "0.6655609", "0.66431475", "0.65949553", "0.65949553", "0.645527", "0.6437321", "0.6395302", "0.6387144", "0.6379288", "0.63731873", "0.6363635", "0.63611174", "0.63584715", "0.63584715", "0.6323855", "0.6293404", "0.62856406", "0.62837493", "0.6282588", "0.6272...
0.55512583
98
Load an item from a store's stock.
public function action_item_load(Request $request, Response $response) { $values = $request->query(); $restock = ORM::factory('Store_Restock', $values['restock_id']); if(!$restock->loaded()) { RD::set(RD::ERROR, 'No restock record found.'); } else { RD::set(RD::SUCCESS, 'Item loaded', null, array_merge($restock->as_array(), ['item_name' => $restock->item->name])); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _loadStockItemById($id)\n {\n \n /* @var $stockItem Mage_CatalogInventory_Model_Stock_Item */\n $stockItem = Mage::getModel('bubble_stockmovements/stock_movement')->load($id); \n if (!$stockItem->getId()) {\n $this->_critical(self::RESOURCE_NOT_FO...
[ "0.6954618", "0.63090044", "0.6293195", "0.6076944", "0.6035917", "0.60084087", "0.576069", "0.57567424", "0.570954", "0.5654217", "0.5652575", "0.56045085", "0.5542765", "0.5527132", "0.5517064", "0.5516764", "0.5514552", "0.5510684", "0.54526937", "0.5409248", "0.53933376",...
0.5895508
6