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
um produto pertence a uma categoria ==> belongsTo <==
public function categories(){ return $this->belongsTo('App\Category'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function categoria()\n {\n return $this->belongsTo(Categoria::class);\n }", "public function categoriaJuego(){\n //relacion de uno a uno\n return $this->belongsTo(CategoriaJuego::class,'categoria_id');\n }", "public function categoria()\n {\n return $this->belongsTo(C...
[ "0.6947008", "0.68743485", "0.6744014", "0.66799796", "0.6662922", "0.6659786", "0.6622099", "0.6543894", "0.653978", "0.6531347", "0.652193", "0.65083194", "0.63613284", "0.63286746", "0.63120526", "0.6271393", "0.62599844", "0.6234162", "0.6196422", "0.6193689", "0.6190167"...
0.60035944
45
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() { $today = Date('Y-m-d'); // gets today's date // get investment with today being the next_payout_date $investment = Investment::where('is_rented', 1) ->where('is_filled', 1) ->where('is_active', 1) ->where('is_complete', 0) ->whereDate('next_rent_payment_date', $today) ->get(); // check if investments were found if ($investment->count() > 0) { // investment found - loop through gotten investment(s) foreach($investment as $investments) { // get users that invested in the investment $user_investment = UserInvestment::where('is_paid', 1) ->where('investment_id', $investments->id) ->get(); // loop through all users record foreach($user_investment as $user_investments) { // create new user rent payout $rent_payout = new RentPayout(); $rent_payout->user_id = $user_investments->user_id; // sets user id $rent_payout->investment_id = $user_investments->investment_id; // sets investment id $rent_payout->amount_paid = app('App\Http\Controllers\Helper')->calculate_roi($user_investments->amount, $investments->property_listing->rentage_profit_percent); $rent_payout->is_paid = 0; // sets is_paid // save record $rent_payout->save(); } // end inner foreach // check investment next payment date and update record if($investments->next_rent_payment_date < $investments->last_rent_payment_date) { // investment is still active - update investment next rent payment date $investments->update(['next_rent_payment_date' => app('App\Http\Controllers\Helper')->next_rent_calculation()]); } else if($investments->next_rent_payment_date >= $investments->last_rent_payment_date) { // investment has expired echo 'Not updated'; } } // end outer foreach } else { // no investment found. echo 'No record found.'; } }
{ "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.6469205", "0.6463761", "0.6426904", "0.63497347", "0.6316859", "0.6273603", "0.6260993", "0.6260039", "0.6234982", "0.6224031", "0.62203085", "0.62127924", "0.61931187", "0.61907774", "0.61823803", "0.61771643", "0.61763066", "0.6173071", "0.614875", "0.61481935", "0.61478...
0.0
-1
Never delete this line!
public function Create() { parent::Create(); //These lines are parsed on Symcon Startup or Instance creation //You cannot use variables here. Just static values. $this->RegisterPropertyString("IPAddress", ""); $this->RegisterPropertyInteger("DefaultVolume", 15); $this->RegisterPropertyBoolean("GroupCoordinator", false); $this->RegisterPropertyBoolean("GroupForcing", false); $this->RegisterPropertyBoolean("MuteControl", false); $this->RegisterPropertyBoolean("LoudnessControl", false); $this->RegisterPropertyBoolean("BassControl", false); $this->RegisterPropertyBoolean("TrebleControl", false); $this->RegisterPropertyString("FavoriteStation", ""); $this->RegisterPropertyString("WebFrontStations", "<all>"); $this->RegisterPropertyString("RINCON", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delete_first_line() {\n\t\tarray_shift($this->record);\n\t\treturn true;\n\t}", "public function clearLine();", "function divertUnsecureLine() \n {\n // Abstract Method\n }", "protected function new_line()\n {\n }", "public function quash_unused() {\n\t\t// Don't put an...
[ "0.6269645", "0.61660916", "0.60603666", "0.59905016", "0.59897596", "0.5986021", "0.59078115", "0.5901067", "0.58676374", "0.5865531", "0.5848876", "0.58364946", "0.58364946", "0.58141303", "0.580603", "0.5760633", "0.57576114", "0.5755776", "0.57044905", "0.570292", "0.5691...
0.0
-1
This function will be available automatically after the module is imported with the module control. Using the custom prefix this function will be callable from PHP and JSONRPC through: SNS_Play($id);
public function Play() { SetValue($this->GetIDForIdent("Status"), 1); include_once(__DIR__ . "/sonos.php"); (new PHPSonos($this->ReadPropertyString("IPAddress")))->Play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getServiceIdPrefix($id = null);", "public function startSession($id){\n\n }", "function recruitPlayer($cxn,$player,$request)\r\n {\r\n \r\n }", "public function __invoke($id)\n {\n return 'ItemQna controller';\n }", "function play( $id, $id_param, $b...
[ "0.5613562", "0.5309677", "0.53036267", "0.5299545", "0.5239549", "0.5208789", "0.5066883", "0.5038404", "0.5036922", "0.50308466", "0.49945822", "0.49909842", "0.49276367", "0.49003866", "0.4896691", "0.4895888", "0.48779538", "0.48627666", "0.4848418", "0.4848418", "0.48483...
0.488273
16
get variable of coordinator members to be updated
public function SetGroup($groupCoordinator) { if ($groupCoordinator){ $groupMembersID = @IPS_GetObjectIDByIdent("GroupMembers",$groupCoordinator); $uri = "x-rincon:".IPS_GetProperty($groupCoordinator ,"RINCON"); }else{ $groupMembersID = @IPS_GetObjectIDByIdent("GroupMembers",GetValue($this->GetIDForIdent("MemberOfGroup"))); $uri = ""; } // update coordinator members SetValue($this->GetIDForIdent("MemberOfGroup"), $groupCoordinator); if($groupMembersID){ $currentMembers = explode(",",GetValueString($groupMembersID)); $currentMembers = array_filter($currentMembers, function($v) { return $v != ""; }); $currentMembers = array_filter($currentMembers, function($v) { return $v != $this->InstanceID ; }); if($groupCoordinator) $currentMembers[] = $this->InstanceID; SetValueString($groupMembersID,implode(",",$currentMembers)); } // Set relevant variables to hidden/unhidden if ($groupCoordinator){ $hidden = true ; }else{ $hidden = false ; } IPS_SetHidden($this->GetIDForIdent("nowPlaying"),$hidden); IPS_SetHidden($this->GetIDForIdent("Radio"),$hidden); IPS_SetHidden($this->GetIDForIdent("Status"),$hidden); include_once(__DIR__ . "/sonos.php"); (new PHPSonos($this->ReadPropertyString("IPAddress")))->SetAVTransportURI($uri); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getMemberInfo() {\n\n $memberModel = $GLOBALS[\"memberModel\"];\n // Get the member by the membership number\n $GLOBALS[\"member\"] = $memberModel->getOneByMemberNumber($_SESSION[\"MembershipNumber\"]);\n }", "function getMembers(){\n\t\treturn $this->members;\n\t}", "pu...
[ "0.6275716", "0.62488455", "0.612174", "0.56763786", "0.5648223", "0.56042045", "0.55674165", "0.5470387", "0.54659176", "0.545809", "0.53700435", "0.5359694", "0.5322169", "0.52932703", "0.52717173", "0.5243647", "0.52399904", "0.52399904", "0.52290183", "0.5196325", "0.5169...
0.0
-1
Remove on next Symcon update
protected function RegisterProfileInteger($Name, $Icon, $Prefix, $Suffix, $MinValue, $MaxValue, $StepSize) { if(!IPS_VariableProfileExists($Name)) { IPS_CreateVariableProfile($Name, 1); } else { $profile = IPS_GetVariableProfile($Name); if($profile['ProfileType'] != 1) throw new Exception("Variable profile type does not match for profile ".$Name); } IPS_SetVariableProfileIcon($Name, $Icon); IPS_SetVariableProfileText($Name, $Prefix, $Suffix); IPS_SetVariableProfileValues($Name, $MinValue, $MaxValue, $StepSize); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remove() {\r\n global $db;\r\n $db->Execute(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key LIKE 'MODULE\\_PAYMENT\\_NOCHEX%'\");\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_UNINSTALLED');\r\n }", "public function remove() {}", "public function remove() {}", "protected fun...
[ "0.63470113", "0.6156906", "0.6156025", "0.6102737", "0.6064715", "0.6060662", "0.6060662", "0.6060662", "0.6060662", "0.6020867", "0.60156506", "0.5964888", "0.5944525", "0.59149", "0.5856321", "0.5845101", "0.5831783", "0.5823265", "0.5809335", "0.58010304", "0.57823575", ...
0.0
-1
Bootstrap the application services.
public function boot() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function boot()\n {\n // Boot here application\n }", "public function boot()\n {\n $configuration = [];\n\n if (file_exists($file = getcwd() . '/kaleo.config.php')) {\n $configuration = include_once $file;\n }\n\n $this->app->singleton('kaleo', functi...
[ "0.7218277", "0.7040664", "0.7003676" ]
0.0
-1
Register the application services.
public function register() { $this->app->bind(ModalidadesRepositorio::class, function($app) { $user = session('usuario'); if ($user->getUsuarioTipo() !== 1) { return new DoctrineModalidadesOficinaRepositorio($app['em'], $user->getOficina()); } return new DoctrineModalidadesRepositorio($app['em']); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function register()\n {\n $this->registerServices();\n }", "public function register()\n {\n $this->registerAssets();\n $this->registerServices();\n }", "public function register()\n\t{\n\n $this->registerUserService();\n $this->registerCountryService();\n ...
[ "0.72834975", "0.7129936", "0.7108755", "0.70365775", "0.69857496", "0.6981425", "0.69721615", "0.6920895", "0.69191223", "0.6882845", "0.6881585", "0.6819491", "0.6818964", "0.68054336", "0.68047476", "0.6799833", "0.6794076", "0.679339", "0.6788445", "0.67767453", "0.677005...
0.0
-1
for logging user out
function logmemberout() { if(isset($_SESSION['status'])){ unset($_SESSION['status']); } if(isset($_COOKIE[session_name()])) { setcookie(session_name(),'',time() - 1000); session_destroy(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user_logging_out($user_id) {\n \n }", "function LogOut() {\n\t\tunset($user);\n\t\t$loggedIn=false;\n\t}", "public function logoff();", "public function Logoff();", "public function logOut(){\n $this->authToken=\"\";\n $this->loggedUser=\"\";\n $this->clearAuthCookie...
[ "0.85464716", "0.84776306", "0.84578776", "0.8452903", "0.8447081", "0.83406764", "0.834049", "0.8340476", "0.82773876", "0.82243174", "0.816739", "0.81584424", "0.8156745", "0.81485766", "0.8142792", "0.81104314", "0.80997294", "0.8091888", "0.8087008", "0.80839795", "0.8079...
0.0
-1
Run the database seeds.
public function run() { // DB::table('usuarios')->insert([ 'email' => 'prueba@laravel.com', 'password' => bcrypt('123123'), 'nombre' => 'Prueba', 'apellido' => 'Laravel', 'tipo_usuario_id' => 1 ]); }
{ "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.80140394", "0.7980541", "0.79775697", "0.79547316", "0.79514134", "0.79500794", "0.79444957", "0.794259", "0.79382807", "0.7937482", "0.7934376", "0.7892533", "0.7881253", "0.78794724", "0.7879101", "0.7875628", "0.787215", "0.7870168", "0.78515327", "0.7850979", "0.784195...
0.0
-1
Get All Data from this method.
public function __construct() { parent::__construct(); $this->load->library('form_validation'); $this->load->library('session'); $this->load->model('ItemModel'); $this->itemCRUD = new ItemModel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function all () {\n return $this -> data;\n }", "public function getAllData() {\n\t\treturn $this->data;\n\t}", "public function get_all_data()\n\t{\n\t\treturn $this->_data;\n\t}", "public function getAllData() {\n\t\treturn $this->_data;\n\t}", "public function get_all () {\r\n\t\tretur...
[ "0.85837615", "0.8428904", "0.84285253", "0.8336047", "0.83070356", "0.83052504", "0.8240704", "0.8240704", "0.8240704", "0.822425", "0.82225966", "0.82225966", "0.82219005", "0.82012874", "0.8196729", "0.8195132", "0.81811976", "0.8144814", "0.8144814", "0.8144814", "0.81285...
0.0
-1
Display Data this method.
public function index() { $data['data'] = $this->itemCRUD->get(); $this->load->view('theme/header'); $this->load->view('items/list',$data); $this->load->view('theme/footer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function display() {\n\t\techo $this->data;\n\t\treturn;\n\t}", "public function display()\n {\n }", "public function display()\n {\n }", "public function display()\n {\n }", "public function display()\n {\n }", "public function display(){}",...
[ "0.848356", "0.7825854", "0.7825854", "0.7824561", "0.7824561", "0.7800392", "0.766641", "0.74771357", "0.74694645", "0.74694645", "0.73982435", "0.73825043", "0.73521143", "0.7273984", "0.7254176", "0.7240891", "0.72158885", "0.7214003", "0.7163512", "0.7163512", "0.7163512"...
0.0
-1
Show Details this method.
public function show($id) { $item = $this->itemCRUD->find($id); $this->load->view('theme/header'); $this->load->view('items/show',array('item'=>$item)); $this->load->view('theme/footer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function showDetails(){\n $this->_showDetails = true;\n }", "public function show() {\n \n \n }", "public abstract function showInfo();", "public function show()\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "p...
[ "0.8088023", "0.738295", "0.7327596", "0.7310155", "0.7283431", "0.7283431", "0.7283431", "0.7265745", "0.72369003", "0.72369003", "0.7231198", "0.72217345", "0.72217345", "0.7214952", "0.7210832", "0.7200316", "0.71963376", "0.7185117", "0.7175417", "0.7175095", "0.7170964",...
0.0
-1
Create from display on this method.
public function create() { $this->load->view('theme/header'); $this->load->view('items/create'); $this->load->view('theme/footer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct(){\n // 表示部分で使うオブジェクトを作成\n $this->initDisplayObj();\n }", "public function __construct() {\n // 表示部分で使うオブジェクトを作成\n $this->initDisplayObj();\n }", "public function display(){}", "public function display() {}", "public function display() {}", "p...
[ "0.70501673", "0.69917846", "0.685978", "0.6642612", "0.6642612", "0.663679", "0.663679", "0.663453", "0.663453", "0.65667886", "0.65202653", "0.6473039", "0.6338563", "0.62509596", "0.62509596", "0.6242798", "0.6241776", "0.6241776", "0.6241776", "0.6207547", "0.6169833", ...
0.0
-1
Store Data from this method.
public function store() { $this->form_validation->set_rules('title', 'Title', 'required'); $this->form_validation->set_rules('description', 'Description', 'required'); if ($this->form_validation->run() == FALSE){ $this->session->set_flashdata('errors', validation_errors()); redirect(base_url('items/create')); }else{ $this->itemCRUD->insert(); redirect(base_url('items')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store()\n\t {\n\t //\n\t }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store() {\n\t\t//\n\t}", "p...
[ "0.78831536", "0.7853703", "0.7706655", "0.7706655", "0.7706655", "0.7704193", "0.7704193", "0.7704193", "0.7616251", "0.76076007", "0.76076007", "0.76076007", "0.76076007", "0.76076007", "0.76076007", "0.76076007", "0.76076007", "0.76076007", "0.76076007", "0.76076007", "0.7...
0.0
-1
Edit Data from this method.
public function edit($id) { $item = $this->itemCRUD->find($id); $this->load->view('theme/header'); $this->load->view('items/edit',array('item'=>$item)); $this->load->view('theme/footer'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function updateData();", "public function edit() {\n\t\t\t\n\t\t}", "public function edit()\n {\n \n }", "public function edit()\n\t{\n\t\t//\n\t}", "protected function editar()\n {\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function edit()...
[ "0.72822595", "0.71372586", "0.6881146", "0.6873769", "0.6872038", "0.6818677", "0.67760456", "0.67701715", "0.67240393", "0.67240393", "0.67240393", "0.6721128", "0.67084634", "0.67084634", "0.6629793", "0.6628123", "0.6626255", "0.6626255", "0.6626255", "0.6600118", "0.6600...
0.0
-1
Update Data from this method.
public function update($id) { $this->form_validation->set_rules('title', 'Title', 'required'); $this->form_validation->set_rules('description', 'Description', 'required'); if ($this->form_validation->run() == FALSE){ $this->session->set_flashdata('errors', validation_errors()); redirect(base_url('items/edit/'.$id)); }else{ $this->itemCRUD->update($id); redirect(base_url('items')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function updateData();", "protected function update() {}", "protected function _update()\n {\n \n }", "protected function _update()\n {\n \n }", "public function update()\r\n {\r\n \r\n }", "public function update()\n {\n }",...
[ "0.81320846", "0.7494075", "0.7252398", "0.7252398", "0.69704086", "0.69340694", "0.685862", "0.684912", "0.68358624", "0.6795219", "0.6789106", "0.67502123", "0.6698962", "0.6698962", "0.6681128", "0.66741127", "0.6670744", "0.66554093", "0.66554093", "0.66452", "0.66381246"...
0.0
-1
Delete Data from this method.
public function delete($id) { $item = $this->itemCRUD->delete($id); redirect(base_url('items')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function delete($data)\n {\n }", "public function delete($data)\n {\n }", "public function clearData() {\n unset($this->data);\n }"...
[ "0.79104495", "0.75630206", "0.75630206", "0.73789", "0.71398276", "0.7054691", "0.7028456", "0.70002383", "0.69834363", "0.69571", "0.69564706", "0.6931199", "0.691435", "0.6901109", "0.6900521", "0.6887708", "0.6884362", "0.6879276", "0.6869475", "0.6869475", "0.68693346", ...
0.0
-1
Function to save chat messages and relay to recepient
public function action_chat() { $recepient = $this->request->param('id'); $sender = $this->_current_user; $avatar = ($sender->personnel_info->personnel_avatar) ? $sender->personnel_info->personnel_avatar : 'default.png'; //STEP1: Save the chat message; $message = ORM::factory('Message'); $message->values($this->request->post()); $message->sender = $sender; $message->recepient = $recepient; $message->time = time(); try { $message->save(); //STEP2: Send Chat Notification to Recepient $date = gmdate('m/d/Y H:i:s', $message->time) . " UTC"; $payload = array( 'msg_id' => $message->message_id, 'msg' => $message->message, 'time' => $date, 'id' => $sender->id, 'username' => $sender->username, 'avatar' => 'assets/avatars/' . $avatar, "local_time" => Date::local_time("now", "m/d/Y H:i:s", "UTC") ); $this->_push('appchat', $payload, array( 'id' => $recepient, 'pushUid'=> Kohana::$config->load("pusher.pushUid") )); $this->_set_msg('Successful sent message', 'success', $payload); } catch(ORM_Validation_Exception $e) { $this->_set_msg('Someone slept on the job', 'error', TRUE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionSendMessage() {\n\n // get data, sent by client\n $data = Yii::app()->request->getPost('chat', array());\n\n // try to store message\n $model = new Chat();\n $result = $model->storeMessage($data);\n\n // prepare return array, set status\n $res...
[ "0.6664889", "0.6569174", "0.65105015", "0.64977884", "0.6429702", "0.6415614", "0.6414149", "0.62557876", "0.6244839", "0.62010616", "0.6194378", "0.6177268", "0.61681765", "0.6135774", "0.6078879", "0.60549617", "0.6047958", "0.6035952", "0.60296375", "0.60248077", "0.60204...
0.7232398
0
Function to save chat messages and relay to recepient
public function action_chat_history() { $this->_template->set('page_title', 'All Messages'); $this->_template->set('page_info', 'view and manage chat messages'); $messages = ORM::factory('Message')->get_grouped_messages($this->_current_user->id); $this->_template->set('messages', $messages); $this->_set_content('messages'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function action_chat() {\n\t\t$recepient = $this->request->param('id');\n\t\t$sender = $this->_current_user;\n\t\t$avatar = ($sender->personnel_info->personnel_avatar) ? $sender->personnel_info->personnel_avatar : 'default.png';\n\t\t//STEP1: Save the chat message;\n\t\t$message = ORM::factory('Message');\n...
[ "0.7232398", "0.6664889", "0.6569174", "0.65105015", "0.64977884", "0.6429702", "0.6415614", "0.6414149", "0.62557876", "0.6244839", "0.62010616", "0.6194378", "0.6177268", "0.61681765", "0.6135774", "0.6078879", "0.60549617", "0.6047958", "0.6035952", "0.60296375", "0.602480...
0.54914933
78
Function to retrieve offline messages from a particular user
public function action_offline_messages() { $sender = $this->request->param('id'); $offline_messages = ORM::factory('Message')->get_offline_messages($this->_current_user->id, $sender); $this->_set_msg('Offline Messages Retrieved', 'success', $offline_messages); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function messages_by_user_get() {\n\t\t$uid = $this->input->get('uid');\n\t\t$skip = $this->input->get('skip');\n\t\t$limit = $this->input->get('limit');\n\n\t\t$messages = $this->Messages_model->getMessagesByUserID($uid, $skip, $limit);\n\t\t\n\t\tforeach($messages as $key=>$value) {\n\t\t\t$id = $messages...
[ "0.6780795", "0.674822", "0.6740253", "0.67117596", "0.65558434", "0.65558434", "0.651822", "0.6502502", "0.6500644", "0.6482182", "0.6426987", "0.6404993", "0.63747907", "0.6374496", "0.63287437", "0.63178515", "0.62996584", "0.6279364", "0.62371874", "0.62257695", "0.621837...
0.77622706
0
Function to mark a sing message as read
public function action_mark_as_read() { if($this->request->param('id')) { $id = $this->request->param('id'); $message = ORM::factory('Message', $id); $message->read = 1; try { $message->save(); $this->_set_msg('Marked as Read', 'success', $message->as_array()); } catch(Exception $e) { $this->_set_msg('Oops something went wrong failed to mark as read', 'error', TRUE); } //$this->redirect($this->request->referrer()); } else if ($this->request->post() && $this->request->post('id')) { $id = $this->request->post('id'); $message = ORM::factory('Message', $id); $message->read = 1; try { $message->save(); $this->_set_msg('Marked as Read', 'success', $message->as_array()); } catch(Exception $e) { $this->_set_msg('Failed to mark as read', 'error', TRUE); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function markAsRead(Message $message): bool;", "function markRead($msgid)\n{\n\tif (is_int($msgid))\n\t\treturn \\dal\\messages\\markRead ($msgid);\n\telse\n\t\treturn 0;\n}", "function mark_read()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_start');\n\n $read=$this->ge...
[ "0.7693829", "0.74338245", "0.74227464", "0.73535556", "0.7236624", "0.7202604", "0.71236086", "0.7084262", "0.6967551", "0.6719541", "0.6701298", "0.66422457", "0.6610905", "0.6590338", "0.65687746", "0.6448554", "0.64173216", "0.6416862", "0.6363332", "0.6303301", "0.630200...
0.69797796
8
Function to mark many messages as read
public function action_mark_all_as_read() { if($this->request->param('id')) { $sender = ORM::factory("User", $this->request->param('id')); $messages = ORM::factory('Message')->where("sender", '=', $sender->id)->find_all(); foreach ($messages as $message) { $model = ORM::factory('Message', $message->message_id); try { $model->read = 1; $model->save(); } catch(Exception $e) { $this->_set_msg('Failed to mark as read', 'error'); } } $this->_set_msg("All conversations with " . $sender->personnel_info->personnel_name . ' were marked as Read', 'success'); $this->redirect($this->request->referrer()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mark_read()\n {\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_start');\n\n $read=$this->get_input_vals();\n\n $this->message_model->save_read($read['uid'],$read['mid'],1);\n\n /* BENCHMARK */ $this->benchmark->mark('func_mark_read_end');\n\n // success\n ...
[ "0.69979167", "0.6703918", "0.6636249", "0.66179955", "0.6535095", "0.6467994", "0.6435783", "0.6430143", "0.6366421", "0.6266", "0.6167882", "0.61663806", "0.61540115", "0.6142393", "0.61039495", "0.6077569", "0.5994711", "0.591745", "0.5885967", "0.5872747", "0.5862917", ...
0.67116755
1
Function to retrieve a recent chat conversation between two users
public function action_recent_chat_history() { $sender = $this->request->param('id'); $messages = ORM::factory('Message')->get_latest_chat_messages($this->_current_user->id, $sender); $this->_set_msg("Retrieved last 5 messages", "success", $messages); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function action_get_conversation() {\n\n\t\t$sender = ORM::factory('User', $this->request->param(\"id\"));\n\t\t$conversations =array();// ORM::factory('Message')->get_conversations($this->_current_user->id, $sender);\n\t\t$post = $this->request->post();\n\t\t$to = \"\";\n\t\t$from = \"\";\n\t\tif($post) {\...
[ "0.7290268", "0.6807004", "0.6734931", "0.6718251", "0.66573954", "0.6640414", "0.66010004", "0.6596083", "0.65521675", "0.65468746", "0.6521288", "0.6512386", "0.65075433", "0.6371828", "0.63287723", "0.6286694", "0.6277833", "0.6268449", "0.6258341", "0.61776704", "0.614571...
0.65158826
11
Function to delete a chat message
public function action_delete() { $id = $this->request->param('id'); if($id) { $message = ORM::factory('Message', $id); if($message->loaded()) { try { $message->delete(); } catch (Exception $e) { $this->_set_msg('Could not delete message because another user is tied to it', 'error'); } } $this->redirect($this->request->referrer()); } $this->_set_content('message_delete'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function messageDelete(Message $message);", "function deleteMessage($chatID, $message_id) {\n global $bot;\n\n $data = array();\n $data['chat_id'] = $chatID;\n $data['message_id'] = $message_id;\n\n return $bot->TelegramApi(\"deleteMessage\", $data);\n}", "function delete_message($chatID, $msgID...
[ "0.8261043", "0.820317", "0.78660065", "0.7633454", "0.7582627", "0.75280154", "0.748587", "0.7449127", "0.7434327", "0.73679495", "0.72992665", "0.72991264", "0.72639024", "0.7239376", "0.71953726", "0.7193042", "0.71840256", "0.71809494", "0.71457124", "0.71367276", "0.7124...
0.765511
3
Function to archive many messages at once
public function action_delete_all_conversations() { $sender = ORM::factory("User", $this->request->param('id')); if ($sender->loaded()) { $messages = ORM::factory('Message')->get_user_conversations($this->_current_user->id, $sender->id); foreach ($messages as $message) { try { $archive = ORM::factory("ArchivedMessage")->archive($message->message_id, $this->_current_user->id); } catch (Exception $e) { $this->_set_msg('Could not archive conversation thread because this would wipe out other users history!', 'error'); } } $this->_set_msg("All conversations with " . $sender->personnel_info->personnel_name . ' were removed from your mailbox', 'success'); $this->redirect($this->request->referrer()); } $this->_set_content('message_delete'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function archiveAllMessage()\n {\n\n $db = $this->getDb();\n $user = $this->getUser();\n $userID = $user->getId();\n\n $queries = [];\n $queries[] = 'UPDATE buiz_message set id_sender_status = '.EMessageStatus::ARCHIVED.' WHERE id_sender = '.$userID.';';\n $queries[] = 'UPDATE buiz_messag...
[ "0.73651636", "0.6480036", "0.571428", "0.56203145", "0.56091815", "0.55122846", "0.5511745", "0.54123104", "0.5401236", "0.53987175", "0.5385846", "0.5341999", "0.5322577", "0.528557", "0.5268313", "0.5243022", "0.5209326", "0.51082367", "0.50609004", "0.50392514", "0.503893...
0.0
-1
Function to retrieve a set inbox contacts based on most recent conversation with them
public function action_conversations() { //STEP1: Get contacts with the most recent message $contacts = ORM::factory('Message')->get_inbox_contacts($this->_current_user->id); $this->_template->set('contacts', $contacts); //STEP2: Return the most recent conversation to display first time page loads //Otherwise return conversation based on user_id param passed in url $user2=""; if ($this->request->param("id")) { $user2 = $this->request->param("id"); } else if(count($contacts)) { $user2 = $contacts[0]['user_info']['user_id']; } $no_messages = (count($contacts)==0) ? True : False; $sender = ORM::factory('User', $user2); $conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender); $this->_template->set('page_title', 'My Conversations'); $this->_template->set("conversation_info", $sender); $this->_template->set("no_messages", $no_messages); $this->_template->set("conversations", $conversations); $this->_set_content('conversations'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getContacts();", "public function getContacts(){\n\t\t// ***\n\t\t// the following code should be ported\n\t\t// so multiple backends are allowed\n\t\t$userOnlineMapper = $this->app['UserOnlineMapper'];\n\t\t$usersOnline = $userOnlineMapper->getOnlineUsers();\n\t\t$syncOnline = $this->app['SyncOn...
[ "0.6320956", "0.6241042", "0.6098973", "0.60935503", "0.60518587", "0.59854156", "0.5916243", "0.59049904", "0.5897746", "0.5879738", "0.5869891", "0.5832868", "0.5811735", "0.5794313", "0.5782151", "0.5775726", "0.57734174", "0.5770536", "0.5747477", "0.57319784", "0.5713804...
0.62006843
2
Function to retrieve the entire conversation with a single user
public function action_get_conversation() { $sender = ORM::factory('User', $this->request->param("id")); $conversations =array();// ORM::factory('Message')->get_conversations($this->_current_user->id, $sender); $post = $this->request->post(); $to = ""; $from = ""; if($post) { $from = date('Y-m-d',strtotime($post['from'])); $to = date('Y-m-d',strtotime($post['to'])); if($to == '1969-12-31') { $to = date('Y-m-d',strtotime('2030-01-01')); } if($from == '1969-12-31') { $from = date('Y-m-d',strtotime('2030-01-01')); } $conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender, $from, $to); }else { $conversations = ORM::factory('Message')->get_conversations($this->_current_user->id, $sender); } $this->_template->set("conversation_info", $sender); $this->_template->set("filters", array("from"=>$from,"to"=>$to,"results"=>$this->_count_all_messages_in_conversation($conversations))); $this->_template->set("conversations", $conversations); $this->_set_content('conversation'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getConversation($id, $fromUser=false){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT * FROM msg_conversation WHERE conv_id=:id ORDER BY date');\n\t\t$statement->execute(array(':id'=>$id));\n\t\treturn $statement->fetchAll(PDO::FETCH_ASSOC);\n\t}", "public function getConversationWith (int $use...
[ "0.7440169", "0.69513035", "0.681697", "0.65520465", "0.6527377", "0.65152216", "0.6510654", "0.6480371", "0.64448404", "0.642741", "0.6410428", "0.6403281", "0.6367946", "0.63518864", "0.62390363", "0.6126855", "0.6103688", "0.6100901", "0.6088312", "0.60726404", "0.60698473...
0.71423113
1
Function to count all the messages from multiple conversation threads
private function _count_all_messages_in_conversation($conversations) { $total_messages = 0; foreach ($conversations as $conversation) { $total_messages += count($conversation['conversations']); } return $total_messages; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function receivedCount();", "public function sentCount();", "public function countMessages() {\n return imap_num_msg($this->imap);\n }", "public function count()\n\t{\n\t\treturn count($this->_messages);\n\t}", "private function msgCount()\n {\n $msg = request('message');\n ...
[ "0.6604231", "0.6578144", "0.6311998", "0.6254085", "0.62120837", "0.61949456", "0.61025316", "0.59845865", "0.5962962", "0.5922883", "0.58728975", "0.58510625", "0.58468395", "0.584548", "0.5834364", "0.58323056", "0.5831323", "0.58201325", "0.5820053", "0.5801109", "0.57837...
0.6512653
2
End User Operator Problem Operator
function get_ProblemsOnWeek($week,$level) { $query = "SELECT p.id,p.userID,u.name,u.nickname,u.photoPath,p.pojProblemID,p.title,p.time,p.source FROM problems AS p,user AS u where p.stat=0 and p.week=$week and p.level=$level and p.userID = u.id and u.stat = 0 order by p.time;"; return mydb_query_return_double_array($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkopration($operator)\r\n {\r\n switch($operator)\r\n {\r\n case 'Add':\r\n return $this->number1 + $this->number2;\r\n break;\r\n\r\n case 'Substract':\r\n return $this->number1 - $this->number2;\r\n bre...
[ "0.69021904", "0.65474665", "0.63550746", "0.61984634", "0.6103864", "0.5987439", "0.5961309", "0.5854882", "0.5854882", "0.5797893", "0.57602066", "0.57602066", "0.5748171", "0.57403564", "0.5677183", "0.56126934", "0.5541809", "0.550578", "0.54169416", "0.53521323", "0.5329...
0.0
-1
End Problem Operator Score Operator
function get_ScoresByWeek($week){ $query = "SELECT s.id,s.userID,u.name,u.nickname,u.photoPath,s.AC,s.ACtime,s.lastModify FROM score AS s, user AS u WHERE s.stat=0 AND u.stat = 0 AND s.userID = u.id AND s.probID IN (SELECT id FROM problems AS p WHERE p.stat=0 AND p.week=$week) ORDER BY s.probID;"; return mydb_query_return_double_array($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function score();", "public function iaqScore();", "public function score(): int;", "public function luxScore();", "public function co2Score();", "public function getScore();", "public function getScore()\n {\n }", "public function visualScore();", "private function score_self...
[ "0.6334382", "0.6111122", "0.5911421", "0.5876335", "0.57137525", "0.56604344", "0.5620892", "0.55221736", "0.5461603", "0.5447388", "0.5320781", "0.5235413", "0.5233876", "0.522462", "0.52189046", "0.52087593", "0.5170214", "0.51662827", "0.5128331", "0.511495", "0.5104946",...
0.0
-1
End Score Operator Comment for problem operator
function get_CommentsByProb($probId) { $query = "SELECT c.id,c.userID,u.name,u.nickname,u.photoPath,c.content,c.time FROM commentsforproblem AS c,user AS u where c.stat=0 and c.probID=$probId AND c.userID=u.id AND u.stat=0 order by c.time;"; return mydb_query_return_double_array($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function specialop() {\n\n\n\t}", "public function operators();", "function yy_r69()\n {\n $operator = strtolower(trim($this->yystack[$this->yyidx + - 1]->minor));\n if (isset($this->opMap[$operator])) {\n $operator = $this->opMap[$operator];\n }\n $this->_retvalue = $...
[ "0.5933568", "0.58577776", "0.5838815", "0.5711414", "0.5607789", "0.5472682", "0.5472682", "0.54471797", "0.54199445", "0.54097074", "0.5366394", "0.5363128", "0.5362044", "0.5360105", "0.5350513", "0.53306603", "0.52864236", "0.52862734", "0.5256702", "0.52459306", "0.52442...
0.0
-1
End Comment for problem operator Comment for spring operator
function get_CommentsByWeek($week,$team) { $query = "SELECT c.id,c.userID,c.content,c.time, u.nickname, u.photoPath FROM commentsforspring AS c,user AS u where c.stat=0 and c.week=$week and c.team=$team AND c.userID=u.id AND u.stat=0 order by c.time;"; return mydb_query_return_double_array($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function specialop() {\n\n\n\t}", "public function next_comment()\n {\n }", "function mCOMMENT(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$COMMENT;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n ...
[ "0.52474415", "0.5208138", "0.5204639", "0.5193693", "0.5119329", "0.50452507", "0.5008033", "0.4981075", "0.4981075", "0.48720744", "0.48644167", "0.48633286", "0.48577344", "0.4852057", "0.48483992", "0.48463157", "0.48463157", "0.48463157", "0.48439294", "0.48418176", "0.4...
0.0
-1
End Comment for spring operator Rank
function getRandOnWeek($week,$team){ $query = "SELECT s.userID,s.probID,u.name,u.nickname,u.photoPath,count(distinct s.probID) 'count' FROM score AS s,user AS u where s.stat=0 and s.userID=u.id and u.team=$team and s.ac=1 AND s.probID IN (SELECT id FROM problems AS p WHERE p.stat=0 AND p.week=$week AND p.level=$team) group by s.userID order by count(distinct s.probID) desc;"; return mydb_query_return_double_array($query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_rank() {\n return 10;\n }", "public function rank();", "public abstract function get_rank();", "public function getRank();", "function getRank() {\n\t\treturn $this->_Rank;\n\t}", "public function getRank()\n {\n return $this->rank;\n }", "public function getR...
[ "0.65568244", "0.63713217", "0.62841624", "0.6211469", "0.60049075", "0.5928204", "0.5928204", "0.5928204", "0.5895393", "0.587364", "0.5844451", "0.58287096", "0.5827188", "0.58146554", "0.57680416", "0.5650874", "0.5650874", "0.5650874", "0.5650874", "0.5650874", "0.5650323...
0.0
-1
Display a listing of the resource.
public function index() { $this->categoryRepository->pushCriteria(app('Prettus\Repository\Criteria\RequestCriteria')); // Get All Categories $categories = $this->categoryRepository->getCategoryList(); if (request()->wantsJson()) { return response()->json([ 'data' => $categories, ]); } return view('admin.categories.index', compact('categories')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Display a form to create category.
public function create() { $this->categoryRepository->pushCriteria(app('Prettus\Repository\Criteria\RequestCriteria')); // Get Categories Dropdown list $categories = $this->categoryRepository->getCategoryDropdownList(); $categories[0] = 'Root Category'; return view('admin.categories.add',compact('categories')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create() {\n return view('admin.category.category_create_form');\n }", "public function create()\n {\n return view (\"admin.category.create\");\n }", "public function create()\n {\n return \\view(\"pages.admin.category.create\");\n }", "public function crea...
[ "0.85421026", "0.82383984", "0.8185193", "0.8157556", "0.8128603", "0.80757236", "0.8073451", "0.8054834", "0.80514205", "0.8044091", "0.802829", "0.8022315", "0.80208325", "0.80208325", "0.80208325", "0.80208325", "0.8017229", "0.8017229", "0.8017229", "0.8017229", "0.801722...
0.7826765
69
Store a newly created resource in storage.
public function store(CategoryCreateRequest $request) { try { $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_CREATE); $data = $request->all(); // Change 'On/Off' value to '1/0' if (isset($data['is_active'])) { $data['is_active'] = $this->categoryRepository->setCheckboxValue($data['is_active']); } else { $data['is_active'] = 0; } // Insert new category $category = $this->categoryRepository->createCategory($data); // Uplaod image $image_info = $this->baseController->imageUpload($request, $category->category_id); if ($image_info) { $data['category_image'] = $image_info['category_image']; $this->categoryRepository->updateCategory($data, $category->category_id); } if ($category) { $response = [ 'message' => 'Category successfully created.', 'status' => 'success', 'data' => $category->toArray(), ]; } else { $response = [ 'message' => 'Category not created.', 'status' => 'danger', ]; } if ($request->wantsJson()) { return response()->json($response); } return redirect()->route('category_list')->with('response', $response); } catch (ValidatorException $e) { if ($request->wantsJson()) { return response()->json([ 'error' => true, 'message' => $e->getMessageBag() ]); } return redirect()->back()->withErrors($e->getMessageBag())->withInput(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // Get category info by bridge category's primary id $category = $this->categoryRepository->getBridgeDataById($id); if ($category->parent_category_id != 0) { // Get category info by bridge category's category id $bridge_data = $this->categoryRepository->getBridgeDataByCategoryId($category->parent_category_id); if ($bridge_data) { $category->parent_category_id = $bridge_data->category_tree_id; } } // Get Dropdown List of bridge categories $categories = $this->categoryRepository->getCategoryDropdownList(); $categories[0] = 'Root Category'; return view('admin.categories.edit', compact('category', 'categories')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", ...
0.0
-1
Update the specified resource in storage.
public function update(CategoryUpdateRequest $request, $id) { try { $this->validator->with($request->all())->passesOrFail(ValidatorInterface::RULE_UPDATE); $data = $request->all(); // Change 'On/Off' value to '1/0' if (isset($data['is_active'])) { $data['is_active'] = $this->categoryRepository->setCheckboxValue($data['is_active']); } else { $data['is_active'] = 0; } // Insert new category $bridge_data = $this->categoryRepository->getBridgeDataById($id); $category = $this->categoryRepository->updateCategory($data, $bridge_data->child_category_id); // Uplaod image $image_info = $this->baseController->imageUpload($request, $category->category_id); if ($image_info) { $data['category_image'] = $image_info['category_image']; $this->categoryRepository->updateCategory($data, $category->category_id); } if ($category) { $response = [ 'message' => 'Category successfully updated.', 'status' => 'success', 'data' => $category->toArray(), ]; } else { $response = [ 'message' => 'Category not updated.', 'status' => 'danger', ]; } return redirect()->route('category_list')->with('response', $response); } catch (ValidatorException $e) { if ($request->wantsJson()) { return response()->json([ 'error' => true, 'message' => $e->getMessageBag() ]); } return redirect()->back()->withErrors($e->getMessageBag())->withInput(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $deleted = $this->categoryRepository->deleteCategory($id); if ($deleted) { $response = [ 'message' => 'Category successfully deleted.', 'status' => 'success', ]; } else { $response = [ 'message' => 'Category not deleted.', 'status' => 'danger', ]; } return redirect()->back()->with('response', $response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Change Status of category.
public function changestatus($id, $status) { $deleted = $this->categoryRepository->changeCategoryStatus($id, $status); if ($deleted) { $response = [ 'message' => 'Category status successfully updated.', 'status' => 'success', ]; } else { $response = [ 'message' => 'Category status not updated.', 'status' => 'danger', ]; } return redirect()->back()->with('response', $response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function changeStatus(Request $request){\n\n $category = Category::find($request->user_id);\n $category->status = $request->status;\n $category->save();\n \n return response()->json(['success'=>'Status change successfully.']);\n }", "public function changeStatus($interview_...
[ "0.6970331", "0.6919888", "0.6842367", "0.66553426", "0.6616221", "0.657897", "0.6459527", "0.6313129", "0.6287552", "0.62841713", "0.6261692", "0.6244561", "0.6192241", "0.6190883", "0.6159764", "0.6152919", "0.61353767", "0.61235213", "0.61235213", "0.6018786", "0.6008959",...
0.596668
23
/ you should hookup the DAO here
public function getAllUser(){ return $this->users; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct() {\n $dao = new DAO();\n }", "function __construct() {\n $dao = new DAO();\n }", "public function __construct()\n {\n //$database = new Database();\n $database = Database::connect();\n $this->dao = $database;\n }", "public function __construct()\n\t\t{\n\t\t...
[ "0.74849254", "0.7443195", "0.70102733", "0.6995597", "0.6953978", "0.6875781", "0.6874606", "0.6761004", "0.6691912", "0.66707355", "0.66041785", "0.65702015", "0.6527278", "0.6524694", "0.6502995", "0.64889103", "0.64846826", "0.6474451", "0.64698267", "0.6414151", "0.64067...
0.0
-1
get user from DB using id
public function getUserDb($user_id) { $mysqli = $this->connectDb(); $result = $mysqli->query("SELECT user_id, identity, salt_masterkey, privkey_user_enc FROM users WHERE user_id = $user_id"); $user = $result->fetch_assoc(); //$user_ = $row['user_id']." ".$row['identity']." ".$row['salt_masterkey']; return $user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findUser($id) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"SELECT * FROM user WHERE _user_Id = ?;\";\n $q = $conn->prepare($sql);\n $q->execute(array($id));\n $user = $q->fetchObject('\\App\\User');\n }\n catc...
[ "0.83529127", "0.8316243", "0.83125865", "0.8243498", "0.82366115", "0.8219225", "0.8165468", "0.8164481", "0.81309086", "0.812507", "0.8116155", "0.810102", "0.80932534", "0.80688936", "0.8056223", "0.80404425", "0.8030999", "0.8003052", "0.80006284", "0.7983874", "0.7970468...
0.0
-1
set key names for csv data
public function set_key_names($keys) { $this->keys = $keys; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setKeyName($key);", "protected function initCSV() {}", "protected function addHeaderRowToCSV() {}", "private function setHeader()\r\n {\r\n rewind($this->handle);\r\n $this->headers = fgetcsv($this->handle, $this->length, $this->delimiter);\r\n }", "function set_keys($...
[ "0.60966605", "0.58883333", "0.58604825", "0.5830257", "0.58274245", "0.56077075", "0.5528459", "0.5525711", "0.55170757", "0.54442894", "0.54227513", "0.54128194", "0.539939", "0.5399046", "0.53753936", "0.53609115", "0.53523606", "0.531739", "0.52794313", "0.52727896", "0.5...
0.5505684
9
add array or key value for csv line
public function add_data($key, $value = false) { // is assoc array -> add key->value if (is_array($key)) { $this->data = $key; } elseif ($key !== false && $value !== false) { $this->data[$key] = $value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function addHeaderRowToCSV() {}", "public function addToCSV($fields){\r\n if (file_exists($this->csv)) {\r\n $csvfile = fopen($this->csv, 'a');\r\n fputcsv($csvfile, $fields);\r\n fclose($csvfile);\r\n }\r\n else {\r\n $csvfile = fopen($this->csv, 'w');\r\n // Put head...
[ "0.6746428", "0.6441989", "0.6271489", "0.6005916", "0.59220207", "0.5789921", "0.57801867", "0.5744925", "0.57417375", "0.56913465", "0.5685545", "0.56644714", "0.56625956", "0.56309646", "0.5618866", "0.5612931", "0.5601249", "0.5559794", "0.55083203", "0.5499243", "0.54981...
0.0
-1
render data to csv
private function render() { // $csv = '"' . implode('";"', $this->keys) . '"' . "\r\n"; // $header = []; // $data = []; // $legend = []; // CSV // $idx = 0; // foreach ($this->data as $k => $v) { // if ($k != "action") { // $header[] = '"' . $idx . '"'; // $data[] = '"' . $v . '"'; // $legend[] = '"' . $idx . '";"' . $k . '"'; // } // $idx++; // } // $csv = implode(";", $header) . "\r\n"; // $csv .= implode(";", $data) . "\r\n"; // $csv .= "\r\n"; // $csv .= implode("\r\n", $legend); // $csv .= "\r\n"; // $csv .= '"timestamp";"' . time() . '"'; // INI $idx = 0; $data = []; $legend = []; foreach ($this->data as $k => $v) { if ($k != "action") { $data[] = $idx . '="' . $v . '"'; $legend[] = $idx . '="' . $k . '"'; } $idx++; } // data section $ini = "[data]\n"; $ini .= implode("\n", $data); $ini .= "\n"; $ini .= "\n"; $ini .= "[legend]\n"; $ini .= implode("\n", $legend); $ini .= "\n"; $ini .= "\n"; $ini .= "[meta]\n"; $ini .= "time=" . date("Y-m-dTH:i:s", time()) . "\n"; $ini .= "timestamp=" . time(); // add active user if (FORM_MAIL_ACCESS_SUPPORT && \ma\Access::user()) { $ini .= "\n"; $ini .= "user=" . \ma\Access::user()->username() . "\n"; } return $ini; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function render() {\n\t\tob_clean();\n\n\t\t$csvContent = '';\n\t\t\n\t\t$full_filename = $this->generateFilenameFromTs();\n\n\t\t$this->sendHeader($full_filename);\n\n $out = fopen('php://output', 'w');\n\n\t\t// Fields\n\t\t$header = array();\n\t\tforeach ($this->getItemById('columns') as $column) ...
[ "0.7707531", "0.7630475", "0.74376506", "0.7195014", "0.7047122", "0.7019662", "0.6859374", "0.6771803", "0.67374575", "0.6666194", "0.66625494", "0.6653946", "0.6638174", "0.6610687", "0.65887827", "0.65799975", "0.6578695", "0.6547145", "0.65435684", "0.65426457", "0.653213...
0.6594078
14
Display a listing of the resource.
public function index() { // return view('users.roles'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re...
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.683052...
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view(...
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.717428...
0.0
-1
Store a newly created resource in storage.
public function store(RolesStoreRequest $request) { // $input = $request->validated(); DB::beginTransaction(); try{ $office_clerk = [ 'clerk-delete' => true, 'clerk-add' => true, 'clerk-update' => true, 'clerk-view' => true, ]; $role = Role::create(['name'=>$input['name'],'display_name'=>$input['display_name'], 'permissions' =>$office_clerk, 'guard_name'=>'web']); DB::commit(); return response()->json(['role'=>$role,'message'=>'Role created successfully.'],200); }catch (\Exception $e) { DB::rollback(); return response()->json(['message' => 'Role could not be saved at the moment ' . $e->getMessage()], 400); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations...
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.63424...
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id...
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047...
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ...
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.6833...
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ...
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890...
0.0
-1
Remove the specified resource from storage.
public function destroy(Role $role) { // if($role->name =="app-admin"){ }else{ $role->delete(); } return redirect('roles'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n ...
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897...
0.0
-1
Controller class for site_settings
function __construct() { parent::__construct(); $this->load->library('session'); $this->load->model('NewModel'); if($this->session->userdata('is_loged_in')!='' && $this->session->userdata('is_loged_in')==1) { //redirect(base_url().'Dashboard'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function settings()\n {\n $result = $this->dtbs->list('site_settings');\n $data['info'] = $result;\n $this->load->view('back/settings/anasehife',$data);\n }", "public function site_settings()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$data['form_submit_message'] = '';\n\t\t\t$th...
[ "0.76514316", "0.75506425", "0.7509433", "0.74648625", "0.74215394", "0.72920156", "0.72843105", "0.7131434", "0.7101804", "0.7094003", "0.7084211", "0.70428586", "0.7017852", "0.7015373", "0.69951266", "0.6993361", "0.69909847", "0.6987934", "0.6985017", "0.69677776", "0.696...
0.0
-1
Generate, the password reset link. The token generated is embedded in the link
private function sendResetEmail($email, $token) { $link = URL::to('/') . '/password/reset/' . $token . '?email=' . urlencode($email); try { //Here send the link with CURL with an external email API $user= User::where('email', $email)->first(); $data['name'] = $user->name; $data['reset-link'] = $link; $user->notify(new SendEmailResetPass($data)); $result['isSuccess'] = true; return $result; } catch (\Exception $e) { // dd($e->getMessage()); $result['isSuccess'] = false; $result['message'] = $e->getMessage(); return $result; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function generatePasswordResetToken() {\n\t\t$this->txt_password_reset_token = Yii::$app->security->generateRandomString () . '_' . time ();\n\t}", "public function generatePasswordResetToken() {\n $this->password_reset_token = Yii::$app->security->generateRandomString();\n }", "public functio...
[ "0.73803085", "0.7375942", "0.7370174", "0.73643106", "0.7362609", "0.73438656", "0.73438656", "0.73438656", "0.73396295", "0.73367256", "0.7332739", "0.7331947", "0.73289657", "0.7304828", "0.7304828", "0.7304828", "0.7304828", "0.7304828", "0.7304828", "0.7304828", "0.73048...
0.0
-1
Created by JetBrains PhpStorm. User: Aicha Date: 13/03/13 Time: 09:54 To change this template use File | Settings | File Templates.
function arrayToXML($array,$node_name,$doc) { $root = $doc->createElement($node_name); $root = $doc->appendChild($root); foreach($array as $key=>$value) { if (is_array($value)){ $root->appendChild(arrayToXML($value,$key,$doc)); } else { $em = $doc->createElement($key); $text = $doc->createTextNode($value); $em->appendChild($text); $root->appendChild($em); } } return $root; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct() {\r\n ;\r\n }", "private function __construct() {;}", "private function __construct() {\n ;\n }", "public function __construct ()\n { // TODO Auto-generated constructor\n }", "public function __construct ()\n {\n // TODO Auto-generate...
[ "0.5920284", "0.5914051", "0.59127474", "0.59069395", "0.5894673", "0.5894673", "0.5882096", "0.5882096", "0.5882096", "0.5882096", "0.5882096", "0.5882096", "0.5882096", "0.5882096", "0.58745474", "0.5871654", "0.5833011", "0.5833011", "0.5833011", "0.5833011", "0.5833011", ...
0.0
-1
ATTRIBUTES STATIC METHODS METHODS
public function hasCustomization($type) { return !!DB::table('customizations')->where('company_id', $this->id)->where('type_code', $type)->count(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function attributes();", "public function attributes();", "public function getAttributes(){ }", "public function getAttributes() {}", "public function getAttributes() {}", "public function getAttributes()\n {\n }", "function getAttributes()\n {\n }", "public function ge...
[ "0.8027656", "0.78619623", "0.75791556", "0.7543619", "0.75415504", "0.750972", "0.7456925", "0.7419253", "0.7419253", "0.7406835", "0.7406253", "0.7406253", "0.7406253", "0.7406253", "0.7406253", "0.7406253", "0.7406253", "0.7406253", "0.7406253", "0.7152183", "0.7073587", ...
0.0
-1
Use this function to generate serial code within this company
public function generateSerialCode($prefix, $length) { return SerialCode::generateCode('COMPANY_' . $this->code, $prefix, $length); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GenerarSerial()\n\t{\n\t\t$this->Serial = CifradorCodigo::generarNumero(\n\t\tCifradorCodigo::LongitudBitsSerialMaximo\n\t\t);\n\t}", "public function serial() : string;", "function generateSerials ($numberOfChars,$lengthOfSerial) {\n\n\n$tokens = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWZY\";\n$serial = \"...
[ "0.7346913", "0.6960255", "0.678619", "0.677294", "0.66670656", "0.6617674", "0.6558764", "0.65465975", "0.6540816", "0.64788944", "0.64055955", "0.6346096", "0.6324459", "0.6305491", "0.62949204", "0.62313396", "0.6221208", "0.62070465", "0.6205898", "0.6194267", "0.6191216"...
0.6339332
12
/ write pretty json requires php 5.4 or later
function WriteJson($str, $json) { if($this->m_fp==false) return false; $ary=json_decode($json); $json=json_encode($ary, JSON_PRETTY_PRINT); fwrite($this->m_fp, "[".date('h:i:s')."] ".$str.$json."\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function json_encode_pretty( $json, $file = null, $force = false ){\n if( is_string( $json ) && is_json( $json ) ){\n\t\n\t\t$json = json_decode( $json );\n\t\t\n\t} elseif( ! is_array( $json ) || ! is_object( $json ) ){\n \n // If it's not a JSON string, or an array/object then return false\n ...
[ "0.7618268", "0.760635", "0.7239164", "0.7221994", "0.7156004", "0.692889", "0.6818284", "0.6799686", "0.67616546", "0.6741522", "0.67203337", "0.65968865", "0.65875995", "0.6570444", "0.6548616", "0.6548616", "0.6548616", "0.6548616", "0.6548616", "0.6548616", "0.6548616", ...
0.6234671
42
Add an input argument for the identifier for the new group
protected function configure() { $this->setName( 'ezp_cookbook:createcontenttypegroup' )->setDefinition( array( new InputArgument( 'content_type_group_identifier', InputArgument::REQUIRED, 'a content type group identifier' ), ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function system_addto_group($paramv)\n{\n}", "function createGroup($args) {\n\t\t$this->editGroup($args);\n\t}", "function system_add_group($paramv)\n{\n}", "function addGroupHandler() {\n global $inputs;\n\n $lastId = insert('group',[\n 'admin_id' => getLogin()['uid'],\n 'group_name' => ...
[ "0.675802", "0.6624445", "0.65987945", "0.64053357", "0.6280214", "0.62035376", "0.6169949", "0.5988497", "0.5970459", "0.59022754", "0.5864064", "0.5847742", "0.5832492", "0.57670075", "0.56630594", "0.564203", "0.5636578", "0.5606631", "0.5577976", "0.5558789", "0.554432", ...
0.0
-1
Executes create group command
protected function execute( InputInterface $input, OutputInterface $output ) { // fetch command line arguments $contentTypeGroupIdentifier = $input->getArgument( 'content_type_group_identifier' ); // get the repository from the di container $repository = $this->getContainer()->get( 'ezpublish.api.repository' ); // get the services from the repsitory $contentTypeService = $repository->getContentTypeService(); $userService = $repository->getUserService(); // load the admin user and set it has current user in the repository $user = $userService->loadUser( 14 ); $repository->setCurrentUser( $user ); try { // instanciate a create struct and create the group $contentTypeGroupCreateStruct = $contentTypeService->newContentTypeGroupCreateStruct( $contentTypeGroupIdentifier ); $contentTypeGroup = $contentTypeService->createContentTypeGroup( $contentTypeGroupCreateStruct ); // print out the group print_r( $contentTypeGroup ); } catch ( UnauthorizedException $e ) { // react on permission denied $output->writeln( $e->getMessage() ); } catch ( ForbiddenException $e ) { // react on identifier already exists $output->writeln( $e->getMessage() ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function createGroupAction() {\n\t\t$this->group->id_parent = isset($this->data['id_parent']) ? $this->data['id_parent'] : null;\n\t\t$this->group->group_name = $this->data['group_name'];\n\t\t$this->group->description = $this->data['description'];\n\t\treturn $this->group->save();\n\t}", "public function...
[ "0.7682366", "0.76707685", "0.75332105", "0.72250146", "0.72095925", "0.7207654", "0.7100662", "0.7023194", "0.69925135", "0.69279885", "0.69005734", "0.68435484", "0.6800002", "0.67769116", "0.6766949", "0.6745324", "0.67314994", "0.669477", "0.66863495", "0.66741323", "0.66...
0.0
-1
/ $adapter = new Adapter([ 'driver' => 'Mysqli', 'database' => 'zf2_test', 'username' => 'root', 'password' => '', ]); $res=$adapter>query("select name from user", Adapter::QUERY_MODE_EXECUTE);
public function aboutAction() {//['data'=>$res] return new ViewModel(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAdapter(){\n return $this->sm->get('Zend\\Db\\Adapter\\Adapter');\n }", "public function test_executeQuery()\n\t{\n\t}", "function db_connecti()\r\n{\r\n$config = new Zend\\Config\\Config(include '../config.php');\r\n$conn = mysqli_connect($config->db_server, $config->db_user, $con...
[ "0.6312465", "0.62757003", "0.61878395", "0.6025461", "0.59901917", "0.59119874", "0.5864493", "0.5853284", "0.58472234", "0.5821584", "0.5814566", "0.5810752", "0.5802275", "0.5767307", "0.57588327", "0.57554185", "0.57520986", "0.5746597", "0.5746597", "0.5746597", "0.57047...
0.0
-1
/ form creation programatically data inilization part $name = new Element('name'); $name>setLabel('Your name'); $name>setAttributes([ 'type' => 'text', 'class'=>'formcontrol' ]); $email = new Element\Email('email'); $email>setLabel('Your email address'); $email>setAttributes([ 'class'=>'formcontrol' ]); $subject = new Element('subject'); $subject>setLabel('Subject'); $subject>setAttributes([ 'type' => 'text', 'class'=>'formcontrol' ]); $message = new Element\Textarea('message'); $message>setLabel('Message'); $email>setAttributes([ 'class'=>'formcontrol' ]); $csrf = new Element\Csrf('security'); Create a submit button: $send = new Element('Send'); $send>setValue('Submit'); $send>setAttributes([ 'type' => 'submit', 'class'=>'btn btnprimary' ]); $form = new Form('Contact'); $form>add($name); $form>add($email); $form>add($subject); $form>add($message); $form>add($csrf); $form>add($send); ['form'=>$form]
public function contactAction() { /* //form creation using factory method asrats $factory = new Factory(); $form=$factory->createForm([ 'hydrator' => ArraySerializable::class, 'elements' => [ [ 'spec' => [ 'name' => 'name', 'type'=> 'text', 'attributes'=> [ 'class'=>'form-control' ], 'options' => [ 'label' => 'Your your name', ], ], ], [ 'spec' => [ 'type' => Element\Email::class, 'name' => 'email', 'attributes'=> [ 'class'=>'form-control' ], 'options' => [ 'label' => 'Your email address', ], ], ], [ 'name' => 'send', 'type' => 'Submit', 'attributes' => [ 'value' => 'Submit', 'class'=>'btn btn-primary btn-block' ], 'spec' => [ 'name' => 'subject', 'type'=> 'text', 'attributes'=> [ 'class'=>'form-control' ], 'options' => [ 'label' => 'Enter your Subject', ], ], ], [ 'spec' => [ 'type' => Element\Textarea::class, 'name' => 'message', 'attributes'=> [ 'class'=>'form-control' , 'rows'=>5,ResultSet 'cols'=>80, ], 'options' => [ 'label' => 'Enter your message', ] ], ], /*[//Rand function not supporting 'spec' => [ 'name'=>'secirity', 'type' => Element\Csrf::class, ], ],*/ /*// [ 'spec' => [ 'name' => 'send', 'type' => 'Submit', 'attributes' => [ 'value' => 'Submit', 'class'=>'btn btn-primary btn-block' ], ], ], ], //form creation using factory method ends ]);*/ $form=new contactForm(); return new ViewModel(['form'=>$form]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FormAsseretion(){\r\n $creat = new UIMAP_createFormPage();\r\n \r\n $this->assertElementPresent($creat->formName());\r\n $this->assertElementPresent($creat->formLanguige());\r\n for($i = 1; $i < 4; $i++){\r\n $this->assertElementPresent($creat->formRespuniqtyp...
[ "0.702038", "0.70133287", "0.6958179", "0.69453764", "0.6891675", "0.68802327", "0.68802327", "0.68211484", "0.6761951", "0.6740447", "0.6705488", "0.67048365", "0.66979957", "0.6681319", "0.66210335", "0.66147876", "0.66147876", "0.6611856", "0.65960366", "0.6563389", "0.656...
0.69590676
2
Create a new notification instance.
public function __construct(Ticket $ticket, User $user) { $this->ticket = $ticket; $this->user = $user; $this->url = url('/it/av/'.$ticket->id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function create($notification){\n }", "public static function createNotification($type, $eventid){\n\t\t$notification = new Notification; \n\t\t$notification->type = $type;\n\t\t$notification->eventid = $eventid;\n\t\t$notification->time = date('Y-m-d H:i:s');\n\t\t$notification->save();\n\t\tretu...
[ "0.8276063", "0.72309536", "0.7192113", "0.71250874", "0.7123231", "0.70414555", "0.6982398", "0.6982398", "0.6982398", "0.69165224", "0.6844303", "0.68205667", "0.6801263", "0.6776018", "0.6589725", "0.6531073", "0.6507233", "0.65047646", "0.6503655", "0.64437956", "0.641349...
0.0
-1
Get the notification's delivery channels.
public function via($notifiable) { return ['mail','database','broadcast']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNotificationChannels()\n {\n if (array_key_exists(\"notificationChannels\", $this->_propDict)) {\n return $this->_propDict[\"notificationChannels\"];\n } else {\n return null;\n }\n }", "public function getDistributionChannels();", "public func...
[ "0.78077316", "0.7333707", "0.7127785", "0.7089724", "0.7087921", "0.70300424", "0.69931364", "0.6973003", "0.6951073", "0.6927183", "0.68472975", "0.67785895", "0.6697527", "0.6530563", "0.65100604", "0.6496754", "0.6474866", "0.6446399", "0.643471", "0.6423392", "0.64229727...
0.0
-1
Get the mail representation of the notification.
public function toMail($notifiable) { return (new MailMessage) ->greeting('Hello! ' .$this->user->name. ',') ->line('New Ticket <b>#'.$this->ticket->ticket_id.'</b> was created by <b>'.$this->ticket->user->name.'</b>.') ->line('<table style="width: 100%; border: 2px solid black; border-collapse: collapse;"> <tbody> <tr> <th style="width: 100%; border: 1px solid black; text-align: center; padding: 10px; padding: 5px;" colspan="2">TICKET DETAILS</th> </tr> <tr> <th style="width: 25%; border: 1px solid black; vertical-align:top; text-align:left; padding: 5px;">PRIORITY</th> <td style="width: 75%; border: 1px solid black; padding: 10px;">'.$this->ticket->priority->name.'</td> </tr> <tr> <th style="width: 25%; border: 1px solid black; vertical-align:top; text-align:left; padding: 5px;">DEPARTMENT</th> <td style="width: 75%; border: 1px solid black; padding: 10px;">'.$this->ticket->department->name.'</td> </tr> <tr> <th style="width: 25%; border: 1px solid black; vertical-align:top; text-align:left; padding: 5px;">CATEGORY</th> <td style="width: 75%; border: 1px solid black; padding: 10px;">'.$this->ticket->category->name.'</td> </tr> <tr> <th style="width: 25%; border: 1px solid black; vertical-align:top; text-align:left; padding: 5px;">SUBJECT</th> <td style="width: 75%; border: 1px solid black; padding: 10px;">'.$this->ticket->subject.'</td> </tr> <tr> <th style="width: 25%; border: 1px solid black; vertical-align:top; text-align:left; padding: 5px;">DESCRIPTION</th> <td style="width: 75%; border: 1px solid black; padding: 10px;">'.$this->ticket->message.'</td> </tr> </tbody> </table>') /* ->line('<b>TICKET DETAILS</b>') ->line('Priority: '.CustomFunctions::priority_format($this->ticket->priority_id)) ->line('Department: '.$this->ticket->department->name) ->line('Category: '.$this->ticket->category->name) ->line('Subject: '.$this->ticket->subject) ->line('Description: '.$this->ticket->message) */ ->line('For more info click on the link below.') ->action('View Ticket', $this->url) ->line('Thank you for using our application!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNotificationEmail() {}", "public function toMail($notifiable)\n {\n $mailMessage = (new MailMessage())\n ->error()\n ->subject($this->getMessageText())\n ->line($this->getMessageText());\n\n foreach ($this->getMonitorProperties() as $name => $v...
[ "0.7328205", "0.72994936", "0.72792137", "0.7245656", "0.71484643", "0.7130593", "0.71283406", "0.71252996", "0.70436805", "0.70436805", "0.70436805", "0.70436805", "0.70173025", "0.69805986", "0.69631016", "0.69623953", "0.69608307", "0.6931938", "0.6926782", "0.6912461", "0...
0.0
-1
Get the array representation of the notification.
public function toArray($notifiable) { return [ 'header' => 'New Ticket Created', 'msg' => 'Ticket #'.$this->ticket->ticket_id.'. Created by '.$this->ticket->user->name.'.', 'url' => $this->url, 'message' => 'Ticket #'.$this->ticket->ticket_id.' Created.', 'mod' => 'create', 'tid' => $this->ticket->id, 'series' => $this->ticket->ticket_id ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function toArray()\n {\n return [\n 'on' => $this->on,\n 'message' => $this->message,\n 'remaining' => $this->remaining\n ];\n }", "public function toArray($notifiable)\n {\n return $this->message;\n }", "public function getAsArray() {\n ...
[ "0.76758885", "0.76516277", "0.75636953", "0.74597746", "0.7458128", "0.734528", "0.73423344", "0.72810096", "0.72445726", "0.7225404", "0.7216026", "0.72065705", "0.71766704", "0.71498305", "0.70820516", "0.70820177", "0.70782363", "0.70270497", "0.70252293", "0.702143", "0....
0.0
-1
Inserts into (or replaces a record) in the index.
protected function _insertIntoIndex(XenForo_Search_Indexer $indexer, array $data, array $parentData = null) { $metadata = array(); $groupId = 0; $title = ''; // index the quotation with the context and attributed username. $indexedData = $data['quotation'] . ' - ' . $data['attributed_context'] . ' - ' . $data['attributed_username']; $indexer->insertIntoIndex( 'quote', $data['quote_id'], $title, $indexedData, $data['quote_date'], $data['author_user_id'], $groupId, $metadata ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function insert($index, $value);", "public function add_or_update()\n {\n $this->on_duplicate_key('foo = foo + 1');\n $this->insert('table', array('foo' => 'bar'));\n }", "public function testInsertExisting()\r\n\t{\r\n\t\t$index = Index::model()->findByAttributes(array(\r\n\t\t\t'INDEX_NAME' =>...
[ "0.7030659", "0.6238836", "0.6193005", "0.6069691", "0.6062879", "0.60153013", "0.6004096", "0.5970818", "0.59131885", "0.58073735", "0.5799538", "0.5779113", "0.57721686", "0.57520837", "0.5742801", "0.56810224", "0.56341684", "0.5619174", "0.5617851", "0.55658734", "0.55658...
0.5095705
68
Updates a record in the index.
protected function _updateIndex(XenForo_Search_Indexer $indexer, array $data, array $fieldUpdates) { $indexer->updateIndex('quote', $data['quote_id'], $fieldUpdates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($record);", "function update($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\t\t// update the collection appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\tif (isset($this->_data[$key]))\n\t\...
[ "0.79408246", "0.7207848", "0.677355", "0.65431875", "0.6528545", "0.6494094", "0.64619917", "0.6438987", "0.6296553", "0.6294696", "0.62648505", "0.6212109", "0.6182868", "0.6166947", "0.6123962", "0.6116856", "0.61138415", "0.6112425", "0.6085174", "0.6085174", "0.60046273"...
0.0
-1
Deletes one or more records from the index.
protected function _deleteFromIndex(XenForo_Search_Indexer $indexer, array $dataList) { $quoteIds = array(); foreach ($dataList AS $data) { $quoteIds[] = $data['quote_id']; } $indexer->deleteFromIndex('quote', $quoteIds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index_delete(){\n\t\t\n\t\t}", "public static function deleteIndex()\n {\n $db = static::getDb();\n $command = $db->createCommand();\n $command->deleteIndex(static::index(), static::type());\n }", "function delete() {\n $fetchPrimary = $this->mysqlConnectio...
[ "0.72958857", "0.699897", "0.6985778", "0.69258124", "0.6681456", "0.6673376", "0.662431", "0.66058373", "0.6542763", "0.6542763", "0.6542763", "0.64928466", "0.64928466", "0.64645505", "0.64546514", "0.6453294", "0.64399344", "0.64288086", "0.64238214", "0.641843", "0.641843...
0.0
-1
Rebuilds the index for a batch.
public function rebuildIndex(XenForo_Search_Indexer $indexer, $lastId, $batchSize) { $quoteIds = $this->_getQuoteModel()->getQuoteIdsInRange($lastId, $batchSize); if (!$quoteIds) { return false; } $this->quickIndex($indexer, $quoteIds); return max($quoteIds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn('label');\n if ($label !== false) {\n $this->rowsIndexByLabel[$label] = $id;\n }\n }\n $this->indexNotUpToDate = false;\n }", "public ...
[ "0.6928868", "0.6845763", "0.66068876", "0.64756113", "0.64576787", "0.6357771", "0.60788417", "0.60601354", "0.59980893", "0.5961809", "0.59575254", "0.5921417", "0.59109366", "0.58320266", "0.5828098", "0.574284", "0.57279116", "0.5684076", "0.5679825", "0.56295574", "0.562...
0.5177176
35
Rebuilds the index for the specified content.
public function quickIndex(XenForo_Search_Indexer $indexer, array $contentIds) { $quoteModel = $this->_getQuoteModel(); $quotes = $quoteModel->getQuotesByIds($contentIds); foreach ($quotes AS $quote) { $this->insertIntoIndex($indexer, $quote); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reindex();", "public function rebuildIndex()\n {\n $this->elastic->deleteIndex(self::INDEX);\n $this->elastic->addIndexCompanion(self::INDEX);\n }", "private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn(...
[ "0.6873523", "0.6871368", "0.67218536", "0.6437012", "0.6401705", "0.63798404", "0.62795544", "0.62220865", "0.6018535", "0.5977336", "0.5951075", "0.5932978", "0.5798801", "0.5734294", "0.5718523", "0.56481296", "0.5633959", "0.5617703", "0.5556425", "0.55406195", "0.5524949...
0.0
-1
Gets the typespecific data for a collection of results of this content type.
public function getDataForResults(array $ids, array $viewingUser, array $resultsGrouped) { return $this->_getQuoteModel()->getQuotesByIds($ids, array( 'join' => XenQuotation_Model_Quote::FETCH_AVATARS )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResults($type)\n {\n return $this->get($type);\n }", "public function results()\n {\n //by default data get as array/stdclasses\n\n // to trunit to arrays of arrays\n // return json_decode(json_encode($this->_results), true);\n return $this->_results...
[ "0.66208994", "0.6463135", "0.63447386", "0.63286304", "0.62006974", "0.61796916", "0.6171584", "0.6134447", "0.6131158", "0.6126984", "0.6087275", "0.60806847", "0.60806847", "0.60700685", "0.60632986", "0.60424995", "0.60424995", "0.60356605", "0.60111815", "0.60085726", "0...
0.0
-1
Determines if this result is viewable.
public function canViewResult(array $result, array $viewingUser) { $quoteModel = $this->_getQuoteModel(); return $quoteModel->canViewQuotation($result['quote_id']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isViewable()\n\t{\n\t\treturn true;\n\t}", "public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}", "public function isViewable()\n {\n return ($this->isPublished() && $this->isActive());\...
[ "0.8069295", "0.79408205", "0.7850212", "0.7432847", "0.73715216", "0.730201", "0.7152644", "0.70312804", "0.69823027", "0.69489896", "0.6880161", "0.6815026", "0.6779258", "0.65464854", "0.65360534", "0.6461", "0.6358466", "0.6311976", "0.6306383", "0.62799877", "0.62799877"...
0.0
-1
Prepares a result for display.
public function prepareResult(array $result, array $viewingUser) { $this->_getQuoteModel()->prepareQuotation($result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startResult(& $result) \n {\n $start = ($result->pageNumber - 1) * $result->resultsPerPage;\n $end = $start + $result->numRows();\n $start ++;\n $row = $this->_headTemplate;\n $row = str_replace('{results}', $start.'-'.$end, $row);\n $row = str_replace('{total}...
[ "0.6414248", "0.6381644", "0.6009674", "0.59813887", "0.5874223", "0.5840941", "0.57425517", "0.55857074", "0.55518335", "0.5551738", "0.5534261", "0.55250293", "0.54894614", "0.546997", "0.5465406", "0.5456604", "0.5444395", "0.5427704", "0.5414388", "0.5407904", "0.53752613...
0.61901784
2
Gets the date of the result (from the result's content).
public function getResultDate(array $result) { return $result['quote_date']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getResultDate(array $result)\n {\n return $result['message_date'];\n }", "function get_date() {\n\t\treturn $this->get_data( 'comment_date' );\n\t}", "public function getDate()\n {\n $yearconst = $this->getValue(self::XPATH_YEAR);\n $monthconst = $this->getValue(se...
[ "0.6869379", "0.6801957", "0.6617412", "0.65952915", "0.6544121", "0.6529613", "0.6513011", "0.6513011", "0.65047807", "0.65003705", "0.65003705", "0.65003705", "0.65003705", "0.65003705", "0.65003705", "0.65003705", "0.65003705", "0.65003705", "0.65003705", "0.65003705", "0....
0.67724174
2
Renders a result to HTML.
public function renderResult(XenForo_View $view, array $result, array $search) { return $view->createTemplateObject('xenquote_search_result_quote', array( 'quote' => $result, 'search' => $search, )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render()\n\t{\n\t\tif (isset($this->result)) {\n\t\t\t$this->usageError('Nothing to render!');\n\t\t}\n\t\t// @todo render\n\t}", "function viewresult($rendered=false){\n\t\tif($rendered){\n\t\t\treturn $this->view->renderresultsimple($this->result);\n\t\t}\n\t\treturn $this->view->returnresultsimple($t...
[ "0.72071904", "0.7077417", "0.69110405", "0.6845811", "0.6816018", "0.6782857", "0.67406046", "0.6729922", "0.6711523", "0.6683457", "0.66612834", "0.662134", "0.65696836", "0.6549937", "0.6549937", "0.6549937", "0.6549937", "0.6549937", "0.6549937", "0.6549937", "0.6549937",...
0.0
-1
Gets the content types searched in a typespecific search.
public function getSearchContentTypes() { return array('quote'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSearchContentTypes()\n {\n return array('conversation_message', 'conversation');\n }", "function &ListContentTypes()\n\t{\n\t\tglobal $gCms;\n\t\t$contenttypes =& $gCms->contenttypes;\n\t\t\n\t\tif (isset($gCms->variables['contenttypes']))\n\t\t{\n\t\t\t$variables =& $gCms->variab...
[ "0.73325866", "0.69764763", "0.66080374", "0.65561604", "0.65206754", "0.64649403", "0.639141", "0.639141", "0.639141", "0.639141", "0.6279278", "0.6266108", "0.6264383", "0.625179", "0.6250367", "0.62446696", "0.62359303", "0.61834264", "0.61506534", "0.61179155", "0.6115676...
0.72188073
1
Get typespecific constraints from input.
public function getTypeConstraintsFromInput(XenForo_Input $input) { return array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getConstraintTypes() {}", "public function getTypeConstraintsFromInput(XenForo_Input $input)\n {\n if (!($this->enabled)) return array();\n $constraints = array();\n\n $replyCount = $input->filterSingle('reply_count', XenForo_Input::UINT);\n if ($replyCount)\n ...
[ "0.67598665", "0.6378992", "0.61512977", "0.61164725", "0.5882489", "0.577702", "0.57595295", "0.5725472", "0.5725472", "0.5702714", "0.5702714", "0.5693041", "0.5693041", "0.5656768", "0.5656637", "0.5656637", "0.56557584", "0.5632766", "0.5628496", "0.562461", "0.56117433",...
0.7038645
0
Process a typespecific constraint.
public function processConstraint(XenForo_Search_SourceHandler_Abstract $sourceHandler, $constraint, $constraintInfo, array $constraints) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handleConstraint(string $rule): Constraint;", "protected function compileConstraint($constraint)\n {\n $method = 'compile';\n foreach (explode(\"_\", $constraint->type) as $type) {\n $method .= ucfirst($type);\n }\n $condition = [$constraint->typ...
[ "0.6015106", "0.548329", "0.52628374", "0.5259539", "0.50084543", "0.49314448", "0.4887963", "0.47628757", "0.47532442", "0.46217403", "0.46217403", "0.4613971", "0.45754385", "0.45754385", "0.4557971", "0.45533445", "0.45084918", "0.44933352", "0.44933352", "0.44756857", "0....
0.5031818
4
Gets the search form controller response for this type.
public function getSearchFormControllerResponse(XenForo_ControllerPublic_Abstract $controller, XenForo_Input $input, array $viewParams) { return $controller->responseView('XenQuotation_ViewPublic_Search_Form_Quote', 'xenquote_search_form_quote', $viewParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function searchResult()\n {\n //\n return view('searchForm.searchResult');\n }", "public function search()\n {\n return $this->call('GET', $this->endpoint);\n }", "public function get() {\n\n\t\treturn $this->search;\n\n\t}", "public function getSearch()\n {\n ...
[ "0.65366083", "0.6324666", "0.63053113", "0.6276132", "0.6192439", "0.6145809", "0.6133352", "0.6113924", "0.6085083", "0.60571706", "0.60571706", "0.6050644", "0.6045103", "0.6003029", "0.59823406", "0.5945003", "0.5926043", "0.59247226", "0.59113413", "0.5909289", "0.585778...
0.5637329
43
Gets the search order for a typespecific search.
public function getOrderClause($order) { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getSearchType() {}", "public function getSearchType() {}", "public function getXsiTypeName() {\n return \"OrderBy\";\n }", "public static function getParsingOrder()\n {\n return [\n static::GTE,\n static::LTE,\n static::NE,\n static::E...
[ "0.64259416", "0.64259416", "0.6088507", "0.6045177", "0.5999502", "0.5947161", "0.58741266", "0.58018106", "0.5797981", "0.576258", "0.5745041", "0.5744608", "0.5741399", "0.5650367", "0.5623307", "0.56109154", "0.5598408", "0.5598408", "0.5510612", "0.5510612", "0.5510612",...
0.0
-1
Gets the necessary join structure information for this type.
public function getJoinStructures(array $tables) { return array(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJoinType() ;", "public function getJoinType() {}", "private function getJoin() {\n return $this->join;\n }", "public function getJoinType()\n {\n return $this->joinType;\n }", "public function getJoinType()\n {\n return $this->get(self::_JOIN_TYPE);\n }", "...
[ "0.636332", "0.62653095", "0.6067226", "0.5954729", "0.5895873", "0.585286", "0.57133216", "0.54554003", "0.528639", "0.52656186", "0.52373624", "0.51592463", "0.5145338", "0.5134744", "0.5133639", "0.5123898", "0.5106144", "0.5089102", "0.5056705", "0.5014458", "0.50138414",...
0.0
-1
Gets the content type that will be used when grouping for this type.
public function getGroupByType() { return 'quote'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_content_type() {\n return $this->content_type;\n }", "public function getContentType()\r\n\t{\r\n\t\treturn $this->m_type;\r\n\t}", "public function getContentType() {\n return $this->content_type;\n }", "public function getContentType () {\r\n\t\treturn $this->content...
[ "0.77823496", "0.76808226", "0.75523156", "0.75408226", "0.749909", "0.74711114", "0.74100983", "0.73885053", "0.736725", "0.73539376", "0.73468655", "0.7337485", "0.7334027", "0.7324525", "0.7293944", "0.7275848", "0.7275848", "0.7240912", "0.7220115", "0.7206705", "0.715323...
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() { $rules = parent::rules(); $extra_rules = []; $rules = array_merge($rules, $extra_rules); return $rules; }
{ "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.8342797", "0.8013068", "0.79357624", "0.79257727", "0.7922943", "0.7903906", "0.7859204", "0.7789624", "0.7783409", "0.77624106", "0.773673", "0.7732383", "0.77094924", "0.7691624", "0.7684878", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.7682184", ...
0.7441297
72
/ login page for module admin
public function Index(){ $this->load->view('Admin/AdminLogin/Index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function login_page()\n\t{\n\t\t$this->redirect( EagleAdminRoute::get_login_route() );\n\t}", "public function index()\n\t{\n\t\tif(is_user_active('', FALSE))\n\t\t{\n\t\t\tredirect('dashboard');\n\t\t}\n\t\t\t\t\n\t\t$data['base_url'] = base_url();\n\t\t$data['view_file'] = \"login\";\n\t\t$this->templa...
[ "0.81442595", "0.8128438", "0.7941084", "0.7903602", "0.7903602", "0.7899988", "0.7799144", "0.77990407", "0.77074516", "0.76706517", "0.7666453", "0.7604443", "0.7592959", "0.7553037", "0.7539887", "0.7530525", "0.75122195", "0.74956167", "0.7485512", "0.7482579", "0.7480641...
0.0
-1
Connects to the database
public function __construct(string $host = 'localhost', string $username = 'root', string $password = '', string $dbname = 'examenvoorbereiding', string $charset = 'utf8') { $this->host = $host; $this->dbname = $dbname; $this->charset = $charset; $this->username = $username; $this->password = $password; try { $dsn = "mysql:host=$this->host;dbname=$this->dbname;charset=$this->charset"; $this->pdo = new PDO($dsn, $this->username, $this->password); } catch(\PDOException $exception) { exit('Unable to connect. Error message: ' . $exception->getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function connectToDB() {}", "private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseU...
[ "0.8527967", "0.8294717", "0.82443756", "0.8105787", "0.809081", "0.802566", "0.7940866", "0.78906786", "0.7874578", "0.7845609", "0.78433204", "0.78165025", "0.77088624", "0.7696437", "0.769558", "0.76713115", "0.7608584", "0.7602148", "0.7601436", "0.75523037", "0.7545432",...
0.0
-1
/ ====== Users ======
public function create_user(int $type_id, string $username, string $email, string $password = null): void { // Als het wachtwoord toch niet sterk genoeg is exitten we. Dan gaat de functie ook niet meer door. if ($this->check_password_strong_enough($password) === false) exit('Het wachtwoord was niet sterk genoeg. <a href="/views/users/create.php">Ga terug</a> en probeer het nog een keer.'); else { // Als we hier komen, is het wachtwoord dus sterk genoeg! $hashed_password = password_hash($password, PASSWORD_DEFAULT); $sql = 'INSERT INTO users (type_id, username, email, password) VALUES (:type_id, :username, :email, :password)'; $this->statement_execute($sql, [ 'type_id' => $type_id, 'username' => $username, 'email' => $email, 'password' => $hashed_password ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function user();", "public function users();", "public function users();", "public function users();", "public function users();", "public function user();", "public function user();", "public function user();", "public function user();", "public function user();", "public funct...
[ "0.7856096", "0.7784931", "0.7784931", "0.7784931", "0.7784931", "0.761798", "0.761798", "0.761798", "0.761798", "0.761798", "0.761798", "0.761798", "0.761798", "0.7337119", "0.73128563", "0.7230423", "0.7197784", "0.7197784", "0.7185904", "0.7185904", "0.7185904", "0.71859...
0.0
-1
/ ====== Hours ======
public function create_hour(int $user_id, int $department_id, string $starts_at, string $ends_at): void { if ($this->check_department_user($department_id, $user_id) === false) exit('Deze gebruiker is niet toegewezen aan deze afdeling. <a href="/views/hours">Ga terug</a> en probeer het nog een keer.'); elseif ($this->check_hour_starts_before_end($starts_at, $ends_at) === false) exit('Het startmoment moet zich <i>voor</i> het eindemoment plaatsvinden. <a href="/views/hours">Ga terug</a> en probeer het nog een keer.'); else { $sql = 'INSERT INTO hours (user_id, department_id, starts_at, ends_at) VALUES (:user_id, :department_id, :starts_at, :ends_at)'; $this->statement_execute($sql, [ 'user_id' => $user_id, 'department_id' => $department_id, 'starts_at' => $starts_at, 'ends_at' => $ends_at ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hours() {\n //TODO prediction\n }", "function getHour()\r\n {\r\n return $this->hora;\r\n }", "function hour()\r\n {\r\n $value = $this->SecondsElapsed;\r\n\r\n $second = $value % 60;\r\n $value = ( $value - $second ) / 60;\r\n\r\n $...
[ "0.79279923", "0.75399506", "0.74466074", "0.7370499", "0.727155", "0.7065025", "0.7061557", "0.70542586", "0.6935337", "0.6935337", "0.6935337", "0.68819284", "0.68805283", "0.6824033", "0.6763906", "0.6707189", "0.6702758", "0.66798735", "0.6672965", "0.66623324", "0.662689...
0.0
-1
AS ... betekent dat de key er op die manier uitkomt
private function check_department_user(int $department_id, int $user_id): bool { // Dus in dit geval gebruik je straks ['count'] in PHP (in plaats van ['COUNT(*)']) $sql = 'SELECT COUNT(*) AS count FROM department_user WHERE department_id = :department_id AND user_id = :user_id'; $statement = $this->statement_execute($sql, [ 'department_id' => $department_id, 'user_id' => $user_id ]); $result = $statement->fetch(PDO::FETCH_ASSOC); // Als de count meer dan 0 is (1 of meer, dus) komt de combinatie voor; dan moet hij true zijn! return $result['count'] > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function getKey();", "abstract public function getKey();", "public function getKey() {}", "public function getKey() {}", "function GetKey() { return( $this->key ); }", "public function key() { return $this->_m_key; }", "abstract public function getKey(): string;", "public functi...
[ "0.6575021", "0.6575021", "0.65320736", "0.65320736", "0.65180784", "0.64653975", "0.63959426", "0.6357795", "0.6352978", "0.6342954", "0.6342954", "0.6342954", "0.6342954", "0.6342954", "0.6342954", "0.6342954", "0.6342954", "0.6342954", "0.6339979", "0.6339979", "0.6339979"...
0.0
-1
In PHP kun je gewoon datumnotaties zoals "20210618 13:30:00" met elkaar vergelijken!
private function check_hour_starts_before_end(int $start_at, int $end_at): bool { // PHP zet het on-the-fly in een DateTimeImmutable, dus het kost wel wat extra werk // Dit doet dus date('Y-m-d H:i:s', $start_at) < date(...... return $start_at < $end_at; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DataHoraAtual(){\n\t$datetime = new DateTime();\n\treturn $datetime->format(\"Y-m-d H:i:s\");\n}", "public static function timestamp() {}", "public function timestamp();", "public function refreshTimestamp();", "public function getTimestamp();", "public function getTimestamp();", "public funct...
[ "0.6324682", "0.60319966", "0.60251856", "0.5916764", "0.59051543", "0.59051543", "0.59051543", "0.5904912", "0.5901574", "0.58707136", "0.5847329", "0.5829528", "0.581219", "0.58088857", "0.57598096", "0.5752912", "0.57515365", "0.5751232", "0.57506764", "0.5744099", "0.5725...
0.0
-1
if you need change,please Overloaded this method and add parent::initialize()
public static function initialize() { container()->forgetInstance(ILogger::class); container()->instance(ILogger::class, container()->make(ILoggerManagerInterface::class)->newLogger(SwooleMaster::getConfig()->getLogDir(), sprintf(SwooleMaster::getTopic() . sprintf("-tasker#%d", self::$id)))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function initialize()\n {\n parent::initialize();\n\n \n }", "public function initialize() {\n parent::initialize();\n }", "public function initialize()\n {\n parent::initialize();\n }", "public function initialize()\n {\n parent::initialize();\n }", "public function in...
[ "0.87850016", "0.87626153", "0.87070656", "0.8697602", "0.8697602", "0.8540321", "0.8462636", "0.8462636", "0.8462636", "0.8462636", "0.84350723", "0.8381733", "0.8381733", "0.8306904", "0.8304862", "0.8303072", "0.82815725", "0.82786715", "0.8262739", "0.8205197", "0.8197720...
0.0
-1
Preference for Anniversary Hook
public function preferences() { $prefs = $this->prefs; ?> <div class="hook-instance"> <div class="row"> <div class="col-lg-4 col-md-4 col-sm-12 col-xs-12"> <div class="form-group"> <label for="<?php echo $this->field_id( 'creds' ); ?>"><?php echo $this->core->plural(); ?></label> <input type="text" name="<?php echo $this->field_name( 'creds' ); ?>" id="<?php echo $this->field_id( 'creds' ); ?>" value="<?php echo $this->core->number( $prefs['creds'] ); ?>" class="form-control" /> </div> </div> <div class="col-lg-8 col-md-8 col-sm-12 col-xs-12"> <div class="form-group"> <label for="<?php echo $this->field_id( 'log' ); ?>"><?php _e( 'Log Template', 'twodayssss' ); ?></label> <input type="text" name="<?php echo $this->field_name( 'log' ); ?>" id="<?php echo $this->field_id( 'log' ); ?>" placeholder="<?php _e( 'required', 'twodayssss' ); ?>" value="<?php echo esc_attr( $prefs['log'] ); ?>" class="form-control" /> <span class="description"><?php echo $this->available_template_tags( array( 'general' ) ); ?></span> </div> </div> </div> </div> <?php }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function app_approved_hook($staffer_id, $first_name, $last_name, $fandom_name, $approver, $assigned_position) {\r\n\tglobal $slack_notification_domain, $slack_staff_hook_url;\r\n\t$url = $slack_staff_hook_url;\r\n\t$payload = '{\"text\": \"Application for <https://'.$slack_notification_domain.'/admin/review_staffe...
[ "0.5647277", "0.539105", "0.5339454", "0.53194094", "0.52638566", "0.52466315", "0.5236817", "0.52297693", "0.52129245", "0.51943076", "0.5150426", "0.51407295", "0.5127697", "0.51024586", "0.5101118", "0.5066544", "0.5058977", "0.5041889", "0.5039581", "0.50332683", "0.49848...
0.0
-1
Valida os dados do arquivo
public static function validarDados( IExportacaoCenso $oExportacaoCenso ) { $lDadosValidos = true; $oExportacaoCenso = $oExportacaoCenso; $aDadosDocente = $oExportacaoCenso->getDadosProcessadosDocente(); DadosCensoDocente2015::getGrauCurso(); foreach( $aDadosDocente as $oDadosCensoDocente ) { $sDadosDocente = $oDadosCensoDocente->registro30->numcgm . " - " . $oDadosCensoDocente->registro30->nome_completo; $sDadosDocente .= " - Data de Nascimento: " . $oDadosCensoDocente->registro30->data_nascimento; $oRegistro30 = $oDadosCensoDocente->registro30; $oRegistro40 = $oDadosCensoDocente->registro40; $oRegistro50 = $oDadosCensoDocente->registro50; $aRegistro51 = $oDadosCensoDocente->registro51; if( !DadosCensoDocente2015::validacoesRegistro30( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $oRegistro40 ) ) { $lDadosValidos = false; } if( !DadosCensoDocente2015::validacoesRegistro40( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $oRegistro40 ) ) { $lDadosValidos = false; } if( !DadosCensoDocente2015::validacoesRegistro50( $sDadosDocente, $oExportacaoCenso, $oRegistro50, $oRegistro30 ) ) { $lDadosValidos = false; } if( !DadosCensoDocente2015::validacoesRegistro51( $sDadosDocente, $oExportacaoCenso, $oRegistro30, $aRegistro51 ) ) { $lDadosValidos = false; } } return $lDadosValidos; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validarArquivo(){\n\n if (empty($this->aRegistrosRetencao)) {\n throw new Exception( _M( self::MENSAGENS . 'erro_validar_arquivo') );\n }\n\n /**\n * Verificamos os registros e caso ocorra inconsistencia populamos o array de Registros inconsistentes\n */\n foreach ($this->a...
[ "0.6762713", "0.6621063", "0.6404361", "0.61944443", "0.6169977", "0.61623245", "0.6148941", "0.61008704", "0.60850894", "0.5992615", "0.5992615", "0.59621143", "0.58643585", "0.58063287", "0.57949644", "0.5784715", "0.57690436", "0.5751859", "0.57293427", "0.5688629", "0.568...
0.5756957
17
0 OUTROS 1 LICENCIATURA 2 BACHARELADO 3 TECNOLOGICO
protected static function getGrauCurso() { $oDaoCursoFormacao = new cl_cursoformacao(); $sCamposGrau = " ed94_c_codigocenso, ed94_i_grauacademico"; $sSqlGrau = $oDaoCursoFormacao->sql_query_file( null, $sCamposGrau, null, null ); $rsGrau = db_query( $sSqlGrau ); if ( !$rsGrau ) { throw new DBException("Erro ao buscar os cursos de formações."); } $iTotalLinhas = pg_num_rows($rsGrau); if ( $iTotalLinhas > 0 ) { for( $iContador = 0; $iContador < $iTotalLinhas; $iContador++ ) { $oGrau = db_utils::fieldsMemory( $rsGrau, $iContador ); DadosCensoDocente2015::$aCursosFormacao[$oGrau->ed94_c_codigocenso] = $oGrau->ed94_i_grauacademico; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Cuerpo($acceso,$id_contrato)\n\t{\n\t\t//echo \"SELECT *FROM vista_contrato where id_contrato='$id_contrato'\";\n\t\t$acceso->objeto->ejecutarSql(\"SELECT tarifa_ser FROM vista_tarifa where id_serv='BM00001'\");\n\t\t\n\t\tif($row=row($acceso)){\n\t\t\t$costo_inst=utf8_decode(trim($row['tarifa_ser']));\n\...
[ "0.65625346", "0.6358433", "0.63350934", "0.62979066", "0.62850285", "0.6236847", "0.623453", "0.6222034", "0.6191078", "0.61887383", "0.6187443", "0.61658555", "0.611654", "0.61109173", "0.60945255", "0.6089499", "0.6088185", "0.6078971", "0.6068745", "0.6059811", "0.6038902...
0.0
-1
Initiate the editor. Push scripts to document if needed
public function onInitEditor() { if (self::$pushscripts) { $this->css(); $this->js(); self::$pushscripts = false; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function botSpawEditorInit() {\n}", "public function init() {\n\t\tif ($this->mojo->auth->is_editor()) {\n\t\t\t$html = \t'<script type=\"text/javascript\" src=\"'.$this->javascript_url().'\"></script>';\n\t\t\t$html .= \t'<script type=\"text/javascript\">$(function(){ Mojo.URL.mojoblog_skin_url = \"' \n\t\t\t\t...
[ "0.70865303", "0.7083737", "0.6604892", "0.65494376", "0.650779", "0.6370795", "0.63474745", "0.63316923", "0.63008785", "0.62308973", "0.61722624", "0.6155058", "0.6142243", "0.6133017", "0.6085184", "0.606983", "0.6058747", "0.59887975", "0.5980538", "0.5977712", "0.5945003...
0.69989854
2
Display a wiki editor
public function onDisplayEditor($name, $id, $content, $cls='wiki-toolbar-content', $col=10, $row=35) { $content = preg_replace('/^((?:<|&lt;)!-- \{FORMAT:(?:.*)\} --(?:>|&gt;))/i', '', $content); $cls = ($cls) ? 'wiki-toolbar-content ' . $cls : 'wiki-toolbar-content'; $editor = '<textarea id="' . $id . '" name="' . $name . '" cols="' . $col . '" rows="' . $row . '" class="' . $cls . '">' . $content . '</textarea>' . "\n"; return $editor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n return view('editor');\n }", "function edit()\n { \n if( $this->input->post('wiki') !== null )\n {\n $data['title'] = 'Edit Detachment Wiki';\n \n $data['wiki'] = $this->wiki_model->get_wiki($this->input->post('wik...
[ "0.65889055", "0.6388956", "0.6341957", "0.62866986", "0.62324464", "0.6135928", "0.6109253", "0.6078581", "0.6077092", "0.60746396", "0.6055818", "0.6027053", "0.5927442", "0.5927442", "0.5927442", "0.5927442", "0.59246874", "0.59178174", "0.5911536", "0.5876375", "0.5873223...
0.0
-1
/ Constructor Check if configuration file exist Load it
public function __construct($session) { if (! is_file('config.php')) { $i18n = i18n::getInstance(); throw new Exception(sprintf($i18n['MISSING_FILE'], 'INSTALL/config.php')); } $this->_load($session); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n ...
[ "0.78029525", "0.7512646", "0.7485289", "0.73806775", "0.73694664", "0.7367456", "0.7359035", "0.7334835", "0.72815406", "0.7259925", "0.7259014", "0.71905553", "0.7172971", "0.7138666", "0.7126061", "0.70804864", "0.70782465", "0.7041034", "0.7028323", "0.70209354", "0.70175...
0.6464225
62