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 |
|---|---|---|---|---|---|---|
use for view the ligin page on admin | public function loginAdminAction(){
if(!empty($_POST)){
$user = new User();
if(!$user->login(true)){
$_SESSION['error'] = 'Login/Passwort ist falsch';
}
if(User::isAdmin()){
redirect(ADMIN);
}else{
redirect();
}
}
$this->layout = 'login';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function admin_page()\n {\n }",
"public function admin_page()\n {\n }",
"public function admin_page()\n {\n echo $this->return_admin_page();\n }",
"public function show_admin_page() {\n\t\t$this->view->render();\n\t}",
"public function admin_page() {\n ec... | [
"0.81915724",
"0.81915724",
"0.7874509",
"0.78125364",
"0.764189",
"0.7516504",
"0.75145787",
"0.7503055",
"0.74744505",
"0.7460312",
"0.74223745",
"0.739383",
"0.7374204",
"0.7305367",
"0.7243842",
"0.72071934",
"0.7136846",
"0.7133207",
"0.7103007",
"0.7096927",
"0.7069379"... | 0.0 | -1 |
Add the Meta Box | function pz_add_custom_meta_box()
{
add_meta_box(
'custom_meta_box',
'Custom Image Metabox',
'pz_custom_meta_box_callbacks',
'page', // page, post etc.
'normal',
'high');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function add_meta_box() {\n add_meta_box( \"CBMTheme\", \"CBM Theme Meta Box\", \"CBMAdmin::posts_page\" );\n }",
"public static function add_meta_box() {\n\t\tadd_meta_box( 'sponsor-meta', __( 'Sponsor Meta', self::$text_domain ), array( __CLASS__, 'do_meta_box' ), self::$post_type_name , 'n... | [
"0.83178455",
"0.8289685",
"0.82773095",
"0.8273988",
"0.8214805",
"0.8178996",
"0.8177539",
"0.8156304",
"0.81465673",
"0.8138356",
"0.81079465",
"0.8104405",
"0.8098265",
"0.80884737",
"0.8065247",
"0.8029458",
"0.8023977",
"0.79432344",
"0.79183185",
"0.79106617",
"0.79069... | 0.7725593 | 26 |
Register admin scripts for custom fields | function pz_load_wp_admin_style()
{
wp_enqueue_media();
wp_enqueue_script('media-upload');
wp_enqueue_style('pz_admin_css', get_template_directory_uri() . '/pz_admin.css');
wp_enqueue_script('pz_admin_script', get_template_directory_uri() . '/pz_admin.js');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function admin_init() {\r\n register_setting($this->optionsName, $this->optionsName);\r\n wp_register_style('custom-page-extensions-admin-css', $this->pluginURL . '/includes/custom-page-extensions-admin.css');\r\n wp_register_script('custom-page-extensions-js', $this->pluginURL . '/js/cu... | [
"0.6946345",
"0.68924266",
"0.68847835",
"0.6870702",
"0.68024594",
"0.67540395",
"0.6711913",
"0.6707241",
"0.67069477",
"0.6679416",
"0.66788816",
"0.66768295",
"0.6667433",
"0.6649931",
"0.6636296",
"0.6632517",
"0.6595033",
"0.65911394",
"0.6581198",
"0.6546152",
"0.65405... | 0.0 | -1 |
Get image ID from URL | function pz_get_image_id($image_url)
{
global $wpdb;
$attachment = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE guid='%s';", $image_url));
return $attachment[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wpbm_get_image_id( $image_url ){\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb -> posts} WHERE guid='$image_url'\";\n $id = $wpdb -> get_var( $query );\n return $id;\n }",
"function rockthemes_get_image_id_from_url($image_url) {\n\tglobal $wpdb;\n\... | [
"0.7743889",
"0.7580079",
"0.7571197",
"0.7330971",
"0.72314346",
"0.7163625",
"0.70910954",
"0.7087257",
"0.705534",
"0.70504117",
"0.6933549",
"0.6880133",
"0.6823867",
"0.68002665",
"0.6769917",
"0.6767856",
"0.67537844",
"0.66945934",
"0.667625",
"0.6646649",
"0.6620791",... | 0.6978872 | 10 |
ANTI XSS & SQL INJECTION// | function antiinjection($data){
$filter_sql = stripslashes(strip_tags(htmlspecialchars($data,ENT_QUOTES)));
return $filter_sql;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sqlInjections($data){\n\t$value1=mysqli_real_escape_string($GLOBALS['link'],$data);\n\t$value1=trim($value1);\n\treturn $value1;\n\t}",
"function anti_injection($data){\n\t$filter = stripslashes(strip_tags(htmlspecialchars($data, ENT_QUOTES)));\n\treturn $filter;\n}",
"public function anti_injection($... | [
"0.6846932",
"0.6671799",
"0.66669977",
"0.6589908",
"0.658406",
"0.65651757",
"0.65582883",
"0.65257055",
"0.6510999",
"0.65039515",
"0.6479666",
"0.6462158",
"0.6458724",
"0.64330816",
"0.6429838",
"0.64138585",
"0.64120257",
"0.63999945",
"0.6394304",
"0.63847834",
"0.6372... | 0.7492571 | 0 |
Create a new job instance. | public function __construct(Reservation $_reservation)
{
$this->reservation = $_reservation;
$this->setReservationManagers($this->reservation);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }",
"abstract public function makeJob();",
"abstract... | [
"0.6921209",
"0.69057024",
"0.69057024",
"0.6869179",
"0.68103194",
"0.6528797",
"0.65196216",
"0.6493415",
"0.6490451",
"0.6469612",
"0.64285964",
"0.6407571",
"0.63951784",
"0.63916427",
"0.63756514",
"0.63051784",
"0.6257829",
"0.6243103",
"0.62026787",
"0.6179217",
"0.607... | 0.0 | -1 |
gets email and mobile from reservation object then send an email , SMS & PUSH Notification to the User | public function sendReservationWasCreatedToCustomerByEmail(Reservation $reservation)
{
// Customer Reservation Created Notification
Mail::send(
'emails/cart/customer/pending',
[
'user' => $reservation->user,
'reservation' => $reservation
],
function ($message) use ($reservation) {
$message->from('sales@howtheyrate.net', trans('HTR Sales!'));
$message->to($reservation->user->email, $reservation->user->name)->subject(trans('Reservation is Pending'));
}
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendEmail_customer($details, $sitetitle) {\n\t\t\t/*echo json_encode($details);\n\t\t\texit();*/\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFul... | [
"0.6672711",
"0.65038604",
"0.64791775",
"0.64435995",
"0.64293474",
"0.64056885",
"0.63879424",
"0.6371168",
"0.6277627",
"0.62704235",
"0.6268141",
"0.6265047",
"0.62172216",
"0.6197046",
"0.6143469",
"0.6128018",
"0.61193085",
"0.61054355",
"0.6065892",
"0.60631716",
"0.60... | 0.0 | -1 |
get restaurant id from reservation objec loop all reservation managers for the found restaurant send email to reservation managers | public function sendReservationWasCreatedToReservationManagersByEmail(Reservation $reservation)
{
// Customer Basic Info
$customer = $reservation->user->toArray();
// Loop and send to Reservation Managers
foreach ($this->reservation_managers as $manager) {
Mail::send(
'emails/cart/admin/pending',
[
'user' => $manager,
'reservation' => $reservation,
'customer' => $customer
],
function ($message) use ($manager) {
$message->from('sales@howtheyrate.net', trans('HTR Sales!'));
$message->to($manager->email, $manager->name)->subject(trans('Reservation is Pending'));
}
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function confirm_reservations($id) {\n global $DB;\n\n $reservation = $DB->get_record('roomscheduler_reservations', array('id' => $id));\n\n $reservations = $DB->get_records('roomscheduler_reservations', array('recurrence_id'=>$reservation->recurrence_id,'location'=>$reservation->location));\n \n fo... | [
"0.588065",
"0.57398707",
"0.55826837",
"0.55086607",
"0.5463044",
"0.5441211",
"0.5418472",
"0.5410198",
"0.5404332",
"0.5390521",
"0.53864413",
"0.53753436",
"0.53495204",
"0.53312933",
"0.5284397",
"0.5262806",
"0.5259282",
"0.52040493",
"0.51934665",
"0.51905113",
"0.5158... | 0.6470802 | 0 |
add current timestamp as coupon expiry date | public function addCouponExpiryDate(Reservation $reservation)
{
// no coupon was applied
if (empty($reservation->coupon_id))
return;
// get model
$coupon = Coupon::whereId($reservation->coupon_id)->first();
if (!$coupon)
throw new CartException(trans('No coupon was applied to this reservation'));
$coupon->expired_at = time();
$result = $coupon->update();
if (!$result)
throw new CartException(trans('Coupon could not be invalidated'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function expiryDate();",
"public function getExpirationDate();",
"function _sf_set_spot_expiry_date($post) {\n\t\t\n\t\t///// FIRSTLY LET'S ADD A METABOX FOR OUR EXPIRY DATE\n\t\t$exp_date = time() + (ddp('submission_days') * (60*60*24));\n\t\t\n\t\t$midnight_time = $exp_date;\n\t\t\n\t\tupdate_post_met... | [
"0.7061822",
"0.6766733",
"0.66498756",
"0.64803",
"0.64722866",
"0.6424264",
"0.63855845",
"0.63058364",
"0.62998414",
"0.62795293",
"0.62671894",
"0.62671894",
"0.62664205",
"0.6254499",
"0.62444234",
"0.6215756",
"0.6158648",
"0.614684",
"0.61257666",
"0.611723",
"0.608147... | 0.5662222 | 56 |
Displays a form to create a new Teacher entity. | public function newAction() {
$entity = new Teacher();
$form = $this->createForm(new TeacherType(), $entity);
return array(
'entity' => $entity,
'form' => $form->createView(),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new Teacher();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ... | [
"0.84595525",
"0.8357474",
"0.81107384",
"0.78124017",
"0.78076524",
"0.77961326",
"0.77961326",
"0.77961326",
"0.77304596",
"0.7716387",
"0.77016187",
"0.7672534",
"0.7630601",
"0.762947",
"0.75905746",
"0.7334293",
"0.7266229",
"0.72532994",
"0.71728456",
"0.71524817",
"0.7... | 0.7995153 | 3 |
Creates a new Teacher entity. | public function createAction(Request $request) {
$entity = new Teacher();
$form = $this->createForm(new TeacherType(), $entity);
$form->bind($request);
$entity->setRegistrationDate(new \DateTime('now'));
$em = $this->getDoctrine()->getManager();
$currentBranchId = $this->getSelectedOrganizationBranch()->getId();
$organizationBranch = $em->getRepository('VirguleMainBundle:OrganizationBranch')->find($currentBranchId);
$entity->addOrganizationBranch($organizationBranch);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($entity);
$em->flush();
$this->addFlash( 'Compte utilisateur "' . $entity->getUsername() . '" créé avec succès !');
return $this->redirect($this->generateUrl('teacher_index'));
}
return array(
'entity' => $entity,
'form' => $form->createView(),
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCreate()\n {\n $model = new Teacher();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ... | [
"0.7414932",
"0.739297",
"0.7250668",
"0.66026896",
"0.6550837",
"0.65495795",
"0.6535018",
"0.64804125",
"0.64538103",
"0.6396742",
"0.63817155",
"0.6374572",
"0.63292444",
"0.63292444",
"0.63292444",
"0.6290915",
"0.62465405",
"0.6187319",
"0.6180495",
"0.6175673",
"0.60975... | 0.6744889 | 3 |
Using single captcha key: | public function registerAction() {
$captcha = new Zend_Captcha_Image(array(
'captcha' => 'Image', 'wordLen' => 4, 'timeout' => 300, 'font' => 'NewtonC.ttf', 'width' => 100, 'height' => 40,
'dotNoiseLevel' => 0, 'lineNoiseLevel' => 0
));
$captcha->setName('captcha');
$values = array();
if($this->getRequest()->isPost()) {
$values = $this->getRequest()->getPost();
if(!$captcha->isValid($_POST['captcha'], $_POST)) {
$this->view->captcha_error = true;
} else {
//dump($this->getRequest()->getPost());
//проверить имя пользователя
$user_model = new Model_Users();
$error = false;
$error = Model_Users::register($values);
if(!$error) {
$this->view->user_error = Vida_Helpers_Text::_T("Пользователь с таким именем или email уже зарегистрирован в системе");
} else {
$this->_helper->redirector('success', 'index');
}
}
}
$this->view->values = json_encode($values);
$this->view->captcha_id = $captcha->generate();
$this->view->captcha = $captcha->render($this->view);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function capcha_draw($min_length,$max_length)\n{\n\n require_once('kcaptcha/kcaptcha.php');\n\n $kcaptcha = new KCAPTCHA($min_length,$max_length);\n //$_SESSION['capcha_code'] = $kcaptcha->getKeyString();\n session_set('capcha_code',$kcaptcha->getKeyString());\n return true;\n}",
"private function... | [
"0.7477949",
"0.71817774",
"0.7099943",
"0.7045666",
"0.69957924",
"0.6994784",
"0.6832279",
"0.68170184",
"0.67944556",
"0.6794216",
"0.67879105",
"0.6769141",
"0.6750773",
"0.67362106",
"0.6728325",
"0.670551",
"0.66925246",
"0.6684418",
"0.6672473",
"0.6610346",
"0.6606833... | 0.0 | -1 |
The "index" action is the default action for all controllers. This will be the landing page of your application. Assuming the default route and default router, this action is dispatched via the following urls: / /index/ /index/index | public function indexAction()
{
// Рандом видео из лучших
$model_files = new Model_Files();
$_arr = $model_files->fetchRandomTopFile();
$this->view->model_file_obj = $_arr;
// Топ (видео)
$_arr = $model_files->fetchTopSelect(ST_REQUEST_TOP_TYPE_ALL);
$this->view->top_video_array = $_arr;
unset($model_files);
// dump($this->_helper->viewRenderer->getResponse()->getBody());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionIndex(){ \n $this->view(\"index.php\");\n }",
"public function actionIndex()\n {\n $this->view->render('index');\n }",
"public function indexAction()\n {\n $this->render('/views/index.html');\n }",
"public function indexAction(){}",
"public f... | [
"0.7738967",
"0.77320236",
"0.77279156",
"0.7725778",
"0.7720843",
"0.7699063",
"0.76702195",
"0.7664014",
"0.7659877",
"0.76440614",
"0.7632856",
"0.7632856",
"0.7619304",
"0.761614",
"0.7597687",
"0.7597215",
"0.7582945",
"0.75803876",
"0.75802016",
"0.75802016",
"0.7580201... | 0.0 | -1 |
Handle the transaction "created" event. | public function created(Transaction $transaction)
{
$user = User::findOrFail($transaction->user_id);
$status = $transaction->status;
if($user){
if($status == 'approved'){
$user->notify(new TransactionNotification(explode(' ', $user->name)[0], false, false, true, $transaction));
}else {
$user->notify(new TransactionNotification(explode(' ', $user->name)[0], true, false, false, $transaction));
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function created(Transaction $transaction)\n {\n //\n }",
"public function created(Transaction $transaction)\n {\n ProcessTransfer::dispatch($transaction, $this->authorizationService);\n }",
"public function createTransaction()\n {\n }",
"public function handleOrderCrea... | [
"0.7344605",
"0.70833266",
"0.65012735",
"0.6283569",
"0.5966646",
"0.5904832",
"0.5798684",
"0.5798684",
"0.5778851",
"0.5725717",
"0.56815696",
"0.56668526",
"0.5644545",
"0.56093234",
"0.560743",
"0.56014085",
"0.55826896",
"0.55826896",
"0.5576279",
"0.55754554",
"0.55502... | 0.6278616 | 4 |
Handle the transaction "updated" event. | public function updated(Transaction $transaction)
{
if($transaction->isDirty('status')){
$user = User::findOrFail($transaction->user_id);
$status = $transaction->status;
if($status == 'approved'){
$user->notify(new TransactionNotification(explode(' ', $user->name)[0], false, false, true, $transaction));
}elseif($status == 'declined'){
$user->notify(new TransactionNotification(explode(' ', $user->name)[0], false, true, false, $transaction));
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updated(Transaction $transaction)\n {\n //\n }",
"public function updated(Transaction $transaction)\n {\n //\n }",
"public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }",
"protected function performUpdate()... | [
"0.72023755",
"0.72023755",
"0.6400626",
"0.60383517",
"0.6006888",
"0.59550333",
"0.59287226",
"0.5914402",
"0.58895326",
"0.58895326",
"0.58895326",
"0.58615935",
"0.5858516",
"0.58291715",
"0.5816223",
"0.5816223",
"0.581255",
"0.581255",
"0.58040243",
"0.5795616",
"0.5787... | 0.62554234 | 3 |
Handle the transaction "deleted" event. | public function deleted(Transaction $transaction)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function deleted($callback)\n {\n self::listenEvent('deleted', $callback);\n }",
"public function handleDeleted(Deleted $event): void\n {\n $entity = $event->entity();\n\n $this->scheduleRemovingOldDocuments($entity);\n\n $this->elasticsearchManager->commit();\n... | [
"0.68374926",
"0.6830709",
"0.67456925",
"0.66479945",
"0.6608365",
"0.66012704",
"0.6600145",
"0.6594114",
"0.65310425",
"0.65166855",
"0.649442",
"0.6421648",
"0.6421648",
"0.6396727",
"0.63881946",
"0.63682",
"0.63404894",
"0.6328055",
"0.6312539",
"0.63117605",
"0.6292937... | 0.7240107 | 2 |
Handle the transaction "restored" event. | public function restored(Transaction $transaction)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function handleTransactionRollback(TransactionRolledBack $event)\n {\n Log::debug('rollback');\n }",
"public function onrestoreCallback($intID, $strTable, $arrData, $intVersion);",
"public function restored(PurchaseReceipt $purchaseReceipt)\n {\n //\n }",
"public function res... | [
"0.69343555",
"0.655309",
"0.63510865",
"0.6244796",
"0.6222654",
"0.60597706",
"0.6020239",
"0.6020239",
"0.6010224",
"0.5985646",
"0.5949184",
"0.5949184",
"0.5949184",
"0.59482265",
"0.59340113",
"0.58958066",
"0.5866178",
"0.58114815",
"0.57835126",
"0.5768945",
"0.576004... | 0.69779557 | 2 |
Handle the transaction "force deleted" event. | public function forceDeleted(Transaction $transaction)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function onBeforeDelete();",
"protected function _preDelete() {}",
"public function afterDeleteCommit(): void\n {\n }",
"public function onAfterDelete();",
"protected function onDeleted()\n {\n return true;\n }",
"public function deleted(Transaction $transaction)\n {\n ... | [
"0.730766",
"0.69939226",
"0.6964241",
"0.69106454",
"0.68971235",
"0.6817606",
"0.6817606",
"0.6817606",
"0.6817606",
"0.6817213",
"0.681684",
"0.67922384",
"0.67890316",
"0.6788038",
"0.67691356",
"0.6765413",
"0.67286193",
"0.6713343",
"0.67113847",
"0.6705567",
"0.6660726... | 0.7249178 | 3 |
Returns the class name. | public function getClass()
{
return $this->method->getClass();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }",
"public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}",
"private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}",
"pu... | [
"0.8927032",
"0.87912285",
"0.87743944",
"0.8688774",
"0.8676623",
"0.8658736",
"0.8653049",
"0.86477107",
"0.86254823",
"0.86254823",
"0.8612077",
"0.8595285",
"0.8581332",
"0.8581332",
"0.856527",
"0.85443616",
"0.8514995",
"0.85068756",
"0.8505168",
"0.8496778",
"0.8484175... | 0.0 | -1 |
Returns the method name. | public function getMethod()
{
return $this->method->getMethod();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMethodName() {\r\n\t\treturn($this->method_name);\r\n\t}",
"public function getMethodName()\n {\n return $this->method;\n }",
"public function getMethodName() : string\n {\n\n return $this->methodName;\n }",
"public function getMethodName() {\n return $this->... | [
"0.89591944",
"0.8824065",
"0.86665046",
"0.8581625",
"0.85813403",
"0.85813403",
"0.84923667",
"0.84923667",
"0.84923667",
"0.8179835",
"0.81223845",
"0.8018441",
"0.7991519",
"0.7866686",
"0.77814484",
"0.7773537",
"0.7705283",
"0.7705283",
"0.7665759",
"0.7652903",
"0.7578... | 0.7190075 | 46 |
Returns the method parameters. | public function getParameters()
{
return $this->parameters;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParameters() {}",
"public function getParams()\n {\n return $this->_invokeParams;\n }",
"public function getParameters()\n {\n return $this->reflection->getParameters();\n }",
"public function getParameters()\n {\n // TODO: Implement getParameters() meth... | [
"0.816109",
"0.81013834",
"0.8099746",
"0.8086376",
"0.807358",
"0.807358",
"0.807358",
"0.807358",
"0.807358",
"0.807358",
"0.807358",
"0.807358",
"0.8072108",
"0.8048743",
"0.8048743",
"0.8048743",
"0.8048743",
"0.80063456",
"0.79413164",
"0.7932623",
"0.79095596",
"0.790... | 0.78455955 | 38 |
Returns the parameter at the given index. | public function getParameter($index)
{
if ($index >= count($this->parameters))
{
throw new OutOfRangeException(sprintf('The parameter %s does not exist', $index));
}
return $this->parameters[$index];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getParam($index)\n {\n return $this->params[$index];\n }",
"public function param($index)\n\t{\n\t\treturn $this->_fetch_from_array($this->params, $index);\n\t}",
"private function _get_param( $index ) {\n\t\treturn ( isset( $this->_params[ $index ] ) ) ? $this->_params[ $index ] :... | [
"0.855581",
"0.8493773",
"0.8092843",
"0.786161",
"0.76036376",
"0.75439376",
"0.74344385",
"0.7390685",
"0.69616085",
"0.6939857",
"0.69266367",
"0.69266367",
"0.6800946",
"0.67945874",
"0.6790953",
"0.6730115",
"0.66975176",
"0.66817427",
"0.66628945",
"0.65581775",
"0.6450... | 0.79295003 | 3 |
Returns a string representation of the method call invocation. The result looks like a method call in PHP source code. Example: $invocation = new LimeMockMethodInvocation('doSomething', array(1, 'foobar')); print $invocation; // => "doSomething(1, 'foobar')" | public function __toString()
{
$parameters = $this->parameters;
if (is_array($parameters))
{
foreach ($parameters as $key => $value)
{
if (is_string($value))
{
$value = str_replace(array("\0", "\n", "\t", "\r"), array('\0', '\n', '\t', '\r'), $value);
$value = strlen($value) > 30 ? substr($value, 0, 30).'...' : $value;
$parameters[$key] = '"'.$value.'"';
}
else if (is_object($value))
{
$parameters[$key] = get_class($value);
}
else if (is_array($value))
{
$parameters[$key] = 'array';
}
else
{
$parameters[$key] = var_export($value, true);
}
}
}
return sprintf('%s(%s)', $this->method->getMethod(), implode(', ', (array)$parameters));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toString() {\n return sprintf(\n \"%s(Calling %s(%d arg(s)) %s)@{\\n\".\n \" [args ] %s\\n\".\n \" [return ] %s\\n\".\n \" [exception ] %s\\n\".\n \" [isInPropertyBehavior] %s\\n\".\n \" [actualCalls ]... | [
"0.7286679",
"0.7013166",
"0.6771366",
"0.6592955",
"0.6395609",
"0.63878465",
"0.62635154",
"0.6175563",
"0.58785987",
"0.5871245",
"0.58293635",
"0.5777014",
"0.5764829",
"0.57433784",
"0.5710327",
"0.5699935",
"0.5645043",
"0.5593387",
"0.5573108",
"0.5530133",
"0.55232674... | 0.68624884 | 2 |
Just update the last recorded time | function updateSameCurrentScore($rawScore, $currentScore) {
$query = "UPDATE `RB3CurrentScores`
SET last_recorded = '$rawScore->recorded'
WHERE id = $currentScore->id";
mysql_query($query);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }",
"public function updateQueryTime()\n\t{\n\t\t$this->setLastQueryTime(time());\n\t\t$this->save();\n\t}",
"public function updateLastUsed()\n {\n if (... | [
"0.76770914",
"0.739268",
"0.73764163",
"0.7301533",
"0.70249254",
"0.68331575",
"0.68214875",
"0.68129647",
"0.6801773",
"0.67551255",
"0.67517203",
"0.6721164",
"0.6716715",
"0.6714452",
"0.6704671",
"0.66938484",
"0.6677496",
"0.66687894",
"0.66350204",
"0.6631558",
"0.661... | 0.0 | -1 |
Truncate data in table before alter his structure | public function truncateTable() {
Schema::disableForeignKeyConstraints();
DB::table('questions')->truncate();
DB::table('answers')->truncate();
Schema::enableForeignKeyConstraints();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function truncate()\n {\n // Désactivation des contraintes FK\n $this->co->executeQuery('SET foreign_key_checks = 0');\n // On tronque\n $this->co->executeQuery('TRUNCATE TABLE casting');\n $this->co->executeQuery('TRUNCATE TABLE department');\n $this->co->execu... | [
"0.7778109",
"0.7232321",
"0.72232217",
"0.7217286",
"0.7166768",
"0.7090838",
"0.7081197",
"0.6998966",
"0.69685507",
"0.69621325",
"0.6954953",
"0.6933242",
"0.6917339",
"0.68343383",
"0.6774539",
"0.6695984",
"0.6688773",
"0.6658805",
"0.6617286",
"0.65879977",
"0.6577454"... | 0.7258272 | 1 |
Transform the resource into an array. | public function toArray($request)
{
// $data = parent::toArray($request);
$data = [];
$data['uid'] = $this->uid;
$data['id'] = $this->id;
$data['fullName'] = $this->nameForMyRole();
$data['email'] = '';
$data['general_phone'] = '';
if (\Auth::user()->hasPermission('access-to-personal')) {
$data['email'] = $this->getValue('email', '');
$data['general_phone'] = $this->getValue('general_phone', '');
}
$steads = $this->steads;
foreach ($steads as $stead) {
$stead['number'] = $stead->stead->number;
unset($stead['stead']);
}
$data['steads'] = $this->steads;
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toArray(): array\n {\n if (is_null($this->resource)) {\n return [];\n }\n\n return is_array($this->resource)\n ? $this->resource\n : $this->resource->toArray();\n }",
"public function toArray(): array\n {\n if (is_null($this->r... | [
"0.7750167",
"0.7750167",
"0.77158",
"0.7590659",
"0.7310113",
"0.71387887",
"0.7135354",
"0.70951104",
"0.70951104",
"0.7095091",
"0.7095091",
"0.7095091",
"0.7095091",
"0.70937836",
"0.70937836",
"0.70937836",
"0.70937836",
"0.70937836",
"0.70937836",
"0.70937836",
"0.70937... | 0.0 | -1 |
Run the database seeds. | public function run()
{
DB::table('publication_types')->insert([
[
'th_name' => 'Journal Papers',
'en_name' => "Journal Papers",
],
[
'th_name' => 'Refereed Conference and Workshop Papers',
'en_name' => "Refereed Conference and Workshop Papers",
],
[
'th_name' => 'Refereed Poster Papers',
'en_name' => "Refereed Poster Paperss",
],
]);
DB::table('publication_types')->update([
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s')
]
);
} | {
"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 |
Display a listing of the resource. | public function __construct()
{
$this->middleware('auth:api');
} | {
"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.75936973",
"0.75936973",
"0.7585464",
"0.7576766",
"0.7571166",
"0.7498768",
"0.7434969",
"0.7432511",
"0.7387868",
"0.7351811",
"0.7336364",
"0.73113805",
"0.7293885",
"0.72812635",
"0.7273037",
"0.72410345",
"0.7228987",
"0.7225174",
"0.718589",
"0.71786976",
"0.7172516"... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
//
return AirlineRate::create([
'rate' => $request['rate'],
'date' => NOW(),
'day' => NOW(),
'user_id' => Auth::user()->id
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.72857565",
"0.714571",
"0.71328056",
"0.66390204",
"0.6620437",
"0.6567189",
"0.6526738",
"0.65074694",
"0.64491314",
"0.63734114",
"0.6370837",
"0.63628685",
"0.63628685",
"0.63628685",
"0.6342026",
"0.63394964",
"0.63394964",
"0.63394964",
"0.63394964",
"0.63394964",
"0.... | 0.0 | -1 |
Display the specified resource. | public function show(AirlineRate $airlineRate)
{
//
} | {
"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(AirlineRate $airlineRate)
{
//
} | {
"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)
{
//
$airline = AirlineRate::findOrFail($id);
$airline->update([
'rate' => $request['rate'],
'date' => $request['date'],
'day' => $request['day'],
'user_id' => Auth::user()->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(AirlineRate $airlineRate)
{
//
} | {
"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.6673811",
"0.66624975",
"0.66376764",
"0.66351163",
"0.66280866",
"0.65443397",
"0.6543099",
"0.64656305",
"0.62881804",
"0.61755043",
"0.61278707",
"0.6089098",
"0.60534257",
"0.6043048",
"0.6006416",
"0.593359",
"0.5929751",
"0.5923406",
"0.59201753",
"0.5904145",
"0.589... | 0.0 | -1 |
return "HAI NAMA SAYA ADIS, DAN SAYA BELAJAR CONTROLELER LARAVEL"; | public function index(){
$nama = "ADIS WIDYA RAMADHAN";
$pelajaran = ["mvc", "laravel", "pemrograman lanjut"];
return view('aku', compact('nama', 'pelajaran'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buenosDias(){\n return \"Hola! buenos días!!\".salto;\n}",
"function aboutMe(){\n return \"Hi my name is Ruby, I am a chatbot, nice to meet you\";\n}",
"function aboutMe(){\n return \"Hi my name is Ruby, I am a chatbot, nice to meet you\";\n}",
"public function bersuara()\n {\n return \"D... | [
"0.7270773",
"0.71938443",
"0.71938443",
"0.7073047",
"0.69907683",
"0.69338274",
"0.68088937",
"0.6770406",
"0.6706742",
"0.66597635",
"0.65890265",
"0.6580275",
"0.6573526",
"0.6481945",
"0.6458035",
"0.6455812",
"0.6423164",
"0.64144903",
"0.6398087",
"0.6396152",
"0.63841... | 0.0 | -1 |
This method is used on contructor to check if each given item can be contained in the container. When this method returns 'false', then an invalid argument exception is throwed. Its default implemantation always returns 'true', but the child classes can reimplement it to keep the container consistency. | protected function canContain($item): bool
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function contains(...$items) : bool;",
"public function inListForItemContainedReturnsTrueDataProvider() {}",
"public function contains(self $item, $checkAgainstThis = true) {}",
"public function has_items()\n {\n }",
"public function inListForItemNotContainedReturnsFalseDataProvider() ... | [
"0.63054496",
"0.61064714",
"0.60920185",
"0.59744334",
"0.5972856",
"0.59413624",
"0.5938047",
"0.5869159",
"0.5851113",
"0.5845355",
"0.5845355",
"0.57907116",
"0.5750357",
"0.57077146",
"0.5680839",
"0.5672905",
"0.56706405",
"0.56604517",
"0.56485707",
"0.5625417",
"0.560... | 0.66998434 | 0 |
The string returned by this method is used to create the invalid argument exception throwed when a given item can not be contained in container. | protected function itemCanNotBeContainedExceptionMessage(string $label): string
{
return "The item '$label' can not be contained in this container";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function beginsWithReturnsInvalidArgumentDataProvider() {}",
"protected function throwInterfaceException(){\n throw new InvalidArgumentException('Invalid $interface argument type : expected string or array of strings');\n }",
"protected function throwTraitException(){\n throw new Invali... | [
"0.5872395",
"0.56960976",
"0.55896795",
"0.557091",
"0.55615705",
"0.5440138",
"0.5365426",
"0.5255015",
"0.5248033",
"0.522471",
"0.5221725",
"0.51909983",
"0.51804",
"0.51517254",
"0.5129337",
"0.51230407",
"0.510752",
"0.5096554",
"0.5096224",
"0.5089041",
"0.50584525",
... | 0.6114548 | 0 |
This method is used to control what happens when try to retrieve an item that does not exist: an exception can be throwed or a default value can be returned. | protected function itemNotFoundHandler(string $label)
{
throw new ItemNotFoundException($label);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUnknownItem()\n {\n $key = 'test';\n $composed = 'cache-bin:test';\n $server = $this->getMemcachedMock(['get']);\n $server->expects($this->once())\n ->method('get')\n ->with($composed)\n ->willReturn(false);\n $this->driver->... | [
"0.6891882",
"0.6744034",
"0.6377104",
"0.6200815",
"0.6057809",
"0.603859",
"0.5980102",
"0.58730054",
"0.5850589",
"0.5847183",
"0.5778543",
"0.5770678",
"0.5690083",
"0.56714255",
"0.56376827",
"0.56301254",
"0.5611481",
"0.56059813",
"0.5595747",
"0.55955315",
"0.5593725"... | 0.5309631 | 47 |
Check login of user | public function login($username, $password)
{
$this->db->select('id, username, password');
$this->db->from('users');
$this->db->where('username', $username);
$this->db->where('password', MD5($password));
$this->db->limit(1);
$query = $this->db->get();
if($query->num_rows() == 1)
{
//print_r($query->row());
return $query->row();
}
else
{
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function _check_login()\n {\n\n }",
"public function isLogin();",
"public function loginCheck()\n\t{\n\t}",
"public function checkUser()\n {\n $response = $this->di->get(\"response\");\n $user = $this->di->get(\"user\");\n\n if (!$user->isLoggedIn()) {\n $respo... | [
"0.8000738",
"0.79501724",
"0.787532",
"0.7778733",
"0.7756958",
"0.76772994",
"0.76654875",
"0.7645711",
"0.7645674",
"0.764541",
"0.76424706",
"0.7628656",
"0.7628555",
"0.76081955",
"0.76062584",
"0.75980073",
"0.7593778",
"0.75796765",
"0.75487655",
"0.7537615",
"0.753598... | 0.0 | -1 |
Read user data from database to show data in admin page | public function get_user($username) {
$condition = "username =" . "'" . $username . "'";
$this->db->select('*');
$this->db->from('users');
$this->db->where($condition);
$this->db->limit(1);
$query = $this->db->get();
if ($query->num_rows() == 1) {
return $query->row();
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function get_user_data()\n {\n }",
"function user_details() {\r\n\t\t\t$query = $this->pdo->prepare(\"select * from user_account\");\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}",
"function ambil_data(){\n\t\treturn $this->db->get('user');\n\t}",
"funct... | [
"0.7112971",
"0.67299855",
"0.66937035",
"0.6675887",
"0.66495246",
"0.6614872",
"0.6590533",
"0.6559691",
"0.65283084",
"0.65140384",
"0.6500292",
"0.64944303",
"0.647126",
"0.64571327",
"0.64480305",
"0.64420104",
"0.6431846",
"0.6416809",
"0.64068496",
"0.6405797",
"0.6405... | 0.0 | -1 |
Update password on forget password | public function updatePassword($email, $newpassword) {
$data = array('password'=>MD5($newpassword));
$this->db->where('email',trim($email));
$result = $this->db->update('users',$data);
if($result) {
return true;
}
else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function changePassword() {}",
"public function testUpdatePasswordNotGiven(): void { }",
"public function resetPassword();",
"function update_password()\n {\n }",
"public function testUpdatePasswordsDontMatch(): void { }",
"public function forgetpassword()\n \t{\n \t\t$this->data['title'] = ... | [
"0.7861368",
"0.78280324",
"0.7431879",
"0.7414188",
"0.72387654",
"0.7163191",
"0.7161194",
"0.7153257",
"0.7122016",
"0.7115512",
"0.710079",
"0.7100747",
"0.70624065",
"0.69956934",
"0.6985837",
"0.6982734",
"0.6979777",
"0.69772786",
"0.697247",
"0.6971464",
"0.69512886",... | 0.0 | -1 |
Function to check if user exist using email | public function checkUserExist($uemail) {
$this->db->select('*');
$this->db->from('users');
$this->db->where('email',$uemail);
$this->db->limit(1);
$query = $this->db->get();
if ($query->num_rows() == 1) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function userExists($email) {\r\n\t\t\tif ($this->getUser($email) != false)\r\n\t\t\t\treturn true;\r\n\t\t\treturn false;\r\n\t\t}",
"function isUserExisted($email) {\n $result = mysql_query(\"SELECT email from users WHERE email = '$email'\",$first);\n $no_of_rows = mysql_num_rows($result);\n ... | [
"0.83206946",
"0.81903964",
"0.8065478",
"0.8029446",
"0.79949516",
"0.7971099",
"0.7969708",
"0.79407555",
"0.7933719",
"0.79192185",
"0.7883798",
"0.78814834",
"0.7870381",
"0.784794",
"0.7847414",
"0.784308",
"0.7841244",
"0.7840542",
"0.78392243",
"0.78332657",
"0.7819802... | 0.7604787 | 52 |
Function to change user password | public function changeUserPassword($rdata) {
$response = array();
$this->db->select('*');
$this->db->from('users');
$this->db->where(array('password'=>md5($rdata['current_pass']), 'id'=>$rdata['user_id']));
$query = $this->db->get();
if ($query->num_rows()) {
if($rdata['new_pass'] != $rdata['confirm_pass']) {
$response['message'] = 'Entered new passwords doesnot match.';
$response['status'] = false;
}
else {
$data = array('password'=>MD5($rdata['new_pass']));
$this->db->where('id',$rdata['user_id']);
$result = $this->db->update('users',$data);
if($result) {
$response['message'] = 'Password updated successfully.';
$response['status'] = true;
}
else {
$response['message'] = 'There was some problem in updating password. Please try again later.';
$response['status'] = true;
}
}
} else {
$response['message'] = 'Current password doesnot match.';
$response['status'] = false;
}
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function changePassword() {}",
"public function changeUserPassword($uid,$newPassword);",
"function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}",
... | [
"0.86941385",
"0.8672989",
"0.8381871",
"0.8345224",
"0.821856",
"0.8167153",
"0.8142631",
"0.8066681",
"0.79199207",
"0.78304094",
"0.7826644",
"0.7824351",
"0.78050786",
"0.77578163",
"0.771736",
"0.7708882",
"0.7681856",
"0.7671913",
"0.7668545",
"0.76655656",
"0.7659713",... | 0.0 | -1 |
Initiate OpenID authentication sequence; Return FALSE on failure or redirect to OpenID provider URL | function auth($proxy=NULL,$attr=[],array $reqd=NULL) {
$fw=\Base::instance();
$root=$fw->SCHEME.'://'.$fw->HOST;
if (empty($this->args['trust_root']))
$this->args['trust_root']=$root.$fw->BASE.'/';
if (empty($this->args['return_to']))
$this->args['return_to']=$root.$_SERVER['REQUEST_URI'];
$this->args['mode']='checkid_setup';
if ($this->url=$this->discover($proxy)) {
if ($attr) {
$this->args['ns.ax']='http://openid.net/srv/ax/1.0';
$this->args['ax.mode']='fetch_request';
foreach ($attr as $key=>$val)
$this->args['ax.type.'.$key]=$val;
$this->args['ax.required']=is_string($reqd)?
$reqd:implode(',',$reqd);
}
$var=[];
foreach ($this->args as $key=>$val)
$var['openid.'.$key]=$val;
$fw->reroute($this->url.'?'.http_build_query($var));
}
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function openidloginAction()\n {\n if(!OPENID_ACTIVE){\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::OPEN_ID_NOT_ACTIVE));\n }\n if(empty($_POST[User::INPUT_OPENID_IDENTITY ])){\n $this->_helper->redirectToRoute('usererror',array('errorC... | [
"0.71878654",
"0.6636602",
"0.6598109",
"0.6526378",
"0.6410717",
"0.6309532",
"0.62821895",
"0.61969507",
"0.6162157",
"0.61491865",
"0.6117497",
"0.6112885",
"0.6089491",
"0.6066943",
"0.5991146",
"0.59550554",
"0.59535706",
"0.5929273",
"0.5873291",
"0.58490545",
"0.583839... | 0.6008249 | 14 |
Return TRUE if OpenID verification was successful | function verified($proxy=NULL) {
preg_match_all('/(?<=^|&)openid\.([^=]+)=([^&]+)/',
$_SERVER['QUERY_STRING'],$matches,PREG_SET_ORDER);
foreach ($matches as $match)
$this->args[$match[1]]=urldecode($match[2]);
if (isset($this->args['mode']) &&
$this->args['mode']!='error' &&
$this->url=$this->discover($proxy)) {
$this->args['mode']='check_authentication';
$var=[];
foreach ($this->args as $key=>$val)
$var['openid.'.$key]=$val;
$req=\Web::instance()->request(
$this->url,
[
'method'=>'POST',
'content'=>http_build_query($var),
'proxy'=>$proxy
]
);
return (bool)preg_match('/is_valid:true/i',$req['body']);
}
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function simpleid_checkid_ok($request) {\n global $version;\n \n $message = array(\n 'openid.mode' => 'id_res',\n 'openid.op_endpoint' => simpleid_url(),\n 'openid.response_nonce' => openid_nonce()\n );\n \n if (isset($request['openid.assoc_handle'])) $message['openid.assoc_h... | [
"0.73925734",
"0.69684803",
"0.67869836",
"0.6735506",
"0.6664794",
"0.66517764",
"0.6561427",
"0.65513575",
"0.65010786",
"0.6498432",
"0.6449355",
"0.6417599",
"0.6397924",
"0.6354561",
"0.63356715",
"0.63136905",
"0.6278225",
"0.6266145",
"0.62433296",
"0.62351215",
"0.622... | 0.76412565 | 0 |
Return OpenID response fields | function response() {
return $this->args;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function identity_response($params){\n \t\t$params['organization_id'] \t= 'organization_id';\n \t\t$params['first_name'] \t\t= 'first_name';\n \t\t$params['last_name'] \t\t= 'last_name';\n \t\t$params['display_name'] \t= 'display_name';\n \t\t$params['username'] \t\t= 'username';\n \t\t$pa... | [
"0.64128536",
"0.60819304",
"0.60235065",
"0.60016",
"0.59965914",
"0.59821975",
"0.59128153",
"0.5883651",
"0.58014685",
"0.57673734",
"0.5658231",
"0.5637676",
"0.5637676",
"0.5590765",
"0.55459577",
"0.54850215",
"0.54598284",
"0.54461396",
"0.5426458",
"0.5406883",
"0.538... | 0.0 | -1 |
Return TRUE if OpenID request parameter exists | function exists($key) {
return isset($this->args[$key]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function IsReturned() : bool\n {\n return isset($_GET[\"openid_mode\"]) && !empty($_GET[\"openid_mode\"]); \n }",
"function exist_param($fieldname){\n return array_key_exists($fieldname, $_REQUEST);\n }",
"private function requestIsValid() : bool\n {\n $queryPa... | [
"0.6788513",
"0.6614573",
"0.6592335",
"0.658063",
"0.63463813",
"0.63086665",
"0.61476433",
"0.6126315",
"0.609339",
"0.609339",
"0.609339",
"0.609339",
"0.609339",
"0.6061259",
"0.6047614",
"0.6025157",
"0.60201937",
"0.593439",
"0.5897878",
"0.58679247",
"0.5846166",
"0.... | 0.0 | -1 |
Bind value to OpenID request parameter | function set($key,$val) {
return $this->args[$key]=$val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function bindOpenID($uid, $openid_identifier);",
"public function getUserIDByOpenID($openid_identifier);",
"function getOpenIDURL() {\n\t// value.\n\n\tif (substr($_POST[ssoInpUsername], 0, 4) == \"http\") {\n\t\t$tmpuri = $_POST[ssoInpUsername];\n\t} else {\n\t\tif (in_array(strtolower(trim($_POST[ssoI... | [
"0.6909441",
"0.5722527",
"0.56329674",
"0.5630883",
"0.56131417",
"0.5605959",
"0.5532851",
"0.5474188",
"0.5474188",
"0.52787304",
"0.5273853",
"0.5211374",
"0.52070785",
"0.5190931",
"0.51783967",
"0.51783967",
"0.51783967",
"0.51783967",
"0.51783967",
"0.51783967",
"0.517... | 0.0 | -1 |
Return value of OpenID request parameter | function &get($key) {
if (isset($this->args[$key]))
$val=&$this->args[$key];
else
$val=NULL;
return $val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOpenid()\n {\n return $this->openid;\n }",
"public function getOpenid()\n {\n return $this->openid;\n }",
"function getOpenIDURL() {\n\t// value.\n\n\tif (substr($_POST[ssoInpUsername], 0, 4) == \"http\") {\n\t\t$tmpuri = $_POST[ssoInpUsername];\n\t} else {\n\t\tif ... | [
"0.66919035",
"0.66919035",
"0.6655184",
"0.6621862",
"0.65798724",
"0.63028044",
"0.6284274",
"0.6138221",
"0.6109803",
"0.60807216",
"0.5939436",
"0.58816826",
"0.5847615",
"0.58355683",
"0.5834199",
"0.5821775",
"0.58125377",
"0.57962114",
"0.5739659",
"0.572749",
"0.57165... | 0.0 | -1 |
Remove OpenID request parameter | function clear($key) {
unset($this->args[$key]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function unbindOpenID($uid, $openid_identifier);",
"private function clearParam($param) {\n return str_replace(self::REQUIRED_PARAM,\"\",$param);\n }",
"private function resetParams()\n {\n $this->id = null;\n }",
"function remove_query_arg($key, $query = \\false)\n {\n }"... | [
"0.59709996",
"0.56573135",
"0.5618431",
"0.55569035",
"0.5447615",
"0.54240555",
"0.5382735",
"0.5345631",
"0.532915",
"0.5294794",
"0.5271827",
"0.526978",
"0.5267027",
"0.52315634",
"0.5221512",
"0.5199992",
"0.5192864",
"0.51904815",
"0.5176107",
"0.5130429",
"0.5126567",... | 0.0 | -1 |
/ This PHP file contains Cookie Ultilities Accessing Cookies with PHP | function getCookiesInfo(){
echo "Cookies information: <br>";
if( isset($_COOKIE["name"])){
echo "_COOKIE[\"name\"]: " . $_COOKIE["name"] . "<br />";
}
else{
echo "Sorry... _COOKIE[\"name\"] is not set yet !" . "<br />";
}
//echo "HTTP_COOKIE_VARS[\"name\"]: " . $HTTP_COOKIE_VARS["name"]. "<br />";
//echo "_COOKIE[\"age\"]: " . $_COOKIE["age"] . "<br />";
//echo "HTTP_COOKIE_VARS[\"name\"]: " . $HTTP_COOKIE_VARS["name"] . "<br />";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_cookies()\n {\n }",
"function doCookies() {\r\n setcookie(\"cli_num\", 123456789, time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_fname\", $_POST['first_name'], time() + (86400 * 1), \"/\");\r\n setcookie(\"cli_lname\", $_POST['last_name'], time() + (86400 * 1), \"/\"... | [
"0.7423709",
"0.72413534",
"0.7023248",
"0.70126003",
"0.6996902",
"0.69403803",
"0.6939797",
"0.68988234",
"0.68562573",
"0.670981",
"0.67063296",
"0.66999906",
"0.667409",
"0.6648376",
"0.66480535",
"0.6637746",
"0.6601291",
"0.65902483",
"0.658814",
"0.658149",
"0.65789473... | 0.7251826 | 1 |
The only action of this controller. This action is used to rewrite the backend Config saveTemplateAction and save additional data. | public function saveTemplateAction()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveAction() :void\n {\n $data = $this->request->getPost();\n $record = ModuleTemplate::findFirst();\n if ($record === null) {\n $record = new ModuleTemplate();\n }\n $this->db->begin();\n foreach ($record as $key => $value) {\n ... | [
"0.6807841",
"0.6206388",
"0.61593",
"0.610639",
"0.6096789",
"0.6075421",
"0.5825599",
"0.5812048",
"0.5737642",
"0.56738055",
"0.5637621",
"0.5622439",
"0.5603154",
"0.5595343",
"0.5590436",
"0.55859154",
"0.55521786",
"0.5511519",
"0.54491484",
"0.54472715",
"0.5446891",
... | 0.74228793 | 0 |
Constructor. We'll throw exceptions if the path don't exist | public function __construct()
{
$this->path = str_finish( Config::get( 'app.gsd.folder' ), '/' );
if ( ! is_dir( $this->path ) )
{
throw new \RuntimeException( "Directory doesn't exist: $this->path" );
}
if ( ! is_dir( $this->path . 'archived' ) )
{
throw new \RuntimeException( "Directory doesn't exist: $this->path" . 'archived' );
}
$this->extension = Config::get( 'app.gsd.extension' );
if ( ! starts_with( $this->extension, '.' ) )
{
$this->extension = '.' . $this->extension;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct($path){\n\t\t$this->path = $path;\n\t\tif(!file_exists($path)){\n\t\t\t$this->createFile($path);\n\t\t}\n\t}",
"function __construct($path) {\n\t\t$this->path = $path;\t\t\n\t}",
"public function __construct($path);",
"public function __construct($path) {\n\t$this->path = $path;\n... | [
"0.78000456",
"0.77823865",
"0.77765036",
"0.7719788",
"0.76885927",
"0.7670511",
"0.7615673",
"0.7608085",
"0.7608085",
"0.760578",
"0.75789213",
"0.75789213",
"0.7564336",
"0.7529935",
"0.7507968",
"0.7503505",
"0.7452567",
"0.7432483",
"0.7413853",
"0.7375766",
"0.73632514... | 0.6830685 | 45 |
Delete the todo list | public function delete( $id, $archived = false )
{
$file = $this->fullpath( $id, $archived );
if ( file_exists( $file ) )
{
return unlink( $file );
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteToDoList() {\n try {\n if (!($this->toDoList instanceof Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList)) {\n throw new Base_Model_ObtorLib_App_Core_Crm_Exception(\" ToDoList Entity not intialized\");\n } else {\n $objToDoList = new ... | [
"0.7782574",
"0.73112094",
"0.72195613",
"0.71730906",
"0.7115361",
"0.70023465",
"0.6972259",
"0.6886819",
"0.6881243",
"0.6838658",
"0.68322116",
"0.68302083",
"0.68302083",
"0.67959166",
"0.6775024",
"0.6729515",
"0.672243",
"0.6720572",
"0.6624582",
"0.66016763",
"0.65966... | 0.0 | -1 |
Does the todo list exist? | public function exists( $id, $archived = false )
{
$file = $this->fullpath( $id, $archived );
return file_exists( $file );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasTaskList(){\n return $this->_has(2);\n }",
"private static function checkIfTodoListTableExists()\n {\n $query = \"SELECT 1 FROM Todo_List\";\n $result = mysqli_query(Core_DbConnectionModel::getInstance(), $query);\n\n //this part allows you to do something if th... | [
"0.69863826",
"0.68293256",
"0.6670974",
"0.66367286",
"0.66166806",
"0.6424875",
"0.6389467",
"0.6277692",
"0.6262712",
"0.6225053",
"0.619561",
"0.619561",
"0.619561",
"0.6166395",
"0.614979",
"0.6139405",
"0.61391646",
"0.6123752",
"0.61158943",
"0.61158943",
"0.61158943",... | 0.0 | -1 |
Return the ids of all the lists | public function getAll( $archived = false )
{
$match = $this->path;
if ( $archived )
{
$match .= 'archived/';
}
$match .= '*' . $this->extension;
$files = glob( $match );
$ids = array();
foreach ($files as $file)
{
$ids[] = basename( $file, $this->extension );
}
return $ids;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getIdsList() {\n return $this->_get(1);\n }",
"public function getAllIds();",
"public function getIds();",
"public function getIds();",
"public abstract function get_ids();",
"public function getAllIds(): array;",
"public function getIdList() {\n migrate_instrument_start(\"Re... | [
"0.79293543",
"0.77623045",
"0.77308035",
"0.77308035",
"0.7726254",
"0.73464864",
"0.7294538",
"0.72793114",
"0.72324073",
"0.72320527",
"0.72209",
"0.72209",
"0.72209",
"0.72209",
"0.72209",
"0.72209",
"0.72209",
"0.72209",
"0.7157794",
"0.7129071",
"0.7128736",
"0.708944... | 0.0 | -1 |
Load a Todolist from it's id | public function load( $id, $archived = false )
{
if ( ! $this->exists( $id, $archived ) )
{
throw new \InvalidArgumentException( "List with id = $id, archived = $archived not found" );
}
$lines = file( $this->fullpath( $id, $archived ) );
// Pull title
$title = array_shift( $lines );
$title = trim( substr( $title, 1 ) );
// Pull subtitle
if ( count( $lines ) && $lines[0][0] == '(' )
{
$subtitle = trim( array_shift( $lines ) );
$subtitle = ltrim( $subtitle, '(' );
$subtitle = rtrim( $subtitle, ')' );
}
// Setup the list
$list = \App::make( 'GSD\Entities\ListInterface' );
$list->set( 'id', $id );
$list->set( 'title', $title );
if ( ! empty( $subtitle ) )
{
$list->set( 'subtitle', $subtitle );
}
$list->set( 'archived', $archived );
// And add the tasks
foreach ( $lines as $line )
{
$line = trim( $line );
if ( $line )
{
$list->taskAdd( $line );
}
}
return $list;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getToDoList($id) {\n try {\n $id = (int) $id;\n $row = $this->fetchRow('id = ' . $id);\n if ($row) {\n $toDoListRow = $row->toArray();\n $toDoListEntity = new Base_Model_ObtorLib_App_Core_Crm_Entity_ToDoList();\n $... | [
"0.6895317",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",
"0.67841667",... | 0.66211396 | 31 |
Return the path to the list file | protected function fullpath( $id, $archived )
{
$path = $this->path;
if ( $archived )
{
$path .= 'archived/';
}
$path .= $id . $this->extension;
return $path;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getWordListPath(): string\n {\n return __DIR__ . \"/../data/{$this->locale}.txt\";\n }",
"public function getLocalExtListFile() {}",
"public function getWordListFile()\n {\n return $this->wordListFile;\n }",
"public function get_file_list()\n {\n return ... | [
"0.7239392",
"0.6959175",
"0.69184566",
"0.6745751",
"0.6709467",
"0.669723",
"0.6681542",
"0.6620379",
"0.65630555",
"0.64606255",
"0.64557976",
"0.64282966",
"0.64278686",
"0.6372177",
"0.6333312",
"0.62620836",
"0.6221003",
"0.62128127",
"0.6191459",
"0.6168023",
"0.615904... | 0.0 | -1 |
$servicos = $this>db>query("SELECT FROM vw_listar_servicos_categoria ORDER BY data_servico DESC;")>result(); | public function getView()
{
if(!$this->base->isAdmin())
$servicos = $this->db->where('inativo IS FALSE');
$servicos = $this->db->order_by('data_servico', 'desc')->get('vw_listar_servicos_categoria')->result();
return $servicos;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function noticiasActivas(){\r\n\t$objDatos = new clsDatos();\r\n\t$sql=\"select * from noticias where activo='1' order by fecha DESC\";\r\n\t$res = $objDatos->filtroListado($sql);\r\n\treturn $res;\r\n}",
"function listarServicios()\n\t{\n\t\treturn \"select servicios.servicio_id,servicios.nombre_servicio... | [
"0.72769225",
"0.6814404",
"0.6790958",
"0.67826134",
"0.6764313",
"0.67016816",
"0.6692756",
"0.6640065",
"0.6636746",
"0.65971464",
"0.65594256",
"0.6545949",
"0.65322655",
"0.65309966",
"0.65279615",
"0.65264034",
"0.651125",
"0.64916867",
"0.64806974",
"0.64722884",
"0.64... | 0.6856004 | 1 |
$realtime = new Realtime; | public function configed_value()
{
$Realtime = Realtime::where('code', request()->code)
->where('user_id', Auth::id())->first();
//->where('user_id', auth()->user()->id);
//dd($Realtime);
if (request()->set == 'set') {
//set
//dd('set!!');
//foreach ($Realtimes as $Realtime) {
$Realtime->upperlimit = request()->upperlimit;
if($Realtime->upperlimit != null){
$time = date( "Y-m-d H:i:s" );
$Realtime->ul_setat = $time;
}
$Realtime->lowerlimit = request()->lowerlimit;
if($Realtime->lowerlimit != null){
$time = date( "Y-m-d H:i:s" );
$Realtime->ll_setat = $time;
}
$Realtime->sendflag = false;
} else {
//delete
//dd('delete!!');
//dd($Realtime);
//$Realtime->delete();
Realtime::where('code', request()->code)
->where('user_id', Auth::id())->first()->delete();
}
//dd($Realtime);
$Realtime->save();
//}
return redirect('/Realtimes/value');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function realtime($params = []);",
"protected static function getFacadeAccessor()\n {\n return 'realtime';\n }",
"function __construct(){\r\n $this->timestamp = time();\r\n }",
"public function __construct() {\n $this->time = time();\n }",
"abstract protected functio... | [
"0.6436666",
"0.6018347",
"0.5882265",
"0.58461905",
"0.5828165",
"0.5827023",
"0.56234324",
"0.5596158",
"0.54346114",
"0.54344",
"0.5408614",
"0.537275",
"0.5325369",
"0.5319352",
"0.53146076",
"0.52909255",
"0.5290442",
"0.5262252",
"0.5230705",
"0.52239597",
"0.5221464",
... | 0.0 | -1 |
$realtime = new Realtime; | public function configed_changerate()
{
$Realtime = Realtime::where('code', request()->code)
->where('user_id', Auth::id())->first();
//->where('user_id', auth()->user()->id);
//dd($Realtime);
if (request()->set == 'set') {
//set
//dd('set!!');
$Realtime->changerate_range = request()->changerate_range;
if($Realtime->changerate_range != null){
$time = date( "Y-m-d H:i:s" );
$Realtime->cr_setat = $time;
}
$Realtime->sendflag_changerate = false;
$Realtime->changecount = 0;
} else {
//delete
//dd('delete!!');
//dd($Realtime);
//$Realtime->delete();
Realtime::where('code', request()->code)
->where('user_id', Auth::id())->first()->delete();
}
//dd($Realtime);
$Realtime->save();
//}
return redirect('/Realtimes/changerate');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function realtime($params = []);",
"protected static function getFacadeAccessor()\n {\n return 'realtime';\n }",
"function __construct(){\r\n $this->timestamp = time();\r\n }",
"public function __construct() {\n $this->time = time();\n }",
"abstract protected functio... | [
"0.6436666",
"0.6018347",
"0.5882265",
"0.58461905",
"0.5828165",
"0.5827023",
"0.56234324",
"0.5596158",
"0.54346114",
"0.54344",
"0.5408614",
"0.537275",
"0.5325369",
"0.5319352",
"0.53146076",
"0.52909255",
"0.5290442",
"0.5262252",
"0.5230705",
"0.52239597",
"0.5221464",
... | 0.0 | -1 |
Creates an async future Example: `var i = Future.async(function(cb) cb(1)); // Future` | public static function async ($f, $lazy = false) {
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:136: lines 136-143
if ($lazy === null) {
$lazy = false;
}
if ($lazy) {
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:137: characters 7-32
return new LazyTrigger($f);
} else {
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:139: characters 7-26
$op = new FutureTrigger();
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:140: characters 7-41
$wrapped = $f;
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:141: characters 7-33
Callback_Impl_::invoke($wrapped, Boot::getInstanceClosure($op, 'trigger'));
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:142: characters 7-16
return $op;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function async(\\Closure $closure, mixed ...$args): Future\n{\n static $run = null;\n\n $run ??= static function (FutureState $state, \\Closure $closure, array $args): void {\n $s = $state;\n $c = $closure;\n\n /* Null function arguments so an exception thrown from the closure does not c... | [
"0.67485434",
"0.6007624",
"0.58094066",
"0.57909596",
"0.5514295",
"0.52986526",
"0.5222937",
"0.5206424",
"0.49322152",
"0.4917685",
"0.4896583",
"0.48238853",
"0.47998327",
"0.4753771",
"0.47355717",
"0.47044033",
"0.470207",
"0.46716198",
"0.4650543",
"0.46186626",
"0.460... | 0.50385267 | 8 |
Flattens `Future>` into `Future` | public static function flatten ($f) {
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:76: characters 5-31
return new NestedFuture($f);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function flatten ($f) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:71: characters 5-31\n\t\treturn new NestedFuture($f);\n\t}",
"static public function ofMany ($futures, $gather = true) {\n\t\t#/home/grabli66/haxelib/tink_core/git/src/tink/core/Future.hx:93: lines 93-108\n\t... | [
"0.65526605",
"0.47828382",
"0.4586958",
"0.45754296",
"0.45375106",
"0.44992465",
"0.43423042",
"0.43423042",
"0.4330191",
"0.4330191",
"0.4330191",
"0.43190578",
"0.43002105",
"0.42518944",
"0.4193827",
"0.40919286",
"0.40881062",
"0.40716207",
"0.40613842",
"0.40016177",
"... | 0.65837544 | 0 |
Like `map` and `flatMap` but with a polymorphic transformer and return a `Promise` | public static function next ($this1, $n) {
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:62: characters 5-50
return $this1->flatMap(function ($v) use (&$n) {
#/home/jahred/haxelib/tink_core/1,23,0/src/tink/core/Future.hx:62: characters 38-49
return $n($v);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function flatMap(Closure $doSomething): Result;",
"function map(array $promises, callable $functor) {\n if (empty($promises)) {\n return new Success([]);\n }\n\n $results = [];\n $remaining = count($promises);\n $promisor = new Future;\n\n foreach ($promises as $key => $resolva... | [
"0.5525345",
"0.5384199",
"0.5153488",
"0.51070356",
"0.5048584",
"0.5046414",
"0.4751486",
"0.46936995",
"0.4689983",
"0.4683948",
"0.45980072",
"0.45875445",
"0.45829022",
"0.4494961",
"0.44889203",
"0.4481982",
"0.44614464",
"0.44428676",
"0.4426489",
"0.44257954",
"0.4356... | 0.0 | -1 |
Complie and display a page | public function display($file) {
$tpl_file = $this->option ['templateDir'] . '/' . $file;
if (! file_exists ( $tpl_file ))
$this->core->err ( '102', $tpl_file );
$parse_file = $this->option ['compileDir'] . '/' . sha1 ( $file ) . $file . '.php';
if (! file_exists ( $parse_file ) || filemtime ( $parse_file ) < filemtime ( $tpl_file )) {
$compile = new templatesModuleCompiler ( $this->core, $this->option, $tpl_file );
$compile->parse ( $parse_file );
}
if ($this->option ['cache']) {
$cache_file = $this->option ['cacheDir'] . '/' . sha1 ( $file ) . $file . '.html';
// Create cache file if needed
if (! file_exists ( $cache_file ) || filemtime ( $cache_file ) < filemtime ( $parse_file )) {
include $parse_file;
$content = ob_get_clean ();
if (! file_put_contents ( $cache_file, $content ))
$this->core->err ( '112' );
}
include $cache_file;
} else {
include $parse_file;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract function render_page();",
"public function show() {\n $this->buildPage();\n echo $this->_page;\n }",
"function showPage() \n\t{\n\t\t$this->xt->display($this->templatefile);\n\t}",
"public function page () {\n\t\tinclude _APP_ . '/views/pages/' . $this->_reg->controller . '/' . $this->_page .... | [
"0.8070252",
"0.79154104",
"0.78222895",
"0.7767053",
"0.76272744",
"0.7448393",
"0.7422496",
"0.73341316",
"0.7299697",
"0.72345835",
"0.7193607",
"0.7193607",
"0.71652365",
"0.71650255",
"0.71485704",
"0.71343696",
"0.71206266",
"0.7119685",
"0.71171546",
"0.71163964",
"0.7... | 0.0 | -1 |
Check if all directory exist | private function checkDir() {
if (! is_dir ( $this->option ['templateDir'] ))
$this->core->err ( '101', $this->option ['templateDir'] );
if (! is_dir ( $this->option ['compileDir'] ))
$this->core->err ( '101', $this->option ['compileDir'] );
if (! is_dir ( $this->option ['cacheDir'] ))
$this->core->err ( '101', $this->option ['cacheDir'] );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function dirIsValid() {\n return is_dir($this->directory);\n }",
"public function hasDirectory(): bool;",
"public function hasDirectory(): bool;",
"private function checkDir()\n {\n $this->init = $this->url[0].'/';\n\n for ($i=0; $i < $this->count; $i++) { \n if ... | [
"0.7449259",
"0.7408391",
"0.7408391",
"0.7401099",
"0.73093694",
"0.7083247",
"0.70210826",
"0.69589573",
"0.6884606",
"0.68573403",
"0.68551856",
"0.679944",
"0.67898685",
"0.67351127",
"0.67292583",
"0.6685421",
"0.66850334",
"0.66716367",
"0.66559976",
"0.6643821",
"0.660... | 0.7329989 | 4 |
This method can be used to set a different translation key or set up a plain text message without i18n. | public function setStatusMessageDatabaseError(string $statusMessageDatabaseError): void
{
$this->statusMessageDatabaseError = $statusMessageDatabaseError;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function withLangMessage($key, $type = '')\n {\n return $this->withMessage($this->translator->get($key), $type);\n }",
"public function withLangMessage($key, $type = '')\n {\n return $this->withMessage($this->translator->get($key), $type);\n }",
"public function setMessageTempl... | [
"0.64905816",
"0.64905816",
"0.63594556",
"0.63263065",
"0.63222474",
"0.6317344",
"0.62044376",
"0.61722296",
"0.61546296",
"0.6112332",
"0.61035514",
"0.6049454",
"0.6022954",
"0.5949653",
"0.59476584",
"0.59374326",
"0.59299695",
"0.5892191",
"0.5883109",
"0.58784956",
"0.... | 0.0 | -1 |
This method can be used to set a different translation key or set up a plain text message without i18n. | public function setStatusMessageFatalError(string $statusMessageFatalError): void
{
$this->statusMessageFatalError = $statusMessageFatalError;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function withLangMessage($key, $type = '')\n {\n return $this->withMessage($this->translator->get($key), $type);\n }",
"public function withLangMessage($key, $type = '')\n {\n return $this->withMessage($this->translator->get($key), $type);\n }",
"public function setMessageTempl... | [
"0.64909166",
"0.64909166",
"0.63598126",
"0.6325922",
"0.6322502",
"0.6316516",
"0.62049615",
"0.6173829",
"0.61541957",
"0.6110681",
"0.61044574",
"0.6050799",
"0.6023423",
"0.594828",
"0.594678",
"0.5938107",
"0.59321636",
"0.58935267",
"0.5883487",
"0.5879758",
"0.5879219... | 0.0 | -1 |
Display a listing of the resource. | public function index()
{
return $this->attendanceRepository->all();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->re... | [
"0.7446777",
"0.736227",
"0.73005503",
"0.72478926",
"0.71631265",
"0.71489686",
"0.7131636",
"0.7105969",
"0.71029514",
"0.7101372",
"0.70508176",
"0.6995128",
"0.69890636",
"0.6934895",
"0.6900203",
"0.6899281",
"0.6891734",
"0.6887235",
"0.68670005",
"0.6849741",
"0.683052... | 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return view('admin.resources.create');\n }",
"public function create(){\n\n return view(... | [
"0.7594873",
"0.7594873",
"0.75862724",
"0.7577369",
"0.75727355",
"0.7500874",
"0.74348205",
"0.74339336",
"0.7389178",
"0.73531044",
"0.73364365",
"0.73124814",
"0.7296061",
"0.72818893",
"0.7274119",
"0.72423935",
"0.72292763",
"0.72266877",
"0.7187332",
"0.717915",
"0.717... | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
request()->validate([
'file' => '|required|file|mimes:xlsx,csv,tsv,ods,xls,slk,xml,gnumeric,html',
]);
if ($this->attendanceRepository->save($request)) {
return response(array("id" => 1, "message" => "ok"));
} else {
return response(array("id" => 0, "message" => "fail"));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations... | [
"0.7286258",
"0.71454436",
"0.7132821",
"0.6640289",
"0.6621105",
"0.6566493",
"0.65255576",
"0.65087926",
"0.6448317",
"0.63752604",
"0.63736314",
"0.6365631",
"0.6365631",
"0.6365631",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.... | 0.0 | -1 |
Display the specified resource. | public function show($id)
{
return $this->attendanceRepository->find($id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id... | [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245... | 0.0 | -1 |
Show the form for editing the specified resource. | public function edit(Attendance $attendance)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n ... | [
"0.78557473",
"0.76946205",
"0.72731614",
"0.7241571",
"0.71700776",
"0.70650244",
"0.7052897",
"0.698311",
"0.69465625",
"0.6944826",
"0.69399333",
"0.69286525",
"0.69031185",
"0.68969506",
"0.68969506",
"0.6878258",
"0.6862812",
"0.6859171",
"0.68560475",
"0.68436426",
"0.6... | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, $id)
{
request()->validate([
'ac_no' => 'sometimes|required|integer',
'name' => 'sometimes|required|string',
'date' => 'sometimes|required|date',
'timetable' => 'sometimes|required|string',
'on_duty' => 'sometimes|required|date_format:H:i',
'off_duty' => 'sometimes|required|date_format:H:i',
'clock_in' => 'nullable|date_format:H:i',
'clock_out' => 'nullable|date_format:H:i',
'late' => 'nullable|date_format:H:i',
'early' => 'nullable|date_format:H:i',
'absent' => 'sometimes|required|integer',
'ot_time' => 'nullable|date_format:H:i',
'work_time' => 'nullable|date_format:H:i',
'comment' => 'sometimes|required|string',
]);
$data = $request->all();
$data['user_id'] = Auth::user()->id;
if ($this->attendanceRepository->update($data, $id)) {
return response(array("id" => 1, "message" => "ok"));
} else {
return response(array("id" => 1, "message" => "fail"));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ... | [
"0.7424884",
"0.7062319",
"0.70572054",
"0.6897199",
"0.658233",
"0.6450576",
"0.6347209",
"0.6211253",
"0.6146092",
"0.6121878",
"0.6114851",
"0.61005586",
"0.608833",
"0.60537165",
"0.60196865",
"0.60068345",
"0.5972924",
"0.594671",
"0.5940615",
"0.5938648",
"0.58927333",
... | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
if ($this->attendanceRepository->delete($id)) {
return response(array("id" => 1, "message" => "ok"));
} else {
return response(array("id" => 1, "message" => "fail"));
}
} | {
"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 |
Loads a Class given the class name | public static function loadClass($className) {
if($className === NULL) {
throw new WURFL_WURFLException("Unable To Load Class : " . $className);
}
if (substr($className, 0, 6) !== WURFL_ClassLoader::CLASS_PREFIX) {
return FALSE;
}
if (!class_exists($className, false)) {
$ROOT = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$classFilePath = str_replace('_', DIRECTORY_SEPARATOR, substr($className, 6)) . '.php';
require_once ($ROOT . $classFilePath);
}
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function load(string $class);",
"public function load($className);",
"public function loadClass($name) {\r\n //array of classes to be laoded\r\n $classes = array(\r\n 'Config' => '../config/Config.php',\r\n 'Error' => '../validation/Error.php',\r\n 'Flash' ... | [
"0.83062476",
"0.7954105",
"0.7674033",
"0.76098144",
"0.7552139",
"0.7406533",
"0.7373622",
"0.7251981",
"0.718307",
"0.7143206",
"0.7132103",
"0.71142006",
"0.70990413",
"0.70886433",
"0.70604175",
"0.7035116",
"0.7026227",
"0.6997787",
"0.6971654",
"0.69662434",
"0.6959065... | 0.0 | -1 |
Sets autorization header telling that you need to be authenticated | public function setAuthenticateHeader()
{
$response = \Yii::$app->response;
$response->getHeaders()->set('WWW-Authenticate', "Basic realm=\"{$this->realm}\"");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setAuthorization()\n\t{\n\t\t// @TODO We don't deal with a case where during your session the token expires\n\t\tif (is_null($this->access_token))\n\t\t{\n\t\t\t$response = $this->getToken();\n\t\t\t$this->access_token = $response->access_token;\n\t\t\t$this->authorization = \"Bearer \" . $this->ac... | [
"0.702322",
"0.7004076",
"0.6986348",
"0.6976852",
"0.6959325",
"0.675015",
"0.6735196",
"0.673283",
"0.6685304",
"0.66836655",
"0.6605274",
"0.6583517",
"0.64165694",
"0.64147997",
"0.63940006",
"0.6292193",
"0.6210134",
"0.617427",
"0.61313754",
"0.6114502",
"0.60141236",
... | 0.70890963 | 0 |
Function to Add Plan | public function AddExe($data){
$this->db->insert('executive',$data);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createPlan(){\n if(!$this->request->plan_name || !$this->request->plan_description) {\n return false;\n }\n $this->plan = Planes::create([\n 'name' => $this->request->plan_name,\n 'description' => $this->request->plan_description,\n ... | [
"0.71260136",
"0.68350846",
"0.6752477",
"0.67453843",
"0.66361356",
"0.6618997",
"0.64919925",
"0.63379884",
"0.63285094",
"0.63147736",
"0.6292509",
"0.6236067",
"0.618298",
"0.61351556",
"0.6090559",
"0.608655",
"0.6032568",
"0.6024815",
"0.6014579",
"0.5982948",
"0.594632... | 0.0 | -1 |
Function to Update Plan | public function UpdateExe($data,$id){
$this->db->where('exe_id',$id);
$this->db->update('executive',$data);
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testUpdatePackingPlan()\n {\n }",
"public function update_plan() {\n if (empty($this->user->admin)) {\n Router::redirect('/');\n die();\n }\n\n # Set up query\n $q = \"UPDATE plans SET\n\t\t\t description='\".$_POST['description'].\"', time... | [
"0.7549871",
"0.7341028",
"0.7189941",
"0.70633256",
"0.6830342",
"0.6800236",
"0.6799026",
"0.67880315",
"0.67170304",
"0.66917133",
"0.65889215",
"0.65039545",
"0.6362408",
"0.6361475",
"0.62863857",
"0.6250946",
"0.6226422",
"0.6207356",
"0.61857635",
"0.6139623",
"0.61328... | 0.0 | -1 |
Function to Delete Plan | public function DeleteExe($exe_id){
$this->db->where('exe_id',$exe_id);
$this->db->delete('executive');
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete_plan() {\n if (empty($this->user->admin)) {\n Router::redirect('/');\n die();\n }\n\n # Set up query\n $q = \"DELETE FROM plans\n\t\t\t WHERE plan_id=\".$_POST['plan_id'];\n $plans = DB::instance(DB_NAME)->query($q);\n\n //Retu... | [
"0.7521497",
"0.74868625",
"0.73012066",
"0.72344637",
"0.7232439",
"0.72282875",
"0.7214159",
"0.69692075",
"0.69659406",
"0.6919226",
"0.6894218",
"0.6878555",
"0.68476814",
"0.6801455",
"0.6692988",
"0.6606185",
"0.6542338",
"0.65063864",
"0.64856935",
"0.6480352",
"0.6411... | 0.0 | -1 |
Execute will be called in a endless loop | protected function execute(InputInterface $input, OutputInterface $output)
{
$this->issuedLicense();
$this->priceInvoice();
$this->activeInstance();
$this->suspendedInstance();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function execute()\n\t{\n\t\t$this->run();\n\t}",
"public function execute()\n {\n $this->run();\n }",
"protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",... | [
"0.7672592",
"0.7438123",
"0.72877234",
"0.7224473",
"0.7224473",
"0.7224033",
"0.7224033",
"0.7224033",
"0.7224033",
"0.7224033",
"0.7224033",
"0.7223859",
"0.7223859",
"0.7223859",
"0.7223859",
"0.7223859",
"0.7223859",
"0.7223859",
"0.7223859",
"0.7223859",
"0.7223859",
... | 0.0 | -1 |
Welcome to upload helper file This file get file to be uploaded return path where it is uploaded | function upload_file($file_name, $allowed_ext, $allowed_mime, $max_size, $location) {
$ext = pathinfo($_FILES[$file_name]['name'], PATHINFO_EXTENSION);
if ((in_array($_FILES[$file_name]['type'], $allowed_mime))
&& (in_array(strtolower($ext), $allowed_ext))
&& (@getimagesize($_FILES[$file_name]['tmp_name']) !== false)
&& ($_FILES[$file_name]['size'] <= $max_size)) {
$md5 = substr(md5_file($_FILES[$file_name]['tmp_name']), 0, 7);
$newname = time().$md5.'.'.$ext;
move_uploaded_file($_FILES[$file_name]['tmp_name'], __DIR__.'/../'.$location.'/'.$newname);
return $location.'/'.$newname;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function uploadPath();",
"public function getRelativeUploadPath(): string;",
"protected function getFullPathToUploadFile()\n {\n return $this->fullPathToUploadFile;\n }",
"public function getUploadPath()\n\t{\n\t\t// return Yii::app()->params->upload.'/';\n\t\treturn Yii::app()->config->f... | [
"0.8447694",
"0.7907046",
"0.78354186",
"0.76956284",
"0.7639022",
"0.7589565",
"0.7583486",
"0.7524702",
"0.7502496",
"0.74898064",
"0.7483539",
"0.7474317",
"0.74570423",
"0.7315897",
"0.73075366",
"0.72570217",
"0.7250155",
"0.71630424",
"0.71630424",
"0.71630424",
"0.7163... | 0.0 | -1 |
/ Constructs the module. | public function __construct(array $fields = null)
{
$this->fields = $fields;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n parent::__construct(array(\n 'name' => __('Module Boilerplate', 'fl-builder'),\n 'description' => __('An starting point for coding new modules.', 'fl-builder'),\n 'category'\t\t=> __('Advanced Modules', 'fl-builder'),\n ... | [
"0.70421374",
"0.7001411",
"0.68424916",
"0.6837479",
"0.6759943",
"0.67455304",
"0.67301065",
"0.67265725",
"0.6718134",
"0.6717789",
"0.67022246",
"0.6615979",
"0.6575237",
"0.6573485",
"0.6569661",
"0.6569661",
"0.6569661",
"0.6569661",
"0.6569661",
"0.6569661",
"0.6569054... | 0.0 | -1 |
/ Gets the error generated by the validation method. | public function getError()
{
return $this->err;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getValidationFailed();",
"public function validAndGetErrorMsg() {\r\n require_once 'Samus/Samus_CRUD/Samus_CRUD_RequestValidator.php';\r\n $req = new Samus_CRUD_RequestValidator($this->object);\r\n $req->init();\r\n return $req->result();\r\n }",
"public function ... | [
"0.79085577",
"0.78873736",
"0.76370144",
"0.76370144",
"0.76370144",
"0.7602829",
"0.7602829",
"0.7602829",
"0.7598822",
"0.7597429",
"0.7596064",
"0.7587656",
"0.7587656",
"0.7587656",
"0.7587489",
"0.7587489",
"0.7587489",
"0.7587489",
"0.7587489",
"0.7587489",
"0.7587489"... | 0.7417952 | 59 |
Store a newly created resource in storage. | public function store(Request $request, Product $product, User $buyer)
{
$rules = [
'quantity' => 'required|integer|min:1'
];
$this->validate($request, $rules);
if($buyer->id == $product->seller_id){
return $this->errorResponse('El comprador y el vendedor no pueden ser el mismo', Response::HTTP_UNPROCESSABLE_ENTITY);
}
if(!$buyer->esVerificado()){
return $this->errorResponse('El comprador no ha sido verificado', Response::HTTP_UNPROCESSABLE_ENTITY);
}
// dd($product->seller);
if(!$product->seller->esVerificado()){
return $this->errorResponse('El vendedor no ha sido verificado', Response::HTTP_UNPROCESSABLE_ENTITY);
}
if(!$product->esDisponible()){
return $this->errorResponse('El producto no está disponible', Response::HTTP_UNPROCESSABLE_ENTITY);
}
if($product->quantity < $request->quantity){
return $this->errorResponse('La cantidad de producto no es suficiente', Response::HTTP_UNPROCESSABLE_ENTITY);
}
return DB::transaction(function() use ($request, $product, $buyer) {
$product->quantity -= $request->quantity;
$product->save();
$transaction = Transaction::create([
'quantity' => $request->quantity,
'buyer_id' => $buyer->id,
'product_id' => $product->id
]);
return $this->showOne($transaction, Response::HTTP_CREATED);
});
} | {
"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.7285922",
"0.714503",
"0.71324795",
"0.6639801",
"0.6620405",
"0.6568167",
"0.65257645",
"0.650948",
"0.64484984",
"0.6375281",
"0.6373189",
"0.63650924",
"0.63650924",
"0.63650924",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",... | 0.0 | -1 |
Bypass if authentication is not required | public function call()
{
if (false === $this->shouldAuthenticate()) {
return $this->next->call();
}
$app = \Slim\Slim::getInstance(getenv('APP_NAME'));
$app->hook('slim.before.dispatch', function() use ($app)
{
$resource = $app->router()->getCurrentRoute()->getName();
$permission = $app->request->getMethod();
$auth = $app->auth;
$acl = $app->acl;
if (!$auth->hasIdentity()) {
return $app->redirectTo('intranet.login');
}
$identity = $auth->getIdentity();
$app->view()->getInstance()->addGlobal('identity', $identity);
if (!$acl->isAllowed($identity['role'], $resource, $permission)) {
return $app->redirectTo('intranet.unauthorized');
}
});
$this->next->call();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function requiresAuthentication() {\n return false;\n }",
"public function authenticate() { return false; }",
"protected function loginIfRequested() {}",
"public static function forceAuthentication() {\n\t\tif (!self::authenticated()) {\n\t\t\tself::redirectToLogin();\n\t\t}\n\t}",
"public funct... | [
"0.73726463",
"0.73420566",
"0.73229694",
"0.6895796",
"0.6864355",
"0.68610966",
"0.68545777",
"0.680227",
"0.6788091",
"0.67189884",
"0.67095715",
"0.6701655",
"0.6629694",
"0.6602682",
"0.6596859",
"0.6585494",
"0.65160054",
"0.6483137",
"0.64804476",
"0.6450043",
"0.64321... | 0.0 | -1 |
get suggest list product | public function getSuggestList($limit, $offset = 0, $categoryId = null)
{
return $this->model->getSuggestList($limit, $offset, $categoryId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function suggest()\n\t{\n\t\tsession_write_close();\n\t\t$suggestions = $this->Item_products->get_search_suggestions($this->input->get('term'),100);\n\t\techo json_encode($suggestions);\n\t}",
"function suggest()\n {\n // allow parallel searchs to improve performance.\n session_write_close();\n ... | [
"0.73384386",
"0.6899764",
"0.6869235",
"0.6773637",
"0.67297345",
"0.6727956",
"0.6720789",
"0.67138535",
"0.67121",
"0.6626844",
"0.65645105",
"0.64216655",
"0.6418241",
"0.63394344",
"0.6332352",
"0.6324489",
"0.63177526",
"0.6299369",
"0.628603",
"0.6263348",
"0.621229",
... | 0.0 | -1 |
Run the database seeds. | public function run()
{
DB::table('users')->insert([
[
'name' => 'Administrator',
'username' => 'admin',
'NIP' => '-',
'password' => Hash::make('sokadmin'),
'role_id' => 2
],[
'name' => 'Kaprodi',
'username' => 'kaprodi',
'NIP' => '-',
'password' => Hash::make('sokkaprodi'),
'role_id' => 3
],[
'name' => 'Prof. Drs. Ec. Ir. Riyanarto Sarno, M.Sc Ph.D',
'username' => '195908031986011001',
'NIP' => '195908031986011001',
'password' => Hash::make('195908031986011001'),
'role_id' => 1
],[
'name' => 'Prof.Ir. Supeno Djanali, M.Sc., Ph.D',
'username' => '194806191973011001',
'NIP' => '194806191973011001',
'password' => Hash::make('194806191973011001'),
'role_id' => 1
],[
'name' => 'Prof.Ir. Handayani Tjandrasa, M.Sc., Ph.D',
'username' => '194908231976032001',
'NIP' => '194908231976032001',
'password' => Hash::make('194908231976032001'),
'role_id' => 1
],[
'name' => 'Prof.Dr.Ir.Joko Lianto Buliali, M.Sc., Ph.D.',
'username' => '196707271992031002',
'NIP' => '196707271992031002',
'password' => Hash::make('196707271992031002'),
'role_id' => 1
],[
'name' => 'Dr. Agus Zainal Arifin, S.Kom., M.Kom.',
'username' => '197208091995121001',
'NIP' => '197208091995121001',
'password' => Hash::make('197208091995121001'),
'role_id' => 1
],[
'name' => 'Dr.Eng. Nanik Suciati, S.Kom., M.Kom.',
'username' => '197104281994122001',
'NIP' => '197104281994122001',
'password' => Hash::make('197104281994122001'),
'role_id' => 1
],[
'name' => 'Daniel Oranova Siahaan, S.Kom., M.Sc., PDEng',
'username' => '197411232006041001',
'NIP' => '197411232006041001',
'password' => Hash::make('197411232006041001'),
'role_id' => 1
],[
'name' => 'Mahendrawathi ER, S.T., M.Sc., Ph.D',
'username' => '197610112006042001',
'NIP' => '197610112006042001',
'password' => Hash::make('197610112006042001'),
'role_id' => 1
],[
'name' => 'Ir. Siti Rochimah, M.T., Ph.D.',
'username' => '196810021994032001',
'NIP' => '196810021994032001',
'password' => Hash::make('196810021994032001'),
'role_id' => 1
],[
'name' => 'Dr.tech.Ir. Raden Venantius Hari Ginardi, M.Sc.',
'username' => '196505181992031003',
'NIP' => '196505181992031003',
'password' => Hash::make('196505181992031003'),
'role_id' => 1
],[
'name' => 'Wahyu Saudi, S.Kom., M.M., M.Kom',
'username' => '197110302002121001',
'NIP' => '197110302002121001',
'password' => Hash::make('197110302002121001'),
'role_id' => 1
],[
'name' => 'Victor Hariadi, S.Si., M.Kom',
'username' => '196912281994121001',
'NIP' => '196912281994121001',
'password' => Hash::make('196912281994121001'),
'role_id' => 1
],[
'name' => 'Dwi Sunaryono, S.Kom., M.Kom',
'username' => '197205281997021001',
'NIP' => '197205281997021001',
'password' => Hash::make('197205281997021001'),
'role_id' => 1
],[
'name' => 'Umi Laili Yuhana,S.Kom., M.Sc',
'username' => '197906262005012002',
'NIP' => '197906262005012002',
'password' => Hash::make('197906262005012002'),
'role_id' => 1
],[
'name' => 'Tohari Ahmad, S.Kom., MIT., Ph.D',
'username' => '197505252003121002',
'NIP' => '197505252003121002',
'password' => Hash::make('197505252003121002'),
'role_id' => 1
],[
'name' => 'Dr. Royyana Muslim Ijtihadie, S.Kom., M.Kom.',
'username' => '197708242003041001',
'NIP' => '197708242003041001',
'password' => Hash::make('197708242003041001'),
'role_id' => 1
],[
'name' => 'Feby Artowodini Muqtadiroh,S.Kom,MT.',
'username' => '198302232009122002',
'NIP' => '198302232009122002',
'password' => Hash::make('198302232009122002'),
'role_id' => 1
],[
'name' => 'Waskitho Wibisono, S.Kom., M.Eng., Ph.D',
'username' => '197410222000031001',
'NIP' => '197410222000031001',
'password' => Hash::make('197410222000031001'),
'role_id' => 1
],[
'name' => 'Anny Yuniarti, S.Kom., M.Comp.Sc',
'username' => '198106222005012002',
'NIP' => '198106222005012002',
'password' => Hash::make('198106222005012002'),
'role_id' => 1
],[
'name' => 'Ir. Muchammad Husni, M.Kom',
'username' => '196002211984031001',
'NIP' => '196002211984031001',
'password' => Hash::make('196002211984031001'),
'role_id' => 1
],[
'name' => 'Dr. Chastine Fatichah, S.Kom., M.Kom.',
'username' => '197512202001122002',
'NIP' => '197512202001122002',
'password' => Hash::make('197512202001122002'),
'role_id' => 1
],[
'name' => 'Ary Mazharuddin Shiddiqi, S.Kom., M.Comp.Sc',
'username' => '198106202005012001',
'NIP' => '198106202005012001',
'password' => Hash::make('198106202005012001'),
'role_id' => 1
],[
'name' => 'Ahmad Saikhu, S.SI., MT.',
'username' => '197107182006041001',
'NIP' => '197107182006041001',
'password' => Hash::make('197107182006041001'),
'role_id' => 1
],[
'name' => 'Dr.Eng. Darlis Herumurti, S.Kom., M.Kom.',
'username' => '197712172003121001',
'NIP' => '197712172003121001',
'password' => Hash::make('197712172003121001'),
'role_id' => 1
],[
'name' => 'Dr. Radityo Anggoro, S.Kom., M.Sc',
'username' => '198410162008121002',
'NIP' => '198410162008121002',
'password' => Hash::make('198410162008121002'),
'role_id' => 1
],[
'name' => 'Imam Kuswardayan, S.Kom., MT.',
'username' => '197612152003121001',
'NIP' => '197612152003121001',
'password' => Hash::make('197612152003121001'),
'role_id' => 1
],[
'name' => 'Bilqis Amaliah, S.Kom., M.Kom',
'username' => '197509142001122002',
'NIP' => '197509142001122002',
'password' => Hash::make('197509142001122002'),
'role_id' => 1
],[
'name' => 'Yudhi Purwananto, S.Kom., M.Kom.',
'username' => '197007141997031002',
'NIP' => '197007141997031002',
'password' => Hash::make('197007141997031002'),
'role_id' => 1
],[
'name' => 'Isye Arieshanti, S.Kom., M.Phil',
'username' => '197804122006042001',
'NIP' => '197804122006042001',
'password' => Hash::make('197804122006042001'),
'role_id' => 1
],[
'name' => 'Diana Purwitasari, S.Kom., M.Sc',
'username' => '197804102003122001',
'NIP' => '197804102003122001',
'password' => Hash::make('197804102003122001'),
'role_id' => 1
],[
'name' => 'Sarwosri, S.Kom., MT.',
'username' => '197608092001122001',
'NIP' => '197608092001122001',
'password' => Hash::make('197608092001122001'),
'role_id' => 1
],[
'name' => 'Misbakhul Munir Irfan Subakti, S.Kom., M.Sc.',
'username' => '197402092002121001',
'NIP' => '197402092002121001',
'password' => Hash::make('197402092002121001'),
'role_id' => 1
],[
'name' => 'Fajar Baskoro, S.Kom., MT.',
'username' => '197404031999031002',
'NIP' => '197404031999031002',
'password' => Hash::make('197404031999031002'),
'role_id' => 1
],[
'name' => 'Ahmad Muklason,S.Kom.,M.Sc.',
'username' => '198203022009121009',
'NIP' => '198203022009121009',
'password' => Hash::make('198203022009121009'),
'role_id' => 1
],[
'name' => 'Ir. F.X. Arunanto. M.Sc',
'username' => '195701011983031004',
'NIP' => '195701011983031004',
'password' => Hash::make('195701011983031004'),
'role_id' => 1
],[
'name' => 'Sholiq,ST.,MT.',
'username' => '197103132009121001',
'NIP' => '197103132009121001',
'password' => Hash::make('197103132009121001'),
'role_id' => 1
],[
'name' => 'Apol Pribadi Subriadi, ST.,MT.',
'username' => '197002252009121001',
'NIP' => '197002252009121001',
'password' => Hash::make('197002252009121001'),
'role_id' => 1
],[
'name' => 'Arif Bramantoro, ST., MT.',
'username' => '197812112002121002',
'NIP' => '197812112002121002',
'password' => Hash::make('197812112002121002'),
'role_id' => 1
],[
'name' => 'Ir. Suhadi Lili',
'username' => '196907281993031001',
'NIP' => '196907281993031001',
'password' => Hash::make('196907281993031001'),
'role_id' => 1
],[
'name' => 'Ahmad Hoirul Basori, S.Kom.',
'username' => '198211152006041003',
'NIP' => '198211152006041003',
'password' => Hash::make('198211152006041003'),
'role_id' => 1
],[
'name' => 'Henning Titi Ciptaningtyas, S.Kom., M.Kom.',
'username' => '198407082010122004',
'NIP' => '198407082010122004',
'password' => Hash::make('198407082010122004'),
'role_id' => 1
],[
'name' => 'Arya Yudhi Wijaya, S.Kom., M.Kom',
'username' => '198409042010121002',
'NIP' => '198409042010121002',
'password' => Hash::make('198409042010121002'),
'role_id' => 1
],[
'name' => 'Wijayanti Nurul Khotimah, S.Kom., M.Sc',
'username' => '198603122012122004',
'NIP' => '198603122012122004',
'password' => Hash::make('198603122012122004'),
'role_id' => 1
],[
'name' => 'Rizky Januar Akbar, S.Kom., M.Eng.',
'username' => '198701032014041001',
'NIP' => '198701032014041001',
'password' => Hash::make('198701032014041001'),
'role_id' => 1
],[
'name' => 'Ratih Nur Esti Anggraini, S.Kom., M.Sc.',
'username' => '198412102014042003',
'NIP' => '198412102014042003',
'password' => Hash::make('198412102014042003'),
'role_id' => 1
],[
'name' => 'Ridho Rahman Hariadi, S.Kom., M.Sc.',
'username' => '198702132014041001',
'NIP' => '198702132014041001',
'password' => Hash::make('198702132014041001'),
'role_id' => 1
],[
'name' => 'Abdul Munif, S.Kom., M.Sc.',
'username' => '198608232015041004',
'NIP' => '198608232015041004',
'password' => Hash::make('198608232015041004'),
'role_id' => 1
],[
'name' => 'Rully Sulaiman, S.Kom.,M.Kom.',
'username' => '197002131994021001',
'NIP' => '197002131994021001',
'password' => Hash::make('197002131994021001'),
'role_id' => 1
],[
'name' => 'Dini Adni Navastara, S.Kom., M.Sc',
'username' => '198610172015042001',
'NIP' => '198610172015042001',
'password' => Hash::make('198610172015042001'),
'role_id' => 1
],[
'name' => 'Baskoro Adi Pratomo, S.Kom., M.Kom',
'username' => '198702182014041001',
'NIP' => '198702182014041001',
'password' => Hash::make('198702182014041001'),
'role_id' => 1
],[
'name' => 'Hudan Studiawan, S.Kom., M.Kom.',
'username' => '198705112012121003',
'NIP' => '198705112012121003',
'password' => Hash::make('198705112012121003'),
'role_id' => 1
],[
'name' => 'Adhatus Solichah Ahmadiyah, S.Kom., M.Sc',
'username' => '198508262015042002',
'NIP' => '198508262015042002',
'password' => Hash::make('198508262015042002'),
'role_id' => 1
],[
'name' => 'Nurul Fajrin Ariani, S.Kom., M.Sc.',
'username' => '198607222015042003',
'NIP' => '198607222015042003',
'password' => Hash::make('198607222015042003'),
'role_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.8013876",
"0.79804534",
"0.7976992",
"0.79542726",
"0.79511505",
"0.7949612",
"0.794459",
"0.7942486",
"0.7938189",
"0.79368967",
"0.79337025",
"0.78924936",
"0.78811055",
"0.78790957",
"0.78787595",
"0.787547",
"0.7871811",
"0.78701615",
"0.7851422",
"0.7850352",
"0.78414... | 0.0 | -1 |
Check if overview files and module activities has value | public function isModulesReady(Course $course)
{
if ($course->modules->where('is_overview', 1)->isEmpty() || $this->getNoOfActivities($course) === 0) {
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isActivity() {\n\t\treturn $this->repoObj->lobType == 'activity';\n\t}",
"public function hasExperimentInfos(){\n return $this->_has(2);\n }",
"function usp_ews_check_activity_setting($configmonitoreddata, $courseid, $modules){\n\n\tglobal $DB;\n\t\n\t$dbmanager = $DB->get_manager(); // loads ... | [
"0.56601524",
"0.562251",
"0.55698764",
"0.5406959",
"0.54017127",
"0.53426015",
"0.5328145",
"0.5305146",
"0.52707255",
"0.5270139",
"0.5253192",
"0.522312",
"0.52072424",
"0.5192396",
"0.5192114",
"0.5175076",
"0.5128811",
"0.5126968",
"0.51202744",
"0.5104638",
"0.5076102"... | 0.4831083 | 65 |
Returns an collection of items for a page. | public function getItems($offset, $itemCountPerPage)
{
$entries = Doctrine_Query::create()
->from('Zfplanet_Model_Entry')
->orderBy('publishedDate DESC')
->limit($itemCountPerPage)
->offset($offset)
->execute();
return $entries;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPageItems()\n {\n }",
"public function getList($page);",
"public function getPageItems() {\r\n\t\treturn $this->__pageItems;\r\n\t}",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function getItems();",
"public function g... | [
"0.73115045",
"0.7199129",
"0.6982969",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6812391",
"0.6783462",
"0.6591818",
"0.6591818",
"0.6564522",
"0.6553492",
... | 0.0 | -1 |
Returns the total number of rows in the collection. | public function count()
{
$count = Doctrine_Query::create()
->select('COUNT(id) as total')
->from('Zfplanet_Model_Entry')
->fetchone();
return $count->total;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function count()\n {\n return count($this->_rows);\n }",
"public function getNumberOfRows()\r\n {\r\n return count($this->data);\r\n }",
"public function countRows()\n {\n return count($this->rows);\n }",
"public function count() {\n return count($this->__... | [
"0.81546694",
"0.8141833",
"0.8120072",
"0.80941343",
"0.8087115",
"0.8062587",
"0.8059919",
"0.7985744",
"0.7975975",
"0.7967798",
"0.79122126",
"0.79096085",
"0.790677",
"0.79014206",
"0.79014206",
"0.789478",
"0.7892104",
"0.78877735",
"0.78777176",
"0.7868898",
"0.786682"... | 0.0 | -1 |
Execute all runonce files in module config directories | public function run()
{
$this->upgrade_to_1_1_0();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function run_init_scripts() {\n foreach (self::$_roots as $module_name => $root_path) {\n if (file_exists($fname =\n ($root_path . self::MODULE_BOOTSTRAP_FILE))) {\n include $fname;\n }\n }\n }",
"public function runModules()... | [
"0.6575087",
"0.62000906",
"0.6194606",
"0.61612505",
"0.60497",
"0.59930634",
"0.5966905",
"0.5893327",
"0.5873614",
"0.581501",
"0.5800831",
"0.57808274",
"0.5764223",
"0.5734841",
"0.56934994",
"0.5679971",
"0.5662041",
"0.5630095",
"0.5623525",
"0.5583241",
"0.5555752",
... | 0.0 | -1 |
Carga los campos desde db | public function load($id){
$req=$this->db()->query("SELECT * FROM idea JOIN categorias
on (idea.id_categoria=categorias.id_categoria)
JOIN usuario on (usuario.id_correo = idea.id_correo)
WHERE idea.id_idea = ".$id." GROUP BY idea.id_idea");
if($req==false)
throw new Exception('MySQL: Error al cargar la idea');
$filas = $this->showData($req);
$this->setId_idea($filas[0]['id_idea']);
$this->setNombre_Idea($filas[0]['nombre_idea']);
$this->setId_categoria($filas[0]['id_categoria']);
$this->setFecha_limite($filas[0]['fecha_limite']);
$this->setDesc_idea($filas[0]['desc_idea']);
$this->setEnVenta($filas[0]['enVenta']);
$this->setId_correo($filas[0]['id_correo']);
$this->setImporte_venta($filas[0]['importe_venta']);
$this->setCv_equipo($filas[0]['cv_equipo']);
$this->setImporte_Solicitado($filas[0]['importe_solicitado']);
$this->setImagen($filas[0]['imagen']);
$this->setCategoria($filas[0]['valor']);
$this->setNombreUsu($filas[0]['nombre']);
$this->setDiasFin($this->diffFechas($this->getFecha_Limite()));
$this->loadRecaudado();
$this->loadPopularidad();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function camposBD(){\n//\t\tSELECT idFactura, nombreTienda AS tienda, fecha, numfactura AS Factura FROM tblfacturas \n//\t\tINNER JOIN tbltiendas ON tbltiendas.idtblTienda = tblfacturas.idtblTienda\n\t\t$fields = array();\n\t\t$fields[] = 'idFactura';\t\n\t\t$fields[] = 'fecha';\t\n\t\t$fields[] = 'tienda';\t\n\t\... | [
"0.6947466",
"0.66658026",
"0.6479266",
"0.63830566",
"0.630348",
"0.62740916",
"0.6259464",
"0.6240629",
"0.6193093",
"0.618637",
"0.61638695",
"0.61525714",
"0.6143584",
"0.61424536",
"0.6117064",
"0.60997313",
"0.6096213",
"0.604814",
"0.59918755",
"0.595419",
"0.5934333",... | 0.0 | -1 |
Inserta los datos en la db | public function setIdea(){
$query="INSERT INTO idea (nombre_idea, id_categoria, fecha_limite, desc_idea, enVenta, id_correo, importe_venta, cv_equipo, importe_solicitado, imagen)
VALUES('".$this->getNombre_Idea()."',
'".$this->getId_Categoria()."',
'".$this->getFecha_Limite()."',
'".$this->getDesc_idea()."',
'".$this->getEnVenta()."',
'".$this->getId_Correo()."',
'".$this->getImporte_Venta()."',
'".$this->getCv_Equipo()."',
'".$this->getImporte_solicitado()."',
'".$this->getImagen()."');";
if($this->db()->query($query) == false)
throw new Exception('MySQL: Error al realizar la inserción SQL. setIdea()');
$query="UPDATE idea SET enVenta = NULL WHERE idea.enVenta=0";
if($this->db()->query($query) == false)
throw new Exception('MySQL: Error al realizar la inserción SQL. Update');
$query="UPDATE idea SET importe_venta = NULL WHERE idea.importe_venta=0";
if($this->db()->query($query) == false)
throw new Exception('MySQL: Error al realizar la inserción SQL. Update');
//Consigue el ID de la BBDD
$query = $this->getBy('nombre_idea', $this->getNombre_Idea());
$this->setId_idea($query[0]['id_idea']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function insert() {\n $conexion = StorianDB::connectDB();\n $insercion = \"INSERT INTO cuento (titulo, contenido, autor) VALUES (\\\"\".$this->titulo.\"\\\", \\\"\".$this->contenido.\"\\\", \\\"\".$this->autor.\"\\\")\";\n $conexion->exec($insercion);\n }",
"public function insertD... | [
"0.73764616",
"0.7310832",
"0.7171039",
"0.7148388",
"0.7098001",
"0.70854694",
"0.70723313",
"0.7062839",
"0.70349985",
"0.6960343",
"0.6944691",
"0.6932344",
"0.69030565",
"0.68867105",
"0.68710804",
"0.6865734",
"0.68537337",
"0.6830176",
"0.68171525",
"0.68063366",
"0.680... | 0.0 | -1 |
Setter for Id. This is the only Id we allow to be set manually, as we use the one from the ESP board. | public function setId($id)
{
$this->id = $id;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SetId($value) { $this->id=$value; }",
"public function updateId() {\n $this->Id = session_id();\n }",
"function setId($value) {\n $this->_id = intval($value);\n }",
"public function setId()\n\t{\n\t}",
"public function setId($x) { $this->id = $x; }",
"public function ... | [
"0.76595205",
"0.69730693",
"0.6950831",
"0.69189614",
"0.68374735",
"0.6822702",
"0.68183273",
"0.6782295",
"0.6763848",
"0.67638075",
"0.6745041",
"0.6737561",
"0.67334545",
"0.6723596",
"0.6711666",
"0.6711666",
"0.6692713",
"0.66814744",
"0.6679587",
"0.66738033",
"0.6665... | 0.0 | -1 |
generate new user emails checks for generic password | public function generate_new_passwords() {
// all users added with "password" will be automatically sent a welcome message
// and new password
$resetpassword = 'password';
// get users
$user_list = $this->get_user->get_all_users();
// go through users
foreach($user_list as $user) {
// check if password is "password"
$user_id = $user->user_id;
if ($this->get_user->check_password($user_id, $resetpassword) == 1) {
// generate simple random password
$newpassword = uniqid();
// write new password to database
$data = array(
'password' => $newpassword
);
$this->get_user->update('user_id', $user_id, $data);
// email user new password
$this->send_password_mail($user_id, $newpassword);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function generateNewPassword($mail);",
"static function password_expired_email() {\n $model = \\Auth::$model;\n $user = $model::requested();\n\n if (!$user->nil()) {\n if ($user->validate()) {\n\n password_expired_email($user) ?\n ... | [
"0.709545",
"0.68329805",
"0.67693996",
"0.6749227",
"0.66979414",
"0.6665304",
"0.66307354",
"0.656412",
"0.64873266",
"0.6419626",
"0.6404173",
"0.6376843",
"0.6341731",
"0.6314451",
"0.62974715",
"0.6284961",
"0.6277273",
"0.62592727",
"0.62543994",
"0.6230435",
"0.62228",... | 0.739786 | 0 |
iterate through users and if no role exists then set to none | public function check_access_type() {
// get users
$user_list = $this->get_user->get_all_users();
// check user is in access table
foreach($user_list as $user) {
// check if user exists
$user_access = $this->get_user->user_level($user->user_id);
// inserts new user into table
if ($user_access == NULL && $user_access == '') {
$this->get_user->insert_access($user->user_id,'student');
}
// generates new password if default value of 'password' is found
$this->generate_new_passwords();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wp_get_users_with_no_role($site_id = \\null)\n {\n }",
"function wporphanageex_adopt_all_orphans() {\n\tforeach ( wporphanageex_get_all_users() as $user_id ) {\n\t\t$user = new WP_User( $user_id );\n\t\tif ( ! user_can( $user_id, 'read' ) ) {\n\t\t\t$user->set_role( wporphanageex_search_user_role(... | [
"0.6636881",
"0.63854456",
"0.6010978",
"0.5876335",
"0.58606595",
"0.58605295",
"0.57766813",
"0.5773733",
"0.5769813",
"0.57535785",
"0.57119465",
"0.5678119",
"0.5629089",
"0.56255156",
"0.5602651",
"0.55890536",
"0.55696434",
"0.5567759",
"0.55439055",
"0.55392283",
"0.55... | 0.0 | -1 |
checks that the table column count matches the data | public function check_import_match($table_name, $text_line) {
$error = 0;
$arr = explode(",",$text_line);
$string_count = sizeof($arr);
$cols = $this->data_driver->get_column_count($table_name);
if ($cols != FALSE) {
$col_count = sizeof($cols);
}
else
{
$error = "Table name doesn't exist";
return $error;
}
if ($string_count == $col_count) {
return $error;
}
else
{
$error = "Column count does not match. Check selection or data format";
return $error;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ae_check_db_fields( ) {\n\n $count = 0;\n $cols = ae_get_db_fields();\n $foo = ae_db_queries();\n if( $cols ){\n foreach($cols as $col) {\n\n if( isset($foo[$col->COLUMN_NAME]) ) {\n\n if(\n $col->DATA_TYPE != $foo[$col->COLUMN_NAME]['type'] ... | [
"0.72854537",
"0.6850018",
"0.67990756",
"0.6696057",
"0.66153663",
"0.6521014",
"0.64371336",
"0.64166206",
"0.63804793",
"0.63425076",
"0.6285483",
"0.6272128",
"0.622768",
"0.6225625",
"0.6211134",
"0.6204711",
"0.6189118",
"0.6157521",
"0.61515105",
"0.6146612",
"0.612834... | 0.63453245 | 9 |
read a text file and load the database | public function process_file() {
//
$done = false;
$error = '';
//
$filelist = directory_map('/var/lib/mysql-files/uploads/', 1);
//
// returns the table selected in the drop down
//
$table_name = $this->input->post('tablename');
//
// returns the array position of the selected item on the
// dropdown list
$fileno = $this->input->post('filename');
//
// get text as an array of strings, the dropdown returns a number
//
$textarray = $this->read_text($filelist[$fileno]);
//
// gets the first line of the text file
//
$text_line = $textarray[0];
//
$return_value = $this->check_import_match($table_name, $text_line);
//
// get list of table columns
//
$filepath = '/var/lib/mysql-files/uploads/'.$filelist[$fileno];
//
// loads a list of table names into an array
//
$tables = $this->load_table_names();
// send back to import page with message
if ($return_value === 0) {
$this->data_driver->load_data($table_name, $filepath);
//
$message = 'Your data has been successfully imported';
// this checks that new users have a role assigned
$this->check_access_type();
}
else
{
$message = $return_value;
}
// call page
$this->call_page($tables, $filelist, $message);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function loadTextFile($text_file)\n {\n try {\n TextFileValidator::textFile($text_file);\n $file = fopen($text_file, \"r\") or die(\"Unable to open file!\");\n while (!feof($file)) {\n $line = fgets($file);\n $this->addLine($line);\n ... | [
"0.6579144",
"0.65604305",
"0.6471807",
"0.6206675",
"0.6129278",
"0.5933081",
"0.59056747",
"0.5866924",
"0.5866924",
"0.5866924",
"0.5809635",
"0.5785229",
"0.5778364",
"0.5771357",
"0.5770827",
"0.5719143",
"0.5713884",
"0.56911826",
"0.56901693",
"0.566998",
"0.56670684",... | 0.0 | -1 |
main function that gets a list of database tables and sends to view | function index() {
//
// initialize email settings
//
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['mailtype'] = 'html';
$config['wordwrap'] = TRUE;
//
$this->email->initialize($config);
//
// gets a list of files in the uploads directory
//
$files = directory_map('/var/lib/mysql-files/uploads/', 1);
//
// get all the table names from the database
// $tables = $this->data_driver->get_tables();
//
// set tables
//
$tables = $this->load_table_names();
//
// this sends data to the drop down lists
//
$message = 'Import Data Utility';
if ($files == FALSE) {
echo anchor('pages', 'Home', 'title="Home"');
echo '<br>';
echo "There are currently no files in the upload directory";
}
else
{
// initial call the the view
$this->call_page($tables, $files, $message);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function _listTables();",
"public function admin_get_tables() {}",
"public function admin_get_tables() {}",
"function listTables();",
"public function getListOfTables() {}",
"protected function getDatabaseTables() {}",
"abstract public function getTables();",
"public function list_... | [
"0.7404853",
"0.7286365",
"0.72856826",
"0.7145066",
"0.71086264",
"0.70602745",
"0.6997653",
"0.69940615",
"0.6967469",
"0.6967469",
"0.6967469",
"0.6914595",
"0.6842169",
"0.68078417",
"0.67902386",
"0.67753017",
"0.67710227",
"0.6761959",
"0.67216396",
"0.6718599",
"0.6706... | 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.