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
Display a listing of the resource.
public function index() { $items = User::all(); return response()->json([ 'data' => $items ], 200); }
{ "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) { $item = User::create($request->all()); return response()->json([ 'data' => $item ], 201); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72857565", "0.714571", "0.71328056", "0.66390204", "0.6620437", "0.6567189", "0.6526738", "0.65074694", "0.64491314", "0.63734114", "0.6370837", "0.63628685", "0.63628685", "0.63628685", "0.6342026", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0.63394964", "0....
0.0
-1
Display the specified resource.
public function show(Request $request, User $user) { $email = $request->email; $user = User::find($email); $item = User::find($user); if($item) { return response()->json([ 'data' => $item ], 200); } else { return response()->json([ 'message' => 'Not found', ], 404); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, User $user) { $update = [ 'name' => $request->name, 'email' => $request->email, 'password' => $request->password, ]; $item = User::where('id', $user->id)->update($update); if($item) { return response()->json([ 'message' => 'Updated successfully', ], 200); } else { return response()->json([ 'message' => 'Not found', ], 404); } }
{ "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(User $user) { $item = User::where('id', $user->id)->delete(); if($item) { return response()->json([ 'message' => 'Deleted successfully', ], 200); } else { return response()->json([ 'message' => 'Not found', ], 404); } }
{ "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
Handle an incoming request. This middleware checks whether loggedin user is related with any account and: 1) has "write" permissions within this account 2) this account has kids to quote
public function handle(Request $request, Closure $next) { $permissions = AccountUserPermission::whereHas('permission', function(Builder $query){ $query->where('allow_write','=','1'); })->has('account.kids') ->where('user_id','=',Auth::id())->count(); if($permissions>0) { return $next($request); } return redirect(route('welcome')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle( $request, Closure $next, ...$guards )\n {\n if( auth()->user()->isAdmin() ) {\n return $next($request);\n } else {\n abort(403);\n }\n }", "public static function handleRequest()\n {\n if(isset($_SESSION['user']) && $_SESSION['use...
[ "0.59198695", "0.58551884", "0.5820321", "0.5749536", "0.57371", "0.5719621", "0.57120746", "0.56859833", "0.56594825", "0.5657772", "0.5640749", "0.56337804", "0.5631338", "0.56286514", "0.56004035", "0.5599671", "0.55985546", "0.55821586", "0.55723053", "0.5567394", "0.5566...
0.641371
0
Return true if it's a normal move.
public function isNormal();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n ...
[ "0.73498464", "0.7245079", "0.6420864", "0.6253832", "0.6139606", "0.6091213", "0.60480785", "0.6007321", "0.5970578", "0.5961628", "0.5919585", "0.5915018", "0.5771028", "0.56230366", "0.5593105", "0.5588063", "0.55361557", "0.5521612", "0.5503647", "0.55028903", "0.5470142"...
0.53612494
24
Return true if it's a special move.
public function isSpecial();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n ...
[ "0.73054177", "0.68649215", "0.67157906", "0.6661825", "0.6585481", "0.6514646", "0.65125597", "0.6414061", "0.6243739", "0.61357415", "0.61193675", "0.6025962", "0.5985392", "0.59344375", "0.5776747", "0.57428735", "0.5714055", "0.570844", "0.5604848", "0.5599082", "0.551890...
0.54220587
26
Return true if it's a super move.
public function isSuper();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isSuper(): bool\n {\n return $this->hasRole('super');\n }", "public function isSuper() {\n\t\treturn ($this->isAdmin() || $this->Session->read('Acl.isSuper'));\n\t}", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_...
[ "0.6505717", "0.6404016", "0.63249946", "0.6279315", "0.6269793", "0.6145727", "0.6029503", "0.58672625", "0.5802306", "0.57306886", "0.57066023", "0.5700708", "0.56229925", "0.5618475", "0.55848074", "0.5540841", "0.5534597", "0.55284506", "0.5527662", "0.55159444", "0.55109...
0.6597946
0
Return the type of the move.
public function getType();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMove()\n {\n if (array_key_exists(\"move\", $this->_propDict)) {\n return $this->_propDict[\"move\"];\n } else {\n return null;\n }\n }", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) retur...
[ "0.6646843", "0.5818897", "0.5778825", "0.5775583", "0.57714504", "0.576759", "0.5518396", "0.5512248", "0.55006105", "0.5498009", "0.5436956", "0.54041797", "0.53889924", "0.53629047", "0.53382635", "0.5328027", "0.5327686", "0.5321066", "0.5318682", "0.5314865", "0.5314283"...
0.0
-1
Return the common name.
public function getName();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_name() {\n\t\treturn 'common';\n\t}", "private function commonNames()\n {\n return [\n\n 'Aphids',\n\n 'Armyworms',\n\n 'Asparagus Beetle',\n\n 'Cabbage Looper',\n\n 'Grasshopper',\n\n 'Psyllid',\n\n 'Slug ...
[ "0.88629067", "0.729078", "0.7201265", "0.697414", "0.6943736", "0.68064225", "0.67835194", "0.67835194", "0.6780109", "0.6769386", "0.67483836", "0.674683", "0.669805", "0.669805", "0.669805", "0.66906565", "0.66906565", "0.66906565", "0.66632766", "0.6621132", "0.66174316",...
0.0
-1
Return the initial position of the character.
public function getInitialPosition();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCharStart();", "public function getFirstCharIndex() {}", "public function findFirstPosition()\n {\n $string = readline(\"Please enter a string to find the first position of character 'a' (ex: mystringwitha) : \");\n $str = \"\\n\\n Input String: \" . $string;\n \n ...
[ "0.7260019", "0.7257306", "0.6666091", "0.6189447", "0.6160194", "0.6145134", "0.59980524", "0.5969157", "0.5936159", "0.5924991", "0.5921556", "0.58812565", "0.5874424", "0.5832538", "0.5817409", "0.5793523", "0.5785584", "0.5772775", "0.571568", "0.5712163", "0.5622826", ...
0.68704224
2
Return a collection of inputs required to accomplish the move.
public function getInputs($asString = false);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function inputs()\n {\n return [];\n }", "public function getInputs()\n {\n return $this->inputs;\n }", "public function inputs()\n {\n return $this->inputs;\n }", "public function getInputs()\n {\n return array();\n }", "public function inputs(...
[ "0.6605077", "0.653998", "0.65192395", "0.6468249", "0.62849355", "0.62433934", "0.6223721", "0.61885995", "0.5697644", "0.56367093", "0.55909437", "0.5577046", "0.5556838", "0.55526006", "0.55460435", "0.5511374", "0.5500526", "0.5499236", "0.5499236", "0.54801285", "0.54664...
0.5222452
34
Return the damage value dealt to the target.
public function getDamage();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function damage() {\r\n\t\tif ($this->isWeapon()) {\r\n\t\t\treturn $this->techData['damage'];\r\n\t\t}\r\n\r\n\t\treturn 0;\r\n\t}", "public function damage() {\n return $this->damageMultiplier * $this->weapon->damage();\n }", "public function getDamage()\n {\n return $this->get(self::_DA...
[ "0.7764828", "0.775929", "0.7616235", "0.7616235", "0.7542312", "0.7431034", "0.73036134", "0.71504366", "0.70668304", "0.6966652", "0.66361195", "0.6603825", "0.6550421", "0.63395", "0.62346226", "0.6167983", "0.61129886", "0.6105344", "0.604269", "0.6008831", "0.5981238", ...
0.73793036
6
Return the meter gain value earned by the dealer.
public function getMeterGain();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_deliveredEnergyMeter(): float\n {\n // $res is a double;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::DELIVEREDENERGYMETER_INVA...
[ "0.6608715", "0.63203067", "0.62981546", "0.62909436", "0.6197732", "0.61832464", "0.6118515", "0.6077072", "0.60670114", "0.60651124", "0.606058", "0.60189724", "0.59712094", "0.5930064", "0.59287155", "0.5925734", "0.59255564", "0.5923893", "0.5911628", "0.5908714", "0.5900...
0.8184569
0
Return the hit level on the target.
public function getHitLevel();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getLevel() {}", "public function getLevel();", "public function getLevel();", "public function GetLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level;\n }", "public function getLevel()\n {\n return $this->level...
[ "0.68071246", "0.6727809", "0.6727809", "0.6630325", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.66138345", "0.6604302", "0.65856564", "0.65856564", "0.65646714", "0.6550286", "0.65243006", "0.65175945", "0.6508514", "0.64722013", "0...
0.8134625
0
Return the move able to cancel the active and recovery frames.
public function getCancelAbilities();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dockCancel(){\n\t\treturn $this->_sendPacketToController(self::DOCK_CANCEL);\n\t}", "private function get_next_move() {\n\t\t$move = $this->can_put_a_card_up();\n\t\tif($move !== false) return $move;\n\t\t\n\t\t// Test si une carte peut être déplacée\n\t\t$move = $this->can_move_cards();\n\t\t//i...
[ "0.58322465", "0.5823302", "0.5767278", "0.53100234", "0.52965194", "0.52627516", "0.5233544", "0.51913166", "0.5189763", "0.5069623", "0.50340456", "0.5015053", "0.4858796", "0.4858796", "0.48449868", "0.48411712", "0.48077136", "0.47916982", "0.47732615", "0.4769645", "0.47...
0.44221786
73
Return the breakdown of frames.
public function getFrameData();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFrames()\n {\n return $this->frames;\n }", "public function getFrame(): string;", "public function getFrame() {}", "public function getSourceFrames() {\n return $this->sourceFrames;\n }", "private function readFrames() {\n\t\twhile (($type = $this->buffer->getByte()) !==...
[ "0.6677494", "0.65331894", "0.64417964", "0.6130419", "0.6076972", "0.5945863", "0.5876855", "0.5849335", "0.581683", "0.5680984", "0.55814785", "0.5524665", "0.53319097", "0.53252286", "0.5307469", "0.5294087", "0.52919793", "0.5284259", "0.5274163", "0.5274163", "0.52738845...
0.59658194
5
Compares move by inputs.
public function equals(MoveInterface $otherMove);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testComplexMove(){\n $gm = new GamesManager();\n\n $game = $this->generateGameObjectWithTwoPlayers();\n\n\n $game->gameState->currentPlayer = 0;\n $game->gameState->isGameGoing = true;\n $game->gameState->selectChecker = false;\n $game->gameState->pickedChe...
[ "0.5544087", "0.54747665", "0.5387154", "0.5273328", "0.52665716", "0.52562845", "0.5227192", "0.5180332", "0.5176289", "0.5160502", "0.51169616", "0.50695074", "0.50054425", "0.49992335", "0.49589285", "0.4948577", "0.49212882", "0.49166873", "0.49122447", "0.4900638", "0.48...
0.5747808
0
ADD O STYLE O SCRIPT DO SITE
function rt_theme_styles(){ /** priemrio o nome segundo o diretorio */ wp_enqueue_style('bootstrap-css', get_template_directory_uri() . '/vendor/bootstrap/css/bootstrap.min.css?ver=1'); wp_enqueue_style('clean-blog', get_template_directory_uri() . '/css/clean-blog.css?ver=1'); wp_enqueue_style('font-awesome', get_template_directory_uri() . '/vendor/font-awesome/css/font-awesome.min.css'); // FONTES wp_enqueue_style('google-font-lora', 'https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic'); wp_enqueue_style('google-font-open-sans', 'https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800'); // SCRIPTS wp_enqueue_script('theme-jquery', get_template_directory_uri() . '/vendor/jquery/jquery.min.js'); wp_enqueue_script('theme-js', get_template_directory_uri() . '/vendor/jquery/jquery.js', array('jquery'), '', true); wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/vendor/bootstrap/js/bootstrap.bundle.min.js'); wp_enqueue_script('clean-blog-js', get_template_directory_uri() . '/js/clean-blog.min.js'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addAdditionalScript() {\necho <<< HTML\n <script src=\"scripts/ajax.js\"></script>\n <link rel=\"stylesheet\" type=\"text/css\" href=\"styles/customer.css\">\nHTML; \n }", "function elegirScript($script){\r\n\techo \"<script type='text/javascript' src='http://www.sindicatoclicks.net...
[ "0.6894319", "0.6789533", "0.6706804", "0.6699865", "0.66399884", "0.6562567", "0.65094155", "0.65065926", "0.6492275", "0.64448756", "0.6408584", "0.6382151", "0.63815767", "0.63522875", "0.6336021", "0.63351876", "0.6318364", "0.63116705", "0.63051814", "0.6303926", "0.6303...
0.0
-1
ADD MENUS AO TEMA
function rt_after_setup(){ // SUPORTE PARA IMAGENS add_theme_support('post-thumbnails'); //SUPORTE PARA TITLE DO TEMA add_theme_support('title-tag'); //LOGO CUSTOMIZADA add_theme_support('custom-logo'); //SUPORTE PARA MENUS add_theme_support('menus'); register_nav_menu('primary', __('Primary Menu','temaOne')); register_nav_menu('footer', 'Menu Rodapé'); // REMOVENDO A BARRA DO ADMIN show_admin_bar(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addMetaboxes() {}", "function insertarMaquinaria(){\n\t\t$this->procedimiento='snx.ft_maquinaria_ime';\n\t\t$this->transaccion='SNX_MAQ_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');...
[ "0.5607881", "0.55981183", "0.55648494", "0.5558524", "0.55545455", "0.55468494", "0.5539828", "0.55150074", "0.54974186", "0.5478723", "0.54755807", "0.5463267", "0.54545456", "0.54353255", "0.54344356", "0.54136294", "0.54089004", "0.54042214", "0.54027086", "0.54026973", "...
0.0
-1
COLOCANDO CSS NOS BOTOES PREV E NEXT PAGE
function posts_link_attributes(){ return ' class="btn btn-primary float-right" '; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNextPage();", "function nextPrev($curpage, $pages) \n { \n $next_prev = \"\"; \n\n if (($curpage-1) <= 0) \n { \n $next_prev .= \"Previous\"; \n } \n else \n { \n $next_prev .= \"<a href=\\\"\".$_SERVER['PHP_SELF'].\"?page=\".($curpage-1).\"\\\" alt=\...
[ "0.6356417", "0.6252179", "0.6216892", "0.6206911", "0.620456", "0.620232", "0.61108106", "0.60750604", "0.6031225", "0.6011953", "0.60092854", "0.6005445", "0.5969607", "0.59592575", "0.59471613", "0.5922548", "0.59047884", "0.58750904", "0.5865265", "0.58580863", "0.5856539...
0.0
-1
CUSTOMIZANDO O LEIA MAIS
function new_excerpt_more($length) { return 18; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function masodik()\n {\n }", "public function mostra(){\n }", "public function abono();", "public function obtenerViajesplusAbonados();", "public static function metodo_estatico () {\n }", "public function obtener()\n {\n }", "public function hapus_toko(){\n\t}", "public func...
[ "0.6340477", "0.63033456", "0.5978593", "0.59154034", "0.590642", "0.5850214", "0.5848934", "0.5823389", "0.5803323", "0.579613", "0.5783415", "0.57683945", "0.57295746", "0.5727861", "0.57224286", "0.5694523", "0.5663771", "0.56549394", "0.56521326", "0.5650222", "0.56457776...
0.0
-1
/ Users details get cache data or query db
public function getUserDetailsAction($userId) { $service = $this->get('users.users_service_cache'); try { $userDetails = $service->getUserDetails($userId); } catch (\Exception $ex) { throw $ex; } return $this->render('UsersBundle:Users:details.html.twig', array('userDetails' => $userDetails)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDataByDatabase()\n {\n $condition = [\n ['user_id', '>', '39454']\n ];\n db()->table('tp_users')->where($condition)->cache('userList', 60)->select();\n $data = Cache::get('userList');\n dump($data);die;\n }", "public function info($key) {\n\t...
[ "0.73639894", "0.69062155", "0.68900716", "0.68708026", "0.680989", "0.6745389", "0.6691998", "0.65188247", "0.6337877", "0.63324744", "0.6324094", "0.63069636", "0.63046336", "0.6242074", "0.6239376", "0.62310654", "0.6213832", "0.6196839", "0.61594206", "0.6147748", "0.6106...
0.0
-1
/ Users details get cache data or query db
public function editAction($userId) { $request = $this->get('request'); $service = $this->get('users.users_list_service'); try { $userDetails = $service->getUserDetails($userId); } catch (\Exception $ex) { throw $ex; } $user = new User(); $user->setFirstName($userDetails['first_name']); $user->setLastName($userDetails['last_name']); $form = $this->createFormBuilder($user) ->add('first_name', 'text') ->add('last_name', 'text') ->add('save', 'submit', array('label' => 'Update')) ->getForm(); if ($request->getMethod() == 'POST') { $form->handleRequest($request); if ($form->isSubmitted() && $form->isValid()) { $user = new User; $user->setId($userId); $user->setFirstName($form["first_name"]->getData()); $user->setLastName($form["last_name"]->getData()); $service->updateUser($user); return $this->redirectToRoute('users_homepage'); } } return $this->render('UsersBundle:Users:list_edit.html.twig', array( 'form' => $form->createView(), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDataByDatabase()\n {\n $condition = [\n ['user_id', '>', '39454']\n ];\n db()->table('tp_users')->where($condition)->cache('userList', 60)->select();\n $data = Cache::get('userList');\n dump($data);die;\n }", "public function info($key) {\n\t...
[ "0.73643225", "0.6905491", "0.6889439", "0.68700737", "0.68099713", "0.67471987", "0.6692425", "0.65224606", "0.6339047", "0.63324124", "0.63227963", "0.6308719", "0.6307604", "0.6242353", "0.62397563", "0.6229758", "0.62166387", "0.62007296", "0.6164302", "0.6148758", "0.610...
0.0
-1
Validates that the given userinfo is a valid response for the requestedClaims. This must be called after other validations
public function validateMatchingResponse(array $requestedClaims, array $userinfo) { $rules = []; if (isset($requestedClaims['rules'])) { if (!is_array($requestedClaims['rules'])) { throw new ValidationException("Rules must be array (logic expression)."); } $rules =& $requestedClaims['rules']; } if (isset($requestedClaims['userinfo']) && !is_object($requestedClaims['userinfo'])) { $this->validateMatchingResponseForToken( $requestedClaims['userinfo'], $userinfo, $rules ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validUserResponse ($userResponse);", "private function verify_request($data_active)\r\n\t\t{\r\n\t\t\t$headers = $this->input->request_headers();\r\n\r\n\t\t\t// Extract the token\r\n\t\t\t$token = $headers['Authorization'];\r\n\r\n\t\t\t// Use try-catch\r\n\t\t\t// JWT library throws exception i...
[ "0.61199075", "0.53209674", "0.5161927", "0.513904", "0.50741595", "0.49586102", "0.49447203", "0.49420717", "0.49323457", "0.4922052", "0.49094534", "0.4908126", "0.48788986", "0.48533937", "0.48219582", "0.48139027", "0.481387", "0.48041713", "0.47919026", "0.47835636", "0....
0.69121504
0
Validates that the requested essential claims are in the response, taking conditionals and special cases into account
private function validateMatchingResponseForToken(array $request, array $response, array $rules) { $logicEvaluator = new LogicEvaluator($rules, $response); foreach ($request as $claimName => $valueInRequest) { if (!$this->isVerificationClaim($claimName)) { continue; } $enabled = $this->getBoolValue($valueInRequest, 'conditional', true, $logicEvaluator); // If value=false is given, we accept both true and false. // It would make no sense to ask for stricly unverified e-mail or phone-number. // $essential is not considered for verification claims $mustBeVerified = $this->getBoolValue($valueInRequest, 'value', false, $logicEvaluator); $valueInResponse = $this->getClaimValue($response, $claimName); $baseClaimName = substr($claimName, 0, strlen($claimName) - strlen('_verified')); $baseClaimValueInRequest = isset($request[$baseClaimName]) ? $request[$baseClaimName] : []; $isBaseClaimEnabled = $this->getBoolValue($baseClaimValueInRequest, 'conditional', true, $logicEvaluator); $baseClaimValueInResponse = $this->getClaimValue($response, $baseClaimName); $isBaseClaimSet = !is_null($baseClaimValueInResponse); $isBaseClaimEssential = $this->getBoolValue($baseClaimValueInRequest, 'essential', false, $logicEvaluator); if (!$isBaseClaimEnabled && $isBaseClaimSet) { throw new ValidationException("Verifiable claim $baseClaimName disabled by conditional, but set."); } if ($isBaseClaimEssential && !$isBaseClaimSet) { throw new ValidationException("Verifiable claim $baseClaimName essential, but missing."); } if ($enabled && $isBaseClaimEnabled && $isBaseClaimSet) { if (!is_bool($valueInResponse)) { throw new ValidationException("Verification claim $claimName missing or has an invalid type."); } if ($mustBeVerified && $valueInResponse !== true) { throw new ValidationException("Verification claim $claimName not true."); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handle_claim() {\n $file = $_FILES[\"claim\"];\n\n if (!check_upload(&$file)) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"Uploaded file missing or of wrong type!\\n\";\n return false;\n }\n\n if (($err = verify_signature(&$file)) !== \"OK\") {\n header(\"HTTP...
[ "0.5917254", "0.58860385", "0.5828724", "0.5704555", "0.5642776", "0.55364764", "0.55364764", "0.55023044", "0.5487876", "0.5476067", "0.5457175", "0.54370266", "0.54347104", "0.53679836", "0.5352606", "0.53438467", "0.5340123", "0.53141844", "0.5310807", "0.53002864", "0.528...
0.58951604
1
Get bool value from request
private function getBoolValue($valueInRequest, $attribute, $defaultValue, LogicEvaluator $logicEvaluator) { if (is_array($valueInRequest) && isset($valueInRequest[$attribute])) { $value = $logicEvaluator->evaluate($valueInRequest[$attribute]); if (!is_bool($value)) { throw new ValidationException($attribute . ' can not be evaluated to bool.'); } return $value; } return $defaultValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBool(): bool;", "public function bool()\n {\n return filter_var($this->value, FILTER_VALIDATE_BOOLEAN);\n }", "public function getBoolField()\n {\n $value = $this->get(self::BOOL_FIELD);\n return $value === null ? (boolean)$value : $value;\n }", "public fun...
[ "0.71778405", "0.701831", "0.7005731", "0.6821132", "0.6760427", "0.66830415", "0.6601742", "0.65724325", "0.651404", "0.65119064", "0.64777994", "0.6395705", "0.63876724", "0.63818914", "0.6362779", "0.634482", "0.63352656", "0.6324884", "0.6323044", "0.631167", "0.6303824",...
0.0
-1
Does the string end with the given ending?
private function endsWith($string, $ending) { $length = strlen($ending); if ($length == 0) { return true; } return (substr($string, -$length) === $ending); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ends_with($string,...$end)\n{\n if(!$string)\n return false;\n foreach( $end as $e )\n if( substr($string,strlen($string)-strlen($e)) == $e )\n return true;\n return false;\n}", "function check_str_end(string $string, string $end, int $len, $endLength): bool\n{\n ret...
[ "0.8075019", "0.79937583", "0.783031", "0.77522296", "0.77446014", "0.77412206", "0.7707136", "0.7633017", "0.7626689", "0.7624749", "0.7588783", "0.7531934", "0.7489809", "0.74896574", "0.74605316", "0.73864275", "0.7373679", "0.73714787", "0.7369942", "0.7367351", "0.728408...
0.8063734
1
Returns whether a configuration object exists.
public function exists($name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasConfig();", "public function hasConfig() {\n\t\treturn (bool)@file_exists($this->fullModulePath.'/config.ini');\n\t}", "public function has_config() {\n return true;\n }", "public function has_config() {\n return true;\n }", "public function has_configuration()\n {...
[ "0.77736974", "0.773603", "0.756169", "0.756169", "0.73932964", "0.73932964", "0.73191", "0.7289112", "0.7289112", "0.72641015", "0.7234415", "0.7200637", "0.71567684", "0.7116742", "0.71004933", "0.70732397", "0.705539", "0.70530415", "0.70530415", "0.7039961", "0.7038368", ...
0.0
-1
Reads configuration data from the storage.
public function read($name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readConfigurationValues();", "public static function read()\n {\n return self::$config;\n }", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "pub...
[ "0.7271961", "0.7196819", "0.69144773", "0.66008073", "0.6591329", "0.64689195", "0.64281684", "0.6357724", "0.6345261", "0.6282819", "0.6261112", "0.6255022", "0.6245914", "0.62448245", "0.6234477", "0.6231036", "0.61999047", "0.6196159", "0.6181799", "0.61234885", "0.608308...
0.0
-1
Reads configuration data from the storage.
public function readMultiple(array $names);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readConfigurationValues();", "public static function read()\n {\n return self::$config;\n }", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "pub...
[ "0.727389", "0.7198893", "0.69167006", "0.66020435", "0.6593285", "0.6467077", "0.6431306", "0.63610655", "0.63451916", "0.6284712", "0.6263903", "0.6257862", "0.6247373", "0.6243261", "0.62375486", "0.6233703", "0.620125", "0.6197925", "0.6185712", "0.61250764", "0.6084894",...
0.0
-1
Writes configuration data to the storage.
public function write($name, array $data);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\t...
[ "0.7184266", "0.6727013", "0.66693735", "0.6667976", "0.64904344", "0.64337415", "0.63909715", "0.6359819", "0.6337933", "0.63310003", "0.63266534", "0.6322355", "0.6249194", "0.6135065", "0.61201805", "0.61148655", "0.6074609", "0.6011083", "0.5992508", "0.5975874", "0.59173...
0.0
-1
Deletes a configuration object from the storage.
public function delete($name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteSettings()\n {\n $master = new DynaGridStore([\n 'id' => $this->dynaGridId,\n 'category' => DynaGridStore::STORE_GRID,\n 'storage' => $this->storage,\n 'userSpecific' => $this->userSpecific\n ]);\n $config = $this->storage ==...
[ "0.69860554", "0.6941031", "0.64523286", "0.63506347", "0.6270832", "0.6249473", "0.6176333", "0.6141203", "0.6109421", "0.6091004", "0.6072525", "0.606543", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", "0.6054349", ...
0.0
-1
Renames a configuration object in the storage.
public function rename($name, $new_name);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rename(Storable $storable, string $newName): void;", "function rename($old_name,$name){\r\n $file = lako_ljson::make_ljson_file($old_name);\r\n $file = $this->loader->locate($file);\r\n $definition = lako::get('ljson')->require_file($file);\r\n $location = dirname($file);\r\n //edi...
[ "0.6215419", "0.57994515", "0.57121986", "0.5274167", "0.5262123", "0.5251104", "0.5124061", "0.5096711", "0.5076634", "0.50512975", "0.5035078", "0.50222725", "0.50198144", "0.5019733", "0.49869028", "0.49865326", "0.495102", "0.49427477", "0.49329376", "0.49276316", "0.4891...
0.5440077
3
Encodes configuration data into the storagespecific format.
public function encode($data);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\t...
[ "0.5545379", "0.5489159", "0.54490453", "0.54300356", "0.5394215", "0.5389233", "0.53847975", "0.53560495", "0.526964", "0.5225407", "0.5206583", "0.51743037", "0.5161273", "0.5157175", "0.5132337", "0.50227976", "0.5020768", "0.5009272", "0.5006084", "0.49858108", "0.4978798...
0.47212213
70
Decodes configuration data from the storagespecific format.
public function decode($raw);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readConfigurationValues();", "public function decode ()\n {\n $magicBytes = $this->nextBytes(4);\n if (Utils::byteArray2String($magicBytes) === \"meta\") {\n $this->version = hexdec(Utils::bytesToHex($this->nextBytes(1)));\n if (!empty($this->metadataVersion...
[ "0.54687566", "0.5364445", "0.5310812", "0.5306034", "0.52516633", "0.5135629", "0.5131478", "0.5128883", "0.5100327", "0.50932646", "0.50932646", "0.50932646", "0.50932646", "0.50932646", "0.5073528", "0.50682443", "0.4981014", "0.49719518", "0.4952335", "0.4934609", "0.4932...
0.49886647
16
Gets configuration object names starting with a given prefix. Given the following configuration objects: node.type.article node.type.page Passing the prefix 'node.type.' will return an array containing the above names.
public function listAll($prefix = '');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPrefixes();", "public static function keys($prefix)\n {\n return parent::keys($prefix);\n }", "public function getPrefix();", "public function getPrefix();", "function getPrefixes();", "function getPrefixes() {\n return array(\"from\" => \"froms\", \"subject\" => \"...
[ "0.64692664", "0.64085", "0.62802047", "0.62802047", "0.62677175", "0.6219111", "0.6173023", "0.61568785", "0.6031773", "0.60099745", "0.59278196", "0.58854645", "0.58851355", "0.58645904", "0.5817596", "0.58150494", "0.579695", "0.57931185", "0.575712", "0.57380956", "0.5726...
0.6012731
9
Deletes configuration objects whose names start with a given prefix. Given the following configuration object names: node.type.article node.type.page Passing the prefix 'node.type.' will delete the above configuration objects.
public function deleteAll($prefix = '');
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function delete($prefix)\n {\n if (!is_string($prefix) or $prefix === null or $prefix === '') {\n throw new \\InvalidArgumentException(\n \"\\$prefix should be a string and cannot be null or empty\"\n );\n }\n\n $prefix = strtolower($prefix...
[ "0.59229916", "0.5854187", "0.58503544", "0.5822707", "0.57871926", "0.552195", "0.5466166", "0.5421459", "0.534045", "0.53156245", "0.5227362", "0.51237273", "0.5120324", "0.49455112", "0.49274817", "0.48961696", "0.48476747", "0.48331958", "0.4800423", "0.4796945", "0.47775...
0.6815704
0
We'll use a constructor, as you can't directly call a function from a property definition.
public function __construct() { // Assign the CodeIgniter super-object $this->CI =& get_instance(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct($val)\n {\n $this->property = $val;\n }", "function createProperty();", "public function __construct($createProperty, $property)\n {\n $this->property = $property;\n\n $this->createProperty = $createProperty;\n }", "public function __construct(Prop...
[ "0.67959", "0.676635", "0.64151615", "0.62790227", "0.62709343", "0.62288797", "0.615108", "0.61469036", "0.6104368", "0.6057775", "0.6057775", "0.6057775", "0.6045571", "0.6045571", "0.6045571", "0.6045571", "0.6045571", "0.6045571", "0.6040542", "0.5979003", "0.59707034", ...
0.0
-1
this three functions look for id,amount,account_type from array accounts
function emetteur_account_id() { global $account_type; foreach ($account_type as $key => $accounts) { foreach ($accounts as $key => $account) { if ($account == test_input($_POST["compte_emetteur"])) { return $accounts["id"]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beneficiaire_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_beneficiaire\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }", "publ...
[ "0.6595377", "0.6134952", "0.60930204", "0.5779701", "0.57348096", "0.56539696", "0.56191105", "0.5611026", "0.5601746", "0.55570155", "0.5549037", "0.554459", "0.55139583", "0.54715633", "0.54419416", "0.543885", "0.5429928", "0.54044324", "0.5379817", "0.5375252", "0.537275...
0.62901866
1
this three functions look for id,amount,account_type from array accounts
function beneficiaire_account_id() { global $account_type; foreach ($account_type as $key => $accounts) { foreach ($accounts as $key => $account) { if ($account == test_input($_POST["compte_beneficiaire"])) { return $accounts["id"]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emetteur_account_id() {\n global $account_type;\n foreach ($account_type as $key => $accounts) {\n foreach ($accounts as $key => $account) {\n if ($account == test_input($_POST[\"compte_emetteur\"])) {\n return $accounts[\"id\"];\n }\n }\n }\n }", "public funct...
[ "0.6289802", "0.6134071", "0.609225", "0.5778751", "0.57343304", "0.5654055", "0.561856", "0.5610239", "0.56008947", "0.55561996", "0.55483097", "0.55452555", "0.5513649", "0.54710156", "0.5441734", "0.5439063", "0.54292583", "0.5402549", "0.53785807", "0.53743976", "0.537309...
0.659521
0
/ the constructor loads the necessary core files and classes, and creates a router instance
public function __construct() { $this->loadCoreClasses(); $this->router = new Router(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct()\n {\n $this->uri = Fly::app()->getUri();\n Fly::log('debug', \"Router Class Initialized\");\n $this->setRouting();\n }", "function __construct()\n {\n $routesPath = ROOT . '/core/config/routes.php';\n if (file_exists($routesPath)) {\n ...
[ "0.8297344", "0.788802", "0.7747912", "0.7725001", "0.77034354", "0.77000535", "0.76570654", "0.76074505", "0.7605644", "0.7557966", "0.7504764", "0.74951476", "0.7449673", "0.74465173", "0.7301544", "0.7273089", "0.7268058", "0.7231878", "0.72175306", "0.72009236", "0.718881...
0.88063747
0
/ this is the method that starts the application
public function run() { $this->routeRequest(new Request()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function start() {\n\t\t$this->invoke(\"start\");\n\t}", "public function startup();", "function start_application() {\n\t// The SAPI type is cgi-fcgi when accessed from the browser.\n\tif (PHP_SAPI === 'cgi-fcgi') {\n\t\t// Force secure site.\n\t\tif (FORCE_SECURE) {\n\t\t\tredirect_to_https();\n\t\t}\...
[ "0.7491657", "0.7436318", "0.7361607", "0.73032093", "0.729617", "0.729617", "0.7295368", "0.72949576", "0.72946435", "0.72946435", "0.72946435", "0.72946435", "0.72946435", "0.72946435", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878", "0.7276878...
0.0
-1
/ sets the user application directory
public function setApplicationDirectory($applicationDirectory) { Config::set('PUNYMVC_APPLICATION_DIR', $applicationDirectory . DIRECTORY_SEPARATOR); Config::set('PUNYMVC_APPLICATION_LIBRARIES_DIR', $applicationDirectory . 'libraries' . DIRECTORY_SEPARATOR); Config::set('PUNYMVC_APPLICATION_MODELS_DIR', $applicationDirectory . 'models' . DIRECTORY_SEPARATOR); Config::set('PUNYMVC_APPLICATION_CONTROLLER_DIR', $applicationDirectory . 'controllers' . DIRECTORY_SEPARATOR); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function & SetAppDir ($appDir);", "public static function setAppDir($app_dir)\n {\n self::$app_dir = $app_dir;\n }", "public function setAppDir($appDir)\n\t{\n\t\t$this->_appDir = $appDir;\n\t}", "function setHomeDir($path)\r\n\t{\r\n\t\t$this->pathHomeDir = $path;\r\n\t}", "function se...
[ "0.7659501", "0.6725675", "0.6611988", "0.6565697", "0.65458095", "0.651755", "0.6434755", "0.64287907", "0.63730067", "0.62439466", "0.61653924", "0.6160163", "0.6083304", "0.60296994", "0.59885216", "0.59426373", "0.5937187", "0.5929818", "0.5892706", "0.5880956", "0.587969...
0.0
-1
/ sets a route for the GET request method
public function get($route, $action) { $this->router->addRoute('GET', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddRouteShorthandMethodGet()\n {\n $this->collection->get('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('GET', $rout...
[ "0.7034967", "0.6874657", "0.6871048", "0.6828566", "0.6784085", "0.6718788", "0.6715438", "0.66463226", "0.663955", "0.66320294", "0.6611031", "0.6556806", "0.6554662", "0.6553525", "0.65507346", "0.6524255", "0.6513028", "0.64307314", "0.64153135", "0.6387633", "0.63735795"...
0.6105624
41
/ sets a route for the POST request method
public function post($route, $action) { $this->router->addRoute('POST', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddRouteShorthandMethodPost()\n {\n $this->collection->post('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('POST', $r...
[ "0.70500004", "0.6770707", "0.67485905", "0.66712075", "0.66712075", "0.66348827", "0.6605969", "0.6597734", "0.65795064", "0.65795064", "0.65764105", "0.6509498", "0.64536905", "0.6451468", "0.6451468", "0.6451468", "0.6374472", "0.6350858", "0.6324766", "0.6313987", "0.6299...
0.6060325
39
/ sets a route for the PUT request method
public function put($route, $action) { $this->router->addRoute('PUT', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testAddRouteShorthandMethodPut()\n {\n $this->collection->put('name', '/', 'action');\n\n $this->assertCount(1, $this->collection->all());\n\n $routes = $this->collection->all();\n\n $this->assertArrayHasKey('0', $routes);\n\n $this->assertContains('PUT', $rout...
[ "0.7303799", "0.72895736", "0.7077067", "0.70744663", "0.6804522", "0.6761533", "0.675793", "0.6612408", "0.6606304", "0.66027147", "0.65710974", "0.64892024", "0.64423424", "0.64268225", "0.6373286", "0.63625056", "0.63282007", "0.63269305", "0.631669", "0.63071716", "0.6288...
0.6516068
11
/ sets a route for the DELETE request method
public function delete($route, $action) { $this->router->addRoute('DELETE', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getRouteDelete() {\n\t\treturn \"/delete\";\n\t}", "public function httpDelete()\n {\n return $this->method(\"DELETE\");\n }", "public function deleteAction()\n {\n Extra_ErrorREST::setInvalidHTTPMethod($this->getResponse());\n }", "public function testAddRouteShorth...
[ "0.790508", "0.71293384", "0.7038066", "0.6905852", "0.68440896", "0.6747114", "0.671746", "0.67152524", "0.66088456", "0.65363675", "0.6509264", "0.65013474", "0.65013474", "0.6483232", "0.63649577", "0.6321028", "0.6315108", "0.6314847", "0.6312016", "0.62826693", "0.623670...
0.5973524
36
/ sets a route for any request method
public function any($route, $action) { $this->router->addRoute('ANY', $route, $action); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRoute() {\n $address = $_SERVER['REQUEST_URI'];\n \n $this->determineControllerAndMethod($address);\n\n $this->determineArguments($address);\n }", "public function route(string $requestUri, string $requestMethod);", "public function route()\n\t{\n\t\t/* [http|h...
[ "0.7600561", "0.7455477", "0.71577156", "0.71222436", "0.7086271", "0.70638144", "0.7040639", "0.69762903", "0.6912904", "0.6664856", "0.6632385", "0.6568038", "0.6551657", "0.64986575", "0.64751595", "0.64742285", "0.6467912", "0.63887656", "0.63814634", "0.63746554", "0.635...
0.0
-1
/ sets an optional userdefined controller action for the 404 response
public function notFound($action) { $this->router->notFound($action); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function actionNotFound()\n\t{\n\t\tzf::halt(\"You can't call this function \\\"actionNotFound\\\" directly. You must redefine it in your controller.\");\n\t}", "public function error404Action() \n {\n return '404 Page not found';\n }", "public function actionNotfound()\n {\n $...
[ "0.75687605", "0.73959404", "0.7356556", "0.730947", "0.72667104", "0.71842384", "0.71421397", "0.7117137", "0.71134186", "0.71047837", "0.70784706", "0.70471174", "0.704137", "0.69491005", "0.6945228", "0.6942602", "0.6928617", "0.6900098", "0.68907547", "0.6839075", "0.6805...
0.6543763
38
/ setter for a configuration item
public function config($key, $value = null){ if (is_array($key)) { Config::set($key); } else { Config::set($key, $value); } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_item($item, $value)\n\t{\n\t\t$this->config[$item] = $value;\n\t}", "public function set_item($item, $value)\n\t{\n\t\tGSMS::$config[$item] = $value;\n\t}", "public function setConfig($a_configItem, $a_value)\n {\n $this->m_config[$a_configItem] = $a_value;\n }", "public...
[ "0.7377834", "0.69909805", "0.69847304", "0.6901345", "0.6777166", "0.65271866", "0.6521171", "0.6329534", "0.61958444", "0.6163527", "0.6111967", "0.6064122", "0.60511076", "0.60177374", "0.5987528", "0.59761506", "0.59574866", "0.59489787", "0.5929193", "0.5925566", "0.5867...
0.0
-1
/ setter for a database configuration users can add multiple configurations by using the $instance parameter
public function database(array $config, $instance = 'default') { Database::configure($config, $instance); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function configureObject( $instance )\n {\n switch ( $instance )\n {\n /* Gauffr DB */\n case Gauffr::GAUFFR_DB_INSTANCE:\n $cfg = ezcConfigurationManager::getInstance();\n list( $driver, $user, $password, $host, $database ) = $cfg...
[ "0.6691665", "0.66329426", "0.6368667", "0.62437004", "0.60426134", "0.6029691", "0.59754705", "0.58853924", "0.5828924", "0.5816703", "0.57715243", "0.5739891", "0.56694907", "0.56220245", "0.5609314", "0.5591512", "0.55891085", "0.5584785", "0.55844855", "0.5558246", "0.554...
0.65304774
2
/ this is teh request handler it takes a Request instance and uses the Router to check for a matching controller if a mathing controller is found, the controller class is instantiated with the Request object and a new Response object The action method is called along with route parameters If no matching controller is found by the Router, a default 404 response is sent
protected function routeRequest(Request $request) { if ($routeAction = $this->router->getRouteAction($request)) { $controllerPath = Config::get('PUNYMVC_APPLICATION_CONTROLLER_DIR') . ltrim($routeAction->path, '/') . '.php'; if ($this->validController($controllerPath)) { require $controllerPath; if (class_exists($routeAction->class) && method_exists($routeAction->class, $routeAction->method)) { $controllerClass = $routeAction->class; $controllerInstance = new $controllerClass($request, new Response()); call_user_func_array(array($controllerInstance, $routeAction->method), $routeAction->params); return; } } } $response = new Response(); $response->setStatus(404); $response->setBody('Not Found'); $response->send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ...
[ "0.7873218", "0.76526374", "0.75794154", "0.74242836", "0.7369262", "0.72697526", "0.7235982", "0.71996295", "0.71238345", "0.7030151", "0.70071214", "0.69780445", "0.69746727", "0.69605404", "0.68467057", "0.6750967", "0.6744485", "0.6696743", "0.6686083", "0.66715795", "0.6...
0.73778725
4
/ validates if a controller path exists and is readable
protected function validController($path) { return file_exists($path) && is_readable($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function checkControllerIsExist () {\n\t\tif ( !isset(self::$url[0]))\n\t\t\treturn false ;\n\t\t$controller = trim(self::$url[0]);\n\t\tif ( !empty($controller)) {\n\t\t\t$controllerPatch = self::$appPatch.self::$app.DIRECTORY_SEPARATOR . 'controller' . DIRECTORY_SEPARATOR . $controller . '.php' ;\...
[ "0.7252334", "0.7035493", "0.68429124", "0.65190035", "0.6396005", "0.6281552", "0.626848", "0.62484044", "0.61569375", "0.60835975", "0.606851", "0.6057534", "0.6037909", "0.5993838", "0.5947583", "0.5947583", "0.5938197", "0.5896171", "0.5877429", "0.5872966", "0.5851458", ...
0.7996422
0
/ loads the core class files
protected function loadCoreClasses() { require __DIR__ . DIRECTORY_SEPARATOR . 'Config.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Router.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Loader.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Controller.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Database.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Model.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Library.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'View.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Request.php'; require __DIR__ . DIRECTORY_SEPARATOR . 'Response.php'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadClassFiles() {}", "private function loadClasses()\n\t\t{\n\t\t\t// foreach($GLOBALS['classes'] as $var => $class)\n\t\t\t// {\n\t\t\t\t// $this->$var = $class;\n\t\t\t// }\n\t\t\t\n\t\t\t// $this->load = _new('loader');\n\t\t\t\n\t\t\t/** Registramos todos os objetos que serão necessários ...
[ "0.78886384", "0.74368006", "0.7236141", "0.7230211", "0.71069735", "0.7071298", "0.70692074", "0.7036053", "0.6996384", "0.6929936", "0.6881678", "0.687795", "0.6813528", "0.68101895", "0.67888033", "0.6780812", "0.67777777", "0.6765415", "0.6741987", "0.673613", "0.6727286"...
0.84678334
0
Display a listing of the resource.
public function getDashboardPage() { $emails = DB::table('emails')->latest()->paginate(5); return view('dashboard',['emails'=>$emails]); // Example------------------------------------------ // return view('dashboard',[ // 'emails'=>DB::table('emails')->latest()->paginate(4) // ]); }
{ "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.7594873", "0.7594873", "0.75862724", "0.7577369", "0.75727355", "0.7500874", "0.74348205", "0.74339336", "0.7389178", "0.73531044", "0.73364365", "0.73124814", "0.7296061", "0.72818893", "0.7274119", "0.72423935", "0.72292763", "0.72266877", "0.7187332", "0.717915", "0.717...
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $rules=$this->Validate($request,["email"=>"required | email", "name"=>"required", "info"=>"required", "phone"=>"required | starts_with:07,00964,+964 | max:15"]); $data=[ "name"=>$request->name, "phone"=>$request->phone, "email"=>$request->email, "info"=>$request->info, "link"=>$request->link ]; Email::create($data); return view('master'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.7286258", "0.71454436", "0.7132821", "0.6640289", "0.6621105", "0.6566493", "0.65255576", "0.65087926", "0.6448317", "0.63752604", "0.63736314", "0.6365631", "0.6365631", "0.6365631", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0.634229", "0....
0.0
-1
Display the specified resource.
public function show(Email $email) { // }
{ "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(Email $email) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78557473", "0.76946205", "0.72731614", "0.7241571", "0.71700776", "0.70650244", "0.7052897", "0.698311", "0.69465625", "0.6944826", "0.69399333", "0.69286525", "0.69031185", "0.68969506", "0.68969506", "0.6878258", "0.6862812", "0.6859171", "0.68560475", "0.68436426", "0.6...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Email $email) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7424884", "0.7062319", "0.70572054", "0.6897199", "0.658233", "0.6450576", "0.6347209", "0.6211253", "0.6146092", "0.6121878", "0.6114851", "0.61005586", "0.608833", "0.60537165", "0.60196865", "0.60068345", "0.5972924", "0.594671", "0.5940615", "0.5938648", "0.58927333", ...
0.0
-1
Remove the specified resource from storage.
public function destroy(Email $email) { // }
{ "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
Return a value for the field.
public function __invoke($rootValue, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) { $key = "example_key"; $cek = DB::table('users')->where('username', $args['username'])->first(); if(!$cek) throw new \GraphQL\Error\UserError('Data Tidak ditemukan'); if(!Hash::check($args['password'], $cek->password)) throw new \GraphQL\Error\UserError('Password Salah'); $payload = array( "iss" => "http://example.org", "aud" => "http://example.com", "iat" => time(), "nbf" => time(), "login" => time(), "user_id" => $cek->id ); return JWT::encode($payload, $key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFieldValue()\n {\n return $this->value;\n }", "public function getValue(): mixed\n {\n return $this->field?->getValue();\n }", "function getFieldValue($field);", "public function getValue()\n {\n return $this->_fields['Value']['FieldValue'];\n }", "...
[ "0.8479756", "0.8379301", "0.8064348", "0.79448414", "0.77689815", "0.77620524", "0.7700596", "0.7662676", "0.7641532", "0.76380265", "0.76324326", "0.7620745", "0.7607805", "0.7595676", "0.7595676", "0.7595676", "0.7579862", "0.7579862", "0.75784016", "0.75784016", "0.757497...
0.0
-1
Get a raw asset by its UUID
public static function uuidRaw($uuid, $locale = null) { return self::assets()->getUuid($uuid, $locale); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }", "public function getAsset($asset)\n {\n $result = $this->newAPIRequest('GET', '/assets/'.$asset);\n return $result;\n }", "public function...
[ "0.65787435", "0.6426662", "0.642404", "0.62226254", "0.61707807", "0.6095904", "0.599809", "0.59961855", "0.59602207", "0.59051216", "0.5785377", "0.5750855", "0.5722788", "0.5721578", "0.5685218", "0.56083983", "0.5597529", "0.553794", "0.54716593", "0.5465606", "0.54591125...
0.5887764
10
Get an asset by its UUID
public static function uuid($uuid, $locale = null) { return self::uuidRaw($uuid, $locale)->toArray(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAsset($asset)\n {\n $result = $this->newAPIRequest('GET', '/assets/'.$asset);\n return $result;\n }", "public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }", "public function...
[ "0.68128", "0.6791113", "0.6654394", "0.66366136", "0.64443743", "0.63976043", "0.6384946", "0.6377226", "0.6242612", "0.62087935", "0.6110482", "0.60111946", "0.600966", "0.5979752", "0.5976832", "0.59351414", "0.5924776", "0.58526057", "0.58455074", "0.579314", "0.57918704"...
0.0
-1
Get an asset by its path
public static function path($path) { return Assets::all()->filter(function ($asset) use ($path) { return $asset->resolvedPath() === $path; })->first(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAsset($key, $path = null) {\n if (isset($path))\n return $this->m->Assets->getAsset($key, $path);\n return $this->info->getAsset($this->m->Assets, $key);\n }", "static function asset($path)\n {\n return Assets::src($path);\n }", "public function asset(string $path)\n...
[ "0.783336", "0.728482", "0.7275394", "0.71702605", "0.70674044", "0.6842171", "0.67996275", "0.66976744", "0.66391087", "0.6557754", "0.651351", "0.651351", "0.6472198", "0.6446784", "0.6430077", "0.6422105", "0.6416686", "0.6400945", "0.6394981", "0.6370265", "0.63701123", ...
0.7417017
1
Lists all Examination models.
public function actionIndex() { $userId = Yii::$app->user->id; $searchModel = new ExaminationSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $dataProvider->query->AndWhere(['user_id' => $userId]); $dataProvider->query->orderBy('create_at DESC'); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n\t{\n\t\t$exams = Exam::with('course')->get(['id', 'name', 'type', 'course_id', 'class', 'campus_id', 'created_at']);\n\n\t\tforeach ($exams as $value) {\n\t\t\t$value['campus'] = Campus::find($value['campus_id'])->title;\n\t\t}\n\t\treturn $exams;\n\t}", "public function index()\n\t{\n\...
[ "0.6388559", "0.6354124", "0.62900794", "0.6183228", "0.61783564", "0.6168356", "0.6096302", "0.6082665", "0.607787", "0.6073956", "0.60720295", "0.60704064", "0.6067534", "0.6064393", "0.60572386", "0.5988476", "0.59781706", "0.5957731", "0.59494495", "0.5945963", "0.5942848...
0.70736754
0
Displays a single Examination model.
public function actionView($id) { return $this->render('view', [ 'model' => $this->findModel($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Exam $exam)\n {\n \n }", "public function show()\n {\n return view('exam::show');\n }", "public function show(Exam $exam)\n {\n //\n }", "public function show(Exam $exam)\n {\n //\n }", "public function show(Exam $exam)\n {\n ...
[ "0.6924364", "0.6914265", "0.68571323", "0.68571323", "0.68571323", "0.68571323", "0.68342686", "0.67925423", "0.67639166", "0.67183965", "0.66891944", "0.6635568", "0.6624407", "0.65760326", "0.6566039", "0.64995617", "0.64879626", "0.6482214", "0.64476866", "0.64167535", "0...
0.0
-1
Creates a new Examination model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Examination(); if ($model->load(Yii::$app->request->post())) { $userId = \Yii::$app->user->id; $this->saveResult($model->result, $userId); return $this->redirect('index'); } return $this->render('create', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n\t{\n\t\t$model=new ElearningExam;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ElearningExam']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ElearningExam'];\n\t\t\tif($model->save())\n\t\t\t\...
[ "0.75224596", "0.70448494", "0.69286925", "0.6925248", "0.6869331", "0.6866634", "0.6846652", "0.68006235", "0.6791648", "0.67599225", "0.6747884", "0.67406905", "0.67236465", "0.67160517", "0.66948795", "0.6693164", "0.6677648", "0.6677507", "0.6677325", "0.667132", "0.66658...
0.84992194
0
Updates an existing Examination model. If update is successful, the browser will be redirected to the 'view' page.
public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post())) { $this->saveResult($model->result, $model->user_id); $this->actionDelete($model->id); } return $this->render('update', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['ElearningExam']))\n\t\t{\n\t\t\t$model->attributes=$_POST['ElearningExam'];\n\t\t\tif($model->save())\n...
[ "0.6903996", "0.68268675", "0.6550709", "0.6491861", "0.64810616", "0.64707583", "0.6439833", "0.6423515", "0.6373841", "0.630749", "0.6284817", "0.62710667", "0.6256288", "0.62167495", "0.61853254", "0.61836785", "0.61529386", "0.614503", "0.614365", "0.6133829", "0.6130882"...
0.0
-1
Deletes an existing Examination model. If deletion is successful, the browser will be redirected to the 'index' page.
public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionDelete()\n\t{\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t\n\t\t\n\t\t$this->checkUser();\n\t\t$this->checkActivation();\n\t//\t$model = new Estate;\n\t\t\n\t\tif($model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$model=Estate::model()->findbyPk($_GET['...
[ "0.749066", "0.7113232", "0.7097525", "0.68604875", "0.68573654", "0.6815398", "0.6789704", "0.6754021", "0.6742855", "0.6688334", "0.66424036", "0.6635721", "0.6629038", "0.6596414", "0.65889204", "0.65632504", "0.65389603", "0.65389603", "0.65309703", "0.6514868", "0.651232...
0.0
-1
Finds the Examination model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = Examination::findOne($id)) !== null) { return $model; } throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "public abstract function find($primary_key, $model);", "private function findModel($key)\n {...
[ "0.67698216", "0.66550237", "0.6546686", "0.6543248", "0.6519957", "0.64661765", "0.6399759", "0.6376996", "0.63081235", "0.6267306", "0.6229699", "0.61941415", "0.6169507", "0.61658055", "0.6164623", "0.6141948", "0.6129402", "0.61219573", "0.6112529", "0.6109874", "0.610174...
0.6949804
0
Activate Extension This function enters the extension into the exp_extensions table
public function activate_extension() { // Setup custom settings in this array. $this->settings = array(); if ($this->EE2) { $hooks = array( 'entry_submission_ready' => 'entry_submission_ready', // entry_submission_ready($meta, $data, $autosave) 'delete_entries_loop' => 'delete_entries_loop', // delete_entries_loop($val, $channel_id) 'category_save' => 'category_save', // category_save($cat_id, $data) 'category_delete' => 'category_delete', // category_delete($cat_ids) 'cp_js_end' => 'cp_js_end', ); } else { $hooks = array( 'after_channel_entry_update' => 'after_channel_entry_update', // after_channel_entry_update($entry, $values, $modified) 'after_channel_entry_delete' => 'after_channel_entry_delete', // after_channel_entry_delete($entry, $values) //'after_channel_entry_bulk_delete' => 'delete_entries_loop', // EE4+ after_channel_entry_bulk_delete($delete_ids) 'after_category_update' => 'after_category_update', // after_category_update($category, $values, $modified) 'after_category_delete' => 'after_category_delete', // after_category_delete($category, $values) //'after_category_bulk_delete' => 'category_delete_loop', // EE4+ after_category_bulk_delete($delete_ids) //'cp_js_end' => 'cp_js_end', ); } foreach ($hooks as $hook => $method) { $data = array( 'class' => __CLASS__, 'method' => $method, 'hook' => $hook, 'settings' => serialize($this->settings), 'version' => $this->version, 'enabled' => 'y' ); $this->EE->db->insert('extensions', $data); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activate_extension()\n\t{\n\n\t $data = array(\n\t 'class' => __CLASS__,\n\t 'method' => 'template_types',\n\t 'hook' => 'template_types',\n\t 'settings' => serialize($this->settings),\n\t 'priority' => 10,\n\t 'version' => $this->version...
[ "0.85474145", "0.84049445", "0.836303", "0.836303", "0.8317834", "0.81736046", "0.8015519", "0.7999967", "0.76635045", "0.7606953", "0.7541912", "0.749552", "0.6567963", "0.6437413", "0.6153233", "0.61193347", "0.604909", "0.60322917", "0.60308313", "0.5969348", "0.5966952", ...
0.63584507
14
delete_entries_loop If there is nothing to redirect to after deleting, there would be no need to redirect to it. So delete them.
function delete_entries_loop($val, $channel_id) { $url_title = ''; $query = $this->EE->db->select('url_title, channel_id') ->from('channel_titles') ->where('entry_id', $val) ->where('site_id', $this->site_id) ->get(); foreach($query->result_array() as $row) { $url_title = $row['url_title']; } $this->entry_delete($val, $channel_id, $url_title); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_entries()\n\t{\n\t\tif ( ! $this->cp->allowed_group('can_access_content'))\n\t\t{\n\t\t\tshow_error($this->lang->line('unauthorized_access'));\n\t\t}\n\n\t\tif ( ! $this->cp->allowed_group('can_delete_self_entries') AND\n\t\t\t ! $this->cp->allowed_group('can_delete_all_entries'))\n\t\t{\n\t\t\tsho...
[ "0.7062756", "0.67359877", "0.66329753", "0.65247166", "0.6372403", "0.62216604", "0.61888796", "0.6165071", "0.61439574", "0.6127509", "0.60074323", "0.5992601", "0.5991106", "0.5987587", "0.5980451", "0.5977999", "0.5941756", "0.59399694", "0.59117925", "0.5910475", "0.5899...
0.61617893
8
entry_delete If there is nothing to redirect to after deleting, there would be no need to redirect to it. So delete them.
function entry_delete($entry_id, $channel_id, $url_title='') { if ( ! empty($url_title) && (isset($this->settings['channel_url'][$channel_id]['uri']) && !empty($this->settings['channel_url'][$channel_id]['uri'])) && (isset($this->settings['channel_url'][$channel_id]['uri']) && !empty($this->settings['channel_url'][$channel_id]['uri'])) ) { $entry_url = trim($this->settings['channel_url'][$channel_id]['uri'],'/').'/'.$url_title; // remove this entry $this->EE->db->delete( 'detours', array( 'new_url' => $entry_url, 'site_id' => $this->site_id ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function delete_entry_and_redirect( Entry $entry ) {\n\t\t$result = $entry->delete();\n\n\t\tif ( -1 === $result ) {\n\t\t\tAdmin_Page::redirect_and_show_message(\n\t\t\t\tnew Message( Message::ERROR, __( 'Database error.', 'glossary-by-arteeo' ) )\n\t\t\t);\n\t\t} else {\n\t\t\tAdmin_Page::redirect_and_sh...
[ "0.80901086", "0.73916095", "0.683369", "0.6761785", "0.6760181", "0.6661342", "0.6656066", "0.65376204", "0.65268844", "0.64591086", "0.63928676", "0.6380439", "0.6372802", "0.6334498", "0.6328187", "0.6315341", "0.62771297", "0.6268108", "0.6255769", "0.6221082", "0.6215207...
0.6469549
9
cp_js_end This adds orig_cat_url_title field to capture and post the original value after submission
function cp_js_end() { $data = ''; if ($this->EE->extensions->last_call !== FALSE) { $data = $this->EE->extensions->last_call; } $js = ' $(".pageContents form").has("input[name=cat_name]#cat_name").find("input[name=cat_url_title]#cat_url_title").each(function() { var $cat_url_title = $(this); if ($(".pageContents form").find("input[name=cat_id]").length > 0) { $cat_url_title.after( $("<input>") .attr("type", "hidden") .attr("name", "orig_cat_url_title") .val($cat_url_title.val()) ); } }); '; $js = ( ! empty($js)) ? NL . '(function($) {'.$js.'})(jQuery);' : ''; return $data . $js; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wp_ajax_press_this_add_category()\n {\n }", "private function getCategoryPostData()\n {\n // Get data from form fields\n $this->data['category_title'] = $this->input->post('category_title');\n }", "function product_category_edit(){\n\t\tglobal $tpl, $config, $meta, $_r, $_l, ...
[ "0.57493216", "0.5638515", "0.5587308", "0.5583835", "0.5576168", "0.5532479", "0.5492839", "0.5468453", "0.5453175", "0.5439546", "0.542789", "0.5405437", "0.53552526", "0.52939606", "0.5288841", "0.5271692", "0.5238602", "0.5228893", "0.52277046", "0.5167096", "0.5166725", ...
0.7567759
0
Disable Extension This method removes information from the exp_extensions table
function disable_extension() { $this->EE->db->where('class', __CLASS__); $this->EE->db->delete('extensions'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function disable_extension() {\n ee()->db->where('class', __CLASS__);\n ee()->db->delete('extensions');\n }", "function disable_extension()\n {\n ee()->db->where('class', __CLASS__);\n ee()->db->delete('extensions');\n }", "function disable_extension()\n\t{\n\t\tee()->db->wher...
[ "0.8821285", "0.8669378", "0.8642913", "0.8585984", "0.8518192", "0.8262398", "0.8087804", "0.80238163", "0.7842973", "0.7197018", "0.6628642", "0.63803476", "0.63490266", "0.61334616", "0.6133108", "0.6041258", "0.6010015", "0.5993963", "0.59843075", "0.59778494", "0.5975309...
0.8674797
5
Update Extension This function performs any necessary db updates when the extension page is visited
function update_extension($current = '') { if ($current == '' OR $current == $this->version) { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update_extension(){}", "protected function updateExtensionAction() {}", "public function db_update() {}", "public function updateExtList() {}", "function update_extension($current='')\n\t{\n\t\tglobal $DB;\n\n\t\tif ($current == '' OR $current == $this->version)\n\t\t\treturn FALSE;\n\n\t\t...
[ "0.80198824", "0.7528284", "0.6896804", "0.67112863", "0.6496797", "0.6426562", "0.63467073", "0.62424344", "0.6190257", "0.61898386", "0.61852705", "0.6183816", "0.6166549", "0.6148454", "0.6133148", "0.6133148", "0.612998", "0.6124347", "0.6039649", "0.6037132", "0.5985143"...
0.0
-1
Display a listing of the resource. GET /empresas
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function listarEmpresasAction(){\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$empresa = $em->getRepository('TheClickCmsAdminBundle:Empresa')->findAll();\n\t\treturn $this->render('TheClickCmsAdminBundle:Default:listarEmpresa.html.twig', array('empresa'=>$empresa));\n\t}", "public function index() ...
[ "0.82047457", "0.79527676", "0.77405864", "0.7654195", "0.7634281", "0.75161654", "0.7505651", "0.7498285", "0.7468509", "0.7456744", "0.7456663", "0.7446925", "0.74365944", "0.7429184", "0.7425572", "0.74211955", "0.7420418", "0.7413812", "0.7408268", "0.7379443", "0.7360265...
0.0
-1
Show the form for creating a new resource. GET /empresas/create
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('empresas.create');\n }", "public function create()\n {\n return view('empresas.create');\n }", "public function create()\n {\n return view('empresa.form_new_empresa')->with('empresas', Empresa::all());\n }", "public function c...
[ "0.81449986", "0.81449986", "0.8069328", "0.79632115", "0.78702873", "0.7846737", "0.7836126", "0.77867967", "0.7776333", "0.76915914", "0.7689062", "0.76819474", "0.7662705", "0.7656674", "0.7650138", "0.76486367", "0.7644539", "0.76156205", "0.7587556", "0.7581524", "0.7581...
0.0
-1
Store a newly created resource in storage. POST /empresas
public function store() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",...
[ "0.71722144", "0.698295", "0.6935045", "0.68464124", "0.6822943", "0.6740656", "0.6710758", "0.6699495", "0.6691652", "0.6690884", "0.6666095", "0.6642097", "0.66355145", "0.66001856", "0.65923023", "0.65900797", "0.6582649", "0.65805125", "0.65796894", "0.655714", "0.6556684...
0.0
-1
caso: cargarAlumno (post): Se deben guardar los siguientes datos: nombre, apellido, email y foto. Los datos se guardan en el archivo de texto alumnos.txt, tomando el email como identificador.
public static function cargarAlumno() { throw new Exception('No implementado aun '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarDatostxt(){\n // Si no existe lo creo\n $tabla=[]; \n if (!is_readable(FILEUSER) ){\n // El directorio donde se crea tiene que tener permisos adecuados\n $fich = @fopen(FILEUSER,\"w\") or die (\"Error al crear el fichero.\");\n fclose($fich);\n }\n $fich = @fopen(...
[ "0.6084217", "0.5927711", "0.5755315", "0.56801736", "0.56752354", "0.56591696", "0.5650602", "0.56040895", "0.56008196", "0.5588999", "0.5584097", "0.5556028", "0.5499985", "0.54826623", "0.5468537", "0.54244405", "0.54075575", "0.5399108", "0.53829056", "0.5375976", "0.5365...
0.6596407
0
8 (2 pts.) caso: alumnos (get): Mostrar una tabla con todos los datos de los alumnos, incluida la foto
public static function alumnos() { throw new Exception('No implementado aun '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.',...
[ "0.72418475", "0.7235908", "0.694395", "0.69120544", "0.68950534", "0.67887986", "0.67784363", "0.6766625", "0.6729326", "0.67208844", "0.6685837", "0.66822815", "0.6668384", "0.6606771", "0.65960425", "0.6582163", "0.65616286", "0.6558404", "0.6539995", "0.65205604", "0.6512...
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "pu...
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315...
0.0
-1
Execute the console command.
public function handle() { // for($i=0;$i<10;$i++){ file_put_contents('./updatePic.sh', '#!/bin/bash'.PHP_EOL, FILE_APPEND); $vuls = Vul::select('id','description')->skip(0)->take(10)->get(); foreach($vuls as $val){ // 抓取图片地址 preg_match_all('/<img[^>]*src=[\'"]?([^>\'"\s]*)[\'"]?[^>]*>/i',$val->description, $match); if(!empty($match[1])){ // 原始内容 // Log::info($val->description); foreach($match[1] as $k => $v){ $dirName = pathinfo($v)['dirname']; if($dirName != '/upload'){ continue; } // 初始替换内容 $replace[0] = $val->description; // 图片新地址内容 $newUrl = '已经删除'; // 替换的地址内容 $replaceUrl = pathinfo($v)['filename']; // 后缀 $extension = pathinfo($v)['extension'] ?? ''; // 赋值新替换内容 $replace[$k+1] = str_replace($replaceUrl,$newUrl,$replace[$k]); // 数据库新内容 $newDesc = $replace[$k+1]; $root = '/var/www'; // 编写shell脚本代码 $shell = 'mv '.$root.$v.' '.$root.'/upload/'.$newUrl.'.'.$extension; file_put_contents('./updatePic.sh', $shell.PHP_EOL, FILE_APPEND); } Vul::where('id',$val->id)->update(['description' => $newDesc]); } } // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() meth...
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.614841...
0.0
-1
Makes a request to the Yelp API and returns the response
function request($host, $path, $url_params = array()) { // Send Yelp API Call try { $curl = curl_init(); if (FALSE === $curl) throw new Exception('Failed to initialize'); $url = $host . $path . "?" . http_build_query($url_params); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, // Capture response. CURLOPT_ENCODING => "", // Accept gzip/deflate/whatever. CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => array( "authorization: Bearer " . $GLOBALS['API_KEY'], "cache-control: no-cache", ), )); $response = curl_exec($curl); if (FALSE === $response) throw new Exception(curl_error($curl), curl_errno($curl)); $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE); if (200 != $http_status) throw new Exception($response, $http_status); curl_close($curl); } catch(Exception $e) { trigger_error(sprintf( 'Curl failed with error #%d: %s', $e->getCode(), $e->getMessage()), E_USER_ERROR); } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function request($host, $path, $url_params = array()) {\n // Send Yelp API Call\n try {\n $curl = curl_init();\n if (FALSE === $curl)\n throw new Exception('Failed to initialize');\n $url = $host . $path . \"?\" . http_build_query($url_params);\n curl_setopt_array($curl...
[ "0.74889237", "0.74889237", "0.686563", "0.686298", "0.6639055", "0.65955085", "0.6579902", "0.6563045", "0.57659435", "0.5711262", "0.5644098", "0.5632624", "0.56119317", "0.5601516", "0.55937666", "0.55753005", "0.5567959", "0.54855937", "0.54855937", "0.54798555", "0.54525...
0.6908324
2
Query the Search API by a search term and location
function search($term, $location) { $url_params = array(); $url_params['term'] = $term; $url_params['location'] = $location; $url_params['limit'] = $GLOBALS['SEARCH_LIMIT']; return request($GLOBALS['API_HOST'], $GLOBALS['SEARCH_PATH'], $url_params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search($term, $location, $price, $radius, $categories, $sort) {\n $url_params = array();\n \n $url_params['term'] = $term;\n $url_params['location'] = $location;\n $url_params['limit'] = $GLOBALS['SEARCH_LIMIT'];\n\t$url_params['open_now'] = true;\n $url_params['price'] = $price;\n $u...
[ "0.7596438", "0.74730897", "0.7405362", "0.7267051", "0.716777", "0.7147625", "0.6984506", "0.69432247", "0.6934082", "0.68978876", "0.6779909", "0.67794234", "0.6776836", "0.67475784", "0.67475784", "0.67432684", "0.67276835", "0.6668217", "0.6656132", "0.6567901", "0.655249...
0.7809321
0
Query the Business API by business_id
function get_business($business_id) { $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id); return request($GLOBALS['API_HOST'], $business_path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_business($bearer_token, $business_id) {\n $business_path = $GLOBALS['BUSINESS_PATH'] . urlencode($business_id);\n \n return request($GLOBALS['API_HOST'], $business_path);\n}", "function GetBusiness($businessId)\n\t{\n\t\t$result = $this->sendRequest(\"GetBusiness\", array(\"BusinessId\"=>$b...
[ "0.72874045", "0.68762845", "0.6643683", "0.6613496", "0.64544404", "0.64544404", "0.64544404", "0.64544404", "0.64544404", "0.64386517", "0.6426751", "0.63784474", "0.6187909", "0.61160827", "0.60744554", "0.60321623", "0.60273176", "0.602034", "0.602034", "0.602034", "0.602...
0.7619095
0
Queries the API by the input values from the user
function query_api($term, $location) { $response = json_decode(search($term, $location)); $business_id = $response->businesses[0]->id; /* print sprintf( "%d local businesses found, querying business info for the top result \"%s\"\n\n <br>", count($response->businesses), $business_id ); */ $response = get_business($business_id); print sprintf("Result for business \"%s\" found:\n", $business_id); $pretty_response = json_encode(json_decode($response), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); print "$pretty_response\n"; return json_decode($response, true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function query();", "public function query();", "public function query();", "function query() {}", "public static function query();", "public function api()\n {\n $input = request('q');\n $tags = Tag::where('name', 'like', $input.'%')\n ->orWhere('name', 'like', '% '.$i...
[ "0.64938456", "0.64938456", "0.64938456", "0.64637804", "0.640242", "0.63288033", "0.62497175", "0.6249559", "0.6157252", "0.6130731", "0.61106855", "0.605952", "0.6013136", "0.5933537", "0.5907476", "0.5890098", "0.5890098", "0.5888156", "0.5880076", "0.5814138", "0.58113563...
0.55975163
52
Display a listing of the resource.
public function index() { $tickets = Ticket::all(); return view('bookTicket.index', compact('tickets')); }
{ "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.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236"...
0.0
-1
Show the form for booking Ticket.
public function bookTicket() { $data = Session::get('key'); $data1 = Session::get('key2'); $date2 = Session::get('key3'); $vehicleTypeS = Session::get('key4'); $destination = DB::table('destinations')->where('name','=',$data1)->value('image'); $routes = Route::where([ ['start_point', '=', $data], ['end_point', '=', $data1], ])->get(); $vehicleType = VehicleType::where([ ['id', '=', $vehicleTypeS], ])->get(); $vehicle = Vehicle::all(); return view('bookTicket.bookTicket', compact('routes', 'vehicleType','vehicle','date2','destination')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return view('web::ticket.create');\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function show(Ticket $ticket)\n {\n //\n }", "public function actionT...
[ "0.6544749", "0.651681", "0.651681", "0.651681", "0.64884603", "0.6481216", "0.6451668", "0.64319694", "0.6431062", "0.6410291", "0.64017427", "0.63991034", "0.6385517", "0.63621414", "0.63358593", "0.63241243", "0.6256744", "0.62531203", "0.62531203", "0.62531203", "0.625312...
0.5887283
57
Checks for the trips.
public function checkTicket(Request $request) { $booking = $request->input('booking_date'); $route = +$request->input('route'); $vehicleType = +$request->input('vehicleType'); $trips = Trip::where([ ['departure_date', '=', $booking], ['route_id', '=', $route], ])->get(); $listTickets = []; foreach ($trips as $trip) { if ($trip->vehicle->vehicleType_id == $vehicleType && $trip->available_seats>0) { $trip['row'] = $trip->vehicle->vehicleType->row; $trip['column'] = $trip->vehicle->vehicleType->column; array_push($listTickets, $trip); } } $data = [ 'listTickets' => $listTickets ]; return response()->json($data, 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkTrips($numbers) {\n\t//TODO: Tjek om der er \"trips\"\n}", "function validToppings($toppings)\n {\n $validToppings = array(\"pepperoni\", \"sausage\",\n \"olives\", \"artichokes\", \"anchovies\");\n\n\t\t// heck each selected topping, and return false\n\t\t// f...
[ "0.698763", "0.58463544", "0.5815626", "0.56375796", "0.56302553", "0.55192226", "0.54502255", "0.53759956", "0.5370381", "0.5329895", "0.53021336", "0.52788687", "0.52520674", "0.52488613", "0.5236402", "0.5209407", "0.5209046", "0.51787055", "0.51304865", "0.51292115", "0.5...
0.0
-1
Checks for the available destination.
public function store(Request $request) { $trip = Trip::find($request->input('trip')); $new_allocated_seat = array_sum($request->input('new_allocated_seats')); $this->validate($request, [ 'trip' => 'required', ]); $request->validate([ 'name' => 'required', 'phoneNumber' => 'required' ]); $ticket = new Ticket(); $ticket->trip_id = $request->input('trip'); $ticket->trip_type = Session::get('key5'); $ticket->return_date = Session::get('key6'); $ticket->no_of_passenger = $new_allocated_seat; if($ticket->trip_type === 'Round Trip') { $ticket->amount = 2 * ($trip->price * $new_allocated_seat); }else{ $ticket->amount = $trip->price * $new_allocated_seat; } $ticket->allocated_seats = $request->input('new_allocated_seats'); $trip->allocated_seats = $request->input('all_allocated_seats'); $trip->available_seats = $trip->available_seats - $new_allocated_seat; if (Auth::check()) { $id = Auth::user()->id; $userDetails = DB::table('users') ->select('email','firstName','lastName', 'phoneNumber') ->where('id','=', $id)->first(); $ticket->user_id = $id; $ticket->email = $userDetails->email; $trip->save(); $count = count((is_countable($request->name)?$request->name:[])); for ($i=0; $i < $count; $i++) { $ticket->name = json_encode($request->name); $ticket->phoneNumber = json_encode($request->phoneNumber); $ticket->save(); } $bookMessage = [ 'title' => 'Booking Confirmation', 'body' => 'Your ticket has been booked.' ]; $pdf = PDF::loadView('ticket',['ticket'=>$ticket]); $message = new SendMail($bookMessage); $message->attachData($pdf->output(), "ticket.pdf"); Mail::to($userDetails->email)->send($message); return redirect()->back()->withSuccessMessage("Your ticket has been booked. Please check your mail."); }else{ Session::put('book', $ticket); return redirect()->route('login'); } Session::forget('book'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function destinationNotGiven()\n {\n return empty($this->destination);\n }", "function custom_rules_is_destination_set(){\n\treturn isset( $_GET['destination'] );\n}", "protected function _hasDestinationAddress()\n {\n $hasDestinationAddress = false;\n if ($this->_request->...
[ "0.7306294", "0.6593073", "0.617597", "0.60095084", "0.5955571", "0.59461564", "0.59461564", "0.59461564", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", "0.5944792", ...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $ticket = Ticket::find($id)->delete(); return redirect('/tickets')->with('status','Deleted Successfully'); }
{ "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
Define the different element to load when user is located on correctiv action
function includes_recommandation_category_boxes($idElement, $chargement = 'tout'){ if($chargement == 'tout'){ require_once(EVA_METABOXES_PLUGIN_DIR . 'recommandation/recommandation_category/category_edition.php'); if(((int)$idElement) != 0){ require_once(EVA_METABOXES_PLUGIN_DIR . 'galeriePhotos/galeriePhotos.php'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function load_login_box(){\n\t\t$element = Element::type('elementLogin');\n\t\t$element->build('login');\n\t\tRender::Singleton()->render_html(Content::Singleton()->build());\n\t}", "function form_init_elements()\r\n {\r\n $this->add_hidden_element(\"swimmeetid\") ;\r\n\r\n // This is u...
[ "0.5787616", "0.5640093", "0.56260103", "0.5572934", "0.55317736", "0.540771", "0.540543", "0.538836", "0.538836", "0.53857136", "0.53759474", "0.53724676", "0.536726", "0.53662145", "0.5327044", "0.5326408", "0.53218216", "0.52974224", "0.52845395", "0.5280867", "0.52798104"...
0.0
-1
Get the existing recommandation category list
function getCategoryRecommandationList(){ global $wpdb; $query = $wpdb->prepare( "SELECT RECOMMANDATION_CAT.*, PIC.photo FROM " . TABLE_CATEGORIE_PRECONISATION . " AS RECOMMANDATION_CAT LEFT JOIN " . TABLE_PHOTO_LIAISON . " AS LINK_ELT_PIC ON ((LINK_ELT_PIC.idElement = RECOMMANDATION_CAT.id) AND (tableElement = '" . TABLE_CATEGORIE_PRECONISATION . "') AND (LINK_ELT_PIC.isMainPicture = 'yes')) LEFT JOIN " . TABLE_PHOTO . " AS PIC ON ((PIC.id = LINK_ELT_PIC.idPhoto)) WHERE RECOMMANDATION_CAT.status = 'valid' GROUP BY RECOMMANDATION_CAT.id", ""); $CategoryRecommandationList = $wpdb->get_results($query); return $CategoryRecommandationList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategories();", "public function getCategories();", "public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}", "public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->g...
[ "0.7073164", "0.7073164", "0.70191187", "0.6952801", "0.6952469", "0.6925243", "0.69237745", "0.691156", "0.6873652", "0.68731844", "0.68014926", "0.6720509", "0.67117107", "0.6695676", "0.6695676", "0.6617632", "0.66162014", "0.66094625", "0.65975153", "0.65836245", "0.65781...
0.76744723
0
Get a specific recommandation category
function getCategoryRecommandation($categoryRecommandationId) { global $wpdb; $query = $wpdb->prepare( "SELECT * FROM " . TABLE_CATEGORIE_PRECONISATION . " WHERE id = %d ", $categoryRecommandationId); return $wpdb->get_row($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCategory() {}", "public function getCategory();", "public function getCategory();", "public function category() {\n\t\treturn $this->get_category();\n\t}", "function the_category() {\n\tglobal $discussion;\n\treturn $discussion['category'];\n}", "function get_Category()\n {\n ...
[ "0.72546226", "0.72053415", "0.72053415", "0.7106401", "0.7034859", "0.69191504", "0.68381095", "0.68334365", "0.6826384", "0.679256", "0.67592597", "0.67592597", "0.6756792", "0.67390704", "0.66927695", "0.66927695", "0.66927695", "0.6691882", "0.6691882", "0.6691882", "0.66...
0.6591083
42
Save a new recommandation category in database
function saveRecommandationCategory($categoryRecommandationInformations) { global $wpdb; foreach($categoryRecommandationInformations as $field => $value) { if ($field != 'id') { $category_recommandation_query_args[ $field ] = $value; } } $category_recommandation_query = $wpdb->insert( TABLE_CATEGORIE_PRECONISATION, $category_recommandation_query_args ); if ( false !== $category_recommandation_query ) { $reponseRequete = 'done'; } else { $reponseRequete = 'error'; } return $reponseRequete; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function save() {\n\t\tglobal $wpdb;\n\t\t//Build Query\n\t\t$types = array(\"%s\",\"%s\");\n\t\tif(empty($this->category_id)) { //New Category\n\t\t\t$wpdb->insert(FAQBUILDDBCATEGORY,$this->toArray(true),$types); //Insert the this faq build category object into the database\n\t\t\t$this->category_id = $wpd...
[ "0.74469036", "0.6996446", "0.6980692", "0.69458544", "0.6726044", "0.66984886", "0.6667092", "0.66258717", "0.6617788", "0.6565813", "0.65211123", "0.65144056", "0.6490442", "0.64152396", "0.640383", "0.63943696", "0.6382432", "0.63762635", "0.6367661", "0.63303924", "0.6320...
0.6869781
4
Update an existing recommandation category in database
function updateRecommandationCategory($categoryRecommandationInformations, $id) { global $wpdb; $reponseRequete = ''; foreach($categoryRecommandationInformations as $field => $value) { if ($field != 'id') { $categoryRecommandation_query_args[ $field ] = $value; } } $category_recommandation_query = $wpdb->update( TABLE_CATEGORIE_PRECONISATION, $categoryRecommandation_query_args, array( 'id' => $id, ) ); if ( false !== $category_recommandation_query ) { $reponseRequete = 'done'; } elseif( $category_recommandation_query == 0 ){ $reponseRequete = 'nothingToUpdate'; } else { $reponseRequete = 'error'; } return $reponseRequete; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateCategory()\n {\n Category::findOrFail($this->category_id)->update([\n 'category_name' => $this->categoryName,\n 'slug' => Str::slug($this->categoryName),\n 'class' => $this->class,\n\n ]);\n }", "function update_category($category_id)...
[ "0.7380183", "0.67156273", "0.6685532", "0.664608", "0.6553447", "0.6522696", "0.65121937", "0.6486996", "0.6466222", "0.63781554", "0.6358192", "0.6355614", "0.6352818", "0.6349003", "0.631522", "0.6309351", "0.63021076", "0.6298562", "0.62837034", "0.6257291", "0.6237301", ...
0.593654
72