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
Create a new controller instance.
public function __construct() { $this->middleware('guest')->except('logout'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this-...
[ "0.82678324", "0.8173564", "0.78118384", "0.7706353", "0.76816905", "0.7659159", "0.74858105", "0.7406485", "0.7298472", "0.7253435", "0.7196091", "0.7174443", "0.7016074", "0.6989523", "0.69837826", "0.69728553", "0.69640046", "0.69357765", "0.6897687", "0.689282", "0.687757...
0.0
-1
Show the application's login form.
public function showLoginForm(Request $request) { $data = []; if (($company_name = $request->company) != null) { // Search company name from api $response = Http::get(env('API_URL') . '/api/v1/company?name=' . $company_name); $body = collect(json_decode($response->body(), true)); $data['company'] = $body; $data['title'] = $body->isEmpty() ? null : $body['name']; } return view('auth.login', compact('data')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showLogin()\n\t{\n\t\t// show the form\n\t \treturn View::make('login');\n\t}", "private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}", "public function showLoginForm()\n\t{\n\t\treturn view('auth.login');\n\t}", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle...
[ "0.8195479", "0.8184714", "0.81353784", "0.8114367", "0.8106355", "0.8087322", "0.80029774", "0.79896617", "0.7967813", "0.79508567", "0.79352325", "0.7924134", "0.7901801", "0.78818923", "0.78473926", "0.7842989", "0.78256094", "0.7800776", "0.77962434", "0.7777558", "0.7777...
0.0
-1
Handle a login request to the application.
public function login(Request $request) { // Validate the input $this->validateLogin($request); // Check the employee user from API $response = Http::post(env('API_URL', 'http://localhost:8000') . '/api/v2/auth/login-employee', $request->all()); $res = json_decode($response->body()); // Return error if unathorized if ($error = $res->error ?? false) return back() ->withInput($request->only('email')) ->withErrors($error); // Return response and pass token to cookie return redirect(route('admin.home')) ->with('message', 'Login Success') ->withCookie(cookie('token', $res->access_token, $res->expires_in)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handleLogin( ){\n\t\t// Filter allowed data\n\t\t$data = Request::only([ 'uid', 'password' ]);\n\n\t\t// Validate user input\n\t\t$validator = Validator::make(\n\t\t\t$data,\n\t\t\t[\n\t\t\t\t'uid' => 'required',\n\t\t\t\t'password' => 'required',\n\t\t\t]\n\t\t);\n\n\t\tforeach ($data as $key => $...
[ "0.7669814", "0.74851155", "0.7442612", "0.72329086", "0.7112905", "0.7103887", "0.70698494", "0.7055757", "0.7029516", "0.6985367", "0.6953118", "0.69134593", "0.6885101", "0.687445", "0.6863917", "0.6856037", "0.6848747", "0.684784", "0.68152297", "0.680864", "0.68045515", ...
0.0
-1
Validate the user login request.
protected function validateLogin(Request $request) { $request->validate([ 'email' => 'required|email', 'password' => 'required|string', ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function validateUserInput() {\n\t\ttry {\n\t\t\t$this->clientUserName = $this->loginObserver->getClientUserName();\n\t\t\t$this->clientPassword = $this->loginObserver->getClientPassword();\n\t\t\t$this->loginModel->validateForm($this->clientUserName, $this->clientPassword);\n\t\t} catch (\\Exception $e) {...
[ "0.7622457", "0.7453561", "0.7278054", "0.71804565", "0.71156424", "0.7111837", "0.70604134", "0.7052839", "0.7021818", "0.6997903", "0.6982885", "0.69527507", "0.6948303", "0.6904977", "0.6901899", "0.6900965", "0.6874296", "0.6829219", "0.6827034", "0.6818194", "0.6799991",...
0.6821922
19
Log the user out of the application.
public function logout(Request $request) { \JWTAuth::invalidate(\JWTAuth::getToken()); return response()->redirectTo(route('login'))->withCookie(cookie('token', null)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function logOut()\n {\n $auth = new AuthenticationService();\n\n if ($auth->hasIdentity()) {\n Session::getDefaultManager()->forgetMe();\n $auth->clearIdentity();\n }\n }", "public function logout(){\n $this->_user->logout();\n }", "public funct...
[ "0.81054616", "0.80752707", "0.8000615", "0.7991024", "0.7948384", "0.79437894", "0.7929018", "0.7915369", "0.7901668", "0.7900809", "0.78969693", "0.78848284", "0.7882785", "0.7878474", "0.78774774", "0.78710175", "0.7867032", "0.78648615", "0.7862948", "0.78546697", "0.7824...
0.0
-1
Lists all Usuario models.
public function actionIndex() { $searchModel = new UsuarioQuery(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAll()\n {\n $usuario = new Usuario();\n return $usuario->getAll();\n }", "public function listarUsuarios()\n {\n $usuarios = Usuarios::all();\n\n return $usuarios;\n }", "public function index()\n {\n $usuarios = dev_Usuario::get();\n return $...
[ "0.77066934", "0.76774323", "0.76732635", "0.7637443", "0.7613845", "0.76040816", "0.76040816", "0.75722086", "0.74828774", "0.7481354", "0.74706364", "0.74706364", "0.7373371", "0.73660296", "0.73294806", "0.732635", "0.7310403", "0.7310403", "0.7310403", "0.7310403", "0.731...
0.7597279
7
Displays a single Usuario model.
public function actionView($id) { return $this->render('view', [ 'model' => $this->findModel($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show() {\r\n\t\t$this->db->connect();\r\n\t\t$this->conn = $this->db->conn();\r\n\r\n\t\t$usuario = new Usuario();\r\n\t\t$usuario->obtener_datos($this->conn);\r\n\t}", "public function actionIndex()\n {\n $searchModel = new UsuarioQuery();\n $dataProvider = $searchModel->search(...
[ "0.74800897", "0.72684556", "0.7225452", "0.7225452", "0.7188013", "0.7188013", "0.7188013", "0.7188013", "0.7188013", "0.7188013", "0.7175951", "0.716528", "0.7163224", "0.7108557", "0.71032387", "0.70725024", "0.70574206", "0.7044582", "0.7032509", "0.70246255", "0.7000943"...
0.0
-1
Creates a new Usuario model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionCreate() { $model = new Usuario(); $model->generatePasswordResetToken(); var_dump(Yii::$app->request->post()); if ($model->load(Yii::$app->request->post())) { $model->setDesactiveStatus(); var_dump($model);die(); //enviar por email $model->save(); $this->sendEmail($model->email, 'novo_usuario', 'Acesso Site Jtecncologia' ); return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('_form', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n if(Permiso::requerirRol('administrador')){\n $this->layout='/main2';\n }\n $mensaje=\"\";\n $model = new Usuario();\n if ($model->load(Yii::$app->request->post())){\n if(!$model1=Usuario::find(['$model->dniUsuario'])->...
[ "0.805618", "0.7903013", "0.77700686", "0.7714941", "0.77109426", "0.77109426", "0.77109426", "0.77109426", "0.764009", "0.76082253", "0.7488276", "0.74761206", "0.746963", "0.7460957", "0.7417892", "0.74174964", "0.7413602", "0.73994124", "0.73992586", "0.73992586", "0.73857...
0.70367074
51
Updates an existing Usuario 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()) && $model->save()) { //enviar por email //$this->sendEmail($model->email, 'novo_usuario', 'Acesso Site Jtecncologia' ); return $this->redirect(['view', 'id' => $model->id]); } else { return $this->render('_form', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionUpdate()\n\t{\n\t if (!Yii::app()->user->checkAccess('admin')){\n\t\t\treturn $this->actionView();\n\t }\n\t\t$this->model = DrcUser::loadModel();\n\t\tif($this->model===null)\n\t\t\tthrow new CHttpException(404,'The requested user does not exist.');\n\t\t$this->renderView(array(\n\t\t\...
[ "0.7221589", "0.71071494", "0.7008238", "0.69234675", "0.6844227", "0.68101716", "0.68090343", "0.68066967", "0.6793148", "0.67895466", "0.6785932", "0.67814046", "0.67535985", "0.67277175", "0.6708714", "0.67006654", "0.6676026", "0.66720575", "0.66500825", "0.6647216", "0.6...
0.0
-1
Deletes an existing Usuario 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 $model = new \\UsersModel();\n $login = $this->getParam('login');\n\n if ( $model->delete($login) ) {\n $this->flashMessage('Odstraněno', self::FLASH_GREEN);\n } else {\n $this->flashMessage('Záznam nelze odstranit', self::FLASH_RED);\n }\...
[ "0.7883321", "0.7682309", "0.71821237", "0.69818664", "0.6918767", "0.6871515", "0.6868601", "0.6841783", "0.68101734", "0.6791641", "0.6779311", "0.6770615", "0.67352986", "0.67352915", "0.6711495", "0.6655473", "0.66497463", "0.6640478", "0.6639956", "0.6638694", "0.6632971...
0.0
-1
Finds the Usuario 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 = Usuario::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function findModel($id)\n {\n if (($model = Usuario::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Usuario::model()->...
[ "0.6874317", "0.67826295", "0.6736697", "0.6736697", "0.6732279", "0.6666562", "0.65707326", "0.65550834", "0.6554187", "0.6501946", "0.64253366", "0.64116424", "0.63947654", "0.63947654", "0.63369626", "0.6332519", "0.6292744", "0.62902343", "0.6283351", "0.62700623", "0.626...
0.6830743
1
Editar sua propria senha.
public function actionEditarSenha() { //$model = new UserMudarSenha; $old_model = Usuario::findOne(Yii::$app->user->identity->id); $model = UserMudarSenha::findOne(Yii::$app->user->identity->id); if (!$model) throw new NotFoundHttpException('Ocorre algum erro, Favor entrar em contato com o administrador'); if ($model->load(Yii::$app->request->post())) { //enviar por email if(md5($model->password_hash) === $old_model->password_hash){ if($model->new_password_hash === $model->confirm_password){ $model->password_hash = md5($model->new_password_hash); //$model->password_reset_token = "CONFIRMADO"; $model->status = $model::STATUS_ACTIVE; $model->save(); //enviar email; Yii::$app->user->logout(); return $this->redirect([Url::to("/login")]); }else{ $model->addError('confirm_password', 'Esse campo tem que ser igual ao de Nova Senha.'); } }else{ $model->addError('password_hash', 'Senha Inválida.'); } } $model->password_hash = ""; return $this->render('_form_mudar_senha', [ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function alterarSenhaAction() {\n \n $formSenha = new Form_Salao_Senha();\n $formSenha->submit->setLabel(\"Alterar Senha\");\n $this->view->form = $formSenha;\n \n if ($this->getRequest()->isPost() && $formSenha->isValid($this->getRequest()->getPost())) {\n ...
[ "0.66360825", "0.6490196", "0.6450639", "0.6252202", "0.61544836", "0.6125288", "0.60919785", "0.60858095", "0.60736513", "0.60714376", "0.6063007", "0.6052177", "0.60443187", "0.6033885", "0.60305", "0.600271", "0.5979491", "0.5942272", "0.5941023", "0.5918715", "0.58939207"...
0.6041648
13
Sends an email to the specified email address using the information collected by this model.
public function sendEmail($email, $path_html, $subject ) { return Yii::$app->mailer->compose(['html' => 'usuario/'.$path_html.'.php'], ['model' => $this]) ->setTo($email) ->setFrom('lucas@jsolucoesti.com.br') ->setSubject($subject) // ->setTextBody($body) ->send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }", "public function sendEmail()\n\t{\n\t\tif (empty($this->get('crmid'))) {\n\t\t\treturn;\n\t\t}\n\t\t$moduleName = 'Contacts';\n\t\t$rec...
[ "0.6980083", "0.6868115", "0.6823123", "0.6794151", "0.6790995", "0.6771945", "0.66886663", "0.65806884", "0.65520245", "0.649606", "0.64859414", "0.6475329", "0.64179444", "0.6411858", "0.63914424", "0.6356509", "0.6312032", "0.6310046", "0.6306721", "0.6276842", "0.62586063...
0.0
-1
Run the database seeds.
public function run() { $accounts = [ ['account_name' => 'SUDUT NEGERI', 'account_number' => '12 90 7 36 592', 'bank_address' => 'Tembalang'], ['account_name' => 'SUDUT NEGERI', 'account_number' => '19 30 8 92 001', 'bank_address' => 'Tembalang'], ['account_name' => 'SUDUT NEGERI', 'account_number' => '98 87 6 412', 'bank_address' => 'Tembalang'], ['account_name' => 'SUDUT NEGERI', 'account_number' => '88 71 6 192', 'bank_address' => 'Tembalang'], ]; foreach($accounts as $a){ DB::table('bank_accounts')->insert($a); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Generate SQL to enumerate the records of an entity, returning the resulting rows and related pagination data.
function enumerate($params, $set_vars=false) { // move the list parameters into the local namespace // (from,exprs,gexprs,select,where,group_by,having,order,limit) extract($params, EXTR_OVERWRITE); assert_type($exprs, 'array'); assert_type($gexprs, 'array'); foreach($exprs as $k=>$v) $select .= ",$v \"$k\""; foreach($gexprs as $k=>$v) $select .= ",$v \"$k\""; // if $params[select] was empty, then we have a leading comma... if(substr($select, 0, 1) == ',') $select = substr($select, 1); // Build WHERE/HAVING clauses from list params and // criteria sent from the browser list($w_sql,$w_args,$h_sql,$h_args) = $this->filter($exprs, $gexprs); // WHERE if(is_array($where)) { foreach($where as $v) $w_sql .= " AND ($v)"; } else if(!empty($where)) { $w_sql .= " AND ($where)"; } // backwards compatibility if(!empty($where_args)) $w_args = array_merge($w_args, $where_args); // HAVING if(is_array($having)) { foreach($having as $v) $h_sql .= " AND ($v)"; } else if(!empty($having)) { $h_sql .= " AND ($having)"; } // Merge all SQL args if necessary ($h_args could be empty) $args = empty($h_args) ? $w_args : array_merge($w_args, $h_args); // ORDER/LIMIT $sort_sql = $this->sort($order, $exprs); $page_sql = $this->paginate($limit); // Get data rows if($this->db->type == 'mysql') $select = "SQL_CALC_FOUND_ROWS $select"; $sql = $this->db->build_sql($select, $from, $w_sql, $group_by, $h_sql, $sort_sql, $page_sql); $data = $this->db->get_all($sql, $args); // Count all matching rows if($this->db->type == 'mysql') { $ttlrows = $this->db->get_value("SELECT FOUND_ROWS()"); } else { $ttlrows = $this->db->get_value($this->db->build_sql("COUNT(*)", $from, $w_sql, $group_by, $h_sql), $args); } if($set_vars) { $this->page->template->set('data', $data); $this->page->template->set('totalrows', $ttlrows); $this->page->template->set('curpage', $this->page->param('p_p', 1)); $this->page->template->set('perpage', $this->page->param('p_pp', $limit)); } // data, total rows, current page, per page return array($data, $ttlrows, $this->page->param('p_p', 1), $this->page->param('p_pp', $limit)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPagedStatement($sql,$page,$items_per_page);", "public function showEntities()\n {\n return Entity::paginate(10);\n }", "protected function displayEntityData()\n {\n\n $this->_query = str_replace(\"\\'\", \"'\", $this->_query);\n $queryToRun = $this->_query;\n $p...
[ "0.5801884", "0.5767462", "0.55644304", "0.5505091", "0.54912215", "0.5443768", "0.5443768", "0.5405545", "0.54036593", "0.5310976", "0.53084445", "0.52939993", "0.52585465", "0.5236381", "0.52038413", "0.5203297", "0.5190925", "0.5168091", "0.51562476", "0.5155259", "0.51439...
0.0
-1
Generate SQL to filter a result set based on filter variables in _REQUEST. This can generate SQL that can be used in a WHERE or HAVING clause.
function filter($exprs=array(), $gexprs=array()) { $where = array('sql'=>array(), 'args'=>array()); $having = array('sql'=>array(), 'args'=>array()); foreach($_REQUEST as $k=>$v) { $args = array(); $sql = array(); if($v === '') continue; if(!preg_match('|^f_[dts]_|', $k)) continue; $t = substr($k, 2, 1); $k = substr($k, 4); // only alphanumerics allowed if(!preg_match('|^[A-z0-9_-]+$|', $k)) continue; switch($t) { case 'd': $coltype = 'date'; break; case 's': $coltype = 'select'; break; case 't': default: $coltype = 'text'; } // look for an expression passed to the function first -- this is // used for trickier SQL expressions, eg, functions if(isset($exprs[$k])) { $s = $exprs[$k]; $t = 'where'; } else if(isset($gexprs[$k])) { $s = $gexprs[$k]; $t = 'having'; } else { // use the literal column name $s = "\"$k\""; $t = 'where'; } $range = explode('<>', $v); if(count($range) == 2) { // double-bounded range $sql[] = "($s>='%s' AND $s<='%s')"; $args[] = $range[0]; $args[] = $range[1]; } else if(strlen($v) == 1) { // no range (explicit) // FYI: this check is needed, as the "else" block assumes // a string length of at least 2 $sql[] = is_numeric($v) ? "$s='%s'" : "$s LIKE '%%s%'"; $args[] = $v; } else { // everything else: single-bounded range, eq, neq, like, not like $chop = 0; $like = false; switch(substr($v, 0, 1)) { case '=': // exactly equals to $s .= '='; $chop = 1; break; case '>': // greater than if(substr($v, 1, 1) == '=') { $s .= '>='; $chop = 2; } else { $s .= '>'; $chop = 1; } break; case '<': // less than if(substr($v, 1, 1) == '=') { $s .= '<='; $chop = 2; } else { $s .= '<'; $chop = 1; } break; case '!': // does not contain if(substr($v, 1, 1) == '=') { $s .= '!='; $chop = 2; } else { $s .= ' NOT LIKE '; $chop = 1; $like = true; } break; default: // contains $s .= ' LIKE '; $like = true; } $v = substr($v, $chop); if($like) { $s .= "'%%s%'"; } else { $s .= "'%s'"; } $sql[] = $s; $args[] = $v; // special handling for various filter types if($coltype == 'date' && $chop) { // don't include the default '0000-00-00' fields in ranged selections $s = isset($exprs[$k]) ? $exprs[$k] : "\"$k\""; $s .= "!='0000-00-00'"; $sql[] = $s; } } switch($t) { case 'where': $where['sql'] = array_merge($where['sql'], $sql); $where['args'] = array_merge($where['args'], $args); break; case 'having': $having['sql'] = array_merge($having['sql'], $sql); $having['args'] = array_merge($having['args'], $args); } } // ensure the WHERE clause always has something in it $where['sql'][] = '1=1'; $final = array(implode(' AND ', $where['sql']), $where['args']); if(!empty($having['sql'])) { $final[] = implode(' AND ', $having['sql']); $final[] = $having['args']; } return $final; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _create_filter_sql () {\n\t\t$SF = &$_SESSION[$this->_filter_name];\n\t\tforeach ((array)$SF as $k => $v) $SF[$k] = trim($v);\n\t\t// Generate filter for the common fileds\n\t\tif (strlen($SF[\"text\"]))\t\t$sql .= \" AND text LIKE '%\"._es($SF[\"text\"]).\"%' \\r\\n\";\n\t\tif (strlen($SF[\"engine\"]))\t...
[ "0.70355844", "0.6997376", "0.6931395", "0.65479934", "0.64781964", "0.6402908", "0.6390376", "0.6373741", "0.6337997", "0.627882", "0.62380886", "0.6219832", "0.61999625", "0.6157145", "0.61102486", "0.61058146", "0.61058146", "0.6086041", "0.60821384", "0.6051842", "0.60284...
0.6008744
22
Generate SQL to sort a result set based on sort variables in _REQUEST
function sort($default, $exprs=array()) { $cols = $sortsql = array(); $field = $this->page->param('s_f', ''); if($field) { $dir = $this->page->param('s_d', 'ASC'); $cols = array(array('field'=>$field, 'dir'=>$dir)); } else { // use the default foreach(explode(',', $default) as $pair) { $pair = trim($pair); if(empty($pair)) continue; $p = explode(' ', $pair); $cols[] = array('field'=>$p[0], 'dir'=>isset($p[1]) ? $p[1] : 'ASC'); } } foreach($cols as $c) { // look for an expression passed to the function first -- this is // used for trickier SQL expressions, like functions if(isset($exprs[$c['field']])) { $s = $exprs[$c['field']]; } else { // use the literal column name $p = explode('.', $c['field']); if(isset($p[1])) { $s = $p[0].'."'.$p[1].'"'; } else { $s = "\"{$c['field']}\""; } } $sortsql[] = "$s {$c['dir']}"; } return join(',', $sortsql); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function prepareOrderByStatement() {}", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = $this->fields_arr['orderby_field'].' '.$this->fields_arr['orderby'];\n\t\t\t}", "public function buildSortQuery()\n\t\t\t{\n\t\t\t\t$this->sql_sort = '';\n\t\t\t\t$sort = $this->fields_arr['o...
[ "0.72902894", "0.72629666", "0.69020003", "0.6849471", "0.6752859", "0.66051775", "0.6598058", "0.657085", "0.65227884", "0.6521345", "0.6516874", "0.6479244", "0.6470579", "0.64645356", "0.6464101", "0.6424167", "0.6377056", "0.6314757", "0.6292665", "0.62854314", "0.6275794...
0.0
-1
Generate SQL to paginate a result set. Also sets the "perpage" and "curpage" variables in the template.
function paginate($perpage=50) { if($perpage == 0) return ''; // zero means unlimited $page = $this->page->param('p_p', 1); $perpage = $this->page->param('p_pp', $perpage); $offset = max(0,($page-1) * $perpage); return "$perpage OFFSET $offset"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPagedStatement($sql,$page,$items_per_page);", "abstract public function preparePagination();", "private function _pagination()\n {\n\n if (Request::has('pq_curpage') && Request::has('pq_rpp')) {\n $columnsTemp = $this->_columnsRaw;\n $pq_curPage = Request::input('pq_...
[ "0.7225453", "0.7120597", "0.70750326", "0.6805313", "0.6805313", "0.673354", "0.6730588", "0.6710622", "0.66671395", "0.6661188", "0.66131544", "0.65684885", "0.6377996", "0.6354035", "0.63459057", "0.63074344", "0.6307043", "0.62715626", "0.62501186", "0.62215996", "0.61628...
0.61886704
20
Register widget with WordPress.
function __construct() { parent::__construct( 'obay_sidebar_menu_widget', // Base ID __('Menu Sidebar'), // Name array( 'description' => __('Menu Sidebar'), ) // Args ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register_widget() {\n register_widget( 'WPP_Widget' );\n }", "function wpb_load_widget()\n{\n register_widget('wpb_widget');\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "function wpb_load_widget() {\n register_widget( 'wpb_widget' );\n}", "f...
[ "0.8390025", "0.83101994", "0.82505625", "0.82505625", "0.82282835", "0.80624324", "0.79771596", "0.7901524", "0.7809308", "0.77684814", "0.77520776", "0.7727257", "0.7609239", "0.75666004", "0.75445676", "0.75443226", "0.7522003", "0.75196254", "0.75170845", "0.7512498", "0....
0.0
-1
processes widget options to be saved
function update($new_instance, $old_instance) { $instance = $old_instance; $instance['sidebar_menu'] = $new_instance['sidebar_menu']; return $instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handle_options()\r\n {\r\n $options = $this->get_options();\r\n \r\n if (isset($_POST['submitted'])) {\r\n \t\t\r\n \t\t//check security\r\n \t\tcheck_admin_referer('snazzy-nonce');\r\n \t\t\r\n ...
[ "0.69915545", "0.6716821", "0.66808283", "0.6677745", "0.66202074", "0.6602848", "0.6494906", "0.646696", "0.6403739", "0.6341822", "0.633675", "0.63270384", "0.6325295", "0.63135666", "0.6311957", "0.6301942", "0.62736166", "0.62450916", "0.62045175", "0.62020034", "0.620046...
0.0
-1
/ Before widget (defined by themes)
function widget($args, $instance) { echo $args['before_widget']; if ( has_nav_menu( $instance['sidebar_menu'] ) ) : $sidebar = array( 'theme_location' => $instance['sidebar_menu'], 'menu' => $instance['sidebar_menu'], 'walker' => new obay_sidebar_navwalker(), 'container' => false, 'items_wrap' => '<div id="obay-cssmenu"><ul>%3$s</ul></div>' ); wp_nav_menu( $sidebar ); endif; /* After widget (defined by themes). */ echo $args['after_widget']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function udesign_top_wrapper_before() {\r\n do_action('udesign_top_wrapper_before');\r\n}", "function udesign_html_before() {\r\n do_action('udesign_html_before');\r\n}", "function pre_load_widget() {\n register_widget( 'events_widget' );\n register_widget( 'fundys_widget' );\n}", "function udesi...
[ "0.71269685", "0.6990116", "0.697852", "0.6823474", "0.67799467", "0.67696595", "0.6762169", "0.66672915", "0.66640043", "0.6642193", "0.660067", "0.6595814", "0.65943813", "0.6520567", "0.65002906", "0.64750075", "0.6416324", "0.6395455", "0.6360453", "0.6345676", "0.6340109...
0.0
-1
May be altered by another class
public function setUpOnce($class) { $isAltered = false; $this->extensionsToReapply = []; $this->extensionsToRemove = []; /** @var string|SapphireTest $class */ /** @var string|DataObject $dataClass */ // Remove any illegal extensions that are present foreach ($class::getIllegalExtensions() as $dataClass => $extensions) { if (!class_exists($dataClass ?? '')) { continue; } if ($extensions === '*') { $extensions = $dataClass::get_extensions(); } foreach ($extensions as $extension) { if (!class_exists($extension ?? '') || !$dataClass::has_extension($extension)) { continue; } if (!isset($this->extensionsToReapply[$dataClass])) { $this->extensionsToReapply[$dataClass] = []; } $this->extensionsToReapply[$dataClass][] = $extension; $dataClass::remove_extension($extension); $isAltered = true; } } // Add any required extensions that aren't present foreach ($class::getRequiredExtensions() as $dataClass => $extensions) { if (!class_exists($dataClass ?? '')) { throw new LogicException("Test {$class} requires dataClass {$dataClass} which doesn't exist"); } foreach ($extensions as $extension) { $extension = Extension::get_classname_without_arguments($extension); if (!class_exists($extension ?? '')) { throw new LogicException("Test {$class} requires extension {$extension} which doesn't exist"); } if (!$dataClass::has_extension($extension)) { if (!isset($this->extensionsToRemove[$dataClass])) { $this->extensionsToRemove[$dataClass] = []; } $this->extensionsToRemove[$dataClass][] = $extension; $dataClass::add_extension($extension); $isAltered = true; } } } // clear singletons, they're caching old extension info // which is used in DatabaseAdmin->doBuild() Injector::inst()->unregisterObjects([ DataObject::class, Extension::class ]); // If we have altered the schema, but SapphireTest::setUpBeforeClass() would not otherwise // reset the schema (if there were extra objects) then force a reset if ($isAltered && empty($class::getExtraDataObjects())) { DataObject::reset(); $class::resetDBSchema(true, true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function modify();", "public function inOriginal();", "abstract public function set();", "abstract public function change();", "abstract protected function update ();", "function modified() { $this->_modified=1; }", "function modified() { $this->_modified=1; }", "protec...
[ "0.6535439", "0.649488", "0.6466413", "0.646512", "0.63473636", "0.63042283", "0.63042283", "0.62910825", "0.6284985", "0.6265124", "0.6235355", "0.6187483", "0.61641514", "0.61572814", "0.61459506", "0.61459506", "0.6112913", "0.6112913", "0.6108745", "0.60844857", "0.608026...
0.0
-1
Return a successful response with an empty body.
protected function respondNoContent() { return response()->make('', Response::HTTP_NO_CONTENT); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function emptyResponse()\n {\n return new ServerResponse(['ok' => true, 'result' => true], null);\n }", "protected function getApiEmptyResponse()\n {\n return new Response(\n '',\n 204\n );\n }", "public function responseNoContent()\n {\n ...
[ "0.78915745", "0.7642096", "0.7614399", "0.7565455", "0.73724395", "0.73673373", "0.72838503", "0.7232111", "0.7218483", "0.6968222", "0.6942818", "0.69042957", "0.68907905", "0.67168415", "0.651194", "0.6445676", "0.64230037", "0.6419969", "0.6331316", "0.63247293", "0.62488...
0.73911595
4
Check the entry data format
function examResults($marks) { if(!is_array($marks)) { echo "Entry data is not an array"; return; } $total = array_sum($marks); // If array length less than 3 if (count($marks) < 3) { echo "Insufficient data"; return; } // If array length more than 3 if (count($marks) > 3) { echo "Redundant data"; return; } // Main loop foreach ($marks as $key=>$mark) { // If the mark less than 35 if ($mark < 35) { echo "Exam failed! Total: $total :("; return; } // If the mark more than 100 if ($mark > 100) { $markNumber = ++$key; echo "The $markNumber mark is a Wrong mark!"; return; } } echo "Exam passed! Total: $total :)"; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkDataFormat(&$data)\n {\n return true;\n }", "public function checkDataFormat($data) {\n return true;\n }", "public function validEntry($data) {\n\t\t$values = array_values($data);\n\t\tif (!isset($values)) {\n\t\t\treturn false;\n\t\t}\n\t\t$value = $values[0];\n\n\t...
[ "0.67706007", "0.67585516", "0.6666151", "0.648947", "0.64673334", "0.64673334", "0.6212232", "0.6082128", "0.6078824", "0.6078689", "0.6076554", "0.6023074", "0.60123116", "0.5956871", "0.5946402", "0.5928117", "0.5926121", "0.59197646", "0.5895151", "0.58225137", "0.5758779...
0.0
-1
Set the item to highlight when the page is rendered out
function __construct($highlightItem = 'none') { $this->highlightItem = $highlightItem; //Group One $this->menuItems[0][] = ['/images/icons/envelope.png', '#', 'Admin Messages']; $this->menuItems[0][] = ['/images/icons/envelope.png', '#', 'Account Requests']; $this->menuItems[0][] = ['/images/icons/envelope.png', '#', 'Send Message']; //Group Two $this->menuItems[1][] = ['/images/icons/user.png', '/pages/admin/useradmin.php', 'User Admin']; $this->menuItems[1][] = ['/images/icons/staff-pick.png', '#', 'Product Admin']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function silo_highlights()\r\n\t{\r\n\t}", "public function silo_highlights()\n\t{\n\t}", "public function onRender()\n {\n $this->page['cssClass'] = $this->property('cssClass');\n }", "public function onRender()\n {\n $this->page['cssClass'] = $this->property('cssClass');\n\n ...
[ "0.66175944", "0.6518488", "0.58726484", "0.58433133", "0.58433133", "0.5763921", "0.57213485", "0.5694193", "0.56575364", "0.56575364", "0.55145687", "0.5392255", "0.53078914", "0.5307407", "0.5235218", "0.5213631", "0.51968914", "0.51597375", "0.50596887", "0.50484395", "0....
0.54913384
11
POST Register/user Check availability of an username
public function checkAvailability() { $name = Helper::getParam('name'); $value = Helper::getParam('value'); return $this->view->json(['available' => $this->model->checkAvailability($name, $value)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkUsernameAction() {\n\t\t\n\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\tif ($request->isPost()) {\n\t\t\t// get the json raw data\n\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t$http_raw_post_data = '';\n\t\t\t\n\t\t\twhile (!feof($handle)) {\n\t\t\t $http_raw_post_data ...
[ "0.79301965", "0.7426028", "0.74024004", "0.7343221", "0.7329237", "0.71937305", "0.71824", "0.7152603", "0.71146107", "0.7113636", "0.71005636", "0.7088958", "0.7043555", "0.70398223", "0.7034342", "0.70212704", "0.70110077", "0.69923526", "0.6980898", "0.69294745", "0.69200...
0.0
-1
Returns available tab options.
protected function getTabOptions() { $options = [ 'members' => $this->t('Members'), 'admins' => $this->t('Administrators'), ]; if (($this->currentUser->hasPermission('manage circle spaces') && $this->moduleHandler->moduleExists('living_spaces_circles')) || $this->moduleHandler->moduleExists('living_spaces_subgroup') ) { $options['inherit'] = $this->t('Inherited'); } return $options; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static function options_page_tabs() {\n $tabs = array(\n 'general' => __('Allgemein', 'fau-cris'),\n 'layout' => __('Darstellung', 'fau-cris'),\n 'sync' => __('Synchronisierung', 'fau-cris')\n );\n return $tabs;\n }", "private function get_tabs() {...
[ "0.72532773", "0.6955908", "0.68708473", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6848745", "0.6821523", "0.681229", ...
0.8225386
0
Returns tab render array based on argument.
protected function getTabContent(string $tab) { /** @var \Drupal\group\Entity\GroupInterface $group */ $group = $this->getContextValue('group'); $build = []; switch ($tab) { case 'members': $group_ids = [$group->id()]; if ($group->hasField('circles')) { $group_ids = array_merge($group_ids, array_column($group->get('circles')->getValue(), 'target_id')); } $build['members'] = $this->getMembersViewRender(implode('+', $group_ids)); $build['contact'] = $this->getContactActionsRender($group); $build['export'] = $this->getExportActionsViewRender($group); break; case 'admins': $build['members'] = $this->getMembersViewRender($group->id(), TRUE); break; case 'inherit': if ($this->moduleHandler->moduleExists('living_spaces_subgroup')) { $build['tree'] = $this->getGroupTreeRender($group); } /** @var \Drupal\group\Entity\Storage\GroupRoleStorageInterface $role_storage */ $role_storage = $this->entityTypeManager->getStorage('group_role'); $roles = $role_storage->loadByUserAndGroup($this->currentUser, $group); $current_is_admin = FALSE; foreach ($roles as $role) { if ($role->get('is_space_admin')) { $current_is_admin = TRUE; break; } } if ($this->moduleHandler->moduleExists('living_spaces_circles') && ( $current_is_admin || $this->currentUser->hasPermission('manage circle spaces') || $group->hasPermission('manage circle spaces', $this->currentUser) ) ) { $build['circle'] = $this->getCircleFormRender($group); $url = Url::fromRoute('entity.group.add_form', [ 'group_type' => 'circle', ], [ 'query' => ['space' => $group->id()], ]); $build['add_cricle'] = [ '#type' => 'link', '#url' => $url, '#title' => $this->t('Add circle'), '#attributes' => ['class' => ['btn', 'btn-primary']], ]; } break; } return $build; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function tab() {\n $args = func_get_args();\n\n if (count($args) == 0) {\n return $this->info['tab'];\n } else {\n $tab = array();\n\n if (!is_array($args[0])) {\n $tab['name'] = $args[0];\n } else {\n $tab = $args[0];\n }\n\n if (isset($args[1])) {\n ...
[ "0.71853554", "0.65441877", "0.6529235", "0.6317095", "0.6282094", "0.6192708", "0.6143254", "0.6140019", "0.6127954", "0.6118145", "0.61177593", "0.6092159", "0.6077302", "0.6038078", "0.60155636", "0.6006818", "0.59634966", "0.59149027", "0.5865436", "0.57963485", "0.579051...
0.5772797
23
Returns render array for members or admins tab.
protected function getMembersViewRender($group_id, $is_admin = FALSE) { $view = Views::getView('members'); if ($is_admin) { $view->setExposedInput([ 'is_space_admin' => '1', ]); } $view->attachment_before[] = [ '#type' => 'html_tag', '#tag' => 'h3', '#value' => $is_admin ? $this->configuration['admins_view_label'] : $this->configuration['members_view_label'], ]; return [ '#type' => 'view', '#view' => $view, '#name' => 'members', '#display_id' => 'members_by_role', '#arguments' => [$group_id], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function renderArray() {}", "public static function getAdminMenu()\n {\n return [\n 'label' => Yii::t('rbac', 'Access control'),\n 'icon' => FA::_WRENCH,\n 'order' => 6,\n 'roles' => ['rbac'],\n 'items' => [\n [\n ...
[ "0.62194455", "0.6145911", "0.59725845", "0.59725845", "0.59642017", "0.5912117", "0.5902642", "0.5897258", "0.5882684", "0.5877859", "0.5870171", "0.5862602", "0.58610046", "0.5828308", "0.5814828", "0.5804857", "0.58048046", "0.575856", "0.5755381", "0.5753162", "0.5752994"...
0.0
-1
Returns render array for contact actions on a space group.
protected function getContactActionsRender(GroupInterface $group) { $output = [ '#type' => 'container', 'title' => [ '#type' => 'html_tag', '#tag' => 'h4', '#value' => t('Contact'), '#attributes' => ['class' => ['living-space-contact-action-title']], ], ]; $hook = 'living_spaces_group_contact_info'; $account = $this->currentUser->getAccount(); $actions = $this->moduleHandler->invokeAll($hook, [FALSE, $group, $account]); if (!empty($actions)) { $output += array_intersect_key($actions, array_filter($this->configuration['enabled_contacts'])); } else { $output = []; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getExportActionsViewRender(GroupInterface $group) {\n $output = [\n '#type' => 'container',\n 'title' => [\n '#type' => 'html_tag',\n '#tag' => 'h4',\n '#value' => t('Export'),\n '#attributes' => ['class' => ['living-space-export-action-title']],\n ]...
[ "0.5938471", "0.5854643", "0.5725198", "0.55975497", "0.55420315", "0.55420315", "0.55420315", "0.55306005", "0.550286", "0.54723805", "0.546748", "0.54247445", "0.54011554", "0.53890795", "0.53735965", "0.53732735", "0.53732735", "0.5345275", "0.5338938", "0.53061503", "0.52...
0.76027656
0
Returns render array for export actions on a space group.
protected function getExportActionsViewRender(GroupInterface $group) { $output = [ '#type' => 'container', 'title' => [ '#type' => 'html_tag', '#tag' => 'h4', '#value' => t('Export'), '#attributes' => ['class' => ['living-space-export-action-title']], ], ]; $actions = $this->moduleHandler ->invokeAll('living_spaces_group_exports_info', [FALSE, $group]); if (!empty($actions)) { $output += array_intersect_key($actions, array_filter($this->configuration['enabled_exports'])); } else { $output = []; } return $output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getContactActionsRender(GroupInterface $group) {\n $output = [\n '#type' => 'container',\n 'title' => [\n '#type' => 'html_tag',\n '#tag' => 'h4',\n '#value' => t('Contact'),\n '#attributes' => ['class' => ['living-space-contact-action-title']],\n ],...
[ "0.64288974", "0.6256333", "0.60034233", "0.5817994", "0.5810293", "0.5797827", "0.57573223", "0.5743704", "0.57402873", "0.5727694", "0.565833", "0.5654961", "0.56274325", "0.562369", "0.56142485", "0.56063426", "0.5563493", "0.5540996", "0.55381507", "0.5538053", "0.5535479...
0.82140887
0
Returns render array for group tree.
protected function getGroupTreeRender(GroupInterface $group) { $plugin_block = $this->blockManager->createInstance('living_spaces_group_tree_block', [ 'id' => 'living_spaces_group_tree_block', 'context_mapping' => [ 'group' => '@group.group_route_context:group', ], ]); if ($plugin_block instanceof ContextAwarePluginInterface) { $contexts = $this->contextRepository->getRuntimeContexts($plugin_block->getContextMapping()); $this->contextHandler->applyContextMapping($plugin_block, $contexts); } return $plugin_block->build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function format()\n {\n $result = array();\n\n foreach ($this->groups as $group) {\n $result[] = array(\n 'id' => $group->getInternalId(),\n 'external_id' => $group->getExternalId(),\n 'value' => $group->getName(),\n 'la...
[ "0.6781402", "0.65309376", "0.63400924", "0.62671614", "0.62258005", "0.61690885", "0.6139825", "0.6118749", "0.60628206", "0.606034", "0.6059696", "0.5984809", "0.59276223", "0.5916014", "0.5904813", "0.5846664", "0.5846664", "0.5827093", "0.582627", "0.57989156", "0.5777557...
0.54979515
59
Returns render array for circle form.
protected function getCircleFormRender(GroupInterface $group) { $plugin_block = $this->blockManager->createInstance('living_spaces_circles_add_people_block', [ 'id' => 'living_spaces_circles_add_people_block', 'context_mapping' => [ 'group' => '@group.group_route_context:group', ], ]); if ($plugin_block instanceof ContextAwarePluginInterface) { $contexts = $this->contextRepository->getRuntimeContexts($plugin_block->getContextMapping()); $this->contextHandler->applyContextMapping($plugin_block, $contexts); } return $plugin_block->build(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getView()\n {\n return [\n 'Figure' => \"Circle\",\n 'Parameters' => [\n 'radius' => $this->radius,\n ],\n 'Area' => $this->area()\n ];\n }", "public function getCircles()\n {\n return $this->circles;\n }"...
[ "0.7145182", "0.65856636", "0.62163293", "0.6121456", "0.57672566", "0.56802696", "0.56290853", "0.55994457", "0.5511177", "0.5419719", "0.53908145", "0.53700453", "0.53474295", "0.53430283", "0.5291359", "0.5279379", "0.5256886", "0.5228608", "0.522236", "0.5215148", "0.5205...
0.0
-1
Get all of the tasks for the user.
public function user() { return $this->belongsTo(User::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTasks();", "public function getTasks();", "public function getAllTasks()\n\t{\n\t\treturn $this->task->orderBy('is_completed', 'ASC')->get();\t\n\t}", "public function forUser(User $user)\r\n {\r\n return tasks::where('user_id', $user->id)\r\n ->orderBy('create...
[ "0.7702231", "0.7702231", "0.76288015", "0.7601574", "0.75348604", "0.7493974", "0.7366935", "0.7338981", "0.72239435", "0.7213353", "0.7186927", "0.71557593", "0.71499896", "0.71365815", "0.71266425", "0.71171784", "0.7110398", "0.70817596", "0.70734525", "0.70730996", "0.70...
0.0
-1
Initializes the controller before invoking an action method.
protected function initializeAction() { $this->pageRenderer->addCssFile(t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/StyleSheet/module.css'); $this->pageRenderer->addInlineLanguageLabelFile('EXT:smoothmigration/Resources/Private/Language/locallang.xml'); $this->pageRenderer->addJsLibrary('jquery', t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/jquery-1.10.1.min.js'); $this->pageRenderer->addJsLibrary('sprintf', t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/sprintf.min.js'); $this->pageRenderer->addJsFile(t3lib_extMgm::extRelPath('smoothmigration') . 'Resources/Public/JavaScript/General.js'); if (t3lib_div::int_from_ver(TYPO3_version) > 6001000) { $this->moduleToken = \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get()->generateToken('moduleCall', 'tools_SmoothmigrationSmoothmigration'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initializeController() {}", "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "public function __init()\n\t{\n\t\t// This code will run before your controller's c...
[ "0.83893245", "0.8365739", "0.8365739", "0.77989143", "0.7763317", "0.7562168", "0.7562168", "0.75611573", "0.745006", "0.74203813", "0.74139845", "0.74139845", "0.74139845", "0.74139845", "0.74139845", "0.73387736", "0.73374873", "0.7303854", "0.7300791", "0.7264129", "0.711...
0.0
-1
Processes a general request. The result can be returned by altering the given response.
public function processRequest(Tx_Extbase_MVC_RequestInterface $request, Tx_Extbase_MVC_ResponseInterface $response) { $this->template = t3lib_div::makeInstance('template'); $this->pageRenderer = $this->template->getPageRenderer(); $GLOBALS['SOBE'] = new stdClass(); $GLOBALS['SOBE']->doc = $this->template; parent::processRequest($request, $response); $pageHeader = $this->template->startpage( $GLOBALS['LANG']->sL('LLL:EXT:smoothmigration/Resources/Private/Language/locallang.xml:module.title') ); $pageEnd = $this->template->endPage(); $response->setContent($pageHeader . $response->getContent() . $pageEnd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function processRequest();", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n b...
[ "0.71927243", "0.71348816", "0.70686597", "0.69724953", "0.6652359", "0.6570904", "0.6568109", "0.6544741", "0.64819896", "0.64289415", "0.63931143", "0.63909805", "0.6222854", "0.61849636", "0.6102798", "0.6098426", "0.6072254", "0.60117525", "0.5990137", "0.5970429", "0.596...
0.5380021
63
genera el contenido para insertar en codigo QR
private function MakeContentQR(){ $content = "{$this->Nombre} {$this->Apellidos}\n{$this->email}\n{$this->Carrera}\n {$this->Semestre}\n{$this->ncontrol}\n{$this->FolioPago}\n{$this->F_Examen}"; return $content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generate(Request $request){ \n $data = $request->all();\n QRCode::text($data['code'])->png(); \n }", "public static function getGenerateQrCode(Request $request){\n $title = \"Generate Qr Code\";\n $projectDetailObj = new \\App\\Project;\n $input = $request->all();\n ...
[ "0.6209538", "0.59599036", "0.58564454", "0.57883894", "0.57696843", "0.5765846", "0.5729959", "0.5686736", "0.5596861", "0.5547655", "0.55446106", "0.5522725", "0.5508945", "0.5497635", "0.5485846", "0.5479005", "0.5470509", "0.5469289", "0.54313016", "0.537364", "0.5369415"...
0.71873707
0
Seed the application's database.
public function run() { $faker = Faker::create('id_ID'); /** * Generate fake author data */ for ($i=1; $i<=50; $i++) { DB::table('author')->insert([ 'name' => $faker->name ]); } /** * Generate fake publisher data */ for ($i=1; $i<=50; $i++) { DB::table('publisher')->insert([ 'name' => $faker->name ]); } /** * Seeding payment method */ DB::table('payment')->insert([ ['name' => 'Mandiri'], ['name' => 'BCA'], ['name' => 'BRI'], ['name' => 'BNI'], ['name' => 'Pos Indonesia'], ['name' => 'BTN'], ['name' => 'Indomaret'], ['name' => 'Alfamart'], ['name' => 'OVO'], ['name' => 'Cash On Delivery'] ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function dbSeed(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Turn foreign key checks off\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0;');// <- USE WITH CAUTION!\n\t\t\t//Seed tables\n\t\t\tArtisan::call('db:seed');\n\t\t\t//Turn foreign key checks on\n\t\t\tDB::statement('SET FOREIGN_KEY_CHECKS=...
[ "0.8064933", "0.7848158", "0.7674873", "0.724396", "0.7216743", "0.7132209", "0.70970356", "0.70752203", "0.704928", "0.699208", "0.6987078", "0.69839287", "0.6966499", "0.68990964", "0.6868679", "0.68468624", "0.68307716", "0.68206114", "0.6803113", "0.6803113", "0.6801801",...
0.0
-1
Creamos la funcion conectar que lo que hace es que cada vez que la llamamos nos conecta a la BD
function conectar () { $username = "root"; $password = "root"; try { $conn = new PDO ('mysql:host=localhost;dbname=its', $username, $password); } catch (Exception $errorConexion) { echo "ERROR: $errorConexion"; } return $conn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function conectar() {\n //Establecer conexion con el servidor\n $this->linkId = @mysql_connect($this->servidor, $this->usuario, $this->password);\n if ($this->linkId == true) {//Si se conecto al servidor.\n //Asignar la conexion a la base de datos\n if (!mysql_sele...
[ "0.78118795", "0.77473384", "0.76412624", "0.7637855", "0.7601001", "0.75909334", "0.7527579", "0.74947864", "0.7459641", "0.7431038", "0.7416699", "0.7364512", "0.7351252", "0.73281336", "0.73255277", "0.7319834", "0.7298542", "0.729603", "0.72717613", "0.72499436", "0.72422...
0.69321287
45
Grabbing variables from $t_args
function Page_Rank_Constant_State(array $t_args) { $className = $t_args['className']; ?> using namespace arma; using namespace std; class <?=$className?>ConstantState { private: // The current iteration. int iteration; // The number of distinct nodes in the graph. long num_nodes; wall_clock timer; public: friend class <?=$className?>; <?=$className?>ConstantState() : iteration(0), num_nodes(0) { timer.tic(); } }; <? return [ 'kind' => 'RESOURCE', 'name' => $className . 'ConstantState', ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function get_args();", "function get_args($request)\n {\n }", "function get_args($request)\n {\n }", "function init_args()\r\n{\r\n $_REQUEST = strings_stripSlashes($_REQUEST);\r\n\r\n // if any piece of context is missing => we will display nothing instead of crashing WORK T...
[ "0.6670055", "0.66026604", "0.66026604", "0.631172", "0.63084155", "0.63084155", "0.62897563", "0.62622315", "0.6254377", "0.61238426", "0.6080027", "0.6061332", "0.5990322", "0.598485", "0.5920138", "0.59086514", "0.5870661", "0.58617944", "0.58603066", "0.5853599", "0.58456...
0.0
-1
This GLA computes the page ranks of a graph given the edge set as inputs. The algorithm runs with O(V) space and O(I E) time, where V is the total number of vertices; E, the total number of edges; and I, the number of iterations. The input should be two integers specifying source and target vertices. The output is vertex IDs and their page rank, expressed as a float. Template Args: adj: Whether the edge count and page rank of a given vertex should be stored adjacently. Doing so reduced random lookups but increases update time. Resources: armadillo: various data structures algorithm: max
function Page_Rank($t_args, $inputs, $outputs) { // Class name is randomly generated. $className = generate_name('PageRank'); // Initializiation of argument names. $inputs_ = array_combine(['s', 't'], $inputs); $vertex = $inputs_['s']; // Processing of template arguments. $adj = $t_args['adj']; $debug = get_default($t_args, 'debug', 1); // Construction of outputs. $outputs_ = ['node' => $vertex, 'rank' => lookupType('float')]; $outputs = array_combine(array_keys($outputs), $outputs_); $sys_headers = ['armadillo', 'algorithm']; $user_headers = []; $lib_headers = []; $libraries = ['armadillo']; $properties = []; $extra = []; $result_type = ['fragment']; ?> using namespace arma; using namespace std; class <?=$className?>; <? $constantState = lookupResource( 'statistics::Page_Rank_Constant_State', ['className' => $className] ); ?> class <?=$className?> { public: // The constant state for this GLA. using ConstantState = <?=$constantState?>; // The current and final indices of the result for the given fragment. using Iterator = std::pair<int, int>; // The value of the damping constant used in the page rank algorithm. static const constexpr float kDamping = 0.85; // The number of iterations to perform, not counting the initial set-up. static const constexpr int kIterations = 20; // The work is split into chunks of this size before being partitioned. static const constexpr int kBlock = 32; // The maximum number of fragments to use. static const constexpr int kMaxFragments = 64; private: <? if ($adj) { ?> // The edge weighting and page rank are stored side-by-side. This will make // updating the page ranks more costly but reduces random lookups. The weight // is the precomputed inverse of the number of edges for that vertex. static arma::mat info; <? } else { ?> // The edge weighting for each vertex. The weight is the precomputed inverse // of the number of edges for that vertex. static arma::rowvec weight; // The page-rank for each vertex. static arma::rowvec rank; <? } ?> // The value of the summation over adjacent nodes for each vertex. static arma::rowvec sum; // The typical constant state for an iterable GLA. const ConstantState& constant_state; // The number of unique nodes seen. long num_nodes; // The current iteration. int iteration; // The number of fragmetns for the result. int num_fragments; public: <?=$className?>(const <?=$constantState?>& state) : constant_state(state), num_nodes(state.num_nodes), iteration(state.iteration) { auto state_copy = const_cast<<?=$constantState?>&>(state); cout << "Time taken for iteration: " << iteration << ": " << state_copy.timer.toc() << endl; } void AddItem(<?=const_typed_ref_args($inputs_)?>) { if (iteration == 0) { num_nodes = max((long) max(s, t), num_nodes); return; } else if (iteration == 1) { <? if ($adj) { ?> info(1, s)++; <? } else { ?> weight(s)++; <? } ?> } else { <? if ($adj) { ?> sum(t) += prod(info.col(s)); <? } else { ?> sum(t) += weight(s) * rank(s); <? } ?> } } void AddState(<?=$className?> &other) { if (iteration == 0) num_nodes = max(num_nodes, other.num_nodes); } // Most computation that happens at the end of each iteration is parallelized // by performing it inside Finalize. bool ShouldIterate(ConstantState& state) { state.iteration = ++iteration; <? if ($debug > 0) { ?> cout << "finished iteration " << iteration << endl; <? } ?> if (iteration == 1) { // num_nodes is incremented because IDs are 0-based. state.num_nodes = ++num_nodes; <? if ($debug > 0) { ?> cout << "num_nodes: " << num_nodes << endl; <? } ?> // Allocating space can't be parallelized. sum.set_size(num_nodes); <? if ($adj) { ?> info.set_size(2, num_nodes); info.row(0).fill(1); <? } else { ?> rank.set_size(num_nodes); weight.set_size(num_nodes); rank.fill(1); <? } ?> return true; } else { <? if ($debug > 1) { ?> cout << "weights: " << accu(info.row(1)) << endl; cout << "sum: " << accu(sum) << endl; cout << "pr: " << accu(info.row(0)) << endl; <? } ?> return iteration < kIterations + 1; } } int GetNumFragments() { long size = (num_nodes - 1) / kBlock + 1; // num_nodes / kBlock rounded up. num_fragments = (iteration == 0) ? 0 : min(size, (long) kMaxFragments); <? if ($debug > 0) { ?> cout << "# nodes: " << num_nodes << endl; cout << "kBlock: " << kBlock << endl; cout << "# fragments: " << size << endl; cout << "Returning " << num_fragments << " fragments" << endl; <? } ?> return num_fragments; } // The fragment is given as a long so that the below formulas don't overflow. Iterator* Finalize(long fragment) { long count = num_nodes; // The ordering of operations is important. Don't change it. long first = fragment * (count / kBlock) / num_fragments * kBlock; long final = (fragment == num_fragments - 1) ? count - 1 : (fragment + 1) * (count / kBlock) / num_fragments * kBlock - 1; <? if ($debug > 0) { ?> printf("Fragment %ld: %ld - %ld\n", fragment, first, final); <? } ?> if (iteration == 2) { <? if ($adj) { ?> info.row(0).subvec(first, final).fill(1); info.row(1).subvec(first, final) = pow(info.row(1).subvec(first, final), -1); <? } else { ?> rank.subvec(first, final).fill(1); weight.subvec(first, final) = 1 / weight.subvec(first, final); <? } ?> sum.subvec(first, final).fill(0); } else { <? if ($adj) { ?> info.row(0).subvec(first, final) = (1 - kDamping) + kDamping * sum.subvec(first, final); <? } else { ?> rank.subvec(first, final) = (1 - kDamping) + kDamping * sum.subvec(first, final); <? } ?> sum.subvec(first, final).zeros(); } return new Iterator(first, final); } bool GetNextResult(Iterator* it, <?=typed_ref_args($outputs_)?>) { if (iteration < kIterations + 1) return false; if (it->first > it->second) return false; node = it->first; <? if ($adj) { ?> rank = info(0, it->first); <? } else { ?> rank = rank(it->first); <? } ?> it->first++; return true; } }; // Initialize the static member types. <? if ($adj) { ?> arma::mat <?=$className?>::info; <? } else { ?> arma::rowvec <?=$className?>::weight; arma::rowvec <?=$className?>::rank; <? } ?> arma::rowvec <?=$className?>::sum; typedef <?=$className?>::Iterator <?=$className?>_Iterator; <? return [ 'kind' => 'GLA', 'name' => $className, 'system_headers' => $sys_headers, 'user_headers' => $user_headers, 'lib_headers' => $lib_headers, 'libraries' => $libraries, 'properties' => $properties, 'extra' => $extra, 'iterable' => true, 'intermediates' => true, 'input' => $inputs, 'output' => $outputs, 'result_type' => $result_type, 'generated_state' => $constantState, ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function galaxy_show_ranking_ally() {\n\tglobal $db;\n\tglobal $pub_order_by, $pub_date, $pub_interval, $pub_suborder;\n\n\tif (!check_var($pub_order_by, \"Char\") || !check_var($pub_date, \"Num\") || !check_var($pub_interval, \"Num\") || !check_var($pub_suborder, \"Char\")) {\n\t\tredirection(\"index.php?action=m...
[ "0.40276578", "0.39606708", "0.39383328", "0.3934288", "0.3888219", "0.38683745", "0.3815064", "0.3810539", "0.37966835", "0.37458992", "0.3711539", "0.37087935", "0.36667502", "0.36576584", "0.3639627", "0.36095986", "0.3601433", "0.35954937", "0.3587483", "0.3584192", "0.35...
0.6190208
0
Ecriture au sein de ce fichier le contenu de $msg avec la date et l'heure
public static function log($msg){ self::createLogExist(); $fichier = fopen('log/log.txt', 'r+'); fputs($fichier, $msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cc_import_immobili_error_log($msg){\n\t\n\t$path = ABSPATH . \"import/\";\n\t$d = date(\"Ymd\");\n\t$file = $path.\"logfile_\".$d.\".txt\";\n\tif(is_array($msg)) $msg = var_export($msg, true);\n\t\n\t$method = (file_exists($file)) ? \"a\": \"w\";\n\t$handle = fopen($file, $method);\n\t$string = date(\"Y-m...
[ "0.67073977", "0.6706532", "0.6555309", "0.6555027", "0.63123965", "0.6297475", "0.6246508", "0.6230543", "0.61696965", "0.6161088", "0.6123385", "0.60761595", "0.6040966", "0.6028027", "0.6013002", "0.60019964", "0.59471107", "0.591046", "0.58943766", "0.5893898", "0.5893490...
0.55416167
45
Coder la fonction mais ne l'appelez pas, on passera par un cron limite de taille : 5mo
public static function purgeLog(){ $fichier = fopen('log/log.txt', 'w'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function cronMinute()\n {\n $timedRecords = $this->app['storage.event_processor.timed'];\n if ($timedRecords->isDuePublish()) {\n $this->notify('Publishing timed records');\n $timedRecords->publishTimedRecords();\n }\n if ($timedRecords->isDueHold()) {\n...
[ "0.66825515", "0.65905243", "0.6536926", "0.65339565", "0.6484514", "0.6476803", "0.64543176", "0.64112526", "0.6378767", "0.63777006", "0.637599", "0.6345236", "0.63249516", "0.63225156", "0.63017386", "0.6286551", "0.6253544", "0.6231126", "0.62248296", "0.62077206", "0.616...
0.0
-1
run in verbose mode.
public static function run_on_demand() { $obj = new self(); $obj->verbose = true; $obj->run(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verbose($v)\n {\n $this->verbose = $v;\n }", "public function isVerbose()\n {\n }", "public function isVerbose();", "public function isVerbose();", "public function isVeryVerbose()\n {\n }", "public function isVeryVerbose();", "private function createVerboseLog(...
[ "0.69430566", "0.67427397", "0.66717386", "0.66717386", "0.65915775", "0.64965487", "0.6169363", "0.6168454", "0.6154027", "0.6149708", "0.6030976", "0.59923464", "0.5950023", "0.5828371", "0.57174206", "0.5671505", "0.5590524", "0.5577883", "0.5564451", "0.55536425", "0.5541...
0.5619492
16
runs the task without output.
public function runSilently() { $this->verbose = false; return $this->run(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function runTestTask()\n\t{\n\t\t$this->runTask(1);\n\t}", "public function run(){}", "public abstract function getNoOutput();", "protected function run()\n {\n /* Do Nothing */\n return 'There is no implementation yet:)';\n }", "public function run()\n {\n // $this->ca...
[ "0.7225751", "0.65315264", "0.65093315", "0.6449802", "0.6329245", "0.6292994", "0.62482417", "0.6237201", "0.6208822", "0.6208822", "0.6208822", "0.6187101", "0.6187101", "0.6187101", "0.6187101", "0.6187101", "0.6187101", "0.6187101", "0.6187101", "0.6187101", "0.6187101", ...
0.6179557
27
For internal only. DO NOT USE IT.
public function deserialize($param) { if ($param === null) { return; } if (array_key_exists("MetricName",$param) and $param["MetricName"] !== null) { $this->MetricName = $param["MetricName"]; } if (array_key_exists("StartTime",$param) and $param["StartTime"] !== null) { $this->StartTime = $param["StartTime"]; } if (array_key_exists("EndTime",$param) and $param["EndTime"] !== null) { $this->EndTime = $param["EndTime"]; } if (array_key_exists("Period",$param) and $param["Period"] !== null) { $this->Period = $param["Period"]; } if (array_key_exists("Values",$param) and $param["Values"] !== null) { $this->Values = $param["Values"]; } if (array_key_exists("Time",$param) and $param["Time"] !== null) { $this->Time = $param["Time"]; } if (array_key_exists("RequestId",$param) and $param["RequestId"] !== null) { $this->RequestId = $param["RequestId"]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __init__() { }", "private function __() {\n }", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}", "protected function init() {}...
[ "0.62662613", "0.6151871", "0.5989886", "0.5989886", "0.5989886", "0.5989886", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5989418", "0.5988404", "0.5988404", "0.5949015", "0.5939596", "0.59168774", "0.59168774", "0.58703923", "0.58665824", "0.5855589"...
0.0
-1
// FoxNews // E!
function test_link($url){ ini_set('default_socket_timeout', 1); if(!$fp = @fopen($url, "r")) { return false; } else { fclose($fp); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function news();", "private function yoast_news() {\n\t\t$extra_links = '<li class=\"facebook\"><a href=\"https://www.facebook.com/yoast\">' . __( 'Like Yoast on Facebook', 'helpscout-docs-api' ) . '</a></li>';\n\t\t$extra_links .= '<li class=\"twitter\"><a href=\"https://twitter.com/yoast\">' . __( 'Fol...
[ "0.68339777", "0.6352707", "0.617973", "0.6161403", "0.61095726", "0.6017487", "0.59946865", "0.5974328", "0.5856696", "0.5847808", "0.58028877", "0.57881325", "0.5765711", "0.57154024", "0.57133335", "0.57133335", "0.57133335", "0.57133335", "0.5713301", "0.57128525", "0.569...
0.0
-1
Devuelve true si la fecha de vencimiento del producto es menor a la fecha actual.
function diasTranscurridos($fecha_inicial, $fecha_final) { $dias = strtotime($fecha_inicial) < strtotime($fecha_final); return $dias; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isExpire(){\n\t\t$duedate = new DateTime($this->duedate);\n\t\t$today = new DateTime(\"now\");\n\t\t\n\t\tif($duedate < $today) \n\t\t\treturn true;\n\t\treturn false;\n\t}", "protected function _isNew($product) {\r\n $from = strtotime ( $product->getData ( 'news_from_date' ) );\r\n ...
[ "0.6827691", "0.66952544", "0.65435475", "0.64063185", "0.63666147", "0.6337721", "0.6335211", "0.63220304", "0.6289998", "0.62509733", "0.6232694", "0.6216706", "0.6201604", "0.62000227", "0.6175984", "0.6173769", "0.6118893", "0.61006224", "0.6081513", "0.60804266", "0.6042...
0.0
-1
Devuelve un array de los productos que vencieron.
function devolverProductosVencidos($consulta) { $conexion = mysqli_connect("localhost", "root", "", "inventariocasa"); $fecha = date("j-n-Y"); if (!$resultado = mysqli_query($conexion, $consulta)) { die(); } $datos = array(); $i = 0; while ($row = $resultado->fetch_assoc()) { if (diasTranscurridos($row['fecha_vencimiento'], $fecha)) { $datos[$i] = $row; $i++; } } mysqli_close($conexion); return $datos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getProductos()\n\t{\n\t\t$productos = [];\n\t\t\n\t\tif($this->carro) {\n\t\t\t\n\t\t\t$productosCollection = Collect($this->carro->getCarro());\n\t\t\t$idDeProductos = [];\n\t\t\t$idYCantidad = [];\n\t\t\t//separamos los ids para luego consultarlos en la BBDD ademas realizamos otro arreglo en dond...
[ "0.74459785", "0.737285", "0.7353909", "0.7295343", "0.72635525", "0.7117612", "0.7108742", "0.7027665", "0.70043176", "0.6985387", "0.6943744", "0.6925094", "0.686199", "0.6800134", "0.67976576", "0.67959523", "0.6783057", "0.67370224", "0.6736678", "0.6729248", "0.672394", ...
0.0
-1
Permite obtener todas las publicaciones que estan en el sitio
public function all() { $item = new Item; $items = $item->all(); View::renderJson($items); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPublicaciones()\n {\n $publicaciones = $this->publicacionDAO->getPublicaciones();\n\n\n echo $this->renderer->render(\"view/listar-publicaciones.mustache\", array(\n \"title\" => \"Publicación\",\n \"publicaciones\" => Publicacion::toListArrayMap($publicaci...
[ "0.71174544", "0.6968476", "0.6798673", "0.6688303", "0.66052735", "0.6590543", "0.63851625", "0.63362", "0.6313525", "0.6234453", "0.62072754", "0.61866605", "0.61293775", "0.6092805", "0.6057471", "0.6030126", "0.5952675", "0.5912036", "0.58738554", "0.58681273", "0.5857017...
0.0
-1
Permite obtener las publicaciones de un usuario particular por el id del mismo, el usuario que quiere ver las publicaciones tiene que estar logueado...
public function allItemsByUser() { $this->checkUserIsLogged(); $params = Route::getUrlParameters(); $idUser = $params['idUser']; $item = new Item; $items = $item->allItemsByUser($idUser); View::renderJson($items); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtenerDatosPublicacionesUsuario($idUsuario){\n $var_id_usuario = $idUsuario;\n //PASO 2: Incluimos archivo de conexión\n include(\"C:/xampp/htdocs/facebook/database/mysqli.inc.php\");\n //PASO 3: Definimos sentencia SQL\n\t $sentenciaMYSQL=\"SELECT p.post_id,p.post,p.us...
[ "0.6855279", "0.637148", "0.62564087", "0.621645", "0.62048674", "0.61880356", "0.6178026", "0.61361545", "0.61052734", "0.60996175", "0.60667217", "0.60592514", "0.60401225", "0.6024384", "0.60093135", "0.6001946", "0.59631544", "0.5959101", "0.59546494", "0.59482294", "0.59...
0.0
-1
Permite obtener la informacion de una publicacion por el id de la misma
public function getItem() { $this->checkUserIsLogged(); $params = Route::getUrlParameters(); $id = $params['id']; try { $item = new Item; $item->getItem($id); View::renderJson($item); } catch (Exception $e) { View::renderJson(['status' => 0, 'message' => $e]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getPublicacion($id)\n {\n $publicacion = $this->publicacionDAO->getPublicacion($id);\n $secciones = $this->seccionDAO->getSecciones($publicacion->getId());\n\n if (!is_null($secciones)) {\n foreach ($secciones as $seccion) {\n $seccion->setNoticias(...
[ "0.69696456", "0.6918937", "0.65399384", "0.6530916", "0.6457736", "0.6431802", "0.6374847", "0.6369175", "0.6326821", "0.63220507", "0.63000107", "0.62486327", "0.6221247", "0.62186325", "0.61846393", "0.61615187", "0.6134261", "0.61164796", "0.60952014", "0.60674316", "0.60...
0.0
-1
Lit une partie de CSV concernant un candidat.
private function updateCandidat($line, $election, $commune) { $candidatInfos = explode(';', $line); for ($i = 0; $i < 3; $i++) { if (!array_key_exists($i, $candidatInfos)) { return false; } } $nuance = $this->nuanceAvant ? $candidatInfos[0] : $candidatInfos[1]; $nom = $this->nuanceAvant ? $candidatInfos[1] : $candidatInfos[0]; if ('liste' === $this->electionType) { $candidat = new ListeCandidate( $election, $nuance, $nom ); } elseif ('uninominale' === $this->electionType) { $candidat = new PersonneCandidate( $election, $nuance, null, $nom ); } $slice = array_values( array_filter( $election->getCandidats(), function ($c) use ($candidat) { return ($candidat->getNom() === $c->getNom()); } ) ); if (0 === count($slice)) { $election->addCandidat($candidat); } else { $candidat = $slice[0]; } $election->setVoixCandidat($candidatInfos[2], $candidat, $commune); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function creer_entete_csv(&$liste_option) {\n\tif (check_report_date ( $liste_option ))\n\t\t$entete = __CLASS__;\n\telse\n\t\t$entete = __CLASS__;\n\t$titre = $liste_option->getOption ( array (\n\t\t\t\"ordre_de_sortie\",\n\t\t\t\"champ\",\n\t\t\t\"titre\" \n\t) );\n\t$separateur = $liste_option->getOption ( arra...
[ "0.64636564", "0.63454026", "0.63147473", "0.6021691", "0.5944933", "0.58485246", "0.58400196", "0.58265847", "0.5792605", "0.5786624", "0.57733864", "0.5747248", "0.56274015", "0.56187344", "0.5617757", "0.56090397", "0.5606433", "0.5584358", "0.55642235", "0.55623823", "0.5...
0.0
-1
This is the constructor.
function miguel_CProfile() { $this->miguel_Controller(); $this->setModuleName('profileManager'); $this->setModelClass('miguel_MProfile'); $this->setViewClass('miguel_VProfile'); $this->setCacheFlag(false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final private function __construct() {\n\t\t\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "final private function __construct()\n {\n }", "private function __construct() {\r\n\t\r\n\t}", "private function __construct()\t{}", "private function __construct() {\n\t\t}", "final ...
[ "0.8686665", "0.8567355", "0.85457885", "0.85449666", "0.8531002", "0.85206646", "0.85004854", "0.8464301", "0.84555864", "0.84532666", "0.84525466", "0.844303", "0.84160125", "0.8412339", "0.8406726", "0.8406726", "0.8406726", "0.8406726", "0.8406726", "0.8406726", "0.840672...
0.0
-1
Get event database client query from configuration.
private function getQuery(array $config) { $query = []; if (isset($config['items_per_page'])) { $query['items_per_page'] = $config['items_per_page']; } if (isset($config['order'])) { $query['order[occurrences.startDate]'] = $config['order']; } if (isset($config['query'])) { try { $value = Yaml::parse($config['query']); if (is_array($value)) { $query = array_merge($query, $value); } } catch (ParseException $ex) { } } return $query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getClientQuery(): string;", "public function getInstanceQuery()\n {\n return $this->get(self::_INSTANCE_QUERY);\n }", "public static function select($config)\n\t{\n\t\treturn self::new_instance_records()->select($config);\n\t}", "public function getQueryCommand();", "public sta...
[ "0.5628943", "0.5485642", "0.5467886", "0.5462427", "0.5448779", "0.5446621", "0.54332185", "0.5426561", "0.54254514", "0.5370719", "0.5362795", "0.53554094", "0.5302289", "0.5251179", "0.5237816", "0.5226193", "0.52163154", "0.52099204", "0.5207886", "0.5189783", "0.51860017...
0.5163875
25
Get paging view for a collection of events.
private function getView(Collection $collection) { $view = []; foreach (['first', 'previous', 'next', 'last'] as $key) { $url = $collection->get($key); if ($url) { $info = parse_url($url); if (!empty($info['query'])) { parse_str($info['query'], $query); $view[$key] = Url::fromRoute('event_database_pull.events_list', $query); } } } return $view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $events = Event::whereDate('date', '>=', Carbon::now())\n ->orderBy('date', 'desc')->paginate(15);\n\n return view('event.index', compact('events'))\n ->with('i', (request()->input('page', 1) -1) *15);\n }", "function loadEvents() {\n ...
[ "0.59467393", "0.5766378", "0.57551855", "0.5740196", "0.572459", "0.5712482", "0.5679925", "0.56694716", "0.5604403", "0.55985415", "0.5577331", "0.54963076", "0.5469232", "0.5458774", "0.54540366", "0.5449997", "0.54391867", "0.54272145", "0.54230356", "0.542053", "0.541713...
0.5808819
1
Load data fixtures with the passed EntityManager
public function load(ObjectManager $manager) { $names = array('News'); foreach ($names as $i => $name) { $list[$i] = new Album(); $list[$i]->setTitle($name); $list[$i]->setDescription($name); $list[$i]->setCategory($this->getReference('album-category')); $manager->persist($list[$i]); } $this->addReference('album', $list[$i]); $manager->flush(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function loadData(ObjectManager $em);", "public function load(ObjectManager $manager)\n {\n // Fixtures are split into separate files\n }", "private function myLoadFixtures()\n {\n $em = $this->getDatabaseManager();\n\n // load fixtures\n $client = static...
[ "0.7676857", "0.75958014", "0.755091", "0.7403772", "0.7331332", "0.7273764", "0.720747", "0.7035566", "0.7007099", "0.6957492", "0.69085765", "0.68872637", "0.68545777", "0.6848193", "0.6842862", "0.68228793", "0.6822571", "0.68179256", "0.6747948", "0.6745667", "0.6713977",...
0.0
-1
Funcion que llamos desde Paso2Listaprecios > Tareas > Funcion contador En donde realizamos RESUMEN, es decir comprueba cuantos registros hay y cuantos son nuevo o existentes.
function contador($nombretabla, $BDImportRecambios,$ConsultaImp) { // Inicializamos array $Tresumen['n'] = 0; //nuevo $Tresumen['t'] = 0; //total $Tresumen['e'] = 0; //existe $Tresumen['v'] = 0; //existe // Contamos los registros que tiene la tabla $total = 0; $whereC = ''; $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC); $Tresumen['t'] = $total; // total registros // Obtenemos lineas de registro en blanco y contamos cuantas $whereC = " WHERE trim(Estado) = ''"; $campo[1]= 'RefFabPrin'; $campo[2]= 'linea'; $RegistrosBlanco = $ConsultaImp->registroLineas($BDImportRecambios,$nombretabla,$campo,$whereC); // Como queremos devolver javascript los creamos $Tresumen['v'] = $RegistrosBlanco['NItems']; $Tresumen['LineasRegistro'] = $RegistrosBlanco; //Registros en blanco // Contamos los registros que tiene la tabla nuevo $total = 0; $whereC = " WHERE Estado = 'nuevo'"; $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC); $Tresumen['n'] = $total; //nuevo // Contamos los registros que tiene la tabla existente $total = 0; $whereC = " WHERE Estado = 'existe'"; $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC); $Tresumen['e'] = $total; //existe return $Tresumen; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contarReprobados($espacios_por_cursar){\n $cantidad=0;\n if(count($espacios_por_cursar)>0){\n foreach ($espacios_por_cursar as $key => $espacio) {\n if($espacio['REPROBADO']==1){\n $cantidad++;\n \t }\n }\n }\n retu...
[ "0.65585566", "0.6494105", "0.6490734", "0.6412446", "0.63329184", "0.6311352", "0.63040525", "0.6265099", "0.6230874", "0.62259394", "0.62103623", "0.62041384", "0.61919856", "0.616504", "0.6161417", "0.6156595", "0.61555076", "0.61513865", "0.614656", "0.6111529", "0.609449...
0.6567973
0
/ ========================= Funcion de consulta ======================================== Encontramos que la tabla listaprecios tiene registros con el estado VACIO, entonces comprobamos en la tabla REFERENCIASCRUZADAS de BD de RECAMBIOS, si existe la referencia Si existe se pone en ESTADO = "existe" NO existe se pone en ESTADO = "nuevo" Estos cambios son el campor ESTADO de la tabla LISTAPRECIOS de BD IMPORTARRECAMBIOS.
function comprobar($nombretabla, $BDImportRecambios, $BDRecambios,$id,$l,$f) { // Inicializamos variables $consfinal = 0; $existente = 0; $nuevo = 0; $consul = "SELECT * FROM referenciascruzadas where RefFabricanteCru ='" . $id . "'"; $consultaReca = mysqli_query($BDRecambios, $consul); if ($consultaReca == true) { // Controlamos que la consulta sea correcta, ya que sino lo es genera un error la funcion fetch $consfinal = $consultaReca->fetch_assoc(); } if ($consfinal['RefFabricanteCru'] == $id && $consfinal['IdFabricanteCru'] == $f) { $actu = "UPDATE `listaprecios` SET `Estado`='existe',`RecambioID`=" . $consfinal['RecambioID'] . " WHERE `linea` ='" . $l . "'"; mysqli_query($BDImportRecambios, $actu); $existente = 1; } else { $actu = "UPDATE `listaprecios` SET `Estado`='nuevo' WHERE `linea` ='" . $l . "'"; mysqli_query($BDImportRecambios, $actu); $nuevo = 1; } $datos[0]['n'] = $nuevo; $datos[0]['e'] = $existente; $datos[0]['t'] = $l; return $datos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contador($nombretabla, $BDImportRecambios,$ConsultaImp) {\n\t// Inicializamos array\n $Tresumen['n'] = 0; //nuevo\n $Tresumen['t'] = 0; //total\n $Tresumen['e'] = 0; //existe\n\t$Tresumen['v'] = 0; //existe\n\t\n\t// Contamos los registros que tiene la tabla\n \t$total = 0;\n $whereC = '';\n...
[ "0.6617181", "0.65739983", "0.648753", "0.64374495", "0.6424512", "0.64021033", "0.6375148", "0.63681793", "0.63302773", "0.6233157", "0.6202936", "0.61929715", "0.61892015", "0.6185677", "0.6175933", "0.61495763", "0.6146274", "0.6141519", "0.61402285", "0.6120325", "0.60868...
0.65383846
2
Reemplazar Model por el modelo que corresponda al modulo
public function run() { if(isset($_GET['id'])){ $id = $_GET['id']; } else{ $id = ''; } if($id != ""){ $catalogo = Catalogos::model()->findByPk($id); } else{ $catalogo = new Catalogos; } if(isset($_POST['Catalogos'])){ $catalogo->attributes = $_POST['Catalogos']; $catalogo->save(); $id = $catalogo->id; $this->controller->redirect(Yii::app()->createUrl('/administracion/default/formCatalogo/', array('id' => $id))); } if(isset($_GET['producto'])){ $producto = $_GET['producto']; } else{ $producto = ''; } if(isset($_GET['accion'])){ $accion = $_GET['accion']; } else{ $accion = ''; } if(isset($_GET['despues'])){ $despues = $_GET['despues']; } else{ $despues = ''; } if(isset($_GET['nombre'])){ $nombre = $_GET['nombre']; } else{ $nombre = ''; } if(isset($_GET['minimo'])){ $minimo = str_replace(".", "", $_GET['minimo']); $minimo_ingresado = $_GET['minimo']; } else{ $minimo = ''; $minimo_ingresado = ''; } if(isset($_GET['maximo'])){ $maximo = str_replace(".", "", $_GET['maximo']); $maximo_ingresado = $_GET['maximo']; } else{ $maximo = ''; $maximo_ingresado = ''; } if(isset($_GET['estado'])){ $estado = $_GET['estado']; } else{ $estado = 1; } if(isset($_GET['tipo'])){ $tipo = $_GET['tipo']; } else{ $tipo = ''; } if(isset($_GET['linea'])){ $linea = $_GET['linea']; } else{ $linea = ''; } $errores = ''; //Calculo de errores if($minimo != '' && !is_numeric($minimo)){ $minimo = ''; $errores = $errores . "- Desde debe ser un valor numerico<br>"; } if($maximo != '' && !is_numeric($maximo)){ $maximo = ''; $errores = $errores . "- Hasta debe ser un valor numerico<br>"; } //Fin del calculo de errores if($errores != ''){ $errores = '<div class="alert alert-warning" role="alert">' . $errores . '</div>'; } if($minimo == ''){ $min = -1; } else{ $min = $minimo; } if($maximo == ''){ $max = 1000000000; } else{ $max = $maximo; } if($producto != ''){ $this->aplicar($id, $producto, $accion, $despues); unset($_GET['producto']); } $criteria = new CDbCriteria; $criteria->compare('id_catalogo', $id); $criteria->order = 'posicion ASC'; $productos_catalogo_ids = ProductosCatalogo::model()->findAll($criteria); $productos_catalogo = new CActiveDataProvider(new ProductosCatalogo, array('criteria' => $criteria)); $ids = array(); foreach($productos_catalogo_ids as $i){ $ids[] = $i['id_producto']; } $criteria = new CDbCriteria; $criteria->addCondition('precio_producto >= ' . $min . ' AND precio_producto <= ' . $max); $criteria->addCondition('nombre_producto LIKE "%'. $nombre . '%"'); $criteria->addNotInCondition('id', $ids); $criteria->compare('estado_producto', $estado); $criteria->compare('id_tipo_producto', $tipo); $criteria->compare('id_linea_producto', $linea); $reporte = new CActiveDataProvider(new Productos, array('criteria' => $criteria)); $tipos = CHtml::listData(TiposProducto::model()->findAll(), 'id', 'nombre_tipo_producto'); $tipos[""] = 'Todas los tipos'; ksort($tipos); $lineas = CHtml::listData(LineasProducto::model()->findAll(), 'id', 'nombre_linea_producto'); $lineas[""] = 'Todas las lineas'; ksort($lineas); $this->controller->render('formulario_catalogos',array( 'nombre' => $nombre, 'minimo' => $minimo, 'maximo' => $maximo, 'estado' => $estado, 'tipo' => $tipo, 'linea' => $linea, 'errores' => $errores, 'id' => $id, 'producto' => $producto, 'catalogo' => $catalogo, 'dataProvider' => $reporte, 'productos_catalogo' => $productos_catalogo, 'tipos' => $tipos, 'lineas' => $lineas, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function model();", "abstract protected function model();", "abstract protected function model();", "abstract function model();", "abstract function model();", "abstract function model();", "abstract function model();", "public function modulo(){\n return $this->belongsTo('A...
[ "0.6640075", "0.65487695", "0.65487695", "0.6525854", "0.6525854", "0.6525854", "0.6525854", "0.6522622", "0.6501978", "0.6501978", "0.6501978", "0.6501978", "0.6470406", "0.64699185", "0.6320553", "0.63167083", "0.6243065", "0.6113767", "0.6113767", "0.5995438", "0.59857804"...
0.0
-1
Verify that there an implementation for the recorded protocol
public static function getInstance($oTicketingConfig, $bLoggingEnabled) { $sClass = 'Ticketing_Import_'.strtoupper($oTicketingConfig->protocol); if (!class_exists($sClass)) { throw new Exception("Invalid protocol in the current ticketing_config: {$oTicketingConfig->protocol}. There is no implementation of this protocol ({$sClass})"); } // Return an instance of the implementation class $oInstance = new $sClass($oTicketingConfig, $bLoggingEnabled); return $oInstance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function verifyImplementation()\n {\n }", "public function testSerializationCapabilities()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n $tmp = serialize($protocol);\n $tmp = unserialize($tmp);\n\n $this->assertEquals($protocol, $tmp);\n $th...
[ "0.70697767", "0.594251", "0.5503519", "0.54659015", "0.5463955", "0.54587543", "0.5349956", "0.5349956", "0.52931255", "0.5283725", "0.5247275", "0.52162075", "0.51983833", "0.5111475", "0.50989795", "0.5077895", "0.50709355", "0.50644857", "0.5059951", "0.5059951", "0.50355...
0.0
-1
Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) { // For security, start by assuming the visitor is NOT authorized. $isValid = False; // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") && false) { $isValid = true; } } return $isValid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function checkPageAllowed() {\n\n if (!$this->user->isPersonnalManager()) {\n\n header('Location: ./index.php');\n exit();\n }\n }", "public function restricted()\n {\n $site = new SiteContainer($this->db);\n\n $site->printHeader();\n if (iss...
[ "0.7619632", "0.7072883", "0.6896645", "0.68458045", "0.67869216", "0.67810124", "0.6758489", "0.6695543", "0.66813356", "0.66748095", "0.6660849", "0.66419417", "0.66035354", "0.6597928", "0.65839565", "0.6561224", "0.6559891", "0.6547126", "0.6542498", "0.654157", "0.653742...
0.0
-1
Fired just before querying.
public function onQuerying(Builder $query) { if ($discount = $this->getDiscount()) { $query->where('discount_id', $discount->getId()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pre_query() { \r\n // Unset invalid date values before the query runs.\r\n if (!empty($this->view->args) && count($this->view->args) > $this->position) {\r\n $argument = $this->view->args[$this->position];\r\n $parts = $this->date_handler->arg_parts($argument);\r\n if (empty($parts[0]...
[ "0.6609827", "0.6597186", "0.6559771", "0.6520574", "0.64788073", "0.6369351", "0.6236459", "0.62258685", "0.6171485", "0.61372197", "0.6119678", "0.6098182", "0.6098182", "0.60953087", "0.6070383", "0.60596144", "0.6058109", "0.60563844", "0.6048864", "0.6043183", "0.6041956...
0.0
-1
seta todos os atributos
public function sets(array $atributos){ foreach ($atributos as $atributo=>$valor){ switch ($atributo){ case 'senha': $this->$atributo = sha1($_POST[$atributo]); break; default: $this->$atributo = $_POST[$atributo];break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setAtributos($atributos)\n {\n $this->atributos = collect($atributos)->map(function ($item) {\n return [\"atributo_id\" => $item];\n });\n }", "public function setAttributes();", "private function addAtrributesToCRUD() {\r\n if (!empty($this->__attributes))...
[ "0.69275504", "0.62879723", "0.58324474", "0.56806564", "0.5678256", "0.5557661", "0.5530896", "0.5518108", "0.55104375", "0.5472165", "0.5460451", "0.54436713", "0.5439721", "0.5411758", "0.540787", "0.53992563", "0.53980637", "0.5364945", "0.5364144", "0.5338474", "0.526988...
0.5738588
3
/ This is a code that prints a minileaguetable such as team1 9 team4 8 team9 8 team2 4 FEEL FREE TO MODIFY!! / Module: Tplleaguestats Author: Mithrandir/TPL Design Licence: GNU
function b_minitable_show( ) { global $xoopsDB; $module_handler =& xoops_gethandler('module'); $module =& $module_handler->getByDirname('cricketstats'); //Get config for News module $config_handler =& xoops_gethandler('config'); if ($module) { $moduleConfig =& $config_handler->getConfigsByCat(0, $module->getVar('mid')); } //Season id $sql = "SELECT SeasonID, SeasonName FROM ".$xoopsDB->prefix("cricket_seasonnames")." WHERE SeasonDefault=1"; $cricket_seasonname = $xoopsDB->query($sql); $cricket_seasonname = $xoopsDB->fetchArray($cricket_seasonname); $cricket_season_id = $cricket_seasonname['SeasonID']; $cricket_seasonname = $cricket_seasonname['SeasonName']; //League id $sql2 = "SELECT LeagueID, LeagueName FROM ".$xoopsDB->prefix("cricket_leaguenames")." WHERE LeagueDefault=1"; $cricket_leaguename = $xoopsDB->query($sql2); $cricket_leaguename = $xoopsDB->fetchArray($cricket_leaguename); $cricket_league_id = $cricket_leaguename['LeagueID']; $cricket_leaguename = $cricket_leaguename['LeagueName']; //For win, draw and lost? $cricket_for_win = $moduleConfig['forwin']; $cricket_for_draw = $moduleConfig['fordraw']; $cricket_for_lose = $moduleConfig['forloss']; //Query to get teams from selected season & league $cricket_get_teams = $xoopsDB->query("SELECT DISTINCT O.OpponentName AS name, O.OpponentID AS id FROM ".$xoopsDB->prefix("cricket_opponents")." O, ".$xoopsDB->prefix("cricket_leaguematches")." LM WHERE LM.LeagueMatchSeasonID = '$cricket_season_id' AND LM.LeagueMatchLeagueID = '$cricket_league_id' AND (O.OpponentID = LM.LeagueMatchHomeID OR O.OpponentID = LM.LeagueMatchAwayID) ORDER BY name"); //Lets read teams into the table $i = 0; while($cricket_data = $xoopsDB->fetchArray($cricket_get_teams)) { $team[$cricket_data['id']]['name'] = $cricket_data['name']; $team[$cricket_data['id']]['homewins'] = 0; $team[$cricket_data['id']]['awaywins'] = 0; $team[$cricket_data['id']]['homeloss'] = 0; $team[$cricket_data['id']]['awayloss'] = 0; $team[$cricket_data['id']]['hometie'] = 0; $team[$cricket_data['id']]['awaytie'] = 0; $team[$cricket_data['id']]['homerunsfor'] = 0; $team[$cricket_data['id']]['homerunsagainst'] = 0; $team[$cricket_data['id']]['awayrunsfor'] = 0; $team[$cricket_data['id']]['awayrunsagainst'] = 0; $team[$cricket_data['id']]['matches'] = 0; } //Match data $query = $xoopsDB->query("SELECT LM.LeagueMatchID AS mid, LM.LeagueMatchHomeID as homeid, LM.LeagueMatchAwayID as awayid, LM.LeagueMatchHomeRuns as homeruns, LM.LeagueMatchAwayRuns as awayruns FROM ".$xoopsDB->prefix("cricket_leaguematches")." LM WHERE LM.LeagueMatchSeasonID = '$cricket_season_id' AND LM.LeagueMatchLeagueID = '$cricket_league_id' AND LM.LeagueMatchHomeRuns IS NOT NULL"); while ($cricket_matchdata = $xoopsDB->fetchArray($query)) { $cricket_hometeam = $cricket_matchdata['homeid']; $cricket_awayteam = $cricket_matchdata['awayid']; $team[$cricket_hometeam]['matches'] = $team[$cricket_hometeam]['matches'] + 1; $team[$cricket_awayteam]['matches'] = $team[$cricket_awayteam]['matches'] + 1; $team[$cricket_hometeam]['homerunsfor'] = $team[$cricket_hometeam]['homerunsfor'] + $cricket_matchdata['homeruns']; $team[$cricket_awayteam]['awayrunsagainst'] = $team[$cricket_awayteam]['awayrunsagainst'] + $cricket_matchdata['homeruns']; $team[$cricket_awayteam]['awayrunsfor'] = $team[$cricket_awayteam]['awayrunsfor'] + $cricket_matchdata['awayruns']; $team[$cricket_hometeam]['homerunsagainst'] = $team[$cricket_hometeam]['homerunsagainst'] + $cricket_matchdata['awayruns']; $rundiff = $cricket_matchdata['homeruns'] - $cricket_matchdata['awayruns']; if ($rundiff > 0) { $team[$cricket_hometeam]['homewins'] = $team[$cricket_hometeam]['homewins'] + 1; $team[$cricket_awayteam]['awayloss'] = $team[$cricket_awayteam]['awayloss'] + 1; } elseif ($rundiff == 0) { $team[$cricket_hometeam]['hometie'] = $team[$cricket_hometeam]['hometie'] + 1; $team[$cricket_awayteam]['awaytie'] = $team[$cricket_awayteam]['awaytie'] + 1; } elseif ($rundiff < 0) { $team[$cricket_hometeam]['homeloss'] = $team[$cricket_hometeam]['homeloss'] + 1; $team[$cricket_awayteam]['awaywins'] = $team[$cricket_awayteam]['awaywins'] + 1; } } $cricket_get_deduct = $xoopsDB->query("SELECT points, teamid FROM ".$xoopsDB->prefix("cricket_deductedpoints")." WHERE seasonid = '$cricket_season_id' AND leagueid = '$cricket_league_id'"); while ($cricket_d_points = $xoopsDB->fetchArray($cricket_get_deduct)) { $team[$cricket_d_points["teamid"]]['d_points'] = $cricket_d_points['points']; } foreach ($team as $teamid => $thisteam) { $temp_points = isset($thisteam['d_points']) ? $thisteam['d_points'] : 0; $cricket_points[$teamid] = ($thisteam['homewins'] * $cricket_for_win) + ($thisteam['awaywins'] * $cricket_for_win) + ($thisteam['hometie'] * $cricket_for_draw) + ($thisteam['awaytie'] * $cricket_for_draw) + $temp_points; $cricket_runsfor[$teamid] = $thisteam['homerunsfor'] + $thisteam['awayrunsfor']; $cricket_runsagainst[$teamid] = $thisteam['homerunsagainst'] + $thisteam['awayrunsagainst']; } array_multisort($cricket_points, SORT_NUMERIC, SORT_DESC, $cricket_runsfor, SORT_NUMERIC, SORT_DESC, $cricket_runsagainst, SORT_NUMERIC, SORT_DESC, $team, SORT_STRING, SORT_ASC); //Print the table $block['title'] = _BL_CRICK_MINITABLE; $block['content'] = "<table width='100%' cellspacing='2' cellpadding='2' border='0'> <tr> <td width='50%' align='left'><span style='font-size: 10px; font-weight: bold;'><u>"._BL_CRICK_TEAM."</u></span></td> <td width='15%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>"._BL_CRICK_POINTS."</u></span></td> <td width='35%' align='center'><span style='font-size: 10px; font-weight: bold;'><u>"._BL_CRICK_RUNS."</u></span></td> </tr></table><marquee behavior='scroll' direction='up' width='100%' height='100' scrollamount='1' scrolldelay='60' onmouseover='this.stop()' onmouseout='this.start()'><table width='100%' cellspacing='2' cellpadding='2' border='0'>"; foreach ($team as $teamid => $thisteam) { $block['content'] .= "<tr> <td width='50%' align='left'><span style='font-size: 10px; font-weight: normal;'>".$thisteam['name']."</span></td> <td width='15%' align='center'><span style='font-size: 10px; font-weight: normal;'>".$cricket_points[$teamid]."</span></td> <td width='35%' align='center'><span style='font-size: 10px; font-weight: normal;'>".$cricket_runsfor[$teamid]."-".$cricket_runsagainst[$teamid]."</span></td> </tr>"; } $block['content'] .= "</table><br><div align=\"center\"><a href=\"".XOOPS_URL."/modules/cricketstats/index.php\">"._BL_CRICK_GOTOMAIN."</a></div></marquee>"; return $block; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPlayinTeams(){\n return array(\n //winner to [25]\n array('name'=>'UCLA','elo'=>1542,'off'=>114.1,'def'=>96.8,'tempo'=>64.7),\n array('name'=>'Michigan State','elo'=>1596,'off'=>107.7,'def'=>92.2,'tempo'=>68.6),\n //winner to [17]\n array('name'=>'Texas Southern','...
[ "0.64923745", "0.63641", "0.6343724", "0.6284793", "0.62629074", "0.6219896", "0.6206723", "0.61959416", "0.6145775", "0.61189675", "0.6095231", "0.60321915", "0.5998101", "0.58968467", "0.58784753", "0.58676875", "0.5841235", "0.5841121", "0.5830934", "0.58199495", "0.57998"...
0.60148877
12
/ echo ""; print_r($_POST); $get_date = "20100301";
function ShowDayOfMonth($get_month){ $arr_d1 = explode("-",$get_month); $xdd = "01"; $xmm = "$arr_d1[1]"; $xyy = "$arr_d1[0]"; $get_date = "$xyy-$xmm-$xdd"; // วันเริ่มต้น //echo $get_date."<br>"; $xFTime1 = getdate(date(mktime(0, 0, 0, intval($xmm+1), intval($xdd-1), intval($xyy)))); $numcount = $xFTime1['mday']; // ฝันที่สุดท้ายของเดือน if($numcount > 0){ $j=1; for($i = 0 ; $i < $numcount ; $i++){ $xbasedate = strtotime("$get_date"); $xdate = strtotime("$i day",$xbasedate); $xsdate = date("Y-m-d",$xdate);// วันถัดไป $arr_d2 = explode("-",$xsdate); $xFTime = getdate(date(mktime(0, 0, 0, intval($arr_d2[1]), intval($arr_d2[2]), intval($arr_d2[0])))); if($xFTime['wday'] == 0){ $j++; } if($xFTime['wday'] != "0"){ $arr_date[$j][$xFTime['wday']] = $xsdate; } } }//end if($numcount > 0){ return $arr_date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function datumtest()\n{\n datest($_REQUEST['vondatum']);\n datest($_REQUEST['bisdatum']);\n}", "function formataData($dateString){\n $arr = date_parse($dateString);\n return $arr[\"day\"].\"/\".$arr[\"month\"].\"/\".$arr[\"year\"];\n }", "function getDailyEventData($date) {\n //Check da...
[ "0.62329185", "0.59288216", "0.5884172", "0.58514893", "0.58479774", "0.57871974", "0.57681197", "0.57651544", "0.5614333", "0.5601476", "0.5599552", "0.557984", "0.55598944", "0.55118257", "0.55111307", "0.5488358", "0.5478534", "0.54614586", "0.5454159", "0.5446209", "0.541...
0.0
-1
membuat function agar jadi satu, supaya jadi efektif dan efisien
function query($query) { //untuk memasukkan variabel $conn karena kalau langsung tidak bisa, grgr scope global $conn; //membuat array kosong untuk menampung data $result = mysqli_query($conn, $query); //untuk mengambil data dari database $rows = []; while ($row = mysqli_fetch_assoc($result)) { $rows[] = $row; } return $rows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selmundat($xent, &$area, &$habit, &$freg, &$dia_fer, &$des_fer ) {\n\t$sqls=\"select * from munp1.municip where cod = '$xent'\";\n\t$ress=mysql_db_query(\"munp1\",$sqls); //\n\t\tif ($ress) {\n\t\t\t\t$regs=mysql_fetch_array($ress);\n\t\t\t\tif ( $regs ) {\n\t\t\t\t\t\t\t\t$area = $regs[\"med_area\"];\n\t...
[ "0.6410931", "0.63967806", "0.62682915", "0.6247548", "0.62225175", "0.6212206", "0.61912274", "0.61790836", "0.6177313", "0.61661553", "0.61415726", "0.6129267", "0.60976166", "0.60922754", "0.608096", "0.6071616", "0.6051011", "0.6036798", "0.6030382", "0.60079885", "0.5987...
0.0
-1
/ Load all of the config files in $dir in ascending alphabetical order. The config files must return an associative array of config values. This function returns the final config data after all of the individual files have been processed.
function load_config_array(string $dir) { $tmp = []; $files = scandir($dir, SCANDIR_SORT_ASCENDING); if ($files !== FALSE) { foreach (array_diff($files, ['.', '..']) as $f) { $inc = include($dir.'/'.$f); if (gettype($inc) === 'array') { $tmp = array_merge($tmp, $inc); } else { throw new Exception( "Invalid configuration file. An array wasn't returned." ); } } } return $tmp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadConfig()\n {\n $files = scandir($this->configPath());\n $configs = [];\n\n foreach ($files as $file) {\n $filePath = $this->configPath() . DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n $config = [basename($file, '.php'...
[ "0.6625902", "0.64870507", "0.6368991", "0.6287424", "0.62823313", "0.62162024", "0.6165398", "0.6092302", "0.58190835", "0.58100176", "0.58020794", "0.5790474", "0.5781771", "0.57182914", "0.5700125", "0.5699668", "0.563929", "0.5620406", "0.559804", "0.55779284", "0.5550268...
0.74778056
0
Get the value of a limit.
function gtlim(string $lim) { return LS_LIMITS[$lim]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_limit();", "public function get_limit(){\r\n return $this->limit;\r\n }", "public function Limit()\n {\n return $this->limit;\n }", "public function getLimit();", "public function getLimit();", "public function getLimit();", "public function getLimit();", "publi...
[ "0.7656031", "0.7416968", "0.7297932", "0.7248518", "0.7248518", "0.7248518", "0.7248518", "0.7248518", "0.72483116", "0.72021854", "0.7200688", "0.71900463", "0.71858937", "0.71858937", "0.71858937", "0.71858937", "0.71858937", "0.71858937", "0.71858937", "0.71858937", "0.71...
0.0
-1
getter CreateUser return string
public function getCreateUser() { return $this->CreateUser; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser();", "public function createUser () {\n syslog( LOG_INFO, 'Create a Lineberty User \\n' );\n\n $url = '/users';\n\n return $this->runRequest($url, 'POST', null)...
[ "0.8061539", "0.8061539", "0.8061539", "0.8061539", "0.7437632", "0.7375623", "0.7195846", "0.7191542", "0.7170123", "0.71594274", "0.7113828", "0.702387", "0.6947556", "0.69367456", "0.68981653", "0.6894015", "0.6883233", "0.6840185", "0.6804434", "0.6794672", "0.67791545", ...
0.7682113
4
getter CreateDate return string
public function getCreateDate() { return $this->CreateDate; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCreateDate(): string\n {\n return $this->create_date;\n }", "public function getFormattedCreateDate();", "public function getCreateDate() {\n\t\treturn $this->createDate;\n\t}", "public function getCreateDate() {\n\t\treturn $this->createDate;\n\t}", "public function getCrea...
[ "0.86611164", "0.8269424", "0.8195311", "0.8195311", "0.81687444", "0.8148218", "0.81252027", "0.81252027", "0.8101081", "0.8078374", "0.8078374", "0.8042076", "0.77365196", "0.76338476", "0.76053107", "0.7585533", "0.75786805", "0.75766885", "0.75766885", "0.75766885", "0.75...
0.8178689
4
getter Name return string
public function getContent($Parsed=true) { if($Parsed) { return $this->parseAll($this->Content); } return $this->Content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_name();", "public function get_name();", "public function get_name();", "public static function get_name() : string ;", "public static function get_name() : string ;", "function get_name () {\n return $this -> name;\n }", "public function get_name(){\n\t\treturn $t...
[ "0.85613745", "0.85613745", "0.85613745", "0.8452412", "0.8452412", "0.83556056", "0.8305417", "0.826446", "0.826446", "0.826446", "0.82434535", "0.8239511", "0.82392853", "0.82352793", "0.823188", "0.823188", "0.82278085", "0.82210135", "0.8218475", "0.8214605", "0.82115823"...
0.0
-1
getter Id return string
public function getid() { return $this->Id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getId(): string;", "public function getID(): string;", "public function getId() : string;", "public function getId(): String;", "public function getId() : string{\n retur...
[ "0.8715661", "0.8715661", "0.8715661", "0.8715661", "0.8683094", "0.8646048", "0.8638346", "0.8634006", "0.8634006", "0.85954624", "0.8534424", "0.8492601", "0.846114", "0.846114", "0.846114", "0.846114", "0.846114", "0.846114", "0.846114", "0.846114", "0.846114", "0.846114...
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.789145...
0.0
-1
Get the validation rules that apply to the request.
public function rules(Request $request) { if(!empty($request->input('password'))){ return [ 'name' => 'required|min:2', 'password' => 'min:6|max:255|required', 'password_confirmation' => 'min:6|max:255|same:password' ]; } else { return [ 'name' => 'required|min:2', ]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.8342703", "0.80143493", "0.7937251", "0.79264987", "0.79233825", "0.79048395", "0.78603816", "0.7790699", "0.77842164", "0.77628785", "0.7737272", "0.7733618", "0.7710535", "0.7691693", "0.76849866", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.7683038", "0.76830...
0.0
-1
configure in a private field setting the values in the private fields //
public function construct( $P_customer_Id = "",//setting the values of customerid in the private field $P_first_Name = "",//setting the values of first name in the private field $P_last_Name = "",//setting the values of lastname in the private field $P_City = "",//setting the values of city in the private field $P_Province = "",//setting the values of province in the private field $P_postal_Code = "",//setting the values of postal codein the private field $P_user_Name = "",//setting the values of username in the private field $P_Password = ""//setting the values of password in the private field ) { // ####################################### setting the values of constructor in the parameters ###################################### // if ($P_customer_Id != "") { $this->customer_Id = $P_customer_Id;//setting the values of constructor in the parameters $this->first_Name = $P_first_Name;//setting the values of constructor in the parameters $this->last_Name = $P_last_Name; $this->City = $P_City; $this->Province = $P_Province; $this->postal_Code = $P_postal_Code; $this->user_Name = $P_user_Name; $this->user_Password = $P_Password;//setting the values of constructor in the parameters } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract function setFields();", "protected function setupFields()\n {\n }", "function set_values() {\n\t\tparent::set_values();\n\t\t$currency = new currency($this->_currency_id);\n\t\t\n\t\t$this->order_id->value = $this->_order_id;\n\t\t$this->timestamp->value = date(\"j M Y\");\n\t\t$this->...
[ "0.7261662", "0.6332225", "0.6202813", "0.6167157", "0.61213464", "0.60737234", "0.60400987", "0.60295856", "0.60248417", "0.5962649", "0.5959441", "0.5948813", "0.5947555", "0.5944998", "0.5926447", "0.5903928", "0.5888553", "0.586996", "0.58501285", "0.584928", "0.58488655"...
0.0
-1
this function selects customer according to the variables defined; variables such as: firstname lastname
public function showData($customer_Id) { $connection=new server(); //accessing connection from the server.php file $connection=$connection->serverConnnection();//accessing connection from the server.php file $sql="CALL show_Customer(:customer_Id)"; //command for the sql to show data of the customer for example his name or city $PDOStatement=$connection->prepare($sql); //preapring connection to the sql $PDOStatement->bindParam(":customer_Id",$customer_Id); //binding perimeter $PDOStatement->execute(); // executing data if($row=$PDOStatement->fetch(PDO::FETCH_ASSOC)) // fetching data { $this->customer_Id=$row["customer_Id"]; $this->first_Name=$row["first_Name"]; $this->last_Name=$row["last_Name"]; $this->City=$row["City"]; $this->Province=$row["Province"]; $this->postal_Code=$row["postal_Code"]; $this->user_Name=$row["user_Name"]; $this->user_Password=$row["user_Password"]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function select_customer()\n {\n $data = array();\n $customer_id = $this->input->post(\"term\");\n \n if ($this->Customer->account_number_exists($customer_id))\n {\n $customer_id = $this->Customer->customer_id_from_account_number($customer_id);\n }\n \...
[ "0.7091138", "0.69389004", "0.65620023", "0.6560951", "0.64903986", "0.64528775", "0.6303862", "0.6205176", "0.6177693", "0.61266565", "0.6123761", "0.6104601", "0.6065274", "0.60475606", "0.5986724", "0.59746593", "0.5954534", "0.5950166", "0.5939307", "0.5934336", "0.590011...
0.0
-1
writing or uploading data to the database this is done for accessing connection from the server.php file
public function writeData() // writing or uploading data to the database { $connection=new server();//accessing connection from the server.php file $connection=$connection->serverConnnection();//accessing connection from the server.php file if($this->customer_Id=='') { $sql="CALL insert_Customer(:first_Name,:last_Name,:City,:Province,:postal_Code,:user_Name,:user_Password)"; // depositing data into the database $PDOStatement=$connection->prepare($sql); // preparing connection to the sql $PDOStatement->bindParam(":first_Name",$this->first_Name); $PDOStatement->bindParam(":last_Name",$this->last_Name); $PDOStatement->bindParam(":City",$this->City); $PDOStatement->bindParam(":Province",$this->Province); $PDOStatement->bindParam(":postal_Code",$this->postal_Code); $PDOStatement->bindParam(":user_Name",$this->user_Name); $PDOStatement->bindParam(":user_Password",$this->user_Password); $PDOStatement->execute(); } else { $sql="CALL update_Customer(:City,:Province,:postal_Code,:user_Password,:user_Name,:customer_Id)"; // depositing the data into the database $PDOStatement=$connection->prepare($sql);// preparing the connections $PDOStatement->bindParam(":City",$this->City);// binding the parameters to the connection $PDOStatement->bindParam(":Province",$this->Province);// binding the parameters to the connection $PDOStatement->bindParam(":postal_Code",$this->postal_Code);// binding the parameters to the connection $PDOStatement->bindParam(":user_Password",$this->user_Password);// binding the parameters to the connection $PDOStatement->bindParam(":user_Name",$this->user_Name);// binding the parameters to the connection $PDOStatement->bindParam(":customer_Id",$this->customer_Id);// binding the parameters to the connection $PDOStatement->execute();// executing the data } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function put(){\r\n\t\t//Connect\r\n\t\t$sql = new DataBase;\r\n\t\t$sql->connect();\r\n\t}", "function post(){\r\n\t\t//Connect\r\n\t\t$sql = new DataBase;\r\n\t\t$sql->connect();\r\n\t}", "function write_to_db(){\n global $jewelry_name,$quality,$price,$discounts,$user_id,$location_id,$table,$conn_obj;\n...
[ "0.77167296", "0.7478669", "0.6679204", "0.6524693", "0.6462344", "0.6432648", "0.6430459", "0.642411", "0.64206064", "0.63026685", "0.62364393", "0.6201386", "0.6170227", "0.6154438", "0.61422473", "0.6133295", "0.6124398", "0.6119805", "0.61183757", "0.611416", "0.61024565"...
0.7119114
2
remove the Customer details from the database this function is for removing the customer from the database
public function removeCustomer($customer_Id) //this function is for removing the customer from the database { $connection=new server();//accessing connection from the server.php file $connection=$connection->serverConnnection();//accessing connection from the server.php file $sql="CALL removeCustomer(:customer_Id)";// initilizing the command to call the source routine $PDOStatement=$connection->prepare($sql); //preparing the connection to the sql $PDOStatement->bindParam(":customer_Id",$customer_Id); // binding the parameters to the connection $PDOStatement->execute();// executing the data }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove_customer()\n\t{\n\t\tglobal $db;\n\n\t\t$sql = \"DELETE FROM preorder_customers WHERE prc_preorderID=$this->preorderID AND prc_customerID=$this->customerID\";\n\t\tmysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t}", "function deleteCustomer() {\n\n // Delete all note...
[ "0.786139", "0.76539934", "0.7140648", "0.70307225", "0.7014123", "0.6989397", "0.69427776", "0.68128586", "0.67163914", "0.66906166", "0.66616917", "0.66133004", "0.65840125", "0.65753514", "0.65753514", "0.65753514", "0.65753514", "0.6567615", "0.65480244", "0.65409005", "0...
0.71658564
2
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }"...
[ "0.8401071", "0.8377486", "0.8377486", "0.8344406", "0.8253731", "0.824795", "0.8213121", "0.8146598", "0.81115526", "0.8083369", "0.7991986", "0.79907674", "0.79836637", "0.79604936", "0.79516214", "0.79494005", "0.79265946", "0.7915068", "0.79001635", "0.7894822", "0.789145...
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'form_type' => ['required', Rule::in([FormType::CREATE_TYPE, FormType::EDIT_TYPE])], 'name' => ['required', Rule::unique('staff')->ignore(request('staff'))], 'id_card_number' => ['nullable', Rule::unique('staff')->ignore(request('staff'))], 'gender' => 'required', 'date_of_birth' => 'nullable|date', 'first_phone' => 'required', 'branch' => ['nullable', 'integer', Rule::requiredIf(request('form_type') == FormType::CREATE_TYPE)], 'position' => 'required|integer', 'profile_photo' => 'nullable|file|mimes:jpg,jpeg,png', 'id_card_photo' => 'nullable|file|mimes:jpg,jpeg,png', //'role' => ['required', Rule::in(array_keys(userRoles()))], 'username' => [Rule::unique('users')->ignore(request('staff')->user ?? null)], 'password' => ['nullable', Rule::requiredIf(request('form_type') == FormType::CREATE_TYPE), 'min:6', 'max:32'], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the sche...
[ "0.83426684", "0.8012867", "0.79357", "0.7925642", "0.7922824", "0.79036003", "0.785905", "0.77895427", "0.77832615", "0.7762324", "0.77367616", "0.7732319", "0.7709478", "0.7691477", "0.76847756", "0.7682022", "0.7682022", "0.7682022", "0.7682022", "0.7682022", "0.7682022", ...
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() { $images = Cache::pull('saleImage'); if (empty($images)) { \Log::info('从缓存中没有获取到图片', []); exit; } foreach (json_decode($images, true) as $image) { $url = "https://pn-activity.oss-cn-shenzhen.aliyuncs.com/market/" . $image; $dingdingUrl = config('app.dingBrandSale'); $dingdingParam = [ 'msgtype' => 'markdown', 'markdown' => [ 'title' => '品类销售占比', 'text' => "![screenshot]({$url})" ], 'at' => [ 'atMobiles' => [''], 'isAtAll' => false, ] ]; $result3 = Curl::curl($dingdingUrl, json_encode($dingdingParam), true, true, true); \Log::info('测试发送图片' . $image, $result3); } }
{ "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
Run the database seeds.
public function run() { //创建用户组 DB::table('shop_categories')->insert( array( array( 'pid' => '28', 'name' => '衣物', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '28', 'name' => '鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '28', 'name' => '帽', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '28', 'name' => '袜', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '28', 'name' => '特殊鞋帽', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '28', 'name' => '婴儿', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '36', 'name' => '含酒精的饮料', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '68', 'name' => '羽绒服装', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '68', 'name' => '裤子', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '68', 'name' => '童装', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '68', 'name' => '内衣', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '68', 'name' => '睡衣', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '68', 'name' => '皮衣', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '68', 'name' => '衬衣', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '69', 'name' => '雨鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '69', 'name' => '运动鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '69', 'name' => '凉鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '69', 'name' => '拖鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '69', 'name' => '运动鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '69', 'name' => '足球鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '69', 'name' => '靴', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '70', 'name' => '帽', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '70', 'name' => '风帽', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '71', 'name' => '短袜', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '71', 'name' => '吊袜带', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '72', 'name' => '滑雪靴', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '72', 'name' => '体操鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '72', 'name' => '爬山鞋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '73', 'name' => '婴儿全套衣', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '73', 'name' => '婴儿睡袋', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '葡萄酒', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '果酒', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '米酒', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '黄酒', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '清酒', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '料酒', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '烧酒', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '鸡尾酒', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '74', 'name' => '白兰地', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), array( 'pid' => '3', 'name' => '其他', 'slug'=> '', 'thumb'=>'', 'description' => '', 'level' => '0', 'sorts' => '100', 'status' => '1', 'created_at' => '2015-01-15 10:10:10', 'updated_at' => '2015-01-15 10:10:10', ), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n fact...
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.78414...
0.0
-1
Returns the static model of the specified AR class. Please note that you should have this exact method in all your CActiveRecord descendants!
public static function model($className = __CLASS__) { return parent::model($className); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function model() {\n return parent::model(get_called_class());\n }", "public function model()\r\n {\r\n return static::class;\r\n }", "public static function model($className=__CLASS__) { return parent::model($className); }", "public static function model($className=__CLA...
[ "0.7572934", "0.75279754", "0.72702134", "0.72696835", "0.72606635", "0.72133243", "0.72126555", "0.71307015", "0.71276915", "0.71276915", "0.71013916", "0.71013916", "0.7101271", "0.707343", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.7063163", "0.706...
0.0
-1
Retrieves a list of models based on the current search/filter conditions.
public function search($pageSize = false) { $criteria = new \CDbCriteria(); $criteria->compare('t.id', $this->id); $criteria->compare('t.subject', $this->subject, true); $criteria->compare('t.to', $this->to, true); $criteria->compare('t.body', $this->body, true); $criteria->compare('t.type', $this->type); $criteria->compare('t.errors', $this->errors); $criteria->compare('t.last_attempt', $this->last_attempt); $criteria->compare('t.status', $this->status); $criteria->compare('t.last_error', $this->last_error, true); return new \CActiveDataProvider($this, array( 'criteria' => $criteria, 'pagination' => array( 'pageSize' => $pageSize ? $pageSize : 50, ), 'sort' => array( 'defaultOrder' => array( 'id' => \CSort::SORT_DESC, ), ), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModels();", "public function getModels();", "public function findAll($model);", "public function getListSearch()\n {\n //set warehouse and client id\n $warehouse_id = ( !is_numeric(request()->get('warehouse_id')) ) ? auth()->user()->current_warehouse_id : request()->get('w...
[ "0.6745192", "0.6745192", "0.6607936", "0.6480248", "0.6380478", "0.6346251", "0.6309924", "0.6302481", "0.62549895", "0.62511677", "0.62511677", "0.6111791", "0.60769993", "0.60728127", "0.60465515", "0.60351735", "0.6033834", "0.601554", "0.5982608", "0.59806865", "0.597930...
0.0
-1
Get columns configs to specified page for grid or detail view
public function genColumns($page) { $columns = array(); switch ($page) { case 'index': $columns = array( array( 'name' => 'id', 'htmlOptions' => array('class' => 'span1 center', ), ), 'subject', array( 'name' => 'to', 'type' => 'html', 'value' => function (EmailQueue $data) { return \CHtml::tag('pre', array(), print_r(jd($data->to), true)); }, ), array( 'name' => 'type', 'value' => function (EmailQueue $data) { return $data->getType(); }, 'filter' => self::getTypes(), 'htmlOptions' => array('class' => 'span1 center', ), ), array( 'name' => 'errors', 'htmlOptions' => array('class' => 'span1 center', ), ), array( 'name' => 'status', 'value' => function (EmailQueue $data) { return $data->getStatus(); }, 'filter' => self::getStatuses(), 'htmlOptions' => array('class' => 'span1 center', ), ), array( 'name' => 'last_error', 'htmlOptions' => array('class' => 'span1 center', ), ), array( 'class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{view}', ), ); break; case 'view': $columns = array( 'id', 'subject', array( 'name' => 'to', 'type' => 'html', 'value' => \CHtml::tag('pre', array(), print_r(jd($this->to), true)), ), 'body:html', array( 'name' => 'type', 'value' => $this->getType(), ), 'errors', array( 'name' => 'last_attempt', 'value' => format()->formatDatetime($this->last_attempt), ), array( 'name' => 'status', 'value' => $this->getStatus(), ), 'last_error', ); break; default: break; } return $columns; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getColumns($page)\n {\n switch ($page) {\n case 'index':\n return [\n ['class' => 'yii\\grid\\SerialColumn'],\n // 'id',\n 'label',\n // 'summary:ntext',\n // 'directio...
[ "0.71503884", "0.6764928", "0.6730456", "0.65779054", "0.62894934", "0.6155866", "0.6063996", "0.6029937", "0.5927109", "0.59175354", "0.59169954", "0.5781238", "0.5747141", "0.5746338", "0.5728248", "0.57201713", "0.57141495", "0.5686432", "0.5686432", "0.5686432", "0.568643...
0.65101314
4
Returns a list of behaviors that this model should behave as.
public function behaviors() { /* * Warning: every behavior need contains fields: * 'configLanguageAttribute' required * 'configBehaviorAttribute' required * 'configBehaviorKey' optional (default: b_originKey_lang, where originKey is key of the row in array * lang will be added in tail */ $languageBehaviors = array(); $behaviors = $this->prepareBehaviors($languageBehaviors); return \CMap::mergeArray( parent::behaviors(), \CMap::mergeArray( $behaviors, array( ) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function behaviors() {\n\t\treturn $this->Behaviors;\n\t}", "public function behaviors()\r\n\t {\r\n\t $behaviors = parent::behaviors();\r\n\r\n\t return $behaviors;\r\n\t }", "public function getBehaviors()\n {\n return $this->getSchema()->behaviors;\n }", "public fun...
[ "0.8171747", "0.7984829", "0.7958152", "0.7933813", "0.78627586", "0.7752681", "0.7660729", "0.75379986", "0.75379986", "0.75379986", "0.75379986", "0.75379986", "0.75379986", "0.75379986", "0.75379986", "0.75379986", "0.752263", "0.752263", "0.7498457", "0.7485555", "0.74753...
0.74484295
21
Metodos CRUD Obtener Ocasion
public function getMesa(){ $page = (isset($_GET['page'])) ? $_GET['page'] : 1; $limite = 5; $limite_inicio = ($page - 1)* $limite; $sql = "SELECT * FROM mesas ORDER BY IdMesa LIMIT $limite_inicio , $limite"; $params = array(null); return Database::getRows($sql, $params); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n return MonitoreoResource::collection(Monitoreo::all());\n //return MonitoreoResource::collection(Conexione::orderBy('ipe_id', 'asc')->get());\n }", "function tipoAlojamientoInstitucion_get(){\n $id=$this->get('id');\n if (count($this->get())>1) {\n ...
[ "0.65438277", "0.6286162", "0.6203246", "0.6136779", "0.6130141", "0.61199343", "0.61191875", "0.61059785", "0.60917425", "0.60915697", "0.6035511", "0.60186267", "0.6012171", "0.5983874", "0.59832597", "0.5963041", "0.5961838", "0.5955806", "0.59425634", "0.5934134", "0.5932...
0.0
-1
In order to provide lazy loading initializing on the configuration values (initialization will happen only on requests that the extension is required) each public method of the resolver must call this method first to verify that configuration values are set correctly.
protected function initialize() { if(!$this->initialized) { $configuration = $this->merge($this->raw,$this->defaultRawConfiguration()); foreach($configuration['types'] as $type) { $this->parsed['type'][$type['name']] = $type['values']; $this->priorities['type'] = array_merge($this->priorities['type'],$type['values']); if(!isset($this->defaults['type'])) { $this->defaults['type'] = new NegotiationResult($type['name'],$type['values'][0]); } } $this->parsed['headers'] = $configuration['headers']; $this->initialized = true; } return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function ensureConfiguration(): void {\n if (!$this->_isInitialized) {\n $this->configure();\n $this->_isInitialized = true;\n }\n }", "protected function initializeConfiguration() {}", "private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n ...
[ "0.6536456", "0.6534109", "0.65053105", "0.6185725", "0.61296546", "0.59902954", "0.5978078", "0.5977943", "0.59682727", "0.5943293", "0.592263", "0.5905164", "0.5899797", "0.5882632", "0.5868527", "0.5867208", "0.5856459", "0.5836755", "0.58293176", "0.5818244", "0.57902795"...
0.0
-1
Merges the defined extension configuration with the default values.
protected function merge(array $rawConfiguration, array $defaultConfiguration) { foreach($defaultConfiguration as $section=>$configuration) { if($this->isNegotiationConfiguration($section)) { if(isset($rawConfiguration[$section])) { if(count($rawConfiguration[$section]) > 0) { $defaultConfiguration[$section] = $rawConfiguration[$section]; } } $appendSection = 'append_'.$section; if(isset($rawConfiguration[$appendSection])) { if(count($rawConfiguration[$appendSection]) > 0) { $defaultConfiguration[$section] = $this->mergeSection($rawConfiguration[$appendSection],$defaultConfiguration[$section]); } } } else { if(isset($rawConfiguration[$section])) { if(is_array($rawConfiguration[$section])) { foreach($configuration as $index=>$item) { if(isset($rawConfiguration[$section][$index])) { $defaultConfiguration[$section][$index] = $rawConfiguration[$section][$index]; } } } else { $defaultConfiguration[$section] = $rawConfiguration[$section]; } } } } $this->negotiationEnabled = $defaultConfiguration['negotiation']['enabled']; $this->serializerEnabled = $defaultConfiguration['serializer']['enabled']; $this->normalizerEnabled = $defaultConfiguration['normalizer']['enabled']; $this->validatorEnabled = $defaultConfiguration['validator']['enabled']; return $defaultConfiguration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function mergeDefaultSettings(){\n\t\t//Get a copy of the default configuration.\n\t\t$defaultConfig = $this->getDefaultConfig();\n\t\t//Check for a 'general' section\n\t\tif(array_key_exists('general', $this->configuration)){\n\t\t\t//If it exists, compare the default keys to the loaded config for missing...
[ "0.7424907", "0.70438117", "0.6783168", "0.66781783", "0.66365457", "0.6515195", "0.62886626", "0.6164226", "0.6102843", "0.59403396", "0.5934853", "0.589574", "0.58764935", "0.5843044", "0.5841047", "0.58130175", "0.5797986", "0.5794138", "0.57897735", "0.5788802", "0.57759"...
0.59103894
11
Merges a raw configuration section with the default values.
protected function mergeSection(array $raw, array $default) { foreach($raw as $rawItem) { if($this->isValidNegotiationNode($rawItem)) { $append = true; foreach($default as $defaultIndex=>$defaultItem) { if($defaultItem['name'] == $rawItem['name']) { $default[$defaultIndex] = $rawItem; $append = false; break; } } if($append) { $default[] = $rawItem; } } } return $default; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function mergeDefaultSettings(){\n\t\t//Get a copy of the default configuration.\n\t\t$defaultConfig = $this->getDefaultConfig();\n\t\t//Check for a 'general' section\n\t\tif(array_key_exists('general', $this->configuration)){\n\t\t\t//If it exists, compare the default keys to the loaded config for missing...
[ "0.749983", "0.7245167", "0.5840686", "0.58113533", "0.5810566", "0.57497084", "0.5726198", "0.57044166", "0.5636673", "0.5592329", "0.5437934", "0.54314816", "0.5426732", "0.54224604", "0.5414891", "0.541312", "0.5390988", "0.5377829", "0.53415066", "0.5312665", "0.5303121",...
0.6437299
2
Checks if a negotiation configuration node is valid.
protected function isValidNegotiationNode($node) { return isset($node['name']) && isset($node['values']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkConfig();", "public function checkIfEssentialConfigurationExists() {}", "public function validate() {\n\n if (empty($this->config['default_pool_read'])) {\n throw new neoform\\config\\exception('\"default_pool_read\" must be set');\n }\n\n if...
[ "0.5878896", "0.5770419", "0.57083994", "0.56578624", "0.56207883", "0.56018627", "0.55906296", "0.5585302", "0.5505117", "0.5476201", "0.54346174", "0.5431089", "0.540532", "0.5344221", "0.5335364", "0.5329896", "0.53082013", "0.5284131", "0.5270382", "0.5237624", "0.5231939...
0.7306595
0
Checks if the tag refers to a negotiation label inside the configuration.
protected function isNegotiationConfiguration($tag) { return $tag === 'types'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hasLabel($label)\n {\n }", "public function hasLabel()\n {\n return !empty($this->getLabel());\n }", "protected function isValidNegotiationNode($node)\n {\n return isset($node['name']) && isset($node['values']);\n }", "public function isLabel(){\n return...
[ "0.5808836", "0.5628761", "0.5506165", "0.5444188", "0.54050064", "0.5356012", "0.53442526", "0.5320642", "0.5267324", "0.52647257", "0.51848006", "0.51029366", "0.5055671", "0.50329393", "0.50117046", "0.5006299", "0.49748126", "0.4946779", "0.4939217", "0.49230802", "0.4910...
0.69135344
0
Creates an empty negotiation structure.
protected static function emptyNegotiationContext() { return [ 'type' => [] ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initialize()\n {\n if(!$this->initialized)\n {\n $configuration = $this->merge($this->raw,$this->defaultRawConfiguration());\n foreach($configuration['types'] as $type)\n {\n $this->parsed['type'][$type['name']] = $type['values'];\...
[ "0.54322267", "0.54147947", "0.5130342", "0.50612366", "0.4748651", "0.47238803", "0.47021398", "0.45461985", "0.45281282", "0.44854885", "0.44424853", "0.4429355", "0.4380007", "0.43118957", "0.43019816", "0.42960608", "0.4271581", "0.42355886", "0.42336273", "0.4231805", "0...
0.64437264
0
Provides a default configuration to merge with the extension configuration.
protected function defaultRawConfiguration() { return [ 'negotiation' => [ 'enabled' => false, ], 'serializer' => [ 'enabled' => true ], 'normalizer' => [ 'enabled' => false ], 'validator' => [ 'enabled' => false ], 'types' => [ [ 'name' => 'json', 'values'=> [ 'application/json','text/json' ], 'restrict' => null ], [ 'name' => 'xml', 'values' => [ 'application/xml','text/xml' ], 'restrict' => null ] ], 'headers' => [ 'content_type' => 'content-type', 'accept_type' => 'accept' ] ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function defaultConfig();", "public function getDefaultConfiguration();", "private function mergeDefaultSettings(){\n\t\t//Get a copy of the default configuration.\n\t\t$defaultConfig = $this->getDefaultConfig();\n\t\t//Check for a 'general' section\n\t\tif(array_key_exists('general', $this->configurati...
[ "0.736358", "0.7275711", "0.7114066", "0.7086317", "0.7043768", "0.67724633", "0.67504126", "0.6583964", "0.65776575", "0.64758164", "0.6471749", "0.642997", "0.64287823", "0.64043087", "0.63616365", "0.63530725", "0.63326323", "0.6321696", "0.62999743", "0.6241815", "0.62364...
0.6054971
33
Loads the symfony parsed configuration inside the resolver.
public function load(array $configuration) { $this->raw = $configuration; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function loadConfiguration()\n {\n // Get bundles paths\n $bundles = $this->kernel->getBundles();\n $paths = array();\n $pathInBundles = 'Resources' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'nekland_admin.yml';\n\n foreach ($bundles as $bun...
[ "0.6115601", "0.60963166", "0.6091193", "0.6090177", "0.6076337", "0.58768284", "0.5802997", "0.57772124", "0.56862104", "0.565992", "0.56595993", "0.56366956", "0.56157947", "0.5578849", "0.5546092", "0.5531601", "0.5527011", "0.5525959", "0.5517519", "0.55141294", "0.549813...
0.0
-1
Generates a NegotiationResult based on the values provided and the configuration options.
protected function resolveNegotiatedValue($value, $context) { $this->initialize(); if($value === null) { return $this->defaults[$context]; } foreach($this->parsed[$context] as $name=>$types) { foreach($types as $type) { if($value === $type) { return new NegotiationResult($name,$type); } } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initialize()\n {\n if(!$this->initialized)\n {\n $configuration = $this->merge($this->raw,$this->defaultRawConfiguration());\n foreach($configuration['types'] as $type)\n {\n $this->parsed['type'][$type['name']] = $type['values'];\...
[ "0.50932235", "0.44757518", "0.44504178", "0.44391856", "0.44092762", "0.4406019", "0.43244046", "0.43134257", "0.43047613", "0.42979324", "0.42766747", "0.42515922", "0.42505875", "0.4245649", "0.42223153", "0.4213374", "0.41792318", "0.4158132", "0.41507235", "0.41425627", ...
0.42076224
16
Returns a resolved header. The method accepts dashes and underscores as well.
protected function getHeader($header) { $this->initialize(); $header = str_replace('-','_',$header); return isset($this->parsed['headers'][$header]) ? $this->parsed['headers'][$header] : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getHeader(string $header): string;", "public function getHeader(string $name): string;", "public function getHeader($header)\n {\n foreach ($this->headers as $key => $value)\n {\n if (str_replace('-', '_', strtolower($key)) == str_replace('-', '_', strtolower($header...
[ "0.7525669", "0.68599313", "0.6848127", "0.6826382", "0.6826382", "0.6826382", "0.6708433", "0.66917855", "0.66518945", "0.6643946", "0.6635199", "0.6633369", "0.65857875", "0.6575575", "0.6561596", "0.6509082", "0.64715135", "0.6466595", "0.64596653", "0.64577746", "0.64465"...
0.6784575
6
Returns the content type of the request based on the configuration and the header values
public function resolveContentType(Request $request) { $this->initialize(); if($this->_contentType !== null) { return $this->_contentType; } if($this->negotiationEnabled) { $this->_contentType = $this->resolveNegotiatedValue( $this->negotiation->negotiateType( is_array($this->priorities['type']) ? $this->priorities['type'] : [], $request->headers->get($this->getHeader('content-type')) ), 'type' ); if($this->_contentType !== null) { return $this->_contentType; } } return $this->defaults['type']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function get_content_type() {\n\n\t $ct = $this->content_types();\n\t $a = trim(reset(explode(',',$_SERVER['HTTP_ACCEPT'])));\n\t \n\t\theader('Content-type:'.$a); // Set header\n\t\n\t if (array_key_exists($a,$ct)) return $ct[$a];\n\t // throw error\n\t throw new Exception('Content type unknown - '....
[ "0.74477875", "0.738685", "0.7370415", "0.735849", "0.7298891", "0.7235673", "0.71844727", "0.7028118", "0.70188946", "0.69513553", "0.68961316", "0.6847535", "0.6790989", "0.678865", "0.6748721", "0.6720873", "0.66900635", "0.66724586", "0.6616281", "0.6609297", "0.6587644",...
0.64021903
32